Skip to content

Commit 9db50da

Browse files
fix: set higher rate limits on staging via env vars
Make RATELIMIT_DEFAULT and RATE_LIMIT_AUTH configurable via environment variables in the base Config class. Set staging-specific values (2000/hour, 30 auth/min) in the deploy workflow env vars. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0ede340 commit 9db50da

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/deploy-staging.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,16 @@ jobs:
121121
echo "API health check timed out"
122122
exit 1
123123
124-
- name: Ensure seed env var on staging API
124+
- name: Ensure staging env vars on API
125125
continue-on-error: true
126126
run: |
127127
az containerapp update \
128128
--name $API_APP_NAME \
129129
--resource-group $AZURE_RESOURCE_GROUP \
130-
--set-env-vars "SEED_ON_STARTUP=demo" 2>&1 || true
130+
--set-env-vars \
131+
"SEED_ON_STARTUP=demo" \
132+
"RATELIMIT_DEFAULT=2000/hour" \
133+
"RATE_LIMIT_AUTH=30/minute" 2>&1 || true
131134
132135
# ──────────────────────────────────────────────────
133136
# Frontend: build SPA and deploy to Static Web App

backend/app/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class Config:
2424
LOG_LEVEL = os.environ.get("LOG_LEVEL", "INFO")
2525
LOG_FORMAT = os.environ.get("LOG_FORMAT", "json")
2626

27-
RATELIMIT_DEFAULT = "200/hour"
28-
RATE_LIMIT_AUTH = "5/minute"
27+
RATELIMIT_DEFAULT = os.environ.get("RATELIMIT_DEFAULT", "200/hour")
28+
RATE_LIMIT_AUTH = os.environ.get("RATE_LIMIT_AUTH", "5/minute")
2929

3030

3131
class DevelopmentConfig(Config):

0 commit comments

Comments
 (0)