Environment variables
Every setting socAdmin reads from its environment, with defaults.
All settings are optional. socAdmin starts with no configuration and generates what it needs on first run.
Server
| Variable | Default | Description |
|---|---|---|
PORT |
8080 |
HTTP or HTTPS port socAdmin listens on. |
DATA_DIR |
current directory; /data in Docker |
Where socadmin.db is stored. Created if missing. |
TLS_CERT |
— | Path to a TLS certificate. With TLS_KEY, socAdmin serves HTTPS. |
TLS_KEY |
— | Path to the TLS private key. |
HTTP_REDIRECT_PORT |
80 |
Port of the HTTP → HTTPS redirect, only when TLS is on. |
Accounts
| Variable | Default | Description |
|---|---|---|
ADMIN_EMAIL |
— | Creates this admin account on startup if it doesn’t exist. Needs ADMIN_PASSWORD. |
ADMIN_PASSWORD |
— | Password of that admin. 10+ characters with uppercase, lowercase, digit and special character, or socAdmin refuses to start. |
REGISTRATION_ENABLED |
true |
Set to false so only admins can create accounts. The first account can always be created. |
JWT_SECRET |
generated and stored in socadmin.db |
Key that signs session tokens. At least 32 characters, or socAdmin refuses to start. Set it explicitly in production. |
Security
| Variable | Default | Description |
|---|---|---|
SECURE_COOKIES |
false |
Set to true to mark cookies Secure when HTTPS ends at a reverse proxy. Automatic when socAdmin serves TLS itself. |
TRUSTED_PROXY |
— | Comma-separated IPs or CIDR ranges allowed to set X-Forwarded-For and X-Real-IP. Without it, proxy headers are ignored. |
ALLOW_PRIVATE_NETWORKS |
true, false in Docker |
Allows connections to loopback and private IPs. Set to false or 0 to block them. |
Database connections
Pre-fill a connection for every user. A connection is enabled as soon as its *_HOST is set. All three engines can be configured at once.
MySQL / MariaDB
| Variable | Default | Description |
|---|---|---|
MYSQL_HOST |
— | Server hostname. Enables the MySQL connection. |
MYSQL_PORT |
3306 |
Server port. |
MYSQL_USER |
root |
Database user. |
MYSQL_PASSWORD |
— | Database password. |
PostgreSQL
| Variable | Default | Description |
|---|---|---|
POSTGRES_HOST |
— | Server hostname. Enables the PostgreSQL connection. |
POSTGRES_PORT |
5432 |
Server port. |
POSTGRES_USER |
postgres |
Database user. |
POSTGRES_PASSWORD |
— | Database password. |
MongoDB
| Variable | Default | Description |
|---|---|---|
MONGO_HOST |
— | Server hostname. Enables the MongoDB connection. |
MONGO_PORT |
27017 |
Server port. |
MONGO_USER |
— | User, if authentication is enabled. |
MONGO_PASSWORD |
— | Password, if authentication is enabled. |
Command-line flags
| Flag | Description |
|---|---|
--reset-password <email> |
Interactively sets a new password for an account, then exits. See Resetting a password. |