Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions services/nomad/infrastructure/nginx-mirror.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ job "nginx" {
}

resources {
memory = 2000
memory_max = -1
memory = 2000
memory_max = 16384
}

dynamic "volume_mount" {
Expand Down
10 changes: 10 additions & 0 deletions services/nomad/infrastructure/nginx-sites/10-mirror.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
map $http_user_agent $non_xbps {
xbps/2.0 "";
default $binary_remote_addr;
}

limit_req_zone $non_xbps zone=per_ip:10m rate=5r/s;

server {
include /etc/nginx/fragments/ssl.conf;
listen 443 ssl http2;
Expand All @@ -10,6 +17,9 @@ server {
"~^repo-[a-z]{2}\.voidlinux\.org$";
root /srv/www/mirror;

limit_req zone=per_ip burst=10 nodelay;
limit_req_status 429;

location / {
autoindex on;
}
Expand Down
3 changes: 2 additions & 1 deletion services/nomad/mirror/sync.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ job "sync" {
"--delete-after",
"--delay-updates",
"--links",
"--filter=P *-repodata",
"rsync://${env["RSYNC_ADDR"]}/${group.value}/",
"/${group.value}/",
]
Expand All @@ -62,7 +63,7 @@ EOF
}

resources {
memory = 1000
memory = 3000
}

volume_mount {
Expand Down
Loading