Configuration Reference
Crit Alarm is configured using environment variables or a YAML configuration file.
Configuration Formats
Section titled “Configuration Formats”Environment Variables
Section titled “Environment Variables”Environment variables are prefixed with CRITALARM_ and use uppercase snake_case:
CRITALARM_BASE_URL="https://alerts.example.com"CRITALARM_RELAY_URL="https://relay.critalarm.app"CRITALARM_RELAY_CONTENT="none"CRITALARM_LISTEN=":8080"CRITALARM_DATA_DIR="/data"CRITALARM_BEHIND_PROXY="true"YAML Configuration File
Section titled “YAML Configuration File”Alternatively, mount a configuration file at /etc/critalarm/config.yaml or pass --config /path/to/config.yaml:
base-url: https://alerts.example.comrelay-url: https://relay.critalarm.apprelay-content: nonelisten: :8080data-dir: /databehind-proxy: trueConfiguration Options
Section titled “Configuration Options”base-url
Section titled “base-url”- Environment Variable:
CRITALARM_BASE_URL - Type: String (URL)
- Required: Yes
- Example:
https://alerts.example.com
The public URL at which your server is accessible from the internet. Do not include a trailing slash.
This must match the app: The mobile app and push relay identify subscriptions by a cryptographic topic hash:
sha256(base_url + "/" + topic). Ifbase-urldoes not exactly match the server address entered in the mobile app, topic hashes will not align, and push notifications will not reach your phone.
relay-url
Section titled “relay-url”- Environment Variable:
CRITALARM_RELAY_URL - Type: String (URL)
- Default:
https://relay.critalarm.app
The endpoint of the push relay service responsible for delivering APNs (Apple) and FCM (Android) notifications to mobile devices.
relay-content
Section titled “relay-content”- Environment Variable:
CRITALARM_RELAY_CONTENT - Type: String enum (
noneorfull) - Default:
none
Controls how alert data is transmitted through the push relay.
none(the default): The push notification sent to the relay contains only an opaque topic hash, incident ID, and priority. No message title, body, or server URL is included. When the push arrives on an iOS device, the iOS Notification Service Extension (NSE) connects back to your server (GET /v1/incidents/:id) using your local credentials to fetch the title and body before displaying the alert. If the device cannot reach your server (for example, if your home internet is down), the alarm still rings with a generic fallback title:Critical alert on prod (open to see details).full: The alert title and message body are included directly inside the push payload delivered through the relay. This eliminates the secondary network fetch from the phone, but transmits alert text through the relay infrastructure.
listen
Section titled “listen”- Environment Variable:
CRITALARM_LISTEN - Type: String (
[host]:port) - Default:
:8080
The interface address and TCP port the HTTP daemon binds to inside the container or host.
data-dir
Section titled “data-dir”- Environment Variable:
CRITALARM_DATA_DIR - Type: String (File path)
- Default:
/data
The local directory where SQLite database files, migration locks, and authentication state are stored. Ensure this directory is mounted to persistent storage.
behind-proxy
Section titled “behind-proxy”- Environment Variable:
CRITALARM_BEHIND_PROXY - Type: Boolean (
trueorfalse) - Default:
true
Instructs the HTTP server to trust standard forwarding headers (X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Host) supplied by reverse proxies.
With it on, rate limiting counts the client, not your proxy, and the server knows the request came in over HTTPS.
Startup Log Verification
Section titled “Startup Log Verification”Upon boot, Crit Alarm logs all effective settings in its opening output:
[INFO] critalarm v0.1.0 starting[INFO] base_url: https://alerts.example.com[INFO] relay_url: https://relay.critalarm.app[INFO] relay_content: none[INFO] listen: :8080[INFO] data_dir: /data[INFO] behind_proxy: true[INFO] mode: selfhosted[INFO] server listening on :8080Review this log line after starting your container to verify that reverse proxy configuration and environment variables were recognized correctly.