zhaofengli / attic

Multi-tenant Nix Binary Cache
https://docs.attic.rs
Other
1.04k stars 79 forks source link

[Feature] serve HTML usage instructions on cache pages #162

Open LordMZTE opened 2 months ago

LordMZTE commented 2 months ago

I have an attic cache at https://nix.mzte.de/mzte that I'd like to allow others to use, but if one visits this URL in a browser, it just returns a JSON-formatted 404 response. It would be nice to show a HTML page here instead that briefly summarized how to configure Nix to use the cache, so it's easy to share. Cachix also does something similar here.

jzbor commented 1 month ago

You can easily do that in your reverse proxy (e.g. nginx or caddy), which is also probably a cleaner and more customizable solution than native support by attic.

LordMZTE commented 1 month ago

I don't see how that would work, as such a page would ideally show the public key of the cache (for setup without the attic CLI), which would require either something more complex than a simple page like nginx can provide on the backend, or complex JS on the frontend, which is avoidable here. I think it makes perfect sense to integrate this into attic.

jzbor commented 1 month ago

I see your point. It would be nice, if this information like key and instructions with the correct url was available by default.