Skip to content

ZFS integration and Telegram interactivity - #6

Merged
inode64 merged 4 commits into
inode64:mainfrom
teo2peer:main
Jul 29, 2026
Merged

inode64 merged 4 commits into
inode64:mainfrom
teo2peer:main

Conversation

@teo2peer

Copy link
Copy Markdown
Contributor

Added a module to check zfs status

Added more functionality to telegram like asking for stats

teo2peer and others added 2 commits July 27, 2026 16:23
Extend the existing Telegram notifier with three optional, backward-compatible
sendMessage fields: parse_mode (MarkdownV2/Markdown/HTML) for formatted text,
silent (disable_notification) for quiet delivery, and message_thread_id to post
into a forum topic. Omitting them reproduces the prior plain-text behaviour, so
existing notifiers are unaffected.

Also add examples/notifiers/ops-telegram.yml, the example fragment the other
transports had but Telegram lacked.

Co-Authored-By: Teo2Peer <teo2din@gmail.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add an optional Telegram bot that answers operator commands with live Sermo
reports. It receives commands over Bot API long polling (getUpdates) -- no
inbound socket, no public exposure -- and only ever reads state: it can never
change the host.

- New self-contained internal/telegrambot package: a getUpdates/sendMessage
  client (token scrubbed from errors), a long-poll loop with SIGHUP-aware
  UpdateConfig, a read-only command router (/status, /services, /watches, /sla,
  /events, /help) and report formatters. It depends only on pure helpers so it
  builds and tests off the daemon's platform-specific dependencies.
- internal/app adapter (telegramreport.go) maps the reload-safe web backend and
  the state store into the bot's Reporter, so reports match the dashboard.
- New top-level telegram_bot config section (token, allowed_chats allow-list,
  poll_interval, enabled) with validation; wired into sermod startup/shutdown
  and the reload path alongside DiagnosticLog.
- Also carries the telegram notifier's new-key validation and the EN/ES docs
  (configuration.md, sermo-all.yml, README) for both features.

Co-Authored-By: Teo2Peer <teo2din@gmail.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
teo2peer and others added 2 commits July 29, 2026 13:29
… tags

sermoctl/sermod failed to compile off Linux: internal/checks imported
github.com/google/nftables unconditionally (pulling nftables/xt, which uses
Linux-only unix.NFPROTO_* constants) and referenced netlink.FAMILY_V4/V6
(defined only in netlink's *_linux.go files). CI runs on Linux so it stayed
green, but local darwin builds broke.

Split both along the existing _linux.go/_other.go convention used across the
tree (notify, execx, utmp, cli, conn):
- firewall_nftables.go gains //go:build linux; a new firewall_nftables_other.go
  stub keeps nftablesRuleCounter available (honoring context cancellation) and
  reports nftables counting is Linux-only.
- route.go now uses local familyV4/familyV6 constants, defined per platform in
  route_family_linux.go (from netlink) and route_family_other.go (numeric).

No behavior change on Linux.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The token is normally sourced from ${env:...}, which is expanded before
validation, so an unset TELEGRAM_BOT_TOKEN / TELEGRAM_TOKEN resolved to "" and
config validation aborted with "token is required". That was inconsistent with
runtime: telegrambot.Config.active() already treats an empty token as inactive,
and notify.Build() skips a tokenless telegram notifier with a warning.

Align validation with runtime: an empty token now leaves the bot (and the
telegram notifier) inactive instead of failing config load, so a host without
the secret still starts. When a token is present the other requirements
(allowed_chats / chat_id, formatting options) are still enforced. The notifier
name stays defined, so `notify` references to it keep resolving.

Docs (EN/ES) updated to note the token is optional.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@inode64
inode64 merged commit 781944d into inode64:main Jul 29, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants