diff --git a/services/nomad/mirror/compat-layout.conf b/services/nomad/mirror/compat-layout.conf new file mode 100644 index 00000000..c8b986c4 --- /dev/null +++ b/services/nomad/mirror/compat-layout.conf @@ -0,0 +1,37 @@ +location /current/ { + location ~ /current/aarch64/(?.*\.aarch64-musl(?:\.xbps(?:\.sig)?|-repodata))$ { + alias /packages/aarch64/musl/$filepath; + } + + location ~ /current/aarch64/(?.*\.aarch64(?:\.xbps(?:\.sig)?|-repodata))$ { + alias /packages/aarch64/glibc/$filepath; + } + + location ~ /current/musl/(?.*\.x86_64-musl(?:\.xbps(?:\.sig)?|-repodata))$ { + alias /packages/x86_64/musl/$filepath; + } + + location ~ /current/musl/(?.*\.armv6l-musl(?:\.xbps(?:\.sig)?|-repodata))$ { + alias /packages/armv6l/musl/$filepath; + } + + location ~ /current/musl/(?.*\.armv7l-musl(?:\.xbps(?:\.sig)?|-repodata))$ { + alias /packages/armv7l/musl/$filepath; + } + + location ~ /current/(?.*\.x86_64(?:\.xbps(?:\.sig)?|-repodata))$ { + alias /packages/x86_64/glibc/$filepath; + } + + location ~ /current/(?.*\.i686(?:\.xbps(?:\.sig)?|-repodata))$ { + alias /packages/i686/glibc/$filepath; + } + + location ~ /current/(?.*\.armv6l(?:\.xbps(?:\.sig)?|-repodata))$ { + alias /packages/armv6l/glibc/$filepath; + } + + location ~ /current/(?.*\.armv7l(?:\.xbps(?:\.sig)?|-repodata))$ { + alias /packages/armv7l/glibc/$filepath; + } +} diff --git a/services/nomad/mirror/mirror.nomad b/services/nomad/mirror/mirror.nomad index 7b854166..0aa6adba 100644 --- a/services/nomad/mirror/mirror.nomad +++ b/services/nomad/mirror/mirror.nomad @@ -34,12 +34,18 @@ job "mirror" { config { image = "ghcr.io/void-linux/infra-nginx:20220804RC02" + volumes = ["local/compat-layout.conf:/etc/nginx/locations.d/compat-layout.conf"] } volume_mount { volume = "dist-mirror" destination = "/srv/www" } + + template { + data = file("compat-layout.conf") + destination = "local/compat-layout.conf" + } } task "rsync" {