Configuration
Every forkbase.toml setting and FORKBASE_* variable, with its default.
Forkbase reads forkbase.toml (made by forkbase init; another file with --config or FORKBASE_CONFIG), then
FORKBASE_* variables over it. A variable always wins, so a container can be set up with variables alone and no
file. Relative paths in the file are relative to the file's folder. Unknown keys are an error, so a typo never goes
unnoticed.
Keep secrets (database URL with a password, SMTP password, OAuth client secrets, S3 keys, the Slack URL) in
variables, not the file. forkbase init writes the file readable by its owner only.
Top level
| Key | Variable | Default | |
|---|---|---|---|
data | FORKBASE_DATA | .forkbase | the data folder: secrets, the engine's database, local storage |
[server]
| Key | Variable | Default | |
|---|---|---|---|
listen | FORKBASE_LISTEN | 127.0.0.1:8000 | address and port. Use 0.0.0.0:8000 in a container |
[database]
| Key | Variable | Default | |
|---|---|---|---|
mode | FORKBASE_DB | postgres | postgres or chronos |
url | FORKBASE_DATABASE_URL | postgres mode only: postgres:// or postgresql://. Required there, refused in chronos mode | |
FORKBASE_DATABASE_URL_FILE | read the URL from a file (Docker secrets) | ||
pool_size | FORKBASE_POOL_SIZE | 16 | connections to the database |
[chronos]
| Key | Variable | Default | |
|---|---|---|---|
bin | FORKBASE_CHRONOS_BIN | next to forkbase, then PATH | the engine program |
pg_listen | FORKBASE_CHRONOS_PG_LISTEN | 127.0.0.1:54329 | chronos mode: where apps reach the database |
[auth]
| Key | Variable | Default | |
|---|---|---|---|
external_url | FORKBASE_EXTERNAL_URL | http://<listen> | where this server is reached from outside; tokens name it, links point at it. Set it in production |
site_url | FORKBASE_SITE_URL | your app; where people return after links and social sign-in | |
redirect_urls | FORKBASE_REDIRECT_URLS (commas) | [] | other allowed redirect_to targets (a URL allows the paths under it) |
origins | FORKBASE_ORIGINS (commas) | [] | extra browser origins for CORS; site_url's is always allowed |
signups | FORKBASE_SIGNUPS | true | anyone may sign up (false: only people an admin makes or invites) |
passwords | FORKBASE_PASSWORDS | true | email and password sign-in |
magic_links | FORKBASE_MAGIC_LINKS | true | emailed links and codes |
require_verified | FORKBASE_REQUIRE_VERIFIED | false | password sign-in waits for a verified address |
access_ttl_s | FORKBASE_ACCESS_TTL_S | 3600 | 60 to 604800 |
[auth.email]
| Key | Variable | Default | |
|---|---|---|---|
mode | FORKBASE_MAIL | log | log, smtp, file or off |
from | FORKBASE_MAIL_FROM | Forkbase <noreply@localhost> | |
smtp_host | FORKBASE_SMTP_HOST | required for smtp | |
smtp_port | FORKBASE_SMTP_PORT | 587 | |
smtp_user | FORKBASE_SMTP_USER | ||
smtp_password | FORKBASE_SMTP_PASSWORD | ||
smtp_tls | FORKBASE_SMTP_TLS | starttls | starttls, tls (port 465) or none (a relay on this machine) |
file | FORKBASE_MAIL_FILE | required for file; relative to the data folder |
[auth.google], [auth.github]
| Key | Variable | |
|---|---|---|
client_id | FORKBASE_GOOGLE_CLIENT_ID, FORKBASE_GITHUB_CLIENT_ID | |
client_secret | FORKBASE_GOOGLE_CLIENT_SECRET, FORKBASE_GITHUB_CLIENT_SECRET | |
auth_url, token_url, api_url | override the provider's endpoints (tests, compatible providers) |
A provider is on when it has both an id and a secret.
[rest]
| Key | Variable | Default | |
|---|---|---|---|
schemas | FORKBASE_REST_SCHEMAS (commas) | ["public"] | schemas served; the first is the default. Forkbase's own and system schemas are refused |
max_rows | FORKBASE_MAX_ROWS | 1000 | most rows one read returns |
[realtime]
| Key | Variable | Default | |
|---|---|---|---|
tables | FORKBASE_REALTIME_TABLES (commas) | [] | tables whose changes are sent: schema.table or table |
[storage]
| Key | Variable | Default | |
|---|---|---|---|
backend | FORKBASE_STORAGE_BACKEND | local | local or s3 |
path | FORKBASE_STORAGE_PATH | storage (in the data folder) | local backend's folder |
file_size_limit | FORKBASE_FILE_SIZE_LIMIT | 52428800 (50 MiB) | bytes |
s3_bucket | FORKBASE_S3_BUCKET | required for s3 | |
s3_region | FORKBASE_S3_REGION | AWS_REGION, then us-east-1 | |
s3_endpoint | FORKBASE_S3_ENDPOINT | for S3-compatible services (path-style requests) | |
s3_access_key_id | FORKBASE_S3_ACCESS_KEY_ID | AWS_ACCESS_KEY_ID or the machine's role | |
s3_secret_access_key | FORKBASE_S3_SECRET_ACCESS_KEY | AWS_SECRET_ACCESS_KEY |
[agents]
| Key | Variable | Default | |
|---|---|---|---|
policies | FORKBASE_POLICIES | policies (beside the file) | folder of <name>.toml merge policies |
default_policy | FORKBASE_DEFAULT_POLICY | forkbase_default | policy for agents that name none |
run_ttl_s | FORKBASE_RUN_TTL_S | 3600 | how long a run may work (at least 10) |
hold_ttl_s | FORKBASE_HOLD_TTL_S | 604800 | how long a held run waits for a person (at least 60) |
refresh_every_s | FORKBASE_REFRESH_EVERY_S | 60 | postgres mode: how often the engine's copy takes Postgres's rows |
undo_window | FORKBASE_UNDO_WINDOW | 7 days | chronos mode: how far back merges can be undone |
slack_webhook_url | FORKBASE_SLACK_WEBHOOK_URL | https:// Slack incoming webhook for held runs | |
approver_emails | FORKBASE_APPROVER_EMAILS (commas) | [] | who is emailed an approval link |
[jobs]
| Key | Variable | Default | |
|---|---|---|---|
enabled | FORKBASE_JOBS | true | this server runs jobs |
workers | FORKBASE_JOB_WORKERS | 4 | jobs at once (1 to 256) |
node_bin | FORKBASE_NODE_BIN | node on PATH | .ts needs Node 22.6+ |
python_bin | FORKBASE_PYTHON_BIN | python3 on PATH | |
timeout_s | 300 | a function's default time limit | |
max_timeout_s | 3600 | the most a function may ask for | |
memory_mb | 512 | default memory (at least 64) | |
max_memory_mb | 4096 | the most a function may ask for | |
max_attempts | 3 | default attempts (1 to 100) | |
log_bytes | 65536 | output kept per attempt (at least 1024) | |
keep_days | 30 | finished jobs are deleted after this (0: kept) |
[observe]
The run ledger and OpenTelemetry export.
| Key | Variable | Default | |
|---|---|---|---|
retention_days | FORKBASE_LEDGER_DAYS | 30 | ledger entries older than this are deleted, daily (0: kept) |
sql_text_bytes | 4000 | SQL text kept per entry; longer is cut and marked | |
otlp_endpoint | FORKBASE_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_ENDPOINT | OTLP/HTTP base URL (/v1/traces, /v1/metrics are added); unset: nothing is exported | |
otlp_headers | OTEL_EXPORTER_OTLP_HEADERS (commas) | [] | name=value headers sent with every export |
service_name | OTEL_SERVICE_NAME | forkbase | the exported service.name |
metrics_every_s | 60 | how often metrics are exported (at least 1) |
Other variables
| Variable | |
|---|---|
FORKBASE_CONFIG | the configuration file |
FORKBASE_LOG | log filter, as RUST_LOG: info (default), debug, forkbase=debug,fb_agents=trace |
FORKBASE_PG_DUMP | the pg_dump the dashboard's dump download runs (postgres mode); default: the one on PATH |
FORKBASE_URL, FORKBASE_SERVICE_KEY | the CLI's status, deploy and invoke: which server, with which key |
A production file
data = "/var/lib/forkbase"
[server]
listen = "127.0.0.1:8000" # behind a TLS proxy
[database]
mode = "postgres" # url from FORKBASE_DATABASE_URL_FILE
pool_size = 32
[auth]
external_url = "https://api.myapp.com"
site_url = "https://myapp.com"
redirect_urls = ["https://myapp.com/auth/callback"]
require_verified = true
[auth.email]
mode = "smtp"
from = "My App <noreply@myapp.com>"
smtp_host = "smtp.postmarkapp.com" # password from FORKBASE_SMTP_PASSWORD
[storage]
backend = "s3"
s3_bucket = "myapp-files"
s3_region = "eu-west-1"
[agents]
approver_emails = ["ops@myapp.com"] # Slack URL from FORKBASE_SLACK_WEBHOOK_URL
[jobs]
workers = 8Something wrong or missing? Edit this page on GitHub or open an issue.