flokli / nix-casync

A more efficient way to store and substitute Nix store paths
80 stars 4 forks source link

disallow uploading nar files with compression for now #16

Closed flokli closed 2 years ago

flokli commented 2 years ago

Right now, we don't support uploading compressed .nar files.

However, the error message when doing so is confusing.

There's no PUT /nar/$filehash.nar.$suffix URL handler, so the upload of a compressed Narfile will return HTTP error 404.

Dynamically uncompressing requires more work, we don't want to recompress either (and then have to rewrite .narinfo files). That's much more work, and certainly requires https://github.com/flokli/nix-casync/issues/9.

As an intermediate solution, we should probably register a handler providing a nicer error message when a Narfile with one of the compression suffixes is uploaded.

flokli commented 2 years ago

Apparently #9 is not required, as long as we live with the fact that uploading a compressed Narfile will cause it to only be reachable at $narhash.nar (in uncompressed form).