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
| Variable | Purpose |
|---|---|
SPRING_DATASOURCE_URL | Where the database is, for example jdbc:postgresql://db:5432/yoursms |
SPRING_DATASOURCE_USERNAME | Database user |
SPRING_DATASOURCE_PASSWORD | Database password |
YOURSMS_JWT_SECRET | Signs the tokens of signed-in users. At least 32 bytes. |
YOURSMS_ENCRYPTION_KEY | Encrypts 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
| Variable | Default | Purpose |
|---|---|---|
YOURSMS_SMS_MAX_SEGMENTS | 10 | The longest message accepted, in SMS parts |
YOURSMS_SMS_MAX_ATTEMPTS | 4 | Sending attempts per message, the first included |
YOURSMS_SMS_MAX_BULK_SIZE | 500 | The most messages in one bulk request |
YOURSMS_SMS_DAILY_QUOTA | 0 | Messages a team may submit per day (UTC). 0 means no limit. |
Sending
| Variable | Default | Purpose |
|---|---|---|
YOURSMS_DISPATCH_MAX_PER_DEVICE_PER_HOUR | 0 | Messages one phone is given per hour. 0 means no limit. |
YOURSMS_DISPATCH_RETRY_DELAYS | 30s,2m,10m | The wait after each failed attempt |
YOURSMS_DISPATCH_LEASE_DURATION | 60s | How long a phone has to confirm it stored a message |
YOURSMS_DISPATCH_RESULT_TIMEOUT | 2m | How long it then has to report a result |
YOURSMS_DEVICE_HEARTBEAT_INTERVAL | 30s | How 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
| Variable | Default | Purpose |
|---|---|---|
YOURSMS_WEBHOOK_RETRY_DELAYS | 1m,5m,30m,2h,6h | The wait after each failed webhook delivery |
YOURSMS_RATE_LIMIT_API_KEY_REQUESTS_PER_MINUTE | 300 | Requests one API key may make per minute |
YOURSMS_RATE_LIMIT_PUBLIC_REQUESTS_PER_MINUTE | 30 | Sign-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:
SERVER_FORWARD_HEADERS_STRATEGY=nativeWithout 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.
