Monita

Command line

The monita binary serves the app and manages a host.

CommandDoes
monita serveRuns pending migrations, then serves
monita migrateRuns pending migrations and exits
monita setup [--yes]Writes the env file and creates the first super admin
monita service installCreates the monita user and folders, writes the systemd unit, starts it, waits for /healthz
monita service status / logs [-f] / uninstallInspect or remove the service
monita whereis [env|data|backups|bin|service|logs]Prints where things are
monita admin create --emailCreates a super admin
monita admin reset-password --emailSets a new password for a super admin, turns their two-factor sign-in off, and signs them out
monita admin reset-sign-in --emailFor any active user who lost the authenticator and the recovery codes. Turns two-factor off, stops the old password, and sends a link to set a new one
monita probe --server <url>Runs checks for one location of another Monita and reports them. Reads the token from MONITA_PROBE_TOKEN; no env file, no database. See Locations.
monita probe install --server <url>Linux, as root: installs the probe as the monita-probe systemd service, with the token from MONITA_PROBE_TOKEN in /etc/monita/probe.env (mode 0600). monita probe uninstall removes it.
monita --versionPrints the version

The env file

Every command reads /etc/monita/monita.env when MONITA_ENV is not set, so root runs commands without loading the file by hand. --env-file <path> names another file. A variable already set in the environment wins over the file.

Scripted setup

monita setup --yes asks nothing. It takes each value from the matching MONITA_* variable, then the file, then the default. The first admin comes from MONITA_ADMIN_EMAIL and MONITA_ADMIN_PASSWORD, which are never written to the file.

sudo MONITA_BASE_URL=https://monita.example.com MONITA_SMTP_URL=smtps://u:p@mail:465 \
  MONITA_ADMIN_EMAIL=you@example.com MONITA_ADMIN_PASSWORD='a-long-password' \
  monita setup --yes

Running it again with the same answers changes nothing. The full contract is api-specs 10.

Edit this page on GitHub