# ===================================================================== # TravStats — Production environment # ===================================================================== # # Minimum configuration: set DB_PASSWORD. That is enough to get a # running instance. Everything else (instance name, user cap, API keys, # Ollama, backups, WebDAV) is configured from the admin UI after the # first-run setup wizard. # # Override any of the optional variables below ONLY if you're running # behind an unusual setup (external DB, reverse proxy without # X-Forwarded-Proto, different Ollama host, …). # # Copy this file to `.env` and adjust. # ===================================================================== # REQUIRED # ===================================================================== # PostgreSQL password for the bundled `db` service. Must be strong. # Generate one: openssl rand -base64 32 DB_PASSWORD=changeme-to-strong-password # ===================================================================== # OPTIONAL — infrastructure overrides # ===================================================================== # Host port the web UI is exposed on. APP_PORT=3000 # Force secure cookies on or off. Unset or empty = auto-detect: Secure # only when the request came over https (directly or via the reverse # proxy's X-Forwarded-Proto header), so plain http on a LAN address works. # "false" = never Secure, any other value = always Secure. Leave this # empty unless your proxy doesn't send that header. # COOKIE_SECURE=true # Allowed cross-origin list. Leave unset when the app is served # same-origin behind a reverse proxy. Set when your frontend lives on a # different hostname than the API. # CORS_ORIGIN=https://travstats.example.com # Reverse proxies whose X-Forwarded-For may name the visitor. The # container's own nginx (loopback) is always enough on its own. If ANOTHER # proxy sits in front — Nginx Proxy Manager, Traefik, Caddy, a Synology or # Unraid proxy — name its address here, otherwise every visitor arrives as # that proxy: they share one login rate limit, and ten wrong passwords from # anyone lock everyone out for 15 minutes. Comma-separated: loopback, # linklocal, uniquelocal, IP addresses or CIDR ranges ("true" is refused — # it would let visitors forge their address). # TRUST_PROXY=loopback, 192.168.1.10 # Container timezone. Keep UTC — TravStats schedulers and logs assume # UTC, the UI renders everything in the user's locale regardless. TZ=UTC # Starting a version you have not run on this data before snapshots the # database BEFORE any migration, and REFUSES TO START if it cannot. Nothing # is migrated in that case, so the previous image still works against it. # Most common cause: pg_dump older than the server. pg_dump cannot dump a # server newer than its own MAJOR version (a newer client is fine), which is # what happens when you point TravStats at your own Postgres and upgrade it. # Set this to upgrade with no snapshot. Only the literal "true" counts — this # is consent to migrate with no way back. Take a backup first, unset after. # SKIP_PRE_MIGRATION_BACKUP=true # ===================================================================== # OPTIONAL — external Postgres instead of the bundled `db` service # ===================================================================== # # Use this if you want TravStats to talk to a Postgres you already run # (homelab, managed DB, …). Takes precedence over DB_PASSWORD. # # DATABASE_URL=postgresql://user:pass@postgres.lan:5432/travstats