63 lines
2.8 KiB
Markdown
63 lines
2.8 KiB
Markdown
# skyg-linux-tracker
|
|
|
|
A small, **read-only** monitor for a Linux host. One binary, `slinuxm`, tells you what systemd, the journal and Docker are doing, through:
|
|
|
|
- a **REST API** (JSON, with Server-Sent Events for live logs),
|
|
- an **MCP server** so AI agents can inspect the host,
|
|
- optional **OpenTelemetry** export of metrics and logs.
|
|
|
|
It reads everything live, keeps no data of its own beyond a database of hashed API tokens, and cannot start, stop or change anything on the host.
|
|
|
|
## Try it in a minute
|
|
|
|
No root, no install. The token database goes in a temp directory.
|
|
|
|
```sh
|
|
cargo build --release # needs Rust, pkg-config, lld, libsystemd headers (or: devenv shell)
|
|
export SKYG_AUTH__DB_PATH=/tmp/slinuxm-demo/db.sqlite
|
|
BIN=target/release/slinuxm
|
|
|
|
TOKEN=$($BIN token create demo) # printed once, stored only as a hash
|
|
$BIN serve & # http://127.0.0.1:1984, loopback only
|
|
|
|
curl -s http://127.0.0.1:1984/healthz
|
|
curl -s -H "Authorization: Bearer $TOKEN" 'http://127.0.0.1:1984/api/v1/systemd/units?state=failed'
|
|
curl -s -H "Authorization: Bearer $TOKEN" 'http://127.0.0.1:1984/api/v1/journal?priority=err&lines=20'
|
|
kill %1
|
|
```
|
|
|
|
Or with Nix: `nix run git+ssh://gitea@gitea.app.internal/Hermenix/skyg-linux-tracker -- --help`.
|
|
|
|
## Documentation
|
|
|
|
Read in this order:
|
|
|
|
| Guide | What it covers |
|
|
| --- | --- |
|
|
| [How it works](docs/how-it-works.md) | What the binary does when it runs, what it reads, auth, signals, every command |
|
|
| [Install](docs/install.md) | **Nix and NixOS module**, or from source with an example systemd unit |
|
|
| [Configuration](docs/configuration.md) | Config file, environment variables, CLI flags, every section |
|
|
| [Operations](docs/operations.md) | Tokens, MCP clients, network exposure, Docker access, OpenTelemetry, troubleshooting |
|
|
|
|
Reference:
|
|
|
|
| Doc | What it covers |
|
|
| --- | --- |
|
|
| [API reference](docs/api.md) | Every REST route and MCP tool; also served by the binary at `/docs` |
|
|
| [TLS](docs/tls.md) | HTTPS, certificate rotation, ACME |
|
|
| [Consolidator](docs/consolidator.md) | One instance watching others (peers) |
|
|
| [`config.example.toml`](config.example.toml) | Every config key with its default |
|
|
| [Development](docs/development.md) | Building, tests, git hooks, version stamp |
|
|
| [ARCHITECTURE.md](ARCHITECTURE.md) | Internals and design decisions |
|
|
|
|
## At a glance
|
|
|
|
| | |
|
|
| --- | --- |
|
|
| Binary | `slinuxm` (Linux, links libsystemd; no openssl) |
|
|
| Listens on | `127.0.0.1:1984` by default |
|
|
| Config | `/etc/skyg-linux-tracker.toml`, `SKYG_*` env vars, CLI flags |
|
|
| State | `/var/lib/skyg-linux-tracker/db.sqlite` (hashed tokens only) |
|
|
| Auth | Bearer tokens, `slinuxm token create <name>` as the service user |
|
|
| Sources | systemd over D-Bus, the journal via libsystemd, Docker over its unix socket |
|