Repository navigation
Expand file tree
/
Copy path.example.env
More file actions
130 lines (113 loc) · 7.11 KB
/
Copy path.example.env
File metadata and controls
130 lines (113 loc) · 7.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# A key the running server reads can also come from a file: set <KEY>_FILE to
# its path (Swarm secrets under /run/secrets/). A directly set <KEY> wins over the
# file (src/shared/utils/hydrateFileSecrets.mjs). deploy/README.md lists the
# secrets. Build-time keys (NEXT_PUBLIC_*, the SENTRY_* upload keys) and the
# standalone scripts and tests at the end cannot: that step never runs for them.
# ─── REQUIRED ─── Core (app will not start without these)
# PRISMA // connection string of your own Postgres server
POSTGRES_URL="postgresql://username:password@host:port/databasename?schema=public"
# Local: POSTGRES_URL="postgresql://elfensky:supersecretpassword123@127.0.0.1:5432/helldivers1api?schema=public"
# Docker: POSTGRES_URL="postgresql://elfensky:supersecretpassword123@host.docker.internal:5432/helldivers1api?schema=public"
# UPDATE // API key for the update endpoint: any random string you generate (e.g. `uuidgen`)
UPDATE_KEY="fcb19795-474f-4ff1-aa21-5d36b81167ba"
UPDATE_INTERVAL="20" # update interval in seconds
# WORKER_ENABLED="false" — serve web only, no poller. Not needed to scale: every
# replica runs the worker, and the worker_heartbeat lease lets only one of them
# poll (src/update/lease.mjs).
# Optional runtime override. Defaults to 3000 when unset.
PORT="3000"
# ─── OPTIONAL ─── Site
# Canonical site origin used for SEO metadata, sitemap, structured data, and
# Umami session hashing. Self-hosters set their own domain here. Inlined into
# the client bundle at build time (NEXT_PUBLIC_* prefix), so it must be set
# during `next build`. Defaults to https://helldivers.bot when unset.
NEXT_PUBLIC_SITE_URL="https://helldivers.bot"
# ─── OPTIONAL ─── Auth (set all or none — partial config is an error)
# AUTH (BetterAuth)
BETTER_AUTH_SECRET="long-random-hexadecimal-string-at-least-32-characters-long-but-ought-to-be-128-characters-long" # generate: openssl rand -hex 64
BETTER_AUTH_URL="http://localhost:3000" # production: https://helldivers.bot
# --- Discord Provider
AUTH_DISCORD_ID="0000000000000000000" # can be found in the discord developer portal
AUTH_DISCORD_SECRET="AAAAAAAAAAA_BBBBBBBBBBBBBBBB" # can be found in the discord developer portal
# --- GitHub Provider
AUTH_GITHUB_ID="your-github-oauth-app-client-id" # GitHub → Settings → Developer settings → OAuth Apps
AUTH_GITHUB_SECRET="your-github-oauth-app-client-secret" # same OAuth app
# --- Google Provider
AUTH_GOOGLE_ID="000000000000-aaaaaaaaaaaaaaaaaaaaaa.apps.googleusercontent.com" # Google Cloud console → APIs & Services → Credentials
AUTH_GOOGLE_SECRET="GOOGLE-aaaaaaaaaaaaaaa-BLA" # same OAuth client
# ─── OPTIONAL ─── Analytics (features degrade gracefully when missing)
UMAMI_SITE_URL="your.umami.domain" # without https or port
UMAMI_SITE_ID="your-umami-site-id" # Umami → Settings → Websites → the site's ID
# ERROR TRACKING (Sentry SDK → self-hosted GlitchTip)
SENTRY_DSN="https://<key>@glitchtip.yourdomain.com/<project-id>" # GlitchTip → project settings → DSN
NEXT_PUBLIC_SENTRY_DSN="https://<key>@glitchtip.yourdomain.com/<project-id>" # same DSN, for the browser
SENTRY_AUTH_TOKEN="secret_sentry_token" # GlitchTip → profile → auth tokens; uploads the source maps at build
SENTRY_URL="https://glitchtip.yourdomain.com" # your GlitchTip origin
# Both must be the URL *slug*, not the display name — sentry-cli resolves
# /api/0/projects/<org>/<project>/ and a display name 404s the release upload.
SENTRY_ORG="your-org"
SENTRY_PROJECT="your-project"
# Forces the seed script to re-upsert every season file even when they are all
# already in the database. The seed runs on app start when the seed data
# changed (and in the manual migrate image); FORCE_SEED applies only to such a
# run. Only "true", "1" or "yes" enable it — anything else, including "false",
# leaves it off.
FORCE_SEED=""
# Folder with node_modules/prisma and prisma/, used by migrate-on-start. Default:
# the process cwd; the app image sets /app/migrate.
# MIGRATE_ROOT=""
GLITCHTIP_HEARTBEAT_URL="" # GlitchTip uptime heartbeat endpoint (POST at worker interval)
# server_name tag on server-side events. Unset falls back to os.hostname(),
# which inside Docker is the container ID — a new random value every redeploy.
# Swarm sets this to '{{.Node.Hostname}}' so the tag names the machine.
SENTRY_SERVER_NAME=""
# Deploy environment. Inlined into the client bundle at build time
# (NEXT_PUBLIC_* prefix), so it must be set during `next build`. CI sets it
# per pipeline: 'production' in build-release.yml, 'staging' in
# build-staging.yml. Local dev leaves it unset.
# It sets the Sentry environment tag; unset falls back to DEPLOY_ENV, then
# NODE_ENV. It also gates robots.txt: only 'production' lets crawlers in and
# lists the sitemap. Any other value, or unset, disallows all crawlers.
# DEPLOY_ENV (without the prefix) is a server-only Sentry fallback used when
# you can't rebuild — e.g. switching a running container between environments
# by env file. It does not affect robots.txt.
NEXT_PUBLIC_DEPLOY_ENV=""
DEPLOY_ENV=""
# ─── OPTIONAL ─── Push notifications (set all or none)
# PUSH NOTIFICATIONS (generate with: npx web-push generate-vapid-keys)
VAPID_PUBLIC_KEY="your-vapid-public-key"
VAPID_PRIVATE_KEY="your-vapid-private-key"
VAPID_SUBJECT="mailto:your-email@example.com"
NEXT_PUBLIC_VAPID_PUBLIC_KEY="same-as-VAPID_PUBLIC_KEY"
# ─── OPTIONAL ─── Timeseries bucketing
# Tumbling-window bucket size for h1_status, h1_statistic, h1_event_progress.
# Every worker poll UPSERTs on (entity, bucket); within a bucket window subsequent
# polls update the same row. At a bucket boundary a new row is inserted.
# Smaller = higher resolution archives + more storage.
# Larger = lower resolution archives + less storage.
# Default: 900 (15 min).
#
# Storage scales inversely (2 timeseries tables, 140 seasons):
# 10 every poll ~11 GB
# 60 1 min ~1.8 GB
# 300 5 min ~360 MB
# 900 15 min (default) ~120 MB
# 3600 1 hour ~30 MB
#
# Changing this between deploys creates mixed-granularity history — tune sparingly.
# BUCKET_SIZE=900
# BUILD-TIME VARIABLES (auto-generated by next.config.mjs — do NOT set manually)
# NEXT_PUBLIC_APP_VERSION — from package.json version field
# ─── SCRIPTS, SEED AND TESTS ─── CI and local use only
# Restored pg_dump of the pre-cleanup schema, read by scripts/backfill-h1-tables.mjs only.
# LEGACY_POSTGRES_URL="postgresql://username:password@host:port/legacydatabase"
# Smoke-test API key: the seed stores the sha-256 hex digest of the key, the smoke
# tests send the key. CI sets both (.github/workflows/check-ci.yml); never reuse them.
# The seed also runs on app start, so the hash creates a key with full access to
# the public API there too: never set it in a deployed environment.
# SEED_TEST_API_KEY_HASH="64-character-lowercase-sha256-hex-digest"
# SEED_TEST_API_KEY="the-plaintext-key-behind-that-digest"
# Server the smoke tests call. Default: http://localhost:3000.
# TEST_SERVER_URL="http://localhost:3000"
# "1" or "true" turns an unreachable smoke-test server into a skip (local use only).
# SMOKE_ALLOW_SKIP=""