This commit is contained in:
2026-08-13 14:37:28 -05:00
parent abb181e537
commit 4b34d5f9a7
5 changed files with 35 additions and 3 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ services:
- no-new-privileges:true - no-new-privileges:true
tmpfs: tmpfs:
- /etc/nginx/conf.d:size=1m,mode=0755 - /etc/nginx/conf.d:size=1m,mode=0755
- /var/cache/nginx:size=32m,mode=0755 - /var/cache/nginx:size=256m,mode=0755
- /var/run:size=1m,mode=0755 - /var/run:size=1m,mode=0755
certbot: certbot:
+5 -1
View File
@@ -77,6 +77,10 @@ server {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Forwarded-Proto http;
proxy_read_timeout 300s; proxy_connect_timeout 30s;
proxy_send_timeout 30m;
proxy_read_timeout 30m;
proxy_request_buffering off;
proxy_buffering off;
} }
} }
+5 -1
View File
@@ -115,6 +115,10 @@ server {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 300s; proxy_connect_timeout 30s;
proxy_send_timeout 30m;
proxy_read_timeout 30m;
proxy_request_buffering off;
proxy_buffering off;
} }
} }
+4
View File
@@ -45,6 +45,10 @@ Nginx also runs with a read-only container filesystem and narrowly scoped
temporary filesystems. The broker trusts proxy headers because Nginx is its temporary filesystems. The broker trusts proxy headers because Nginx is its
only production ingress; Nginx replaces rather than appends client-supplied only production ingress; Nginx replaces rather than appends client-supplied
forwarding headers. forwarding headers.
Git request and response buffering is disabled so clone, fetch, and push pack
streams pass directly between clients and Gitea. The Nginx cache tmpfs remains
available for other proxy activity and is sized above typical repository pack
files.
## 2. Install the repository ## 2. Install the repository
+20
View File
@@ -62,6 +62,26 @@ grep -F -- './config/letsencrypt/archive:/etc/archive:ro' \
printf 'FAIL: TLS compose does not expose Certbot archive symlink targets\n' >&2 printf 'FAIL: TLS compose does not expose Certbot archive symlink targets\n' >&2
exit 1 exit 1
} }
grep -F -- '/var/cache/nginx:size=256m,mode=0755' \
"${TEST_ROOT}/compose.yaml" >/dev/null || {
printf 'FAIL: Nginx cache tmpfs is too small for Git pack streaming\n' >&2
exit 1
}
for template in \
"${TEST_ROOT}/deploy/nginx/templates/http.conf.template" \
"${TEST_ROOT}/deploy/nginx/templates/tls.conf.template"; do
for directive in \
'proxy_send_timeout 30m;' \
'proxy_read_timeout 30m;' \
'proxy_request_buffering off;' \
'proxy_buffering off;'; do
[[ "$(grep -Fc -- "$directive" "$template")" == 2 ]] || {
printf 'FAIL: both proxied services need %s in %s\n' \
"$directive" "$template" >&2
exit 1
}
done
done
printf '%s\n' \ printf '%s\n' \
'broker.test' \ 'broker.test' \