Closed yu-re-ka closed 1 year ago
Nevermind, just realized that for this to work my object storage has to be publicly reachable.
It would be nice to use the local garage server or gateway, yet still have a way to point clients to find the downloads :)
To leave a note for future travellers and expand on the above, if:
unable to download 'https://<server>/<cachename>/<whatever>.nar': HTTP error 307 (curl error: Couldn't connect to server)
when trying to use nix with your cache configuredstorage.endpoint
as something like http://localhost:<someport>
Your problem is that your s3 backend needs to be publicly accessible, and configured as a public url. Attic returns 307
redirects to presigned urls - you can see this by using curl, authorized with the netrc file attic use
should have installed:
curl --netrc-file /home/$USER/.config/nix/netrc <the url from above>
You'll see a 307 redirect to the localhost url configured in storage.endpoint
with a bunch of auth signatures.
warning: error: unable to download 'https://cache.cyberchaos.dev/musl/nar/zgh590rfmf9gq1n02yvhja3zmvhxfryd.nar': HTTP error 307 (curl error: Couldn't connect to server); retrying in 334 ms