Environment variables
The Runs on column says which container reads each variable: the backend, the scheduled job runner, or both.
Core
| Variable | Runs on | Required | Default | What it does |
|---|---|---|---|---|
DATABASE_URL | Both | Yes | None | PostgreSQL connection string, starting postgres:// or postgresql://. The backend applies migrations on startup, so this user needs permission to change the schema. |
REDIS_URL | Both | Backend: yes. Runner: only with email | None | Redis-compatible cache, starting redis:// or rediss://. |
BETTER_AUTH_SECRET | Backend | Yes | None | Signs sessions and tokens. At least 32 characters, for example from openssl rand -base64 32. Changing it signs everyone out. |
BETTER_AUTH_URL | Backend | Yes | None | Your server's public address, such as https://beacon.example.com. |
SERVER_NAME | Both | No | OpenBeacon | Name shown in the app, by GET /health and in email footers. |
SELF_HOSTED | Backend | No | true | Leave as true. When true, the backend refuses app feedback, which always goes to OpenBeacon's hosted server. |
Network
| Variable | Runs on | Required | Default | What it does |
|---|---|---|---|---|
OPENBEACON_API_PORT | Backend | No | 3000 | Port the API listens on. |
OPENBEACON_API_HOSTNAME | Backend | No | 0.0.0.0 | IPv4 address the API binds to. |
TRUSTED_PROXY_PROVIDER | Backend | No | none | Where to read each client's IP address from: none, trusted-proxy, cloudflare or cloudflare-authenticated. See Networking. |
CLOUDFLARE_ORIGIN_SECRET | Backend | With cloudflare-authenticated | None | Secret Cloudflare sends in the X-OpenBeacon-Origin-Secret header. At least 32 characters. |
Google sign-in
| Variable | Runs on | Required | Default | What it does |
|---|---|---|---|---|
GOOGLE_CLIENT_ID | Backend | No | None | Google web OAuth client ID. Set it with GOOGLE_CLIENT_SECRET to turn on Google sign-in. |
GOOGLE_CLIENT_SECRET | Backend | With GOOGLE_CLIENT_ID | None | Secret for that client. |
Set Resend or SMTP, not both, or neither to turn email off. Give the runner the same email settings as the backend. See Email.
| Variable | Runs on | Required | Default | What it does |
|---|---|---|---|---|
RESEND_API_KEY | Both | No | None | Sends email through Resend. A sending-only key works. |
SMTP_HOST | Both | No | None | Sends email through this SMTP server. |
SMTP_PORT | Both | No | 465 with SMTP_SECURE=true, otherwise 587 | SMTP port. |
SMTP_SECURE | Both | No | true on port 465 | Connect with implicit TLS. |
SMTP_REQUIRE_TLS | Both | No | true | Refuse to send unless STARTTLS succeeds. Set false only for a local plaintext relay. |
SMTP_USER | Both | With SMTP_PASSWORD | None | SMTP username. |
SMTP_PASSWORD | Both | With SMTP_USER | None | SMTP password. |
EMAIL_FROM | Both | With Resend or SMTP | None | Sender address. Emails come from OpenBeacon <EMAIL_FROM>. |
EMAIL_CODE_IP_LIMIT | Backend | No | false | Also 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.
| Variable | Runs on | Required | Default | What it does |
|---|---|---|---|---|
S3_ENDPOINT | Both | No | OpenBeacon's storage provider | S3 API endpoint. Set this to your own. |
S3_REGION | Both | No | us-east-005 | S3 region. |
S3_ACCESS_KEY_ID | Both | Yes | None | Access key ID. At least 20 characters. |
S3_ACCESS_KEY | Both | Yes | None | Secret key. At least 20 characters. |
S3_BUCKET_NAME | Both | Yes | None | Bucket that holds pictures. |
S3_CDN_URL | Both | No | https://cdn.openbeacon.net/file | Public base address for picture links. Set this to your own. |
MAX_IMAGE_FILE_SIZE | Backend | No | 5242880 (5 MB) | Largest picture upload, in bytes. |
Map tiles
All required by both the backend and the runner. See Map tiles.
| Variable | What it does |
|---|---|
R2_ACCOUNT_ID | Cloudflare account ID that owns the bucket. |
R2_ACCESS_KEY_ID | R2 access key ID. |
R2_SECRET_ACCESS_KEY | R2 secret key. |
R2_BUCKET | Bucket that holds the map file. |
R2_PM_TILES_KEY | Name of the PMTiles file in the bucket. Startup fails if it doesn't exist. |