Skip to Content

Environment variables

The Runs on column says which container reads each variable: the backend, the scheduled job runner, or both.

Core

VariableRuns onRequiredDefaultWhat it does
DATABASE_URLBothYesNonePostgreSQL connection string, starting postgres:// or postgresql://. The backend applies migrations on startup, so this user needs permission to change the schema.
REDIS_URLBothBackend: yes. Runner: only with emailNoneRedis-compatible cache, starting redis:// or rediss://.
BETTER_AUTH_SECRETBackendYesNoneSigns sessions and tokens. At least 32 characters, for example from openssl rand -base64 32. Changing it signs everyone out.
BETTER_AUTH_URLBackendYesNoneYour server's public address, such as https://beacon.example.com.
SERVER_NAMEBothNoOpenBeaconName shown in the app, by GET /health and in email footers.
SELF_HOSTEDBackendNotrueLeave as true. When true, the backend refuses app feedback, which always goes to OpenBeacon's hosted server.

Network

VariableRuns onRequiredDefaultWhat it does
OPENBEACON_API_PORTBackendNo3000Port the API listens on.
OPENBEACON_API_HOSTNAMEBackendNo0.0.0.0IPv4 address the API binds to.
TRUSTED_PROXY_PROVIDERBackendNononeWhere to read each client's IP address from: none, trusted-proxy, cloudflare or cloudflare-authenticated. See Networking.
CLOUDFLARE_ORIGIN_SECRETBackendWith cloudflare-authenticatedNoneSecret Cloudflare sends in the X-OpenBeacon-Origin-Secret header. At least 32 characters.

Google sign-in

VariableRuns onRequiredDefaultWhat it does
GOOGLE_CLIENT_IDBackendNoNoneGoogle web OAuth client ID. Set it with GOOGLE_CLIENT_SECRET to turn on Google sign-in.
GOOGLE_CLIENT_SECRETBackendWith GOOGLE_CLIENT_IDNoneSecret for that client.

Email

Set Resend or SMTP, not both, or neither to turn email off. Give the runner the same email settings as the backend. See Email.

VariableRuns onRequiredDefaultWhat it does
RESEND_API_KEYBothNoNoneSends email through Resend. A sending-only key works.
SMTP_HOSTBothNoNoneSends email through this SMTP server.
SMTP_PORTBothNo465 with SMTP_SECURE=true, otherwise 587SMTP port.
SMTP_SECUREBothNotrue on port 465Connect with implicit TLS.
SMTP_REQUIRE_TLSBothNotrueRefuse to send unless STARTTLS succeeds. Set false only for a local plaintext relay.
SMTP_USERBothWith SMTP_PASSWORDNoneSMTP username.
SMTP_PASSWORDBothWith SMTP_USERNoneSMTP password.
EMAIL_FROMBothWith Resend or SMTPNoneSender address. Emails come from OpenBeacon <EMAIL_FROM>.
EMAIL_CODE_IP_LIMITBackendNofalseAlso limits each IP address to 20 code requests an hour. Off by default because it can block people who share an IP address.

Picture storage

The backend and runner must use the same bucket and S3_CDN_URL. See Picture storage.

VariableRuns onRequiredDefaultWhat it does
S3_ENDPOINTBothNoOpenBeacon's storage providerS3 API endpoint. Set this to your own.
S3_REGIONBothNous-east-005S3 region.
S3_ACCESS_KEY_IDBothYesNoneAccess key ID. At least 20 characters.
S3_ACCESS_KEYBothYesNoneSecret key. At least 20 characters.
S3_BUCKET_NAMEBothYesNoneBucket that holds pictures.
S3_CDN_URLBothNohttps://cdn.openbeacon.net/filePublic base address for picture links. Set this to your own.
MAX_IMAGE_FILE_SIZEBackendNo5242880 (5 MB)Largest picture upload, in bytes.

Map tiles

All required by both the backend and the runner. See Map tiles.

VariableWhat it does
R2_ACCOUNT_IDCloudflare account ID that owns the bucket.
R2_ACCESS_KEY_IDR2 access key ID.
R2_SECRET_ACCESS_KEYR2 secret key.
R2_BUCKETBucket that holds the map file.
R2_PM_TILES_KEYName of the PMTiles file in the bucket. Startup fails if it doesn't exist.

On this page