Configuration file and environment variables
Settings in the YAML file override the defaults. Environment variables override values in the file.
The installer writes your answers to the server configuration file, /etc/gadka/gadka.yaml.
Configuration precedence
The server reads settings in the following order. Each source overrides the previous one.
- Default values in the program.
- The YAML file specified by the
--configflag or theGADKA_CONFIGenvironment variable. - Environment variables beginning with
GADKA_.
Change a setting
- Open the file as root with
sudo nano /etc/gadka/gadka.yaml. - Change the value and save the file.
- Restart the server.
sudo systemctl restart gadka- Run
systemctl status gadkato check that the service started.
The server validates its configuration at startup. If it fails validation, the service stops. Run journalctl -u gadka -n 30 to see why.
Environment variables
To find the environment variable for a key, replace the dots in its path with underscores, convert it to uppercase and add the prefix GADKA_.
| Configuration key | Environment variable |
|---|---|
log.level | GADKA_LOG_LEVEL |
db.password_file | GADKA_DB_PASSWORD_FILE |
link_safety.source | GADKA_LINK_SAFETY_SOURCE |
api.trusted_proxies | GADKA_API_TRUSTED_PROXIES |
Separate list items with commas. The list of SSO providers (auth.oidc.providers) can only be set in the configuration file.
For a native installation, run sudo systemctl edit gadka and add the variable as follows.
[Service]
Environment=GADKA_LOG_LEVEL=debugFiles for passwords and keys
Keep passwords and keys out of the configuration file. Keys ending in _file specify the path to a file containing the secret.
sudo install -o root -g gadka -m 0640 /dev/null /etc/gadka/oidc-client-secret
sudo nano /etc/gadka/oidc-client-secretThe gadka group must have read access to the file because the server runs as the gadka user.
Main configuration sections
| Section | Settings |
|---|---|
log | Log level (debug, info, warn, error) and format (json, text) |
db | Database driver (driver accepts sqlite, postgres or mysql) and connection settings |
auth | Tokens, minimum password length, SSO (oidc) and the 2FA requirement for admins (mfa) |
api | Public URL (public_url), listen address and trusted proxies |
gateway | App connections, QUIC and the TLS certificate |
ratelimit | Rate limits for login attempts and searches |
telemetry | Port for status and metrics, OpenTelemetry tracing |
s3, antivirus, files | File storage and scanning |
link_previews, link_safety | Link previews and safety checks |
calendar, crypto | Calendar integrations and encryption keys |
federation | Conversations with other organizations |
license | License key file imported at startup |
web | Directory containing the web app |
Trusted proxies
The bundled reverse proxy runs on the same machine as the server. The installer adds its address to the configuration.
api:
trusted_proxies: ["127.0.0.1"]This lets the server identify each client's actual address and apply the limit on login attempts separately to each computer.
Installers older than 0.3.2 did not add this setting, and updates leave gadka.yaml untouched. If the api section has no trusted_proxies key, add it as shown above and restart the server. Without it, all users share a single limit on login attempts.