Docs / Reference

Configuration

yasp reads a small startup configuration: where it's reachable, which database to use, the encryption key, how people sign in, and how it serves HTTP. Everything else (monitors, components, pages, email delivery, retention, static copies) lives in the database and is edited in the dashboard.

# The file and environment variables

Settings come from two places, and you can use either or both:

  1. A TOML file. yasp reads ./yasp.toml if it exists. To use another file, pass --config /etc/yasp/yasp.toml (or -c) or set YASP_CONFIG=/etc/yasp/yasp.toml. A file named this way must exist, or yasp stops with an error.

  2. Environment variables starting with YASP_. They override the file. Use __ (two underscores) between nested names:

    FileEnvironment variable
    base_url = "…"YASP_BASE_URL=…
    [database] url = "…"YASP_DATABASE__URL=…
    [oidc] client_secret = "…"YASP_OIDC__CLIENT_SECRET=…
    [tls] acme_email = "…"YASP_TLS__ACME_EMAIL=…

    Values are parsed TOML-style, so lists and tables fit in one variable:

    YASP_SERVER__TRUSTED_PROXIES='["10.0.0.0/8"]'
    YASP_BOOTSTRAP__ADMIN_EMAILS='["you@example.com"]'
    YASP_ENCRYPTION__KEYS='[{id="k1",key="base64:…"}]'

    Only variables that start with a known section are read: YASP_BASE_URL, YASP_LISTEN, and YASP_DATABASE__, YASP_ENCRYPTION__, YASP_OIDC__, YASP_SAML__, YASP_EMAIL_LOGIN__, YASP_DEMO__, YASP_BOOTSTRAP__, YASP_SERVER__, YASP_TLS__ and YASP_SELF_MONITOR__. Other YASP_ variables are ignored. (Before 0.1.2, YASP_EMAIL_LOGIN__ and YASP_DEMO__ were ignored too; set those in the file there.)

A misspelled key in the file is an error, not silently ignored, so typos show up at startup. Check a configuration without starting the server:

yasp --config /etc/yasp/yasp.toml check-config

It validates everything and prints a summary without secrets.

Every setting is read once, at startup. After you change the file or the environment, restart yasp. The same goes for files the configuration points at: TLS certificate files and SAML metadata are read (or fetched) when yasp starts.

# Top level

SettingDefaultWhat it does
base_urlhttp://localhost:8080The public address, e.g. https://status.example.com. Used in links, emails, feeds, probe commands and sign-in redirects. It must be an absolute http or https URL without a query or fragment; a trailing slash is ignored. With [tls] it must use https.
listen127.0.0.1:8080The address and port to listen on. The Docker images set 0.0.0.0:8080. With [tls], this is the HTTPS address, usually 0.0.0.0:443.

# [database]

One URL chooses the backend. SQLite needs nothing else and creates the file if it's missing; Postgres (15 or newer) is for running several instances (see high availability). yasp applies migrations at startup.

SettingDefaultWhat it does
urlrequiredsqlite:///var/lib/yasp/yasp.db (anything starting with sqlite:), or postgres://user:pass@host/yasp (postgresql:// works too). Other schemes are refused. Treated as a secret: never printed or logged.

The Docker images set sqlite:///data/yasp.db.

# [[encryption.keys]]

Secrets you enter in the dashboard (the SMTP password, webhook secrets, certificate keys) are encrypted with this key before they are stored. Generate one with yasp keys generate (--id names it; the default is k1).

On first start yasp stores a check value made with the key. Afterwards it refuses to start with a key that doesn't match, so a wrong key fails loudly instead of corrupting data. Every instance sharing a database needs the same keys.

Backups don't contain the key. Keep it somewhere else, such as a password manager or secrets store: without it, the secrets in a restored database can't be read.

With SQLite you can leave the keys out. yasp then makes a key on first start and keeps it in yasp.key next to the database file (for sqlite:///data/yasp.db, that's /data/yasp.key), readable only by yasp, and uses it on every start after. It's the quick way to try yasp, but the key then sits next to the data it protects, so a copy of that directory has both. For anything that matters, configure the key explicitly instead. Postgres always needs a configured key, because every instance must share it.

SettingDefaultWhat it does
idrequiredA name for the key. Stored next to everything it encrypts.
keyrequiredbase64:…, as printed by yasp keys generate.

With keys configured, the list needs at least one entry. The first is the primary key, used for everything new.

Rotating the key. Generate a new key with a new id, put it first in the list and keep the old one after it, restart, then run yasp keys rotate. It re-encrypts every stored secret with the new key and updates the startup check, and is safe while yasp runs. After that the old key can go. Manage and unsubscribe links in emails sent before the rotation stop working once their key is removed, so you may want to keep it a while.

[[encryption.keys]]
id = "k1"
key = "base64:…"

# [oidc]

Dashboard sign-in with OpenID Connect. Register yasp at your identity provider with the redirect URI {base_url}/admin/auth/callback. yasp asks for the openid, email and profile scopes and reads the role from the ID token. When a person matches several roles, they get the highest.

SettingDefaultWhat it does
issuerrequiredThe issuer URL; yasp discovers the rest at /.well-known/openid-configuration. Must use https, except for localhost, 127.0.0.1 and [::1].
client_idrequiredThe client id.
client_secretrequiredThe client secret.
role_claimgroupsThe ID-token claim holding groups or roles. A string or a list of strings.
role_mapemptyWhich claim values grant which role. The roles are admin, editor and viewer.
[oidc]
issuer = "https://idp.example.com/realms/main"
client_id = "yasp"
client_secret = "…"
role_claim = "groups"
[oidc.role_map]
admin = ["yasp-admins"]
editor = ["ops"]
viewer = ["staff"]

# [saml]

Dashboard sign-in with SAML 2.0, alongside or instead of OIDC. It needs a build with SAML (the yasp-saml image); other builds refuse to start when [saml] is set. See SAML sign-in for what to register at the identity provider.

SettingDefaultWhat it does
idp_metadata_urlnoneWhere the identity provider publishes its metadata. Fetched at startup.
idp_metadata_filenoneA local copy of the metadata instead. Set exactly one of the two.
role_attributegroupsThe attribute holding groups or roles.
role_mapemptyWhich attribute values grant which role: admin, editor or viewer.
email_attributethe usual onesThe attribute holding the email address. By default yasp looks for email, mail and the common claim URIs, then an email-format Name ID.
name_attributethe usual onesThe attribute holding the display name.

# [email_login]

Sign-in with one-time links sent by email, for people without an account at your identity provider, or instead of one. Admins invite people from Users in the dashboard. Invited people and bootstrap admins can then ask for a link on the sign-in page. Sending links needs email delivery, set up in the dashboard under Notifications → Email delivery. Before that, yasp admin invite --email you@example.com --role admin invites someone and prints a link.

SettingDefaultWhat it does
enabledfalseTurns email sign-in on.

As a variable: YASP_EMAIL_LOGIN__ENABLED=true.

# [demo]

For a public, read-only demo: the sign-in page offers a shared demo account that sees every screen but can't change anything. Only for installs meant to be public. See running a public demo.

SettingDefaultWhat it does
enabledfalseTurns demo mode on.

As a variable: YASP_DEMO__ENABLED=true.

# [bootstrap]

The first admin has to come from somewhere. These people are always admin, whatever the role map or the Users screen says, which also makes them a way back in if you lock yourself out.

SettingDefaultWhat it does
admin_emailsemptyEmail addresses that are always admin. Compared without regard to case. With OIDC or SAML, the identity provider must report the address as verified. These addresses may also use email sign-in when it's on.
admin_claimnoneA value of the role claim (oidc.role_claim, or saml.role_attribute) that is always admin.

If you can't sign in at all, yasp admin grant --email … --role admin gives a role to someone who has signed in before.

# [server]

SettingDefaultWhat it does
trusted_proxiesemptyReverse proxies and load balancers whose X-Forwarded-For and Forwarded headers yasp believes, as CIDRs (10.0.0.0/8, 203.0.113.7/32). Set it when yasp is behind a proxy, so rate limits, the audit log and private pages limited to certain networks see visitors' addresses rather than the proxy's.
metrics_tokennoneRequire Authorization: Bearer <token> on /metrics. See observability.
outbound_allowemptyPrivate networks or hosts that yasp itself may call: notification webhooks and static-copy uploads. Private addresses are refused by default, like probe checks. Each entry is a CIDR, an IP address or a host name.
[server]
trusted_proxies = ["10.0.0.0/8"]
metrics_token = "…"
outbound_allow = ["192.168.1.0/24", "hooks.internal"]

# [tls]

Built-in HTTPS, with certificate files, automatic certificates (ACME), or both. Leave the section out when a reverse proxy terminates TLS. With [tls], listen serves HTTPS and http_listen answers ACME challenges and redirects everything else to HTTPS. See HTTPS and custom domains.

SettingDefaultWhat it does
certnonePEM certificate chain, used for the base host and any host without its own certificate.
keynonePEM private key for cert. Set both or neither.
acme_emailnoneContact address for the ACME account. Setting it turns automatic certificates on.
acme_directoryletsencryptletsencrypt, letsencrypt-staging, or the URL of another ACME directory (ZeroSSL, step-ca, Pebble).
acme_ca_filenonePEM root certificate for a private directory's own HTTPS (step-ca, Pebble).
acme_base_hoston when no certAlso get an ACME certificate for the base URL's host.
http_listen0.0.0.0:80Plain-HTTP address for ACME HTTP-01 challenges and redirects.

Set cert and key, or acme_email, or all three.

# [self_monitor]

yasp can't report its own death. Point this at an external dead-man's switch (healthchecks.io, Cronitor, an Uptime Kuma push monitor) and it alerts when the pings stop.

SettingDefaultWhat it does
heartbeat_urlnoneFetched every 60 seconds while this instance leads and the database answers. With several instances only the leader pings, so the pings stop when no instance can lead. Private addresses are allowed here.

# [vapid]

Browser push notifications to subscribers identify this server to the push services with a contact address.

SettingDefaultWhat it does
subjectthe base URLA mailto: address or an https:// URL push services can contact you at.

# Outside the configuration

A few things are set on the command line or with standard variables, not in yasp.toml:

SettingDefaultWhat it does
--config, -c / YASP_CONFIG./yasp.toml if presentThe configuration file.
--log-format / YASP_LOG_FORMATjsonjson or pretty.
RUST_LOGinfoThe log level.
OTEL_EXPORTER_OTLP_ENDPOINT and friendsoffTrace export; see observability.

# A complete example

# Where people reach yasp. Used in every link it sends.
base_url = "https://status.example.com"

# HTTPS on 443, since [tls] is set below. Without [tls], e.g. "127.0.0.1:8080".
listen = "0.0.0.0:443"

[database]
# SQLite file, created if missing. Or postgres://yasp:…@db.internal/yasp
url = "sqlite:///var/lib/yasp/yasp.db"

# From `yasp keys generate`. Back it up separately from the database.
[[encryption.keys]]
id = "k1"
key = "base64:…"

# Dashboard sign-in through your identity provider.
# Redirect URI: https://status.example.com/admin/auth/callback
[oidc]
issuer = "https://idp.example.com/realms/main"
client_id = "yasp"
client_secret = "…"
role_claim = "groups"
[oidc.role_map]
admin = ["yasp-admins"]
editor = ["ops"]
viewer = ["staff"]

# Also let invited people without an IdP account sign in with emailed links.
[email_login]
enabled = true

# Always admin, even before the groups above exist.
[bootstrap]
admin_emails = ["you@example.com"]

[server]
# The load balancer in front of yasp.
trusted_proxies = ["10.0.0.0/8"]
# Prometheus sends this as a bearer token.
metrics_token = "…"
# Let webhooks reach this internal host.
outbound_allow = ["hooks.internal"]

# Automatic certificates for the base host and every custom domain.
# Port 80 must be reachable for challenges.
[tls]
acme_email = "ops@example.com"

# Pinged every minute while yasp is healthy.
[self_monitor]
heartbeat_url = "https://hc-ping.com/…"