Environment variables
Required
| Variable | Notes |
|---|---|
GITHUB_TOKEN | Fine-grained PAT, single repo, Contents: Read and write |
COMMENTS_REPO | owner/repo for comment data |
COMMENTS_SECRET | At least 32 bytes, HKDF master secret |
SELF_ORIGIN | Public URL of this service, no trailing slash |
ALLOWED_ORIGINS | Comma-separated blog origins |
TURNSTILE_SITE_KEY | Optional. Setting it enables verification |
TURNSTILE_SECRET | Optional. 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
| Variable | Default | Required when | Notes |
|---|---|---|---|
MODERATION_REQUIRED | true | never | false writes directly |
MODERATOR_EMAIL | — | moderation on | Review recipient |
MAIL_PROVIDER | auto | never | resend or mailport |
RESEND_API_KEY | — | moderation on with Resend | |
RESEND_FROM | — | with the API key | Name <addr@domain> |
MAILPORT_BASE_URL | — | moderation on with MailPort | no trailing slash |
MAILPORT_PID | — | with MailPort | 5–10 character route id |
MAILPORT_API_KEY | — | with MailPort | 32-character key |
Selection: explicit MAIL_PROVIDER wins; otherwise Resend, then MailPort; if both are configured Resend wins.
Optional
| Variable | Default | Notes |
|---|---|---|
COMMENTS_BRANCH | main | Target branch |
COMMENTS_PATH | comments | Directory in the repo |
SELF_REPO | empty | Used 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/healthreturns503withdegraded- Endpoints that need the missing values return
503 - Other endpoints keep working