Configuration
Every setting of the engine and of a project, with its default, and every command of the engine's binary.
Two kinds of settings: the engine’s, from the environment, and each project’s, kept in its database and changed with the admin API (/auth/v1/admin/settings) or the console.
The engine
| Variable | Default | What |
|---|---|---|
SYPNIA_DATA_MASTER_KEY | — (required unless KMS) | 32 bytes, base64; encrypts signing keys and credentials |
SYPNIA_DATA_MASTER_KEY_KMS | — | instead of the master key: the master key encrypted with AWS KMS (aws kms generate-data-key, ciphertext blob, base64); the engine decrypts it at start-up |
SYPNIA_DATA_KMS_KEY_ID | — | the KMS key that seals each project’s database connection in the registry (Sypnia Cloud) |
SYPNIA_DATA_PUBLIC_URL | http://localhost:8080 | the address people reach; used in e-mail links and token iss |
DATABASE_URL | — | one project’s database, as a user that can install |
DATABASE_URL_AUTHENTICATOR, DATABASE_URL_ADMIN | — | instead of DATABASE_URL, after a manual install |
SYPNIA_DATA_PROJECTS_FILE | — | projects.toml: several projects (below) |
SYPNIA_DATA_LISTEN | 0.0.0.0:8080 | server mode |
SYPNIA_DATA_POOL_MAX | 2 on Lambda, 10 otherwise | connections per project per instance |
SYPNIA_DATA_TICK | external | internal: run e-mail retries and cleanup every minute in-process; external: run sypnia-data tick yourself, or the events function |
SYPNIA_DATA_MAX_ROWS | 1000 | rows per Data API response |
SYPNIA_DATA_MAIL | none | the engine’s own sender: smtp, resend, postmark, ses, none |
SYPNIA_DATA_SMTP_URL | — | smtps://user:pass@host:465 |
SYPNIA_DATA_RESEND_API_KEY, SYPNIA_DATA_POSTMARK_TOKEN | — | HTTP providers |
SYPNIA_DATA_SES_REGION | the instance’s region | SES with the instance’s AWS credentials |
SYPNIA_DATA_SES_CONFIGURATION_SET | — | the SES configuration set whose bounces and complaints reach the events function |
SYPNIA_DATA_MAIL_FROM | — | Name <address>; the project’s name replaces Name |
SYPNIA_DATA_MAIL_DEFAULT_REFS | all projects | the projects that may send through the engine’s own sender, comma-separated (* = all). The others need their own provider. Sypnia Cloud: sypnia |
SYPNIA_DATA_MAIL_DEFAULT_HOURLY_CAP | 0 (no cap) | e-mails per hour per project through the engine’s own sender; past it, 429 rate_limited |
SYPNIA_DATA_MAIL_UNCAPPED_REFS | — | projects exempt from that cap, comma-separated |
SYPNIA_DATA_LOG | info | debug, info, warn (JSON lines on stdout) |
SYPNIA_DATA_INSTALL_ON_START | false | true: serve installs or upgrades the schema in DATABASE_URL first, waiting for the database (the Docker and AWS setups use it) |
<NAME>_SSM | — | for DATABASE_URL, SYPNIA_DATA_MASTER_KEY, SYPNIA_DATA_SMTP_URL, SYPNIA_DATA_RESEND_API_KEY, SYPNIA_DATA_POSTMARK_TOKEN, SYPNIA_DATA_ORIGIN_SECRET: the name of an SSM SecureString read at start instead of the value |
SYPNIA_DATA_DATABASE_SECRET_ARN | — | a Secrets Manager secret {username, password} (the RDS format); with SYPNIA_DATA_DATABASE_HOST, _PORT (5432) and _NAME (postgres) it becomes DATABASE_URL with TLS |
SYPNIA_DATA_ORIGIN_SECRET | — | when set, requests must carry X-Sypnia-Origin with this value, or get 403 direct_access (put it on your CDN, so nobody can skip it) |
SYPNIA_DATA_MCP_URL | <SYPNIA_DATA_PUBLIC_URL>/mcp | where the MCP server answers; also its OAuth resource indicator |
SYPNIA_DATA_ACCOUNT_PROJECT | — | the project whose users are accounts with organizations (cloud.* tables), so their tokens reach their organizations’ projects through MCP (Sypnia Cloud: sypnia) |
SYPNIA_DATA_CONTROL_PLANE_URL | — | the control plane MCP’s create_project calls (Sypnia Cloud: https://data.api.sypnia.com) |
SYPNIA_DATA_ROLE | — | events: on Lambda, this function handles the minute tick, SES bounces from SNS and the control actions instead of HTTP |
SYPNIA_DATA_OFFLINE | — | set: skip the breached-password lookup (an engine without internet access) |
SYPNIA_DATA_NEW_PASSWORD | — | read only by sypnia-data users create: the new user’s password |
Sypnia Cloud’s own
The same binary runs Sypnia Cloud with a few more settings. You do not need them to self-host:
| Variable | What |
|---|---|
SYPNIA_DATA_REGISTRY_URL (or _SSM) | the database that holds cloud.projects, the registry of hosted projects (read every 60 s) |
SYPNIA_DATA_PROJECT_DOMAIN | <ref>.<domain> is a project: data.sypnia.com |
SYPNIA_DATA_PROJECTS_SSM | an SSM SecureString with a JSON array of projects outside the registry, with the fields of projects.toml (Sypnia’s own project at auth.sypnia.com) |
SYPNIA_DATA_MASTER_URL, SYPNIA_DATA_PROVISIONER_URL_SSM | the shared Postgres server where provision creates managed databases |
Several projects
A self-hosted engine serves one project, default, from DATABASE_URL, on any host. To serve several, list them in projects.toml:
[[project]]
ref = "shop"
host = "api.laespiga.co"
database_url = "postgres://sypnia_admin:…@db.example.com:5432/shop?sslmode=verify-full"
[[project]]
ref = "admin"
hosts = ["admin-api.laespiga.co", "admin-api.internal"]
public_url = "https://admin-api.laespiga.co"
database_url_admin = "postgres://sypnia_admin:…@db.example.com:5432/admin"
database_url_authenticator = "postgres://sypnia_authenticator:…@db.example.com:5432/admin"| Field | What |
|---|---|
ref | the project’s name: a slug, used in keys (syp_pk_<ref>_…) and tokens |
host, hosts | the hosts that reach it |
public_url | its address; by default https:// and its first host |
database_url | a user that can install; or the two below |
database_url_admin, database_url_authenticator | after a manual install |
admin_role, authenticator_role | role names other than sypnia_admin and sypnia_authenticator |
Each project keeps its own database, keys and settings.
The engine’s commands
The binary is sypnia-data. Every command reads the environment above.
SYPNIA_DATA_LISTEN, or the Lambda runtime when it runs in AWS Lambda. It is also what the binary does with no command.Flags
-
--installboolean optionalInstall or upgrade the schema inDATABASE_URLfirst (SYPNIA_DATA_INSTALL_ON_START).Default:
false
/health with 200. The container’s healthcheck (the image has no curl).DATABASE_URL. Safe to run again: it applies only what is missing.Flags
-
--print-sqlboolean optionalPrint the SQL for a database administrator instead of running it.Default:
false -
--refstring optionalUse the role names of a managed project (sd_<ref>_admin,sd_<ref>_authenticator).
sypnia-data provision <ref> creates a managed project’s database and roles on the server of SYPNIA_DATA_MASTER_URL and prints its sealed registry value. With --static-ssm <parameter> --host <host> [--public-url <url>] it registers the project in that SSM parameter instead.Flags
-
--projectstring optionalThe project’s ref.Default:
default
Flags
-
--projectstring optionalThe project’s ref.Default:
default -
--kindstring optionalpublishableorsecret.Default:
publishable -
--namestring optionalA name for the key.
sypnia-data users create <email> creates a confirmed user, with the password in SYPNIA_DATA_NEW_PASSWORD, or «e-mail first» when it is not set.Flags
-
--projectstring optionalThe project’s ref.Default:
default
sypnia-data registry seal <ref> reads a value from stdin and prints it sealed for that project’s registry row.The events function
On AWS, the function with SYPNIA_DATA_ROLE=events runs the minute tick and the SES bounce handling, and answers these actions when invoked directly (IAM decides who may invoke it):
action | Takes | Does |
|---|---|---|
api_key | ref, kind, name?, protected? | creates an API key: { id, key, protected } |
protect_key | ref, id | marks an existing key protected |
rotate_protected_key | ref, id | replaces a protected key: { id, key } |
upgrade | ref | applies the engine’s pending migrations to the project |
provision | ref | creates a managed database on the shared server |
install_byo | ref, url | installs the engine in your own Postgres |
deprovision | ref | drops a managed project’s database and roles |
aws lambda invoke --function-name my-data-events --cli-binary-format raw-in-base64-out \
--payload '{"action":"api_key","ref":"default","kind":"publishable"}' /dev/stdoutA project
Kept in sypnia_data.settings, one row per key. Read them with GET /auth/v1/admin/settings and change any of them with PATCH /auth/v1/admin/settings and a secret key; an object is merged into the stored one, and credentials come back as "[redacted]". Changes apply within a minute.
| Setting | Default | What |
|---|---|---|
session_policy | { access_token_ttl: 3600, session_lifetime: null, inactivity_timeout: null, single_session: false, refresh_reuse_interval: 10 } | how long sessions live; null is never |
require_email_confirmation | true | sign-up needs a confirmed e-mail |
signup_open | true | false closes sign-ups (403 signup_disabled); admins still create and invite users |
password_policy | { min_length: 10, require: [], breached_check: true } | require: any of lower, upper, digit, symbol |
site_url | — | your app’s address: the default return of e-mail links |
redirect_urls | [] | allowed redirect_to values: exact addresses or patterns such as https://*.myapp.com/** |
providers | e-mail on | email (true or false), google and github ({ enabled, client_id, client_secret }) |
mail | no provider | the e-mail provider |
templates | the engine’s | e-mail templates per type and language |
captcha | none | { provider: "turnstile" | "hcaptcha", secret } |
exposed_schemas | ["public"] | the schemas the Data API serves |
rate_limits | see protections | signup_per_hour_per_ip, otp_per_hour_per_email, otp_per_hour_per_ip, password_per_5min, refresh_per_hour_per_session, oauth_token_per_min_per_client |
dynamic_client_registration | false | open dynamic client registration |
cross_subdomain | none | { domain: ".example.com" }: one session across your apps |
otp_ttl | 3600 | lifetime of links and codes, 300 to 86 400 seconds |
project_name | the ref | the name e-mails show |
device_verification_uri | the engine’s /auth/v1/device | your page where a person approves a device code (Sypnia Cloud: https://data.app.sypnia.com/device) |
consent_url | the engine’s /auth/v1/oauth/consent | your page where a person approves an OAuth client |
cors_origins | [] | origins that may use the session cookie, patterns such as https://*.example.com |
An unknown key answers 400 unknown_setting; a session policy out of range, 400 invalid_session_policy.