Configuration

Sendword reads its configuration from sendword.toml in the working directory. Every option can be overridden with environment variables using the SENDWORD_ prefix.

Server

[server]
bind = "127.0.0.1"   # Listen address
port = 8080           # Listen port

Database

[database]
path = "data/sendword.db"

Logs

[logs]
dir = "data/logs"

Scripts

[scripts]
dir = "data/scripts"

Authentication

[auth]
session_lifetime = "24h"    # Login session duration
secure_cookie = false       # Require HTTPS for cookies

Defaults

Global defaults that individual hooks can override:

[defaults.rate_limit]
max_per_minute = 60

[defaults.timeout]
timeout = "30s"

[defaults.retries]
count = 0
backoff = "exponential"
initial_delay = "1s"
max_delay = "60s"

Environment Variable Overrides

Any setting can be overridden using the SENDWORD_ prefix with __ for nesting:

SENDWORD_SERVER__PORT=9090 sendword serve
SENDWORD_DEFAULTS__TIMEOUT__TIMEOUT=60s sendword serve

Export and Import

Export your running config as JSON:

sendword export > config.json

Import on another machine:

sendword import config.json

Or use the API:

curl http://localhost:8080/api/config/export > config.json
curl -X POST http://localhost:8080/api/config/import \
  -H "Content-Type: application/json" \
  -d @config.json