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

KeyVariableDefault
dataFORKBASE_DATA.forkbasethe data folder: secrets, the engine's database, local storage

[server]

KeyVariableDefault
listenFORKBASE_LISTEN127.0.0.1:8000address and port. Use 0.0.0.0:8000 in a container

[database]

KeyVariableDefault
modeFORKBASE_DBpostgrespostgres or chronos
urlFORKBASE_DATABASE_URLpostgres mode only: postgres:// or postgresql://. Required there, refused in chronos mode
FORKBASE_DATABASE_URL_FILEread the URL from a file (Docker secrets)
pool_sizeFORKBASE_POOL_SIZE16connections to the database

[chronos]

KeyVariableDefault
binFORKBASE_CHRONOS_BINnext to forkbase, then PATHthe engine program
pg_listenFORKBASE_CHRONOS_PG_LISTEN127.0.0.1:54329chronos mode: where apps reach the database

[auth]

KeyVariableDefault
external_urlFORKBASE_EXTERNAL_URLhttp://<listen>where this server is reached from outside; tokens name it, links point at it. Set it in production
site_urlFORKBASE_SITE_URLyour app; where people return after links and social sign-in
redirect_urlsFORKBASE_REDIRECT_URLS (commas)[]other allowed redirect_to targets (a URL allows the paths under it)
originsFORKBASE_ORIGINS (commas)[]extra browser origins for CORS; site_url's is always allowed
signupsFORKBASE_SIGNUPStrueanyone may sign up (false: only people an admin makes or invites)
passwordsFORKBASE_PASSWORDStrueemail and password sign-in
magic_linksFORKBASE_MAGIC_LINKStrueemailed links and codes
require_verifiedFORKBASE_REQUIRE_VERIFIEDfalsepassword sign-in waits for a verified address
access_ttl_sFORKBASE_ACCESS_TTL_S360060 to 604800

[auth.email]

KeyVariableDefault
modeFORKBASE_MAILloglog, smtp, file or off
fromFORKBASE_MAIL_FROMForkbase <noreply@localhost>
smtp_hostFORKBASE_SMTP_HOSTrequired for smtp
smtp_portFORKBASE_SMTP_PORT587
smtp_userFORKBASE_SMTP_USER
smtp_passwordFORKBASE_SMTP_PASSWORD
smtp_tlsFORKBASE_SMTP_TLSstarttlsstarttls, tls (port 465) or none (a relay on this machine)
fileFORKBASE_MAIL_FILErequired for file; relative to the data folder

[auth.google], [auth.github]

KeyVariable
client_idFORKBASE_GOOGLE_CLIENT_ID, FORKBASE_GITHUB_CLIENT_ID
client_secretFORKBASE_GOOGLE_CLIENT_SECRET, FORKBASE_GITHUB_CLIENT_SECRET
auth_url, token_url, api_urloverride the provider's endpoints (tests, compatible providers)

A provider is on when it has both an id and a secret.

[rest]

KeyVariableDefault
schemasFORKBASE_REST_SCHEMAS (commas)["public"]schemas served; the first is the default. Forkbase's own and system schemas are refused
max_rowsFORKBASE_MAX_ROWS1000most rows one read returns

[realtime]

KeyVariableDefault
tablesFORKBASE_REALTIME_TABLES (commas)[]tables whose changes are sent: schema.table or table

[storage]

KeyVariableDefault
backendFORKBASE_STORAGE_BACKENDlocallocal or s3
pathFORKBASE_STORAGE_PATHstorage (in the data folder)local backend's folder
file_size_limitFORKBASE_FILE_SIZE_LIMIT52428800 (50 MiB)bytes
s3_bucketFORKBASE_S3_BUCKETrequired for s3
s3_regionFORKBASE_S3_REGIONAWS_REGION, then us-east-1
s3_endpointFORKBASE_S3_ENDPOINTfor S3-compatible services (path-style requests)
s3_access_key_idFORKBASE_S3_ACCESS_KEY_IDAWS_ACCESS_KEY_ID or the machine's role
s3_secret_access_keyFORKBASE_S3_SECRET_ACCESS_KEYAWS_SECRET_ACCESS_KEY

[agents]

KeyVariableDefault
policiesFORKBASE_POLICIESpolicies (beside the file)folder of <name>.toml merge policies
default_policyFORKBASE_DEFAULT_POLICYforkbase_defaultpolicy for agents that name none
run_ttl_sFORKBASE_RUN_TTL_S3600how long a run may work (at least 10)
hold_ttl_sFORKBASE_HOLD_TTL_S604800how long a held run waits for a person (at least 60)
refresh_every_sFORKBASE_REFRESH_EVERY_S60postgres mode: how often the engine's copy takes Postgres's rows
undo_windowFORKBASE_UNDO_WINDOW7 dayschronos mode: how far back merges can be undone
slack_webhook_urlFORKBASE_SLACK_WEBHOOK_URLhttps:// Slack incoming webhook for held runs
approver_emailsFORKBASE_APPROVER_EMAILS (commas)[]who is emailed an approval link

[jobs]

KeyVariableDefault
enabledFORKBASE_JOBStruethis server runs jobs
workersFORKBASE_JOB_WORKERS4jobs at once (1 to 256)
node_binFORKBASE_NODE_BINnode on PATH.ts needs Node 22.6+
python_binFORKBASE_PYTHON_BINpython3 on PATH
timeout_s300a function's default time limit
max_timeout_s3600the most a function may ask for
memory_mb512default memory (at least 64)
max_memory_mb4096the most a function may ask for
max_attempts3default attempts (1 to 100)
log_bytes65536output kept per attempt (at least 1024)
keep_days30finished jobs are deleted after this (0: kept)

[observe]

The run ledger and OpenTelemetry export.

KeyVariableDefault
retention_daysFORKBASE_LEDGER_DAYS30ledger entries older than this are deleted, daily (0: kept)
sql_text_bytes4000SQL text kept per entry; longer is cut and marked
otlp_endpointFORKBASE_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_ENDPOINTOTLP/HTTP base URL (/v1/traces, /v1/metrics are added); unset: nothing is exported
otlp_headersOTEL_EXPORTER_OTLP_HEADERS (commas)[]name=value headers sent with every export
service_nameOTEL_SERVICE_NAMEforkbasethe exported service.name
metrics_every_s60how often metrics are exported (at least 1)

Other variables

Variable
FORKBASE_CONFIGthe configuration file
FORKBASE_LOGlog filter, as RUST_LOG: info (default), debug, forkbase=debug,fb_agents=trace
FORKBASE_PG_DUMPthe pg_dump the dashboard's dump download runs (postgres mode); default: the one on PATH
FORKBASE_URL, FORKBASE_SERVICE_KEYthe CLI's status, deploy and invoke: which server, with which key

A production file

TOML
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 = 8

Something wrong or missing? Edit this page on GitHub or open an issue.

Configuration · Forkbase