pulsequorum

module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: AGPL-3.0

README

Pulsequorum

Pulsequorum

Hochverfügbarer, mandantenfähiger Uptime-Monitor zum Selbsthosten

Im Aufbau. Pulsequorum ist noch nicht für den Produktivbetrieb freigegeben. v0.*-Versionen sind Vorabversionen. Unterstützte Versionen und Sicherheitsmeldungen: siehe SECURITY.md.

Was ist Pulsequorum?

Pulsequorum prüft die Erreichbarkeit von Diensten von mehreren Knoten aus. Die Knoten bilden einen Raft-Cluster: Ein Monitor gilt erst dann als ausgefallen, wenn sich ein Quorum einig ist. Netzprobleme an einem einzelnen Standort erzeugen so keinen Fehlalarm, und der Ausfall eines Knotens unterbricht die Überwachung nicht.

  • Monitortypen: HTTP(S) (auch mit Client-Zertifikat/mTLS), TCP, DNS und ICMP
  • Konsens-Status: Heartbeats werden zwischen den Knoten repliziert, Statuswechsel und Incidents laufen über Raft
  • Alarme: Benachrichtigungskanäle (Shoutrrr-URLs, Webhooks) mit Bündelung, Rate-Limits und Wartungsfenstern
  • Uptime: Rollups, Latenzen je Knoten und Aufbewahrungsfristen
  • Mandanten: Rollen, Limits, Anmeldung lokal oder über OIDC (z. B. Zitadel), API-Tokens und Audit-Log
  • Sicherheit: SSRF-Schutz für alle ausgehenden Prüfungen und Benachrichtigungen, verschlüsselte Geheimnisse, die in der API maskiert werden
  • Betrieb: Prometheus-Metriken, Selbstüberwachung des Clusters, ein Binary mit eingebetteter Web-Oberfläche

In Arbeit / geplant (P5): Probes hinter NAT, externes Frontend mit Failover, PostgreSQL-Backend (zunächst Vorarbeiten), Backup und Restore. Weitere Monitortypen und Statusseiten folgen in P6.

Stand

Phase Inhalt Status
P0 – Fundament Grundgerüst, Architekturentscheidungen, Spikes ✅ abgeschlossen
P1 – Kern Single-Voter mit Checks, Uptime, Alarmen, lokalen Nutzern ✅ abgenommen
P2 – Cluster Join/Leave, mTLS, Heartbeat-Replikation ✅ abgenommen
P3 – HA-Logik Konsens-Status, Leader-Alarme, Degraded-Modus, Selbstüberwachung ✅ abgenommen
P4 – Mandanten OIDC, Rollen, Limits, SSRF-Durchsetzung, Admin-UI ✅ abgenommen
P5 – Reichweite Probes, externes Frontend, Backup; Release 1.0 🔄 in Arbeit
P6 – Ausbau Statusseiten, Push-Monitore, weitere Typen, Node-Labels ⬜ geplant

Details und Abnahmeberichte: docs/roadmap.md, docs/abnahme/.

Schnellstart

Ein Knoten mit Docker oder Podman Compose, Anleitung in docs/betrieb/compose.md:

docker compose -f deploy/compose.single.yaml up -d --build
docker compose -f deploy/compose.single.yaml logs uptime | grep setup_token

Danach http://localhost:8080/setup öffnen und den ersten Administrator anlegen.

Dokumentation

Dokument Inhalt
Konzept Ursprüngliches Konzept v0.3
Pflichtenheft Verbindliche Anforderungen und Abnahmekriterien
Roadmap Phasen, Arbeitspakete und aktueller Stand
ADRs Architekturentscheidungen
Abnahmeberichte Nachweise je Phase
Single-Node mit Compose Einzelknoten-Betrieb und Konfiguration
Cluster erweitern und verkleinern Voter hinzufügen, entfernen und ersetzen
Anmeldung über OIDC Zitadel und andere OIDC-Anbieter
API-Tokens, Audit-Log Tokens, Protokoll und Massenaktionen
Recovery Quorumverlust und Admin-Passwort
SSRF-Schutz Zielprüfung und Ausnahmen
ICMP im Container Ping-Monitore in Containern
Client-Zertifikate (mTLS) HTTP-Monitore für Ziele mit mTLS
Release Ablauf, Prüfung und Fehlerfälle

Entwicklung

Voraussetzungen: Go 1.27, Node.js 24.15+ oder 26, npm.

make help        # alle Ziele
make build       # SPA bauen und ins Binary einbetten → bin/pulsequorum
make test        # Go- und Frontend-Tests
make lint        # go vet, gofmt, golangci-lint, Prettier
make run         # lokaler Single-Voter auf http://localhost:8080
make web-dev     # Angular-Dev-Server auf :4200 (API-Proxy auf :8080)

Container: docker compose -f deploy/compose.single.yaml up --build

Lizenz

AGPL-3.0-only + kommerzielle Lizenz, siehe LICENSING.md. Externe Beiträge werden derzeit noch nicht angenommen, siehe CONTRIBUTING.md.

Directories

Path Synopsis
build
release command
Command release holds the pure helpers used by the release pipeline: SemVer tag selection and next-version computation (version.go), and Conventional Commits changelog rendering (changelog.go).
Command release holds the pure helpers used by the release pipeline: SemVer tag selection and next-version computation (version.go), and Conventional Commits changelog rendering (changelog.go).
cmd
pulsequorum command
Command pulsequorum runs a Pulsequorum node.
Command pulsequorum runs a Pulsequorum node.
internal
admincli
Package admincli implements the "pulsequorum admin" subcommands for recovery tasks (FA-OBS-04, ADR 0019).
Package admincli implements the "pulsequorum admin" subcommands for recovery tasks (FA-OBS-04, ADR 0019).
aggregator
Package aggregator derives the consensus status of the monitors from the heartbeats of all responsible nodes and records status changes and incidents via Raft (FA-CON-01/02/03/05/06, FA-INC-01, ADR 0021).
Package aggregator derives the consensus status of the monitors from the heartbeats of all responsible nodes and records status changes and incidents via Raft (FA-CON-01/02/03/05/06, FA-INC-01, ADR 0021).
alert
Package alert delivers notifications: Shoutrrr and webhook senders, the JSON-safe webhook templates, secret masking and the leader's outbox dispatcher (ADR 0014, FA-ALR-*).
Package alert delivers notifications: Shoutrrr and webhook senders, the JSON-safe webhook templates, secret masking and the leader's outbox dispatcher (ADR 0014, FA-ALR-*).
api
Package api implements the REST API defined in api/openapi.yaml on top of the generated strict server (ADR 0003).
Package api implements the REST API defined in api/openapi.yaml on top of the generated strict server (ADR 0003).
api/gen
Package gen provides primitives to interact with the openapi HTTP API.
Package gen provides primitives to interact with the openapi HTTP API.
api/internal/stubgen command
Command stubgen writes unimplemented.go: one 501 stub per operation of gen.StrictServerInterface, so new OpenAPI operations compile immediately.
Command stubgen writes unimplemented.go: one 501 stub per operation of gen.StrictServerInterface, so new OpenAPI operations compile immediately.
auth
Package auth defines the authenticated principal and the role model (Konzept 12.2, FA-AUTH-09).
Package auth defines the authenticated principal and the role model (Konzept 12.2, FA-AUTH-09).
auth/oidc
Package oidc authenticates requests with JWT access tokens of an external OpenID Connect provider (ADR 0027).
Package oidc authenticates requests with JWT access tokens of an external OpenID Connect provider (ADR 0027).
auth/oidctest
Package oidctest provides a fake OpenID Connect identity provider for tests.
Package oidctest provides a fake OpenID Connect identity provider for tests.
authswitch
Package authswitch holds the leader tasks that run after a cluster moved from AUTH_MODE=local to oidc (ADR 0032, FA-AUTH-08).
Package authswitch holds the leader tasks that run after a cluster moved from AUTH_MODE=local to oidc (ADR 0032, FA-AUTH-08).
backoff
Package backoff provides exponential backoff with jitter and context-aware sleeping.
Package backoff provides exponential backoff with jitter and context-aware sleeping.
checker
Package checker defines the monitor type plugins (Konzept 11.2, FA-CHK-01).
Package checker defines the monitor type plugins (Konzept 11.2, FA-CHK-01).
checker/builtin
Package builtin registers all built-in monitor types with checker.Default.
Package builtin registers all built-in monitor types with checker.Default.
checker/dnscheck
Package dnscheck implements the DNS monitor type (FA-CHK-40/41).
Package dnscheck implements the DNS monitor type (FA-CHK-40/41).
checker/httpcheck
Package httpcheck implements the HTTP(S) monitor type (FA-CHK-10..15).
Package httpcheck implements the HTTP(S) monitor type (FA-CHK-10..15).
checker/icmpcheck
Package icmpcheck implements the ICMP (ping) monitor type (FA-CHK-30/31).
Package icmpcheck implements the ICMP (ping) monitor type (FA-CHK-30/31).
checker/tcpcheck
Package tcpcheck implements the TCP monitor type (FA-CHK-20).
Package tcpcheck implements the TCP monitor type (FA-CHK-20).
cluster
Package cluster contains the Raft consensus layer: the FSM that materializes data class A into state.db and the node that runs Raft (ADR 0005, 0012).
Package cluster contains the Raft consensus layer: the FSM that materializes data class A into state.db and the node that runs Raft (ADR 0005, 0012).
clusterhost
Package clusterhost assembles the cluster side of a voter: join, master key hand-over, the mTLS cluster port with Raft and ClusterService, the CA and the node certificate (ADR 0005, 0006, 0011).
Package clusterhost assembles the cluster side of a voter: join, master key hand-over, the mTLS cluster port with Raft and ClusterService, the CA and the node certificate (ADR 0005, 0006, 0011).
clusternet
Package clusternet serves the cluster port (ADR 0006): one TLS 1.3 listener with mutual authentication against the cluster CA, multiplexed by ALPN into Raft ("uc-raft/1", voters only) and gRPC ("h2", authorized per RPC).
Package clusternet serves the cluster port (ADR 0006): one TLS 1.3 listener with mutual authentication against the cluster CA, multiplexed by ALPN into Raft ("uc-raft/1", voters only) and gRPC ("h2", authorized per RPC).
clusterpki
Package clusterpki runs the cluster CA on top of the replicated state (ADR 0006, FA-PKI-01..04): it creates the CA at bootstrap, issues and redeems join tokens, issues and renews node certificates, keeps the revocation list at hand for TLS handshakes and manages this node's own certificate.
Package clusterpki runs the cluster CA on top of the replicated state (ADR 0006, FA-PKI-01..04): it creates the CA at bootstrap, issues and redeems join tokens, issues and renews node certificates, keeps the revocation list at hand for TLS handshakes and manages this node's own certificate.
config
Package config loads and validates the node configuration from environment variables.
Package config loads and validates the node configuration from environment variables.
configsecret
Package configsecret protects secrets inside monitor configurations (ADR 0015).
Package configsecret protects secrets inside monitor configurations (ADR 0015).
degraded
Package degraded decides whether this voter is in the degraded mode of ADR 0024: it has known no leader for a while, so the cluster cannot decide alerts.
Package degraded decides whether this voter is in the degraded mode of ADR 0024: it has known no leader for a while, so the cluster cannot decide alerts.
diskstat
Package diskstat reports the free space of the file system that holds a path (ADR 0025, DISK_FREE_ALERT).
Package diskstat reports the free space of the file system that holds a path (ADR 0025, DISK_FREE_ALERT).
maintenance
Package maintenance computes when maintenance windows are active (FA-MNT-01).
Package maintenance computes when maintenance windows are active (FA-MNT-01).
membership
Package membership changes the voter set of the cluster (ADR 0005 point 7, ADR 0012 A3–A5, FA-CLU-03/04/08/10): joining nodes enter as nonvoters and are promoted once they caught up, changes are serialized, nodes are only removed by a platform admin and are revoked with it.
Package membership changes the voter set of the cluster (ADR 0005 point 7, ADR 0012 A3–A5, FA-CLU-03/04/08/10): joining nodes enter as nonvoters and are promoted once they caught up, changes are serialized, nodes are only removed by a platform admin and are revoked with it.
metrics
Package metrics exposes the Prometheus metrics of a node (FA-OBS-02, ADR 0025 section 7).
Package metrics exposes the Prometheus metrics of a node (FA-OBS-02, ADR 0025 section 7).
node
Package node manages the persistent identity of a node.
Package node manages the persistent identity of a node.
pki
Package pki implements the cluster's own certificate authority (ADR 0006, FA-PKI-01..04): an ECDSA P-256 CA created at bootstrap, node certificates issued from CSRs, peer verification against the CA bundle and the revocation list, and one-time join tokens that pin the CA fingerprint.
Package pki implements the cluster's own certificate authority (ADR 0006, FA-PKI-01..04): an ECDSA P-256 CA created at bootstrap, node certificates issued from CSRs, peer verification against the CA bundle and the revocation list, and one-time join tokens that pin the CA fingerprint.
probe
Package probe implements the client-side probe runtime (ADR 0034, ADR 0035): joining a cluster, managing the voter candidate list, maintaining the local heartbeat buffer, streaming monitor assignments, and uploading heartbeats with keepalive, tick-timeout failover, and CA bundle verification.
Package probe implements the client-side probe runtime (ADR 0034, ADR 0035): joining a cluster, managing the voter candidate list, maintaining the local heartbeat buffer, streaming monitor assignments, and uploading heartbeats with keepalive, tick-timeout failover, and CA bundle verification.
probegw
Package probegw implements the voter-side ProbeService gRPC gateway (ADR 0034, ADR 0035): probe verification, monitor assignment streaming, keepalive ticks, and validated heartbeat ingestion.
Package probegw implements the voter-side ProbeService gRPC gateway (ADR 0034, ADR 0035): probe verification, monitor assignment streaming, keepalive ticks, and validated heartbeat ingestion.
provision
Package provision creates tenants for Zitadel organizations on their first login (FA-TEN-03, ADR 0029).
Package provision creates tenants for Zitadel organizations on their first login (FA-TEN-03, ADR 0029).
ratelimit
Package ratelimit provides a per-key token-bucket rate limiter.
Package ratelimit provides a per-key token-bucket rate limiter.
replication
Package replication distributes heartbeats between voters outside of Raft (data class B, ADR 0006, ADR 0012 B2/B3/B6).
Package replication distributes heartbeats between voters outside of Raft (data class B, ADR 0006, ADR 0012 B2/B3/B6).
scheduler
Package scheduler runs the checks this node is responsible for (FA-SCH-*).
Package scheduler runs the checks this node is responsible for (FA-SCH-*).
secrets
Package secrets implements envelope encryption for secrets stored in the replicated state (ADR 0011, FA-SEC-SEC): a master key (KEK) wraps data encryption keys (DEKs), and DEKs encrypt individual values with AES-256-GCM.
Package secrets implements envelope encryption for secrets stored in the replicated state (ADR 0011, FA-SEC-SEC): a master key (KEK) wraps data encryption keys (DEKs), and DEKs encrypt individual values with AES-256-GCM.
selfcheck
Package selfcheck probes the reference targets of a node to tell whether the node itself has lost its connectivity (ADR 0022, FA-CON-04).
Package selfcheck probes the reference targets of a node to tell whether the node itself has lost its connectivity (ADR 0022, FA-CON-04).
selfhealth
Package selfhealth decides on the leader which voters are impaired in their connectivity (FA-CON-04, ADR 0022).
Package selfhealth decides on the leader which voters are impaired in their connectivity (FA-CON-04, ADR 0022).
server
Package server provides the HTTP server of a voter: REST API, health endpoints, runtime frontend configuration and the embedded SPA.
Package server provides the HTTP server of a voter: REST API, health endpoints, runtime frontend configuration and the embedded SPA.
store
Package store defines the persistence interfaces and records (ADR 0004).
Package store defines the persistence interfaces and records (ADR 0004).
store/sqlite
Package sqlite implements the store interfaces on SQLite with the CGO-free modernc.org/sqlite driver (ADR 0004, 0013).
Package sqlite implements the store interfaces on SQLite with the CGO-free modernc.org/sqlite driver (ADR 0004, 0013).
store/storetest
Package storetest is the shared test suite for every store implementation (ADR 0004, NFA-PORT-03).
Package storetest is the shared test suite for every store implementation (ADR 0004, NFA-PORT-03).
stream
Package stream fans out live events (heartbeats, status changes, incidents) to the WebSocket clients of this node (FA-API-04).
Package stream fans out live events (heartbeats, status changes, incidents) to the WebSocket clients of this node (FA-API-04).
sysalert
Package sysalert evaluates the system alerts of the cluster (FA-OBS-01, FA-REP-05, FA-REP-06, FA-PKI-06, ADR 0025).
Package sysalert evaluates the system alerts of the cluster (FA-OBS-01, FA-REP-05, FA-REP-06, FA-PKI-06, ADR 0025).
tenant
Package tenant holds the rules for tenants, plans and their limits (ADR 0029).
Package tenant holds the rules for tenants, plans and their limits (ADR 0029).
tenantpurge
Package tenantpurge deletes the metrics of deleted tenants on every node and keeps heartbeats of deleted tenants out of metrics.db (ADR 0029).
Package tenantpurge deletes the metrics of deleted tenants on every node and keeps heartbeats of deleted tenants out of metrics.db (ADR 0029).
uptime
Package uptime computes uptime and latency from heartbeats and the consensus status history, maintains the hourly and daily rollups, compacts old raw data and enforces retention (FA-UPT-01..06).
Package uptime computes uptime and latency from heartbeats and the consensus status history, maintains the hourly and daily rollups, compacts old raw data and enforces retention (FA-UPT-01..06).
version
Package version exposes build metadata injected via -ldflags.
Package version exposes build metadata injected via -ldflags.
webui
Package webui serves the embedded Angular single-page application.
Package webui serves the embedded Angular single-page application.
test
acceptance/as01 command
Command as01 automates acceptance scenario AS-01 (docs/pflichtenheft.md, section 13.2) against a running single-node Pulsequorum.
Command as01 automates acceptance scenario AS-01 (docs/pflichtenheft.md, section 13.2) against a running single-node Pulsequorum.
acceptance/as06 command
Command as06 automates acceptance scenario AS-06 (docs/pflichtenheft.md, section 13.2) against a running Pulsequorum node that has two tenants signed in through OIDC.
Command as06 automates acceptance scenario AS-06 (docs/pflichtenheft.md, section 13.2) against a running Pulsequorum node that has two tenants signed in through OIDC.
chaos/cmd/chaos command
Command chaos runs container-based cluster scenarios (AP-2.9): it starts Pulsequorum voters with podman or docker, adds and removes nodes, injects network faults and checks the behaviour against the Pflichtenheft.
Command chaos runs container-based cluster scenarios (AP-2.9): it starts Pulsequorum voters with podman or docker, adds and removes nodes, injects network faults and checks the behaviour against the Pflichtenheft.
chaos/harness
Package harness runs Pulsequorum voters as containers and injects faults into them: kill, stop, isolate, latency.
Package harness runs Pulsequorum voters as containers and injects faults into them: kill, stop, isolate, latency.
internal/fake
Package fake provides in-process stand-ins for external services that the acceptance and chaos drivers need: an ntfy server that records messages and an HTTP monitor target that can be switched between healthy and failing.
Package fake provides in-process stand-ins for external services that the acceptance and chaos drivers need: an ntfy server that records messages and an HTTP monitor target that can be switched between healthy and failing.
internal/ucapi
Package ucapi is a minimal client for the Pulsequorum REST API (api/openapi.yaml).
Package ucapi is a minimal client for the Pulsequorum REST API (api/openapi.yaml).
load/gendata command
Command gendata fills the data directory of a stopped voter with synthetic history for the monitors that already exist in its state.db.
Command gendata fills the data directory of a stopped voter with synthetic history for the monitors that already exist in its state.db.
load/loadtest command
Command loadtest drives load and measurement scenarios against a running Pulsequorum voter (NFA-PERF-01 to NFA-PERF-04).
Command loadtest drives load and measurement scenarios against a running Pulsequorum voter (NFA-PERF-01 to NFA-PERF-04).
ssrfenv/cmd/ssrfenv command
Command ssrfenv provides the network services of the local SSRF test environment (AS-07, ADR 0030, deploy/ssrf-dev/README.md):
Command ssrfenv provides the network services of the local SSRF test environment (AS-07, ADR 0030, deploy/ssrf-dev/README.md):

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL