Skip to content

Configuration ​

The server is set up through environment variables. With the provided deployment, add them to the server service's environment list in infrastructure/compose.yaml and run docker compose up -d again.

Required ​

VariablePurpose
SPRING_DATASOURCE_URLWhere the database is, for example jdbc:postgresql://db:5432/yoursms
SPRING_DATASOURCE_USERNAMEDatabase user
SPRING_DATASOURCE_PASSWORDDatabase password
YOURSMS_JWT_SECRETSigns the tokens of signed-in users. At least 32 bytes.
YOURSMS_ENCRYPTION_KEYEncrypts webhook signing secrets. At least 32 bytes.

The server refuses to start without the two keys. The provided deployment sets all five from your .env file.

Messages ​

VariableDefaultPurpose
YOURSMS_SMS_MAX_SEGMENTS10The longest message accepted, in SMS parts
YOURSMS_SMS_MAX_ATTEMPTS4Sending attempts per message, the first included
YOURSMS_SMS_MAX_BULK_SIZE500The most messages in one bulk request
YOURSMS_SMS_DAILY_QUOTA0Messages a team may submit per day (UTC). 0 means no limit.

Sending ​

VariableDefaultPurpose
YOURSMS_DISPATCH_MAX_PER_DEVICE_PER_HOUR0Messages one phone is given per hour. 0 means no limit.
YOURSMS_DISPATCH_RETRY_DELAYS30s,2m,10mThe wait after each failed attempt
YOURSMS_DISPATCH_LEASE_DURATION60sHow long a phone has to confirm it stored a message
YOURSMS_DISPATCH_RESULT_TIMEOUT2mHow long it then has to report a result
YOURSMS_DEVICE_HEARTBEAT_INTERVAL30sHow often phones report in. Three missed reports mean offline.

Set a limit per phone

Android asks the person holding the phone to confirm once an app sends too many SMS too fast, and an unattended gateway then stops. Set YOURSMS_DISPATCH_MAX_PER_DEVICE_PER_HOUR below what your phone model allows. See The Android app.

Webhooks and request limits ​

VariableDefaultPurpose
YOURSMS_WEBHOOK_RETRY_DELAYS1m,5m,30m,2h,6hThe wait after each failed webhook delivery
YOURSMS_RATE_LIMIT_API_KEY_REQUESTS_PER_MINUTE300Requests one API key may make per minute
YOURSMS_RATE_LIMIT_PUBLIC_REQUESTS_PER_MINUTE30Sign-in and pairing attempts per address per minute

Behind your own proxy ​

If you put the server behind a reverse proxy other than the provided one, set:

text
SERVER_FORWARD_HEADERS_STRATEGY=native

Without it every request appears to come from the proxy, so all visitors share one sign-in limit and the activity log records the proxy's address.