Files
Evection/.env.example
T
ksmithandClaude Sonnet 5.5 ac5e951749 Harden the login throttle and cache readiness aggregates (R2-S4, R2-C5; #36, #45)
S4: the throttle keyed on the first X-Forwarded-For entry, which a client
or a proxy that appends can choose, and disabled itself entirely when
Redis was down.

EVECTION_TRUSTED_PROXIES (IPs/CIDRs of your reverse proxy) makes it
strict: X-Forwarded-For is only believed when the TCP peer is a trusted
proxy, and the rightmost entry that isn't itself a trusted proxy — the
address the proxy actually saw — is used instead of the spoofable first
one. Unset keeps the previous behavior so existing installs don't
suddenly share one bucket behind a proxy, and `manage.py check --deploy`
warns (evection.W001) until it's set. During a Redis outage the throttle
now falls back to a bounded in-process limiter instead of switching off.

C5: /health/ready/ reuses its queue/feed aggregates for 15s
(EVECTION_HEALTH_CACHE_SECONDS) so a fast-polling monitor can't create
steady load; the database, Redis and poller probes stay live. Docs
cover both settings, restricting the endpoint at the proxy, and the
tombstone/purge behavior from the previous changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 12:08:13 -07:00

32 lines
1.1 KiB
Bash

# Copy to .env and adjust for your environment.
# A long, random, secret value — never commit your real one.
SECRET_KEY=change-me-to-a-long-random-value
DEBUG=False
ALLOWED_HOSTS=localhost,127.0.0.1
# SQLite (default, zero-config):
DATABASE_URL=sqlite:///db.sqlite3
# Postgres:
# DATABASE_URL=postgres://evection:password@localhost:5432/evection
REDIS_URL=redis://localhost:6379/0
# Open account registration is off by default; the first account created via
# the setup wizard becomes the instance admin.
EVECTION_SIGNUP_ENABLED=False
# Global floor for any feed's polling interval, in minutes.
EVECTION_MIN_FETCH_INTERVAL_MINUTES=15
# Bump this on deploys that change cached static assets to invalidate old
# service worker caches.
EVECTION_PWA_CACHE_VERSION=v1
# IP address(es) or CIDR(s) of the reverse proxy in front of gunicorn,
# comma-separated, e.g. 192.168.1.10 or 10.0.0.0/24. When set, the login
# throttle trusts X-Forwarded-For only from these addresses. Strongly
# recommended; `manage.py check --deploy` warns until it's set.
# EVECTION_TRUSTED_PROXIES=