Skip to content

Reference

Environment variables

10 min readUpdated

Page actions

ChatGPT and Claude are third-party services. The link gives them this page's public address and a short instruction. This site records nothing.

Every environment variable the API, the website, the wiki and the tools read — who reads it and what it changes — generated from the code that reads it.

59 variables, found by scanning the code for the places that read them. Each row names the files that read the variable and what it changes; the descriptions are kept beside this page in docs/reference/environment.descriptions.json. Names only: where a variable holds a token or a secret, its value lives in the GitHub environment or the hosting project, never in the repository (environments). Variables the CI runner sets for itself (CI, GITHUB_OUTPUT, GITHUB_REPOSITORY) are not listed.

The API and its services

Read by the API process (webapp/serve.py) and the services beside it at start-up.

VariableRead byWhat it changes
HUKAMNAMA_ALERT_NTFY_URLservices/hukamnama/hukamnama/alerts.pyhttps://ntfy.sh/<topic> (or a self-hosted ntfy server): the Hukamnama service posts every new alert there at once, so it reaches the owner’s phone; the dead-man check reads the same value as a repository secret. The topic is the secret (16–64 letters, digits, - or _). Unset: no phone alerts; malformed: the service refuses to start.
HUKAMNAMA_APIwebapp/hukamnama_page.pyThe origin of the public Hukamnama API (https://api.gurbanisoul.com) the web server reads each day’s record from to fill the Hukamnama pages, feeds, sitemap and embed. Unset (the default), or without a page shell for the language, the pages are not served. On Vercel the all function sets it per environment from hukamnama_api in gateway/routes.json; a value set on the project wins, and an empty one turns the pages off. Must be https://… (or a local http://127.0.0.1: / http://localhost: address).
HUKAMNAMA_APNS_KEY_FILEservices/hukamnama/hukamnama/__main__.pyPath to the APNs Auth Key (.p8, PEM) the Hukamnama service signs its provider token with, as a Render secret file (/etc/secrets/…); needed only when HUKAMNAMA_SEND=on. The key itself never goes in an environment variable or the repository.
HUKAMNAMA_APNS_KEY_IDservices/hukamnama/hukamnama/__main__.pyThe 10-character Key ID of that APNs Auth Key (Apple Developer → Keys); the kid of the provider token.
HUKAMNAMA_APNS_TEAM_IDservices/hukamnama/hukamnama/__main__.pyThe Apple Developer Team ID that owns the APNs key; the iss of the provider token.
HUKAMNAMA_APNS_TOPICservices/hukamnama/hukamnama/__main__.pyThe APNs topic (the app’s bundle id); default org.sggs.app.
HUKAMNAMA_APPROVE_BASE_URLservices/hukamnama/hukamnama/alerts.pyThe https origin the phone alert’s Approve and Review buttons call (this service’s own Render URL, not the edge). Default: Render’s RENDER_EXTERNAL_URL. Must be https://….
HUKAMNAMA_APPROVE_SECRETservices/hukamnama/hukamnama/alerts.py, services/hukamnama/hukamnama/api.pyTurns on one-tap approve from the phone alert: a held_veto alert then carries an Approve button (and a Review page) for the exact run hs.sgpc.net resolved to, signed with this secret (HMAC). The service re-proves the range against the corpus before publishing. Unset (the default): no buttons, and /owner/approve answers 404. A long random value set only in Render’s environment; never committed, never sent in an alert.
HUKAMNAMA_ARCHIVEservices/hukamnama/hukamnama/__main__.pyWhere the Hukamnama service keeps every distinct page it fetched from SGPC, gzip under each Amritsar date with an index of every fetch, kept 60 days (unset: no archive); the same as serve --archive. The image sets /var/data/archive.
HUKAMNAMA_COMMITservices/hukamnama/hukamnama/api.pyThe source commit the Hukamnama service reports on /health so a deploy is verified by identity; the image bakes it from Render’s RENDER_GIT_COMMIT (falls back to that, then unknown).
HUKAMNAMA_DBservices/hukamnama/hukamnama/__main__.pyThe scripture database the Hukamnama service reads (default db/sggs.sqlite); the same as its --db option.
HUKAMNAMA_ENVservices/hukamnama/hukamnama/alerts.pystaging (the default) or production: the environment name the Hukamnama service puts in its phone alerts’ titles.
HUKAMNAMA_MEANINGservices/hukamnama/hukamnama/__main__.pyon adds the English translation (Dr. Sant Singh Khalsa) to the Hukamnama service’s public snapshot as a separate, labelled layer (lines[].en and translation); anything else (the default) leaves it out, and switching it off removes it from the files on the next sync. The Gurmukhi is identical either way.
HUKAMNAMA_ORIGIN_REQUIREDservices/hukamnama/hukamnama/api.pyon makes the Hukamnama service answer 403 on /v1/* to any request without the edge’s secret (/health stays open). Anything else (the default) leaves direct calls allowed. Needs HUKAMNAMA_ORIGIN_SECRET.
HUKAMNAMA_ORIGIN_SECRETservices/hukamnama/hukamnama/api.pyThe secret the edge Worker sends in X-Origin-Auth. When set, the Hukamnama service believes a request’s client address (X-Client-IP) only with it, and limits every other request by its socket’s own address. Set the same value on the Worker (ORIGIN_SECRET). Never committed.
HUKAMNAMA_PEER_URLservices/hukamnama/hukamnama/peer.pyThe other Hukamnama service’s own https origin (production’s on staging, staging’s on production). The service then checks the other’s /health every 5 minutes, 05:15–14:15 IST, and raises peer_down on its own phone alerts when the other is unreachable, reports ok=false or its poller has stopped, after 3 failed checks in a row and once a day. Unset: no watch. Not https://: the service refuses to start.
HUKAMNAMA_PUBLIC_ACCESS_KEY_IDservices/hukamnama/hukamnama/r2.pyThe access key id of an R2 API token scoped to the public snapshot bucket only (Object Read & Write). Not the backup’s token.
HUKAMNAMA_PUBLIC_BUCKETservices/hukamnama/hukamnama/r2.pyThe R2 bucket the Hukamnama service writes its public snapshot to, for the edge Worker to serve (unset: no bucket). Needs HUKAMNAMA_R2_ENDPOINT and the two HUKAMNAMA_PUBLIC_… keys; with any of them missing the service refuses to start.
HUKAMNAMA_PUBLIC_DIRservices/hukamnama/hukamnama/__main__.pyWhere the Hukamnama service writes its public snapshot: one file per published day plus an index, rewritten when a day is published, corrected or held (unset: no snapshot); the same as serve --public-dir.
HUKAMNAMA_PUBLIC_SECRET_ACCESS_KEYservices/hukamnama/hukamnama/r2.pyThe secret of that R2 API token. Set only in the host’s environment (Render); never in the repository or a log.
HUKAMNAMA_SENDservices/hukamnama/hukamnama/__main__.pyon makes the Hukamnama service push each published Hukamnama to registered devices through APNs; anything else (the default) keeps sending off. With on and no usable APNs key the service refuses to start.
HUKAMNAMA_STATEservices/hukamnama/hukamnama/__main__.pyThe Hukamnama service’s own state database: each day’s fetched Hukamnama, the gate’s decision and the audit trail (default hukamnama-state.sqlite); the same as its --state option.
HUKAMNAMA_VERCEL_PROJECTservices/hukamnama/hukamnama/purge.pyThe id or name of the Vercel project whose CDN copy of the Hukamnama pages the service purges (see HUKAMNAMA_VERCEL_PURGE_TOKEN).
HUKAMNAMA_VERCEL_PURGE_TOKENservices/hukamnama/hukamnama/purge.pyA Vercel access token for the web project’s team, used only to delete the hukamnama cache tag from the CDN after a published Hukamnama day is corrected or withdrawn. Set only in the host’s environment (Render); never in the repo. With HUKAMNAMA_VERCEL_PROJECT and HUKAMNAMA_VERCEL_TEAM; with any of the three missing the service refuses to start (all unset: no purge).
HUKAMNAMA_VERCEL_TARGETservices/hukamnama/hukamnama/purge.pyWhich of the project’s environments the CDN purge clears: production or preview (unset: Vercel’s default).
HUKAMNAMA_VERCEL_TEAMservices/hukamnama/hukamnama/purge.pyThe Vercel team id of that project (see HUKAMNAMA_VERCEL_PURGE_TOKEN).
LITESTREAM_SHA256services/hukamnama/fetch_litestream.pyBuild-time only, from the Hukamnama Dockerfile’s build arg: the sha256 of that Litestream release archive, copied from the release’s checksums.txt; the image build fails on a mismatch.
LITESTREAM_VERSIONservices/hukamnama/fetch_litestream.pyBuild-time only, from the Hukamnama Dockerfile’s build arg: the Litestream release the image installs for the state backup to R2. Bumped together with LITESTREAM_SHA256.
PORTservices/hukamnama/hukamnama/__main__.py, webapp/serve.pyThe port to listen on, set by the host (Render, a container platform). The API prefers it to SGGS_PORT; the Hukamnama service defaults to 8080 without it.
RENDER_EXTERNAL_URLservices/hukamnama/hukamnama/alerts.pySet by Render to the service’s own https://<name>.onrender.com URL; the Hukamnama service uses it as the default approve-button origin (HUKAMNAMA_APPROVE_BASE_URL).
RENDER_GIT_COMMITservices/hukamnama/hukamnama/api.py, webapp/serve.pyInjected by Render: the commit being served, reported by /api/health → commit so a deploy is verified by identity.
SGGS_ACCESS_LOGwebapp/serve.py0 turns off the one-line JSON access log written per request (default on); the generators that drive the API in-process set it.
SGGS_COMMITwebapp/serve.pyThe source commit /api/health reports when the host does not inject RENDER_GIT_COMMIT; the generated API functions set it at deploy time.
SGGS_DBwebapp/sggs/core.pyThe database file the API opens read-only; a per-context function points it at its own slice of the database. Default: db/sggs.sqlite.
SGGS_MAX_WORKERSwebapp/serve.pyHow many requests the threaded server handles at once before new ones queue (default 48).
SGGS_MODULESwebapp/serve.pyWhich bounded contexts this process serves: all (the default, the whole API) or a comma list such as search or insights,knowledge. An unknown name stops the server.
SGGS_OPEN_BROWSERwebapp/serve.py1 opens the site in the desktop browser when the server starts; never set on a host.
SGGS_PORTwebapp/serve.pyThe API’s local port when PORT is not set (default 7777), e.g. to run a second server beside another worktree’s.

The website build

Read by the Astro build of the website. PUBLIC_ variables are compiled into the pages, so they are switches and public addresses, never secrets.

VariableRead byWhat it changes
PUBLIC_APP_STORE_LIVEfrontend/src/site.ts1 once the app is live on the App Store: the pages show the store link, the Smart App Banner and the install URL; otherwise “Coming soon”. Set in the production project on launch day.
PUBLIC_CONTRIBUTE_MODEfrontend/src/contribute.tsWhich payment links the Contribute page carries: live, test (Stripe test mode, for staging) or off (the default, no links). A link that does not fit the mode fails the build.
PUBLIC_I18N_PREVIEWfrontend/src/i18n/locales.tsall also builds every drafted language that has a catalog, for a reviewer to read on real pages; never set for production.
PUBLIC_I18N_PSEUDOfrontend/src/i18n/t.ts1 builds every catalog string as pseudo-text, so a string that bypasses the catalog, or a layout that cannot take a longer translation, stands out.
PUBLIC_NEWSLETTER_FORM_URLfrontend/src/components/Newsletter.astro, frontend/src/pages/[lang]/privacy.astroThe launch-notice sign-up form’s address; without it the sign-up band is not built and the privacy page leaves out its section.

The wiki build

Read by the wiki’s build and its review scripts.

VariableRead byWhat it changes
DOCS_APIdocs-site/scripts/visual-qa.mjsWhere the wiki’s visual review script sends /api requests so live widgets show real data (default: production).
DOCS_PAGE_ACTIONSdocs-site/plugins/features.mjs0 builds the wiki without the page menu (copy, view as Markdown, assistant links, print), should it misbehave in production.
DOCS_PDFdocs-site/plugins/features.mjs1 also builds a PDF of every page; CI sets it for every build it tests or deploys, a local build is quicker without.
PUBLIC_DOCS_COMMITdocs-site/astro.config.mjs, docs-site/plugins/export-pages.mjs, docs-site/plugins/remark-code-excerpt.mjs, docs-site/scripts/review-pack.mjs, docs-site/src/components/Footer.astroThe commit the wiki documents: it pins code excerpts and repository links, and is shown in the footer and in the sggs-docs-commit meta tag the deploy smoke test checks. CI passes it; locally it is read from git.
VERCEL_BYPASSdocs-site/scripts/visual-qa.mjsThe protection-bypass secret the wiki’s visual review script sends to reach a protected base URL such as the staging alias.

Tools, CI and release scripts

Read by the generators, gates and deploy scripts, locally and in GitHub Actions.

VariableRead byWhat it changes
COUPLING_ENFORCEtools/docs_coupling.pyTurns the docs-impact check (tools/docs_coupling.py) into a gate: when 1/true/on, a page that declares covers: and was neither updated, re-stamped nor named on its own Docs-impact: docs/<page>.md — <reason> line fails the run. On in docs-coupling.yml since 2026-11-22; release pull requests and bot branches are reported but never fail.
DOCS_HEALTH_TOKENtools/docs_check.pyA GitHub token that can read this repository’s pull requests. docs_check.py --health reads each merged pull request’s description with it (its Docs-impact lines) to measure the coupling debt; falls back to GH_TOKEN/GITHUB_TOKEN, and without any token the debt is labelled an upper bound.
GH_TOKENscripts/data/fetch_dataset.py, scripts/release/check_release_complete.py, tools/docs_check.py, tools/fetch_sibling_docs.py, tools/gen_repo_map.pyA GitHub token for reading the private sibling repositories and their releases: the dataset download, the pinned sibling docs, the repository-map check, the release-complete check and the sibling pin lag on the docs-health page. Preferred over GITHUB_TOKEN.
GITHUB_TOKENscripts/data/fetch_dataset.py, scripts/release/check_release_complete.py, tools/docs_check.py, tools/fetch_sibling_docs.py, tools/gen_repo_map.pyThe fallback GitHub token when GH_TOKEN is not set (the token GitHub Actions provides); read by the same scripts.
SGGS_READ_TOKENtools/fetch_sibling_docs.pyThe third fallback for reading the pinned sibling docs, after GH_TOKEN and GITHUB_TOKEN; in CI it is the read-only token for the sibling repositories.
VERCEL_AUTOMATION_BYPASS_SECRETscripts/ci/hukamnama_morning.py, scripts/ci/verify_functions.py, tools/contract_http.pyVercel’s protection-bypass secret, sent as x-vercel-protection-bypass so the contract replay and the function verification can reach a protected staging or preview deployment.
VERCEL_DOCS_BYPASS_SECRETscripts/ci/docs_smoke.pyThe wiki project’s protection-bypass secret, sent by the post-deploy smoke test to reach a protected wiki deployment.
VERCEL_ENVtools/build_api_functions.pySet by Vercel itself in every deployment (production, preview or development); never set by hand. The generated all function reads it to choose the Hukamnama API of the environment it runs in (hukamnama_api in gateway/routes.json; staging is a preview deployment).
VERCEL_ORG_IDscripts/ci/vercel_api.pyThe Vercel team the API calls of scripts/ci/vercel_api.py are made in; required with VERCEL_TOKEN.
VERCEL_PROJECT_IDscripts/ci/vercel_api.pyThe Vercel project scripts/ci/vercel_api.py has-production asks about.
VERCEL_TOKENscripts/ci/vercel_api.pyA Vercel API token for scripts/ci/vercel_api.py (which deployment serves a domain, a deployment’s target, whether a project has a production deployment).

How this page stays true

tools/gen_env_vars.py --check runs in the docs job and in make docs-check: a new read of a variable without a description, a description for a variable nothing reads any more, or a page that differs from the code fails it. To add a variable, read it in the code, add one sentence to the descriptions file and run python3 tools/gen_env_vars.py.