fix: limit Jeannie API edge traffic
Homelab Main / validate (push) Waiting to run Details
Homelab Main / running-update (push) Blocked by required conditions Details
Homelab Main / debian-ops (push) Blocked by required conditions Details

This commit is contained in:
juvenal.diaz 2026-10-16 13:21:16 -06:00
parent b7424c3942
commit df6ae89e7d
2 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ access_log /var/log/nginx/crowdsec-access.log;
error_log /var/log/nginx/crowdsec-error.log warn;
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=jeannie_api:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=jeannie_api:10m rate=2r/s;
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=static_assets:10m max_size=100m inactive=24h;
proxy_cache_path /var/cache/nginx_dynamic levels=1:2 keys_zone=dynamic_content:5m max_size=50m inactive=1h;
@ -126,7 +126,7 @@ server {
}
location / {
limit_req zone=jeannie_api burst=20 nodelay;
limit_req zone=jeannie_api;
client_max_body_size 64k;
proxy_pass http://jeannie_api_backend;

View File

@ -32,8 +32,8 @@ edge proxy at `api.lab2025.duckdns.org`. The backend remains the Debian host
at `192.168.100.73:8787`; Kubernetes does not run a second Jeannie server and
is not required for API availability.
The edge gateway applies a per-client rate limit of 10 requests per second
with a burst of 20, forwards the bearer token to Debian, and uses 35-second
The edge gateway applies a per-client rate limit of 2 requests per second with
no burst, forwards the bearer token to Debian, and uses 35-second
proxy read/write timeouts. The Jeannie API remains responsible for bearer
authentication and command allowlisting. Read-only retries are not enabled at
the edge; `POST /v1/execute` is never retried so a command cannot be submitted