Skip to content
DDelTech MUNDocs

Environment variables

Every variable the app reads, what it is for, and where to get its value.

There are three places a value can live, and which one it belongs in is decided by when it is read.

WhereWhat goes thereRead
GitHub Environment variable (production, staging)NEXT_PUBLIC_APP_URLAt image build. Changing it needs a deploy.
/srv/mun/app.env on the box, mode 600Every runtime secretWhen the container starts. Edit, then docker compose up -d app.
.env locallyYour own copiesBy next dev. Never committed.

NEXT_PUBLIC_* values are inlined into the JavaScript bundle at build time. Never put a secret behind that prefix.

Set by the image

The Dockerfile sets these; do not put them in app.env.

VariableWhy
APP_ENVproduction or staging. Drives the staging ribbon. Replaces the old VERCEL_ENV.
APP_VERSIONThe commit SHA. /api/health reports it, and the deploy workflow checks it.
AUTH_URLDerived from NEXT_PUBLIC_APP_URL. Without it Auth.js puts http://0.0.0.0:3000 into sign-in redirects.
AUTH_TRUST_HOSTtrue. Safe because Caddy only forwards this deployment's own hostnames.
PORT, HOSTNAME3000, 0.0.0.0.

Database

VariableWhat it is
DATABASE_URLRuntime connection. On a box, the Postgres container over the Compose network.
DIRECT_URLUsed by migrations. Locally the same as DATABASE_URL; against a box, a URL through an SSH tunnel.
DATABASE_POOL_MAXPool size. Code default 15; the boxes set 5, against max_connections=50.

Auth

VariableWhat it is
AUTH_SECRETSigns session tokens. Different per environment.
ADMIN_EMAILThe seeded admin account.

Email

VariableWhat it is
EMAIL_TRANSPORTresend (default) or ses. Production stays on Resend until SES production access is granted.
AUTH_RESEND_KEYResend API key.
SES_REGIONDefaults to ap-south-1.
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEYRead by the SES client. On the boxes, the same per-environment IAM key as S3.
EMAIL_FROMSender. Defaults to noreply@deltechmun.in.
EMAIL_REDIRECT_TOStaging only. Sends every message to one inbox, real recipient in the subject. If it is ever unset, staging mails real people.

Storage

VariableWhat it is
S3_BUCKET, S3_REGIONdeltechmun-media-prod or -staging, ap-south-1.
S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEYServer only. The browser gets a presigned URL instead.
S3_PUBLIC_BASE_URLOptional public origin. Defaults to the bucket's own URL.
S3_ENDPOINTOptional, for MinIO or LocalStack locally.

Payments

VariableWhat it is
RAZORPAY_KEY_ID, RAZORPAY_KEY_SECRETLive keys on production, test keys on staging.
RAZORPAY_WEBHOOK_SECRETVerifies webhook signatures. Unset means every webhook is rejected.
UPI_VPA, UPI_PAYEE_NAMEFallbacks when the admin console has none.

Integrations

VariableWhat it is
CRON_SECRETBearer token the cron routes require. Staging has its own value.
GFORM_SHARED_SECRETHeader secret for the Google Form webhook.
SHEET_SYNC_SECRETAuthenticates the outbound sheet mirror.
GROQ_API_KEY, GROQ_MODELAI import mapping. Optional.

Development and scripts only

VariableWhat it is
ALLOW_DESTRUCTIVE_SEEDMust be 1 for the staging seed to run.
RECRUITMENT_DB_CHECKSEnables the database-backed recruitment concurrency check.
QUIZ_LOAD_*Options for scripts/load-quiz.ts.

Other files on the box

FileHolds
/srv/mun/caddy.envACME_EMAIL for certificate notices.
/srv/mun/db.envThe Postgres container's credentials.

Compose would normally expand $ inside these files, which silently empties a value such as a password hash. They are loaded with format: raw in deploy/compose.yml for that reason.

GitHub

NameKindWhat it is
DEPLOY_HOST, DEPLOY_KNOWN_HOSTSEnvironment secretThat environment's box address and host key.
DEPLOY_SSH_KEYSecretThe deploy user's key.
CRON_SECRETRepository secretProduction's value, used by the cron workflow.
AWS_DEPLOYRepository variableDeploys do nothing unless true.
CRON_ENABLEDRepository variableScheduled cron calls do nothing unless true.