From 1e7e4c41d23b43401bb30d1052cd8300b069ac68 Mon Sep 17 00:00:00 2001 From: 0x5c Date: Sun, 11 Sep 2022 02:38:24 -0400 Subject: [PATCH] services/nomad/mirror: add nginx rules for old repo layout These allow serving packages on the old paths for compatibility. --- services/nomad/mirror/compat-layout.conf | 37 ++++++++++++++++++++++++ services/nomad/mirror/mirror.nomad | 6 ++++ 2 files changed, 43 insertions(+) create mode 100644 services/nomad/mirror/compat-layout.conf 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" {