infrastructure/deploy/Caddyfile

56 lines
1.7 KiB
Caddyfile

{
admin off
auto_https off
}
:8080 {
header {
X-Content-Type-Options nosniff
Referrer-Policy strict-origin-when-cross-origin
Content-Security-Policy "default-src 'self'; style-src 'self'; script-src 'self'; img-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'"
}
redir /archipelago /archipelago/ 308
handle /archipelago/healthz {
respond "ok" 200
}
handle /archipelago/pipeline.json {
root * /srv/artifacts
rewrite * /pipeline-public.json
header Cache-Control "no-cache"
file_server
}
handle_path /archipelago/iso/* {
root * /srv/artifacts/current/iso
file_server
}
handle_path /archipelago/ostree/* {
root * /srv/artifacts/current/ostree
header Cache-Control "no-cache"
file_server
}
handle_path /archipelago/v1/* {
root * /srv/artifacts/current/v1
header Cache-Control "no-cache"
file_server
}
# Immutable monthly repository views. They are separate ZFS mounts inside the
# published root, so they cannot live under the generation symlink `current`.
handle_path /archipelago/arch-repo-snapshot/* {
root * /srv/artifacts/arch-repo-snapshot
header Cache-Control "no-cache"
file_server
}
handle /archipelago/releases.json {
root * /srv/artifacts/current
rewrite * /releases.json
header Cache-Control "no-cache"
file_server
}
handle_path /archipelago/* {
root * /srv/portal
header Cache-Control "no-cache"
file_server
}
handle {
respond "Not found" 404
}
}