Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Settings reference

Settings live in .env in the install directory. template.env lists each one with its default.

  • sudo ./manage.sh check reports missing or invalid settings; each service refuses to start on an error in the settings it uses.
  • Restart the services after a change: sudo ./manage.sh restart.
  • After an update, sudo ./sync-env.sh adds the settings from template.env that .env is missing, and shows the change before writing it.
  • On Docker, check with docker compose exec publisher python -m publisher config check and apply a change with docker compose up -d.

Server

SettingDefaultDescription
HOST127.0.0.1REST API address. Docker always binds 0.0.0.0.
PORT16000REST API port
WORKERSNoneREST API worker processes: 1 by default under scripts/run.sh, 4 on Docker and server installs
GRPC_HOST127.0.0.1gRPC address. Docker always binds 0.0.0.0.
GRPC_PORT6000gRPC port
GRPC_MAX_WORKERS10gRPC worker threads
GRPC_TLS_ENABLEDfalseServes TLS on GRPC_PORT itself; leave off behind nginx (details)
GRPC_TLS_CERT_FILE, GRPC_TLS_KEY_FILENoneCertificate and key. Required when GRPC_TLS_ENABLED=true.
NONCE_TTL_SECONDS600How far a gRPC request’s timestamp may be from the server’s clock; nonces are remembered this long to refuse replays

Database

See Database and Encryption keys.

SettingDefaultDescription
DATABASE_DIALECTsqlitesqlite, mysql (MySQL and MariaDB) or postgres
SQLITE_DATABASE_PATHdata/relaysms.dbSQLite database file
MYSQL_HOST127.0.0.1MySQL server
MYSQL_PORT3306MySQL port
MYSQL_USER, MYSQL_PASSWORDNoneRequired for mysql
MYSQL_DATABASErelaysmsRequired for mysql; created if it doesn’t exist
POSTGRES_HOST127.0.0.1PostgreSQL server
POSTGRES_PORT5432PostgreSQL port
POSTGRES_USER, POSTGRES_PASSWORDNoneRequired for postgres
POSTGRES_DATABASErelaysmsRequired for postgres; created if it doesn’t exist
DATABASE_ENCRYPTION_ENABLEDtrue (false if unset)Encrypts the SQLite file with SQLCipher. No effect on MySQL or PostgreSQL.
DATABASE_ENCRYPTION_KEYNoneRequired for SQLite when encryption is on
DATABASE_FIELD_ENCRYPTION_ENABLEDtrue (false if unset)Encrypts linked accounts’ platform tokens
DATABASE_FIELD_ENCRYPTION_KEYNoneRequired when field encryption is on
DATA_ENCRYPTION_KEYNoneRequired. Encrypts the server’s private keys, and keys the hash that replaces each sender’s address.

Celery

See Celery broker.

SettingDefaultDescription
CELERY_BROKER_TYPEsqlitesqlite, redis or rabbitmq
CELERY_WORKER_CONCURRENCY1 for sqlite, else 4Tasks the worker runs at once
CELERY_BROKER_DB_PATHdata/celery_broker.dbBroker file when CELERY_BROKER_TYPE=sqlite
CELERY_RESULT_DB_PATHdata/celery_results.dbResult file when CELERY_BROKER_TYPE=sqlite
CELERY_REDIS_URLredis://localhost:6379/0Broker and result backend when CELERY_BROKER_TYPE=redis
CELERY_RABBITMQ_URLamqp://guest:guest@localhost:5672//Broker when CELERY_BROKER_TYPE=rabbitmq
CELERY_BEAT_SCHEDULE_PATHdata/celerybeat-scheduleBeat’s schedule file
CELERY_CLEANUP_CRON0 */3 * * *When to clean up expired data (below)
CELERY_TOKEN_CLEANUP_CRON0 3 * * *When to remove idle tokens (below)

Cleanup jobs

Both schedules are 5-field cron expressions in UTC.

  • CELERY_CLEANUP_CRON deletes incomplete payloads, ended web sessions, and audit events and adapter jobs past retention, and fails abandoned adapter jobs.
  • CELERY_TOKEN_CLEANUP_CRON deletes tokens idle past TOKEN_IDLE_MAX_AGE_DAYS and revokes them on their platform.

Retention

SettingDefaultDescription
PAYLOAD_SESSION_MAX_AGE_HOURS3Hours before an incomplete multi-part payload is discarded
TOKEN_IDLE_MAX_AGE_DAYS90Days without use before a linked account’s token is deleted and revoked on its platform
AUDIT_RETENTION_DAYS365Days to keep audit events and adapter install and update jobs

Offline publishing

See Offline publishing.

SettingDefaultDescription
OFFLINE_PUBLISH_ALLOWED_PROTOCOLSsmtp (empty if unset)Comma-separated protocols whose offline payloads publish: https, smtp. Empty allows both.
OFFLINE_PUBLISH_SHARED_SECRETNone64 hex characters. Required when https is allowed.

SMTP transport

See SMTP transport.

SettingDefaultDescription
SMTP_TRANSPORT_ENABLEDfalseRuns the email listener
SMTP_IMAP_SERVER, SMTP_IMAP_USERNAME, SMTP_IMAP_PASSWORDNoneIMAP host and login. Required when the transport is enabled.
SMTP_IMAP_PORT993IMAP port
SMTP_IMAP_MAIL_FOLDERINBOXComma-separated folders to watch, such as INBOX,Spam
SMTP_TLS_CLIENT_CERTIFICATE, SMTP_TLS_CLIENT_KEYNonemTLS client certificate and key, if the provider requires one. Set both or neither.
SMTP_ALLOWED_SENDERSNoneComma-separated addresses and domains allowed to send. Empty allows nothing.
SMTP_TRUSTED_AUTHSERV_IDNoneauthserv-id whose Authentication-Results verdicts are trusted, such as mx.google.com. Required when the transport is enabled.
SMTP_REQUIRE_DKIM, SMTP_REQUIRE_SPFtrueRequire dkim=pass and spf=pass
SMTP_VERIFY_DKIM_INDEPENDENTLYfalseAlso re-verifies the DKIM signature against DNS

Platform adapters

See Managing adapters. Relative paths are from the install directory.

SettingDefaultDescription
PLATFORMS_ADAPTERS_DIRdata/platforms/adaptersDirectory for adapters’ code
PLATFORMS_ADAPTERS_VENV_DIRdata/platforms/venvsDirectory for adapters’ virtualenvs
PLATFORMS_ADAPTERS_CONFIG_DIRdata/platforms/configDirectory for adapters’ credentials.json files
PLATFORMS_ADAPTERS_STATE_DIRdata/platforms/stateDirectory for files adapters write, such as databases
PLATFORMS_GITHUB_ORGSNoneComma-separated GitHub orgs that administrators may install and update adapters from over the REST API. Empty refuses REST installs; publisher.sh platforms is unaffected.

REST API access

See Credentials and access.

SettingDefaultDescription
AUTH_WEB_ORIGINSNoneComma-separated web client origins allowed to use a session cookie, such as https://console.example.com
AUTH_SESSION_COOKIE_SECUREtrueSends the session cookie over HTTPS only. Set false only for local HTTP development.
AUTH_SESSION_IDLE_MINUTES30Minutes of inactivity that end a web session
AUTH_SESSION_MAX_HOURS12Hours after login when a web session ends, even if it’s active
API_DOCS_ENABLEDfalseServes interactive API docs at /docs and the schema at /openapi.json. For development.

AUTH_WEB_ORIGINS origins must be on the same site as the API. Leave it empty when the web client is served from the API’s own origin.

Logging and monitoring

See Observability.

SettingDefaultDescription
LOG_LEVELinfodebug, info, warning, error or critical
OTEL_EXPORTER_OTLP_ENDPOINTNoneOTLP collector URL for traces, metrics and logs, such as http://localhost:4317. Needs requirements-observability.txt. Blank turns all three off.
OTEL_EXPORTER_OTLP_PROTOCOLgrpcgrpc or http/protobuf
OTEL_TRACES_SAMPLERparentbased_traceidratioWhich traces to keep
OTEL_TRACES_SAMPLER_ARG1.0Fraction of traces kept, 0 to 1
OTEL_LOGS_EXPORTERotlpotlp sends logs to the collector; none doesn’t
OTEL_PYTHON_LOG_CORRELATIONtrueAdds trace and span IDs to log records
UPTIME_KUMA_WORKER_PUSH_URL, UPTIME_KUMA_SMTP_PUSH_URLNoneUptime Kuma push URLs for the worker and email listener heartbeats. Blank turns them off.