Documentation contents

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.

  1. Default values in the program.
  2. The YAML file specified by the --config flag or the GADKA_CONFIG environment variable.
  3. Environment variables beginning with GADKA_.

Change a setting

  1. Open the file as root with sudo nano /etc/gadka/gadka.yaml.
  2. Change the value and save the file.
  3. Restart the server.
sudo systemctl restart gadka
  1. Run systemctl status gadka to 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 keyEnvironment variable
log.levelGADKA_LOG_LEVEL
db.password_fileGADKA_DB_PASSWORD_FILE
link_safety.sourceGADKA_LINK_SAFETY_SOURCE
api.trusted_proxiesGADKA_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=debug

Files 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-secret

The gadka group must have read access to the file because the server runs as the gadka user.

Main configuration sections

SectionSettings
logLog level (debug, info, warn, error) and format (json, text)
dbDatabase driver (driver accepts sqlite, postgres or mysql) and connection settings
authTokens, minimum password length, SSO (oidc) and the 2FA requirement for admins (mfa)
apiPublic URL (public_url), listen address and trusted proxies
gatewayApp connections, QUIC and the TLS certificate
ratelimitRate limits for login attempts and searches
telemetryPort for status and metrics, OpenTelemetry tracing
s3, antivirus, filesFile storage and scanning
link_previews, link_safetyLink previews and safety checks
calendar, cryptoCalendar integrations and encryption keys
federationConversations with other organizations
licenseLicense key file imported at startup
webDirectory 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.