Server Configuration
server.toml is owned by the platform admin and passed with --server-config. It sets the runtime
boundary the app runs within: listeners, the database, resource limits, runtimes, logging, named
HTTP servers, and whether exec activities are available at all. These settings belong to the host
and normally stay the same through an app's lifecycle. The file is optional: without it, the
built-in defaults apply. Environment overrides of the form OBELISK__... apply to this file only.
See Configuration for how it relates to
app.toml and deployment.toml.
API Server
api.listening_addr = "127.0.0.1:5005" # Address and port for API server
api.public_url = "https://api.example.com" # Optional URL behind a proxy, used by the api-url source
api.max_stream_duration.minutes = 10 # Follow/SSE responses end cleanly after this durationAPI Authentication
The API port denies any request without a valid Authorization: Bearer <token> header. Persistent
tokens are configured as SHA-256 hashes, which are not secrets, so server.toml stays safe to
commit:
api.token_hashes = [
"sha256:...", # agent
"sha256:...", # laptop
]
A plaintext token can also be injected through --api-token or the environment variable
OBELISK_API_TOKEN; do not write the plaintext into a committed server.toml. There is no
plaintext api.token key in server.toml. See
Authentication for the full model,
generating tokens, and server run --dev for local development.
Web UI
webui.listening_addr = "127.0.0.1:8080" # Address and port for web UI
webui.public_url = "https://webui.example.com" # Optional browser URL behind a proxy
webui.public_url is the value of app public environment entries with
{ type = "internal", source = "webui-url" } (see
Internal public environment).
It must be an HTTP(S) URL without credentials, query, or fragment. Without it, those entries use the
local Web UI listener address.
The Web UI needs no credentials of its own and always starts: every action it takes goes through the API's authentication.
App Environment Prefix
By default, app public environment variables and env-backed secrets declared in app.toml are read
from process variables of the same name. A platform hosting several apps, or keeping its own
variables apart from the app's, can prepend a prefix:
app_env_prefix = "APP_"
With this setting, OPENAI_KEY declared in app.toml is read from APP_OPENAI_KEY, and there is
no fallback to the unprefixed name. Components and deployment ${...} references keep using the
logical name. The prefix does not apply to server settings such as OBELISK__... overrides,
OBELISK_API_TOKEN, or OBELISK_APP_NAME. The default is an empty prefix.
Platform Exec Gate
Exec activities run host
processes outside the WASM sandbox, so they are disabled by default. They need approval from
both the platform admin in server.toml and the app admin in app.toml (see
App Exec Approval).
allowed_exec_activities = "*" # Allow any app-approved exec activity; startup warns.
# Or limit the platform grant to reviewed component digests:
# [allowed_exec_activities]
# worker = "sha256:..."
Omitting the field or setting it to false disables exec activities. Every digest in app.toml
must be covered by the platform grant. Both files accept an array of digests when overlapping
deployment revisions must be authorized.
Server Limits
[limits]
max_persisted_value_size.mib = 1 # default
max_deployment_file_size.mib = 20 # default
max_transport_message_size.mib = 512 # default
Sizes take the unit as the key: bytes, kib, mib or gib.
max_deployment_file_size limits an individual file submitted as part of a deployment.
max_persisted_value_size is snapshotted by each new execution tree and bounds persisted
parameters and results. max_transport_message_size independently bounds a single API request
body. The 0.42 byte-count keys max_persisted_value_size_bytes, max_deployment_file_bytes and
max_transport_message_size_bytes are still accepted with a deprecation warning.
Execution Slots
Every execution slot in the process is charged to exactly one (workload, runtime) cell. count is
how many slots the cell grants, and memory is how much memory one slot may hold. Both accept
"unlimited". Byte sizes require a unit key: memory.mib, memory.gib, or memory.bytes. The
defaults are:
[limits.activities.wasm] # Includes JavaScript activities with OBELISK_JS_RUNTIME=boa-wasm.
count = 500
memory.gib = 1
[limits.activities.v8]
count = 16
memory.mib = 256
[limits.activities.process] # activity_exec: an operating system process, so no `memory`.
count = 32
[limits.workflows.wasm] # Includes JavaScript workflows with OBELISK_JS_RUNTIME=boa-wasm.
count = 500
memory.mib = 512
[limits.workflows.v8]
count = 100
memory.mib = 256
[limits.webhooks.wasm] # Includes JavaScript webhook endpoints with OBELISK_JS_RUNTIME=boa-wasm.
count = 500
memory.mib = 512
[limits.webhooks.v8]
count = 16
memory.mib = 256
The cells are independent reservations, so no workload or runtime can starve another, and their sum
is the process bound. Executors acquire a slot before locking an execution, so work beyond the limit
stays pending in the database. A webhook request that cannot acquire a slot receives
503 Service Unavailable; capacity is acquired only after a route matches.
JavaScript components use the wasm or v8 cells depending on the selected
JS runtime.
Automatic Maintenance and Retention
Obelisk removes tombstoned execution trees and unreferenced shared data in bounded background batches. Automatic maintenance is enabled by default. Completed execution trees, inactive deployments, and system events each default to a maximum age of 31 days. Execution trees and deployments are also capped by count: by default the newest 1,000 finished top-level execution trees and the newest 100 inactive deployments are kept:
[maintenance.gc]
enabled = true
interval.seconds = 30
batch_size = 1000
batch_delay.milliseconds = 25
upload_grace_period.hours = 1 # Keep files uploaded via PUT /v1/files until a deployment references them
[maintenance.gc.retention.executions]
enabled = true
max_age.hours = 744
max_count = 1000
[maintenance.gc.retention.deployments]
enabled = true
max_age.hours = 744
max_count = 100
[maintenance.gc.retention.system_events]
enabled = true
max_age.hours = 744
A record is deleted once it is older than max_age or falls outside the newest max_count; set
max_count = 0 to disable the count limit. Deployment age and order use updated_at, which a
submit with matching content or a status change bumps. Unfinished execution trees and active cron
trackers are never deleted by retention. Active and enqueued deployments and the most recently
deactivated one are kept, and deleting a deployment also deletes its execution trees. Inactive
deployments that are still referenced count toward max_count but stay until they are no longer in
use; the sweep records a maintenance.gc.deployments_in_use warning while that happens.
Garbage collection steps that conflict with a running deployment submit or switch are deferred to
the next sweep and recorded as an info-level maintenance.gc.deferred_by_deployment event.
maintenance.gc.completed and maintenance.gc.deferred_by_deployment events carry the active
deployment ID.
System event retention never deletes events of the current node run, nor the CAS blobs they
reference. Disable a specific retention policy when that class must be retained indefinitely.
Disable maintenance.gc only when maintenance is managed externally. Operator-triggered deletion
and retention operations are also available through obelisk admin and /v1/admin.
Sqlite
The SQLite database directory defaults to a per-app path:
database.sqlite.directory = "${DATA_DIR}/apps/${APP_NAME}/sqlite"
${APP_NAME} is the configured app name. Releases before 0.42 used ${DATA_DIR}/obelisk-sqlite;
set that value explicitly to keep using an existing database. See Path Prefixes
for how ${DATA_DIR} is translated.
Customize PRAGMA statements. Defaults are in crates/db-sqlite/src/sqlite_dao.rs
database.sqlite.pragma = { "cache_size" = "10000", "synchronous" = "FULL" }
By default (fsync = "group"), commits run with synchronous = NORMAL and a single fsync of the
WAL covers all commits made before it. It runs before a commit is revealed outside of the server:
before an API call or webhook responds, an activity runs, or an external read returns. Writes
nobody waits for are synced after one second of inactivity. A power loss or OS crash can roll back
only commits that were not revealed, although log lines, traces and metrics may already mention
them. With fsync = "commit", every commit fsyncs the WAL. group cannot be combined with a
synchronous pragma: setting the pragma requires fsync = "commit".
database.sqlite.fsync = "commit"
database.sqlite.litestream.socket replicates synchronously: every fsync is followed by a sync
through the Litestream control socket (socket.path in the Litestream configuration), so a
commit is revealed only after Litestream uploads it. Litestream must be replicating the database
before the server starts; the server waits for it on startup. The server does not check that the
database matches the replica: after a host crash the replica can be ahead of the local database,
so the launcher must restore the replica before starting Litestream whenever the database is
behind it or does not match Litestream's local position.
database.sqlite.litestream.socket = "/var/run/litestream.sock"
With sync = "deployments", only deployment submits wait for the upload, so a restored replica
holds every submitted deployment while other commits reach it on Litestream's own schedule. The
default sync = "all" waits on every commit.
database.sqlite.litestream = { socket = "/var/run/litestream.sock", sync = "deployments" }
SQLite databases use auto_vacuum=INCREMENTAL. After retention and garbage collection, each
automatic maintenance sweep returns freed pages to the file system in bounded batches, pausing for
maintenance.gc.batch_delay between them, so the database file shrinks after large deletions
without a full VACUUM. A full VACUUM remains optional for fragmentation within partially filled
pages. The file size reflects reclaimed pages after the next WAL checkpoint.
A database created by 0.43.0-rc.11 or earlier is converted once at startup with a full VACUUM. The
conversion can noticeably lengthen that startup on a large database and temporarily needs free disk
space up to twice the database size.
PostgreSQL
TLS is disabled by default. Set database.postgres.ssl_mode = "verify_full" to encrypt connections
and verify the certificate chain and host name against system certificates. Set
database.postgres.ssl_root_cert to a PEM file to use a custom set of trusted CAs instead.
Configure connection to Postgres. All of the following keys support environment variable interpolation.
database.postgres.host = "${POSTGRES_HOST}"
database.postgres.user = "${POSTGRES_USER}"
database.postgres.password = "${POSTGRES_PASSWORD}"
database.postgres.db_name = "${POSTGRES_DATABASE}"Database creation
database.postgres.provision_policy = "never" # One of "auto"|"never".
If auto is selected, missing database will be created on startup.
Timers Watcher Configuration
[timers_watcher]
enabled = true
leeway.milliseconds = 500
tick_sleep.milliseconds = 100Global WASM Configuration
[wasm]
cache_directory = "${CACHE_DIR}/wasm" # WASM file cache location
allocator_config = "auto" # One of "auto"|"on_demand"|"pooling"
fuel = "unlimited" # If set to an integer, WASM instances consume fuel, details: https://docs.wasmtime.dev/api/wasmtime/struct.Store.html#method.set_fuel
build_semaphore = "unlimited" # If set to an integer, limits the number of AOT compilations that can run in parallel.
parallel_compilation = true # Enable (default) or disable parallel AOT compilation of each WASM component.
debug = false # Emit DWARF debug info and disable Cranelift optimizations.
Concurrency and per-instance memory are configured by the execution slot cells
of [limits].
See Path Prefixes for how ${CACHE_DIR} is translated.
WASM Cache Directory
Path to directory where downloaded or transformed WASM files are stored. Supports
path prefixes. By default "${CACHE_DIR}/wasm" or "./cache/wasm" if no valid
home directory path could be retrieved from the operating system.
Allocator Configuration
See
Allocation strategy
for instance creation. Can be either
pooling or
on demand.
Default value auto will attempt to use the pooling strategy with a fallback on error to
on_demand.
Code Generation Cache
The compiled binaries can be stored to speed up startup time.
[wasm.codegen_cache]
enabled = true
directory = "${CACHE_DIR}/codegen" # Path to directory where AOT generated code is cached. Supports path prefixes.JS Runtime Configuration
The [v8] table and the choice between the boa-wasm and v8 runtimes are described in
JS runtime.
Global Webhook Configuration
[webhooks]
request_timeout.seconds = 30 # Deadline for a webhook handler to return its HTTP response.
max_stream_duration.minutes = 10 # Streaming responses are cut off after this duration.
The deadline applies to all webhook handlers, and only covers the time until the response headers
are returned. It does not limit a streaming response body after that; max_stream_duration does,
including for silent streams. A response still streaming when the duration expires is truncated, so
its connection is aborted: HTTP/1.1 clients see a body shorter than its Content-Length or without
the final chunk, HTTP/2 clients see a stream reset. A handler that wants a clean end must finish
its stream before the limit.
Outbound HTTP Connection Pool
Outbound HTTPS from activities and webhook endpoints trusts the host's system certificates, including installed private CAs. Install a CA bundle on hosts and in custom container images; Obelisk no longer supplies bundled Mozilla roots.
Activities and webhook endpoints share one pool of outbound HTTP connections. Idle HTTP/1 connections are reused per scheme, host and port.
[outbound_http_pool]
max_idle_per_host = 16 # Idle connections kept per scheme, host and port. 0 opens a new connection for every request.
idle_timeout.seconds = 4 # How long an idle connection is kept when the server sends no Keep-Alive hint.
When a response carries a Keep-Alive: timeout=N header, the connection is kept for one second less
than N (at most 10 minutes) instead, so a reused connection is not closed by the server while a
request is being sent. Requests are not retried automatically if that still happens.
Platform Integrations
Hosting platforms that serve integrations to activities and webhook endpoints over HTTP list their origins here. Requests to them carry the calling execution's ID:
[integrations]
origins = ["http://127.0.0.1:9195"] # Scheme, host and port; no path.
An origin matches a request URL by exact scheme, host (case-insensitive) and port, where a missing
port is the scheme default. Matching requests get the caller's execution ID in the
Obelisk-Int-Execution-Id header, so the service can attribute work to an execution.
Components may not set any Obelisk-Int-* header themselves, for any destination: such a request is
denied with an outbound_http.denied system event whose rejected_by is reserved_header. A
service reached under another host name for the same address therefore sees no header instead of a
forged one. Native activity_exec processes never get the header.
Global Workflow Configuration
[workflows]
subscription_interruption.seconds = 1 # Interrupts listening for notifications periodically. Needed for Postgres with a local-only subscription mechanism. Value can be "none" or a duration.
max_events_per_run = 100 # Max history events a real workflow run writes before it yields and unlocks, improving fairness across concurrent workflows. Replay uses max_replay_captured_writes instead.
max_replay_captured_writes = 100 # Max captured writes a single replay pass returns. On reaching it, replay stops and returns that many as an advanceable prefix (advance them, then replay again to resume), keeping a non-terminating join-next-try poll loop advanceable in bounded batches.
response_refresh_interval = 32 # Reload responses from the database after this many newly written non-blocking events while a workflow keeps running. Usually set below max_events_per_run. Replay ignores it.HTTP Servers
Webhook endpoints are served by HTTP servers declared in the http_server table, keyed by name. Two
are built in and enabled by default, so they need no declaration:
| Name | Default address | Intended for |
|---|---|---|
external | 127.0.0.1:9090 | Webhooks reachable by third parties. |
internal | 127.0.0.1:9091 | Webhooks meant to sit behind authentication, such as a proxy. |
Obelisk treats both like any other server; the name only states intent. Every webhook endpoint in
deployment.toml names its server with http_server. The name webui is reserved: the Web UI is
configured in [webui].
http_server.external.listening_addr = "127.0.0.1:9090"
http_server.internal.enabled = false # Disable a built-in server.
# Additional servers need a listening address.
[http_server.partner]
listening_addr = "0.0.0.0:9000"
public_url = "https://partner.example.com" # Optional browser URL behind a proxy.
Settings can be overridden by environment variables such as
OBELISK__HTTP_SERVER__EXTERNAL__ENABLED=false. Webhook listeners serve HTTP/1.1 and cleartext
HTTP/2 (prior knowledge, without TLS) on the same port.
Credentials and Public Servers
A server can require a bearer token on every request, checked before routing. Missing or invalid
tokens return 401; a verified JWT matching no entry returns 403.
# Accept every token the API accepts: the startup token, --api-token,
# api.token_hashes and api.oidc. Requires an enabled API.
http_server.internal.api_auth = true
# Accept OIDC ID tokens matching any entry; matching works like [[api.oidc]].
[[http_server.internal.oidc]]
issuer = "https://oidc.fly.io/my-org"
audience = "https://internal.example.com"
claims = { app_name = "my-proxy" }
A verified Authorization header is removed before the request reaches the webhook. After an OIDC
token, the obelisk-oidc-claims header carries its claims as JSON; a client-supplied header of that
name is always removed.
A server without oidc or api_auth accepts requests without credentials, so it starts only when
the app admin lists it in
public_http_servers. This
keeps external closed unless app.toml opens it. The reserved internal server cannot be listed:
without credentials it starts only with server run --dev. A deployment whose webhook names a
server that does not start fails verification. Listening on all interfaces ([::]:<port>) is not
advised for servers without credentials.
Use server verify --dev to verify the same local development configuration as server run --dev.
This replaces setting OBELISK__HTTP_SERVER__INTERNAL__API_AUTH=true just for verification.
Idle Reporting
A platform that suspends idle servers can receive idle reports. SQLite only; without a URL the detector is disabled:
idle_report.url = "http://127.0.0.1:9194/v1/idle"
idle_report.check_interval.seconds = 30 # How often idleness is evaluated and reports repeat.
idle_report.quiet_period.http.seconds = 60 # Busy this long after the last request finished.
idle_report.quiet_period.executions.seconds = 0 # Busy this long after executions became inactive.
idle_report.horizon.minutes = 1 # Executions due within this window keep the server busy.
idle_report.resume_threshold.seconds = 5 # Wall time jump that means the server was resumed.
idle_report.request_timeout.seconds = 10 # Timeout of one report request.
The server is idle when no HTTP request is in flight, no execution is locked, cancelling, or due
within horizon, and both quiet periods have elapsed. Open streams count as requests until they
end. Pending stub executions do not count as active. horizon must be longer than check_interval.
While idle, the server POSTs
{"period_id": "IdlePeriod_<ULID>", "next_run_at": <RFC 3339 UTC timestamp or null>} every check
interval, ignoring the response status. All reports of one idle period share its ID, and any
activity or resume starts a new period, so a receiver can discard late reports of a period it
already suspended. next_run_at lets the receiver schedule a wake-up. The server.idle.reported
and server.idle.resumed system events record each period.
Health Listener
health.listening_addr = "[::]:5006"
Disabled unless set. GET /health reads the database and answers 200, or 503 when the read
fails. It requires no token and does not count as activity for idle reporting. Do
not expose it publicly.
Observability
Levels and filtering is configured using EnvFilter syntax.
OTLP Tracing
[otlp]
enabled = true
level = "info,app=trace" # See filtering syntax
service_name = "obelisk-server"
otlp_endpoint = "http://localhost:4317"Logging
Console Logging
[log.console]
enabled = false
level = "info,app=debug" # See filtering syntax
style = "plain_compact" # One of "plain"|"plain_compact"|"json"
span = "none" # One of "none"|"new"|"enter"|"exit"|"close"|"active"|"full"
target = false # Whether to include the target module in message
writer = "stderr" # One of "stderr"|"stdout". Default: "stderr"File Logging
[log.file]
enabled = false
level = "info,obeli=debug,app=debug" # See filtering syntax
style = "json" # One of "plain"|"plain_compact"|"json"
span = "close" # One of "none"|"new"|"enter"|"exit"|"close"|"active"|"full"
target = true # Whether to include the target module in message
rotation = "daily" # One of "minutely"|"hourly"|"daily"|"never"
directory = "."
prefix = "obelisk_server_daily" # File name prefixPath Prefixes
Paths in server.toml support these prefixes:
| Prefix | Default Path on Linux | Details |
|---|---|---|
~ | ~ | Home directory |
${DATA_DIR} | ~/.local/share/obelisk | System data directory |
${CACHE_DIR} | ~/.cache/obelisk | System cache directory |
${CONFIG_DIR} | ~/.config/obelisk | System config directory |
${SERVER_CONFIG_DIR} | N/A | Directory where the server.toml file is located |
${TEMP_DIR} | /tmp | See temp_dir |
Note: the resolved path on Mac OS and Windows will be different, e.g. for ${CONFIG_DIR}:
/Users/youruser/Library/Application Support/com.obelisk.obelisk-App/on MacC:\Users\youruser\AppData\Roaming\obelisk\obelisk\config\on Windows
See the directories crate documentation for details.