Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

That would be a good thing. Put some light on one of the biggest failure of our democracies.


Github answers 404 instead of a 403 when you try to access a private repository while not being logged in.

I assume the rational is to not leak information about what's private. But still, it's weird.


AWS S3 does the opposite when querying objects that don't exist. If you don't have s3:ListObjects permissions on the bucket you'll get a 403 error (you can't differentiate between the object not existing vs. you don't have access to it).

I think either approach is valid as long as you're consistent. You can make a case for either 404 or 403 when you don't have enough permissions. In GitHub's case you can argue that it's a 404 because the resource does indeed not exist through your auth context. In AWS' case you can argue that a 403 makes sense because you don't have permission to know the answer to your query.


That's exactly correct and has been generally the best practices guidance for decades now.


From the article:

> The message to me as a maintainer is quite clear: once a project achieved criticality, then the index wants to exercise a certain amount of control

I don't think that's the definition of control. Pypi gains no power with this, only more work.

And 2FA is really not a big deal.

> One could imagine that an index would like to enforce cryptographic signing of newly released packages.

Yes. Please yes.

Letsencrypt was a boon to the web.

Having a quick way to sign your package to send it so pypi would be a great thing.

This is a long article over nothing.


2FA is a pain in the ass and provides minimal extra security. The reason why companies employ it is because their users are incompetent and will install malware on their desktop OS, so they shift the burden of security to locked-down mobile operating systems like Android and iOS.

If an experienced user does not want to use 2FA, they will run the 2FA app in a virtual machine and automate it. You can't force them to 2FA but you can inconvenience them and tie them down to a phone number, SMS, or locked-down hardware (through remote attestation).

>Letsencrypt was a boon to the web.

Letsencrypt and the existing PKI structure just forces everyone's eggs into a single basket, Ripe for exploitation from the government.


In this particular case, Pypi is giving away hardware security key.

I have 3 of them, it is secure and convenient.


With root certificates, gov already have complete ability to MITM your https connection.


> Having a quick way to sign your package to send it so pypi would be a great thing.

I guess we just need to make signing easy then.

Which remains a hard problem.


We've been working with PyPI to help integrate Sigstore, which makes signing (and verification) easier!

sigstore.dev


I'll have to check out sigstore.

Anything that makes signing/verifying easier is a welcome change.


What, exactly, is hard about signing?


We used to say that about https, and now we got letsencrypt.


LE made SSL/TLS easy, we need something similar for sign/verify of packages/software.

Another commenter mentioned sigstore.dev which looks potentially interesting.


And here is where Django and RoR shine. With their very rich, and above all, well integrated ecosystem, we have had plugins to do all this with a few settings for years.

That's where "libs over frameworks" doesn't pay.

And you don't have to delegate your sign in to a third party, share user data, get locked in, or have all the problems associated with having some part of your stack as a service, micro or not.


It’s more complicated than that. Delegating identity to another party also delegates some amount of risk to them.

It allows you to focus on trusting the identity and not worrying as much about someone stealing credentials etc.

Also presumably that other party has a security team constantly monitoring and securing things.


8ft is 2.4m, it's not that long, it's the lenght of a small car. With current modern resolutions and zooms, you can even read the name of cops on their plaque from that distance.

I don't think it's going to prevent much recording. In fact, the recording are probably be of much more quality: instead of close ups that doesn't show much actions, we will see the a bigger context. Most useful videos are from at least 8 ft away.

I understand the author of the law doesn't have a great background in the US and cops have terrible reputation in this country. So it's probable there is an abuse path I don't see here.

But if I haven't been given that context, the law would not have seen excessive: in a law enforcement context, you don't want every body to park too close to the hot spot. Also, there is this annoying tendency of people with a camera to put it in your face, or to not mind their surrounding.

Given an arrest can be tensed, 8ft sound like it make sense. What am I missing, as a French person not understanding all the weird american social details ?


It's not so much the specific distance as the limitation and illegal "zone" that now exists around officers, a moving target for when you can suddenly ve performing something illegal that wasn't illegal a few centimeters ago. A cop leaning a bit or just shifting their weight is enough to make you a criminal.

The main reason there is such concern over this is because the power and corruption in many police forces and a lack of accountability for misbehavior of police, combined with the silliness of such a concept of no recording zone that now surrounds officers.

The issue isn't about how practical it is to record a police officer, it's that rather than address institutional corruption and misbehavior, there is a very vague law with ridiculous premises invented that gives police the ability to issue fines and arrests. Proof of misbehavior can be confiscated by a sudden movement by any police officer. It's a very strange power to give police officers.


If you are able to position yourself at a safe distance down to the centimeter, you probably also have the super power to move when the officer shifts weight.

The easy solution is to post up at 15 feet and vigilantly adapt. If you are filming an intense arrest, I would hope you would maintain that sort of situational awareness anyway.

I certainly understand your concerns about abuse of power. However, giving officers room to do their job is not “very strange” nor is the premise “ridiculous.” Indeed, moving bystanders back to a reasonable distance might reduce tension and the likelihood of misbehavior


I appreciate what I assume is a good faith attempt to read this law, but the law isn't about giving the officers room to safely operate. If that were the case, it would not cite _recording the officers_ as the illegal action, it would just define a minimum perimeter of non-interference.

> However, giving officers room to do their job is not “very strange” nor is the premise “ridiculous.” Indeed, moving bystanders back to a reasonable distance might reduce tension and the likelihood of misbehavior

As the law is written and the language of the law specifically acting on _making a video recording_, and nothing else:

IT IS UNLAWFUL FOR A PERSON TO KNOWINGLY MAKE A VIDEO RECORDING 7 OF LAW ENFORCEMENT ACTIVITY IF THE PERSON MAKING THE VIDEO RECORDING IS 8 WITHIN EIGHT FEET OF WHERE THE PERSON KNOWS OR REASONABLY SHOULD KNOW THAT 9 LAW ENFORCEMENT ACTIVITY IS OCCURRING,

https://www.azleg.gov/legtext/55leg/2R/bills/HB2319S.pdf

If this was about officer safety to operate, then it would just define it as such, but it goes out of its way to specifically forbid recording.

So I can do the following actions which are certainly disruptive to the police making an arrest without violating this law:

- Stop for a smoke next to an officer (presuming I am in one of the allowed places for smoking)

- Make out with someone in a publicly respectable way

- Busking of any kind

- Rollerskate/Skateboard as long as I am practicing reasonable safety

I think it's not easily contestable that these actions are _more_ disruptive to the police being engaged in an arrest, but the law has no concern about them as the focus of the law is exclusively recording. Other laws regarding arrests don't mention such a distance or rights for the officers. The point here is not some desire to interfere with arrests, it's that the premise of your statement that it's about officer safety and ability to perform doesn't pass scrutiny against the text of the law and other situations that would fall under the same concern, which are allowed.

I don't see a justification for this law except to allow police the right to fine/jail people recording them.

Edit: It may be suggested that laws should be concise and specific, and to a point I agree. However, such conciseness also means that the specific action meant to be prevented is much more clear. So I must stress, that even if the law is concise, this means that the focus is not on safety for police and bystanders, but specifically on recording the police. I'm not sure there is a logical interpretation any other way to suggest it's about safety to operate, because if it is, then the law is no longer concise and specific, it requires fairly roundabout inference to reach the spirit of the law.


You make a good point. If the law only forbids recording, then the officer safety justification is weaker.

I wonder if other Arizona laws already exist that address other activities within 8ft.


The issue is not the precise distance, but that police officers can arrest you for being too close.

Let's say you were 4m away and got arrested anyways. The officer stopped you from filming and it deterred others to start filming too.

Even if the charges get dropped later on (which they might not), the police already succeeded in stopping you from filming.


Once you are being arrested, you are no longer a bystander, so you may continue filming.

I understand your fear of the chilling effect this may have, but I would guess there will be just as many people who now feel empowered to say “This is my right. I’m 8 ft away.”


No, that is not the case.

> B. NOTWITHSTANDING SUBSECTION A OF THIS SECTION, A PERSON WHO IS 22 THE SUBJECT OF POLICE CONTACT MAY RECORD THE ENCOUNTER IF THE PERSON IS 23 NOT INTERFERING WITH LAWFUL POLICE ACTIONS,

The basis of being subject to this law is that you are interfering with police actions, and lawfulness can only be determined by the courts after the fact.

I don't think it's a foregone conclusion that you would be in your legal right to record the police if you were being arrested for violation of this law, and likely it's something that would need to be tested fairly considerably in court before a definite interpretation was set.

This is a really badly designed/defined law, and I would not rely on the guarantees of the law as being subject to it means it's already been determined you're interfering with police action.


>abuse path

The cop doesn't want you recording, moves closer to you, and arrests you.


Except that isn't what it is for. It's so when someone is being lawfully detained, you don't get 30 people circling the officer(s) shouting things and exciting one another, while recording and blocking view and the movement of officers.

It's purely a safety thing. You don't want random people close to you while you are dealing with something

These videos can be graphic:

- Here protestors drag an officer into the crowd and savagely beat him https://www.youtube.com/watch?v=Le07VPqBZ58

- https://www.youtube.com/watch?v=Sw3F91w6D78 here is a video of onlookers recording agitating one another, several of which are standing in the street and blocking police vehicles.

- https://www.youtube.com/watch?v=71wdrhKzuys here a man that had been harassing local businesses and patrons all day charges a guardsman (who's an off-duty police officer) and the crowd starts surrounding him, recording, shouting things, agitating, when another bystander jumps to the guardsman's defense and now you've got multiple hostile people getting more and more agitated while the guardsman waits for uniformed police to come take the guy that tried to assault him, tried to damage his car, was harassing others, etc.

- https://www.youtube.com/watch?v=H40vEOOs5z0 here are protestors, standing around filming each other, assaulting a motorcycle officer on his motorcycle as he tries to drive away from them

- https://www.youtube.com/watch?v=gvDwWSl-sVE here officers try to restrain a felon, in felony possession of a firearm, that had tried to assault officers while a felon unlawfully possessing a firearm, as people surrounded them to hold their phones as close to them as possible to take footage, then as 3 of them try to subdue the suspect that continued, while armed, to try and resist then has to escalate to non-lethal violence of gasp punching the guy to try to get him to submit. At 3:42 an onlooker throws a full trash can at the officers that are actively trying to handcuff an ARMED FELON that is fighting tooth and nail to escape.

- https://www.youtube.com/watch?v=sdFsumyHLXo guy on a roof of a business hops down, then retrieves a handgun and aims it at officers, the officers start issuing commands while a bystander walks into the officer's line of fire filming and occasionally shouting things (go to 4:20 and you can see them just right of 12 o'clock.)

Etc.

It's hard enough to deal with a life or death situation without an angry mob of people standing around shouting shoving their phone in your face.


You've got a lot of videos of people messing with cops. In any of them, did the fact that someone was recording, as opposed to any other crimes they may have committed, make the officers' job harder?

This law is much, much more about removing accountability than police safety.


You just posted videos of the police in an attempt to show why people shouldn't be able to film the police.


I feel like my dash cam could get me arrested if the cop approaches my car.


I think the law excludes the restriction when filming in a confined structure. I don’t know if a car qualifies, but as the intention is to prevent interference, it arguably could qualify.


Terrible landing page for an otherwise excellent tool.

It sets up JS transpiling and bundling for you in an easy way, then provide a server with pretty fast hot reload.

This solves 2 problems:

- the complicated js project stack is now simple to setup, unlike with webpack

- saving and seeing the result of your coding is now almost instant, unlike with CRA

It's a joy to use, given that it's from VueJS author, and I highly recommend it to anyone that has a lof of frontend to do.


I have been using parcel for web development because I thought webpack is very difficult to use. However, for my latest personal project, I tried webpack. To my surprise, I found webpack 5 much simpler to use then I thought it is (significantly easier than make or gradle, the complexity is not even on the same level). Everything pretty much worked out of box now. All I had to do was to copy the starting template for typescript from their website (~20 lines, half of which are open/closing brackets) and copy the setup for dev server. HMR, code splitting via dynamic imports, etc. all worked without any setup.


Webpack is probably fine for new or small projects. It's when you've been using it for a while, do anything complex, or worst of all your framework libraries update then you have to update Webpack which is a nightmare.

Ive had Webpack break more of my deploys than any other piece of software in the last 3 years.

Vite was basically a plug and play replacement (almost zero config) and I also got to drop Babel, so that meant replacing about 12 packages in my package.json and who knows how many in Yarn.lock (Mostly babel and webpack plugins) with 2 vite packages. It's much faster at builds and the chunking of small js files seemed more intelligent and better integrated with Vue.


Vite is incredibly fast compared to Webpack.

I didn't really know how much time I could have been saving, and I never even thought of Webpack as slow.


IIRC Vite wraps esbuild, which is written in Go and very fast.


You can use esbuild with webpack via esbuild-loader, but what makes Vite so fast is mainly the strategy of pre-bundling dependencies when running the dev server, this makes hot starts and hot reloads incredibly quick.


Vite is just a few lines, and it’s a much better experience than webpack


Last time I checked NPM the weekly downloads were still heavily slanted in favour of version 4. I wonder if that plays into perception of it.

At work, an engineer in a different team recently recommended we switch to Vite because it’s “so much faster”. Warm builds are 700ms with our very uninteresting Webpack 5 config. It’s hard to imagine that the cost of reconfiguring our entire build would be worth it.


> pretty fast hot reload

An understatement to be sure: you can set VS Code to auto-save every 1 second and that way whatever you type instantly appears via Vite's Hot Reload in your dev browser. No waiting multiple seconds for a recompile.

It's game-changing workflow (for some tasks).


I dunno if it's just me, but I've always found live reload to be an overstated benefit. I usually have a mental model of what I'm trying to code that I don't want to check until it's at a specific state - the seconds it takes to press reload doesn't really add up to that much.

I'd say it's more beneficial for CSS styling but I usually mock up my changes in the dev inspector and then copy it over anyways.


Exactly that though. For a SPA you’re going to have a bunch of state loaded and you don’t want to refresh. If you’re using something like tailwind where you’re transpiling your css too then it’s a major boon to have it hot reloaded.

I’ve found vite to be an awesome dev experience.


Not just you.

Hotreload can be handy to some extent, annoying in others - I like to preserve state of given app including what the dom looks like + the window/memory state in devtools. Iterate in code, refresh, then compare. You can do that with multiple browser tabs for example. But not with hotreloading; each tab will re-render/reload the global window state.


Game-changer perhaps in a bad way ;) We're losing the art of writing solid code and instead flail with the "hot reload" crutch. I miss the days of punching cards and submitting a deck to be compiled and run - at least in terms of it forcing me to verify my work ahead of time.

And yes - I'm (mostly) kidding. But I did write my first programs on punched cards at a university course while I was still in grade school. Probably the last generation of programmers to experience that discipline.


We are also writing far more complicated software. Punch cards didn’t have to support thousands of different devices, resolutions, screen densities, input methods, etc. It’s a totally different world.


That's totally fair but the tooling is still not where you'd like it.

In theory, there's no reason that you shouldn't be able to backtrace from the website to the filesystem. If you can do that, then your "it reloads every second" becomes even faster, it becomes WYSIWYG, you are writing in the live constantly-refreshing UI. Well, almost: your text editor has Undo and Git and your web browser doesn't. But we could build those into the browser. Heck, Redux is basically Git except without any standardized verbs, just give Redux some standardized verbs for tracking revisions in a living app and you've got everything you need.

If you follow that trend to its logical conclusion ("OK I want a special way to ctrl-click or right-click or something to edit the HTML of a component I see") you eventually get Smalltalk, and we're finally back as productive as we could be in the 70s :)


I think it does this by not even recompiling. It just links all the uncompiled, uncompressed files and dependencies using a few functions to make them work in the browser.


Credit to them for a nice "Why Vite" button backed by a very informative page.

But for any homepage describing any product / project: If you solve a similar problem as a better know competitor, that's a huge advantage! Mention them explicitly and then state what makes you different. That's one of the fastest avenues to understanding anything "it's like [well known thing] but different in that it [differences here]".

Perhaps just having this:

Vite is a javascript bundler for web development that uses native ES modules. Projects are adopting Vite in lieu of Webpack to gain near-instant HMR and much simpler setup and configuration.


One question .. Is the main goal to make development process easy or does it also have an impact on production performance as well ?


From https://main.vitejs.dev/guide/

"Vite (French word for "quick", pronounced /vit/, like "veet") is a build tool that aims to provide a faster and leaner development experience for modern web projects."

Ultimately it makes the dev process more productive because builds are generally much faster than most other build tools.

https://main.vitejs.dev/guide/why.html might also be worth a read


I can attest that it is a great way to spin up (and compile for server-ready HTML/CSS/JS) a React or Vue project.

Just run ‘npm init vite@latest’ and you get a basic well-organized React/Vue project ready for components and other dependencies to be dropped in.

Uses esbuild+rollup behind the scenes I believe.

If you have the luxury of picking your tools for a completely fresh web project this is a great way to do it.


It’s mainly for dev rebuild performance. I also use vite and it’s a pretty nice build tool that’s relatively easy to configure and quite fast.

It might also affect your production build times, but prod builds are far less frequent and performance isn’t important here


Ideally, for production you're not constantly rebuilding a JS bundle but instead just building once with all the required package versions and then just serving that bundle all the time.

The bundle only really needs to change if the underlying code does, but in pretty much all cases your customers/users are not actually triggering any changes in your underlying code, that's a security risk.


So, this is not a framework like React, right?


It’s more like Webpack, the software that processes your React code into JavaScript bundles that are optimized for the browser. ie puts together what belongs together, removes the unused code, provides a test server to develop and get instant refresh.


How would one use it together with a backend that already serves the frontend code? As a compiler only?


I’ve had similar backend projects where I setup a reverse-proxy to a backend, along with the frontend dev server, to allow the full site and api to run in the browser from local host.

It’s not the most graceful setup, but it works if your backend build isn’t as flexible as you need.


If you're talking about something like Django where you would want to serve frontend JS from a static assets directory, you would have to output a build bundle into your static directory. You would not get hot reloading that way, though.


You could yes, however you’ll probably have to write your configuration from scratch. You’ll have to define the JavaScript entry files (those that call the others) and put that into your HTMLs. Depending on how many scripts etc you have this might be a lot of work, but this should optimize your JavaScript to ist what you need.


I don't think Webpack is designed for that use case, it is pretty apples and oranges


Got it, thanks


Thanks for the info, will switch from CRA as soon as I can :D


Would this replace parcel or be adjacent to it?



Replace it.


There should be a law stating that if you write a new DSL, you are forced to write all the plugin for all the IDE and a debugger for it before you are allowed to publish it.

For 3 months I have been working with a team leader that had the project of making all entrypoints in the program accessible from a JSON based DSL. I tried to suggest we first expose a nice regular ergonomic API, and if we can't satisfy our requirement, we then add the DSL on top.

Nope.

Got the PR this week. Now he leaves next month, so we will have to maintain that.


XKCD 927, once again.

I would rather avoid YAML all together.

Small human editable files: TOML.

Big machine editable files: JSON.

And I validate all that with pydantic.

I wish CUElang was ready for prime time, that would solve all this at once.


I did, and they are very underrated. CUE in itself is brillantly designed: just enough power to be useful (conditionals, loops), but not enough to be dangerous (not turing complete). The idea that you can define data types and data values with the same language makes for very ergonomic configuration files, and it is compatible with YAML and JSON, being able to export to and validate them.

Any new tech is esoteric at first.

When I started Python 20 years ago, there were no job offer for it in my country.


I'm a big fan of Cue, but it's stuck in Golang.

If I where to use it in Python, I would have to code a parser, then implement the entire type logic mysql.

And I bet this is why it's not more used: JSON or YAML are comparatively easy to implement because you just need the parser. You don't have a full featured language with a set based typing system on top.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: