Skip to content

v2.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Nov 23:39
· 4 commits to main since this release

[2.0.0] — 2026-11-27

Headless mode is the headline: the engine that has always shipped inside the desktop app
now also runs as a standalone daemon for servers and containers, with its own HTTP
surface, man page and completions, container image, .deb/.rpm packages and
deployment tooling. Existing installs keep their settings, history and backups, so the
major number marks a new distribution channel rather than a break in the desktop app.

Added

  • docs/headless-migration.md is the switch-over guide from the desktop app: what carries over unchanged (the app's own export, its alert thresholds, the TargetStats JSON), what has to be replaced (live table, tray notifications, 30-day history), a parity check with --once, exposing the HTTP surface behind a TLS proxy, the overlap-and-rollback procedure, and the surprises (netstudio_target_up absent before the first sample, -1 sentinels, counter and event-cursor resets on restart, CAP_NET_RAW for hardened units).
  • deploy/grafana/netstudio-headless.json imports as a complete dashboard: readiness, offline/degraded/stale counts, per-target state history, RTT (avg/max), jitter, loss, time since the last success, request rate, reload outcomes, TLS expiry and failures by kind, with the Prometheus data source picked through a datasource variable. deploy/grafana/README.md covers importing and ConfigMap provisioning, and tool/headless-grafana-check.py (run in CI next to the man page check) rejects a panel that queries a metric the daemon does not emit or legends a label the series does not carry.
  • Headless docs are now checked, not just written: tool/headless-docs-check.py compares the flags in cli.rs with docs/netstudio-headless.1 and both completions, rejects duplicated option blocks and a stale .TH version, and CI renders the man page with groff and syntax-checks the completions. The man page gained the missing --listen entry, an HTTP-endpoints section, and lost a duplicated --windows-service block.
  • CI builds native_engine/Dockerfile on every push and boots the image: preflight against the example config, /healthz, /readyz, /metrics, /api/v1/events, the pid-file-less status file, and the image's own --health-check, so a broken image fails the run instead of the deployment.
  • The headless documentation overstated what was missing: SIGHUP reload and bearer-token authentication shipped earlier, so "What is not included" now names only TLS termination and user accounts — which is exactly what the migration guide tells you to put in a reverse proxy.
  • Headless GET /api/v1/events?since=<seq> serves the alert feed: one event per down/up transition (with outage_ms on recovery), a monotonic cursor the client passes back, and dropped when the 256-event ring buffer evicted transitions before that cursor. Muted targets stay out, the feed sits behind the bearer token, and every transition is also logged.
  • deploy/alerting/netstudio-alert-bridge.py forwards that feed to Slack, Mattermost, ntfy or any HTTPS webhook with retries and a restart-safe cursor, so the daemon itself still needs no TLS client or certificate store.
  • Headless / CLI mode: a standalone netstudio-headless binary built from the same Rust engine, for servers and containers. It reads the app's JSON export (full envelope or bare target array), supports --check, --once, --interval, --probe-concurrency, --output (atomic snapshot file), --pid-file, --quiet, --format, --color and --log-level, streams color-coded tables on a terminal (NDJSON when piped), and optionally serves /healthz, /readyz, /metrics (Prometheus) and /api/v1/status. Snapshots report sanitized last_error/last_error_kind, TCP fallback, and staleness. Handles SIGINT/SIGTERM gracefully and returns 0/3 from --once depending on target health. No new crates; documented in docs/headless.md.
  • Headless --check now pre-flights the whole deployment, not just the JSON: it verifies the --output and --pid-file directories are writable, refuses a pid file held by a live process, and binds --listen once. Failures exit 2 with a per-channel report (--format json emits "type": "check"), so a CI job or ExecStartPre catches a bad mount or a busy port before the service restart-loops.
  • Headless documentation helpers: docs/netstudio-headless.1 man page and bash/zsh completions in docs/completions/.
  • Standalone headless packaging: a multi-stage native_engine/Dockerfile (unprivileged user, ICMP via --cap-add NET_RAW) and per-platform netstudio-headless-<os>-<arch> release archives that contain only the daemon and an example config.
  • Headless HTTP can require a bearer token (--http-token-file or NETSTUDIO_HTTP_TOKEN): every endpoint except /healthz returns 401 without it, the comparison is constant-time, and --check validates the token file. TLS still belongs in a reverse proxy.
  • --check now follows the same output rule as --once and the daemon: text on a terminal, JSON when stdout is piped (override with --format), so a CI job can pipe the report straight into jq.
  • Headless daemon reloads its config on SIGHUP (Unix): added, removed and edited targets are applied in place, unchanged targets keep their counters, alert thresholds take effect immediately, and a malformed file is logged without stopping the daemon. The same signal re-reads --http-token-file, so the bearer token can be rotated without a restart; an unreadable or empty file keeps the previous secret and only logs a warning.
  • Headless --windows-service runs under the Windows Service Control Manager: it reports SERVICE_RUNNING only once serving, stops gracefully on SERVICE_CONTROL_STOP, and ships tool/install-headless-service.ps1 to register, restart on failure and remove the service.
  • Headless releases now ship .deb and .rpm packages with a hardened systemd unit (deploy/linux/, tool/headless-sbom.py), built in debian:bullseye so one binary covers Debian 11-13, Ubuntu 20.04+ and RHEL 9+.
  • Headless --health-check <URL> sends one HTTP GET and exits 0 only on 200, so a container image without curl can still declare a HEALTHCHECK (the image now does, against /readyz); deploy/kubernetes/ adds a ConfigMap, Deployment and Service with strict readiness.
  • Headless --log-file <PATH> mirrors every log line into a file (rotated to PATH.1 at 8 MiB, never truncated on restart), so a service or container without a console can keep its diagnostics.
  • Headless config validation is stricter: an unknown protocol value skips the target instead of silently probing ICMP, keys the loader does not read are reported (unknown key "porrt" is ignored), and two targets on the same protocol host:port are flagged as duplicates.
  • docs/netstudio-headless.schema.json describes the target file (types, ranges, defaults); a test keeps it in step with the keys the loader reads.
  • Headless --watch-config <SECS> polls the config file and reloads it on change, which gives Windows (no SIGHUP) and containers the same hot reload; a broken file is attempted once per edit instead of once per poll.
  • Headless --probe-interval overrides every target's interval_ms from the command line (1–3600 s), so one flag retunes a mixed config without editing it; --interval remains the snapshot cadence.
  • Snapshots and /metrics gained "last successful probe" data: last_success_epoch_ms per target and netstudio_target_last_success_timestamp_seconds (a failure moves the check timestamp, never this one).
  • /readyz answers 503 with Retry-After: 1 while targets still have no sample, so probes back off instead of hammering a starting daemon.
  • /metrics now also describes the daemon: netstudio_uptime_seconds, netstudio_ready, netstudio_targets_configured, netstudio_stale_targets, netstudio_last_snapshot_duration_seconds, netstudio_config_reloads_total{result} and netstudio_http_requests_total{path,status}, so a wedged prober or a failing reload is alertable instead of looking like a healthy scrape.
  • Headless --log-format json writes one JSON object per stderr line (time, level, msg, escaped, no ANSI) for log collectors, while the default text format is unchanged.
  • Headless config honours group and "is_muted"; both flow into the text table, snapshot JSON, and Prometheus (new netstudio_target_muted, group label on every target metric). Muted targets are still probed but no longer make --once exit 3. summary gained muted.
  • The desktop app's JSON backup now includes settings.offline_after/recover_after when the shell has configured them, so an exported file reproduces the app's alert thresholds under the daemon.

Fixed

  • The headless container image actually contains the daemon. COPY keeps the checkout's mtimes, which are older than the dependency-cache layer's stub build, and cargo fingerprints by mtime: the second build printed Finished and the image shipped the stub fn main() {} — it started, printed nothing and exited 0, so the container never listened. The build stage now refreshes the copied sources' timestamps, drops the crate's release artifacts and fails unless the binary answers --version, and CI asserts the output of --version and --check instead of only their exit codes.
  • Headless: the last-check timestamp is now written when a probe sample completes instead of on every snapshot, so a stalled prober no longer looks fresh;
  • Headless: --output and --pid-file paths are validated before the probe loop starts; a daemon with an unusable output path used to log the same error every interval forever and now exits 2. A write failure that appears later is logged once (with a recovery line when writes succeed again) instead of on every tick.
  • Headless: the first probe fires immediately at startup. /readyz is now strict — it stays 503 until every target has a real sample — and netstudio_target_up is absent until that target has one, so a scrape can no longer be mistaken for "all targets up" or "ready".
  • Headless: --listen/--pid-file combined with --once are rejected (exit 2) instead of being silently ignored; --check --format json prints JSON instead of text; the pid file is claimed with an exclusive create and a stale file from a killed process is taken over (a live one aborts startup), with cleanup on graceful stop.
  • Headless text tables now measure display width, so CJK, Hangul, and emoji target names keep their columns aligned instead of shifting them by one cell per wide glyph. /metrics gained netstudio_target_stale, netstudio_target_last_sample_age_seconds, netstudio_target_tcp_fallback and netstudio_target_error_info. The HTTP server now uses a fixed worker pool with request timeouts and bounded queues (no thread per connection), returning 400/413/408 for bad input.
  • The 2.0.0 release run failed at "Install packaging tools": Debian 11's suite indexes still came from deb.debian.org, but the package files had moved to archive.debian.org, so apt resolved the current versions and 404ed every download. The packaging job now points apt at the archive (and ignores Valid-Until), still building on bullseye so the .deb/.rpm keep their glibc 2.31 floor. The job also installs procps and man-db, which the minimal image lacks and systemd-analyze verify needs to check ExecReload=/bin/kill and the Documentation=man: reference.
  • The Add Server dialog now exposes the per-target timeout next to the interval field, with 100–10000 ms validation matching NativeBindings.clampTimeout; the dialog title also ellipsizes instead of overflowing on narrow or localized layouts (#2).