runner: Caddyfile for cache HTTPS frontend + README

This commit is contained in:
2026-05-18 20:27:48 +00:00
parent bbae941a36
commit fcecc1e5b0
2 changed files with 39 additions and 13 deletions

28
runner/Caddyfile.example Normal file
View File

@@ -0,0 +1,28 @@
# Caddy snippet that serves the cargoxx binary cache over HTTPS.
# Append to /etc/caddy/Caddyfile (or include via `import`) and reload:
# sudo systemctl reload caddy
#
# Caddy handles cert provisioning + renewal via ACME automatically.
# Adjust the domain + the `root` path if the runner lives elsewhere.
#
# The cache is read-only here — writes happen exclusively from the
# runner job container (`nix copy --to file:///srv/cargoxx-cache/store`).
cache.cargoxx.amadey.xyz {
root * /home/mozart/cargoxx-pkgs/runner/cache/store
file_server browse=false
# narinfo / nar are immutable per content hash → cache aggressively.
@cache_immutable path *.narinfo *.nar.xz *.nar
header @cache_immutable Cache-Control "public, immutable, max-age=31536000"
# Substituter probe — short cache, must reflect new entries quickly.
@cache_info path /nix-cache-info
header @cache_info Cache-Control "public, max-age=300"
# Logs go to /var/log/caddy/cargoxx-cache.{access,error}.log by
# default; uncomment to override.
# log {
# output file /var/log/caddy/cargoxx-cache.log
# }
}