- Elixir 98.6%
- JavaScript 0.5%
- CSS 0.3%
- Shell 0.3%
- Dockerfile 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
CI / image (postgres) (push) Successful in 1m21s
CI / image (sqlite) (push) Successful in 1m26s
CI / test (sqlite) (push) Successful in 1m53s
CI / test (postgres) (push) Successful in 1m56s
Release / build (postgres, linux/arm64) (push) Successful in 2m8s
Release / build (postgres, linux/amd64) (push) Successful in 1m57s
Release / build (sqlite, linux/amd64) (push) Successful in 2m14s
Release / build (sqlite, linux/arm64) (push) Successful in 1m58s
Release / merge (sqlite, -sqlite, sqlite) (push) Successful in 16s
Release / merge (postgres, , latest) (push) Successful in 15s
Release / release (push) Successful in 3s
|
||
| .forgejo | ||
| assets | ||
| config | ||
| docs | ||
| lib | ||
| priv | ||
| rel/overlays/bin | ||
| test | ||
| .dockerignore | ||
| .env.example | ||
| .formatter.exs | ||
| .gitignore | ||
| AGENTS.md | ||
| CHANGELOG.md | ||
| cliff.toml | ||
| Dockerfile | ||
| mise.toml | ||
| mix.exs | ||
| mix.lock | ||
| README.md | ||
Lamplighter
A dashboard for a homelab: it polls the things you run (Proxmox, Kubernetes, Docker, DNS, uptime monitors, GitHub, ...), turns sustained problems into reports, sends notifications, and can have an AI diagnose a report with the sources' help.
To run it locally:
- Run
mise installto get the pinned Erlang/Elixir versions (seemise.toml) - Have PostgreSQL running with a
postgres/postgressuperuser onlocalhost, or setDATABASE_HOSTto reach it elsewhere (dev and test both read it) - Run
mix setupto install dependencies and create the database - Start it with
mix phx.server, or inside IEx withiex -S mix phx.server
Now you can visit localhost:4000 from your browser.
Run mix precommit (compile with warnings as errors, format, and tests)
before sending a change.
Running it for real? See Running in production.
Authentication
Users can log in with email (magic link or password) and, optionally, single
sign-on through any OpenID Connect provider (Authentik, Authelia, Keycloak,
Pocket ID, Dex, ...). SSO is enabled when these environment variables are set.
For local development, copy .env.example to .env (gitignored); mise loads it
automatically.
| Variable | Description |
|---|---|
OIDC_ISSUER |
Issuer URL, e.g. https://auth.example.com/application/o/lamplighter/ |
OIDC_CLIENT_ID |
Client ID registered with the provider |
OIDC_CLIENT_SECRET |
Client secret |
OIDC_DISPLAY_NAME |
Button label on the login page (default SSO) |
OIDC_SCOPES |
Space-separated scopes (default openid email profile) |
OIDC_ALLOW_INSECURE_HTTP |
Dev only: allow a plain-HTTP issuer for local testing |
SSO_ONLY |
true to allow only SSO (see below) |
Register <app URL>/auth/oidc/callback as the redirect URI with your provider.
On first SSO login, an account is created for the user's email. If an account
with that email already exists, it is linked only when the provider reports the
email as verified (email_verified). After that, users are matched by the
provider's stable subject ID, so changing the email at the provider is safe.
With SSO_ONLY=true, registration, password login, and magic links are
disabled, and account email and password are managed by the provider. Since
accounts are created on first SSO login, restrict who can use the
Lamplighter app in your provider (e.g. an Authentik policy or Pocket ID
user group). Lamplighter refuses to start with SSO_ONLY set if OIDC isn't
configured.
Running in production
The Dockerfile builds a self-contained image of the release. Tagged
releases are published for amd64 and arm64 as
git.knope.dev/jfro/lamplighter (see Releasing), in two
variants: PostgreSQL (2026.12.1, 2026.12, latest) and SQLite
(2026.12.1-sqlite, 2026.12-sqlite, sqlite; see SQLite):
docker run -p 4000:4000 \
-e DATABASE_URL=ecto://user:pass@db/lamplighter \
-e SECRET_KEY_BASE=... -e PHX_HOST=lamplighter.example.com \
-e OIDC_ISSUER=https://id.example.com -e OIDC_CLIENT_ID=... -e OIDC_CLIENT_SECRET=... \
-e SSO_ONLY=true \
git.knope.dev/jfro/lamplighter
With Docker Compose, alongside PostgreSQL (generate SECRET_KEY_BASE with
openssl rand -base64 48, or mix phx.gen.secret):
services:
lamplighter:
image: git.knope.dev/jfro/lamplighter:2026.12
restart: unless-stopped
ports:
- "4000:4000"
environment:
DATABASE_URL: ecto://lamplighter:${POSTGRES_PASSWORD}@db/lamplighter
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
PHX_HOST: lamplighter.example.com
MAILGUN_API_KEY: ${MAILGUN_API_KEY}
MAILGUN_DOMAIN: mg.example.com
depends_on:
db:
condition: service_healthy
db:
image: postgres:18
restart: unless-stopped
environment:
POSTGRES_USER: lamplighter
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: lamplighter
volumes:
- db:/var/lib/postgresql
healthcheck:
test: ["CMD", "pg_isready", "-U", "lamplighter"]
interval: 10s
retries: 5
volumes:
db:
Put the variables in a .env file next to compose.yaml. Pin a month
(:2026.12) or an exact version (:2026.12.1) rather than latest, so an
upgrade is a choice (see Backups and upgrades).
Versions are YEAR.MONTH.BUILD; up to 1.3.0 they were semantic versions.
Run one instance (one replica): sources are polled, and diagnoses queued, by the node that runs them, so several replicas would poll everything several times, race on reports, and pay for each AI diagnosis more than once.
Migrations run on start. Everything Lamplighter keeps is in PostgreSQL, so the
container needs no volume (a SQLite build keeps it in one file instead; see
SQLite). It speaks plain HTTP on port 4000; put TLS in a
reverse proxy. Its login cookies are secure and it sends HSTS, so reach it
over https. To serve it straight over plain http on your LAN instead, set
PHX_SCHEME=http (and PHX_URL_PORT if it isn't PORT), or logins won't stick.
GET /healthz answers 200 {"status":"ok","checks":{"database":"ok"}} when
the app can reach its database, and 503 with "error" when it can't (the
reason goes to the log, not the response). It needs no login and isn't logged,
so point an uptime monitor or a load balancer at it. The image's Docker
HEALTHCHECK probes it every 30 seconds, so docker ps shows the container as
healthy or unhealthy.
Registering and "Log in with email" send magic links, which need a mailer:
an SMTP server (SMTP_HOST and MAIL_FROM) or Mailgun (MAILGUN_API_KEY and
MAILGUN_DOMAIN), see Environment. Without one, email login is
off and new accounts can't be confirmed, so either set up a mailer or use SSO
(see Authentication).
To watch the Docker host it runs on, mount its socket and add the socket's
group, since the app runs as nobody (see Docker):
-v /var/run/docker.sock:/var/run/docker.sock:ro --group-add "$(stat -c %g /var/run/docker.sock)"
Environment
| Variable | Required | |
|---|---|---|
DATABASE_URL |
Postgres images | ecto://USER:PASS@HOST/DATABASE |
DATABASE_PATH |
SQLite images | The database file, like /data/lamplighter.db, instead of DATABASE_URL. See SQLite. |
SECRET_KEY_BASE |
yes | Signs cookies, and encrypts the source credentials stored in the database. Generate with mix phx.gen.secret. Changing it means re-entering those credentials. |
PHX_HOST |
yes | The hostname the app is reached at, over HTTPS. LiveView refuses connections from other hosts. |
OIDC_ISSUER, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET |
for SSO | See Authentication, along with OIDC_DISPLAY_NAME, OIDC_SCOPES, and SSO_ONLY. |
SMTP_HOST |
for email | An SMTP server to send through (magic links, email notifications). Needs MAIL_FROM. Set this or Mailgun's variables, not both: the app won't start with both. Without either, email is off. |
SMTP_TLS |
starttls (default), tls (implicit TLS, as on port 465), or none. With TLS the server's certificate is checked against the system's CAs. |
|
SMTP_PORT |
Default 587, or 465 with SMTP_TLS=tls, 25 with none. |
|
SMTP_USERNAME, SMTP_PASSWORD |
A login, if the server wants one. | |
MAILGUN_API_KEY, MAILGUN_DOMAIN |
for email | Or a Mailgun sending key and its domain, instead of SMTP. |
TRUST_X_FORWARDED_FOR |
behind a proxy | true to take the client address from the proxy's X-Forwarded-For (its last entry), so login rate limits count each client rather than the proxy. Only set it when the app is reachable only through the proxy. |
MAILGUN_BASE_URL |
https://api.eu.mailgun.net/v3 for an EU Mailgun domain. |
|
MAIL_FROM |
with SMTP | Sender, as ops@example.org or Lamplighter <ops@example.org>; with Mailgun the default is lamplighter@<MAILGUN_DOMAIN>. |
PUSHOVER_*, NTFY_*, NOTIFY_EMAIL_TO |
Set up notifications; see Notifications. | |
ALLOW_REGISTRATION |
Every account can change sources and settings, so registering by email is open only until the first account exists. true keeps it open. SSO logins aren't affected: your identity provider decides who gets in. |
|
PORT |
HTTP port, default 4000. |
|
PHX_SCHEME |
https (default) when browsers reach the app through a TLS proxy; cookies are then secure and responses send HSTS. Set http for a plain-http LAN install (e.g. http://nas:4000), or logins won't stick. |
|
PHX_URL_PORT |
The port in links and the OIDC redirect URI: default 443 for https, or PORT for http. |
|
RUN_MIGRATIONS |
Set to false to skip migrations on start and run bin/migrate yourself. |
|
POOL_SIZE |
Database connections, default 10 (5 with SQLite). |
|
ECTO_IPV6 |
true to connect to the database over IPv6. |
SQLite
For a small install without a database server, use the SQLite image. The
database is fixed when the image is built, so there's one image for each; a
SQLite image doesn't take DATABASE_URL, and a Postgres one doesn't take
DATABASE_PATH. Releases publish it with a -sqlite suffix
(2026.12.1-sqlite, 2026.12-sqlite), and sqlite follows the newest
release the way latest does for PostgreSQL:
docker run -p 4000:4000 -v lamplighter-data:/data \
-e DATABASE_PATH=/data/lamplighter.db \
-e SECRET_KEY_BASE=... -e PHX_HOST=lamplighter.example.com \
git.knope.dev/jfro/lamplighter:sqlite
To build it yourself: docker build --build-arg LAMPLIGHTER_DB=sqlite -t lamplighter:sqlite .
Keep /data on a volume: it holds everything. Back it up with the app
stopped, or with sqlite3 /data/lamplighter.db ".backup lamplighter.bak"
while it runs. In development, LAMPLIGHTER_DB=sqlite mix setup uses
lamplighter_dev.db in the project folder (use a separate MIX_BUILD_ROOT,
like _build_sqlite, to keep both builds compiled).
Backups and upgrades
Everything to keep is in the PostgreSQL database: accounts, sources and their
encrypted credentials, reports, settings, and API tokens. Back it up with
pg_dump (with the Compose file above:
docker compose exec db pg_dump -U lamplighter -Fc lamplighter > lamplighter.dump)
and restore with pg_restore --clean. Keep SECRET_KEY_BASE with the backup:
without the same value, the restored source credentials can't be decrypted and
must be entered again, and everyone has to log in again.
To upgrade, read CHANGELOG.md for the release, back up the database, then
pull the new image and restart it (docker compose pull && docker compose up -d).
Migrations run on start; with RUN_MIGRATIONS=false, run bin/migrate in the
new image before starting it. Migrations only move forward, so to go back to an
older version, restore the backup taken before the upgrade.
Releasing
Commit messages follow conventional commits
(feat:, fix:, ...), which git-cliff turns into
CHANGELOG.md (configured in cliff.toml); older commits starting with
"Add" or "Fix" are grouped as features and fixes. To release:
mise run release -n # preview the next version and its notes
mise run release # bump mix.exs, update the changelog, commit, tag and push
mise run release 2026.12.3 # or release an exact version
Versions are YEAR.MONTH.BUILD, like 2026.12.1: the month of the release
(in UTC, without a leading zero, so it's still valid SemVer for Mix) and its
build, which starts at 1 each month (.forgejo/scripts/next-version.sh
counts the month's v* tags).
Pushing a v* tag builds both images (PostgreSQL and SQLite) for both
architectures and publishes them: PostgreSQL tagged with the version, the
month (2026.12), and latest; SQLite with the same plus -sqlite
(2026.12.1-sqlite, 2026.12-sqlite) and sqlite. It then creates the
Forgejo release for the tag with the tag's notes and a pull line for each
image (.forgejo/scripts/publish-release.sh; versions with a -, like
2026.12.1-rc.1, become pre-releases). CI runs the checks and tests, for
both databases, on every push to main and on pull requests, and builds both
images (without pushing them) to catch a broken Dockerfile before a tag.
Sources and reports
Lamplighter polls sources for the current state of what they watch, and triggers turn sustained problems into reports on the dashboard:
- A source (
Lamplighter.Sources.SourceType) returns oneSignalper watched thing on each poll: its status, the what (title, summary), the why if known, and raw facts for diagnosis. Lamplighter.Triggerstracks how long each signal has been failing or healthy and opens or resolves reports once the source'sopen_after/resolve_afterthresholds are met.- If a source can't be polled, that becomes a report of its own.
Each source is labeled with what it's for:
- Problems: it finds problems, which become reports. Most sources do this.
- Context: it answers queries for metrics, logs, and state while a report is diagnosed, such as PromQL against Prometheus. It's polled only to check it can be reached, so its form has no thresholds for problems.
A source that finds problems also answers queries for the same things, so a diagnosis can look at them live, healthy ones included. Only Prometheus and Loki are context alone.
Sources are added and configured in the app under Settings → Sources,
including connection details, credentials, and timing thresholds. Credentials
are stored encrypted with a key derived from SECRET_KEY_BASE; if that
changes, re-enter them. The settings form can test a connection before saving.
Polls are logged when something changes, not on every poll: a warning when a source starts failing or fails differently (with the source's id, type, name, the HTTP status if any, and how long the poll took), and an info line when it recovers, with how many polls failed and for how long.
Uptime Kuma
Lamplighter reads Kuma's /metrics endpoint, so a read-only API key (Kuma:
Settings → API Keys) is enough. Point it at Kuma's base address, not through a
login proxy. It reports:
- Down monitors, one report per host when several of its monitors fail
- Brief outages between checks, caught from drops in Kuma's uptime ratio
- Slow responses, when the last day's average is several times the 30-day one
- TLS certificates that are invalid or close to expiry
Tune individual monitors with Kuma tags (Kuma exports a new tag only after it restarts, and keeps only letters, digits, and underscores in values):
| Tag | Value | Effect |
|---|---|---|
lamplighter |
ignore |
Skip the monitor entirely |
lamplighter |
critical, serious, warning |
Severity when down (default critical) |
lamplighter_group |
any name, e.g. storage |
Report these monitors together |
It also adds context to diagnoses: every monitor with its status, target,
response times, uptime over a day, month, and year, and certificate, healthy
and ignored ones included. Kuma's API keys only open /metrics, so its error
messages and heartbeat history aren't available, and paused monitors don't
appear. Credentials written into a monitor's URL are left out.
Uptime Robot
Lamplighter reads monitors through Uptime Robot's v3 API with the account's read-only API key (Integrations & API → API). It reports:
- Down monitors, with Uptime Robot's reason (e.g. Connection Timeout) and when the incident started; "looks down" is held until Uptime Robot confirms it
- Paused monitors, only if turned on in the source's settings
- TLS certificates close to expiry or expired
Limit it to monitors with certain tags in the settings, or tag a monitor
lamplighter:ignore to skip it, or lamplighter:warning / :serious /
:critical to set its severity when down (default critical). A poll makes one
request per 200 monitors; the free plan allows 10 requests a minute per key.
It also adds context to diagnoses, one request per query: monitors whatever their status, one monitor's checks and certificate, incidents with their reasons, an incident's root cause (the HTTP status and response it got), response times, and uptime over a range. Some plans don't include the statistics. Monitors' credentials and request headers are never returned.
Dokploy
Generate an API key in Dokploy (Settings → Profile → API/CLI). Keys act as the user who made them and Dokploy has no read-only keys, so prefer a member with read access to the projects to watch, plus Docker read access for the container check. Note that Dokploy's Docker read permission also lets the key stop or remove containers; turn the container check off if that's too much. It reports applications, Compose services, and databases:
- Failed deploys, with Dokploy's error message; a warning while the previous version is still running
- Services that aren't running: deployed, but no container is running, one keeps restarting, or a Compose container exited with an error
During diagnosis it lists services, their recent deployments and deploy logs, and their containers. Limit it to some projects in the settings. Dokploy before 0.26 lists only applications and Compose services, without the container check.
Proxmox VE
Create an API token (Datacenter → Permissions → API Tokens) and give its user
the PVEAuditor role on /, plus the token itself if it has privilege
separation. It reports offline nodes, nodes that rebooted (seen from their
uptime dropping), lost quorum, guests set to start at boot
that aren't running, storage that's unavailable or filling up, ZFS pools that
aren't ONLINE, disks failing SMART, failed backup runs, and guests not covered
by any backup job (templates are left out unless "Check templates' backups" is
on). Tag guests lamplighter-ignore, or lamplighter-warning /
-serious / -critical to set their severity.
Pending updates are opt-in: reading them needs Sys.Modify on the nodes,
which also allows changing node settings.
A reboot says whether the node shut down cleanly first, from the stopall
task Proxmox runs to stop guests in every clean shutdown (from the web UI, the
shell, or a UPS). One without it, after a power loss, crash, or reset, is
serious rather than a warning.
A stopped guest that should be running says why, from its latest task: the error of a failed start, who shut it down, or that it last started fine and nothing in Proxmox stopped it (it shut down from inside or crashed). A failed backup run's cause adds the error lines from its log, such as which guest failed and why, where Proxmox only says "job errors".
It also adds context to diagnoses: the cluster's nodes, guests, and storage
with their usage; a guest in depth (live status, hardware, disks, any lock, and
recent tasks); tasks and their logs, such as why a backup or a guest start
failed; and Proxmox's own metric history for nodes, guests, and storage. A
guest's notes, cloud-init password, SSH keys, and raw QEMU arguments are never
read out. Diagnoses can also read nodes' system logs (kernel, corosync, and
service messages) if you turn that on and grant Sys.Syslog with the setup
guide's optional LamplighterSyslog role.
A role granted on /nodes replaces PVEAuditor there rather than adding to
it, so the guide's optional roles include Sys.Audit. If you created
LamplighterUpdates from an older guide, with Sys.Modify alone, failed
backups have gone unreported; fix it with
pveum role modify LamplighterUpdates --privs Sys.Audit,Sys.Modify.
Test connection says when a role hides the nodes like this.
Proxmox Backup Server
Create an API token and give both the user and the token the Audit role
on /; PBS limits a token to what its user may do. It reports datastore errors
and capacity (including projected fill-up), backup groups with no recent
backup in any namespace, latest backups that failed verification, failed jobs
(verify, sync, prune, garbage collection), and pending updates. A failed job's
cause adds the error lines from its task log, since PBS's own status often only
says to check it.
It also adds context to diagnoses: datastores with their usage and last
garbage collection, backup groups and snapshots with their verification state,
tasks and their logs (e.g. which chunks failed verification), metric history,
and the system log. The Audit role already allows all of it; a setting turns
the system log off.
Kubernetes (k3s and others)
Create a read-only service account (the settings page has a copyable
kubectl apply manifest; it can't read Secrets or change anything) and paste
its token, the cluster's CA certificate, and the API server URL. It reports
nodes that aren't ready or are under pressure, Deployments, StatefulSets, and
DaemonSets missing pods (with the reason: unschedulable, crash-looping, image
pull failures, and so on), containers restarting while otherwise healthy,
failed CronJob runs (as backups when named or annotated like one), and
cert-manager certificates that aren't ready.
A node reboot is one report, seen from the node's boot ID changing even when the reboot was too quick for it to go NotReady. Containers on the node that restart in the 15 minutes after are counted in that report instead of reported one by one, including ones that take a few tries while their dependencies come back.
Annotate namespaces or objects with lamplighter.dev/ignore: "true", or
lamplighter.dev/severity: warning|serious|critical.
It also adds context to diagnoses: pods with why containers are waiting or how they last ended (e.g. OOMKilled), one pod in depth with its recent events, events, nodes, and container logs, including a crashed container's previous run. Environment variables, command arguments, and volumes are never read out. Logs can hold secrets, so a setting turns that off. If you set up the service account before events and logs were added, apply the manifest again; Test connection says when it can't read them yet.
Alertmanager
Point it at Alertmanager (not Prometheus), with basic-auth credentials or a
bearer token if it's protected. Firing alerts become reports, one per
alertname by default (configurable, e.g. alertname,instance), using the
alert's summary/description, its severity label, and its real start time.
info/none alerts such as Watchdog are skipped unless included. Silenced
alerts keep their report open; alerts that stop firing resolve on the next
poll. Set a lamplighter_kind label (security, backup, performance,
updates) to choose a report's kind; otherwise it's guessed from the alert
name.
It also adds context to diagnoses: every alert it holds, in every state (including silenced, inhibited, and info alerts that don't become reports), filtered by label matchers, state, or receiver; silences, including pending and recently expired ones, with how many alerts each silences; and its status with the routing config (routes, inhibit rules, time intervals), without receivers' settings. It never creates or expires silences.
QNAP NAS
Enable SNMPv3 in QTS (Control Panel → Network & File Services → SNMP) with authentication (HMAC-SHA), and privacy with AES if offered. DES isn't supported; if the QNAP only offers DES, turn privacy off on both sides: requests stay authenticated but the data isn't encrypted on the network. Lamplighter reads QNAP's storage tables: disk health and SMART status, disk and system temperatures, fans, power supplies, RAID groups, storage pools, and volume status and fullness, for the NAS and any expansion units. Firmware updates are optional: they need the web interface URL and an administrator login (without 2-step verification) and are checked every 12 hours, or hourly while an update is pending.
App (QPKG) updates are optional too, and off by default. Over the same
administrator login (one login a check, shared with firmware), Lamplighter
asks the NAS for its installed apps the way App Center does
(appRequest.cgi?subfunc=qpkg&apply=10), then compares them with QNAP's
public App Center feed for the NAS's exact QTS version, on the same schedule
as firmware. It picks the feed entry for the NAS's platform, reports an app
only when the feed's version is newer, and skips apps from third-party
stores. It needs no SSH. QNAP doesn't document this answer, so a QTS update
may change it; if it does, the check fails rather than calling every app
current.
It also adds context to diagnoses: the same storage tables read live, healthy parts included, and, when firmware updates are checked, a check for one right away.
Docker and Docker Swarm
Give Lamplighter read-only access to the Docker API, in one of three ways (the
settings page has commands): mount /var/run/docker.sock read-only and keep
the default unix:// address; run a socket proxy that only allows CONTAINERS,
EVENTS, INFO, NODES, SERVICES, and TASKS, and use http://<host>:2375; or use
Docker's TLS port (https://<host>:2376) with a client certificate and key and
Docker's CA. For a swarm, connect to a manager. Inspecting containers reveals
their environment variables, so keep a proxy off networks others can reach.
On the host, it reports containers that keep restarting, are unhealthy (with
the health check's output), ran out of memory, couldn't start (such as a port
already taken after a reboot), or crashed, plus restarts between checks.
Containers stopped with docker stop are fine, and stopped containers without
a restart policy are only watched once Lamplighter has seen them running, so
old leftovers aren't reported. On a swarm, it reports nodes that are down,
unreachable managers, services with fewer running tasks than desired, jobs and
run-to-completion services (like swarm-cronjob backups) whose latest run
failed, and rolling updates that were rolled back, paused, or stuck. Causes
come from Docker: scheduling errors such as "no suitable node", exit codes, and
the last lines the failed container or task printed (turn this off if logs may
hold secrets).
It also adds context to diagnoses: the host, every container (running or not) with its health checks, restarts, and exit codes, recent events (Docker keeps only a short history), and, unless turned off, container, service, and task logs; on a swarm, nodes and services with their tasks and update status. Environment variables, commands, and labels outside Compose, swarm, and Lamplighter's own are never returned.
Label containers, services, or nodes lamplighter.ignore=true,
lamplighter.severity=warning|serious|critical, or lamplighter.kind=backup.
Prometheus
A context source: it reports no problems itself (point the Alertmanager source
at your alert rules for that), but answers queries while a report is diagnosed:
PromQL at an instant or over a range, the series and label values that exist
(e.g. every metric recorded for a host), and scrape targets with their last
error. Results are capped so they stay readable, and say when they were cut
short. Point it at Prometheus itself (with kube-prometheus-stack, usually
http://prometheus-operated.monitoring:9090), with basic-auth credentials or a
bearer token if it's protected. Anything serving Prometheus's query API works,
such as Thanos, VictoriaMetrics, or Grafana Mimir (include its /prometheus
prefix). Test connection shows its version and which scrape targets are
down.
Queries run through Lamplighter.Sources.query_context/3, for example from
iex:
source = Lamplighter.Sources.get_source!(id)
Lamplighter.Sources.query_context(source, "query_range", %{
query: ~s|node_memory_MemAvailable_bytes{instance=~"pve1.*"}|,
start: "2026-10-02T13:00:00Z"
})
Loki
A context source, like Prometheus: it answers LogQL queries while a report is
diagnosed, such as what a crashing pod logged before it died, and lists the
labels, label values, and streams that exist so the right logs can be found.
Log queries return lines grouped by stream (newest first, or oldest first to
read from when a problem began), at most 500 and each cut at 1,000 characters;
metric queries such as count_over_time return series. Point it at Loki's
gateway or query frontend (or the single binary, port 3100), not Grafana. If
Loki runs multi-tenant (auth_enabled: true), enter the tenant ID, sent as
X-Scope-OrgID; for a proxy or Grafana Cloud, enter credentials too. Test
connection shows its version and the labels its recent logs carry.
Sable DNS
Turn on Sable's MCP server (Integrations → MCP Server), then create an API
token whose groups grant blocking.read, cluster.read, logs.read,
zones.read, and updates.read on the API surface. Lamplighter calls only read-only tools that
Sable turns on by default. It reports:
- Block lists that fail to update, with Sable's reason
- Cluster nodes that are offline, have open problems, or are still catching up, and a rolling update that failed
- Insights findings Sable marks as needing attention (optionally notices too, such as new devices)
- A newer Sable release, from Sable's own update check, with the cluster
nodes still on an older one (Sable 1.6 or newer, with
updates.read; development builds have no update info)
A tool the token has no grant for is skipped, and the connection test says so. During diagnosis it resolves names through Sable, checks whether a domain is blocked and why, and reads its query statistics and findings.
GitHub
Create a fine-grained personal access token (Settings → Developer settings →
Personal access tokens → Fine-grained tokens) for the user or organization
that owns the repositories, with read-only repository access to Actions,
Checks, Code scanning alerts, Contents, Dependabot alerts, Issues, Pull
requests, and Secret scanning alerts. A token covers one owner, so add a source
per owner. List repositories as owner/name, or owner/* for all of an
owner's (archived repositories are always skipped, and forks are skipped when
matched by owner/*; a fork you list by name is watched). For GitHub
Enterprise Server, set the API URL to https://HOST/api/v3. It reports, per repository:
- Dependabot and code scanning alerts at or above a minimum severity (default medium)
- Secret scanning alerts, critical when GitHub knows the secret is still valid or was leaked publicly
- Failing workflows: an Actions workflow whose latest run on the default branch failed, or that GitHub disabled for inactivity
- Dependency updates left waiting: Renovate or Dependabot pull requests open longer than a threshold (default 14 days)
- Renovate problems: a broken Renovate config, or errors on its Dependency Dashboard
Each check can be turned off, and you can then leave out its permission. A token missing a permission fails the poll, saying which one to add, except Checks, which is only used for failed-job details and is skipped without it. During diagnosis it shows recent changes, what a commit changed, pending updates, and workflow runs and their logs.
Sources behind NAT
To watch sources on a network Lamplighter can't reach, such as another site
behind NAT, run a relay agent there: the same image with
LAMPLIGHTER_MODE=agent, which connects out to Lamplighter and makes the
sources' requests for it, limited to the hosts you allow. Create one under
Settings → Agents, then set a source's Reach through agent. See
docs/agent.md and docs/compose.agent.yaml.
Self-signed certificates
Sources that talk HTTPS can trust a server's self-signed certificate by its SHA-256 fingerprint (it may then be reached by IP), or trust a private CA by pasting its PEM certificate. When verification fails, Test connection shows the fingerprint the server presented, to compare against the one the server itself displays (e.g. the PBS dashboard's "Show Fingerprint").
Adding a source type
Implement the Lamplighter.Sources.SourceType behaviour and register the
module in Lamplighter.Sources.types/0. Describe its settings with
Lamplighter.Sources.Field specs in settings_fields/0, and the settings form,
validation, encrypted secrets, and connection test come for free. Polling,
thresholds, persistence, and reports are handled generically.
A source that adds context returns :context from roles/0 (alongside
:problems if it also finds them), describes its queries as
Lamplighter.Sources.ContextQuery structs in context_queries/0, and runs them
in query/3. Params are checked and cast before query/3 sees them.
Notifications
Settings → Notifications sends reports to Pushover, ntfy, email, or any number of webhooks: when one opens, when its severity gets worse, and (unless you turn it off) when it resolves. Each channel has its own minimum severity, serious by default, so pending updates and other warnings don't ping your phone unless you ask. Send a test checks the settings before you save them. A failed delivery is logged and shown on the settings page.
| Channel | You need |
|---|---|
| Pushover | An application token (create one at pushover.net/apps/build) and your user or group key. Critical reports go out at high priority, serious at normal, warnings and recoveries quietly. |
| ntfy | A topic, on ntfy.sh or your own server, plus an access token if the topic is protected. Priorities run from 5 (critical) down to 2 (recoveries). |
| A mailer (SMTP or Mailgun, see Environment) and one or more addresses. | |
| Webhooks | As many as you like, each a URL that takes a JSON POST (like an AI agent's or an automation's), with an optional name and signing secret. See below. |
Environment variables can set a channel instead, and win over the saved
settings: PUSHOVER_APP_TOKEN, PUSHOVER_USER_KEY, PUSHOVER_DEVICE;
NTFY_URL, NTFY_TOPIC, NTFY_TOKEN; NOTIFY_EMAIL_TO. Webhooks are
only set up in settings. A channel whose
required fields are all set this way is on without saving anything; its
severity and recovery settings still come from the settings page. A token
from the environment only goes to the server the environment names: for a
self-hosted ntfy server, set NTFY_URL along with NTFY_TOKEN (otherwise the
token is only sent to https://ntfy.sh, never to a URL typed into settings).
Webhooks
Webhooks let other systems act on reports: an AI agent that looks into an
incident, a chat bot, a home automation. Add as many as you like under
Settings → Notifications → Webhook, and edit, test, turn off or remove
each one there. Each has its own minimum severity and recovery setting, and
every webhook that's on gets each notification. Changing a webhook's URL
means entering its signing secret again. Each notification is a POST of
JSON; any 2xx answer counts as delivered:
{
"event": "opened",
"title": "Critical: pve1 is down",
"body": "Proxmox VE · pve1",
"severity": "critical",
"url": "https://lamplighter.example.com/?kind=incident",
"sent_at": "2026-12-01T09:30:00Z",
"report": {
"id": 42, "kind": "incident", "status": "open", "title": "pve1 is down",
"url": "https://lamplighter.example.com/reports/42",
"api_url": "https://lamplighter.example.com/api/v1/reports/42",
"...": "the rest as GET /api/v1/reports/42 gives it"
}
}
event is opened, escalated, resolved, still_open (after a
silence ended), grew (more joined its incident) or test (with report
null), and is also sent as the X-Lamplighter-Event header. With a signing
secret, X-Lamplighter-Signature is sha256= followed by the hex
HMAC-SHA256 of the raw body, keyed with the secret: compute it over the bytes
you received and compare. To read more or write back (notes on the report),
the receiver can use the API with its own token.
API
Lamplighter has a read-only JSON API at /api/v1, for tools that gather
its reports. It's authenticated with a personal API token (llk_…), sent
as a bearer token; the session cookie doesn't count, and a token in the URL
is refused.
Create tokens under Settings → API. A token is shown once, when it's created, so copy it then; only its hash is kept. Creating one needs a sign-in from the last 20 minutes (the page asks you to sign in again otherwise), and each user can have up to 20 live tokens. Tokens can expire after 30 days, 90 days, or a year, or never, and can be revoked there at any time; the list shows when each was last used.
curl -H "Authorization: Bearer llk_…" https://lamplighter.example.com/api/v1/reports?status=open
| Endpoint | What it returns |
|---|---|
GET /api/v1/summary |
unresolved reports counted per kind |
GET /api/v1/reports |
reports, newest first; filters status (open, resolved, all), kind, severity, updated_since (ISO 8601); pages with limit (at most 100) and cursor (the previous page's next_cursor) |
GET /api/v1/reports/:id |
one report |
GET /api/v1/sources |
each source's name, type, and health (never its settings or secrets) |
Each token may make 120 requests a minute; past that the API answers 429
with Retry-After. Set config :lamplighter, LamplighterWeb.ApiAuth, rate_limit: n to change it. Failed sign-ins are limited to 300 a minute per
client address; behind a reverse proxy every client shares the proxy's
address, which is why it's generous. A valid token is never held back by it.
Requests from a browser page are refused (403) unless their Origin is the
app's own URL (PHX_HOST, PHX_SCHEME, PHX_URL_PORT), which stops DNS
rebinding. To let a browser dashboard on another origin call the API, list it
in API_ALLOWED_ORIGINS, comma-separated: https://dash.example.com.
Clients that aren't browsers send no Origin and aren't affected.
MCP
The same reads are an MCP server at /api/mcp (Streamable HTTP), for AI
clients such as Claude Code, with the same token, limits, and Origin rule:
claude mcp add --transport http lamplighter https://lamplighter.example.com/api/mcp \
--header "Authorization: Bearer llk_…"
Its tools are get_summary, list_reports (the same filters and paging as
GET /api/v1/reports), get_report, and list_sources, each answering with
the REST endpoint's JSON. None of them change anything. Send one JSON-RPC
message per request: batches (dropped in MCP 2025-06-18) are refused, so each
tool call counts against the token's rate limit. /mcp is a separate,
internal server for AI diagnosis runs and doesn't accept API tokens.
AI diagnosis
Lamplighter can diagnose reports with Claude: it reads a report and its facts, queries your sources (Prometheus, Loki, Alertmanager, Proxmox, …) as tools, and writes the most likely cause, with its evidence, and what to check next. The report shows the diagnosis, the model, and the queries it ran. Set it up under Settings → AI with one of:
- Claude Code: uses a Claude subscription. Run
claude setup-tokenon any machine with Claude Code and paste the token. Lamplighter runs the Claude Code CLI headless (the image includes it) with its own config directory, so nothing of a local Claude Code setup is used. The CLI reaches the tools through Lamplighter's own/mcpendpoint, over loopback, with a token that only works while that diagnosis runs. - Claude API: uses an Anthropic API key, billed per use. The tool loop runs inside Lamplighter.
Check connection asks the model for a short reply before you save. New reports are diagnosed automatically unless you turn that off; any report can be diagnosed, or diagnosed again, from the dashboard. Diagnoses run two at a time and pause when a usage limit is hit, resuming when it resets. Each diagnosis uses your subscription's allowance or API credit.
Other AI providers can be added by implementing Lamplighter.AI.Provider and
registering the module in Lamplighter.AI.providers/0; diagnosis only talks to
that behaviour.