Dough Git

clove/pkviewer

.env.example

back to tree

# ---------------------------------------------------------------------------
# pkviewer configuration
#
# Every origin below is deployment configuration, never an architectural fact.
# No absolute pkviewer URL is ever persisted to the database; URLs are composed
# at render time from these values. See docs/decisions.md §17.
# ---------------------------------------------------------------------------

NODE_ENV=development

# --- origins -------------------------------------------------------------
#
# ONE user-facing origin. It serves everything a person visits:
#
#   /            landing page
#   /login       Discord sign-in
#   /auth/...    OAuth callbacks (proxied to the API by the web tier)
#   /manage/...  authenticated management UI
#   /s/...       public system and member pages
#
# pkviewer previously split these across two hosts. It no longer does; see
# docs/decisions.md O1.
#
# Production: https://pkviewer.xyz
PUBLIC_ORIGIN=http://system.localhost:3000

# Optional. Defaults to PUBLIC_ORIGIN. Reserved for serving media elsewhere.
PUBLIC_ASSET_ORIGIN=



# --- api -----------------------------------------------------------------
API_PORT=3001
# Interface the API binds to. Loopback by default, because the API is internal
# and the browser never calls it. Containers set 0.0.0.0 and do NOT publish the
# port — the network namespace provides the isolation instead.
API_HOST=127.0.0.1
# Where the web tier reaches the API. Internal; never public.
INTERNAL_API_ORIGIN=http://127.0.0.1:3001

# --- database ------------------------------------------------------------
DATABASE_PATH=./data/pkviewer.db

# --- pluralkit -----------------------------------------------------------
PK_API_BASE=https://api.pluralkit.me/v2
# Contact URL embedded in the User-Agent. Point this at the REPOSITORY, not the
# deployment origin, so it survives a domain move. The UA
# must be identical across every instance and must never vary by user or server.
PK_USER_AGENT_CONTACT=https://github.com/doughmination/pkviewer
# Self-imposed ceilings, deliberately below PluralKit's documented 10/s reads
# and 3/s writes, leaving headroom for burst and clock imprecision.
PK_RATE_LIMIT_READ_RPS=6
PK_RATE_LIMIT_WRITE_RPS=2

# --- discord oauth -------------------------------------------------------
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
# Comma-separated, so two domains can both be registered ahead of
# the domain move and the cutover needs no flag day.
DISCORD_REDIRECT_URIS=http://system.localhost:3000/auth/discord/callback

# --- access --------------------------------------------------------------
# Whether NEW accounts may be created. Signing in with an existing account
# always works, so closing signup never locks anyone out of what they have.
SIGNUP_ENABLED=true

# --- secrets -------------------------------------------------------------
# 32+ random bytes, base64. Rotate by generating a new one; sessions are
# server-side, so rotation invalidates them rather than corrupting them.
SESSION_SECRET=