Environment variables
cairn reads very few environment variables. This page lists them all. Variables for your app are set in cairn.toml instead, with [env] and env_file (see cairn.toml).
Variables you might set
| Variable | Effect |
|---|---|
CAIRN_PROGRESS=plain | Print progress as plain lines instead of redrawing them. Any other value does nothing. |
NO_COLOR | When set to anything, never use colour. |
CLICOLOR_FORCE | When set to anything, use colour even into a pipe. |
CLICOLOR=0 | No colour. |
TERM, CI | Colour is on for a terminal if TERM is set and isn't dumb, or if CLICOLOR or CI is set. Live progress needs a terminal and a TERM that isn't dumb. |
LC_ALL, LC_CTYPE, LANG | The first one that is set decides whether cairn uses Unicode symbols. It must name UTF-8. |
The rules for combining these are in Output and scripting.
Variables cairn reads from your session
| Variable | Used for |
|---|---|
HOME | A fallback for finding your systemd user unit directory. |
XDG_CONFIG_HOME | If it's set to an absolute path, cairn writes the systemd units for start-at-boot apps to $XDG_CONFIG_HOME/systemd/user. Otherwise it uses ~/.config/systemd/user. |
XDG_RUNTIME_DIR, DBUS_SESSION_BUS_ADDRESS | How cairn talks to your systemd user manager (systemctl --user). Without a session, the systemd launcher is unavailable, and cairn doctor says so. |
NOTIFY_SOCKET | Set by systemd when it starts a VM's supervisor, so the supervisor can report that it started. Never set it yourself. |
PATH | Where cairn finds podman, git, curl and similar tools. cairn run removes the synced folder's directories from it first (see Run an agent). |
Where your data is kept
An installed cairn always keeps your data in ~/.cairn, where ~ is your home directory from /etc/passwd. Each user has exactly one. There's no setting to move it. The layout is described in Files and directories.
Inside the VM
None of the variables above are passed to your app. For cairn run, -e and an agent alias's env list choose which variables are passed in (see Run an agent).
Inside an exec health check, cairn sets CAIRN_CHECK_ADDR to the address the http and tcp checks use.
Variables for developers and tests
These are for cairn's own tests. Don't set them on a normal install.
CAIRN_HOMEis only read by a debug build from a source checkout, where it replaces~/.cairn.CAIRN_JAIL,CAIRN_NETDandCAIRN_HELPERreplace the paths of the helper programs, so that tests can run stand-ins. A normal install always uses/usr/libexec/cairn, and there's no setting for that. The systemd units cairn writes copy these three variables if they're set.- Any variable named
CAIRN_TEST_*,CAIRN_*_TEST_*orCAIRN_UPDATE_GOLDENis a test hook, and isn't supported.
See Development.