Configuration
One config model: file, environment variables, and precedence.
Synapass has one configuration model across Docker, native, and desktop. Learn it once; every deployment path obeys it.
Precedence#
Lowest to highest:
- Built-in defaults — a config file is optional; the defaults boot.
- Config file —
--config/SYNAPASS_CONFIG_FILE. - Environment variables —
SYNAPASS_*always win, which is what makes a container override of one value possible without a second file.
# Inspect the resolved configuration (secrets redacted)
SYNAPASS_ADMIN_KEY=$(openssl rand -hex 24) synapass config --config config.example.yamlSecrets are referenced, never embedded#
Every credential names an environment variable via *_env. The secret
stays in your environment and out of version control — which keeps the config
file safe to commit and keeps synapass config from becoming the leak.
providers:
- name: openai-prod
kind: openai
base_url: https://api.openai.com/v1
api_key_env: OPENAI_API_KEY # the name, not the value# .env — never committed
SYNAPASS_ADMIN_KEY=<generated with openssl rand -hex 24>
OPENAI_API_KEY=<your provider key>
ANTHROPIC_API_KEY=<your provider key>An inline api_key on a provider write is discarded by the gateway. If a
secret appears where a reference belongs, it is dropped rather than stored.
The main sections#
config.example.yaml is the annotated reference. The sections you will touch
most:
| Section | What it controls |
|---|---|
app.environment | development / staging / production. Production tightens validation: an admin surface without a bootstrap key refuses to start, and a CORS wildcard is rejected. |
app.default_tenant_* | The tenant seeded on first boot so a fresh install is usable. |
app.bootstrap_from_config | Apply the providers/policies in the file on every startup, upserting by name. The database is the runtime source of truth afterwards. |
http.addr | Bind address. Use :8080 in containers; bind 127.0.0.1:8080 on a host behind a reverse proxy. |
http.cors_allowed_origins | The dashboard's origin. A wildcard is refused in production. |
database.* | PostgreSQL connection — discrete fields or a full dsn. auto_migrate: true is convenient for self-hosting; under strict change control, set it false and run synapass migrate as a release step. |
redis.* | Redis connection. key_prefix namespaces every key so one Redis can serve several deployments. |
auth.* | Header name, minimum key length, and validated-key cache TTL. |
Durations accept a string ("30s", "5m", "2h") or a bare number of seconds.
Environment variable overrides#
Any file value can be overridden without editing the file. The Docker path uses this for the two values operators change most:
# Move the host port when 8080 is taken
GATEWAY_PORT=18080
NEXT_PUBLIC_SYNAPASS_API_URL=http://localhost:18080First-run checklist#
- Copy
.env.exampleto.env(Docker) or the systemd drop-in (native). - Generate
SYNAPASS_ADMIN_KEYwithopenssl rand -hex 24. - Add at least one provider key (
OPENAI_API_KEY/ANTHROPIC_API_KEY). - Start the stack and check
/ready— it only reports ready after migrations and catalogue seeding finish. - Create the console administrator in the dashboard; there are no defaults.