| 1 |
# Peace of Mind |
| 2 |
|
| 3 |
A production operations monitor -- health checks, TLS certificate tracking, remote test orchestration, peer mesh, and email alerts. Built with Rust, Tokio, Axum, and SQLite. |
| 4 |
|
| 5 |
## Prerequisites |
| 6 |
|
| 7 |
- **Rust** (stable toolchain, 2024 edition) |
| 8 |
- **Config file** at `~/.config/pom/pom.toml` (targets, peers, alert settings) |
| 9 |
|
| 10 |
## Usage |
| 11 |
|
| 12 |
PoM operates in three modes: CLI, HTTP daemon, and MCP server. |
| 13 |
|
| 14 |
```sh |
| 15 |
# Run all configured health checks once |
| 16 |
pom check |
| 17 |
|
| 18 |
# Start the HTTP API daemon (periodic checks, peer heartbeats, pruning) |
| 19 |
pom serve |
| 20 |
|
| 21 |
# Start as an MCP server (stdio transport, for Claude integration) |
| 22 |
pom mcp |
| 23 |
|
| 24 |
# Show current status of all targets |
| 25 |
pom status |
| 26 |
|
| 27 |
# Run remote test suites via SSH |
| 28 |
pom test |
| 29 |
|
| 30 |
# Show TLS certificate expiry for monitored hosts |
| 31 |
pom tls |
| 32 |
``` |
| 33 |
|
| 34 |
## Configuration |
| 35 |
|
| 36 |
PoM reads `~/.config/pom/pom.toml`. The config defines: |
| 37 |
|
| 38 |
- **Targets** -- HTTP endpoints to monitor, with expected status codes, JSON field checks, body substring matches, and check intervals |
| 39 |
- **Peers** -- other PoM instances in the mesh (URL, bearer token, heartbeat interval, grace period) |
| 40 |
- **Alerts** -- Postmark API credentials, recipient addresses, per-target cooldowns (falls back to stdout in dev mode) |
| 41 |
- **TLS** -- hosts to probe for certificate expiry warnings |
| 42 |
- **Tests** -- SSH targets and commands for remote test suite execution |
| 43 |
|
| 44 |
## Module Overview |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
| `main.rs` / `cli.rs` | Binary entry point, CLI argument parsing and dispatch | |
| 49 |
| `config.rs` | TOML config loading and validation | |
| 50 |
| `types.rs` | Shared domain types | |
| 51 |
| `checks/` | HTTP health checks, TLS probes, SSH test runners | |
| 52 |
| `peer.rs` | Peer mesh heartbeats, identity verification, grace periods | |
| 53 |
| `db.rs` | SQLite persistence (incidents, history, trends) | |
| 54 |
| `api.rs` | Axum HTTP API (status, trends, mesh data) | |
| 55 |
| `alerts.rs` | Email alerts via Postmark API | |
| 56 |
| `tools/` | MCP tool definitions for Claude integration | |
| 57 |
| `display.rs` | Terminal output formatting | |
| 58 |
| `error.rs` | Error types | |
| 59 |
|
| 60 |
## License |
| 61 |
|
| 62 |
PolyForm Noncommercial 1.0.0 |
| 63 |
|