nginx on the server also answers on its own IP. A direct request with a fresh X-Forwarded-For each time got a new throttle identity every time and skipped every per-IP limit (OTP request/login, admin login): reproduced on the server 2026-10-13, 65 of 65 health requests with rotating XFF got 200. TrustedProxyMiddleware reads X-Real-IP (set by nginx from the TCP peer) and, when the peer is not in TRUSTED_PROXY_NETWORKS (default: ArvanCloud's published list), replaces XFF with the peer address. Logs a WARNING once an hour per untrusted peer that sent a proxied XFF, so a new Arvan range shows up. Also ignore the parallel test DB clones (.test-db_N.sqlite3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
737 B
Plaintext
26 lines
737 B
Plaintext
venv/
|
||
__pycache__/
|
||
*.pyc
|
||
db.sqlite3
|
||
.DS_Store
|
||
.env
|
||
|
||
# کتابهای درسی: خودِ PDFها در گیت نمیآیند (حجیماند)
|
||
data/textbooks/*
|
||
!data/textbooks/README.md
|
||
|
||
# کلیدِ امضای تولیدشدهی خودکار (هرگز کامیت نشود)
|
||
.django_secret_key*
|
||
|
||
# خروجیِ collectstatic — تولیدی است، در هر دیپلوی از نو ساخته میشود.
|
||
staticfiles/
|
||
|
||
# نسخهی پشتیبانِ تغییرهای دستیِ روی سرور که deploy.sh کنار میگذارد.
|
||
.deploy-backups/
|
||
|
||
# دیتابیسِ فایلیِ تستها (config/settings.py → DATABASES.TEST)
|
||
.test-db*.sqlite3*
|
||
tools/fake_openai_requests.jsonl
|
||
.pg_password
|
||
.redis_password
|