Configuration
Canonical production origin: https://asi-database-node-api.arybit.co.ke.
Copy deployment examples using bash init-deploy-database-api.sh. Keep target-specific configuration private. The production target must use domain=asi-database-node-api.arybit.co.ke; aliases need their own DNS records and certificate coverage. Staging retains its separate hostname.
Runtime settings read by backend/core/config.py:
| Variable | Meaning / default |
|---|---|
| ENV | development, test, staging or production; default development |
| API_HOST / API_PORT | 127.0.0.1 / 8080 |
| DB_ENGINE | postgresql or mysql; default postgresql |
| DB_HOST | Loopback database host; default 127.0.0.1 |
| DB_PORT | 5432 for PostgreSQL; 3306 for MySQL |
| DB_NAME / DB_USER / DB_PASSWORD | Explicit private database credentials |
| ALLOWED_HOSTS | Comma-separated hostnames, without scheme or paths |
| CORS_ORIGINS | Comma-separated origins, without paths |
Production runtime host settings:
ENV=production
DB_ENGINE=postgresql
DB_HOST=127.0.0.1
DB_PORT=5432
ALLOWED_HOSTS=asi-database-node-api.arybit.co.ke,www.asi-database-node-api.arybit.co.ke,localhost,127.0.0.1
CORS_ORIGINS=https://asi-database-node-api.arybit.co.ke
Add privately provisioned DB_NAME, DB_USER and DB_PASSWORD. Deployed passwords must have at least 16 characters and cannot contain placeholder markers. Remote DB hosts are rejected in deployed settings because driver TLS is not implemented. Protect environment files with mode 0600. The deployment renderer derives runtime hosts and CORS from the selected target.
ui/config.json uses the current HTTPS origin when apiBase is empty. Keep contractVerified false until a session/login/logout contract actually exists; the current diagnostic backend does not provide it.