Environment variables¶
Bootstrap values (database, listeners, keys) come from the environment. Everything else is configured in the console, stored in the database, audited and applied at runtime on every instance. Some console settings start from the environment (OIDC, allowed domain, local login, stale threshold and the operations settings below); once saved in the console, the saved values win and the variable no longer matters.
Variables that stay in the environment, and why:
- Bootstrap:
LIMDM_DATABASE_URLandLIMDM_DB_MAX_CONNS(needed before the database, where the settings live, can be read),LIMDM_SESSION_KEY,LIMDM_CA_DIR,LIMDM_KEY_PROVIDERandLIMDM_PKCS11_*(keys that protect the settings themselves; a console that could change them could take over the server),LIMDM_LISTEN,LIMDM_AGENT_LISTEN,LIMDM_TLS_*,LIMDM_PUBLIC_URL,LIMDM_AGENT_URL,LIMDM_AGENT_HOSTS(sockets and certificates bound at the start),LIMDM_RELEASE_PUBLIC_KEY(trust anchor of agent packages: a stolen console session must not replace it),LIMDM_ARTIFACT_DIR,LIMDM_RELEASE_DIRandTMPDIR(file system paths of the host). - Safety:
LIMDM_ADMINSandLIMDM_AUDITORS(seed accounts that get you back in),LIMDM_TRUSTED_PROXIES(decides the client address the console network lists check; a wrong value in the console could lock everyone out),LIMDM_GEOIP_URL(offis a host level privacy guarantee),LIMDM_MULTI_TENANT,LIMDM_DRAIN_SECONDSandLIMDM_SKIP_UPGRADE_BACKUP(package and shutdown time).
Server¶
Read by limdm-server serve (ConfigFromEnv). The package reads them from
/etc/limdm-server/server.env, Docker Compose from .env (below).
| Variable | Default | Meaning |
|---|---|---|
LIMDM_DATABASE_URL |
required | PostgreSQL URL. Remote hosts need sslmode=verify-full; only a unix socket or loopback may go without it. |
LIMDM_SESSION_KEY |
required | At least 32 bytes as hex (openssl rand -hex 32). Signs sessions and derives the keys for sealed values (stored secrets, recovery keys). During a rotation a comma separated list, the new key first: the first seals and signs, all of them open and verify; old values are sealed again in the background. Replacing it without a rotation invalidates sessions and makes stored secrets unreadable (Session key). |
LIMDM_PUBLIC_URL |
required | Console URL as users see it, https:// only, for example https://mdm.example.com. |
LIMDM_AGENT_URL |
required | Agent API URL, https://host:port. Its host goes into the server certificate agents verify. |
LIMDM_AGENT_LISTEN |
:8444 |
Listener of the agent API (mTLS, TLS 1.3, terminates here). |
LIMDM_AGENT_HOSTS |
Extra names or IPs for the agent certificate, comma separated (Moving to another DNS name). | |
LIMDM_LISTEN |
127.0.0.1:8080, :8443 with a certificate |
Console listener. Without a certificate only loopback is allowed. |
LIMDM_TLS_CERT, LIMDM_TLS_KEY |
Console certificate and key when no local reverse proxy terminates TLS. | |
LIMDM_CA_DIR |
/var/lib/limdm-server/ca |
Device CA, network CA, command key (key files 0600), keys.json, audit-keys, audit-keyed-from. Back it up (Keys and HSM). |
LIMDM_KEY_PROVIDER |
file |
Where the private keys of the CAs and the command key live: file or pkcs11 (HSM, needs a server built with -tags pkcs11). |
LIMDM_PKCS11_MODULE |
Path of the PKCS#11 module, for LIMDM_KEY_PROVIDER=pkcs11. |
|
LIMDM_PKCS11_TOKEN |
Token label. | |
LIMDM_PKCS11_PIN |
User PIN (Key provider and HSM). | |
LIMDM_LOCAL_LOGIN |
false |
true allows local accounts (password and TOTP). Starting value of the console setting. |
LIMDM_OIDC_ISSUER |
Console single sign on, https:// issuer. Optional; also configurable in the console. |
|
LIMDM_OIDC_CLIENT_ID |
Required when LIMDM_OIDC_ISSUER is set. |
|
LIMDM_OIDC_CLIENT_SECRET |
Client secret. | |
LIMDM_OIDC_ALLOWED_DOMAIN |
Only accept this Google hd claim or email domain. |
|
LIMDM_ADMINS |
Comma separated emails seeded as console admins at start. Required when LIMDM_OIDC_ISSUER is set. |
|
LIMDM_AUDITORS |
Comma separated emails seeded as console auditors at start. | |
LIMDM_STALE_HOURS |
24 |
Hours without check in until a device counts as stale (positive integer). Starting value of the console setting. |
LIMDM_RELEASE_DIR |
/var/lib/limdm-server/agent-releases |
Cache of verified agent packages for updates (Agent updates). The packaged server.env sets /var/lib/limdm-server/releases. |
LIMDM_RELEASE_REPO |
MalteKiefer/limdm |
GitHub repository for agent updates and /install.sh. |
LIMDM_RELEASE_PUBLIC_KEY |
compiled in (release builds) | Ed25519 public release key (64 hex characters) that /install.sh embeds to verify SHA256SUMS before installing. Without a key /install.sh answers 404. Set it for servers built without UPDATE_PUBKEY or agents from your own fork (Release key). |
LIMDM_GEOIP_URL |
https://ipwho.is/ |
Location lookup for device public addresses, the IP is appended. Used only when Settings, Security, Privacy turns geolocation on (default off); off disables it for good (Privacy). |
LIMDM_TRUSTED_PROXIES |
Load balancers or reverse proxies whose X-Forwarded-For names the client, comma separated addresses or networks (10.0.0.5,10.0.1.0/24). A proxy on loopback is always trusted. Without it, a proxy on another host makes every request seem to come from the proxy (rate limits, console network lists, audit) (Load balancer). |
|
LIMDM_DB_MAX_CONNS |
32 |
Database connections of this instance (4 to 1000); a pool_max_conns parameter in LIMDM_DATABASE_URL wins. All instances together plus about 3 per instance (schema, notifications) must stay below max_connections of PostgreSQL (PostgreSQL for several instances). |
LIMDM_MAX_CHECKINS |
64 |
Agent check ins processed at once per instance (1 to 10000); an eighth of them (at least 1) may carry a body over 1 MiB (inventory, package list). A check in without a free slot within 5 s gets 503 with Retry-After, as do agent and API requests that hit a lock or statement timeout; agents wait that long before they try again. Initial value of Settings, Operations. |
LIMDM_UPDATE_DOWNLOADS |
20 |
Agent packages served at once per instance (1 to 10000); more downloads wait up to 20 s, then get 503 with Retry-After (Agent installation). Initial value of Settings, Operations. |
LIMDM_AGENT_PROXY_PROTOCOL |
Load balancers in TCP passthrough mode that send a PROXY protocol v2 header on the agent port, comma separated addresses or networks. Connections from them must start with the header, which names the device's address; other connections are taken as they are (Load balancer). Initial value of Settings, Operations. | |
LIMDM_LOG_LEVEL |
info |
Level of the JSON log on stdout: debug, info, warn or error. TLS handshake and HTTP protocol errors are logged as warn lines too. Initial value of Settings, Operations. |
LIMDM_ACCESS_LOG |
false |
true writes one log line per request: listener, method, path (without query), status, duration, client address and request id. Every answer carries an X-Request-ID header (taken from the request when a proxy set a well formed one, else random), and error log lines name it. Initial value of Settings, Operations. |
LIMDM_AUDIT_API_READS |
sensitive |
Which admin API reads go to the audit log as api.read (writes are always audited): sensitive reads of the audit log and of a single device with its inventory, all every read, off none (Admin API). Initial value of Settings, Operations. |
LIMDM_DRAIN_SECONDS |
5 |
On SIGTERM, how long /readyz fails before connections close, so load balancers stop sending requests (0 to 300). |
LIMDM_SYSLOG |
Forward audit entries and device events as RFC 5424 syslog, udp://host:514, tcp://host:514 or over TLS tcp+tls://host:6514 (Syslog). Initial value of Settings, Operations. |
|
LIMDM_SYSLOG_CA |
CA certificate file (PEM) that verifies a tcp+tls syslog collector; without it the system roots apply. Read once into Settings, Operations as PEM. |
|
LIMDM_MULTI_TENANT |
false |
true shows the tenant pages and the tenant switcher to global administrators (Tenants). Tenant isolation applies regardless. |
LIMDM_ARTIFACT_DIR |
/var/lib/limdm-server/artifacts |
Local store of uploaded packages, content addressed per tenant (Package repository). Part of every backup. Not used when Software, Packages keeps uploads in S3. |
LIMDM_SKIP_UPGRADE_BACKUP |
Set to 1 in the environment of apt or dnf to skip the backup the server package makes before an upgrade (Before upgrades). |
|
TMPDIR |
/tmp |
Where backup archives and uploads are staged before they go to their target. Needs room for one archive or upload; the Docker example points it at the state volume. |
The server refuses to start when OIDC and local login are both off, when OIDC is set without
an administrator in LIMDM_ADMINS, when LIMDM_PUBLIC_URL or LIMDM_AGENT_URL is not
https, or when the console would listen on a public address without a certificate.
limdm-server local-admin -env FILE, limdm-server keys -env FILE and limdm-server backup -env FILE read the same
variables from an env file (limdm-server).
install.sh¶
<LIMDM_PUBLIC_URL>/install.sh installs and enrolls the agent on a device. It is generated
by the server with its agent URL and device CA fingerprint and reads:
| Variable | Default | Meaning |
|---|---|---|
LIMDM_TOKEN |
Enrollment token, written to /etc/limdm/enroll.conf. Without it an existing enroll.conf (or an enrolled device) is used, so the same command serves mass deployment. |
|
LIMDM_ALLOW_SCRIPTS |
false |
true allows remote scripts on this device (allow_scripts). |
LIMDM_ALLOW_REMOTE_SHELL |
false |
true allows remote support shells on this device (allow_remote_shell, Remote shell). |
The keys of enroll.conf, the agent's files under /etc/limdm and /var/lib/limdm and the
agent command line: Mass deployment: enroll.conf, Files on the device.
Docker Compose¶
deploy/docker/.env.example lists the values
compose.yaml uses:
| Variable | Meaning |
|---|---|
LIMDM_DOMAIN |
DNS name of the server. Sets LIMDM_PUBLIC_URL (https://<domain>), LIMDM_AGENT_URL (https://<domain>:8444) and the Caddy site. |
LIMDM_VERSION |
Image tag of ghcr.io/maltekiefer/limdm-server, default latest. |
LIMDM_SESSION_KEY |
As above. |
POSTGRES_PASSWORD |
Password of the database role limdm, hex only (part of the database URL). |
LIMDM_LOCAL_LOGIN |
As above, default true. |
LIMDM_OIDC_ISSUER, LIMDM_OIDC_CLIENT_ID, LIMDM_OIDC_CLIENT_SECRET, LIMDM_OIDC_ALLOWED_DOMAIN, LIMDM_ADMINS, LIMDM_AUDITORS |
As above, optional. |
compose.yaml sets LIMDM_DATABASE_URL, LIMDM_LISTEN (127.0.0.1:8080, Caddy shares the
network namespace) and LIMDM_AGENT_LISTEN itself. Other variables of the table above
(for example LIMDM_SYSLOG) must be added to the environment of the limdm service.