Kalzit is in early development. These pages describe what exists today and change as the milestones progress. Screenshots show the development version with demo data.

Configuration

Kalzit reads its settings from three layers. An environment variable KALZIT_* wins over the configuration file kalzit.toml, and the file wins over values saved in the settings of the web UI. What the environment or the file sets shows up there locked, with its source. Listen addresses, certificate files and the trusted proxy headers exist only in the file or the environment, so a wrong value cannot lock an admin out of the settings page; automatic certificates and the outbound proxy are set in the web UI under Settings > Network, HTTPS and proxy.

Where the file is

Kalzit uses the first file it finds:

  1. the file given with --config <file> (or the KALZIT_CONFIG variable),
  2. kalzit.toml in the current directory,
  3. on Windows %ProgramData%\Kalzit\kalzit.toml, on Linux /etc/kalzit/kalzit.toml.

Without a file, the defaults apply. Relative paths in the file resolve against the file’s folder. Unknown keys and misspelled KALZIT_* variables are refused at start, so a typo does not go unnoticed. Check a configuration without starting the server with kalzit check-config.

Environment variables

Every key has a variable named KALZIT_<SECTION>_<KEY> in upper case, for example KALZIT_SERVER_HTTP_ADDR for http_addr in [server]. The value is read as a TOML value when it is one (a number, true or false, a list like ["10.0.0.0/8"]) and as text otherwise.

More variables that are not keys of a section:

Variable Meaning
KALZIT_CONFIG Path of the configuration file.
KALZIT_SETTING_<KEY> A setting of the web UI, for example KALZIT_SETTING_DATASOURCES_SQLITE_DIRS. It then shows locked in the settings.
KALZIT_DATABASE_URL_FILE A file with the URL of Kalzit’s own database (also the credential kalzit-database-url), so the password is in no variable.
KALZIT_SECRETS_KEY The key for stored secrets such as data source passwords (base64, 32 bytes). Without it, Kalzit takes systemd credentials on Linux, a DPAPI-protected key file on Windows, and as a last resort a key file in the data directory, with a warning in the log.
KALZIT_SETUP_TOKEN A fixed setup code for automated installs, see First start.

An example

[server]
http_addr = "127.0.0.1:3000"
public_url = "https://kalzit.example.com"

[security]
trusted_proxies = ["127.0.0.1/32", "::1/128"]

[database]
url = "postgres://kalzit@db.internal/kalzit"   # default: SQLite in the data directory

[log]
format = "json"

[server]

Key Default Meaning
http_addr "0.0.0.0:3000" Address and port for plain HTTP. An empty string turns HTTP off.
https_addr "" (off) Address and port for HTTPS, for example "0.0.0.0:443". Uses tls.cert_file and tls.key_file, or without them a certificate from Let’s Encrypt or another ACME authority (see HTTPS).
public_url not set The address users open, for example https://kalzit.example.com: scheme and host, no path. Used for the origin check and for links. Must start with http:// or https://.
redirect_http_to_https true When HTTPS is on, plain HTTP answers with a redirect to HTTPS. /healthz and /readyz stay reachable over HTTP.
base_path "" (the root) The sub-path behind a reverse proxy, such as "/kalzit" for https://example.com/kalzit/. Pages, API, live updates, sign-in callbacks, mail links and cookies follow it; /healthz and /readyz also answer at the root.

At least one of http_addr and https_addr must be set. Network settings are read at start: restart Kalzit after changing them.

[tls]

Key Default Meaning
cert_file not set Certificate chain as a PEM file.
key_file not set Private key as a PEM file.
min_version "1.2" Lowest TLS version: "1.2" or "1.3".
reload_interval_secs 60 How often the two files are checked for changes, in seconds. 0 turns reloading off.

[security]

Key Default Meaning
hsts true Send Strict-Transport-Security on HTTPS responses.
hsts_max_age_secs 31536000 HSTS duration in seconds (one year).
trusted_proxies [] IP ranges of reverse proxies whose forwarding header is trusted, for example ["10.0.0.0/8"]. Everyone else’s are ignored.
forwarded_headers "x-forwarded" Which header the trusted proxies write: "x-forwarded" (X-Forwarded-For, -Proto and -Host) or "forwarded" (the standard Forwarded header). The other one is ignored.
login_max_failures 10 Failed sign-ins allowed per window, per client address and per account, before further attempts are refused.
login_window_secs 900 Length of that window in seconds (15 minutes).
setup_max_failures 100 Wrong setup codes from all addresses together per window, on top of the limit per address.
setup_window_secs 3600 Length of that window in seconds (one hour).

[sessions]

Key Default Meaning
lifetime_hours 720 Longest life of a session (30 days). At least 1.
idle_timeout_hours 168 A session without activity for this long ends (7 days). 0 turns the idle limit off.

[database]

Key Default Meaning
url SQLite file sqlite://... or postgres://.... Without it, Kalzit uses kalzit.db in the data directory.
max_connections 10 Size of the connection pool.

Kalzit’s own database is SQLite (the default, for one server) or PostgreSQL (also for several servers on one database). kalzit db copy moves an installation from SQLite to a new, empty PostgreSQL database while the server is stopped: it copies every table, checks that the secrets key reads the stored secrets and compares the rows of every table. There is no copy back. The steps are in Moving from SQLite to PostgreSQL in the repository.

[paths]

Key Default Meaning
data_dir %ProgramData%\Kalzit\data on Windows, /var/lib/kalzit on Linux Data directory: the SQLite database, backups, the logs of the Windows service and, during setup, setup-token.txt. A relative path in kalzit.toml resolves against the file, one from the environment against the working directory.

[log]

Key Default Meaning
level "info" A log filter, for example "info" or "kalzit=debug,info".
format "text" "text" or "json".
event_log "errors" Windows service only: what also goes to the Windows event log (Application, source Kalzit): "errors", "warnings" (warnings too) or "off". Entries hold no addresses or user ids.

[metrics]

Key Default Meaning
enabled false Serve Prometheus metrics at /metrics (below the sub-path when there is one). Needs a token, allowed networks, or both.
token not set The bearer token scrapers send, at least 16 characters. Give it in KALZIT_METRICS_TOKEN rather than in the file.
allowed_networks [] Client networks that may scrape, for example ["10.0.0.0/8"]. With a token as well, both must match.

The metrics count requests, query times per source kind, query cache hits, active sessions and plugin processes, without names, addresses or query text. Details are in Monitoring in the repository.

[smtp]

The mail server for invitations and password resets. Without host, it is set in the settings under Email instead.

Key Default Meaning
host not set Host of the mail server.
port 0 0 takes the usual port of security: 587 for STARTTLS, 465 for TLS, 25 without.
security not set "starttls", "tls" or "none" (only for a relay on the same machine).
username, password not set The sign-in at the mail server. Give the password in KALZIT_SMTP_PASSWORD; one in the file is used with a warning.
from_name, from_address, reply_to not set Sender name, sender address and reply address of the mails.