Hirevo / alexandrie

An alternative crate registry, implemented in Rust.
https://hirevo.github.io/alexandrie/
Apache License 2.0
495 stars 54 forks source link

Disallow anonymous crate browsing in the frontend #164

Closed Hirevo closed 1 year ago

Hirevo commented 1 year ago

Many users expressed the interest in restricting the anonymous browsing of the registry's crates, in the effort of allowing a truly private (in the privacy sense) crate registry.

This PR adds a new boolean configuration option called login_required, which, if enabled, prevents unauthenticated users from browsing the registry using the frontend's pages.

This, however, still does not make the registry completely opaque to anonymous users by itself, due to some of Cargo's APIs not supporting authentication as of yet.

Cargo sends no token to these endpoints so we can't really require one, like:

(I talk about this situation in more depth in this issue comment, if you wonder why is it like that and what is currently planned to be done about it by the Cargo team)

So, as of today, the definitive way of preventing every kind of anonymous browsing would still be to host the registry in a private network, and require the use of VPN or a proxy (like an SSH tunnel) to access it.