Skip to content

Environment Variables

This page summarizes the env vars used by the backend. Some values in backend/.env.example are recommended deployment examples; code defaults may differ.

Core settings

VariableRequiredDefaultDescription
OPENPOST_PORTNo8080HTTP server port.
OPENPOST_DB_PATHNofile:openpost.db?cache=shared&mode=rwcSQLite database path or DSN.
OPENPOST_FRONTEND_URLNo, but set it in real deploymentshttp://localhost:5173Public frontend origin used for CORS and auth flow assumptions.
OPENPOST_CORS_EXTRA_ORIGINSNoemptyExtra comma-separated origins to allow.
JWT_SECRETYes for productiondevelopment fallback in codeSecret used to sign JWTs.
ENCRYPTION_KEYYes for productiondevelopment fallback in codeSecret used to encrypt stored OAuth tokens.
OPENPOST_MEDIA_PATHNo./mediaLocal directory for uploaded media.
OPENPOST_MEDIA_URLNo, but required for Threads production use/mediaPublic base URL for media files.
OPENPOST_ENVNoemptySet to production or prod to enforce production secret validation.

X

VariableRequiredDefaultDescription
TWITTER_CLIENT_IDYes for XemptyX OAuth client ID.
TWITTER_CLIENT_SECRETYes for XemptyX OAuth client secret.
TWITTER_REDIRECT_URINohttp://localhost:8080/api/v1/accounts/x/callbackX callback URL override.

Mastodon

VariableRequiredDefaultDescription
MASTODON_REDIRECT_URINohttp://localhost:8080/api/v1/accounts/mastodon/callbackMastodon callback URL override.
MASTODON_SERVERSYes for MastodonemptyJSON array of configured Mastodon apps and instance URLs.

LinkedIn

VariableRequiredDefaultDescription
LINKEDIN_CLIENT_IDYes for LinkedInemptyLinkedIn OAuth client ID.
LINKEDIN_CLIENT_SECRETYes for LinkedInemptyLinkedIn OAuth client secret.
LINKEDIN_REDIRECT_URINohttp://localhost:8080/api/v1/accounts/linkedin/callbackLinkedIn callback URL override.
OPENPOST_DISABLE_LINKEDIN_THREAD_REPLIESNofalseDisable LinkedIn comment-style child replies for thread posts.

Threads

VariableRequiredDefaultDescription
THREADS_CLIENT_IDYes for ThreadsemptyMeta app ID.
THREADS_CLIENT_SECRETYes for ThreadsemptyMeta app secret.
THREADS_REDIRECT_URINohttp://localhost:8080/api/v1/accounts/threads/callbackThreads callback URL override.

Notes

  • backend/.env.example is still the best copy-paste starting point.
  • Set explicit public URLs in production even when defaults exist.
  • For Threads, treat OPENPOST_MEDIA_URL as mandatory.

Released under the MIT License.