Environment variables

Required

VariableNotes
GITHUB_TOKENFine-grained PAT, single repo, Contents: Read and write
COMMENTS_REPOowner/repo for comment data
COMMENTS_SECRETAt least 32 bytes, HKDF master secret
SELF_ORIGINPublic URL of this service, no trailing slash
ALLOWED_ORIGINSComma-separated blog origins
TURNSTILE_SITE_KEYOptional. Setting it enables verification
TURNSTILE_SECRETOptional. Must be set together with the site key

Turnstile is optional: leave both empty to disable verification; setting only one is a configuration error and health reports degraded. It is independent of moderation.

Moderation and mail

VariableDefaultRequired whenNotes
MODERATION_REQUIREDtrueneverfalse writes directly
MODERATOR_EMAIL—moderation onReview recipient
MAIL_PROVIDERautoneverresend or mailport
RESEND_API_KEY—moderation on with Resend
RESEND_FROM—with the API keyName <addr@domain>
MAILPORT_BASE_URL—moderation on with MailPortno trailing slash
MAILPORT_PID—with MailPort5–10 character route id
MAILPORT_API_KEY—with MailPort32-character key

Selection: explicit MAIL_PROVIDER wins; otherwise Resend, then MailPort; if both are configured Resend wins.

Optional

VariableDefaultNotes
COMMENTS_BRANCHmainTarget branch
COMMENTS_PATHcommentsDirectory in the repo
SELF_REPOemptyUsed only for the same-repo warning

There is no SAME_REPO switch. COMMENTS_REPO expresses it.

Startup validation

Incomplete configuration never crashes the service:

  • /api/health returns 503 with degraded
  • Endpoints that need the missing values return 503
  • Other endpoints keep working