Skip to content

Environment variables ​

All server settings live in the .env file in the installation folder. The installer creates it with mode 600; it never goes into git or Docker images. After editing, restart the services:

bash
docker compose up -d api worker caddy

Most settings are in the admin panel

Rates, payment systems, mail, notifications, AML/KYC, design and texts are changed in the admin panel. Keys entered there are stored encrypted in the database (with SETTINGS_SECRET), and the panel only shows whether they are set.

Generated automatically ​

The installer generates these once. Do not change them without a reason.

VariableMeaning
NODE_ENVproduction on the server
POSTGRES_PASSWORDDatabase owner password — migrations run under it
APP_DB_PASSWORDPassword of the application role, which cannot alter the action log and money ledger
DATABASE_URLThe app's database connection (as the application role)
SESSION_SECRETSession signing, at least 32 characters
SETTINGS_SECRETEncryption key for secrets from the admin panel. If you change it, all keys from the admin panel must be entered again
BACKUP_PASSWORDBackup encryption password. Without it a backup cannot be opened — keep it in a password manager
ADMIN_GATE_SECRETSecret Caddy uses to ask the API whether an address may open the admin panel

Domains and access ​

VariableDefaultMeaning
SITE_DOMAINfrom the install commandWebsite domain. Changed here, no code changes
ADMIN_DOMAINadmin. + domainAdmin subdomain. There is no admin panel on the main domain
ADMIN_ALLOWED_IPS127.0.0.1/32 (closed to all)Emergency admin access: IPs or subnets, space-separated. Works even if the API is down

Backups ​

VariableDefaultMeaning
BACKUP_HOST_DIR/home/deploy/backups/autoBackup folder on the server, outside the installation folder — updates do not touch it

Schedule, retention and Telegram delivery are in the admin panel, Settings → Backups.

External services ​

VariableMeaning
TELEGRAM_BOT_TOKENBot token from @BotFather: notifications, backups to Telegram, client bot
API_INTERNAL_URLWhere the bot sends requests inside Docker. Default http://api:3000 — do not change
ANTHROPIC_API_KEYAI reply suggestions in support. Without it the “Suggest reply” button is hidden
AMLBOT_ACCESS_ID, AMLBOT_ACCESS_KEY, AMLBOT_API_URLAML screening via AMLBot. Usually AML providers are connected in the admin panel, AML and KYC
KYC_PROVIDERmanual — documents are uploaded on the website, an operator decides
KYC_STORAGE_DIRPrivate folder for KYC documents and payment proofs. On the server it is a separate Docker volume, so data survives updates

Mail — fallback ​

Mail is normally configured in the admin panel, Mail. These are needed only if the panel is not available yet.

VariableMeaning
SMTP_HOST, SMTP_PORTServer and port: 465 — TLS, 587 — STARTTLS
SMTP_SECUREtrue / false if the server differs from its port's default
SMTP_USER, SMTP_PASSWORDMailbox login and password
SMTP_FROMSender, e.g. "Exchange <no-reply@example.com>"

Documentation of the OneSwaper exchange engine