# Copy to .env and fill in. .env is git-ignored; never commit real values. # --- Site --------------------------------------------------------------- # Required in production. Derives the email-identity pepper and the sign-in # form keys. Generate with: openssl rand -hex 32 # BACK IT UP: losing or changing it orphans every account (nobody can sign in # to their existing account again). SECRET_KEY= BASE_URL=https://db.getutm.app LISTEN_ADDR=:8080 # Serve HTTPS directly from the binary (both or neither). Behind Cloudflare use # an Origin CA certificate; see deploy/README.md. #TLS_CERT=/usr/local/gamesdb/tls/origin.pem #TLS_KEY=/usr/local/gamesdb/tls/origin.key # Development only: re-read templates and static files from the source tree # on every request (no rebuild needed). Never enable in production. DEV_RELOAD=false # Operator/agent API: a Unix socket (absolute path; the service's group may # use it, nobody else) or, for development, a loopback address. Reach the # socket from another machine through an SSH tunnel: # ssh -L 8081:/usr/local/gamesdb/run/internal.sock admin@host INTERNAL_LISTEN_ADDR=/usr/local/gamesdb/run/internal.sock # Directory holding gamesdb.sqlite, uploads/ and covers/ DATA_DIR=/data # Set when the site is served over https (defaults to true for https BASE_URL) #COOKIE_SECURE=true # --- IGDB (Twitch developer application) --------------------------------- IGDB_CLIENT_ID=your-twitch-client-id IGDB_CLIENT_SECRET=your-twitch-client-secret # How often to pull catalog changes; the first run imports every PC game. IGDB_SYNC_INTERVAL=24h # Run a sync as soon as the server starts IGDB_SYNC_ON_START=false # IGDB platform ids to mirror (6 = PC Windows) IGDB_PLATFORM_IDS=6 # --- Email (sign-in codes) ------------------------------------------------- # direct = deliver to recipients' mail servers ourselves, DKIM-signed (see # deploy/README.md "Sending mail directly"); smtp = hand mail to the # relay below; log = print codes to stdout (dev only) MAIL_MODE=direct # From header. In direct mode its domain carries the SPF, DKIM and DMARC records. MAIL_FROM="UTM Database " # direct: the machine's own hostname (DNS-only A record to the sending IP, # and the IP's reverse DNS set to the same name), announced to receiving # servers. It names the host, not a service, so it is shared by anything else # on the box that needs reverse DNS. MAIL_HELO=srv1.getutm.app # direct: DKIM selector and key (created by `gamesdb mail-setup`) MAIL_DKIM_SELECTOR=utmdb #MAIL_DKIM_KEY=/dkim/utmdb.key # direct: keep retrying temporary refusals (greylisting) every 90 s for this # long; keep it below LOGIN_CODE_TTL, a code delivered after it expired is useless MAIL_RETRY_FOR=8m # smtp: relay settings SMTP_HOST=smtp.example.com SMTP_PORT=587 SMTP_USER= SMTP_PASS= # starttls (default) | tls | none SMTP_TLS=starttls # --- Anti-spam ------------------------------------------------------------- # Leave empty to skip Akismet (link/HTML blocking and rate limits still apply) AKISMET_KEY= # Reject submissions when Akismet is unreachable (default: allow and log) AKISMET_FAIL_CLOSED=false # --- Proxy / CDN ------------------------------------------------------------- # REQUIRED in production. Only trust CF-Connecting-IP / X-Forwarded-For from # these ranges (comma separated): the peers that actually connect to the # server. That is Cloudflare's published ranges when Cloudflare connects # directly; with a reverse proxy or tunnel on the host in front of the # 127.0.0.1 port, it is only the compose network's gateway as a /32 (the # server logs a warning naming it, e.g. 172.18.0.1/32). Without the right # ranges every visitor shares one IP for rate limiting and Akismet. TRUSTED_PROXY_CIDRS=173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/13,104.24.0.0/14,172.64.0.0/13,131.0.72.0/22,2400:cb00::/32,2606:4700::/32,2803:f800::/32,2405:b500::/32,2405:8100::/32,2a06:98c0::/29,2c0f:f248::/32 # Optional purge-by-URL hook. When set, writes POST {"files":[absolute urls]} # with "Authorization: Bearer " to this endpoint. Off when empty. CDN_PURGE_URL= CDN_PURGE_TOKEN= # --- Auto-Triage --------------------------------------------------------------- # Accounts users can gift games to, shown on the triage request page. Only # accounts whose storefront the game is sold on are offered. Optional # "instructions" replaces the built-in gifting steps for that storefront. # "account" is the account name on the storefront and "email" the address # gifts are sent to (Steam, GOG and itch.io gift by email); either or both; # "url" is the profile to befriend (Epic gifts only to friends). TRIAGE_GIFT_ACCOUNTS=[{"storefront":"steam","account":"utm-triage","email":"gifts@example.com","url":"https://steamcommunity.com/id/utm-triage"}] # --- Public upload limits (shown on the form) ------------------------------------- UPLOAD_MAX_FILE_BYTES=26214400 UPLOAD_MAX_FILES=5 UPLOAD_MAX_REPORT_BYTES=104857600 # Attachments older than this are deleted ATTACHMENT_RETENTION_DAYS=30 # --- Private quotas and rate limits (never displayed) ---------------------------- # Per user per UTC day / lifetime. Tune these on the server; defaults are conservative. UPLOAD_QUOTA_DAILY_BYTES=209715200 UPLOAD_QUOTA_DAILY_FILES=20 UPLOAD_QUOTA_TOTAL_BYTES=2147483648 RATE_REPORTS_PER_HOUR=5 RATE_COMMENTS_PER_HOUR=30 RATE_PLUSONES_PER_HOUR=60 RATE_SEARCH_PER_MINUTE=60 RATE_PREVIEW_PER_MINUTE=60 RATE_LOGIN_PER_HOUR_IP=10 RATE_LOGIN_PER_HOUR_EMAIL=3 # Minimum gap between any two content submissions (report, edit, comment, # request) by the same user. Search, previews, stars and +1s are not covered. RATE_CONTENT_INTERVAL=15s # --- Sign-in hardening ----------------------------------------------------------- # Proof-of-work bits the browser must solve per sign-in (16 ≈ 1 s; 0 disables). LOGIN_POW_BITS=16 # A sign-in form may be submitted only within this age window. LOGIN_FORM_MIN_AGE=2s # A report form submitted sooner than this after it was shown is refused CONTENT_FORM_MIN_AGE=3s LOGIN_FORM_MAX_AGE=1h # Workers that hash, check MX and send mail (memory ≈ workers × 64 MiB); queue depth. LOGIN_WORKERS=2 LOGIN_QUEUE_SIZE=256 # Site-wide budget of sign-in emails; beyond it requests are silently dropped. LOGIN_GLOBAL_PER_MINUTE=30 LOGIN_GLOBAL_PER_HOUR=300 # Skip sending to domains without mail servers (default: on unless MAIL_MODE=log). LOGIN_MX_CHECK=true # --- Account data export --------------------------------------------------------------- # One export per user per interval; attachments younger than the minimum age # are listed but withheld (prevents upload-then-export file transfer). EXPORT_INTERVAL=24h EXPORT_MIN_ATTACHMENT_AGE=48h # --- Sessions ------------------------------------------------------------------------ SESSION_TTL=720h # How long an emailed sign-in code stays valid (Safari offers a detected code for 3 minutes) LOGIN_CODE_TTL=10m