Configuration and environment variables

Last updated:

Which environment variables does Commentpin use?

Commentpin reads its settings from environment variables, usually in a .env file. The full list with comments is in .env.example in the repository. With Docker Compose, the defaults work as they are.

Core

VariableWhat it does
APP_URLPublic URL of the app, with no trailing slash. Used for sign-in links, emails and the widget snippet.
DATABASE_URLPostgres connection string. Docker Compose sets it.
BETTER_AUTH_SECRETSigns sessions. At least 32 characters. Docker generates one if empty.

Sign-in

Magic links by email work out of the box. GitHub and Google buttons appear when both values are set:

  • GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET (callback <APP_URL>/api/auth/callback/github)
  • GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET (callback <APP_URL>/api/auth/callback/google)

Email

VariableWhat it does
EMAIL_FROMSender name and address
RESEND_API_KEYUse Resend. Takes priority over SMTP.
SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, SMTP_SECUREAny SMTP server. Docker Compose points at Mailpit.

Screenshot storage

VariableWhat it does
STORAGE_DRIVERauto (default): S3 if the S3 values are set, otherwise local disk. Also s3, local, none.
DATA_DIRLocal disk folder. Docker uses the appdata volume.
S3_ENDPOINT, S3_REGION, S3_BUCKET, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_FORCE_PATH_STYLEAny S3-compatible storage. The bucket needs a CORS rule allowing PUT with a content-type header from any origin.

Scheduled jobs

CRON_SECRET protects /api/cron/*. Docker generates it, and the cron service calls the jobs.

Integrations

GitHub, Linear and webhook settings are in integration setup. ENCRYPTION_KEY encrypts stored tokens. WEBHOOKS_ALLOW_PRIVATE=true lets webhooks reach private network addresses.

Single sign-on

SSO_IDP_ORIGINS adds identity provider addresses for single sign-on, comma-separated, such as https://sso.example.com,https://*.my-idp.com. Okta, Microsoft Entra ID, Google, Auth0, OneLogin, JumpCloud and Ping are allowed without it.

See also Docker and running on a VPS.