Compare commits

..
Author SHA1 Message Date
k.renner 2eb943cbf4 Merge pull request 'fix(review-bot): mint the review token with read:issue' (#1507) from review-bot-token-read-issue into main
Reviewed-on: #1507
2026-10-28 00:27:23 +00:00
claude-botandClaude Opus 5.5 6e5e369f60 fix(review-bot): mint the review token with read:issue
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The sweep lists PRs that request review-bot via /repos/issues/search,
which needs read:issue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 01:26:10 +01:00
security-bot de02886ce6 chore(image-automation): bump gitea.renner.uno/konairius/shelly-manager:build.1793145992
Updates managed by image-automation-controller.
2026-10-28 00:11:57 +00:00
k.renner 9043340922 Merge pull request 'shelly-manager image under konairius; drop in-house package retention' (#1504) from t_1bc87417/konairius-registry into main
Reviewed-on: #1504
2026-10-28 00:11:00 +00:00
hermes-bot 040e10756b gitea: remove the in-house package retention CronJob
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Owner decision on #1455 (2026-10-27): package retention moves to Gitea's
built-in package cleanup rules (docs.gitea.com/usage/packages/storage),
created in the UI; Gitea 1.27.3 has no API for them.

Removed: package-retention.yaml (CronJob, ExternalSecret, ServiceAccount,
ClusterRole/Binding), package-retention.py and its configMapGenerator
entry, the gitea-package-retention-kube-apiserver CiliumNetworkPolicy, and
`gitea` from the openbao ClusterSecretStore allowlist. The retention
ExternalSecret was the only one in namespace gitea using that store;
gitea-ssh-ca uses its own namespaced SecretStore openbao-ssh-ca.

The job had failed nightly since 2026-10-18 with a dead token (hermes-bot
recreated, no longer site admin). Gitea's cleanup_packages cron in
statefulset.yaml stays: it runs the cleanup rules and frees blobs.
2026-10-27 23:18:44 +00:00
hermes-bot ec3b6666aa image-automation: track shelly-manager under konairius
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
ci/woodpecker/pr/ci-scripts-test Pipeline was canceled
ImageRepository shelly-manager scans gitea.renner.uno/konairius/shelly-manager
and renovate's Flux-managed list names the new path. The Deployment line is
left to image automation: its marker is the full-reference form, so the first
konairius build.<ts> rewrites name and tag together. No manual tag.

konairius/shelly-manager already holds build.1791038240 (2026-10-03, older
than the running k.renner build.1792997278), so this must merge only after the
konairius/shelly-manager release pipeline has pushed a newer build there;
otherwise the policy would roll the Deployment back to the October image.

Owner decision on #1455: no packages under k.renner.
2026-10-27 23:16:09 +00:00
security-bot a0f1c3e1e5 chore(image-automation): bump gitea.renner.uno/gitea_admin/review-bot:2026-10-27-2231
Updates managed by image-automation-controller.
2026-10-27 22:42:26 +00:00
k.renner 76fddd90cf Merge pull request 'feat(review-bot): review on request in any repo, read less, log token usage' (#1503) from review-bot-on-request into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1503
2026-10-27 22:31:14 +00:00
claude-botandClaude Opus 5.5 abc89c2476 fix(review-bot): post a review verdict, never a comment
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/review-bot-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The bot posted COMMENT whenever the agent said comment, gave no
verdict, or approved with a red or yellow section. A COMMENT is no
review verdict, so the PR showed no approval or rejection by the bot.

Every review is now APPROVED or REQUEST_CHANGES. Only blocking findings
request changes: the verdict request-changes, a Blocking section, or an
empty change. Suggestions, nits and unverified points stay in the body
of an approval. An answer without a verdict line is not posted; the
review fails instead of guessing. The prompt offers only request-changes
and approve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:26:33 +01:00
claude-botandClaude Opus 5.5 8def607a73 fix(review-bot): findings of the review of #1503
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/review-bot-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
- The sweep leaves queued and running reviews alone. Enqueueing one
  marked it for another run when it ended, so a failing review was
  chained back-to-back and FAILURE_COOLDOWN never applied.
- Mistral's read-only check accepts _compare_, so a re-review that
  calls compare_commits is not rejected as a violation.
- SELECTOR_MIN_CONFIDENCE=NaN is rejected instead of disabling the
  fallback.
- The prompt always lists recent base commits on the changed files, so
  a change already on the base is still caught when mergeable is true.
- The requested-review search pages until an empty page.
- Doc comments describe the request-only, any-repository trigger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:10:33 +01:00
claude-botandClaude Opus 5.5 fcdba4505d fix(review-bot): prompt takes the base branch from the PR
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/review-bot-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:04:09 +01:00
claude-botandClaude Opus 5.5 9ec31f0769 feat(review-bot): review every repository that requests a review
REPOS is gone. The webhook takes a review request from any repository,
and the sweep asks Gitea for every open pull request that requests a
review from the bot (issues/search review_requested=true), so a repo
needs no webhook and no config entry: requesting review-bot is enough.

The sweep runs every 5 minutes, since it is now one search plus two
reads per requested PR. A head whose review failed is left to the next
request or FAILURE_COOLDOWN (1h), so a failing review is not rerun on
every sweep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:03:53 +01:00
claude-botandClaude Opus 5.5 1ea1562d6f feat(review-bot): review on request, read less, log token usage
Reviews start only when review-bot is a requested reviewer: the
pull_request webhook with action review_requested for the bot, or the
sweep finding the bot in requested_reviewers. Gitea drops the request
when the bot posts its review, so each request yields one review. Pushes
and opened PRs alone start nothing.

The prompt reads the diff first, opens whole files only where the hunks
are not enough, reads the base side only when mergeable is false or the
base moved, and aims at 10-20 tool calls. Re-reviews read only the
commits since the last marker via compare_commits, now an enabled tool.

Every review logs and exports input, output and cache tokens
(review_bot_tokens_total, review_bot_tool_calls_total).

The selector falls back to the default model when it picks another one
with less than SELECTOR_MIN_CONFIDENCE (0.6), and asks for the cheapest
capable model. Sonnet is the default, Opus the exception, Haiku is gone
(41-50 tool calls on trivial PRs), Mistral stays as a separate budget.
Anthropic effort defaults to medium.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:03:53 +01:00
k.renner 61be8d4c43 Merge pull request 'chore(ansible): remove the Shelly NTP play' (#1501) from remove-shelly-ntp-play into main
Reviewed-on: #1501
2026-10-27 21:45:26 +00:00
k.renner 0fd4b81967 Merge pull request 'fix(ansible): NTP and dist-upgrade checks fail instead of passing silently' (#1500) from fix-play-checks into main
Reviewed-on: #1500
2026-10-27 21:45:08 +00:00
claude-botandClaude Opus 5.5 2111189ec7 chore(ansible): remove the Shelly NTP play
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
Shelly devices are not Ansible-managed. Drops
plays/configure-shelly-ntp.yml, its only helper files/discover_shelly.py,
and the mention in site.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 22:43:02 +01:00
claude-botandClaude Opus 5.5 78ad56e812 fix(ansible): NTP and dist-upgrade checks fail instead of passing silently
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
install-ntp-ha.yml:
- 'chronyc clients | head -10' could not fail: without pipefail the rc
  is head's, and the result was never used. 'chronyc -n tracking'
  fails when chronyd does not answer.
- The udp/123 check had failed_when: false and only printed
  LISTENING/NOT LISTENING. 'ss -Hlunp sport = :123' now fails unless
  chronyd owns the socket.
- The v4/v6 VIP presence checks had failed_when: false, so an ip
  error (e.g. a wrong interface name) read as 'BACKUP'. They now fail
  on a non-zero rc; an empty result still means BACKUP.

update-dist-upgrade.yml: failed_when already passes 'No new release
found'; ignore_errors: true on top of it turned a failed
do-release-upgrade into 'ignored' and the play went on to reboot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 22:41:59 +01:00
k.renner e17b7a5d49 Merge pull request 'fix(ansible): NTP VIP check queries NTP, not the chronyc command port' (#1499) from fix-ntp-vip-check into main
Reviewed-on: #1499
2026-10-27 21:36:41 +00:00
claude-botandClaude Opus 5.5 f02c1284de fix(ansible): NTP VIP check queries NTP, not the chronyc command port
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
chronyc -h <vip> talks to chronyd's command port, which chrony.conf binds
to loopback only, so it always returned '506 Cannot talk to daemon'. The
'|| echo' turned that into rc 0, so the task reported ok on every run.

chronyd -Q with a server directive on the command line does a one-shot
NTP query: no config file means no pidfile, and client-only mode zeroes
the NTP and command ports, so it runs alongside the live daemon. -t 10
makes it fail rather than hang when the VIP does not answer.

The VIP presence check used 'ip addr show | grep 10.2.40.4', which also
matches 10.2.40.40-49; it now uses 'ip -4 addr show to <vip>' like the
v6 check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 22:10:04 +01:00
k.renner 71900cc055 Merge pull request 'fix(ansible): site.yml from the workstation; NetBird dashboard login' (#1498) from ansible-check-mode into main
Reviewed-on: #1498
2026-10-27 20:09:11 +00:00
claude-botandClaude Opus 5.5 db5a5e2a57 fix(netbird-server): dashboard CSP allows the Authentik host
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The dashboard builds its Content-Security-Policy from AUTH_AUTHORITY, which
for Authentik is a path (https://auth.renner.uno/application/o/netbird/).
A CSP source with a path only matches URLs below it, so the browser blocked
the token endpoint (/application/o/token/): no code exchange, no refresh,
and the dashboard showed "Error: Unauthenticated" until site data was
cleared. Verified in Chromium against the live header; NETBIRD_CSP adds
https://auth.renner.uno, derived from netbird_auth_issuer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:07:46 +01:00
claude-botandClaude Opus 5.5 bf8e972ad3 fix(ansible): site.yml runs from the workstation
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
- crowdsec-edge-bouncer, netbird-client: the controller downloads also run
  in check mode; they only write on the controller and the next step needs
  the archive
- uptime-kuma: reads and writes OpenBao through its HTTP API (uri) instead
  of community.hashi_vault, so the controller needs no hvac library. The
  token comes from VAULT_TOKEN or ~/.vault-token, as with the bao CLI; the
  owner OIDC role gets policy uptime-kuma-vps.
- deploy-uptime-kuma pipeline removed: its deploy step was gone, only the
  renewal cron for the CI token remained.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:54:41 +01:00
claude-botandClaude Opus 5.5 4dd74ef38b fix(ansible): site.yml --check reads real state
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
Check mode skips command and uri tasks, so every assert or condition on a
read-only result failed or saw nothing (ssh-ca: "dict has no attribute
content" on the CA key). The tasks that only read state run in check mode
too (check_mode: false): the CA key fetch, sshd unit lookup, key
fingerprints, sshd listeners, netbird status, grep/pgrep/ip/chronyc/
timedatectl checks. The sshd -T assert is skipped in check mode, as sshd
reads the files check mode has not written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:38:03 +01:00
k.renner 970226d3be Merge pull request 'fix(ansible): drop node-exporter from the state' (#1497) from drop-node-exporter into main
Reviewed-on: #1497
2026-10-27 19:36:23 +00:00
claude-botandClaude Opus 5.5 5fdfbb6772 fix(ansible): drop node-exporter from the state
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
It was never installed on any managed host (/opt/node-exporter absent on
all four, site.yml --check) and Prometheus scrapes no :9100 target outside
the cluster. The role also downloaded from github.com on the host, which
proxy-1 (IPv6-only) cannot reach. Play and role removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:35:37 +01:00
k.renner 2ac5e705fd Merge pull request 'feat(ansible): one site.yml for the whole state' (#1496) from ansible-site into main
Reviewed-on: #1496
2026-10-27 19:32:56 +00:00
claude-botandClaude Opus 5.5 9e1dfc99bd feat(ansible): one site.yml for the whole state
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ansible-playbook site.yml, from ansible/, applies every state play in
dependency order; the inventory and vault password come from ansible.cfg,
now as paths relative to it. One-off actions (update-os,
update-dist-upgrade, rotate-netbird-secrets, configure-shelly-ntp) stay
separate.

- gathering=smart: facts once per host and run, not per play
- ControlPersist=30m so a run costs one YubiKey PIN per host;
  plays/close-connections.yml ends site.yml and the action playbooks and
  closes the connections
- qemu-guest-agent only on VMs (edge-1 is bare metal)
- removed: edge-mqtt-bridge.yml (install-edge-host.yml carries the role,
  sml2mqtt is gone from edge-1) and the decommissioned claude-ws (inventory,
  group_vars, role, play)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:29:33 +01:00
k.renner c2b0d9b6d9 Merge pull request 'perf(ssh-ca): find the sshd unit without service_facts' (#1495) from ssh-ca-no-service-facts into main
Reviewed-on: #1495
2026-10-27 19:16:37 +00:00
claude-botandClaude Opus 5.5 7ccdd8f405 perf(ssh-ca): find the sshd unit without service_facts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
service_facts took 3.5-11.7 s per host (profile over the four [ssh_ca]
hosts: 32 s of a 62 s run). The role only needs the running sshd unit,
which systemctl list-units answers in milliseconds; on Ubuntu the
sshd.service alias resolves to ssh.service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:15:40 +01:00
k.renner 36c958fb14 Merge pull request 'perf(ansible): enable pipelining' (#1494) from ansible-pipelining into main
Reviewed-on: #1494
2026-10-27 19:11:27 +00:00
claude-botandClaude Opus 5.5 0878054873 perf(ansible): enable pipelining
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
Without it every task is a temp dir, an sftp upload, a chmod, the run and
a cleanup, each a separate SSH round trip. Measured over the mesh against
netbird.renner.uno with a warm ControlMaster: 1.85 s per command task
without pipelining, 0.85 s with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:10:40 +01:00
k.renner e502990db8 Merge pull request 'feat(ssh-ca): claude-bot rights for diagnosis and restarts' (#1493) from claude-bot-docker-logs into main
Reviewed-on: #1493
2026-10-27 19:02:32 +00:00
claude-botandClaude Opus 5.5 8832d9f23f fix(ssh-ca): no password logins
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
edge-1 and netbird accepted password authentication (OpenSSH default; no
config line sets it), the proxies did not. The ssh-ca drop-in turns off
password and keyboard-interactive authentication and the role asserts it
in sshd -T. The edge-host ISO renders the same drop-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:01:20 +01:00
claude-botandClaude Opus 5.5 e72c31f3e9 feat(ssh-ca): claude-bot rights for diagnosis and restarts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
Replaces the docker-logs flag with one fixed set for every [ssh_ca] host:
- systemd-journal group instead of sudo journalctl/systemctl status, which
  also allowed journalctl --vacuum-*/--rotate
- sudo: ss -tulpn, sshd -T, nft list ruleset (fixed args: nft joins argv
  into one command line), netbird status [*], docker ps/logs/stats and
  docker restart (no docker start: -a/-i attach to stdin)
- per-host restartable units: proxies netbird, netbird-proxy-flood-watchdog,
  crowdsec-firewall-bouncer; netbird netbird; edge-1 mosquitto,
  edge-mqtt-cred, edge-alloy, keepalived, chronyd

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:57:00 +01:00
claude-botandClaude Opus 5.5 50b66682d3 feat(ssh-ca): claude-bot may read container logs on netbird
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
The NetBird services on netbird.renner.uno log only to docker, which
claude-bot cannot reach. New role flag ssh_ca_claude_docker_logs adds
sudo for docker ps and docker logs; enabled for netbird.renner.uno.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:50:21 +01:00
k.renner 1848079297 Merge pull request 'feat(ansible): netbird sshd listens on the NetBird interface only' (#1492) from ssh-mesh-only-netbird into main
Reviewed-on: #1492
2026-10-27 18:29:26 +00:00
claude-botandClaude Opus 5.5 48f1574d29 feat(ansible): netbird sshd listens on the NetBird interface only
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
proxy-1 and proxy-2 were verified: only *%wt0:22 listens and the public
addresses refuse port 22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:26:30 +01:00
k.renner df6276101f Merge pull request 'fix(ansible): one SSH login per host for the SSH plays' (#1491) from ansible-fewer-logins into main
Reviewed-on: #1491
2026-10-27 18:25:31 +00:00
claude-botandClaude Opus 5.5 df0150d24a fix(ansible): one SSH login per host for the SSH plays
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
From a workstation every new SSH login costs a YubiKey PIN and touch.
ssh-mesh-only reconnected on every run; the reconnect now sits in an
include that runs only when sshd is switched, since meta reset_connection
ignores when:. configure-ssh-ca is one play: with serial: 1, the second
play reached each host after its 60 s ControlPersist had expired, so it
logged in again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:24:07 +01:00
k.renner 880bf00baa Merge pull request 'feat(ansible): proxy-1 sshd listens on the NetBird interface only' (#1490) from ssh-mesh-only-proxy-1 into main
Reviewed-on: #1490
2026-10-27 18:17:57 +00:00
claude-botandClaude Opus 5.5 6fbfb0ed03 feat(ansible): proxy-1 sshd listens on the NetBird interface only
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
proxy-2 was verified: only *%wt0:22 listens, the public IPv4 and IPv6
addresses refuse port 22, and mesh SSH works after a full reboot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:14:10 +01:00
k.renner 88c80ae21a Merge pull request 'feat(ansible): sshd listens on the NetBird interface only' (#1489) from ssh-mesh-only into main
Reviewed-on: #1489
2026-10-27 18:09:07 +00:00
claude-botandClaude Opus 5.5 12d11f8c50 feat(ansible): sshd listens on the NetBird interface only
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
New role ssh-mesh-only and play configure-ssh-mesh-only.yml. sshd moves to a
systemd socket with BindToDevice=wt0: on Arch a new sshd.socket (Accept=yes,
packaged sshd@.service), on Ubuntu a drop-in for ssh.socket that masks the
sshd-socket-generator output, plus BindsTo= so ssh.service stops with it.
NetBird recreates wt0 on every engine restart; BindToDevice stops the socket
with the old interface and a udev SYSTEMD_WANTS rule starts it with the new
one. The socket is not in sockets.target, which would hold boot until wt0.

The switchover runs in a transient unit and arms a revert timer first; the
play cancels it only after logging in again through the new listener and
seeing no listener outside wt0. [ssh_mesh_only] starts with proxy-2.

ssh-ca reloads sshd only when one sshd unit is running, as there is none
with per-connection or stopped socket-activated sshd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:01:51 +01:00
k.renner 355b046abf Merge pull request 'feat(ansible): mesh inventory for the internet hosts, remove the Woodpecker CI SSH key' (#1488) from inventory-mesh-hosts into main
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
Reviewed-on: #1488
2026-10-27 17:53:31 +00:00
claude-botandClaude Opus 5.5 b4933d65e5 feat(edge-host-iso): trust the SSH user CA
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The build fetches the CA public key from the ssh-ca role URL and renders the
role drop-in, revocation list and root principal into the live system;
edge-install copies them to the installed system and checks sshd -T uses
the CA. Owner certificates log in as root from the first boot, with the
break-glass key as fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:29:57 +01:00
claude-botandClaude Opus 5.5 3187be1f62 chore: remove stale SSH keys
ci/woodpecker/pr/ci-scripts-test Pipeline failed
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The edge-host ISO carried krenner@fortress, ansible-runner@ci-new and
krenner@krenner-XPS-13-9310; it now carries only the break-glass key.
The netbird-server revoke task for netbird-backup@homelab-cluster goes:
the exclusive managed authorized_keys already excludes it. OpenTofu drops
the unused ssh_public_key/ssh_private_key variables and the Proxmox
provider ssh block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:20:48 +01:00
claude-botandClaude Opus 5.5 0c1fb0a229 feat: remove the Woodpecker CI SSH key
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
The woodpecker-ci@homelab key is dropped from the managed authorized_keys
and from the edge-host ISO. The Ansible pipelines that used it are deleted;
plays run from a workstation. deploy-uptime-kuma keeps only the OpenBao
token renewal cron, and deploy-infrastructure no longer installs the key
(no root-module resource uses the Proxmox provider SSH).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:18:15 +01:00
claude-botandClaude Opus 5.5 373b682902 feat(ansible): reach the internet hosts over the NetBird mesh
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
proxy-1, proxy-2 and netbird are addressed by their mesh names, so Ansible
for them runs from a mesh-connected workstation. CI cannot reach the mesh;
the pipelines targeting these hosts lose their push triggers and run only
on manual deployment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:45:46 +01:00
k.renner aad723252a Merge pull request 'fix(ansible): netbird-client downloads the release on the controller' (#1487) from netbird-client-controller-download into main
ci/woodpecker/push/deploy-netbird-client Pipeline failed
Reviewed-on: #1487
2026-10-27 15:35:13 +00:00
claude-botandClaude Opus 5.5 875fbfc730 fix(ansible): netbird-client downloads the release on the controller
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
The first workstation run failed on proxy-1 with 'Network is
unreachable' fetching the release: proxy-1 is IPv6-only and github.com
has no IPv6 address. The tarball is now downloaded and checksum-verified
on the controller (~/.cache/ansible/netbird) and unarchive copies it to
the host, so the hosts need no route to GitHub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:34:37 +01:00
k.renner f56fc42c73 Merge pull request 'fix(ansible): install-netbird-client runs one host at a time' (#1486) from netbird-client-serial into main
ci/woodpecker/push/deploy-netbird-client Pipeline failed
Reviewed-on: #1486
2026-10-27 15:33:11 +00:00
claude-botandClaude Opus 5.5 c4ee6f1662 fix(ansible): install-netbird-client runs one host at a time
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
From the workstation each new SSH session asks for the YubiKey PIN and
a touch; with the default forks both proxies prompted at once. serial: 1
like the other plays that touch the proxies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:30:50 +01:00
k.renner d0413edc27 Merge pull request 'fix(ansible): drop private_key_file from ansible.cfg' (#1485) from ansible-cfg-no-key-file into main
ci/woodpecker/push/deploy-netbird-client Pipeline failed
Reviewed-on: #1485
2026-10-27 15:28:53 +00:00
claude-botandClaude Opus 5.5 30d0299073 fix(ansible): install-netbird-client gathers facts only on selected hosts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
The play gathered facts on every inventory host before skipping those
without netbird_setup_key, so a workstation run opened an SSH session
(YubiKey PIN + touch) to edge-1 and netbird too, and timed out on the
decommissioned claude-ws. Facts are gathered after the skip now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:27:57 +01:00
claude-botandClaude Opus 5.5 c3566b8fc3 fix(ansible): drop private_key_file from ansible.cfg
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ansible.cfg forced ~/.ssh/id_ed25519, which does not exist on the
owner's workstation: runs from there failed with 'no such identity'
and bypassed the ssh config that picks the plugged-in YubiKey's key
and certificate. CI never read this file ('world writable directory,
ignoring it as an ansible.cfg source'); its pipelines write the CI key
to ~/.ssh/id_ed25519, ssh's default identity, so they are unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:27:25 +01:00
k.renner 271aefc5d2 Merge pull request 'feat(ansible): netbird-client installs on Arch (proxy hosts)' (#1484) from netbird-client-arch into main
ci/woodpecker/push/deploy-netbird-client Pipeline failed
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/push/deploy-ssh-ca Pipeline was successful
Reviewed-on: #1484
2026-10-27 15:18:13 +00:00
claude-botandClaude Opus 5.5 285057bc98 feat(ansible): netbird-client installs on Arch (proxy hosts)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
Step 1 of SSH-only-over-NetBird: proxy-1/2 (Arch) need a host NetBird
client with wt0 before sshd can stop listening on their public
addresses. The role was apt-only.

- Arch: release tarball from GitHub, verified against the release's
  checksums file (get_url checksum URL), binary to /usr/local/bin,
  'netbird service install'. Version netbird_client_version, 0.75.0
  like netbird-ingress; Debian/Ubuntu keep following the apt repo.
- netbird_disable_dns adds --disable-dns; set for [netbird_proxy],
  whose resolv.conf the netbird-proxy role pins.
- The service is started before 'netbird up' (the Arch path has no
  package that starts it).
- The connected check matched 'Connected' inside 'Disconnected'; it
  now matches the 'Management: Connected' line.
- 'netbird up' runs with no_log: its argv holds the setup key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:12:55 +01:00
k.renner 973c6d9e94 Merge pull request 'fix(bootstrap): portable DR secret commands, visible YubiKey prompts' (#1482) from dr-secrets-age-fixes into main
Reviewed-on: #1482
2026-10-27 14:29:03 +00:00
claude-botandClaude Opus 5.5 a5f2bc39e4 fix(bootstrap): portable DR secret commands, visible YubiKey prompts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Review of #1481 (merged with it open):
- The Job printed the operator's streaming command with the pod's
  HOME expanded (/work/.config/...), unusable on the workstation. The
  defaults stay a literal ~ now; eval expands it on the workstation.
- 'Collecting secrets' captured stderr, where age-plugin-yubikey asks
  for the PIN and touch: a silent hang. stderr stays on the terminal.
- Runbook/migration doc still named pass as the DR store in places;
  tooling list gains age + age-plugin-yubikey; the file list gains
  hetzner-cloud-api-secret.age.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:27:17 +01:00
k.renner cb7f727c1c Merge pull request 'feat(bootstrap): DR secrets from YubiKey/paper-key age files, not pass' (#1481) from dr-secrets-age into main
Reviewed-on: #1481
2026-10-27 14:25:33 +00:00
claude-botandClaude Opus 5.5 e4f14180ff feat(bootstrap): DR secrets from YubiKey/paper-key age files, not pass
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The cold-rebuild secrets (seal key, Hetzner restore keys, GHCR pull
token) came from the pass store: one gpg key file on the owner's laptop,
readable by any process of that user while gpg-agent caches the
passphrase, and with no second copy.

bootstrap.sh now decrypts ~/.config/homelab-secrets/<name>.age, files
encrypted to both YubiKeys (touch) and an offline paper key; a copy is
on nas-2. HOMELAB_AGE_IDENTITY switches to the paper key when both
sticks are gone. The in-cluster Job path is unchanged: the printed
streaming command is the age one. Runbook and the two OpenBao alert
texts point at the new files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:07:23 +01:00
k.renner a44b55b942 Merge pull request 'feat(ansible): remaining CA hosts accept only break-glass and CI keys (SSH CA phase 4)' (#1480) from ssh-keys-managed-rest into main
ci/woodpecker/push/deploy-ssh-ca Pipeline was successful
Reviewed-on: #1480
2026-10-27 13:31:34 +00:00
k.renner 0001f2f0c2 Merge pull request 'fix(crowdsec): never ban successful UI bursts on http-crawl-non_statics' (#1478) from worktree-crowdsec-ma-imageproxy-whitelist into main
Reviewed-on: #1478
2026-10-27 13:26:45 +00:00
claude-botandClaude Opus 5.5 f78e4bc713 feat(ansible): remaining CA hosts accept only break-glass and CI keys
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
proxy-1 is verified after #1477/#1479: authorized_keys holds exactly
breakglass-neo-6532348 and the CI key, and CI still reaches it.

Removed with this run, per the [ssh_ca] report and the sshd journals
(no root login with any of them except id_ecdsa, the owner's old key):
- proxy-2: id_ecdsa, ansible-runner@ci-new
- netbird: id_ecdsa, ansible-runner@ci-new, krenner@fortress,
  netbird-tunnel (SHA256:cNy8...), a second woodpecker-ci key
  (SHA256:hQxz...); none used for a root login since 2026-08-29
- edge-1: id_ecdsa, ansible-runner@ci-new, krenner@fortress
The CI key keeps from= the pod network on edge-1 (LAN, CI arrives from
10.244.2.x) and has none on proxy-2 and netbird (CI arrives NATed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 14:26:06 +01:00
claude-botandClaude Opus 5.5 e855921b39 fix(crowdsec): drop crawl-non_statics alerts for successful bursts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Replaces the per-service Music Assistant/Immich parser whitelists with
one postoverflow whitelist: http-crawl-non_statics overflows are dropped
unless at least half of the requests in the alert are 4xx.

Every self-ban in the alert history (MA 350/368/477, Immich 149/150) was
a burst of 200s from a signed-in UI. Every scanner ban on this scenario
was 404s (/.env, /.git/...). The per-service rules only covered apps
that had already failed and muted all scenarios on their paths; this
covers any image-heavy UI and touches only this scenario.

Verified in a crowdsecurity/crowdsec:v1.8.1 replay: a 60x200 burst is
whitelisted, a 60x404 burst with distinct paths still overflows and is
not whitelisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 14:23:43 +01:00
k.renner ec5b7314d6 Merge pull request 'fix(ansible): no from= on the CI key for internet hosts' (#1479) from ssh-ci-key-from-per-host into main
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/push/deploy-ssh-ca Pipeline was successful
Reviewed-on: #1479
2026-10-27 13:20:28 +00:00
claude-botandClaude Opus 5.5 d46d6fde93 fix(ansible): no from= on the CI key for internet hosts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
#1477 locked CI out of proxy-1: the CI key got from= the pod network,
but CI reaches the internet hosts NATed from the home WAN address
(proxy-2 journal: root logins from 84.171.37.13). The from= came from
plays/configure-ssh-keys.yml, which no pipeline ever ran, so it was
never in effect on those hosts. LAN hosts do see the pod address
(edge-1 journal: 10.244.2.x).

ssh_ci_key_from is now per host: the pod CIDRs by default, empty for
[netbird_proxy] and netbird.renner.uno. The owner already removed the
from= on proxy-1 by hand; this keeps the next run from restoring it.
Restricting SSH on internet hosts to the NetBird mesh is the follow-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 14:15:01 +01:00
claude-botandClaude Opus 5.5 16ca2f69b7 fix(crowdsec): whitelist Immich timeline/asset loads
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Scrolling the Immich timeline fetches a /api/timeline/bucket and then
every /api/assets/<uuid> in it; 46-54 requests in 3-9s fired
crowdsecurity/http-crawl-non_statics against a residential Telekom IPv6
(alerts 149/150, 2026-10-23).

Same parser-stage pattern as the Music Assistant whitelist, scoped to
the Immich Traefik router and those two path prefixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:55:40 +01:00
claude-botandClaude Opus 5.5 cb4cabeca7 fix(crowdsec): whitelist Music Assistant imageproxy cover-art loads
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
The MA UI loads every cover through /imageproxy/<hash>?size=512 in one
burst; a library view (47 requests in 3s) fired
crowdsecurity/http-crawl-non_statics and banned a residential Telekom
IPv6 (alert 477, 2026-10-27).

Parser-stage whitelist scoped to the MA Traefik router and the
/imageproxy/ path. The Traefik parser sets no target_fqdn, so the
router name is used as host scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:54:34 +01:00
k.renner 2f63d2d426 Merge pull request 'feat(ansible): proxy-1 accepts only break-glass and CI keys (SSH CA phase 4)' (#1477) from ssh-keys-managed-proxy-1 into main
ci/woodpecker/push/deploy-ssh-ca Pipeline was successful
Reviewed-on: #1477
2026-10-27 12:14:08 +00:00
claude-botandClaude Opus 5.5 04b704fdbd feat(ansible): proxy-1 accepts only break-glass and CI keys
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
First host in [ssh_keys_managed]. root on proxy-1 currently has
id_ecdsa (krenner@krenner-XPS-13-9310), woodpecker-ci@homelab
(SHA256:DQWPS...) and ansible-runner@ci-new (dead since #184). After
this run: breakglass-neo-6532348 and the same CI key with its from=
pod-network restriction; people log in with CA certificates. proxy-2
is the twin, so the public edge survives a mistake here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 12:49:46 +01:00
k.renner 63df267a2f Merge pull request 'feat(ansible): one admin key list; report authorized_keys (SSH CA phase 4, step 1)' (#1476) from ssh-keys-managed into main
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
ci/woodpecker/push/deploy-ssh-ca Pipeline was successful
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
Reviewed-on: #1476
2026-10-27 11:38:59 +00:00
claude-botandClaude Opus 5.5 6c5bdd3e46 feat(ansible): one admin key list; report authorized_keys (phase 4)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Phase 4 of the SSH CA, step 1. Nothing is removed from any host yet.

- ssh_admin_authorized_keys (group_vars/all) is the single list of
  plain keys the admin logins may accept: the break-glass PIV key on
  the offline YubiKey NEO and the CI deploy key (from= pod network).
- ssh-ca reports, on every [ssh_ca] host, the fingerprints of the
  admin logins' current authorized_keys.
- configure-ssh-ca.yml gets a second play that sets the admin logins'
  authorized_keys exclusively to that list on [ssh_keys_managed]. The
  group is empty; hosts join one at a time after the report.
- Removed the three dead key lists: plays/configure-ssh-keys.yml (no
  pipeline ran it), common_ssh_public_keys (defined, never used) and
  opentofu/locals.tf common_ssh_keys (no reference). They carried
  krenner@fortress, ansible-runner@ci-new and the laptop id_ecdsa key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 12:28:48 +01:00
k.renner 8a13b241cb Merge pull request 'feat(gitea): trust the OpenBao SSH CA (SSH CA phase 3b)' (#1475) from gitea-ssh-ca-trust into main
Reviewed-on: #1475
2026-10-27 10:42:44 +00:00
claude-botandClaude Opus 5.5 1b63cb8970 feat(gitea): trust the OpenBao SSH CA (phase 3b)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Step A is verified: Secret gitea-ssh-ca holds exactly the CA key
(SHA256:xEhuqx..., one line, 81 bytes like OpenBao's content-length),
so the webhook provider passes a text/plain body through unchanged.

- StatefulSet: SSH_TRUSTED_USER_CA_KEYS from the Secret,
  SSH_AUTHORIZED_PRINCIPALS_ALLOW=username. The built-in SSH server
  looks a cert's principals up as principal keys, so each user
  registers their username once as a principal.
- ExternalSecret: trim the trailing newline before it reaches app.ini.
- Reloader annotation: Gitea reads env only at start, so a CA rotation
  restarts it. The step A comment claimed the refresh alone reaches
  Gitea; corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:40:05 +01:00
k.renner 4ba3f03b18 Merge pull request 'feat(gitea): sync the OpenBao SSH CA public key into a Secret (SSH CA phase 3a)' (#1474) from gitea-ssh-ca-secret into main
Reviewed-on: #1474
2026-10-27 10:35:31 +00:00
claude-botandClaude Opus 5.5 739b41b623 feat(gitea): sync the OpenBao SSH CA public key into a Secret
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Phase 3, step A of the SSH CA: Gitea's built-in SSH server needs the CA
key as SSH_TRUSTED_USER_CA_KEYS. A namespaced ESO webhook SecretStore
reads OpenBao's unauthenticated /v1/ssh-client-signer/public_key from
the in-cluster Service into Secret gitea-ssh-ca, so the key has one
source. Gitea is not wired to it yet; step B follows once the Secret
is verified to hold exactly the CA key (the ESO docs do not say how a
text/plain body without result.jsonPath is handled).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:22:47 +01:00
security-bot f8796b181f chore(image-automation): bump gitea.renner.uno/konairius/wiki:build.1793094262
Updates managed by image-automation-controller.
2026-10-27 09:47:02 +00:00
k.renner e8c72cd1f1 Merge pull request 'feat(ansible): SSH CA on edge-1' (#1473) from ssh-ca-edge-1 into main
ci/woodpecker/push/deploy-ssh-ca Pipeline was successful
Reviewed-on: #1473
2026-10-27 09:46:56 +00:00
claude-botandClaude Opus 5.5 2da554d40e feat(ansible): SSH CA on edge-1
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
netbird verified (Ubuntu, ssh.service): claude-bot cert login, sudo
journalctl allowed, systemctl restart refused. edge-1 is the last
Ansible-managed host (OpenSSH_10.6 banner like the proxies).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:44:45 +01:00
k.renner 35461f1f54 Merge pull request 'fix(ansible): ssh-ca reloads the sshd unit that is running' (#1472) from ssh-ca-running-unit into main
ci/woodpecker/push/deploy-ssh-ca Pipeline was successful
Reviewed-on: #1472
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-27 09:42:25 +00:00
claude-botandClaude Opus 5.5 adedc98b50 fix(ansible): ssh-ca reloads the sshd unit that is running
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
The netbird run (pipeline 14795) failed at the reload: 'Could not find
the requested service sshd.service'. Ubuntu's service_facts list
sshd.service as a not-found alias next to the real ssh.service
(running; disabled because ssh.socket activates it), and the role only
checked that the name exists.

The unit is now the one of sshd.service/ssh.service whose state is
running, asserted to be exactly one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:41:06 +01:00
k.renner 1f228c94ef Merge pull request 'feat(ansible): SSH CA on netbird.renner.uno' (#1471) from ssh-ca-netbird into main
ci/woodpecker/push/deploy-ssh-ca Pipeline failed
Reviewed-on: #1471
2026-10-27 09:37:16 +00:00
claude-botandClaude Opus 5.5 9232937b85 feat(ansible): SSH CA on netbird.renner.uno
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
proxy-2 verified (claude-bot cert login, sudo allow/deny as on
proxy-1). netbird is the first Ubuntu host (OpenSSH_9.6p1
Ubuntu-3ubuntu13.20): unit ssh.service, which the role picks from
service_facts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:36:21 +01:00
k.renner 707f6ab840 Merge pull request 'feat(ansible): SSH CA on proxy-2' (#1470) from ssh-ca-proxy-2 into main
ci/woodpecker/push/deploy-ssh-ca Pipeline was successful
Reviewed-on: #1470
2026-10-27 09:33:35 +00:00
claude-botandClaude Opus 5.5 7600a9dbf9 feat(ansible): SSH CA on proxy-2
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
proxy-1 is verified: owner cert login as root (sk-ed25519 cert) and
claude-bot cert login with the expected sudo rules both work. proxy-2
is its twin (same OpenSSH_10.6 banner).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:31:42 +01:00
k.renner b12ef67002 Merge pull request 'fix(ansible): ssh-ca compares sshd -T output case-insensitively' (#1469) from ssh-ca-assert-case into main
ci/woodpecker/push/deploy-ssh-ca Pipeline was successful
Reviewed-on: #1469
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-27 09:25:47 +00:00
claude-botandClaude Opus 5.5 e6e0e44b6a fix(ansible): compare sshd -T output case-insensitively
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
The second deploy-ssh-ca run on proxy-1 failed at the assert although
all three settings were active: OpenSSH 10.6 prints them as
TrustedUserCAKeys, AuthorizedPrincipalsFile and RevokedKeys, the check
expected lowercase keywords. The run stopped before the reload, so the
running sshd still has the old config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:24:41 +01:00
k.renner 39b7fc7fc3 Merge pull request 'fix(ansible): ssh-ca reloads sshd by its real unit name' (#1468) from ssh-ca-reload-fix into main
ci/woodpecker/push/deploy-ssh-ca Pipeline failed
Reviewed-on: #1468
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-27 09:09:51 +00:00
claude-botandClaude Opus 5.5 33dd968a25 fix(ansible): reload sshd by its real unit name on every run
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
The first deploy to proxy-1 failed at the reload: 'Could not find the
requested service ssh'. proxy-1 is not Debian (banner OpenSSH_10.6
without distro suffix, root shell /usr/bin/bash), so the unit is
sshd.service; the handler only special-cased RedHat.

The unit is now picked from service_facts. The reload runs on every
run instead of via a handler: sshd -T only parses the files, so after
a failed reload a re-run with nothing changed would otherwise leave the
running daemon on the old config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:05:19 +01:00
k.renner d8813a68b7 Merge pull request 'feat(ansible): hosts trust the OpenBao SSH user CA (SSH CA phase 2)' (#1467) from ssh-ca-phase2 into main
ci/woodpecker/push/deploy-ssh-ca Pipeline failed
Reviewed-on: #1467
2026-10-27 08:53:33 +00:00
claude-botandClaude Opus 5.5 9dcaf42f96 fix(ansible): start the SSH CA rollout on proxy-1
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline failed
claude-ws is decommissioned. proxy-1 resolves by name, answers on 22,
and has proxy-2 as its twin, so the public edge survives a bad run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:50:58 +01:00
security-bot d033503fc3 chore(image-automation): bump gotenberg/gotenberg:8.39.0
Updates managed by image-automation-controller.
2026-10-27 08:50:46 +00:00
claude-botandClaude Opus 5.5 66c56288a7 feat(ansible): hosts trust the OpenBao SSH user CA (phase 2)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
New role ssh-ca with play configure-ssh-ca.yml (serial: 1) and pipeline
deploy-ssh-ca. Hosts in the new [ssh_ca] group get:

- TrustedUserCAKeys from OpenBao's public_key endpoint, fetched on the
  controller at run time (no copy in git).
- AuthorizedPrincipalsFile: k.renner for root/ladmin (whichever
  exists), claude-bot for Claude's own claude-bot account.
- RevokedKeys, always deployed: sshd refuses all key logins when the
  file is set but missing.
- claude-bot sudo: read-only journalctl/systemctl status/ss/sshd -T,
  restart/reload only for ssh_ca_claude_sudo_units; NOEXEC against
  pager shell escapes; visudo-validated.

The drop-in is tested with sshd -t and removed again on failure; sshd -T
must show all three settings afterwards. authorized_keys is untouched,
so this only adds a login path. [ssh_ca] starts with claude-ws only.

ssh-sign-owner.hcl now also records the mount, CA and owner role
commands (review on #1466).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:47:48 +01:00
k.renner 2b309dec92 Merge pull request 'feat(openbao): SSH client CA roles (SSH CA phase 1)' (#1466) from ssh-ca-phase1 into main
Reviewed-on: #1466
2026-10-27 08:42:24 +00:00
k.renner 396f839567 Merge pull request 'chore(ci): bump ci-claude image to 2.1.311' (#1464) from ci-image/claude-2.1.311 into main
Reviewed-on: #1464
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-27 08:42:06 +00:00
claude-botandClaude Opus 5.5 2e412e6448 feat(openbao): SSH client CA roles for owner and claude-bot
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Phase 1 of the SSH CA. The ssh-client-signer mount and its ed25519 CA
were set up by hand (root token); this records the roles and the
claude-bot signing policy.

- role owner: principal k.renner, 6-month certs. The mount was enabled
  with -max-lease-ttl=4380h; the 768h system default would cap it.
- role claude: principal claude-bot, 1h certs, pty only.
- policy ssh-sign-claude for the claude-bot userpass user, next to its
  existing claude-bot-write.

Verified: a YubiKey sk-ssh-ed25519 key signed on role owner yields a
sk-ssh-ed25519-cert-v01 cert, principal k.renner, valid to 2027-04-27.
CA fingerprint SHA256:xEhuqxqFVZ/ig6KpAtHOhLbwsIhyWpzXhvDcjIfM/Js,
served unauthenticated at /v1/ssh-client-signer/public_key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:39:19 +01:00
security-bot 7f61ad0ce9 chore(image-automation): bump gitea.renner.uno/gitea_admin/review-bot:2026-10-27-0757 gitea.renner.uno/gitea_admin/ci-backup-verify:2026-10-27
Updates managed by image-automation-controller.
2026-10-27 08:23:50 +00:00
security-bot 6503161146 chore(image-automation): bump gitea.renner.uno/gitea_admin/kuma-sync:2026-10-27-0801
Updates managed by image-automation-controller.
2026-10-27 08:23:47 +00:00
security-bot 01133ca106 chore(image-automation): bump gitea.renner.uno/gitea_admin/secret-rotator:2026-10-27
Updates managed by image-automation-controller.
2026-10-27 08:23:46 +00:00
security-bot ce5be4d067 chore(image-automation): bump gitea.renner.uno/gitea_admin/cloudflare-lb-sync:2026-10-27-0807
Updates managed by image-automation-controller.
2026-10-27 08:17:10 +00:00
security-bot 150e8229fd chore(image-automation): bump gitea.renner.uno/konairius/hermes:build.1793088058
Updates managed by image-automation-controller.
2026-10-27 08:07:03 +00:00
security-bot 0247b3dfd5 chore(image-automation): bump gitea.renner.uno/gitea_admin/authentik-gate-sync:2026-10-27-0801
Updates managed by image-automation-controller.
2026-10-27 08:06:48 +00:00
claude-bot 9b7a64e48c chore(ci): bump ci-claude image to 2.1.311
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
2026-10-27 07:53:48 +00:00
k.renner aee26df4b8 Merge pull request 'fix(wiki): wiki-sync retries while the wiki pod restarts' (#1462) from alert-fix/issue-1461 into main
Reviewed-on: #1462
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-27 07:53:21 +00:00
k.renner 0bf2cd309e Merge pull request 'feat(openbao): OIDC login via Authentik (SSH CA phase 0)' (#1463) from worktree-openbao-oidc-authentik into main
ci/woodpecker/push/ci-claude-refresh Pipeline was successful
ci/woodpecker/push/deploy-claude-workstation Pipeline failed
ci/woodpecker/push/deploy-edge-mqtt-bridge Pipeline was successful
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
ci/woodpecker/push/deploy-netbird-client Pipeline failed
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/push/deploy-netbird-server Pipeline was successful
ci/woodpecker/push/deploy-uptime-kuma Pipeline was successful
ci/woodpecker/push/hermes-image Pipeline was successful
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1463
2026-10-27 07:52:50 +00:00
claude-bot 73d85b4aa8 Merge remote-tracking branch 'origin/main' into worktree-openbao-oidc-authentik
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline failed
# Conflicts:
#	kubernetes/apps/authentik/blueprints-configmap.yaml
2026-10-27 08:45:30 +01:00
claude-botandClaude Opus 5.5 b78cacb6c4 feat(openbao): OIDC login via Authentik for SSH cert signing
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
Phase 0 of the OpenBao SSH CA: humans log in to OpenBao with
Authentik instead of the root token.

- Authentik blueprint: group OpenBao Admins (k.renner), confidential
  OAuth2 provider openbao (CLI + UI callbacks), application, group
  binding. The client secret is generated by Authentik and only goes
  into auth/oidc/config.
- openbao-authentik-egress: auth.renner.uno resolves to the Traefik
  VIP in-cluster, which the existing world egress does not cover.
- Policy ssh-sign-owner with the manual bao commands for auth/oidc;
  its sign path is enabled in phase 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 08:44:15 +01:00
security-bot b753ba4776 chore(image-automation): bump gitea.renner.uno/konairius/wiki:build.1793086240
Updates managed by image-automation-controller.
2026-10-27 07:37:00 +00:00
k.renner 84c0561146 Merge pull request 'feat(authentik): bump to 2026.8.4 with samba-bridge 2026.8.4-3c8f413' (#1460) from claude/authentik-2026.8.4 into main
Reviewed-on: #1460
2026-10-27 07:28:39 +00:00
hermes-bot be4e605d65 fix(wiki): wiki-sync retry window covers the full 120 s
ci/woodpecker/pr/ci-scripts-test Pipeline failed
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Six retries at a fixed 10 s delay stopped after about 60 s, so
--retry-max-time 120 never bound. Twelve retries let the 120 s cap
be the limit, covering a Recreate rollout slowed by an image pull.

Retrying on 5xx is safe: POST /api/v1/sync is serialized by
SyncCoordinator and re-syncs the same state, the same as a webhook
landing mid-sync. --retry-max-time 120 keeps a long sync that fails
late from being repeated.
2026-10-27 07:27:46 +00:00
hermes-bot 10cb1c2152 fix(wiki): wiki-sync retries while the wiki pod restarts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
The wiki Deployment uses Recreate, so during an image rollout the Service
has no ready endpoint for ~10 s. wiki-sync-29884710 started 06:30:00Z, 4 s
before the new pod was Ready, failed with curl (7) and fired KubeJobFailed.
Retry up to 6 times, 10 s apart, on connection refused too, bounded to
120 s from the first attempt so a long sync that fails is not repeated.

Refs #1461
2026-10-27 07:26:13 +00:00
claude-botandClaude Opus 5.5 ae8ce26a01 feat(authentik): bump to 2026.8.4 with samba-bridge 2026.8.4-3c8f413
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Chart, server/worker image and LDAP outpost image move together, as
the chart pin requires. Images built from authentik-samba-bridge
3c8f413 (PR #8), pipeline 43.

Supersedes #1347.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:39:59 +01:00
security-bot 1f1125c49c chore(image-automation): bump gitea.renner.uno/konairius/wiki:build.1793081757
Updates managed by image-automation-controller.
2026-10-27 06:26:58 +00:00
security-bot 1467596309 chore(image-automation): bump valkey/valkey:9.1.3-alpine
Updates managed by image-automation-controller.
2026-10-27 02:50:38 +00:00
security-bot 8ef130da2e chore(image-automation): bump redis:8.10.3-alpine
Updates managed by image-automation-controller.
2026-10-26 17:50:32 +00:00
security-bot 2e677483db chore(image-automation): bump redis:7.4.12-alpine
Updates managed by image-automation-controller.
2026-10-26 17:46:58 +00:00
k.renner 532b853929 Merge pull request 'fix(music-assistant): bind streams to net1 so Sendspin mDNS queries the IoT VLAN' (#1459) from fix/ma-sendspin-mdns-net1 into main
Reviewed-on: #1459
2026-10-26 14:34:12 +00:00
claude-botandClaude Opus 5.5 af7103fd75 fix(music-assistant): bind streams to net1 so Sendspin mDNS queries the IoT VLAN
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
aiosendspin starts its zeroconf on [bind_ip], or on InterfaceChoice.Default
when bind_ip is 0.0.0.0. Default egresses via the pod's main-table default
route (eth0); net1 routes sit in the sbr table. MA therefore never sent
_sendspin._tcp queries onto v30iot and only rediscovered Voice PEs when they
announced on their own, leaving them disconnected for hours after every MA
restart (e.g. 2026-10-26 13:56: 3 of 4 still offline at 15:05).

The reconcile initContainer now writes bind_ip = the live net1 address it
already computes for publish_ip. The address is read from the interface on
every boot, so the Sendspin no-bind-fallback failure (stale literal IP)
cannot recur.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 15:12:32 +01:00
k.renner 1984b01e5d Merge pull request 'fix(music-assistant): mark Up Next episodes played from the playlist' (#1458) from claude/ma-pocketcasts-up-next-mark-played into main
Reviewed-on: #1458
2026-10-26 12:53:42 +00:00
claude-botandClaude Opus 5.5 e02ad7639b fix(music-assistant): mark Up Next episodes played from the playlist
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The Up Next payload carries no episode duration. Marking an episode played
in the UI reports the duration as the position, so the provider received 0
and took it for an explicit "mark unplayed": the episode stayed in Up Next
and was flagged unplayed.

The Up Next playlist now takes duration and playback status from the
(cached, throttled) episode details, falling back to the bare entry when
the details cannot be fetched.

Tested against the 2.10.7 source: 21/21 pocketcasts tests, ruff, mypy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:51:27 +01:00
k.renner 80f5310653 Merge pull request 'feat(music-assistant): Pocket Casts Up Next as a library playlist' (#1457) from claude/ma-pocketcasts-up-next-playlist into main
Reviewed-on: #1457
2026-10-26 12:30:42 +00:00
claude-botandClaude Opus 5.5 9895b7f4f4 feat(music-assistant): Pocket Casts Up Next as a library playlist
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Overlays the Pocket Casts provider with a patched __init__.py that adds
ProviderFeature.LIBRARY_PLAYLISTS and a read-only "Up Next" playlist of
podcast episodes, fetched live from /up_next/list in queue order.

An initContainer copies the image's provider into an emptyDir and swaps
in the patch only when the stock file's sha256 matches the version it was
written against (identical in 2.10.7 and 2.10.8). A later image bump that
changes the provider keeps the stock provider instead of breaking it.

Temporary until the change is upstreamed to music-assistant/server.
Tested against the 2.10.7 source: 18/18 pocketcasts tests, ruff, mypy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:27:44 +01:00
k.renner c380c7c2b8 Merge pull request 'revert(music-assistant): remove PO token server' (#1456) from revert/ma-po-token-server into main
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
Reviewed-on: #1456
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-26 10:18:28 +00:00
claude-botandClaude Opus 5.5 0f86537bb1 revert(music-assistant): remove PO token server
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Reverts #1451. The YouTube Music provider is not kept; the PO token
server and its image automation go with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 11:11:11 +01:00
security-bot 31459dac6d chore(image-automation): bump gitea.renner.uno/konairius/wiki:build.1793006975
Updates managed by image-automation-controller.
2026-10-26 09:36:48 +00:00
k.renner 57c96a9a62 Merge pull request 'fix(image-automation): unpin the gitea-mcp ImageRepository' (#1452) from claude/gitea-mcp-imagerepo into main
Reviewed-on: #1452
2026-10-26 09:28:43 +00:00
claude-botandClaude Opus 5.5 ffd24865ee fix(image-automation): unpin the gitea-mcp ImageRepository
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Renovate #1439 pinned a digest into the ImageRepository's spec.image,
which image-reflector rejects ("should not include a tag"), so Flux
stopped tracking gitea-mcp-server. The image was missing from the
renovate.json list of images Flux image automation already bumps; add
it there so Renovate leaves it alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:11:42 +01:00
k.renner 439e4b4b83 Merge pull request 'feat(music-assistant): PO token server for YouTube Music provider' (#1451) from feat/ma-youtube-music-po-token-v2 into main
Reviewed-on: #1451
2026-10-26 09:05:42 +00:00
k.renner 622a4cc593 Merge pull request 'chore(coredns): Talos alone owns the Corefile (2/2)' (#1450) from claude/coredns-talos-owned-2 into main
Reviewed-on: #1450
2026-10-26 09:04:47 +00:00
claude-botandClaude Opus 5.5 96ea510143 feat(music-assistant): add PO token server for YouTube Music provider
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
MA's YouTube Music provider needs a bgutil PO token server; MA installs
the matching yt-dlp plugin unpinned from PyPI (2.0.2 today), so the
server tracks 2.x via image automation. The MA docs' "1.2.1" predates
the 2.x plugin line.

Reachable only from the MA pod; egress limited to DNS and world:443.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:02:41 +01:00
claude-botandClaude Opus 5.5 60d3acc202 chore(coredns): Talos alone owns the Corefile
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Step 2 of 2. The coredns ConfigMap is a Talos bootstrap manifest; Flux
stops applying its own copy (prune is disabled since the previous
commit, so the live ConfigMap stays until talosctl upgrade-k8s writes
Talos's version). CoreDNS forwards to the node resolver, which asks
k8s-gateway first, so cluster DNS no longer depends on Flux.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:59:37 +01:00
k.renner cb697e2812 Merge pull request 'chore(coredns): keep Flux from pruning the Talos-owned Corefile (1/2)' (#1449) from claude/coredns-talos-owned into main
Reviewed-on: #1449
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-26 08:58:29 +00:00
claude-botandClaude Opus 5.5 1e26d5cdb2 chore(coredns): keep Flux from pruning the Talos-owned Corefile
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Step 1 of 2 to hand the coredns ConfigMap back to Talos. It is a Talos
bootstrap manifest (talos-bootstrap-manifests-inventory) that Flux also
applies; talosctl upgrade-k8s reverts Flux's Corefile. Bootstrap already
runs on Talos's Corefile (forward to the node resolver, which asks
k8s-gateway first), and k8s-gateway carries serve_stale for every name,
so the Flux copy is redundant.

With prune disabled, step 2 can drop the file without Flux deleting the
live ConfigMap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:55:13 +01:00
k.renner fbd3fbd119 Merge pull request 'fix(dns): pods ask the UDM on the segment they leave on' (#1448) from claude/k8s-gateway-ingress-resolver into main
Reviewed-on: #1448
2026-10-26 07:39:52 +00:00
k.renner 3c05098780 Merge pull request 'fix(egress): syncthing STUN 3479, Loki usage reporting off' (#1447) from claude/egress-followups into main
Reviewed-on: #1447
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-26 07:39:25 +00:00
claude-botandClaude Opus 5.5 5ecd17d26b fix(dns): pods ask the UDM on the segment they leave on
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Since UniFi OS 6.0.15 / Network 11.0.97 (2026-10-25 18:42Z) the UDM's
DNS answers out of the interface a query arrived on. Pod traffic to
10.2.40.1 arrives on VLAN 40 (on-link route in table 47) while the pod
CIDRs are routed back over VLAN 47, so the UDM ARPs for the pod on
VLAN 40 and never answers (seen with talosctl pcap on k8s-3; TCP 443 to
the same address works, UDP and TCP 53 do not). fd00::1 was reached
over VLAN 47 and kept working.

k8s-gateway's upstream (k8s-gateway-site), the blackbox-dns probes and
the gatus UDM check now use the UDM's ingress-segment addresses,
fd02:47::1 and 10.2.47.1 (the egress-gw annotations); both answer from
a pod.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 08:29:04 +01:00
security-bot f29e9f965a chore(image-automation): bump gitea.renner.uno/konairius/wiki:build.1792997373
Updates managed by image-automation-controller.
2026-10-26 06:56:47 +00:00
security-bot 42a3a31460 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1792997278 gitea.renner.uno/gitea_admin/review-bot:2026-10-26-0647
Updates managed by image-automation-controller.
2026-10-26 06:53:44 +00:00
security-bot 188784d406 chore(image-automation): bump gitea.renner.uno/gitea_admin/secret-rotator:2026-10-26
Updates managed by image-automation-controller.
2026-10-26 06:53:42 +00:00
security-bot 6f5c4f7b81 chore(image-automation): bump docker.gitea.com/gitea-mcp-server:1.11.0
Updates managed by image-automation-controller.
2026-10-26 06:52:51 +00:00
claude-botandClaude Opus 5.5 76f3d4b6b5 fix(egress): syncthing STUN 3479, Loki usage reporting off
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
syncthing's STUN NAT-type probe sends its change request to port 3479,
which syncthing-egress dropped (seen: 77.72.169.212:3479/UDP).

Loki tried to send usage reports to Grafana (34.49.170.206:443), denied
by its egress policy; switch reporting off instead of allowing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 07:51:31 +01:00
k.renner 67ff176875 Merge pull request 'chore(deps): update alpine:3.24 docker digest to be26560' (#1441) from renovate/multus into main
Reviewed-on: #1441
2026-10-26 06:43:16 +00:00
k.renner 2ddb9544e6 Merge pull request 'feat(wiki): sync and encyclopedia schedules as CronJobs' (#1446) from feat/wiki-cronjobs into main
Reviewed-on: #1446
2026-10-26 06:43:02 +00:00
k.renner 25e70dc555 Merge pull request 'chore(deps): update home-assistant non-major' (#1442) from renovate/home-assistant-minor-patch into main
Reviewed-on: #1442
2026-10-26 06:42:36 +00:00
k.renner a4b18f44c3 Merge pull request 'chore(deps): update all non-major dependencies' (#1440) from renovate/all-minor-patch into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1440
2026-10-26 06:42:16 +00:00
k.renner 49856fe577 Merge pull request 'chore(deps): update influxdb:2.9.1 docker digest to 8f106f7' (#1443) from renovate/influxdb into main
Reviewed-on: #1443
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-26 06:42:01 +00:00
k.renner 576611faae Merge pull request 'chore(deps): update ci non-major' (#1444) from renovate/ci-minor-patch into main
ci/woodpecker/push/build-ci-images Pipeline is pending
ci/woodpecker/push/ci-claude-refresh Pipeline is pending
ci/woodpecker/push/deploy-infrastructure Pipeline is pending
Reviewed-on: #1444
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-26 06:41:44 +00:00
k.renner cc898ec553 Merge pull request 'chore(deps): update hermes image' (#1445) from renovate/hermes-image into main
ci/woodpecker/push/build-ci-images Pipeline is pending
ci/woodpecker/push/hermes-image Pipeline is pending
Reviewed-on: #1445
2026-10-26 06:41:25 +00:00
k.renner 7d53c99062 Merge pull request 'chore(deps): pin docker.gitea.com/gitea-mcp-server docker tag to ccdb566' (#1439) from renovate/pin-image-digests into main
Reviewed-on: #1439
2026-10-26 06:40:47 +00:00
claude-botandClaude Opus 5.5 8ce5ebd8ac feat(wiki): sync and encyclopedia schedules as CronJobs
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
wiki-sync (every 30 min) and wiki-encyclopedia (06:00 Europe/Berlin) call
the service's API with a generated scheduler key; the service no longer
schedules anything itself (konairius/Wiki#18). Pods in ai already reach
the wiki through the namespace default policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 07:37:15 +01:00
renovate-bot 9258947fef chore(deps): update hermes image
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
2026-10-26 03:01:35 +00:00
renovate-bot 1955a11b81 chore(deps): update ci non-major
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/review-bot-test Pipeline was successful
2026-10-26 03:01:34 +00:00
renovate-bot da614f83fe chore(deps): update influxdb:2.9.1 docker digest to 8f106f7
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
2026-10-26 03:01:30 +00:00
renovate-bot e5c99655e5 chore(deps): update home-assistant non-major
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
2026-10-26 03:01:27 +00:00
renovate-bot 392a010daa chore(deps): update alpine:3.24 docker digest to be26560
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
2026-10-26 03:01:25 +00:00
renovate-bot f04f449163 chore(deps): update all non-major dependencies
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/review-bot-test Pipeline was successful
2026-10-26 03:01:23 +00:00
renovate-bot 32d0f0cc7b chore(deps): pin docker.gitea.com/gitea-mcp-server docker tag to ccdb566
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
2026-10-26 03:01:19 +00:00
security-bot c79ccfb3f3 chore(image-automation): bump lscr.io/linuxserver/lidarr:3.1.6.5079-ls46
ci/woodpecker/cron/update-audit Pipeline was successful
ci/woodpecker/cron/e2e Pipeline failed
Updates managed by image-automation-controller.
2026-10-26 02:52:46 +00:00
k.renner 0904f73721 Merge pull request 'fix(netpol): allow shelly-manager mDNS queries' (#1436) from claude/shelly-manager-mdns into main
Reviewed-on: #1436
2026-10-25 22:16:39 +00:00
k.renner ef2024c565 Merge pull request 'feat(mqtt): admin login as a register account' (#1437) from claude/mqtt-admin-register into main
Reviewed-on: #1437
2026-10-25 22:16:23 +00:00
claude-botandClaude Opus 5.5 3c86f0970c feat(mqtt): admin login as a register account
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The controller (main-b1f294d, konairius/mqtt-account-controller#13)
delivers a password account to a namespace Secret. admin moves into the
register with its password in Secret mqtt-admin-password; Dynamic
Security is asked first, so it replaces the password_file login without
a broker restart. The controller gets get/create/patch/delete on that
Secret by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 21:06:03 +01:00
security-bot 4c5665aa75 chore(image-automation): bump gitea.renner.uno/gitea_admin/ci-backup-verify:2026-10-25 gitea.renner.uno/gitea_admin/review-bot:2026-10-25-1455 gitea.renner.uno/gitea_admin/secret-rotator:2026-10-25
Updates managed by image-automation-controller.
2026-10-25 15:23:41 +00:00
security-bot 38091cbe11 chore(image-automation): bump gitea.renner.uno/gitea_admin/kuma-sync:2026-10-25-1459
Updates managed by image-automation-controller.
2026-10-25 15:23:40 +00:00
security-bot 33c0266fc1 chore(image-automation): bump gitea.renner.uno/gitea_admin/cloudflare-lb-sync:2026-10-25-1504
Updates managed by image-automation-controller.
2026-10-25 15:17:02 +00:00
claude-botandClaude Opus 5.5 9bcc1cb420 fix(netpol): allow shelly-manager mDNS queries
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
shelly-manager resolves device *.local names via mDNS; the queries leave on
eth0 to 224.0.0.251:5353 and have been dropped since the egress lockdown
(#1432), failing with 'Name or service not known' since 15:07Z.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:10:58 +01:00
security-bot b10b50fd2d chore(image-automation): bump gitea.renner.uno/konairius/hermes:build.1792940452
Updates managed by image-automation-controller.
2026-10-25 15:06:45 +00:00
security-bot f9c517bd37 chore(image-automation): bump gitea.renner.uno/gitea_admin/authentik-gate-sync:2026-10-25-1458
Updates managed by image-automation-controller.
2026-10-25 15:06:43 +00:00
security-bot 49cafb2f6d chore(image-automation): bump gitea.renner.uno/konairius/wiki:build.1792939775
Updates managed by image-automation-controller.
2026-10-25 14:56:41 +00:00
k.renner 6fa10a7744 Merge pull request 'feat(wiki): gate wiki sign-in to Wiki Readers and enable encyclopedia planning' (#1435) from feat/wiki-encyclopedia-pilot into main
Reviewed-on: #1435
2026-10-25 14:51:08 +00:00
k.renner b341b26673 Merge pull request 'feat(netpol): restrict pod egress to the outside world per workload' (#1432) from claude/egress-lockdown into main
ci/woodpecker/push/ci-claude-refresh Pipeline was successful
ci/woodpecker/push/deploy-claude-workstation Pipeline failed
ci/woodpecker/push/deploy-edge-mqtt-bridge Pipeline was successful
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
ci/woodpecker/push/deploy-netbird-client Pipeline failed
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/push/deploy-netbird-server Pipeline was successful
ci/woodpecker/push/deploy-uptime-kuma Pipeline was successful
ci/woodpecker/push/hermes-image Pipeline was successful
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1432
2026-10-25 14:50:32 +00:00
k.renner aad24d4186 Merge pull request 'feat(mosquitto): retire legacy password users (admin stays, generated Secret)' (#1433) from claude/mosquitto-legacy-auth-removal into main
Reviewed-on: #1433
2026-10-25 14:50:09 +00:00
k.renner 7ef4475952 Merge pull request 'chore(ci): bump ci-claude image to 2.1.310' (#1434) from ci-image/claude-2.1.310 into main
Reviewed-on: #1434
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-25 14:48:49 +00:00
claude-botandClaude Opus 5.5 aca39a5a8f feat(wiki): gate wiki sign-in to Wiki Readers and enable encyclopedia planning
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Only members of the new Authentik group Wiki Readers may sign in to the wiki
OIDC application; membership is managed in Authentik, so the owner must be
added before merge. Encyclopedia is enabled with MaxArticles=0 so the first
nightly run only plans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 14:52:51 +01:00
claude-bot d7ca8dda11 chore(ci): bump ci-claude image to 2.1.310
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
2026-10-25 00:01:21 +00:00
security-bot c8483b3545 chore(image-automation): bump ghcr.io/home-assistant/home-assistant:2026.10.4
ci/woodpecker/cron/ci-claude-refresh Pipeline was successful
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
Updates managed by image-automation-controller.
2026-10-24 20:50:33 +00:00
claude-botandClaude Opus 5.5 bb090e6809 feat(mosquitto): retire legacy password users; admin stays on a generated Secret
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Since the broker restart on 2026-10-22 only register accounts connect; the
last legacy logins (homeassistant, sml2mqtt, open3e, zigbee2mqtt) were on
2026-10-08, and admin/evcc never logged in within the 30-day Loki window.

- Delete mosquitto-bootstrap.yaml (5 Jobs that apk add at runtime + RBAC).
- The broker's password_file/acl_file now hold only admin, the owner's
  workstation login over the LoadBalancer. The controller has no delivery
  mode that puts a password account's password into a Secret, and the cert
  listener :8884 is in-cluster only, so admin cannot be a register account.
  Its password comes from an ESO Password generator (CreatedOnce), the
  pattern of apps/hermes/api-key.yaml, in Secret mosquitto-admin-password.
- Delete the evcc and health ExternalSecrets and the health rotator
  CronJob/policy; nothing reads them.
- Delete PROPOSAL-mosquitto-credential-rotation.md; its subject is gone.
- MosquittoDown test masks with the dynsec-test pod instead of a
  bootstrap Job pod; comments and docs follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:46:00 +02:00
claude-botandClaude Opus 5.5 5aee6a54ad revert(netpol): no world egress for mosquitto-bootstrap
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Runtime package installs are not to be enabled by policy. The Jobs feed only
the unused legacy password_file and are removed in a separate PR, which must
merge before this one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 17:33:25 +02:00
claude-botandClaude Opus 5.5 8a53171ad0 fix(netpol): let mosquitto-bootstrap Jobs reach Alpine mirrors
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The Jobs run apk add curl jq on every execution; without world 443/80 they
fail and block the home-assistant Kustomization. Also correct the stale
renderer egress comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 17:26:49 +02:00
claude-botandClaude Opus 5.5 299194247e feat(netpol): allow mqtt-account-controller to deliver to edge-1
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
edge-1.iot.renner.uno:8443 is the deliver.esp32 target in mqtt-accounts.yaml
(https+mTLS credential push). Matched by FQDN, not the current 10.2.30.108.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 17:26:00 +02:00
claude-bot 6b6e1e7e04 Merge remote-tracking branch 'origin/main' into worktree-egress-lockdown
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline failed
# Conflicts:
#	kubernetes/infrastructure/network-policies/gitea-ns.yaml
#	kubernetes/infrastructure/network-policies/matrix-ns.yaml
2026-10-24 12:45:03 +02:00
claude-botandClaude Opus 5.5 752fcd5d03 feat(netpol): restrict pod egress to the outside world per workload
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
Drop namespace-wide world egress and give each workload only the external
destinations it needs (FQDN where the host is in our config, port-scoped
world otherwise). Namespaces that had ingress-only policies get an
in-cluster + DNS egress baseline. CNPG instances get Hetzner S3 via one
clusterwide policy.

Out of scope: kube-system, flux-system, rook-ceph, woodpecker-ci,
music-assistant, evcc, openbao.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 12:43:38 +02:00
security-bot 55cd083484 chore(image-automation): bump ghcr.io/advplyr/audiobookshelf:2.37.2
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
Updates managed by image-automation-controller.
2026-10-23 20:49:32 +00:00
security-bot ada3d3d0b4 chore(image-automation): bump ghcr.io/home-assistant/home-assistant:2026.10.3
Updates managed by image-automation-controller.
2026-10-23 19:50:03 +00:00
security-bot 1bd3111912 chore(image-automation): bump ghcr.io/music-assistant/server:2.10.8
Updates managed by image-automation-controller.
2026-10-23 14:49:29 +00:00
security-bot 0e12e90509 chore(image-automation): bump gitea.renner.uno/gitea_admin/authentik-gate-sync:2026-10-23-0757
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
Updates managed by image-automation-controller.
2026-10-23 08:02:02 +00:00
k.renner 613e1da011 Merge pull request 'fix(authentik-gate-sync): embedded outpost redirects browsers to the public URL' (#1430) from fix/gate-embedded-browser-host into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1430
2026-10-23 07:57:11 +00:00
claude-botandClaude Opus 5.5 6998845854 fix(authentik-gate-sync): embedded outpost redirects browsers to the public URL
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
The embedded outpost builds the sign-in redirect from authentik_host, not authentik_host_browser. Setting it to the in-cluster Service sent every gate's login to http://authentik-server.authentik.svc.cluster.local/. authentik_host is now https://auth.renner.uno/, Authentik's default for the embedded outpost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:55:33 +02:00
security-bot 430c710fd0 chore(image-automation): bump gitea.renner.uno/gitea_admin/authentik-gate-sync:2026-10-23-0748
Updates managed by image-automation-controller.
2026-10-23 07:51:29 +00:00
k.renner 6accd1d3cd Merge pull request 'feat(authentik-gate): Traefik ForwardAuth, gate config on the Ingress' (#1429) from feat/authentik-gate-forwardauth into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1429
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-23 07:48:22 +00:00
claude-botandClaude Opus 5.5 6178063299 fix(authentik-gate-sync): verify the embedded outpost match, refuse shared hosts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The embedded outpost is matched on the client too, so a filter the server ignored cannot select the LDAP outpost. A host named by two gated Ingresses is a GateError: the outpost finds providers by host, so it would serve one gate for both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:44:34 +02:00
claude-botandClaude Opus 5.5 0b7a2b6c46 feat(authentik-gate): gate config lives on the Ingress itself
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
The gate is now declared on the app's own traefik Ingress: naming the
static Middleware authentik/gate (ForwardAuth against the embedded
outpost) in router.middlewares opts in, and its auth.renner.uno/*
annotations configure it. No generated route Ingress, ExternalName
Service or per-gate Middleware; the IngressClass authentik-gate is gone.

authentik-gate-sync keeps building the Authentik side (forward_single
provider on the embedded outpost, application, group policy) and the
backend CNP admitting Traefik, and sweeps the objects it generated
before. Traefik publishes the Ingress status itself.

The outpost's own paths (/outpost.goauthentik.io/) are one static
IngressRoute above the app routes. The embedded outpost answers 404 for
a host without a provider (checked live: auth/traefik with
X-Forwarded-Host no-such-gate.renner.uno), so a gate without its
provider stays closed.

docs.renner.uno points at paperless:80 behind redirect + gate (Paperless
Users) instead of the removed paperless-gate Service. Drops __pycache__
committed by mistake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:40:27 +02:00
claude-botandClaude Opus 5.5 772311c574 feat(authentik-gate): Traefik ForwardAuth on the embedded outpost
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Each gate was a single-replica proxy outpost in series with Traefik, so
any outpost restart, drain or node loss took its app down. Gates now
run as Traefik ForwardAuth against Authentik's embedded outpost inside
authentik-server: the request path is Traefik -> app, and the only auth
dependency is authentik-server, which every login already needs.

Per gated Ingress the controller now creates a forward_single provider
attached to the embedded outpost, a ForwardAuth Middleware first in the
route's chain, a /outpost.goauthentik.io route to authentik-server, and
a CNP admitting Traefik to the backend pods. It removes the per-gate
outposts and their egress CNPs.

Identity headers: authResponseHeadersRegex makes Traefik delete every
client-sent X-authentik-* header before copying the outpost's answer
(traefik pkg/middlewares/auth/forward.go), so a gated backend only ever
sees identity Authentik issued. Traefik answers 500 if the outpost is
unreachable and drops a router whose Middleware is missing: fail closed.

The blueprint no longer declares the embedded outpost: an entry must
carry providers, and re-applying [] would detach every gate. The
controller owns its providers and authentik_host/_browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:16:30 +02:00
security-bot 7bf1681c2d chore(image-automation): bump gitea.renner.uno/gitea_admin/secret-rotator:2026-10-23
Updates managed by image-automation-controller.
2026-10-23 05:53:33 +00:00
k.renner c9cd0783df Merge pull request 'fix(hermes): gitea-webhook-sync covers every konairius repo via team membership' (#1413) from fix/gitea-webhook-sync-org-scope into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1413
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-23 05:34:08 +00:00
k.renner 7e57b42316 Merge pull request 'docs: drop references to the deleted *.renner.uno wildcard' (#1428) from docs/drop-wildcard-references into main
ci/woodpecker/push/deploy-claude-workstation Pipeline failed
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
ci/woodpecker/push/deploy-netbird-proxy Pipeline was canceled
Reviewed-on: #1428
2026-10-23 05:33:31 +00:00
security-bot 9afb56536c chore(image-automation): bump docker.gitea.com/gitea-mcp-server:1.11.0
Updates managed by image-automation-controller.
2026-10-23 00:49:33 +00:00
security-bot 23c089c8b7 chore(image-automation): bump ghcr.io/paperless-ngx/paperless-ngx:3.3.4
Updates managed by image-automation-controller.
2026-10-22 22:49:23 +00:00
claude-botandClaude Opus 5.5 a3eb69ee20 docs: drop references to the deleted *.renner.uno wildcard
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The public Cloudflare wildcard CNAME *.renner.uno -> proxy.renner.uno and
its carve-out TXTs were removed on 2026-10-22. Public hosts now carry an
explicit CNAME to proxy.renner.uno created by external-dns from
dns.renner.uno/public; UDM records are opt-in via dns.renner.uno/internal.

Comment/doc text only; no config value changes:
- KumaMonitor, Ingress, HelmRelease and tofu comments that said hosts
  resolve via the wildcard or that external-dns-unifi "skips" public hosts.
- PrometheusRule descriptions (k8s-gateway, dns-resolution) and the
  matching promtool test strings.
- k8s-gateway cache comment: the cache tuning stays (dnsmasq refusal
  bursts, 5s lease TTLs); the wildcard-trap rationale is gone.
- hermes skill references, claude-workstation runbook, crowdsec bouncer
  defaults.

Not changed: kubernetes/apps/home-assistant/* (README rule 1 window) and
the wildcard sentence inside the CoreDNS Corefile data
(infrastructure/coredns-config), where an edit changes the ConfigMap.

Verified live before the edit: all 30 Kuma DNS monitors and all blackbox
DNS/HTTP probes green after the wildcard removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:08:07 +02:00
k.renner c6cb6b3aec Merge pull request 'fix(netbird-server): keep the host mesh client out of DNS' (#1427) from fix/netbird-controller-disable-dns into main
ci/woodpecker/push/deploy-netbird-server Pipeline was successful
Reviewed-on: #1427
2026-10-22 19:56:51 +00:00
claude-botandClaude Opus 5.5 29c299c0fe fix(netbird-server): keep the host mesh client out of DNS
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
The controller's own NetBird client registered ~renner.uno in
systemd-resolved, pointing at the kube-dns-lb nameserver group, which is
unreachable from this peer. Every *.renner.uno lookup on the host returned
SERVFAIL, and Uptime Kuma, resolving through Docker's embedded DNS and the
host stub, marked all HTTP monitors DOWN after the 2026-10-22 update-os
reboot.

The role now reconnects the client with --disable-dns when its config has
DNS management enabled. The flag is only honoured on a fresh up, so the
task runs netbird down + up; it is a no-op once disableDns is true.
Applied live and verified 2026-10-22 before this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:55:11 +02:00
k.renner a3efc511c8 Merge pull request 'feat(dns): one consumer per label; public DNS as CNAME to proxy.renner.uno (step 2/2)' (#1426) from feat/dns-labels-split-2 into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1426
2026-10-22 19:52:53 +00:00
k.renner 924b6e9e88 Merge pull request 'feat(dns): add dns.renner.uno/internal and netbird.renner.uno/public labels (step 1/2)' (#1425) from feat/dns-labels-split-1 into main
Reviewed-on: #1425
2026-10-22 19:46:56 +00:00
claude-botandClaude Opus 5.5 5bfa957f29 feat(dns): one consumer per label; public DNS as CNAME to proxy.renner.uno
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Step 2 of 2 of the label split (owner decision 2026-10-22). Requires
#1425 (step 1) to be applied first.

- external-dns-unifi: labelFilter dns.renner.uno/internal=true (opt-in).
  Every object it publishes today carries the label since step 1, so the
  UDM record set is unchanged.
- external-dns-cloudflare: labelFilter dns.renner.uno/public=true, default
  target proxy.renner.uno (the cloudflare-lb-sync load balancer) instead of
  the retired tunnel, no --cloudflare-proxied, policy sync. Each public
  host gets a DNS-only CNAME to proxy.renner.uno plus its TXT registry
  record; this is the prerequisite for removing the *.renner.uno wildcard.
- netbird-service-sync: reads netbird.renner.uno/public only. Every
  dns-public Ingress carries it since step 1, so the 21 proxy services are
  unchanged.
- git/gitea/gitea-mcp: add dns.renner.uno/public (public today via the
  wildcard; keep their LAN record via dns.renner.uno/internal).
- Drop comments describing the old public!=true filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:45:20 +02:00
claude-botandClaude Opus 5.5 0806bdfab5 feat(dns): add dns.renner.uno/internal and netbird.renner.uno/public labels
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Step 1 of 2 of the label split, owner decision 2026-10-22:
  dns.renner.uno/internal  -> UniFi (LAN) DNS via external-dns-unifi
  dns.renner.uno/public    -> Cloudflare DNS via external-dns-cloudflare
  netbird.renner.uno/public -> NetBird reverse-proxy service (netbird-service-sync)

Additive only; no consumer reads the new labels yet:
- dns.renner.uno/internal on every object external-dns-unifi publishes
  today (24 Ingresses incl. Grafana via chart values, 6 LoadBalancer
  Services = the 31 live UDM hostnames).
- netbird.renner.uno/public next to every dns.renner.uno/public label
  (20 Ingresses). netbird-service-sync already ORs both labels, so its
  desired set is unchanged.
authentik-gate-sync copies source labels to the generated *-gate Ingresses.

Step 2 flips external-dns-unifi to dns.renner.uno/internal=true,
netbird-service-sync to netbird.renner.uno/public only, and
external-dns-cloudflare to dns.renner.uno/public=true. It must merge only
after this change is applied, or external-dns-unifi (policy sync) would
delete LAN records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:43:33 +02:00
security-bot 9d1b034d0f chore(image-automation): bump gitea.renner.uno/gitea_admin/ci-backup-verify:2026-10-22
Updates managed by image-automation-controller.
2026-10-22 19:23:34 +00:00
security-bot 46af8158ca chore(image-automation): bump gitea.renner.uno/gitea_admin/kuma-sync:2026-10-22-1858
Updates managed by image-automation-controller.
2026-10-22 19:23:31 +00:00
security-bot d30afa09c2 chore(image-automation): bump gitea.renner.uno/gitea_admin/secret-rotator:2026-10-22
Updates managed by image-automation-controller.
2026-10-22 19:23:29 +00:00
security-bot 6a82260500 chore(image-automation): bump gitea.renner.uno/gitea_admin/review-bot:2026-10-22-1854
Updates managed by image-automation-controller.
2026-10-22 19:23:28 +00:00
security-bot ab55215532 chore(image-automation): bump gitea.renner.uno/gitea_admin/authentik-gate-sync:2026-10-22-1858
Updates managed by image-automation-controller.
2026-10-22 19:23:26 +00:00
k.renner 7b9886545f Merge pull request 'fix(cloudflare-lb-sync): point deployment at the built image 2026-10-22-1904' (#1424) from fix/cloudflare-lb-sync-image-tag into main
Reviewed-on: #1424
2026-10-22 19:15:15 +00:00
claude-botandClaude Opus 5.5 5be8ee6e0e fix(cloudflare-lb-sync): point deployment at the built image 2026-10-22-1904
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
#1423 shipped a placeholder tag (2026-10-22-0000) that was never pushed,
so the pod sits in ImagePullBackOff until image automation rescans.
2026-10-22-1904 is the tag pipeline 14713 pushed
(sha256:bef768a88c7b7bd30f7fcbf3f3fecfc58e8f7ff5e08e1c5f576f8043a9465f83).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:14:36 +02:00
k.renner b9d237562e Merge pull request 'feat(cloudflare-lb-sync): manage proxy.renner.uno load balancer from the cluster' (#1423) from feat/cloudflare-lb-sync into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1423
2026-10-22 18:51:01 +00:00
claude-botandClaude Opus 5.5 444b20d70e feat(cloudflare-lb-sync): manage proxy.renner.uno load balancer from the cluster
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
New in-house controller (kuma-sync house pattern) that reconciles a
CloudflareLoadBalancer resource into a DNS-only Cloudflare load balancer,
its pool and its health monitor, using cloudflare-go v7.

proxy.renner.uno had round-robin A/AAAA records without health checks, so
every proxy reboot blackholed part of the public traffic. The owner set up
a DNS-only load balancer by hand (hostname origins proxy-1/proxy-2, HTTPS
monitor with Host: status.renner.uno); this moves it into git.

- Identity is the load balancer hostname; pool and monitor are found via
  its references. Hand-made objects are adopted (the account allows only
  2 origins, so a parallel pool would be rejected) and tagged in their
  description; objects with another owner's tag are never written.
- Status shows per-origin health; resync every 2 minutes.
- Token from OpenBao homelab/infrastructure/k8s-cloudflare-lb via
  ExternalSecret; egress limited to api.cloudflare.com:443.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:46:01 +02:00
k.renner 5f2c02306b Merge pull request 'fix(wordpress): move to PHP 8.5.12 for PHP2Shell' (#1422) from fix/wordpress-php85-php2shell into main
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
Reviewed-on: #1422
2026-10-22 10:00:11 +00:00
k.renner e367fc1c85 Merge pull request 'feat(ansible): update-os play + pipeline for host package upgrades' (#1421) from feat/update-os into main
Reviewed-on: #1421
2026-10-22 09:59:12 +00:00
claude-botandClaude Opus 5.5 bbeaf622ed fix(wordpress): move to PHP 8.5.12 for PHP2Shell
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
CVE-2026-109618 and CVE-2026-109619 (BSI BITS-H 2026-297981-1132) allow
unauthenticated RCE on every PHP before 8.5.12/8.4.27/8.3.36/8.2.35;
mod_php is the highest-risk variant. The running pod reports PHP 8.3.35
and www.renner.uno serves / to the internet without the Authentik gate.

Switch to the php8.5-apache variant of the same WordPress release,
pinned to the index digest rebuilt on 2026-10-22 after the PHP fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 11:57:02 +02:00
claude-botandClaude Opus 5.5 9439e0d58c fix(os-update): reboot when the booted kernel is no longer installed
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/deployment/update-os Pipeline was successful
Review #1811: on Arch the reboot only fired when this run's pacman task
changed something, while the post-reboot check looks at host state. A
host whose newer kernel was installed by an interrupted earlier run (or
by hand) skipped the reboot, failed the kernel check and stopped the
whole run. The play now also reboots when /usr/lib/modules/$(uname -r)
is gone before the reboot step.

Also from the review:
- assert >= 1 GiB free on / before upgrading (edge-1 runs from a
  6.6 GiB eMMC root, 2.1 GiB free on 2026-10-22)
- play comment names the groups it covers instead of 'every host'
- pipeline comment points at the README 02:00-05:00 window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 11:55:18 +02:00
k.renner 919e7b9208 Merge pull request 'chore(talos): move to v1.13.12 (CVE-2026-99999)' (#1420) from chore/talos-1.13.12 into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1420
2026-10-22 08:08:30 +00:00
claude-botandClaude Opus 5.5 92615c0402 feat(ansible): add update-os play and pipeline for host package upgrades
ci/woodpecker/pr/ci-manifests-test Pipeline is running
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
Since 52899ecb (#625) removed plays/update.yml and the update-all
pipeline together with the Proxmox fleet, nothing upgrades the remaining
Ansible hosts. proxy-1/2 and edge-1 (Arch) and netbird (Ubuntu) all run
kernels affected by CVE-2026-99999.

os-update role, per host:
- records failed systemd units and running docker containers
- Arch: archlinux-keyring first, then pacman -Syu
- Debian/Ubuntu: apt full-upgrade + autoremove
- reboots when pacman changed something / reboot-required is set
- asserts the running kernel is the installed one (Arch) or no reboot
  is pending (Debian)
- waits until every previously running container is back and no new
  failed units appear

update-os.yml runs netbird_proxy, then edge_host, then netbird_server,
serial: 1 with max_fail_percentage: 0, so the first failing host stops
the whole run before the next host is touched.

The pipeline is deployment-only (target update-os): edge-1 is the sole
NTP server and carries Z-Wave and the heating CAN bus, and netbird is
the control plane; neither may reboot on a cron.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:04:28 +02:00
claude-botandClaude Opus 5.5 704e3d44b7 chore(talos): move to v1.13.12
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Fixes CVE-2026-99999 (ipv4: validate checksum_start before completing
checksum, CVSS 9.3). The nodes run 6.18.48-talos; the fix is in 6.18.57,
which v1.13.12 ships (siderolabs/pkgs@19e92dc).

Not applied to any node yet. Rollout is one node at a time: drain,
talosctl upgrade --image, wait for Ceph HEALTH_OK, starting with k8s-1.

Patch release within 1.13; Kubernetes stays v1.36.3. Schematic is
unchanged; factory installer manifest and ISO verified to exist for the
tag. talosctl checksum taken from the release's sha256sum.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 09:54:26 +02:00
hermes-bot 08004a508a Merge remote-tracking branch 'origin/main' into fix/gitea-webhook-sync-org-scope
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
# Conflicts:
#	kubernetes/apps/hermes/skills/gitea-issues/SKILL.md
2026-10-22 06:01:33 +00:00
security-bot 1912e6b4a0 chore(image-automation): bump apache/tika:3.3.3.0
Updates managed by image-automation-controller.
2026-10-21 20:45:23 +00:00
security-bot 4d51d99d9e chore(image-automation): bump ghcr.io/immich-app/immich-machine-learning:v3.3.5
Updates managed by image-automation-controller.
2026-10-21 18:52:03 +00:00
security-bot 2ddc736f7e chore(image-automation): bump ghcr.io/immich-app/immich-server:v3.3.5
Updates managed by image-automation-controller.
2026-10-21 18:46:24 +00:00
k.renner 02044f0e4b Merge pull request 'fix(kuma): retry MCB Website 3x at 20s before DOWN' (#1418) from atlas/kuma-mcb-www-retries into main
Reviewed-on: #1418
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-21 12:20:08 +00:00
hermes-bot eed77ecb9a fix(kuma): retry mcb-www three times at 20s before DOWN
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
www.multi-circuit-boards.eu (third-party Apache) occasionally resets a
single TLS handshake with ECONNRESET. Kuma 2.5.6 opens a fresh
connection for every check, so two such resets in a row were enough
for DOWN with retryInterval 60 / maxRetries 1: 14 false episodes since
2026-10-20 21:51 UTC. A 30-min probe from the cluster (559 requests at
3s) saw 557x 200 and 2 handshake resets, and got 200 during Kuma's
DOWN window.

With retryInterval 20 (CRD minimum) and maxRetries 3, DOWN now takes 4
failures in a row over at least 60s, so a real outage longer than
about 1 min still alerts. The other third-party monitors are left
unchanged.

Refs #1407
2026-10-21 11:55:05 +00:00
k.renner c7935b918e Merge pull request 'feat(traefik): move the chart to 42.x, access log on the 41+ schema' (#1411) from atlas/traefik-chart-42 into main
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
Reviewed-on: #1411
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-21 10:48:08 +00:00
security-bot a27af28e2f chore(image-automation): bump gitea.renner.uno/gitea_admin/secret-rotator:2026-10-21
Updates managed by image-automation-controller.
2026-10-21 10:18:44 +00:00
k.renner 70d27f3cdf Merge pull request 'fix(secret-rotator): keep the replaced HA token until the next rotation (#1081, #1084)' (#1414) from alert-fix/issue-1081-rotator into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1414
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-21 10:18:12 +00:00
k.renner 5aed1f5690 Merge pull request 'feat(monitoring): alert when k8s-gateway stops answering renner.uno Ingress names' (#1415) from fix/monitoring-k8s-gateway-probe into main
Reviewed-on: #1415
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-21 10:17:52 +00:00
k.renner 09d1b3d951 Merge pull request 'chore(ci): bump ci-claude image to 2.1.306' (#1416) from ci-image/claude-2.1.306 into main
Reviewed-on: #1416
2026-10-21 10:17:05 +00:00
k.renner 07e2c98a16 Merge pull request 'feat(hermes): route Gitea PR reviews back to the expert's card' (#1417) from feat/hermes-gitea-pr-review-loop into main
Reviewed-on: #1417
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-21 10:16:55 +00:00
hermes-bot cee1011fbc fix(hermes): review loop follows up review-bot 1803
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
- predates() also guards approvals: an approval older than the card the PR
  line names now (e.g. a follow-up whose expert rebutted without a push)
  no longer completes that card on replay.
- predates() parses created_at as epoch or RFC 3339 and fails loudly when a
  card has none (hermes kanban show --json gives epoch seconds, v0.22.2,
  checked against the CLI), instead of silently never skipping.
- Closing one PR does not complete a card another open PR (stacked stage)
  still names.
- Follow-up cards tell the worker to read every review and comment since the
  previous card: only the newest finding is quoted, older ones that predate
  the card are not added (deliberate, now pinned by a test).
2026-10-21 08:59:58 +00:00
hermes-bot 679d1408e6 fix(hermes): review loop ignores findings handled before the line moved
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
review-bot 1802 on #1417 (blocking): marker dedupe was per card, but the PR's
Hermes-Card line moves (follow-up card, coordinator hand-off, gitea_pr.py
adopt), so a replay re-sent findings already handled on the earlier card to
the new one. A finding older than the card the line names now is skipped
(review submitted_at / comment created_at vs the card's created_at); the new
card's worker reads the PR itself.

Also from the review:
- PR merged or closed while its card is in review completes the card
  (hook event pull_request_only, route event pull_request, closed hermes-bot
  PRs of the replay window are replayed); a rebuttal without push otherwise
  left the card in review forever once the owner merged.
- 404 on the PR (system hook fires for repos hermes-bot cannot read) is a
  skip, not an error line per review.
- One route-script run per PR at a time (flock): a delivery and its replay
  can overlap.
- find_review drops dismissed reviews like the replay does.
- Replay checks the run budget before listing; CronJob comment updated.
- Skill: stun-tls-probe.py runs via python3 (ConfigMap mode 0644); rebuttal
  wording says the card waits for the owner.
2026-10-21 08:51:38 +00:00
hermes-bot f77e997dfb feat(hermes): route Gitea PR reviews back to the expert's card
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Experts closed their card with kanban_complete as soon as the PR was open, and
nothing listened to Gitea reviews afterwards (#1412/#1414 REQUEST_CHANGES and
the review-bot suggestions on #1411/#1415 sat unanswered).

Owner decision: the card stays in review until the Gitea review is through; no
follow-up cards for a card that is still open.

- Herkunft: expert PRs carry `Hermes-Card: <card> (<profile>)`. The new helper
  homelab-gitea-pr/scripts/gitea_pr.py sets it deterministically (open/adopt)
  and refuses a second PR for the same branch or `Closes #N` (find/open).
  The card id comes from --card, $HERMES_KANBAN_TASK or the scratch workspace
  name: the terminal tool does not pass HERMES_KANBAN_TASK to commands.
- Events: the system hook adds pull_request_review and pull_request_comment
  (Gitea 1.27.3 routers/api/v1/utils/hook.go; HasEvent maps the approved/
  rejected/comment review types onto pull_request_review). Headers per
  modules/webhook/type.go Event(): pull_request_approved/_rejected/_comment
  for reviews, issue_comment for PR comments; the route lists exactly those.
- Routing in gitea_issues.py (no LLM, [SILENT], HMAC by the gateway as before):
  the review payload carries no review id or commit, so the script reads the
  reviews API and ignores reviews of an older head.
  review-bot APPROVED on the head + card in review -> hermes kanban complete.
  review-bot REQUEST_CHANGES/COMMENT, owner reviews with text, owner PR
  comments -> card in review: hermes kanban reopen-review (back to the
  implementer from review_requested, review quoted as untrusted text); card
  open: comment; card done/missing: follow-up card for the same expert
  (key <owner>/<repo>!<n>@after-<card>, needed because Hermes has no CLI to
  reopen a done card) and the PR's line moves to it; PR without a line:
  coordinator card (key ...@review). A marker per review/comment id makes
  every replay a no-op.
  `hermes kanban request-changes` is not usable here: it needs an active
  reviewer run claimed from review, which only exists with review dispatch.
- kanban.review_dispatch=false on default (Hermes docs: "Set false for
  human-only review boards"); otherwise every card in review would spawn an
  sdlc-review LLM run next to review-bot.
- Replay step in gitea-webhook-sync: review-bot's latest review and owner
  reviews of each open hermes-bot PR's head plus owner PR comments (48 h) are
  re-delivered every 15 min. review-bot can approve before the expert calls
  kanban_request_review; without the replay that card would stay in review.
- homelab-gitea-pr moves from the coordinator's PVC into git (experts never
  had it): review-loop section, one-PR-per-cause rule, the helper. SOUL.md and
  the bridge's card text say: PR cards end with kanban_request_review.
2026-10-21 08:39:45 +00:00
hermes-bot 885e4d723e docs(traefik): name the 41.0.0 break that forced the accessLog move
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
Addresses the nit in review-bot review 1795 on 75401220.
2026-10-21 08:28:58 +00:00
hermes-bot aebf78b79a fix(monitoring): k8s-gateway dead-man's switch per record, triage hints
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Addresses review-bot review 1792 on a1b52f5b:
- K8sGatewayProbesAbsent now fires per record (A, AAAA), so one broken
  module no longer hides behind the other's series. New promtool case
  (AAAA-only input) and mutation k8s-gateway-absent-aaaa-dropped.
- K8sGatewayIngressAnswerWrong description names the other cause: the
  auth.renner.uno Ingress (authentik) being gone.
- The Traefik lb-ipam-ips annotation points back at the blackbox modules
  that match the same VIP.
2026-10-21 08:28:36 +00:00
hermes-bot 3445ce7013 Merge remote-tracking branch 'origin/main' into alert-fix/issue-1081-rotator
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Picks up main after #1412 was closed as superseded by this PR.
2026-10-21 08:21:47 +00:00
security-bot 9455d79130 chore(image-automation): bump gitea.renner.uno/gitea_admin/ci-backup-verify:2026-10-21
Updates managed by image-automation-controller.
2026-10-21 08:15:20 +00:00
security-bot 2a60ae3c1b chore(image-automation): bump gitea.renner.uno/gitea_admin/kuma-sync:2026-10-21-0756
Updates managed by image-automation-controller.
2026-10-21 08:15:19 +00:00
security-bot 03ce76eaba chore(image-automation): bump gitea.renner.uno/gitea_admin/review-bot:2026-10-21-0752
Updates managed by image-automation-controller.
2026-10-21 08:15:17 +00:00
security-bot 973a4245d3 chore(image-automation): bump gitea.renner.uno/gitea_admin/authentik-gate-sync:2026-10-21-0755
Updates managed by image-automation-controller.
2026-10-21 08:15:14 +00:00
security-bot 9cea229587 chore(image-automation): bump gitea.renner.uno/konairius/hermes:build.1792569647
Updates managed by image-automation-controller.
2026-10-21 08:05:16 +00:00
hermes-bot 6f1a7b6d96 fix(secret-rotator): never fail the HA run after the store; stage the image rollout
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Folds the good parts of #1412 into this PR and addresses both review-bot
reviews (#1412 review 1789, #1414 review 1791):

- Everything after the OpenBao store is best-effort. Decode, reconnect,
  listing and revokes run in reap_superseded(); reap_summary() turns any
  error into "reap skipped" plus a warning, so rotate_ha_token returns Ok.
  A failed run would start a second pod (backoffLimit: 1) that keeps the
  token just stored and its successor and reaps the token consumers still
  hold until ESO syncs, i.e. the #1081 outage. Two unit tests cover it.
- Warn when the replaced token is not named "<client_name> [<6 hex>]":
  no later run reaps it, so it needs a manual revoke (from #1412).
- Staged image rollout (from #1412): only the three HA CronJobs carry the
  flux-system:secret-rotator marker; the other 17 rotators stay on
  2026-07-30 until a manual HA run validates the new binary, then a
  follow-up adds the marker to them. rotation/kustomization.yaml records
  the exception.
- Merged current main (a6f37e2b, 1691a0ac): the Reloader annotations for
  zone-configurator and speech-to-phrase are already there via #1409.
2026-10-21 07:59:52 +00:00
hermes-bot 754012208c docs(traefik): say why the chart range has no ceiling
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
review-bot (review 1787) noted the old explanatory comment was dropped without replacement. The range stays open-ended: the homelab rule is to never pin a Helm chart version, Traefik follows current upstream.
2026-10-21 07:58:59 +00:00
hermes-bot 71fe053af1 Merge remote-tracking branch 'origin/main' into work 2026-10-21 07:58:35 +00:00
claude-bot 4403261c2f chore(ci): bump ci-claude image to 2.1.306
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
2026-10-21 07:53:34 +00:00
hermes-bot 3d3510b7bd fix(hermes): list hermes-bot's orgs via the admin route the PAT's scopes cover
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
review-bot: /users/{u}/orgs requires the user and organization scope
categories (Gitea 1.27.3 api.go, HasScope needs all), and the sync's PAT
has write:admin,write:organization,write:issue,read:repository, no
read:user. /admin/users/{u}/orgs needs only the admin category and lists
private orgs for a site admin.

Also: drop paged()'s dead /repos/search unwrapping, test the team-mode
fallback of team_writes_issues, and say in SKILL.md that direct-collaborator
and user repos still get cards via the system hook.
2026-10-21 07:47:13 +00:00
hermes-bot a1b52f5b1b feat(monitoring): alert when k8s-gateway stops answering renner.uno Ingress names
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
From 2026-10-08 to 2026-10-16 k8s-gateway ran the chart's default Corefile
(zone example.com, forward . /etc/resolv.conf). Pods stayed Ready, every
renner.uno lookup was forwarded to the UDM and still answered (public names as
CNAME proxy.renner.uno), and nothing alerted. probes-dns.yaml only asks the UDM.

Two blackbox DNS modules ask the k8s-gateway Service (by name, not IP) for
auth.renner.uno A over IPv4 (the path CoreDNS forwards on, 10.96.0.11) and
AAAA over IPv6, and fail unless every answer RR is the Traefik VIP
(10.2.99.86 / fd99::86). A forwarded answer — CNAME or any other address —
fails. CoreDNS is bypassed on purpose: its renner.uno block serves stale for 1h.

K8sGatewayIngressAnswerWrong (critical) fires when the 10m success average is
under 0.8 for 5m: about 7m after a total failure starts, and also when one of
the two replicas is broken (average ~0.5), where a `for` on the raw value would
keep resetting. One or two failed probes stay silent. K8sGatewayProbesAbsent is
the dead-man's switch.

Verified: the module config was run with blackbox_exporter 0.29.0 against the
live cluster resolver (which relays k8s-gateway's answer): A and AAAA succeed;
a k8s-gateway-forwarded name (ha.renner.uno, 10.2.99.87) and a wildcard name
(CNAME proxy.renner.uno) fail. promtool-rules.sh with promtool 3.15.0: 9 suites
green, 41 mutations caught (4 new).

Closes #1290
2026-10-21 07:45:53 +00:00
k.renner 1691a0ac3c Merge pull request 'feat(flux): upgrade components to v2.9.6' (#1410) from atlas/flux-2.9.6 into main
Reviewed-on: #1410
2026-10-21 07:44:09 +00:00
k.renner a6f37e2b68 Merge pull request 'fix(zone-configurator,speech-to-phrase): restart on HA prometheus-token rotation (#1082)' (#1409) from alert-fix/issue-1082 into main
ci/woodpecker/push/ci-claude-refresh Pipeline was successful
ci/woodpecker/push/deploy-claude-workstation Pipeline failed
ci/woodpecker/push/deploy-edge-mqtt-bridge Pipeline was successful
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
ci/woodpecker/push/deploy-netbird-client Pipeline failed
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/push/deploy-netbird-server Pipeline was successful
ci/woodpecker/push/deploy-uptime-kuma Pipeline was successful
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/push/hermes-image Pipeline was successful
Reviewed-on: #1409
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-21 07:42:13 +00:00
hermes-bot 0fd90e07e2 fix(secret-rotator): keep the replaced HA token until the next rotation
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ha-token mode revoked the outgoing LLAT seconds after storing the new one in
OpenBao. Consumers read the k8s Secret, which ESO syncs every 1h, so on
2026-10-01 the ServiceMonitor scrape got 401 from 02:00 to ~02:36Z
(HomeAssistantDown, TargetDown) and zone-configurator crashlooped (#1081,
#1082, #1084).

The reap now keeps the token just stored and the one it replaced, and
revokes only rotator-minted tokens (exact "<client_name> [6 hex]") other
than those two, the same keep-two rule gitea-token mode got in 59e804d9.
The replaced token is revoked by the following quarterly run.

The binary only reaches the CronJobs through a new image, and every
rotator was hand-pinned to secret-rotator:2026-07-30. Enrol the image in
Flux image automation (dated-tag policy, as for ci-backup-verify) and mark
all 20 rotator image lines, so they move together to the newest built tag.
Source between 2026-07-30 and this commit differs only by the Rust 1.91 ->
1.99 build image (68c09786).

Closes #1081
2026-10-21 07:41:16 +00:00
hermes-bot bd9f0cb18d fix(hermes): gitea-webhook-sync covers every konairius repo via team membership
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
The sync reached only konairius/homelab ("repos: 1 with issues writable by
hermes-bot") although hermes-bot has write on all 10 org repos through the
org team Bots (includes_all_repositories, repo.issues write).

Cause: GET /repos/{o}/{r}/collaborators/{user}/permission (Gitea 1.27.3
GetRepoPermissions) returns permission.AccessMode, the repo-wide mode from
the collaborator/access level. Rights from a unit-based team land only in
the per-unit modes and are not part of that field, so it said "none" for
the 9 repos where hermes-bot is not a direct collaborator (checked live:
homelab "write", shelly-manager and ical-proxy "none", while
/orgs/konairius/repos reports push: true for all 10).

Scope is now derived from org membership: orgs of hermes-bot
(/users/hermes-bot/orgs) -> teams granting repo.issues write that it is a
member of -> all org repos (includes_all_repositories) or the team's repos,
non-archived with issues on. User-owned repos are out of scope, so labels
are org labels only and the repo-label branch is gone.

Tests: team scope, read-only team skipped, selected-repo team, user repos
out of scope, failed team lookups, org-labels-only. Live read-only probe
with hermes-bot's token: 10 repos, label target konairius.
2026-10-21 07:40:33 +00:00
hermes-bot 12c5b30286 feat(traefik): move the chart to 42.x, access log on the 41+ schema
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Chart 41.0.0 renamed `logs.access` to `accessLog` and its values schema
rejects the old root `logs` key; that is why 399f101b capped the range
below 41.0.0. Moving `logs.access.enabled` to `accessLog.enabled` makes
our values valid on the current line, so the cap goes.

Verified with helm v4.3.1 against the published charts, values taken
from this HelmRelease, --kube-version 1.36.3:
- 42.0.0 with the old values fails exactly as in June
  ("additional properties 'logs' not allowed").
- 42.1.0 with these values renders the same manifests as the running
  40.3.0, apart from chart/version labels and the image
  (traefik v3.7.4 -> v3.7.15). The access-log args are unchanged
  (--accesslog=true, fields defaultmode keep, headers drop), so the
  CrowdSec agents parsing Traefik logs see the same format.
- Chart CRDs: same 25 CRDs; additive schema changes and controller-gen
  0.17.1 -> 0.21.0 annotations.

Other breaking notes for 41/42 do not apply here: providers.file.content
is not set; 42.0 requires Kubernetes >= 1.30 (cluster runs 1.36.3);
the Hub secret RBAC and transparency-log witness changes only apply
with hub.token, which is not set.

The range is now open-ended (>=42.0.0), per the house rule not to pin
chart versions; note the wiki's floating-helm-chart-constraint-risk
recommends tilde ranges instead, so the owner should confirm the shape.

Refs #426
2026-10-21 07:35:25 +00:00
hermes-bot 947200e081 feat(flux): upgrade components to v2.9.6
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
Regenerated with `flux install --export
--components-extra=image-reflector-controller,image-automation-controller`
from the v2.9.6 CLI (release tarball, sha256 checked against
flux_2.9.6_checksums.txt); the same component set as before.

Controllers: source v1.9.5 -> v1.9.6, kustomize v1.9.5 -> v1.9.6, helm
v1.6.4 -> v1.6.5. notification, image-reflector and image-automation
are unchanged. No CRD, RBAC or NetworkPolicy changes: the diff is the
three images and their app.kubernetes.io/version labels.

`flux check --pre` (v2.9.6 CLI) passes on Kubernetes 1.36.3.

Flux core: merge only 02:00-05:00 Europe/Berlin.

Refs #426
2026-10-21 07:34:24 +00:00
hermes-bot c0a3d2e974 fix(zone-configurator,speech-to-phrase): shorten the Reloader annotation comments to one line
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
2026-10-21 07:33:45 +00:00
hermes-bot 38fa4e9df9 Merge remote-tracking branch 'origin/main' into alert-fix/issue-1082 2026-10-21 07:33:33 +00:00
k.renner 2dbd53fb29 Merge pull request 'feat(hermes): Gitea issues become kanban cards; alert issues end to end, issue-fix retired' (#1408) from feat/hermes-gitea-issues-kanban into main
Reviewed-on: #1408
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-21 07:24:45 +00:00
hermes-bot 3aa78c1d0f fix(hermes): put the expert-card guard above the quoted issue text
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
review-bot on 5de84e94: the guard sat after up to 20000 characters of untrusted
issue text. render() now takes a head block placed right after the title line;
Gitea-Issue: stays the last line.

Also checked (Gitea release/v1.27 routers/api/v1/repo/collaborators.go,
GetRepoPermissions; the API docs only list 200/403/404): for a site-admin caller
it answers 200 with the access mode (none for a non-collaborator), 404 only for an
unknown user, so repos hermes-bot cannot see are filtered, not failed.
2026-10-21 06:36:55 +00:00
hermes-bot 5de84e9471 fix(hermes): guard the hand-over claim window; skip repos whose permission lookup fails
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
review-bot on b6179a41:
- Expert card bodies open with "This card is for the <expert> expert. If you are
  not <expert>, do no work on it": a coordinator that claims the card between the
  body edit and the reassign completes it instead of running the alert protocol
  next to the separate @expert card.
- issue_repos skips (and names) a repo whose hermes-bot permission lookup fails
  instead of aborting; the other repos still get labels and backfill, the Job
  still fails.
2026-10-21 06:30:10 +00:00
hermes-bot b6179a418a fix(hermes): keep the Gitea admin PAT out of the agent's OpenBao reach; safer hand-over
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
review-bot on de080442:
- The site-admin PAT moves from apps/hermes/gitea-admin (readable by the agent's
  `hermes` role, homelab/data/apps/hermes/*) to apps/gitea-webhook-sync/admin.
  Only ESO reads it (eso role, existing ClusterSecretStore); `bao token
  capabilities` with the hermes role: deny on the new path. ExternalSecret and
  K8s Secret are now gitea-webhook-sync-admin, mounted only by the CronJob.
- Hand-over writes the expert body before reassigning. If the coordinator claims
  the card in between, its routing body is restored and the expert gets the
  separate @expert card; if the edit fails, nothing is reassigned. Tests for both.
- [alert] cards: a comment is the owner's only by its API user.login (k.renner,
  the login issue-fix trusted and the one commenting on homelab issues), never by
  a name or quote in the text.
- Labels and backfill only in repos where hermes-bot has issue write (per
  /collaborators/hermes-bot/permission), org labels only for orgs owning such a
  repo; gitea_admin/_cargo-index (hermes-bot: read) no longer gets labels.
- Backfill starts no replay after RUN_BUDGET_SECONDS (900); activeDeadlineSeconds
  1200 covers that plus one 60 s delivery; a test pins the relation.

Verified live: Gitea 1.27.3 swagger says IssueLabelsOption.labels takes IDs or
names, so the coordinator's {"labels": ["<expert>"]} works; hermes-bot has
write on konairius/homelab.
2026-10-21 06:23:36 +00:00
hermes-bot de080442d3 feat(hermes): alert issues end to end: labelled at filing, routed, fixed by the expert card; retire issue-fix
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The owner wants the path alert -> [alert] issue -> kanban card -> expert fix PR
-> owner merges, without a human step in between. Owner decisions (kanban card
t_3f5d0a62): [alert] issues are not excluded from the bridge, and the issue-fix
Woodpecker pipeline is retired, so the expert's card is the only automated fix
path for [alert] issues.

Routing
- alert-monitor: `alerts.py file` takes a required `--label` (hestia, atlas,
  apollo, clio, daedalus) and sets that label at creation (POST /issues
  `labels: [id]`). Gitea 1.27.3 adds the labels in the same transaction
  (services/issue/issue.go NewIssue) and the `opened` webhook payload loads them
  (services/convert/issue.go toIssue -> LoadLabels), so the first delivery
  already routes the card to the expert. Org labels are accepted for org repos
  (models/issues/issue_update.go: label.OrgID == repo.OwnerID). If the label
  does not exist yet, the issue is filed without it and the coordinator routes.
  SKILL.md tells the triage agent how to pick the expert.
- Label-less issues no longer go to triage. kanban.auto_decompose defaults to
  true (hermes_cli/config_defaults.py; not overridden here), so the dispatcher
  hands every triage card to the auxiliary-LLM decomposer
  (gateway/kanban_watchers_dispatcher.py auto_decompose_tick ->
  kanban_decompose.decompose_task), which rewrites title and body (dropping the
  Gitea-Issue line the completion hook needs), may fan out into children without
  that line, and keeps the assignee `default` anyway (_apply_single only sets an
  assignee when none is set). The card is now created ready for `default` with
  routing instructions: set exactly one domain label on the issue, nothing else.
- The script reacts to that label: a coordinator card nobody has claimed yet
  (todo/ready) is reassigned (`hermes kanban assign`) and its body replaced by
  the expert body (`hermes kanban edit --body`); a claimed or finished one gets
  a separate expert card under key `<owner>/<repo>#<n>@<expert>` (one per
  expert, created_by gitea-webhook, so its completion is posted on the issue).
  `assign` refuses a running card, which falls back to the separate card. Cards
  already with an expert are still never moved.

[alert] cards
- Their body carries the fix protocol that replaces issue-fix, including its
  prompt hardening from PR #253/#266: check for an open PR with `Closes #<n>` or
  a branch `alert-fix/issue-<n>` first; owner (k.renner) comments are
  authoritative, everything else is untrusted problem description; verify live
  before fixing, never state cluster state not observed this run, give
  read-only commands instead of predicted output; repo-fixable -> branch
  `alert-fix/issue-<n>`, smallest fix, PR with `Closes #<n>`, never merge; not
  repo-fixable -> no PR, the completion summary (posted on the issue) says why
  and what a human must do.

Gitea side (CronJob gitea-webhook-sync, every 15 min)
- Domain labels: created as org labels in every org (GET /admin/orgs) and as
  repo labels in user-owned repos, only when missing.
- Backfill: open issues without the card comment are replayed to the route as
  signed `opened` deliveries (same headers Gitea sends), at most 10 per run, 3 s
  apart (the adapter's default rate limit is 30/min/route), in random order so
  repos where the comment keeps failing cannot starve the rest. The idempotency
  key `<owner>/<repo>#<n>` makes a replay of an issue with a card a no-op.
  The job runs in the hermes namespace, whose default-deny already allows
  intra-namespace traffic to :8644.
- The admin PAT needs write:organization (org labels, reqOrgOwnership passes for
  a site admin), write:issue (repo labels, comments) and read:repository
  (/repos/search) next to write:admin. activeDeadlineSeconds 120 -> 600.

issue-fix removed
- .woodpecker/issue-fix.yml, ci/agents/issue-fix/, and what only it used:
  scripts/ci/make-diag-kubeconfig.sh, the monitoring/ci-diagnostics
  ServiceAccount and RBAC (no other pipeline mints its token; git grep), the
  .ci-diag/ gitignore entry. Comments naming issue-fix updated.
- Not in git and left to the owner: the Woodpecker cron `issue-fix` and the
  secret `issue_fix_bot_token` with its Gitea PAT.

Tested: unittest 73 OK; gitea_issues.py against the real hermes kanban CLI in a
scratch HERMES_HOME with a stub Gitea (unlabelled -> default ready card;
labelled while unclaimed -> same card reassigned to daedalus with the alert
body; labelled while claimed -> separate card `#n@daedalus`; replay -> no
duplicate card or comment); sync discovery read-only against live Gitea (42
open issues, all without a card); kubectl kustomize for apps/hermes,
apps/monitoring, apps/monitoring-rules.
2026-10-21 05:48:01 +00:00
hermes-bot 82f5b3e95d feat(hermes): Gitea issues become kanban cards
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Every open issue on gitea.renner.uno lands on the Hermes kanban board without a
manual step (owner decision: all issues, no opt-in label). Exactly one label out
of hestia/atlas/apollo/clio/daedalus assigns the card to that expert; anything
else goes to the coordinator (default) in triage.

Inbound, event-driven through upstream Hermes features only (webhook platform,
route script, kanban CLI; nothing forked or patched):

- A Gitea system webhook (events issues_only + issue_label) posts to
  hermes.hermes.svc.cluster.local:8644/webhooks/gitea-issues. Gitea signs with
  X-Hub-Signature-256 and sends X-GitHub-Event: issues, which the Hermes webhook
  adapter validates as GitHub-style HMAC.
- Route gitea-issues runs skills/gitea-issues/scripts/gitea_issues.py as its
  route script. The script creates the card itself with
  `hermes kanban create --idempotency-key <owner>/<repo>#<number>
  --created-by gitea-webhook` and answers [SILENT], so no agent run and no LLM
  call happens. Edits and label changes reuse the existing card (no duplicate,
  no reassignment). The issue text is quoted into the card body as untrusted
  input; the card ends with a `Gitea-Issue: <url>` line.
- It then comments the card id on the issue once (marker comment, so retries
  and later events do not repeat it).

Back channel: a kanban_task_completed shell hook (config `hooks:` on default and
all five experts) runs the same script in `completed` mode and posts the
completion summary on the issue. Dispatcher-spawned workers run with
--accept-hooks; the gateway (dashboard completions) gets an allowlist entry in
each profile's shell-hooks-allowlist.json. The issue is not closed
automatically: a finished card is not proof the issue is resolved (the work may
sit in an unmerged PR), so closing stays with the owner or an explicit ask.

Gitea side, declarative: CronJob gitea-webhook-sync (hermes ns, every 15 min,
hermes image, scripts/sync_webhook.py) keeps the system hook in place through
the admin API. Gitea 1.27.3 facts it relies on (routers/api/v1/utils/hook.go):
POST /admin/hooks creates a *default* (template) hook unless
config.is_system_webhook is "true", and PATCH ignores config.secret. So the
hook is named hermes-kanban-<hash of url, events, secret>; when no active hook
has the desired name, a new one is created first and older hermes-kanban* hooks
are deleted afterwards. Other system hooks (review-bot) are never touched.

Secrets (OpenBao, apps/hermes only, bootstrap commands in
gitea-webhook-externalsecret.yaml):
- apps/hermes/gitea-webhook#secret: HMAC secret, read by the gateway (written
  to /opt/data/.env as WEBHOOK_SECRET by default-env, which also sets
  WEBHOOK_ENABLED only when the secret exists) and by the sync job.
- apps/hermes/gitea-admin#api-token: site-admin PAT (write:admin; Gitea has no
  narrower scope for system hooks), mounted only into the sync job.
The Deployment carries a Reloader annotation for hermes-gitea-webhook, so the
first sync of the secret (and a rotation) restarts the gateway with it.

Network: Service port webhook 8644, CNP hermes-allow-gitea (ingress from the
gitea pod on 8644), egress rule in gitea's default-deny, and
hermes.hermes.svc.cluster.local in GITEA__security__ALLOWED_HOST_LIST.

Tested offline: tests/test_gitea_issues.py (routing, card shape, marker
spoofing, comment dedup, completion, sync create/no-op/replace). Against the
real Hermes code in a scratch HERMES_HOME with a stub Gitea API: WebhookAdapter
accepted a Gitea-style signed POST (200, script), rejected a bad signature
(401), ignored a pull_request event; repeated issue events produced one card;
the init-container logic set the route, hooks and allowlist (`hooks list`:
allowed); kanban_db.complete_task after register_from_config fired the hook and
posted the summary.
2026-10-21 05:29:09 +00:00
security-bot 0a4ef9deae chore(image-automation): bump lscr.io/linuxserver/lidarr:3.1.0.4875-ls45
ci/woodpecker/cron/issue-fix Pipeline was successful
Updates managed by image-automation-controller.
2026-10-21 00:12:50 +00:00
k.renner 0c7e0c0485 Merge pull request 'fix(hermes): write default's platform credentials to .env (Matrix/API down since #1405)' (#1406) from fix/hermes-multiplex-env into main
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: #1406
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-20 20:51:08 +00:00
claude-bot a955cb9f9d fix(hermes): write default's platform credentials to .env (Matrix/API down since #1405)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Since #1405 the pod has six profiles, so the gateway multiplexes
(gateway.multiplex_profiles is written true on boot). In that mode every
profile, default included, reads its platform credentials only from its
own secret scope (/opt/data/.env plus secret sources), never from the pod
environment. After the #1405 rollout the gateway logged "matrix is enabled
but no profile ... provided a bot credential" and started neither Matrix
nor the API server (API_SERVER_KEY is not a global env var). The
GATEWAY_MULTIPLEX_PROFILES=false override does not avoid this: tested in
build.1792397861 with five profiles present, the API server still stays
down.

New init container `default-env` writes API_SERVER_KEY, the MATRIX_*
settings, MATRIX_ACCESS_TOKEN and HA_TOKEN into /opt/data/.env on every
start, through Hermes's own writer (hermes_cli.config.save_env_value
replaces an existing line in place and keeps the 0600 mode). A key whose
source is gone (for example the optional hermes-homeassistant Secret) is
removed from .env with remove_env_value, so a revoked token does not
linger. HA_TOKEN is written too, so default's ${HA_TOKEN} MCP header
resolves in its own scope.

Unlike the other init containers this one is fatal: if a Hermes bump
moves the writer, the pod should fail visibly (HermesDown) rather than
come up Ready with Matrix and the API server silently down.

The plain MATRIX_* settings move into a generated ConfigMap,
hermes-matrix-config, used by envFrom in both containers, so they exist
once. The hermes container keeps its env otherwise unchanged: s6 stage2
checks API_SERVER_KEY there, and expert kanban workers resolve HA_TOKEN
from it. A new profile does not copy the root .env (checked:
`hermes profile create` with credentials in the root .env leaves the new
profile's .env without them), so experts still get no platform
credentials.

Trade-off: these credentials now also sit in the PVC's .env (0600, next
to the keys entered in the dashboard) and in any PVC backup. The same uid
can already read them from the gateway's /proc/<pid>/environ, so this is
no new boundary, but the file is easier to stumble into.

Verified locally in build.1792397861 on a volume with extra profiles and
gateway.multiplex_profiles: true: the script exits 0 on repeated runs,
each key occurs once in .env, an unset HA_TOKEN is removed on the next
run, an unwritable HERMES_HOME exits 1, and the gateway then starts the API server
("API server listening on http://0.0.0.0:8642") and connects Matrix with
the token from .env (the test homeserver was unreachable on purpose).

After merge: check the gateway log for "matrix connected" and
"api_server connected", and that https://hermes-api.renner.uno answers.
2026-10-20 22:48:24 +02:00
k.renner 507bacc5fe Merge pull request 'feat(hermes): five domain experts as profiles, default hands them kanban cards' (#1405) from feat/hermes-experts into main
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: #1405
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-20 20:27:01 +00:00
claude-bot bb3cee8a3c feat(hermes): five domain experts as profiles, default hands them kanban cards
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Adds five expert profiles to the existing hermes pod, managed from git:
hestia (home automation), atlas (platform), apollo (media), clio
(documents and web), daedalus (dev and CI). Their main purpose is to be
used by the default profile, which acts as coordinator.

- experts/<name>.md: each expert's role and domain (apps, repos, domain
  rules). ConfigMap hermes-experts.
- New non-fatal init container `experts`: creates each profile once
  (`hermes profile create`), then on every start writes its SOUL.md
  (shared SOUL.md + role file), its description (the kanban routing hint),
  the Bot Mode title in profile.yaml (`ui_meta.hermes-bots`, which also
  enables message_agent in Bot Chats), skills.external_dirs, and links the
  hermes-bot tea login into the profile HOME (container profiles get
  HOME=<profile>/home), and copies default's Home Assistant MCP entry
  (#1404) into each expert, read from the root config.yaml so there is one
  source; ${HA_TOKEN} resolves from the pod env in expert workers,
  verified. It also enables the kanban toolset for
  default on matrix, cli and api_server.
- SOUL.md: the HA MCP server added to "What you can touch" (#1404 left
  it out; every profile now has it). "The team" section, shared by all profiles: the roster; the
  coordinator hands in-domain work out as self-contained kanban cards and
  relays the outcome; experts stay in their domain and finish with
  kanban_complete / kanban_block.

- README: the HA-impact reviewer stays the owner until the owner hands
  that review to the new `hestia` profile.

How it runs: the kanban dispatcher already runs inside the default gateway
and spawns `hermes -p <expert>` workers for cards. Experts have no
messaging platforms of their own (secondary profiles read platform
credentials only from their own .env), so nothing double-binds Matrix or
the API server. They use the root Anthropic OAuth login; refreshes are
written back to root.

Same access as default, by owner decision: read-only kubectl/talosctl/
bao, PRs as hermes-bot, Home Assistant through ha-updates and the HA MCP
server. HA MCP write tools stay behind trust: untrusted; kanban workers
run as `hermes chat -q`, where the trust gate never auto-accepts
(tools/approval_prompt.py request_elicitation_consent: single-query
sessions decline, gateway prompts nobody answers end as cancel). All
profiles share the pod and its mounted secrets, so this is not a
credential boundary.

Verified locally in the current image (build.1792397861) on a fresh
volume: the init script runs clean twice (idempotent) and produces the
profiles with the composed SOUL.md, title, description, external_dirs
and tea link; the gateway boots with all six profiles; a kanban card
assigned to hestia is claimed and spawned as a worker, and that worker
connects to its MCP server with ${HA_TOKEN} resolved from the env.

Trade-off: `hermes tools enable kanban --platform X` snapshots the current
default toolset list for that platform into config.yaml, so toolsets
Hermes adds by default later will not appear on matrix/cli/api_server
without another enable.

After merge: nothing manual. Check `hermes profile list` and the experts
init log in the new pod, then give default one domain question on Matrix.
2026-10-20 22:19:19 +02:00
security-bot ac44e7a1ff chore(image-automation): bump lscr.io/linuxserver/lidarr:3.1.0.4875-ls44
Updates managed by image-automation-controller.
2026-10-20 20:12:42 +00:00
security-bot 820ca25ea3 chore(image-automation): bump gitea.renner.uno/gitea_admin/kuma-sync:2026-10-20-1950
Updates managed by image-automation-controller.
2026-10-20 19:56:45 +00:00
k.renner 2007cbe7fd Merge pull request 'feat(hermes): add Home Assistant MCP server' (#1404) from feat/hermes-ha-mcp into main
Reviewed-on: #1404
2026-10-20 19:54:25 +00:00
k.renner 8332bfb166 Merge pull request 'feat(kuma-sync): declare the public status page in git' (#1403) from feat/kuma-status-page into main
ci/woodpecker/push/deploy-uptime-kuma Pipeline was successful
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1403
2026-10-20 19:49:51 +00:00
hermes-bot d9e47807bd feat(hermes): add Home Assistant MCP server
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Registers https://home.renner.uno/api/mcp as mcp_servers.homeassistant via
an init container (same pattern as the other config set steps), so the
entry is reapplied on every start instead of living only on the PVC.

Auth reuses Hermes's own HA admin token (apps/hermes/homeassistant, already
synced to hermes-homeassistant for ha-updates), exposed as HA_TOKEN and
referenced as ${HA_TOKEN} in the header; Hermes interpolates it at connect
time, so the token never lands in config.yaml.

trust: untrusted makes every tool without readOnlyHint (HassTurnOn, scripts,
media, vacuum, ...) require approval; read-only tools (GetLiveContext,
calendar/todo reads) run freely. This keeps the standing "no agent write
calls to the HA API" decision enforced per call instead of silently lifted.
2026-10-20 19:48:25 +00:00
claude-botandClaude Opus 5.5 e3e3b987fa feat(kuma-sync): ship the KumaStatusPage CRD, RBAC and the renner page
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The CRD and the ClusterRole rules land with the controller change, so
Flux applies them at merge, before the new kuma-sync image is built and
rolled out by the ImagePolicy; the new controller watches
KumaStatusPage and would not start without them.

- infrastructure/kuma-sync-crds: crd-kumastatuspages.yaml, a copy of
  config/crd with prune disabled, next to crd-kumamonitors.yaml.
- apps/kuma-sync/rbac.yaml: kumastatuspages, /status, /finalizers, as in
  config/rbac/role.yaml.
- apps/kuma-sync/statuspage-renner.yaml: the public page (slug renner,
  domain uptime.renner.uno) with the sections Services and Third-party,
  selected by the uptime.renner.uno/status-page-section label.
- The label on the 17 top-level service groups and the four third-party
  HTTP checks.

An envtest test validates the deployed page object against the CRD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 21:15:57 +02:00
k.renner 29bc320be8 Merge pull request 'fix(hermes): ha-updates review follow-ups from #1400' (#1402) from fix/hermes-ha-updates-review into main
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: #1402
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-20 19:15:50 +00:00
k.renner 05d9f78d6b Merge pull request 'feat(hermes): alert-monitor moves from Woodpecker to a Hermes cron job' (#1401) from feat/hermes-alert-monitor into main
Reviewed-on: #1401
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-20 19:15:34 +00:00
claude-bot fdc45b0785 fix(hermes): ha-updates --rollback must really roll back (review 1771)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
- install --rollback without --version is refused before any HA call, and
  --rollback to the entity's latest_version is refused as a forward install,
  so --rollback cannot bypass the 60-minute HACS limit.
- SKILL.md command list shows --rollback.
- Tests for both refusals; 16 pass locally and in the pinned CI image.
2026-10-20 21:13:24 +02:00
claude-bot 2ae6998bca fix(hermes): ha-updates time budget for the HACS phase (review 1769)
ci/woodpecker/pr/ci-scripts-test Pipeline is pending
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
- ha.py install: a HACS item (integration domain hacs) needs 60 min left in
  the window, room for restart, settling, a rollback install and a second
  restart; install --rollback needs 30, like other installs. The plain
  window check still runs before any HA call.
- SKILL.md: HACS before firmware, so firmware time can no longer push the
  HACS restart past its limit; regression handling directly after the HACS
  restart; not_restarted or a refused restart = installed but pending a
  restart, reported as a problem, never as Applied; rollbacks use --rollback.
- window_state: comment on wall-clock arithmetic on the DST-end night.
- Tests: install timeout capped 5 min before 05:00 (04:30 -> 25 min), HACS
  60-min threshold vs --rollback, 15 tests pass locally and in the pinned
  python:3.14-alpine CI image (so tzdata is present there too).
2026-10-20 21:11:48 +02:00
claude-botandClaude Opus 5.5 c24e02d048 fix(kuma-sync): clear stale status page view, test unsent config keys
A Conflict loser no longer keeps the page ID, section counts and unsynced
count of an earlier sync; an invalid selector keeps only the page ID.
The round-trip integration test now asserts that autoRefreshInterval,
showOnlyLastHeartbeat and rssTitle survive a managed save. Doc comments
state that per-monitor custom URLs are cleared on save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 21:11:16 +02:00
claude-bot 92502bac73 fix(hermes): alert-monitor secret guard nits from review 1768
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
- Window check steps by 1, so every 24-character piece of a secret is
  caught, as the guard claims.
- PEM certificates (ca.crt, base64 ca/crt fields in the talosconfig) are
  public and no longer count as secrets, so quoting a caBundle is not
  refused with a misleading message. Private keys stay guarded.
- SKILL.md: a 'Script Error' block in the prompt (gate failed) is reported
  in one line; Hermes wakes the agent with it (cron/scheduler_prompt.py).

Tested: 18 unittests; in the hermes pod against the real mounts: 7 secret
values collected, a normal issue body passes, a 24-char unaligned piece of
the Gitea token is refused (no values printed); gate: wakeAgent false.
2026-10-20 21:10:09 +02:00
claude-bot 31157b8414 fix(hermes): ha-updates review follow-ups from #1400
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
Review 1765/1766 on #1400 (merged before the review was acted on):

- Window enforced in ha.py, not only by the prompt: install refuses outside
  02:00-05:00 Europe/Berlin or with < 30 min left, restart with < 20 min
  left, before any HA call. install stops waiting 5 min before 05:00
  (timeout capped to the time left) instead of the 60 min default.
- restart: "running" only when HA was observed going down; otherwise
  result not_restarted, exit 1, so HACS updates are not reported as applied
  while their code is not loaded. Poll every 2 s.
- SKILL.md: the hard limits, not_restarted handling, a refused rollback is
  reported for the owner, and config-sync's live->main PRs in
  konairius/homeassistant as an expected side effect of HACS frontend
  updates.
- README: records the owner decision (automatic HACS/firmware updates and HA
  restarts by Hermes inside the window, UniFi/SMLIGHT excluded) next to the
  existing exception for HA image bumps.
- Offline unittests (skills/tests/test_ha.py): window edges incl. CET/CEST,
  refusals before any HA call, error-signature masking, compare (no change,
  recovery, regressions, safe mode), restart observed vs not_restarted.

Settled from the review's unverified list: tzdata is present in the image
(ZoneInfo("Europe/Berlin") works in the hermes pod); the live HA endpoints
(core/state, check_config, error_log, template config_entry_*) answered with
the real token; Hermes cron runs in UTC (no timezone configured, pod TZ UTC).

Already fixed in #1401: token volume optional, init container non-fatal, CI
step that runs skills/tests (this PR's test file is picked up once #1401 is
merged).

Not changed: the admin token. update.install, restart, check_config,
template and error_log need an HA admin; the owner chose to run this in
Hermes rather than the narrower proxy design of #1043.
2026-10-20 21:07:11 +02:00
claude-bot 32a67b0733 fix(hermes): alert-monitor review follow-ups
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
- BlackboxProbeFailing: exclude the hermes /api/status target (it has
  HermesDown), so a Hermes outage fires one alert, not two.
- alerts.py: a noise-log line with an impossible date is dropped instead of
  killing the gate (fails toward more alerting, as the pipeline did).
- alerts.py: HTTP errors raise ApiError; a Prometheus error only drops the
  blips (live alerts still triaged, WARNING line in the prompt);
  Alertmanager/Gitea errors exit non-zero so Hermes reports the failed run.
- alerts.py file/noise refuse text that contains a secret Hermes holds: any
  single-value file or key-like token under /var/run/secrets, credential env
  vars, or a 24-character piece of one.
- cron-jobs init container is non-fatal: an unreadable jobs.json or a failed
  cron create/edit logs a warning and the pod still starts (from the #1400
  review).
- homeassistant-token volume optional: true, like wiki-key and talos-config
  (from the #1400 review).
- Offline unittests (kubernetes/apps/hermes/skills/tests): title fallback,
  noise parsing incl. TTL and invalid dates, blip fingerprint equal to the
  old pipeline's, gate wake/sleep, Prometheus error fallback, secret guard.
  Run in ci-scripts-test.yml (python:3.14-alpine, pinned by digest).
- Nits: .gitignore blank line, comment width in ci-diagnostics-rbac.yaml.

Tested: 16 tests pass locally and in the pinned CI image; the gate run in
the hermes pod (wakeAgent false, 0 new); init script on a scratch
HERMES_HOME, normal (both jobs, skills replaced not appended) and with a
corrupt jobs.json (two warnings, exit 0); exclusion regex matches only the
hermes status URL; promtool check rules on both rule files; kustomize,
citations, server dry-run.
2026-10-20 21:04:49 +02:00
claude-botandClaude Opus 5.5 37c83ed6c2 feat(kuma-sync): declare the public status page as a KumaStatusPage
New namespaced CRD KumaStatusPage (uptime.renner.uno/v1alpha1) and a
reconciler that owns the Kuma status page completely: config, domain
names and the full group/monitor list. Sections select KumaMonitors in
any namespace by label; monitors are ordered by displayName, then
namespace/name, a monitor goes to the first matching section only, and
monitors without a Kuma ID are left out and counted in status.

The reconciler adopts an existing page with the slug, writes only when
the managed content differs (no write per resync), reuses Kuma group IDs
by position so saves do not churn them, reverts UI edits on resync,
deletes the page on resource deletion, and reports Ready=False/Conflict
for a younger resource claiming the same slug. Every KumaMonitor change
to labels, displayName, monitor ID or deletion enqueues all pages.

kumaclient gains a StatusPages interface (Breml + Fake). The socket API
returns no group list, so groups are read from Kuma's public
GET /api/status-page/<slug>, as the bootstrap did. Fields kuma-sync does
not manage (logo, custom CSS, analytics, RSS title, auto refresh
interval) are written back unchanged. autoRefreshInterval is not in the
spec: go-uptime-kuma-client v0.6.2 (latest) never sends it on save.

The Ansible bootstrap no longer creates or edits status pages; the
existing page is left in place for kuma-sync to adopt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 21:03:50 +02:00
claude-bot 4f547dfd27 feat(hermes): alert-monitor moves from Woodpecker to a Hermes cron job
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Owner decision: Hermes files the [alert] issues; the Woodpecker
alert-monitor pipeline is retired. issue-fix keeps working unchanged: it
picks issues by the "[alert] " title prefix, and the dedup contract is the
same (title "[alert] <alertname> (<namespace|job|cluster>)", noise-log lines
"- <fp> <ALERTNAME> — <date>: <reason>" with a 30-day TTL, blip
fingerprint sha256(alertname|scope)[:16], fingerprint footer on issues).

- skill alert-monitor: scripts/alerts.py (stdlib) is the cron pre-run gate:
  Alertmanager active alerts minus heartbeats and null-routed ones, plus
  ALERTS blips of the last 75 min, minus open [alert] issues (paginated, the
  pipeline read only the first 100) and noise fingerprints. Nothing new ->
  {"wakeAgent": false}, no LLM run, no message. `file` and `noise` write the
  verdicts in the fixed formats. SKILL.md ports the triage prompt: wiki
  first, verify live (kubectl, Prometheus, Loki, talosctl), problem/noise,
  root cause vs symptoms; Matrix report per run that found something.
- Cron job alert-monitor, hourly at :20, deliver matrix. The init container
  (renamed cron-jobs) now ensures both jobs by name and copies the gate
  script to /opt/data/scripts (Hermes only runs scripts from there).
- HermesDown: blackbox probe of https://hermes.renner.uno/api/status plus an
  alert, since a Hermes outage now stops alert -> issue (Alertmanager email
  is unaffected).
- Removed .woodpecker/alert-monitor.yml and ci/agents/alert-monitor/;
  comments that named them updated.

Tested: the gate run inside the hermes pod against live Alertmanager,
Prometheus and Gitea: 2 active, 36 open issues, 50 noise suppressions, 0 new
-> wakeAgent false. With a 3-day lookback and no noise TTL it produced 4
blips with the expected titles. file/noise against a fake Gitea (61 issues,
pagination, duplicate title skipped, footer, noise log created then
appended, parsed back by the gate; bad title/body/fingerprint refused).
Init script run twice on a scratch HERMES_HOME holding an existing
ha-updates job: ha-updates edited in place, alert-monitor created once,
script copied. Blackbox probe of the new target: 200. kustomize, citations
and server dry-run pass.

After merge:
- Delete the Woodpecker cron alert-monitor (id 4); without its pipeline file
  it has nothing to run.
- The alert_monitor_bot_token secret and the alert-monitor-bot account are
  unused afterwards.

Trade-off: the pipeline posted with alert-monitor-bot, a PAT limited to
write:issue. Hermes posts as hermes-bot, which also has repo write; the
agent reads untrusted alert text with a broader credential than before.
2026-10-20 20:52:46 +02:00
k.renner bb9d7e66f6 Merge pull request 'feat(hermes): ha-updates cron job for Home Assistant updates' (#1400) from feat/hermes-ha-updates into main
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1400
2026-10-20 18:35:41 +00:00
claude-bot 27e9ab1987 feat(hermes): ha-updates holds UniFi and SMLIGHT firmware
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Owner decision: firmware for integrations unifi (switches, APs, UDM) and
smlight (SLZB coordinators) is reported, never installed by the job.
2026-10-20 20:34:34 +02:00
claude-bot 4c5e77301c feat(hermes): ha-updates cron job for Home Assistant updates
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Hermes checks Home Assistant update entities every 4 hours and applies HACS
and device-firmware updates on its own, only inside the 02:00-05:00
Europe/Berlin window (README change rule 1). Owner decision: auto-apply for
these two classes; HA core stays with Flux image automation.

- skill ha-updates (SKILL.md + stdlib scripts/ha.py): list pending updates
  with their integration, health snapshots (core state, safe mode, component
  count, check_config, unavailable entities, masked ERROR log signatures),
  snapshot comparison, install-and-wait, restart-and-wait.
- Per run: vet each update against release notes and the homeassistant repo
  (safe / risky / held). Outside the window report new findings or answer
  [SILENT]. Inside: firmware one device at a time, then HACS, check_config,
  one restart, before/after comparison, roll back HACS items by version on an
  attributable regression. risky updates are never applied.
- Cron job ha-updates created or updated in place by the init container
  cron-ha-updates (state from git, not only on the PVC). Hermes cron runs in
  UTC; 0 1,5,9,13,17,21 puts one run at 02:00 CET / 03:00 CEST.
  Delivery: matrix (home room); failures follow it.
- ExternalSecret hermes-homeassistant: OpenBao homelab/apps/hermes/homeassistant,
  property token, mounted at /var/run/secrets/homeassistant.
- SOUL.md: Home Assistant access, scoped to this skill and the window.

Tested: ha.py against a fake HA REST API (list, snapshot, firmware install
with background progress, unsupported install refused, HACS install,
restart with downtime, regression detection, version rollback, 401). The
config_entry template renders with jinja2. Init script run twice against a
scratch HERMES_HOME with Hermes 0.22.2: one job, edited in place.
kubectl kustomize, yaml-citations and server dry-run pass.

Before merge:
1. Create a Home Assistant admin user for Hermes, a long-lived access token
   for it, and put it at OpenBao homelab/apps/hermes/homeassistant, property
   token. Without it the ExternalSecret stays unready and the Flux wait fails.
2. Give hermes-bot read access to konairius/homeassistant (today: none);
   the skill vets updates against that repo.

Gaps: no live HA test (no token yet). Rollback exists only for entities
that support picking a version (HACS); firmware cannot be rolled back.
2026-10-20 20:25:05 +02:00
security-bot 16e555331b chore(image-automation): bump ghcr.io/immich-app/immich-machine-learning:v3.3.4
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-10-20 10:43:30 +00:00
k.renner b0f4db7dfc Merge pull request 'fix(matrix): serve turn.matrix.renner.uno from the TCP router, not HTTPS' (#1397) from fix/turn-tcp-router into main
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: #1397
2026-10-20 10:39:54 +00:00
k.renner 6a0992d0cd Merge pull request 'fix(crowdsec): sign the LAPI/agent certs with a CA that outlives them' (#1396) from fix/crowdsec-own-ca into main
Reviewed-on: #1396
2026-10-20 10:39:32 +00:00
security-bot 0d08002137 chore(image-automation): bump ghcr.io/immich-app/immich-server:v3.3.4
Updates managed by image-automation-controller.
2026-10-20 10:39:08 +00:00
hermes-bot f3b8e93c42 fix(matrix): serve turn.matrix.renner.uno from the TCP router, not HTTPS
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
TURN/TLS never reached LiveKit. A TLS connection to
turn.matrix.renner.uno without ALPN, as TURN clients open it, got
LiveKit's HTTP "OK" from the HTTP router; a STUN Binding request on it got
no answer.

Traefik v3.7 (pkg/server/router/tcp/router.go, ServeTCP) matches HTTPS
routers before TCP-TLS routers: an HTTPS router with a specific Host takes
precedence over an IngressRouteTCP with the same HostSNI. The matrix-rtc
Ingress created exactly that HTTPS router for the turn host.

The turn host moves to its own Ingress bound to the `web` entrypoint only,
so netbird-service-sync still publishes it (it reads Ingress hosts) but no
HTTPS router claims the SNI on websecure. Its certificate becomes a
standalone Certificate (livekit-turn-tls), since the Ingress no longer
carries a tls section.
2026-10-20 10:20:02 +00:00
hermes-bot 766a790ee1 fix(crowdsec): sign the LAPI/agent certs with a CA that outlives them
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The LAPI has been in CrashLoopBackOff since the restart #1394 triggered
(10:08Z). Its own watcher login fails:
  tls: failed to verify certificate: x509: certificate has expired or is
  not yet valid: current time 2026-10-20T10:13:44Z is after
  2026-10-20T06:24:37Z
Rolling back to the previous ReplicaSet fails the same way, so any LAPI
restart since this morning would have hit it.

Cause: the chart's CA Certificate sets no duration, so cert-manager's 90d
default applies, the same lifetime as the leaves (tls.certManager.duration
90d, renewBefore 30d). All of them renew together. At 2026-09-20 06:24:37
the leaves were re-signed by the CA issued 2026-07-22 06:24:37 while the
CA itself rotated to a new key. That earlier CA expired today at 06:24:37,
so every leaf now chains to an expired CA. The LAPI pod running since
2026-10-01 kept working with the certs already loaded, until the restart.
The same skew is what made Traefik reject the LAPI cert (500) since
2026-09-20.

Fix, no chart fork: our own CA in tls-ca.yaml (self-signed Issuer, 10y CA
Certificate renewed a year before expiry, CA Issuer), handed to the chart
via tls.certManager.issuerRef. The chart then stops rendering its own
CA/issuers. cert-manager re-issues every leaf because the Secret's issuer
annotation no longer matches the Certificate's issuerRef
(SecretIssuerAnnotationsMismatch). Leaves renew every 60d under a CA that
lives 10y, so the leaves and the CA no longer renew together.

Reloader restarts LAPI (crowdsec-lapi-tls, crowdsec-agent-tls) and agents
(crowdsec-agent-tls) when the certs change; both read them at start only.
The ServersTransport already trusts crowdsec-lapi-tls's ca.crt (#1394), so
it follows the new CA.
2026-10-20 10:15:31 +00:00
k.renner bca807c2c1 Merge pull request 'fix(crowdsec): trust the CA that signed the LAPI cert, not the current root' (#1394) from fix/crowdsec-lapi-transport-ca into main
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1394
2026-10-20 10:06:46 +00:00
k.renner a4d60ad689 Merge pull request 'fix(matrix): disable service links for LiveKit and lk-jwt-service' (#1395) from fix/livekit-service-links into main
Reviewed-on: #1395
2026-10-20 10:06:08 +00:00
hermes-bot f96cef137d fix(matrix): disable service links for LiveKit and lk-jwt-service
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
LiveKit crashlooped after #1393:
  could not parse "tcp://10.107.186.157:7880" as uint value from
  environment variable "LIVEKIT_PORT" for flag port

The Service named livekit makes the kubelet inject Docker-style link
variables (LIVEKIT_PORT, LIVEKIT_SERVICE_HOST, ...) into every pod in the
namespace. LiveKit reads LIVEKIT_* as its own config; lk-jwt-service reads
LIVEKIT_* too. enableServiceLinks: false on both pods removes them.
2026-10-20 10:04:28 +00:00
hermes-bot 34a8f3d2f3 fix(crowdsec): trust the CA that signed the LAPI cert, not the current root
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
crowdsec.renner.uno has answered 500 on every path since 2026-09-20.
Traefik logs, every request:
  tls: failed to verify certificate: x509: certificate signed by unknown
  authority (possibly because of "x509: ECDSA verification failure" while
  trying to verify candidate authority certificate "crowdsec-ca")

Cause: the chart's CA (crowdsec-ca, no duration set, so cert-manager's 90d
default) and its leaves (tls.certManager.duration 90d, renewBefore 30d) were
created together and so renew at the same instant. cert-manager logs show
crowdsec-ca, crowdsec-lapi and crowdsec-agent all triggered "Renewing" at
2026-09-20T06:24:37Z. The CA came back with a new ECDSA key, while the
leaves issued in the same second were signed by the previous one. The
ServersTransport trusted crowdsec-root-secret, so it holds the new CA and
rejects the LAPI cert. Same subject, different key, hence "ECDSA
verification failure".

Fix: point the ServersTransport at the ca.crt of crowdsec-lapi-tls. For a
CA issuer, cert-manager stores the signing CA there, so it matches the
served cert whichever key the root holds. Traefik reads ca.crt from a
rootCAs secret (Traefik v3.7 docs).

Reloader also restarts the LAPI when crowdsec-lapi-tls changes. The LAPI
reads its cert at start; without a restart a renewal would update ca.crt
while the old leaf is still served, and the mismatch would come back.

Impact while broken: the edge firewall bouncers on proxy-1/proxy-2 got no
decisions from this endpoint.
2026-10-20 10:04:18 +00:00
security-bot 783bb70a0e chore(image-automation): bump gitea.renner.uno/gitea_admin/kuma-sync:2026-10-20-0933
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-10-20 09:56:44 +00:00
k.renner de5ca66466 Merge pull request 'feat(matrix): Element Call (audio and video) via LiveKit + lk-jwt-service' (#1393) from feat/matrix-element-call into main
Reviewed-on: #1393
2026-10-20 09:56:13 +00:00
hermes-bot e71bfdeff2 feat(matrix): Element Call (audio and video) via LiveKit + lk-jwt-service
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Element X reported MISSING_MATRIX_RTC_TRANSPORT: matrix.renner.uno had no
MatrixRTC backend (no SFU, /rtc/transports 404, msc4143 off).

Adds the backend from the Element Call self-hosting guide and the
lk-jwt-service README:

- LiveKit SFU (rtc.yaml), signalling at wss://rtc.matrix.renner.uno.
  Media: ICE straight to the pod IPs (UDP 7882 mux, TCP 7881), which the
  LAN reaches through the BGP-routed pod CIDR, dual-stack. Clients that
  cannot reach the pod (mobile data, NetBird-only) use the embedded TURN
  server over TLS on turn.matrix.renner.uno:443. That rides the existing
  public path: NetBird proxy TLS passthrough -> Traefik, where an
  IngressRouteTCP terminates TLS (turn.external_tls) and hands plain TCP to
  LiveKit. The proxy only does TLS on :443, so TURN/TLS is the one transport
  that works from the internet without opening router ports.
- lk-jwt-service as a Synapse appservice (MSC4502 membership look-ups,
  MSC4512 proxy of /rtc/livekit to it), plus its legacy client endpoints
  under rtc.matrix.renner.uno/livekit/jwt: Element Call 0.28 / Element Web
  1.12.32 still use livekit_service_url.
- The legacy endpoints verify OpenID tokens at
  <server>/_matrix/federation/v1/openid/userinfo, found through
  /.well-known/matrix/server (fallback :8448). Synapse therefore serves the
  server well-known and the `openid` listener resource, and the Ingress
  routes exactly those two paths. No federation resource is served and
  federation_domain_whitelist stays empty; federation remains off.
- Synapse: msc4143/4222/4502/4512, matrix_rtc transport (url +
  livekit_service_url), rtc_foci in the client well-known for older
  embedded Element Call builds, delayed events (24h) and the guide's rate
  limits for key sharing and membership heartbeats.
- Secrets: one Password generator (LiveKit API secret, appservice tokens),
  generated once in-cluster like the former matrix-bridge tokens; Synapse,
  LiveKit and lk-jwt-service read the same Secret, so nothing can drift and
  nothing needs seeding in OpenBao.
- CNPs: world -> LiveKit 7881/tcp + 7882/udp and LiveKit -> world UDP
  (ICE checks/media); lk-jwt-service -> Traefik 8443 (matrix.renner.uno and
  rtc.matrix.renner.uno resolve to the Traefik VIP in-cluster).
- embedded TURN denies private peers by default; the relay targets the
  SFU's own pod IP, so 10.0.0.0/8 and fc00::/7 are allowed (LiveKit already
  limits embedded-TURN relays to its own media ports).
- Kuma: DNS + reachability for rtc. and turn.matrix.renner.uno.
2026-10-20 09:49:41 +00:00
k.renner 521c41ba49 Merge pull request 'feat(kuma): monitor every public service and the proxies, defined with their apps' (#1392) from feat/kuma-public-coverage into main
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1392
2026-10-20 09:32:55 +00:00
hermes-bot 58b59fbe43 feat(kuma): monitor every public service and the proxies, defined with their apps
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Every host the NetBird proxies serve (exactly the Ingresses labelled
dns.renner.uno/public or netbird.renner.uno/public; verified by SNI probe of
proxy-1 and proxy-2) gets a group with three kinds of check:

- DNS: cluster services have no own record, so the check asserts the
  *.renner.uno wildcard answers (CNAME == proxy.renner.uno, Cloudflare
  resolver, IPv6 first). External names (apex, proxies, third-party) assert
  their own AAAA/A record instead.
- HTTP reachability: a URL routed to the backend, redirects not followed,
  any status below 500 counts.
- Response validation: health/API JSON or a page keyword; services fully
  behind the Authentik gate assert the login page.

The proxies get their own group: proxy.renner.uno, and per instance its
DNS plus reachability and a Gatus health check pinned to that proxy (URL
host is the proxy, Host header status.renner.uno; Node derives SNI from the
Host header, so the proxy routes it like a client request).

Layout: monitors live in the kustomization of the app they monitor;
external ones (proxies, apex, third-party) in apps/monitoring. The CRD moves
to infrastructure/ so every app Kustomization can consume it; it carries
prune: disabled, so leaving kuma-sync's inventory does not delete it. The
old kuma-sync/monitors objects go; their Kuma monitors are recreated under
the new owner keys (history since this morning is lost).

App Kustomizations wait on their resources, and KumaMonitor Ready reflects
whether Uptime Kuma on the VPS is reachable. Each consuming Kustomization
therefore treats KumaMonitor as always current, so a Kuma outage cannot
stall Flux.

kuma-sync: dns monitors gain spec.dns.conditions (Kuma's "record"
variable with its string operators, ANDed), mapped both ways so drift is
detected and an emptied list clears Kuma's conditions. Until the new image
rolls out the controller drops the field and the DNS checks only test
resolvability.
2026-10-20 09:24:09 +00:00
k.renner c4d69fab0f Merge pull request 'feat(hermes): bootstrap Matrix cross-signing for @hermes' (#1390) from feat/hermes-matrix-cross-signing into main
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1390
2026-10-20 07:02:25 +00:00
k.renner 63012f0dc6 Merge pull request 'feat(home-assistant): render the Matrix bot password into secrets.yaml' (#1391) from feat/ha-matrix-nabu-secret into main
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1391
2026-10-20 06:50:41 +00:00
claude-botandClaude Opus 5.5 d16641661c feat(home-assistant): render the Matrix bot password into secrets.yaml
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Home Assistant's Matrix integration logs in as @nabu:matrix.renner.uno
(MAS account, password login verified) and only takes the password from
YAML, so it reaches HA the same way recorder_db_url does: OpenBao
apps/home-assistant/matrix -> ExternalSecret ha-matrix -> init container
render-matrix-password -> /config/secrets.yaml (matrix_nabu_password).
The config that uses it lands in the homeassistant repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 08:47:18 +02:00
claude-botandClaude Opus 5.5 1569faef4b feat(hermes): bootstrap Matrix cross-signing for @hermes
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The bot's device HERMESBOT is not cross-signed, so Element shows it as
unverified. With MATRIX_RECOVERY_KEY_OUTPUT_FILE set, Hermes bootstraps
cross-signing on startup and writes the generated recovery key once (0600).
Step 1 of 2: the key then moves to OpenBao apps/hermes/matrix and a follow-up
PR feeds it back as MATRIX_RECOVERY_KEY and drops the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 08:35:59 +02:00
k.renner 0911575775 Merge pull request 'feat(hermes): chat with Hermes over Matrix' (#1389) from feat/hermes-matrix into main
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1389
2026-10-20 06:21:15 +00:00
claude-botandClaude Opus 5.5 79be70b84e feat(hermes): chat with Hermes over Matrix
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
In the dashboard an agent lives only as long as its browser PTY
connection (close_on_disconnect sessions are reaped on disconnect, upstream
#136713). The messaging gateway that already runs in the pod
(`gateway run`) keeps conversations server-side instead, so Hermes joins
our Matrix homeserver as a bot:

- account @hermes:matrix.renner.uno, registered in MAS without a password
  (token-only), compatibility token on fixed device HERMESBOT in OpenBao
  apps/hermes/matrix -> ExternalSecret hermes-matrix (MATRIX_ACCESS_TOKEN).
  A stable device keeps the E2EE store under /opt/data valid.
- MATRIX_HOMESERVER https://matrix.renner.uno (via Traefik, already in the
  hermes egress), MATRIX_ALLOWED_USERS @k.renner only,
  MATRIX_E2EE_MODE=required (mautrix[encryption] and libolm are in the
  image).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 08:18:42 +02:00
security-bot dd21d961f3 chore(image-automation): bump ghcr.io/paperless-ngx/paperless-ngx:3.3.3
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-10-19 17:43:24 +00:00
security-bot 8d36bbebea chore(image-automation): bump gitea.renner.uno/konairius/wiki:build.1792419299
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
Updates managed by image-automation-controller.
2026-10-19 14:20:55 +00:00
k.renner b0e3999ef2 Merge pull request 'fix(wiki): the service reads the wiki-index BasicAuth users' (#1388) from fix/wiki-basic-auth-in-service into main
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1388
2026-10-19 14:14:03 +00:00
hermes-bot 69915ce0dd fix(wiki): the service reads the wiki-index BasicAuth users
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
#1383 + konairius/Wiki#14 put the wiki's read API behind an OIDC session
or an API key. External agents only have the wiki-index.renner.uno
BasicAuth credentials and got 401 since.

konairius/Wiki (feat/basic-auth-machines) checks `Authorization: Basic`
in the service against the htpasswd lines Traefik uses. This mounts the
existing Secret wiki-api-basic-auth (OpenBao apps/ai/wiki-index-basic-auth,
already the wiki's own) read-only at /var/run/secrets/wiki-basic-auth.
Auth__Basic__UsersPath points at the directory, because the service reads
every key there, as Traefik does. A rotated Secret now also rolls the pod
(reloader annotation).

Order does not matter: the current image ignores the setting, and the new
image without it authenticates nobody over BasicAuth. Traefik's middleware
on wiki-index stays.
2026-10-19 14:07:11 +00:00
k.renner 4a05b82fe8 Merge pull request 'test(hermes): raise dashboard WS ping interval to 60s' (#1385) from fix/hermes-dashboard-ws-ping-interval into main
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/review-bot-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
Reviewed-on: #1385
2026-10-19 11:30:20 +00:00
hermes-bot 538a968edb test(hermes): raise dashboard WS ping interval to 60s
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The dashboard console's /api/pty and /api/events WebSockets close
together every ~12-23 s (Traefik durations 18.9/21.8/22.7/22.8 s on
2026-10-19 11:14-11:19Z), the browser reports code 1006 and shows
"Please wait while the conversation loads…". The TUI process and
/api/status stay healthy meanwhile. The only ~20 s server timer found is
uvicorn's WS keepalive (dashboard.ws_ping_interval, default 20 s).

Diagnostic change: if socket lifetimes move to ~60 s the keepalive is
implicated; if they stay at ~20 s it is ruled out. Set via init container
like dashboard.trusted_proxies since there is no env equivalent.
2026-10-19 11:27:25 +00:00
k.renner 47592bd308 Merge pull request 'fix(hermes): request offline_access so the dashboard session refreshes' (#1384) from fix/hermes-dashboard-refresh-token into main
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1384
2026-10-19 10:47:07 +00:00
hermes-bot 2d2959f32a fix(hermes): request offline_access so the dashboard session refreshes
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The dashboard logged out exactly ~60 min after every login
(dashboard-auth.log: session_rejected reason=no_cookie at login+60m).
Hermes' self-hosted OIDC provider defaults to "openid profile email" and
the Authentik hermes-provider mapped only those scopes. Since authentik
2024.2 a refresh token is issued only when the client requests
offline_access and the provider has the offline_access scope mapping, so
Hermes never got one and could not rotate the session when the ID-token
cookie expired.

- authentik blueprint: add the managed scope-offline_access mapping to
  hermes-provider (refresh_token grant was already enabled).
- hermes: HERMES_DASHBOARD_OIDC_SCOPES adds offline_access.
2026-10-19 10:46:02 +00:00
k.renner d153d3e62e Merge pull request 'feat(wiki): wiki.renner.uno on plain Traefik, gate and header trust go (3/3)' (#1383) from feat/wiki-drop-gate into main
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1383
2026-10-19 10:33:16 +00:00
security-bot de570ddf7c chore(image-automation): bump gitea.renner.uno/konairius/wiki:build.1792404861
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-10-19 10:20:54 +00:00
k.renner 5a81930991 Merge pull request 'fix: [alert] FluxImageAutomationNotReady (cluster) (#1363)' (#1371) from alert-fix/issue-1363 into main
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1371
2026-10-19 10:14:12 +00:00
k.renner 7f4ab6fc21 Merge pull request 'feat(wiki): Authentik OIDC application for the wiki's own login (1/3)' (#1382) from feat/wiki-oidc-provider into main
Reviewed-on: #1382
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-19 10:07:25 +00:00
hermes-bot c659cc2bd6 feat(wiki): wiki.renner.uno on plain Traefik, the gate and header trust go
review-bot reviewed: comment
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Stage 3 of 3. Merge only after konairius/Wiki feat/oidc-login is running
(Deployment image newer than build.1790322994 and `wiki-79948db4c6` gone):
the current image has no login of its own, so on plain Traefik its UI
would be open to the LAN.

- Ingress `wiki`: ingressClassName traefik instead of authentik-gate.
  authentik-gate-sync's sweep then deletes what it generated for the gate
  (Ingress/Service/CNP wiki-gate in ai, CNP gate-ai-wiki-c9ba6b in
  authentik, the ai-wiki-c9ba6b outpost, application and provider). One
  proxy layer fewer: Traefik -> wiki.
- Deployment: the Auth__ReverseProxy__TrustedProxies entries go. They were
  a hand copy of the Talos podSubnets, and the OIDC image no longer reads
  them.
- Middleware wiki-api-strip-identity goes. No header names a user any
  more; wiki-index.renner.uno keeps BasicAuth.
- Comments in ai-ns.yaml and the Authentik blueprint follow.

The `wiki` CNP already admits Traefik on 8080, and the ai namespace egress
already reaches Traefik, so auth.renner.uno (OIDC discovery, JWKS, token)
needs no new rule.
2026-10-19 09:47:23 +00:00
hermes-bot 13a7ad1c06 feat(wiki): Authentik OIDC application for the wiki's own login
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: approve
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Stage 1 of 3 for moving the wiki off proxy-header identity
(konairius/Wiki feat/oidc-login).

The wiki took the username from X-Authentik-Username for any peer in the
pod CIDR, so any pod that may reach :8080 (Hermes, Gitea, Traefik, all of
ai and monitoring) could claim a human's name. Authentik's proxy provider
sends no signed identity header, so the wiki now signs humans in itself
with OpenID Connect and takes the username from the verified ID token.

- Blueprint: OAuth2 provider "Wiki" (public client `wiki`, PKCE,
  authorization_code, RS256 self-signed key, openid+profile) and
  application `wiki` (issuer https://auth.renner.uno/application/o/wiki/),
  redirect URI https://wiki.renner.uno/signin-oidc. No policy binding,
  the same audience as today's gate, which has no group annotation.
- Deployment: Auth__Oidc__Authority and Auth__Oidc__ClientId. The running
  image ignores them; the OIDC image refuses to start without them, which
  is why this lands first.

Order: this PR, then konairius/Wiki feat/oidc-login (Flux image
automation rolls it; it works behind the existing gate, since the gate
session makes the OIDC round trip silent), then the stacked PR that
moves wiki.renner.uno off the authentik-gate class.
2026-10-19 09:47:03 +00:00
k.renner 4b574b77bc Merge pull request 'fix(hermes): target Talos nodes by name in SOUL.md' (#1381) from fix/hermes-soul-talos-node-names into main
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: #1381
2026-10-19 09:28:34 +00:00
hermes-bot f76b638dec fix(hermes): target Talos nodes by name in SOUL.md
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot skipped: closed
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The hermes ServiceAccount cannot list nodes, so the InternalIP lookup
via kubectl get nodes failed (Forbidden). talosctl accepts node names
through the talos.default endpoint: talosctl -n k8s-2 get members and
-n k8s-1,k8s-2,k8s-3 version both succeed from the hermes pod.
2026-10-19 09:27:53 +00:00
security-bot 67bc3a2f43 chore(image-automation): bump gitea.renner.uno/gitea_admin/kuma-sync:2026-10-19-0857
Updates managed by image-automation-controller.
2026-10-19 09:26:39 +00:00
k.renner 2b2fd3647b Merge pull request 'docs: konairius/homelab on main in runbooks and READMEs' (#1380) from claude/docs-konairius-main into main
Reviewed-on: #1380
2026-10-19 09:25:51 +00:00
k.renner 53996b0136 Merge pull request 'docs(plan): claude-bot takes the Cut-over 1 snapshot, owner only transfers' (#1373) from claude/plan-step0-claude-bot into main
Reviewed-on: #1373
2026-10-19 09:25:19 +00:00
claude-botandClaude Opus 5.5 cdf0b5ffca docs: konairius/homelab on main in runbooks and READMEs
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: comment
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Cold-rebuild and HA-rollback runbooks, README and the image-automation README
name main and konairius/homelab. The plan records the Flux ref patch and the
cron API calls Cut-over 2 needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:20:24 +02:00
security-bot 2f2f28c0a7 chore(image-automation): bump gitea.renner.uno/gitea_admin/review-bot:2026-10-19-0912
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-10-19 09:15:09 +00:00
k.renner 39e4250bdb Merge pull request 'chore(rotation): stop syncing org secrets into k.renner' (#1377) from claude/drop-k-renner-org-secrets into main
Reviewed-on: #1377
2026-10-19 09:14:55 +00:00
claude-botandClaude Opus 5.5 7a495d0549 chore(rotation): stop syncing org secrets into k.renner
review-bot review failed: anthropic POST /v1/messages: HTTP 400: {"type":"error","error":{"type":"invalid_request_error","message":"mcp_servers[0] 'gi…
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Homelab's pipelines resolve org secrets in konairius since the move; the only
repo left in the k.renner Woodpecker org (turm1388) uses repo secrets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:13:31 +02:00
k.renner 5e03e394c5 Merge pull request 'docs(review-bot): every repo's default branch is main' (#1376) from claude/prompts-main into main
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1376
2026-10-19 09:12:10 +00:00
claude-botandClaude Opus 5.5 d9fb1d6244 docs(review-bot): every repo's default branch is main
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/review-bot-test Pipeline was successful
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:08:50 +02:00
k.renner 1160cb13fd Merge pull request 'feat(hermes): log talosctl, bao and tea in' (#1374) from feat/hermes-cli-logins into main
Reviewed-on: #1374
2026-10-19 08:59:29 +00:00
k.renner 73b7e6457e Merge pull request 'chore: default branch main (merge inside Cut-over 2 only)' (#1375) from claude/default-branch-main into master
Reviewed-on: #1375
2026-10-19 08:59:00 +00:00
claude-botandClaude Opus 5.5 5528ccbd0b chore: default branch main
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Pipeline branch filters and PR bases, Flux GitRepository ref, image automation
checkout and push, restore-test, vmtest and bootstrap.sh. Merge right before
the master -> main rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:57:20 +02:00
claude-botandClaude Opus 5.5 dcf9e24dec feat(hermes): log talosctl, bao and tea in
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
talosctl: os:reader through Talos's Kubernetes API access.
cluster.yaml enables machine.features.kubernetesTalosAPIAccess for
namespace hermes, role os:reader; already applied to k8s-1, k8s-2,
k8s-3 with `talosctl patch machineconfig --mode=no-reboot`, one node at
a time with `talosctl health` between. The talos.dev ServiceAccount
hermes-talos gets Secret hermes-talos (key config), mounted at
/var/run/secrets/talos.dev with TALOSCONFIG pointing at it. Egress to
host/remote-node :50000 (Service default/talos endpoints are the node
InternalIPs).

bao: policy hermes (read on homelab/apps/hermes/*) and Kubernetes-auth
role hermes for SA hermes/hermes, applied by hand like
netbird-service-sync (commands in hermes.hcl). BAO_ADDR is the in-cluster
service; CNPs both ways on :8200.

tea: an init container writes config.yml for login hermes-bot from the
mounted Gitea token into an emptyDir at the agent's ~/.config/tea
(subprocess HOME is /opt/data/home), so no token lands on the PVC.

SOUL.md says how to use all three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:54:42 +02:00
k.renner 35a387a3c1 Merge pull request 'chore: follow homelab to konairius/homelab (merge inside Cut-over 1 only)' (#1372) from claude/homelab-konairius into master
ci/woodpecker/push/ci-claude-refresh Pipeline was successful
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: #1372
2026-10-19 08:52:21 +00:00
k.renner 093857c353 Merge pull request 'feat(rotation): sync claude_code_oauth_token and review_bot_token into konairius' (#1370) from claude/konairius-org-secrets into master
Reviewed-on: k.renner/homelab#1370
2026-10-19 08:50:17 +00:00
claude-botandClaude Opus 5.5 e7c5325aae docs(plan): claude-bot takes the Cut-over 1 snapshot, owner only transfers
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: comment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:49:18 +02:00
issue-fix-bot 853d2ba803 fix: [alert] FluxImageAutomationNotReady (cluster) (#1363)
review-bot reviewed: comment
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
2026-10-19 08:43:38 +00:00
claude-botandClaude Opus 5.5 7f29ebb878 chore: follow homelab to konairius/homelab
review-bot reviewed: comment
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/review-bot-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Flux source URL, flux-git rotator verify repo, review-bot REPOS, pipeline API,
clone and push URLs, the heating-can source label and the review-bot and
kuma-sync Go module paths. Merge right after the transfer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:43:23 +02:00
claude-botandClaude Opus 5.5 b07167ae1a feat(rotation): sync claude_code_oauth_token and review_bot_token into konairius
review-bot reviewed: comment
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Homelab moves to konairius/homelab; after the Woodpecker move its pipelines
resolve org secrets in konairius. The k.renner containers stay until the move
is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:42:20 +02:00
k.renner df0b344f7f Merge pull request 'fix(hermes): push the Hermes image as registry-bot' (#1369) from fix/hermes-image-registry-bot into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#1369
2026-10-19 08:31:56 +00:00
hermes-bot 46b7d458b3 fix(hermes): push the Hermes image as registry-bot
review-bot reviewed: request changes
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
registry-bot is the konairius registry identity: write:package PAT,
konairius org secret registry_bot_token, rotated by
openbao/rotation/registry-bot.yaml. That rotation syncs the secret for
the push, tag, release and manual events, so the manual trigger is
`event: manual` instead of a deployment target.

registry_bot_token is a konairius org secret. Woodpecker resolves org
secrets through the repo's org link, so this pipeline gets it only once
homelab has moved to konairius/homelab
(docs/superpowers/plans/2026-10-18-homelab-konairius-main.md, cut-over 1).
2026-10-19 08:29:53 +00:00
security-bot 2d04575c51 chore(image-automation): bump gitea.renner.uno/konairius/hermes:build.1792397861
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-10-19 08:20:50 +00:00
k.renner 97310db78c Merge pull request 'feat(hermes): run the in-house Hermes image' (#1367) from feat/hermes-use-custom-image into master
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/push/hermes-image Pipeline was successful
Reviewed-on: k.renner/homelab#1367
2026-10-19 08:16:53 +00:00
k.renner 085f969f63 Merge pull request 'feat(hermes): build a Hermes image with the agent's CLI tools' (#1366) from feat/hermes-image into master
ci/woodpecker/push/build-ci-images Pipeline is pending
ci/woodpecker/push/hermes-image Pipeline is pending
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#1366
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-19 08:12:26 +00:00
hermes-bot d00ee70b23 fix(hermes): run the Hermes image from the konairius org
review-bot reviewed: request changes
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
2026-10-19 08:10:18 +00:00
hermes-bot 8ea8318c6e Merge branch 'feat/hermes-image' into feat/hermes-use-custom-image 2026-10-19 08:10:13 +00:00
hermes-bot fbc1aaef21 fix(hermes): publish the Hermes image under the konairius org
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: approve
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
2026-10-19 08:10:11 +00:00
hermes-bot be9898f7b0 chore(renovate): leave gitea_admin/hermes to Flux image automation
review-bot reviewed: request changes
ci/woodpecker/pr/ci-scripts-test Pipeline was canceled
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
2026-10-19 08:06:10 +00:00
hermes-bot 3c5c04d4a5 fix(hermes): let Renovate keep the Hermes image current
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: comment
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
Drops the daily cron and the upstream-polling decide step. Every version
in ci/images/hermes/Containerfile is now an image reference (FROM for
nousresearch/hermes-agent, COPY --from for talosctl, kubectl, flux, bao
and tea), which Renovate's enabled dockerfile manager updates and
digest-pins. A merged Renovate PR pushes to ci/images/hermes/**, the
pipeline builds build.<unix-ts>, and Flux image automation rolls it out.
No checksums to maintain: the binaries come from digest-pinned images.

renovate.json: the hermes Containerfile gets a PR of its own instead of
the "CI non-major" group (that group is for changes that never reach the
cluster), and nousresearch/hermes-agent is held to v0.x because the
retired date-versioned v2026.x tags sort above it.

Verified: each COPY --from path exists in the pinned image and the
binary runs on the hermes-agent v0.22.2 base. renovate-config-validator
37.440.7 reports only the two pre-existing errors on master
(flux/kubernetes.managerFilePatterns).
2026-10-19 08:06:09 +00:00
hermes-bot 3ed7741c68 docs(hermes): tea is in the image now, still not logged in
review-bot reviewed: request changes
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was canceled
2026-10-19 07:58:27 +00:00
hermes-bot f73cc54705 feat(hermes): build a Hermes image with the agent's CLI tools
review-bot reviewed: comment
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
nousresearch/hermes-agent ships no talosctl, kubectl, flux, bao, tea or
jq. The kubectl init container dropped its binary in /opt/data/.local/bin,
which the agent's terminal never has on PATH: Hermes snapshots the env
from a bash login shell, and Debian's /etc/profile resets PATH for
non-root users. /usr/local/bin survives that reset.

Upstream's documented route for always-present tools is a derived image
(docs/user-guide/docker, "Adding tools"). ci/images/hermes builds FROM
the upstream release and adds the binaries, versions matched to the
cluster (Talos v1.13.10, Kubernetes v1.36.3, Flux v2.9.5, OpenBao 2.7.1)
and checksummed against upstream release checksums.

.woodpecker/hermes-image.yml rebuilds daily when upstream publishes a
new release (compared against the uno.renner.hermes.version label on
:latest), and on any push to the Containerfile. Tags are
build.<unix-ts>, the scheme Flux image automation already tracks for
wiki and shelly-manager.

Owner step after merge: register the cron
  woodpecker repo cron add --repo k.renner/homelab \
    --name hermes-image --branch master --schedule '@daily'

The Deployment switch follows in a separate PR once the first build
exists, so the Recreate rollout never points at a missing tag.
2026-10-19 07:58:27 +00:00
hermes-bot c8849b8d9c feat(hermes): run the in-house Hermes image
Switches apps/hermes to gitea.renner.uno/gitea_admin/hermes, which
carries talosctl, kubectl, flux, bao, tea and jq in /usr/local/bin. The
image-automation policy now tracks its build.<unix-ts> tags instead of
upstream nousresearch/hermes-agent; .woodpecker/hermes-image.yml follows
upstream releases.

Drops the kubectl init container and its emptyDir: the binary sat in
/opt/data/.local/bin, which the agent's terminal does not have on PATH.
2026-10-19 07:58:27 +00:00
k.renner 9d0707c1aa Merge pull request 'feat(kuma-sync): Uptime Kuma monitors replacing UptimeRobot' (#1365) from feat/kuma-task5-monitors into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#1365
2026-10-19 07:57:25 +00:00
claude-botandClaude Opus 5.5 74db40710e feat(kuma-sync): define Uptime Kuma monitors replacing UptimeRobot
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: comment
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
One group per own service with application-level checks (json-query on
health/API endpoints where ungated, keyword otherwise) and a Third-party
group with plain checks. Endpoints verified from the Kuma VPS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:54:08 +02:00
k.renner 368dc24add Merge pull request 'feat(hermes): push and open PRs on Gitea as hermes-bot' (#1364) from feat/hermes-gitea into master
Reviewed-on: k.renner/homelab#1364
2026-10-19 07:49:07 +00:00
claude-botandClaude Opus 5.5 dfb2f71c85 feat(hermes): push and open PRs on Gitea as hermes-bot
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot skipped: closed
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
The owner placed hermes-bot's API token at OpenBao apps/hermes/gitea
(api-token). ExternalSecret hermes-gitea mounts it as a file at
/var/run/secrets/gitea/api-token.

git is configured through GIT_CONFIG_* env on the container, so nothing
lives on the PVC: a credential helper for https://gitea.renner.uno that
answers with hermes-bot and the token read from the file, plus the
commit identity hermes-bot <hermes-bot@konstantin-renner.de>. Hermes'
subprocess env scrub only strips its own provider/messaging secrets, so
GIT_* reaches the terminal tool.

SOUL.md drops "no write access" and tells the agent how to use git and
the REST API (no tea in the image) without printing the token; the
existing feature-branch/PR/no-self-merge rules apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:48:05 +02:00
k.renner 6b78f4cb5b Merge pull request 'fix(hermes): put the generated ConfigMaps in the hermes namespace' (#1361) from fix/hermes-configmap-namespace into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#1361
2026-10-19 07:06:08 +00:00
claude-botandClaude Opus 5.5 d8d356779d fix(hermes): put the generated ConfigMaps in the hermes namespace
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: comment
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
apps/hermes sets namespaces per resource, not in the kustomization, so
configMapGenerator emitted hermes-soul and hermes-skills without one and
the Flux apply failed ("namespace not specified"). The earlier
server-side dry-run masked it by defaulting to the current namespace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:00:17 +02:00
security-bot 2b1016bd4a chore(image-automation): bump gitea.renner.uno/gitea_admin/kuma-sync:2026-10-19-0646 nousresearch/hermes-agent:v0.22.2
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-10-19 06:56:39 +00:00
k.renner 58695ceb9a Merge pull request 'feat(hermes): give the agent the homelab house rules and the wiki' (#1360) from feat/hermes-homelab-context into master
Reviewed-on: k.renner/homelab#1360
2026-10-19 06:55:15 +00:00
k.renner 055cc6a6e3 Merge pull request 'feat(monitoring): watch off-site Uptime Kuma from Prometheus' (#1357) from feat/kuma-task4-cluster into master
Reviewed-on: k.renner/homelab#1357
2026-10-19 06:47:18 +00:00
claude-botandClaude Opus 5.5 2a0a14fb25 feat(hermes): give the agent the homelab house rules and the wiki
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: request changes
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
SOUL.md comes from git (ConfigMap hermes-soul, subPath over the PVC
copy): the stock persona plus the homelab's working rules distilled
from Claude Code's global CLAUDE.md and feedback memory — wiki first,
the verification ladder, the network/DNS/placement/secret design rules,
operational change discipline and how to work with the owner. Claude
Code harness specifics (Bash allowlisting, subagent sizing, worktrees,
claude-bot identities) are left out.

The homelab-wiki skill (ConfigMap hermes-skills, mounted at
/opt/hermes-skills and registered via skills.external_dirs) wraps the
wiki service API in a stdlib Python client, since the image has no
bash or jq. Hermes calls the in-cluster service directly with its own
API key, identity `hermes`:

- apps/hermes/wiki -> Secret hermes-wiki, mounted as a file (optional,
  so the pod starts before it is seeded; reads are anonymous)
- apps/ai/wiki-api-key-hermes -> Auth__ApiKeys__hermes on the wiki. A
  separate path rather than a field in apps/ai/wiki-api-keys, because
  claude-bot's OpenBao policy is write-only and a put on the shared path
  would drop the workstation key.
- CNPs: hermes egress to ai/wiki:8080, wiki ingress from hermes
- hermes added to the openbao ClusterSecretStore allowlist

The built-in memory store (2200/1375 chars, agent-rewritten) is left to
the agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:44:57 +02:00
k.renner 67372c673f Merge pull request 'fix(uptime-kuma): mount the bootstrap script directory, not the file' (#1359) from fix/uptime-kuma-script-mount into master
ci/woodpecker/push/deploy-uptime-kuma Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#1359
Reviewed-by: Review Bot <review-bot@renner.uno>
2026-10-19 06:44:07 +00:00
claude-botandClaude Opus 5.5 ab1f004b48 fix(uptime-kuma): mount the bootstrap script directory, not the file
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: approve
A single-file bind mount pins the inode present at container start.
ansible.builtin.copy replaces the file by rename, so the running
container kept executing the previous kuma-setup.js: the #1358 deploy
ran the old admin-only script (host md5 8d77..., container 55a2...) and
created no notification, status page or metrics key.

The script now lives in {{ uptime_kuma_dir }}/setup/, mounted read-only
at /app/setup; the compose change recreates the container once. The old
file path is removed.

Verified on a local 2.5.6 container: a file replaced by rename in the
mounted directory is visible inside, and the script run from
/app/setup resolves socket.io-client and converges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:42:10 +02:00
k.renner afbc21edc3 Merge pull request 'feat(uptime-kuma): bootstrap settings, email notification, status page and metrics key' (#1358) from feat/kuma-task4-bootstrap into master
ci/woodpecker/push/deploy-uptime-kuma Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: k.renner/homelab#1358
2026-10-19 06:39:51 +00:00
k.renner 91d940499e Merge pull request 'feat(kuma-sync): attach Kuma's default notifications to managed monitors' (#1356) from feat/kuma-sync-default-notifications into master
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: k.renner/homelab#1356
2026-10-19 06:38:58 +00:00
k.renner 4d4ea98b7c Merge pull request 'fix(hermes): keep image automation off the retired date-versioned tags' (#1355) from fix/hermes-image-policy into master
Reviewed-on: k.renner/homelab#1355
2026-10-19 06:38:40 +00:00
claude-botandClaude Opus 5.5 7e1b46108a fix(uptime-kuma): fail when a list event is missing after login
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot reviewed: comment
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Kuma 2.5.6 afterLogin (server/server.js:1839-1848) sends the
notification and API-key lists inside Promise.allSettled and acks the
login regardless. A missing notificationList was read as empty and
would create a second default "email" notification (double mails);
a missing apiKeyList would add a key without removing the old one.
The script now fails the run instead.

Verified against a local 2.5.6: fresh run creates everything, second
run reports no changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:34:24 +02:00
security-bot 4fb3a4ba40 chore(image-automation): bump gitea.renner.uno/gitea_admin/kuma-sync:2026-10-19-0615
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-10-19 06:26:39 +00:00
claude-botandClaude Opus 5.5 72927293e2 test(monitoring): promtool suite for Uptime Kuma rules, terse comments
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
review-bot skipped: draft
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:26:12 +02:00
claude-botandClaude Opus 5.5 67aadbc0f9 feat(uptime-kuma): bootstrap settings, email notification, status page and metrics key
kuma-setup.js now logs in after the admin setup and converges on every run:
- settings: Trust Proxy on, Primary Base URL https://kuma.renner.uno.
  Read-modify-write; unset keys get the same defaults the Kuma settings page
  applies before saving (a raw getSettings payload has nscd unset, which makes
  setSettings stop nscd).
- notification "email" (SMTP, default enabled, applied to existing monitors):
  created or updated in place by name, never duplicated. Credentials from
  OpenBao homelab/infrastructure/uptime-kuma/smtp; recipient is the
  Alertmanager receiver admin@renner.uno; 465 means implicit TLS, else STARTTLS.
- status page "renner" / "Renner" with custom domain uptime.renner.uno. Only
  title and domain are enforced; saveStatusPage replaces all groups, so the
  current publicGroupList from /api/status-page/<slug> is sent back unchanged.
  Steady state does not call saveStatusPage at all.
- metrics API key "prometheus": Ansible checks the key stored at
  homelab/infrastructure/uptime-kuma-metrics against /metrics; if it is
  missing or rejected the script deletes all "prometheus" keys, creates a new
  one and hands it over via a 0600 file in the data dir, which Ansible writes
  to OpenBao (vault_kv2_write, community.hashi_vault 7.1.0 in the CI image)
  and then removes. The key never reaches stdout/stderr or the Ansible log.

The script is restructured into small async steps with per-emit timeouts.
The uptime-kuma-vps policy gains read on the smtp path and
read/create/update on the metrics path (must be applied by hand).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:25:43 +02:00
claude-bot fd2f3b7be4 fix(hermes): keep image automation off the retired date-versioned tags
review-bot reviewed: comment
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
nousresearch/hermes-agent still carries v2026.4.3..v2026.9.24 from the
old date-based scheme. As semver they sort above 0.x, so '>=0.22.2'
picked v2026.9.24 (2026-09-24) and rolled the pod back from v0.22.2.
Cap the range below 1.0.0 and pin the manifests back to v0.22.2.
2026-10-19 08:18:03 +02:00
claude-botandClaude Opus 5.5 a35bc6b91d feat(monitoring): watch off-site Uptime Kuma from Prometheus
Add a blackbox-http probe of kuma.renner.uno with a dedicated critical
UptimeKumaUnreachable rule (excluded from BlackboxProbeFailing), scrape
Kuma /metrics with the API key from OpenBao, and alert on sustained slow
monitor response times. No egress policy exists in the monitoring
namespace, so no CNP change is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:17:30 +02:00
issue-fix-bot 747ebbb50c fix: [alert] KubePodCrashLooping (home-assistant) (#1082)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
2026-10-01 03:44:26 +00:00
517 changed files with 21117 additions and 5567 deletions
-6
View File
@@ -20,11 +20,5 @@ kubernetes/access-staging/
trivy-iac.json
trivy-image-*.json
# Alert-monitor pipeline workspace (generated in CI, never commit)
.ci-alert-monitor/
# CI diagnostic kubeconfig + kubectl for the agent steps (generated, never commit)
.ci-diag/
# Plaintext secret templates awaiting SOPS encryption (never commit)
*.plaintext.yaml
-298
View File
@@ -1,298 +0,0 @@
# Alert monitor — every 15 minutes, read the active alerts from Alertmanager.
# When a NEW alert is firing, an AI agent triages it against the repo and the
# cluster context gathered here; alerts it confirms as real problems become
# Gitea issues, which the issue-fix pipeline (issue-fix.yml) later turns into
# PRs. Alerts it classifies as noise are recorded in a persistent "Alert
# monitor: noise log" issue so they are never re-triaged (delete a line from
# that issue to un-suppress an alert).
#
# Alertmanager access: the woodpecker-ci namespace cannot reach monitoring
# ClusterIPs directly (Cilium default-deny-ingress on monitoring, see
# kubernetes/infrastructure/network-policies/monitoring-ns.yaml), and the
# public hostname alerts.renner.uno sits behind the Authentik gate. The
# apiserver *service proxy* path works: apiserver→pod traffic arrives with
# host/remote-node identity, which that policy explicitly allows. Verified
# 2026-07-16 with `kubectl get --raw .../services/kube-prometheus-stack-
# alertmanager:9093/proxy/api/v2/alerts`.
#
# Step split: the ci-k8s image has kubectl/flux but NO jq; the ci-claude image
# has jq but no kubectl. So the fetch step only talks to the cluster and dumps
# raw files into the workspace, and every JSON decision (heartbeat filter,
# dedup, gating) lives in the agent step.
#
# Dedup contract (what makes 15-minute re-runs cheap): an alert is dropped
# before the agent ever sees it when EITHER
# - an open issue titled exactly "[alert] <alertname> (<namespace|job|cluster>)"
# exists (namespace first, job as fallback for aggregate alerts), OR
# - its Alertmanager fingerprint appears in the noise-log issue body.
# Runs where nothing new is firing stop before the agent — no tokens spent.
#
# Triggering:
# - cron : a cron NAMED exactly "alert-monitor" (name filter, same
# mechanism as update-audit.yml):
# woodpecker repo cron add --repo k.renner/homelab \
# --name alert-monitor --branch master --schedule '*/15 * * * *'
# - deploy : woodpecker-cli pipeline deploy k.renner/homelab <n> alert-monitor
# where <n> is an existing pipeline to promote.
when:
- event: cron
cron: alert-monitor
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "alert-monitor"'
steps:
- name: fetch-alerts
image: gitea.renner.uno/gitea_admin/ci-k8s:2026-09-08
environment:
SOPS_AGE_KEY:
from_secret: sops_age_key
S3_ACCESS_KEY_ID:
from_secret: hetzner_s3_access_key
S3_SECRET_ACCESS_KEY:
from_secret: hetzner_s3_secret_key
commands:
- bash scripts/ci/fetch-kubeconfig.sh
- |
# Active, unsilenced, uninhibited alerts — raw dump; filtering happens
# in the agent step (no jq in this image).
set -eu
mkdir -p .ci-alert-monitor
AM="/api/v1/namespaces/monitoring/services/kube-prometheus-stack-alertmanager:9093/proxy"
kubectl get --raw "$$AM/api/v2/alerts?active=true&silenced=false&inhibited=false" \
> .ci-alert-monitor/alerts-raw.json
head -c 400 .ci-alert-monitor/alerts-raw.json; echo
- |
# Blip lookback: an alert that fires and resolves BETWEEN ticks is
# invisible to the live snapshot (a 17-minute KubeHpaMaxedOut escaped
# exactly this way on 2026-07-16). Scan Prometheus's ALERTS history
# over ~2 tick intervals + jitter; the overlap between runs is
# deduped downstream like everything else.
set -eu
PROM="/api/v1/namespaces/monitoring/services/kube-prometheus-stack-prometheus:9090/proxy"
kubectl get --raw "$$PROM/api/v1/query?query=max%20by%20(alertname,namespace,job,severity)%20(max_over_time(ALERTS%7Balertstate%3D%22firing%22,alertname!~%22Watchdog%7CInfoInhibitor%22%7D%5B35m%5D))" \
> .ci-alert-monitor/blips-raw.json \
|| printf '{"data":{"result":[]}}' > .ci-alert-monitor/blips-raw.json
# (no jq in this image — counting happens in the agent step)
head -c 300 .ci-alert-monitor/blips-raw.json; echo
- |
# Cluster context for the triage agent — gathered here because the
# agent itself gets NO cluster access (no Bash, no kubeconfig). Runs
# unconditionally (a handful of read-only calls every 15 min is
# cheaper than teaching this jq-less step to gate on the JSON).
set -eu
{
echo "=== nodes ==="
kubectl get nodes -o wide
echo "=== pods not Running/Succeeded ==="
kubectl get pods -A --no-headers | grep -Ev 'Running|Completed|Succeeded' || echo "(none)"
echo "=== warning events (most recent last, tail 100) ==="
kubectl get events -A --field-selector type=Warning --sort-by=.lastTimestamp | tail -100
echo "=== flux kustomizations not ready ==="
flux get kustomizations -A --status-selector ready=false 2>&1 || true
echo "=== flux helmreleases not ready ==="
flux get helmreleases -A --status-selector ready=false 2>&1 || true
} > .ci-alert-monitor/context.txt
wc -l .ci-alert-monitor/context.txt
- |
# Least-privilege live-diagnostics kubeconfig (+ kubectl binary — the
# ci-claude image ships none) so the triage agent can VERIFY instead
# of hypothesize. Degrades to snapshot-only if the ServiceAccount
# isn't reconciled yet.
bash scripts/ci/make-diag-kubeconfig.sh
- name: alert-triage-agent
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.303
environment:
CLAUDE_CODE_OAUTH_TOKEN:
from_secret: claude_code_oauth_token
# Dedicated identity: alert-monitor-bot, PAT scoped to write:issue ONLY.
# This step runs an LLM agent over untrusted input (alert annotations,
# cluster event text) and its output is published verbatim as a public
# issue body, so the credential it holds must not be able to do anything
# but write issues. The account is a write collaborator, but the PAT
# scope is the real cap: verified 403 on /user/repos and /admin/users.
# Replaces the admin-owned gitea_token that used to sit here (#330).
GITEA_TOKEN:
from_secret: alert_monitor_bot_token
commands:
- |
# Filter + dedup + gate. Drops the always-firing heartbeats
# (Watchdog, InfoInhibitor), alerts routed ONLY to the `null`
# receiver (the owner already declared those unactionable in the
# Alertmanager route config — triaging them re-litigates a settled
# decision; found via #252/KubeCPUOvercommit), alerts that already
# have an open "[alert] ..." issue, and fingerprints recorded in the
# noise log. The repo is public, so these reads need no token. Exits
# the step — agent never starts — when nothing new is firing.
set -eu
jq '[.[]
| select(.labels.alertname != "Watchdog" and .labels.alertname != "InfoInhibitor")
| select([.receivers[]?.name] | (length == 0) or any(. != "null"))]' \
.ci-alert-monitor/alerts-raw.json > .ci-alert-monitor/alerts-active.json
echo "Active alerts (after heartbeat filter): $$(jq length .ci-alert-monitor/alerts-active.json)"
API="https://gitea.renner.uno/api/v1/repos/k.renner/homelab"
curl -sfL "$$API/issues?state=open&type=issues&limit=100" > .ci-alert-monitor/open-issues.json
TITLES=$$(jq -c '[.[].title]' .ci-alert-monitor/open-issues.json)
NOISE_BODY=$$(jq -r 'map(select(.title == "Alert monitor: noise log")) | .[0].body // ""' \
.ci-alert-monitor/open-issues.json)
# Suppression entries are exactly the structured lines the write-back
# step emits: "- <fp> <ALERTNAME> — <YYYY-MM-DD>: <reason>". Parse THAT
# shape rather than grepping the whole body for 16-hex tokens. A reason
# routinely cites another alert's fingerprint in prose ("see the issue
# filed for fingerprint <fp>"), and the body-wide grep turned every such
# citation into a silent, permanent suppression of an alert that was
# never classified as noise — verified against the live noise log, which
# yielded 22 fingerprints for 21 real entries, the extra one being
# 2ddc41edb689fc33, an alert that HAD been filed as a genuine issue.
#
# Entries also expire after NOISE_TTL_DAYS. A noise verdict says "this
# occurrence was benign", not "this alert can never be interesting
# again" — but the fingerprint is sha256(alertname|scope) and therefore
# stable across recurrences, so without an expiry a single blip mutes
# that alertname+scope pair forever. Re-triaging a recurrence weeks
# later is cheap; missing a real outage because a July blip muted
# openbao's KubePodNotReady is not.
#
# Lines that fail to parse are simply dropped, i.e. they stop
# suppressing — this fails toward MORE alerting, never less.
#
# date is BusyBox here, not GNU: `date -d '30 days ago'` errors out, so
# the cutoff goes through epoch arithmetic and `date -d @<epoch>`, which
# this image does support.
NOISE_TTL_DAYS=$${NOISE_TTL_DAYS:-30}
CUTOFF=$$(date -u -d @$$(( $$(date -u +%s) - NOISE_TTL_DAYS * 86400 )) +%F)
FPS=$$(printf '%s\n' "$$NOISE_BODY" \
| sed -nE 's/^- ([0-9a-f]{16}) [^ ]+ — ([0-9]{4}-[0-9]{2}-[0-9]{2}):.*/\2 \1/p' \
| awk -v c="$$CUTOFF" 'BEGIN{gsub(/-/,"",c)} { d=$$1; gsub(/-/,"",d); if (d+0 >= c+0) print $$2 }' \
| jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "Noise suppressions in effect: $$(printf '%s' "$${FPS:-[]}" | jq length)" \
"(TTL $${NOISE_TTL_DAYS}d, entries dated >= $$CUTOFF)"
# Synthesize pseudo-alerts for BLIPS: lookback series whose label set
# is not currently firing at all (checked against the PRE-filter raw
# snapshot, so live-but-null-routed alerts don't reappear as blips).
# Pseudo-fingerprint = sha256(alertname|scope)[:16] — STABLE across
# recurrences, so one noise verdict suppresses a flappy alert
# permanently via the noise log.
: > .ci-alert-monitor/blips-new.jsonl
jq -c '.data.result[]?.metric // empty' .ci-alert-monitor/blips-raw.json | while IFS= read -r M; do
NAME=$$(printf '%s' "$$M" | jq -r '.alertname')
SCOPE=$$(printf '%s' "$$M" | jq -r '.namespace // .job // "cluster"')
if jq -e --arg n "$$NAME" --arg s "$$SCOPE" \
'[.[] | select(.labels.alertname == $$n and ((.labels.namespace // .labels.job // "cluster") == $$s))] | length > 0' \
.ci-alert-monitor/alerts-raw.json > /dev/null; then
continue
fi
FP=$$(printf '%s|%s' "$$NAME" "$$SCOPE" | sha256sum | cut -c1-16)
jq -n --arg fp "$$FP" --argjson m "$$M" \
'{labels: $$m, fingerprint: $$fp, blip: true,
annotations: {summary: "BLIP: fired within the lookback window (~35 min) and already resolved — caught by the ALERTS history scan, not currently active."}}' \
>> .ci-alert-monitor/blips-new.jsonl
done
jq -s '.' .ci-alert-monitor/blips-new.jsonl > .ci-alert-monitor/blips-candidates.json
# Title key: namespace, else job, else "cluster". The job fallback
# exists because aggregate alerts like TargetDown carry no namespace
# — with only "(cluster)" two simultaneous TargetDowns for different
# jobs (pve and dns-servers, 2026-07-16) collapsed into ONE issue
# and the second root cause was never triaged.
jq -s 'add' .ci-alert-monitor/alerts-active.json .ci-alert-monitor/blips-candidates.json \
> .ci-alert-monitor/alerts-combined.json
jq --argjson titles "$$TITLES" --argjson fps "$${FPS:-[]}" '
[ .[]
| ("[alert] " + .labels.alertname + " (" + (.labels.namespace // .labels.job // "cluster") + ")") as $$t
| select( ($$t | IN($$titles[]) | not) and (.fingerprint | IN($$fps[]) | not) )
| . + {issue_title: $$t} ]' \
.ci-alert-monitor/alerts-combined.json > .ci-alert-monitor/alerts-new.json
NEW=$$(jq length .ci-alert-monitor/alerts-new.json)
jq -r '.[] | "\(.fingerprint)\t\(.issue_title)"' .ci-alert-monitor/alerts-new.json
if [ "$$NEW" -eq 0 ]; then
echo "No new alerts — agent not started."
exit 0
fi
- |
# Headless triage run. Same auth model as security-scan.yml
# (subscription OAuth, prompt piped via stdin — see the comments
# there). Tool allowlist is read-only on the repo plus Write for the
# /tmp verdict file, plus EXACTLY ONE live command: the RBAC-scoped
# kubectl from make-diag-kubeconfig.sh (read-only ClusterRole, no
# Secrets). The prefix match means no pipes/redirects and no other
# binaries — the agent verifies cluster state, it cannot mutate it,
# fetch the web, or read secrets.
export KUBECONFIG="$$PWD/.ci-diag/kubeconfig"
# Model chosen live from the catalog (not hardcoded, no family assumed) —
# see the header of scripts/ci/pick-model.sh. Empty MODEL -> CLI default.
MODEL=$$(sh scripts/ci/pick-model.sh "triage firing Prometheus/Alertmanager alerts against read-only live cluster state and classify each as a real problem or noise; careful diagnostic reasoning, no changes")
if [ -n "$$MODEL" ]; then echo "alert-monitor: selected model $$MODEL"; else echo "alert-monitor: no live catalog — using the CLI default model"; fi
cat ci/agents/alert-monitor/prompt.md | claude $${MODEL:+--model $$MODEL} \
--permission-mode acceptEdits \
--allowedTools "Read,Glob,Grep,Write,Bash(./.ci-diag/kubectl:*)" \
--settings ci/agents/alert-monitor/settings.json \
-p
- |
# Post the verdicts: one Gitea issue per confirmed problem, and one
# appended line in the persistent noise log per noise verdict. Every
# write checks its HTTP status explicitly (see update-audit.yml for
# why piping into `curl -sf | jq` is not enough).
set -eu
if [ ! -s /tmp/alert-verdicts.json ]; then
echo "Agent wrote no verdicts (/tmp/alert-verdicts.json missing) — nothing to post."
exit 0
fi
jq . /tmp/alert-verdicts.json > /dev/null # fail loudly on malformed output
API="https://gitea.renner.uno/api/v1/repos/k.renner/homelab"
STAMP=$$(date -u +%Y-%m-%d)
gitea_write() {
code=$$(curl -s -o /tmp/gitea-resp.json -w '%{http_code}' \
-X "$$1" -H "Authorization: token $$GITEA_TOKEN" \
-H "Content-Type: application/json" --data @"$$3" "$$2")
echo "$$1 $$2 -> HTTP $$code"
if [ "$$code" -lt 200 ] || [ "$$code" -ge 300 ]; then
echo "Gitea API error body:"; cat /tmp/gitea-resp.json; echo
return 1
fi
}
N=$$(jq length /tmp/alert-verdicts.json)
i=0
: > /tmp/noise-lines.txt
while [ "$$i" -lt "$$N" ]; do
VERDICT=$$(jq -r ".[$$i].verdict" /tmp/alert-verdicts.json)
TITLE=$$(jq -r ".[$$i].title" /tmp/alert-verdicts.json)
FP=$$(jq -r ".[$$i].fingerprint" /tmp/alert-verdicts.json)
NAME=$$(jq -r ".[$$i].alertname" /tmp/alert-verdicts.json)
REASON=$$(jq -r ".[$$i].reason" /tmp/alert-verdicts.json)
if [ "$$VERDICT" = "problem" ]; then
# Safety re-check: never double-file if a parallel run won the race.
EXISTS=$$(curl -sfL "$$API/issues?state=open&type=issues&limit=100" \
| jq -r --arg t "$$TITLE" 'map(select(.title == $$t)) | length')
if [ "$$EXISTS" -gt 0 ]; then
echo "Issue already open for '$$TITLE' — skipping."
else
jq --arg footer "$$(printf '\n\n---\n<!-- alert-monitor:fingerprint=%s -->\n_Filed automatically by the alert-monitor pipeline (%s). The issue-fix pipeline may pick this up and open a PR._' "$$FP" "$$STAMP")" \
--argjson idx "$$i" \
'.[$$idx] | {title: .title, body: (.body + $$footer)}' \
/tmp/alert-verdicts.json > /tmp/gitea-create.json
gitea_write POST "$$API/issues" /tmp/gitea-create.json
jq '{number, html_url, title}' /tmp/gitea-resp.json
fi
else
printf -- '- %s %s — %s: %s\n' "$$FP" "$$NAME" "$$STAMP" "$$REASON" >> /tmp/noise-lines.txt
fi
i=$$((i+1))
done
if [ -s /tmp/noise-lines.txt ]; then
NOISE_NUM=$$(curl -sfL "$$API/issues?state=open&type=issues&limit=100" \
| jq -r 'map(select(.title == "Alert monitor: noise log")) | .[0].number // empty')
if [ -n "$$NOISE_NUM" ]; then
curl -sfL "$$API/issues/$$NOISE_NUM" | jq -r '.body // ""' > /tmp/noise-old.txt
jq -n --rawfile old /tmp/noise-old.txt --rawfile add /tmp/noise-lines.txt \
'{body: ($$old + "\n" + $$add)}' > /tmp/gitea-patch.json
gitea_write PATCH "$$API/issues/$$NOISE_NUM" /tmp/gitea-patch.json
else
printf '%s\n\n' "Fingerprints the alert-monitor triage agent classified as noise. The dedup step skips any alert whose fingerprint appears below — delete a line to make that alert eligible for triage again. Keep this issue open; it is the suppression state. Entries EXPIRE after NOISE_TTL_DAYS (default 30) counted from the date in the line, so a one-off blip stops suppressing its alertname+scope pair once the window passes; re-add happens automatically if it is triaged as noise again. Only lines in the exact '- <fingerprint> <ALERTNAME> — <YYYY-MM-DD>: <reason>' form suppress anything — a fingerprint mentioned in prose does not." > /tmp/noise-header.txt
jq -n --rawfile hdr /tmp/noise-header.txt --rawfile add /tmp/noise-lines.txt \
'{title: "Alert monitor: noise log", body: ($$hdr + $$add)}' > /tmp/gitea-create.json
gitea_write POST "$$API/issues" /tmp/gitea-create.json
fi
fi
+28 -2
View File
@@ -27,7 +27,7 @@
# Note this pipeline runs no LLM agent, so the exfil path that motivated the
# other cutovers does not apply to it.
#
# Push builds run on master only. Without the branch filter a feature branch
# Push builds run on main only. Without the branch filter a feature branch
# that touches this file started all steps at once: it pushed unreviewed
# images and used the whole woodpecker-ci-quota, so the PR checks could not
# get a pod (REN-286).
@@ -36,7 +36,7 @@
# image, and in parallel they exceed the woodpecker-ci-quota.
when:
- event: push
branch: master
branch: main
path:
- "ci/images/**"
- "secret-rotator/**"
@@ -454,6 +454,32 @@ steps:
--destination gitea.renner.uno/gitea_admin/kuma-sync:$TAG \
--destination gitea.renner.uno/gitea_admin/kuma-sync:latest
# cloudflare-lb-sync: reconciles CloudflareLoadBalancer resources into
# Cloudflare. Its unit tests run as a stage of the image build.
- name: build-cloudflare-lb-sync
image: registry.gitlab.com/gitlab-ci-utils/container-images/kaniko:v1.25.19-debug@sha256:7795cec509a50a71378cc2c365f55c555ee3a05834d8eb1cd2552df5e66d44d8
directory: ci/images/cloudflare-lb-sync
when:
- event: deployment
- event: push
path: ["ci/images/cloudflare-lb-sync/**", ".woodpecker/build-ci-images.yml"]
environment:
GITEA_USER: gitea_admin
GITEA_TOKEN:
from_secret: ci_images_token
commands:
- mkdir -p /kaniko/.docker
- AUTH=$(printf '%s:%s' "$GITEA_USER" "$GITEA_TOKEN" | base64 | tr -d '\n')
- printf '{"auths":{"gitea.renner.uno":{"auth":"%s"}}}' "$AUTH" > /kaniko/.docker/config.json
# YYYY-MM-DD-HHMM: the image-automation ImagePolicy picks the newest.
- TAG=$(date +%Y-%m-%d-%H%M)
- |
/kaniko/executor \
--context . \
--dockerfile Containerfile \
--destination gitea.renner.uno/gitea_admin/cloudflare-lb-sync:$TAG \
--destination gitea.renner.uno/gitea_admin/cloudflare-lb-sync:latest
# bird: BGP daemon for the pod-network mesh over pod0 (#576). Runtime
# artifact like heating-can; same registry so the audit tracks it.
- name: build-bird
+12 -12
View File
@@ -46,20 +46,20 @@
# push/cron/manual events this pipeline fires on.
#
# OWNER SETUP — the token + secret above are already provisioned. The one
# remaining step, to be run AFTER this merges to master (a cron references a
# remaining step, to be run AFTER this merges to main (a cron references a
# pipeline that must exist on the target branch), is to register the schedule:
# woodpecker repo cron add --repo k.renner/homelab \
# --name ci-claude-refresh --branch master --schedule '@weekly'
# woodpecker repo cron add --repo konairius/homelab \
# --name ci-claude-refresh --branch main --schedule '@weekly'
# Weekly is plenty; the pipelines tolerate being a few days behind a release.
#
# Triggering:
# - cron : the cron NAMED exactly "ci-claude-refresh" (see above).
# - deploy : woodpecker-cli pipeline deploy k.renner/homelab <n> ci-claude-refresh
# - deploy : woodpecker-cli pipeline deploy konairius/homelab <n> ci-claude-refresh
# where <n> is an existing pipeline to promote.
# - push : a change to the Containerfile (or this file) ON master forces a
# - push : a change to the Containerfile (or this file) ON main forces a
# rebuild of the current latest version so Containerfile fixes ship
# promptly. Restricted to master ON PURPOSE — a feature branch must
# never build/push an image or open a bump PR (only master pushes
# promptly. Restricted to main ON PURPOSE — a feature branch must
# never build/push an image or open a bump PR (only main pushes
# images), and without this filter every PR that edits these paths
# would do exactly that from its own branch.
when:
@@ -68,7 +68,7 @@ when:
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "ci-claude-refresh"'
- event: push
branch: master
branch: main
path:
- "ci/images/claude/**"
- ".woodpecker/ci-claude-refresh.yml"
@@ -174,9 +174,9 @@ steps:
# Both were validated non-empty by the decide step; re-assert before a
# sed that would corrupt every pin if either were blank.
[ -n "$$NEW" ] && [ -n "$$CUR" ] || { echo "empty version/current sentinel — aborting"; exit 1; }
API="https://gitea.renner.uno/api/v1/repos/k.renner/homelab"
API="https://gitea.renner.uno/api/v1/repos/konairius/homelab"
BRANCH="ci-image/claude-$$NEW"
if git ls-remote --heads "https://gitea.renner.uno/k.renner/homelab.git" "$$BRANCH" | grep -q .; then
if git ls-remote --heads "https://gitea.renner.uno/konairius/homelab.git" "$$BRANCH" | grep -q .; then
echo "Branch $$BRANCH already exists — a PR for $$NEW is already open. Nothing to do."
exit 0
fi
@@ -197,7 +197,7 @@ steps:
git checkout -b "$$BRANCH"
git add $$CONSUMERS
git commit -m "chore(ci): bump ci-claude image to $$NEW"
git push "https://$$PUSH_TOKEN@gitea.renner.uno/k.renner/homelab.git" HEAD:"$$BRANCH"
git push "https://$$PUSH_TOKEN@gitea.renner.uno/konairius/homelab.git" HEAD:"$$BRANCH"
{
printf 'Automated bump of the ci-claude agent image from `%s` to `%s`.\n\n' "$$CUR" "$$NEW"
printf 'The refresh pipeline built and pushed `ci-claude:%s` (and `:latest`) from the\n' "$$NEW"
@@ -208,7 +208,7 @@ steps:
jq -n --arg title "chore(ci): bump ci-claude image to $$NEW" \
--rawfile body /tmp/pr-body.md \
--arg head "$$BRANCH" \
'{title: $$title, body: $$body, head: $$head, base: "master"}' > /tmp/pr.json
'{title: $$title, body: $$body, head: $$head, base: "main"}' > /tmp/pr.json
code=$$(curl -s -o /tmp/resp.json -w '%{http_code}' \
-X POST -H "Authorization: token $$PUSH_TOKEN" \
-H "Content-Type: application/json" --data @/tmp/pr.json "$$API/pulls")
+4 -4
View File
@@ -66,9 +66,9 @@ steps:
# Verified green across every kustomization in the tree when this was added,
# so this gates new breakage rather than pre-existing debt.
#
# ci-k8s TAG SPLIT: this file pins a newer dated tag than e2e.yml, e2e-test.yml,
# alert-monitor.yml and issue-fix.yml, which still sit on an older one. That is
# staleness in those four, not a deliberate split here — everything should be on
# ci-k8s TAG SPLIT: this file pins a newer dated tag than e2e.yml and
# e2e-test.yml, which still sit on an older one. That is
# staleness in those two, not a deliberate split here — everything should be on
# the newest dated tag. They are not bumped here because none of them are
# triggered by this PR, so it would ship untested changes under cover of a green
# run that never touched them. Tracked in #461.
@@ -319,7 +319,7 @@ steps:
# writes its stripped mirror under mktemp and never into the workspace.
- name: promtool
depends_on: [] # see note above `steps:`
image: prom/prometheus:v3.15.0@sha256:efd719c99d83b060d9daefdcf00360461adf279f45ef5391f8d111892118753e
image: prom/prometheus:v3.15.1@sha256:fa3302279710be2f21a8301ec17a8b4f2301fd829bd113839b3b6b02b6f191a2
commands:
- sh scripts/ci/promtool-rules.sh
+16 -4
View File
@@ -35,28 +35,40 @@ when:
steps:
- name: model-selection-tests
depends_on: []
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.303
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.311
commands:
- sh scripts/ci/test-model-selection.sh
- name: pr-review-mistral-tests
depends_on: []
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.303
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.311
commands:
- sh scripts/ci/test-pr-review-mistral.sh
- name: promtool-rules-guard-tests
depends_on: []
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.303
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.311
commands:
- sh scripts/ci/test-promtool-rules.sh
- name: yaml-citations-guard-tests
depends_on: []
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.303
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.311
commands:
- sh scripts/ci/test-yaml-citations.sh
# Offline unittests for the Hermes skill scripts
# (kubernetes/apps/hermes/skills/): the [alert] title, noise-log and blip
# fingerprint contract the alert-monitor dedup depends on, the issue->card
# bridge, and the secret guard.
- name: hermes-skill-tests
depends_on: []
image: python:3.15-alpine@sha256:d44b1254cb92329418d164b22b20d86bbd3869d48e80e09e476531a409a728bb
environment:
PYTHONDONTWRITEBYTECODE: "1"
commands:
- python3 -m unittest discover -s kubernetes/apps/hermes/skills/tests -v
- name: backup-verify-tests
depends_on: []
image: gitea.renner.uno/gitea_admin/ci-backup-verify:2026-10-10
-33
View File
@@ -1,33 +0,0 @@
when:
# Deploy only on master (merge) + manual — never auto-deploy from a branch.
- event: push
branch: master
path:
- "ansible/roles/claude-workstation/**"
- "ansible/plays/install-claude-workstation.yml"
- ".woodpecker/deploy-claude-workstation.yml"
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "deploy-claude-workstation"'
timeout: 30
steps:
- name: deploy-claude-workstation
image: gitea.renner.uno/gitea_admin/ci-ansible:2026-04-29
environment:
ANSIBLE_FORCE_COLOR: "true"
ANSIBLE_HOST_KEY_CHECKING: "false"
ANSIBLE_ROLES_PATH: "../roles:./roles"
SSH_PRIVATE_KEY:
from_secret: ssh_private_key
VAULT_PASS:
from_secret: vault_pass
commands:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- printf "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null\n" > ~/.ssh/config
- cd ansible
- echo "$VAULT_PASS" > .vault_pass && chmod 600 .vault_pass
- export ANSIBLE_VAULT_PASSWORD_FILE=.vault_pass
- ansible-playbook -i inventory/ plays/install-claude-workstation.yml -v
-36
View File
@@ -1,36 +0,0 @@
when:
# Deploy only on master (merge) + manual — never auto-deploy from a branch.
- event: push
branch: master
path:
- "ansible/roles/mqtt-bridge/**"
- "ansible/plays/edge-mqtt-bridge.yml"
- "ansible/inventory/group_vars/edge_host/**"
- ".woodpecker/deploy-edge-mqtt-bridge.yml"
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "deploy-edge-mqtt-bridge"'
timeout: 30
steps:
- name: deploy-edge-mqtt-bridge
image: gitea.renner.uno/gitea_admin/ci-ansible:2026-04-29
environment:
ANSIBLE_FORCE_COLOR: "true"
ANSIBLE_HOST_KEY_CHECKING: "false"
ANSIBLE_ROLES_PATH: "../roles:./roles"
SSH_PRIVATE_KEY:
from_secret: ssh_private_key
VAULT_PASS:
from_secret: vault_pass
commands:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- printf "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null\n" > ~/.ssh/config
- cd ansible
- echo "$VAULT_PASS" > .vault_pass && chmod 600 .vault_pass
- export ANSIBLE_VAULT_PASSWORD_FILE=.vault_pass
# Local MQTT bridge on the edge hosts only (REN-1307); restarts only the
# local mosquitto on edge-1, never the cluster broker.
- ansible-playbook -i inventory/ plays/edge-mqtt-bridge.yml -v
+3 -10
View File
@@ -1,10 +1,10 @@
when:
# Plan only on master (merge) + manual — a push trigger without this gate
# Plan only on main (merge) + manual — a push trigger without this gate
# would run `tofu plan` (which evaluates provider/data-source code) with
# all proxmox/hetzner/unifi secrets mounted for any pushed branch,
# including malicious feature-branch .tf.
- event: push
branch: master
branch: main
path:
- "opentofu/**"
- ".woodpecker/deploy-infrastructure.yml"
@@ -13,7 +13,7 @@ when:
steps:
- name: validate-secrets
image: alpine:3.24.2@sha256:294b683cb724975bec92580e1e685676bd4b50bda910ddb8c51d4cabeaec77e6
image: alpine:3.24.3@sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a
environment:
TF_VAR_proxmox_api_url:
from_secret: proxmox_api_url
@@ -109,8 +109,6 @@ steps:
from_secret: hetzner_s3_access_key
TF_VAR_hetzner_s3_secret_key:
from_secret: hetzner_s3_secret_key
SSH_PRIVATE_KEY:
from_secret: ssh_private_key
PROXMOX_TOKEN_ID:
from_secret: proxmox_token_id
PROXMOX_TOKEN_SECRET:
@@ -121,11 +119,6 @@ steps:
ANSIBLE_ROLES_PATH: "../roles:./roles"
ANSIBLE_FORCE_COLOR: "true"
commands:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- export TF_VAR_ssh_private_key="$(cat ~/.ssh/id_ed25519)"
- printf "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
- echo "$VAULT_PASS" > /tmp/.vault_pass && chmod 600 /tmp/.vault_pass
- export ANSIBLE_VAULT_PASSWORD_FILE=/tmp/.vault_pass
- tofu init -upgrade -backend-config="access_key=$AWS_ACCESS_KEY_ID" -backend-config="secret_key=$AWS_SECRET_ACCESS_KEY"
-35
View File
@@ -1,35 +0,0 @@
when:
# Deploy only on master (merge) + manual — never auto-deploy from a branch.
- event: push
branch: master
path:
- "ansible/roles/netbird-client/**"
- "ansible/plays/install-netbird-client.yml"
- "ansible/inventory/group_vars/claude_workstation/**"
- ".woodpecker/deploy-netbird-client.yml"
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "deploy-netbird-client"'
timeout: 30
steps:
- name: deploy-netbird-client
image: gitea.renner.uno/gitea_admin/ci-ansible:2026-04-29
environment:
ANSIBLE_FORCE_COLOR: "true"
ANSIBLE_HOST_KEY_CHECKING: "false"
ANSIBLE_ROLES_PATH: "../roles:./roles"
SSH_PRIVATE_KEY:
from_secret: ssh_private_key
VAULT_PASS:
from_secret: vault_pass
commands:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- printf "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null\n" > ~/.ssh/config
- cd ansible
- echo "$VAULT_PASS" > .vault_pass && chmod 600 .vault_pass
- export ANSIBLE_VAULT_PASSWORD_FILE=.vault_pass
# Enrol only the off-site Claude workstation into the Netbird mesh.
- ansible-playbook -i inventory/ plays/install-netbird-client.yml --limit claude_workstation -v
-54
View File
@@ -1,54 +0,0 @@
when:
# Deploy only on master (merge) + manual — never auto-deploy from a branch.
- event: push
branch: master
path:
- "ansible/roles/netbird-proxy/**"
# install-netbird-proxy.yml also applies the netbird-proxy-watchdog role,
# so changes to it must redeploy this host too.
- "ansible/roles/netbird-proxy-watchdog/**"
# install-netbird-proxy.yml also applies the edge bouncer.
- "ansible/roles/crowdsec-edge-bouncer/**"
- "ansible/plays/install-netbird-proxy.yml"
# The variables that steer those roles, not just the roles themselves.
# Without these two, a change that only touches inventory never deploys
# and nothing says so: arming the bouncer lives in host_vars, and its
# LAPI key lives in group_vars, so both would sit in git looking applied
# while the hosts kept running the previous configuration.
#
# pve_hosts.yml is deliberately NOT listed. It is the single inventory
# file for the whole fleet, so listing it would redeploy the proxies for
# any unrelated host edit. The cost is that a change to [netbird_proxy]
# group membership needs a manual deployment run.
- "ansible/inventory/host_vars/proxy-*.yml"
- "ansible/inventory/group_vars/netbird_proxy/**"
- ".woodpecker/deploy-netbird-proxy.yml"
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "deploy-netbird-proxy"'
timeout: 30
steps:
- name: deploy-netbird-proxy
image: gitea.renner.uno/gitea_admin/ci-ansible:2026-04-29
environment:
ANSIBLE_FORCE_COLOR: "true"
ANSIBLE_HOST_KEY_CHECKING: "false"
ANSIBLE_ROLES_PATH: "../roles:./roles"
SSH_PRIVATE_KEY:
from_secret: ssh_private_key
VAULT_PASS:
from_secret: vault_pass
PROXMOX_TOKEN_ID:
from_secret: proxmox_token_id
PROXMOX_TOKEN_SECRET:
from_secret: proxmox_token_secret
commands:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- printf "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null\n" > ~/.ssh/config
- cd ansible
- echo "$VAULT_PASS" > .vault_pass && chmod 600 .vault_pass
- export ANSIBLE_VAULT_PASSWORD_FILE=.vault_pass
- ansible-playbook -i inventory/ plays/install-netbird-proxy.yml -v
-37
View File
@@ -1,37 +0,0 @@
when:
# Deploy only on master (merge) + manual — never auto-deploy from a branch.
- event: push
branch: master
path:
- "ansible/roles/netbird-server/**"
- "ansible/plays/install-netbird-server.yml"
- ".woodpecker/deploy-netbird-server.yml"
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "deploy-netbird-server"'
timeout: 30
steps:
- name: deploy-netbird-server
image: gitea.renner.uno/gitea_admin/ci-ansible:2026-04-29
environment:
ANSIBLE_FORCE_COLOR: "true"
ANSIBLE_HOST_KEY_CHECKING: "false"
ANSIBLE_ROLES_PATH: "../roles:./roles"
SSH_PRIVATE_KEY:
from_secret: ssh_private_key
VAULT_PASS:
from_secret: vault_pass
PROXMOX_TOKEN_ID:
from_secret: proxmox_token_id
PROXMOX_TOKEN_SECRET:
from_secret: proxmox_token_secret
commands:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- printf "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null\n" > ~/.ssh/config
- cd ansible
- echo "$VAULT_PASS" > .vault_pass && chmod 600 .vault_pass
- export ANSIBLE_VAULT_PASSWORD_FILE=.vault_pass
- ansible-playbook -i inventory/ plays/install-netbird-server.yml -v
-47
View File
@@ -1,47 +0,0 @@
when:
# Deploy only on master (merge) + manual — never auto-deploy from a branch.
- event: push
branch: master
path:
- "ansible/roles/uptime-kuma/**"
- "ansible/plays/install-uptime-kuma.yml"
- ".woodpecker/deploy-uptime-kuma.yml"
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "deploy-uptime-kuma"'
- event: cron
cron: uptime-kuma-token-renew
timeout: 30
steps:
- name: renew-openbao-token
image: gitea.renner.uno/gitea_admin/ci-ansible:2026-10-18
environment:
VAULT_TOKEN:
from_secret: openbao_uptime_kuma_token
commands:
- 'curl -sSf -X POST -H "X-Vault-Token: $VAULT_TOKEN" https://openbao.renner.uno/v1/auth/token/renew-self -o /dev/null'
- name: deploy-uptime-kuma
image: gitea.renner.uno/gitea_admin/ci-ansible:2026-10-18
when:
- event: [push, deployment]
environment:
ANSIBLE_FORCE_COLOR: "true"
ANSIBLE_HOST_KEY_CHECKING: "false"
ANSIBLE_ROLES_PATH: "../roles:./roles"
SSH_PRIVATE_KEY:
from_secret: ssh_private_key
VAULT_PASS:
from_secret: vault_pass
VAULT_TOKEN:
from_secret: openbao_uptime_kuma_token
commands:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- printf "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null\n" > ~/.ssh/config
- cd ansible
- echo "$VAULT_PASS" > .vault_pass && chmod 600 .vault_pass
- export ANSIBLE_VAULT_PASSWORD_FILE=.vault_pass
- ansible-playbook -i inventory/ plays/install-uptime-kuma.yml -v
+4 -4
View File
@@ -4,10 +4,10 @@
# Triggers:
# - cron : scoped to the named daily/weekly crons below. This used to be
# a bare `event: cron` (run on EVERY cron of this repo), which
# was harmless at daily/weekly cadence — but alert-monitor.yml
# fires every 15 minutes, so piggybacking must be opt-in now.
# was harmless at daily/weekly cadence but not with hourly
# crons, so piggybacking must be opt-in.
# A new cron that SHOULD also run e2e gets its name added here.
# - deploy : `woodpecker-cli pipeline deploy k.renner/homelab <n> e2e`, where
# - deploy : `woodpecker-cli pipeline deploy konairius/homelab <n> e2e`, where
# <n> is an existing pipeline to promote.
when:
@@ -26,7 +26,7 @@ steps:
# fetch-models.sh response mapping. No cluster, no secrets, no network — the
# ci-claude image just provides sh + jq. Keeps the flag-injection regression
# test from rotting (it exercises the exact injection shapes).
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.303
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.311
commands:
- sh scripts/ci/test-model-selection.sh
+29
View File
@@ -0,0 +1,29 @@
# Builds ci/images/hermes (nousresearch/hermes-agent plus the agent's CLIs) as
# gitea.renner.uno/konairius/hermes:build.<unix-ts> and :latest.
when:
- event: push
branch: main
path:
- "ci/images/hermes/**"
- ".woodpecker/hermes-image.yml"
- event: manual
steps:
- name: build
image: registry.gitlab.com/gitlab-ci-utils/container-images/kaniko:v1.25.19-debug@sha256:7795cec509a50a71378cc2c365f55c555ee3a05834d8eb1cd2552df5e66d44d8
directory: ci/images/hermes
environment:
# registry-bot write:package PAT (konairius org secret).
GITEA_TOKEN:
from_secret: registry_bot_token
commands:
- mkdir -p /kaniko/.docker
- AUTH=$(printf '%s:%s' registry-bot "$GITEA_TOKEN" | base64 | tr -d '\n')
- printf '{"auths":{"gitea.renner.uno":{"auth":"%s"}}}' "$AUTH" > /kaniko/.docker/config.json
- TAG="build.$(date +%s)"
- |
/kaniko/executor \
--context . \
--dockerfile Containerfile \
--destination gitea.renner.uno/konairius/hermes:$TAG \
--destination gitea.renner.uno/konairius/hermes:latest
-217
View File
@@ -1,217 +0,0 @@
# Issue fixer — hourly, pick the oldest open "[alert] ..." Gitea issue (filed
# by the alert-monitor pipeline, alert-monitor.yml) that nobody has worked on
# yet, hand it to an AI agent, and open a PR with the fix. One issue per run
# keeps runs bounded and PRs reviewable.
#
# "Not worked on yet" means BOTH:
# - no alert-fix/issue-<n> branch exists on origin (a branch means a PR was
# already opened — or is being opened by a concurrent run), and
# - no issue comment contains "<!-- alert-fix:assessed -->" (the marker this
# pipeline leaves when the agent concluded the problem is NOT fixable in
# the repo, so we don't burn an agent run on it every hour) — UNLESS a
# TRUSTED_AUTHORS comment is newer than the latest marker: an owner reply
# re-opens the issue for the agent, with the reply passed to it as
# pipeline-verified guidance (see below).
#
# Trusted owner guidance: comments by TRUSTED_AUTHORS are appended to the
# agent's issue.md under "Verified owner guidance". The trust anchor is the
# hardcoded author list in THIS file (reviewed via PR; agents cannot edit
# .woodpecker/). Deliberately NOT the Gitea permission API: this pipeline's
# own comments post as issue-fix-bot, which is itself a write collaborator,
# so "has write access" cannot distinguish the human from the pipeline — and
# an injected instruction inside an agent-authored comment must never be able
# to masquerade as owner guidance (the #259 lesson, in both directions: the
# agent rightly refused unauthenticated body text, but then had no channel
# for the owner's authentic reply).
#
# Tokens: a single dedicated identity, issue-fix-bot, for both the issue
# comments and the push/PR. Its PAT is scoped to write:issue +
# write:repository and nothing else. It deliberately does NOT reuse
# security_bot_token (that identity belongs to the security-review pipeline)
# nor the admin-owned gitea_token — see #330.
#
# Triggering:
# - cron : a cron NAMED exactly "issue-fix":
# woodpecker repo cron add --repo k.renner/homelab \
# --name issue-fix --branch master --schedule '41 * * * *'
# - deploy : woodpecker-cli pipeline deploy k.renner/homelab <n> issue-fix
# where <n> is an existing pipeline to promote.
when:
- event: cron
cron: issue-fix
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "issue-fix"'
steps:
- name: fetch-diag
# Least-privilege live-diagnostics kubeconfig (+ kubectl binary) for the
# fix agent, same mechanism as alert-monitor.yml. Runs unconditionally
# (the issue-pick logic needs jq, which only the ci-claude image has);
# minting a 1h read-only token per run is cheap. Degrades to
# snapshot-only if the ci-diagnostics ServiceAccount isn't reconciled.
image: gitea.renner.uno/gitea_admin/ci-k8s:2026-09-08
environment:
SOPS_AGE_KEY:
from_secret: sops_age_key
S3_ACCESS_KEY_ID:
from_secret: hetzner_s3_access_key
S3_SECRET_ACCESS_KEY:
from_secret: hetzner_s3_secret_key
commands:
- bash scripts/ci/fetch-kubeconfig.sh
- bash scripts/ci/make-diag-kubeconfig.sh
- name: issue-fix-agent
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.303
environment:
CLAUDE_CODE_OAUTH_TOKEN:
from_secret: claude_code_oauth_token
# Dedicated identity: issue-fix-bot, PAT scoped to write:issue +
# write:repository (it comments, pushes a branch, and opens a PR).
# One identity for both roles — the previous split borrowed
# security_bot_token, which belongs to the security-review pipeline
# and has no business in this trust domain (#330).
GITEA_TOKEN:
from_secret: issue_fix_bot_token
PUSH_TOKEN:
from_secret: issue_fix_bot_token
commands:
- |
# Pick the oldest unhandled [alert] issue. The repo is public, so the
# candidate reads are unauthenticated; only writes need tokens.
set -eu
TRUSTED_AUTHORS="k.renner" # space-separated; the trust anchor (see header)
mkdir -p /tmp/alert-fix
API="https://gitea.renner.uno/api/v1/repos/k.renner/homelab"
curl -sfL "$$API/issues?state=open&type=issues&limit=100" \
| jq '[.[] | select(.title | startswith("[alert] "))] | sort_by(.number)' \
> /tmp/alert-fix/candidates.json
COUNT=$$(jq length /tmp/alert-fix/candidates.json)
echo "Open [alert] issues: $$COUNT"
TRUSTED_JSON=$$(printf '%s\n' $$TRUSTED_AUTHORS | jq -R . | jq -s -c .)
i=0
while [ "$$i" -lt "$$COUNT" ]; do
NUM=$$(jq -r ".[$$i].number" /tmp/alert-fix/candidates.json)
curl -sfL "$$API/issues/$$NUM/comments" > /tmp/alert-fix/comments.json
# Eligibility in jq (ISO timestamps compare lexically; shell test
# has no portable string-< in busybox ash): eligible unless an
# assessed marker exists with no NEWER trusted-author comment.
STATE=$$(jq -r --argjson t "$$TRUSTED_JSON" '
([.[] | select(.body | contains("alert-fix:assessed")) | .created_at] | max // "") as $$mark
| ([.[] | select(.user.login as $$u | $$t | index($$u)) | .created_at] | max // "") as $$trust
| if $$mark == "" then "fresh"
elif $$trust > $$mark then "retry"
else "skip" end' /tmp/alert-fix/comments.json)
if git ls-remote --heads origin "alert-fix/issue-$$NUM" | grep -q .; then
echo "#$$NUM: branch alert-fix/issue-$$NUM already exists — skipping."
elif [ "$$STATE" = "skip" ]; then
echo "#$$NUM: assessed and no newer owner comment — skipping."
else
if [ "$$STATE" = "retry" ]; then echo "#$$NUM: owner replied after assessment — retrying with guidance."; fi
echo "Picking issue #$$NUM."
jq ".[$$i]" /tmp/alert-fix/candidates.json > /tmp/alert-fix/issue.json
{
printf '# %s\n\n' "$$(jq -r '.title' /tmp/alert-fix/issue.json)"
printf 'Issue number: %s\n\n' "$$NUM"
jq -r '.body' /tmp/alert-fix/issue.json
# Owner comments, authorship checked against TRUSTED_AUTHORS
# above. Everything in the section is authentic owner input;
# agent-authored comments never match (they post as
# issue-fix-bot) and marker comments are excluded regardless.
if [ "$$(jq -r --argjson t "$$TRUSTED_JSON" '[.[] | select((.user.login as $$u | $$t | index($$u)) and (.body | contains("alert-fix:") | not))] | length' /tmp/alert-fix/comments.json)" -gt 0 ]; then
printf '\n\n## Verified owner guidance (authorship checked by the pipeline)\n'
jq -r --argjson t "$$TRUSTED_JSON" '.[] | select((.user.login as $$u | $$t | index($$u)) and (.body | contains("alert-fix:") | not)) | "\n### \(.user.login), \(.created_at)\n\n\(.body)"' /tmp/alert-fix/comments.json
fi
} > /tmp/alert-fix/issue.md
break
fi
i=$$((i+1))
done
[ -f /tmp/alert-fix/issue.json ] || echo "Nothing to fix — all [alert] issues handled."
- |
# Branch + git identity. The bot user owns the commits so PRs are
# visibly machine-authored, and the identity names THIS pipeline —
# previously these commits and PRs were attributed to security-bot,
# which made alert fixes look like security-review output (#330).
[ -f /tmp/alert-fix/issue.json ] || exit 0
set -eu
NUM=$$(jq -r '.number' /tmp/alert-fix/issue.json)
BRANCH="alert-fix/issue-$$NUM"
git config user.email "issue-fix-bot@renner.uno"
git config user.name "Alert Fix Agent"
git checkout -b "$$BRANCH"
echo "$$BRANCH" > /tmp/alert-fix/branch
- |
# Headless fix run. Prompt piped via stdin, subscription OAuth, file
# tools plus EXACTLY ONE live command: the RBAC-scoped read-only
# kubectl from fetch-diag (no Secrets readable, prefix match forbids
# pipes and other binaries). No web (see security-scan.yml).
[ -f /tmp/alert-fix/issue.json ] || exit 0
export KUBECONFIG="$$PWD/.ci-diag/kubeconfig"
# Model chosen live from the catalog (not hardcoded, no family assumed) —
# see the header of scripts/ci/pick-model.sh. Empty MODEL -> CLI default.
MODEL=$$(sh scripts/ci/pick-model.sh "diagnose an [alert] issue against read-only live cluster state and fix the root cause by editing repo manifests; multi-step reasoning that changes infrastructure code and needs a capable model")
if [ -n "$$MODEL" ]; then echo "issue-fix: selected model $$MODEL"; else echo "issue-fix: no live catalog — using the CLI default model"; fi
cat ci/agents/issue-fix/prompt.md | claude $${MODEL:+--model $$MODEL} \
--permission-mode acceptEdits \
--allowedTools "Read,Edit,Write,Glob,Grep,Bash(./.ci-diag/kubectl:*)" \
--settings ci/agents/issue-fix/settings.json \
-p
- |
# No edits → the agent judged this not fixable in the repo. Post its
# summary (with the assessed-marker) as an issue comment so the next
# run skips this issue, and stop cleanly.
[ -f /tmp/alert-fix/issue.json ] || exit 0
set -eu
API="https://gitea.renner.uno/api/v1/repos/k.renner/homelab"
NUM=$$(jq -r '.number' /tmp/alert-fix/issue.json)
if git diff --quiet && git diff --cached --quiet \
&& [ -z "$$(git ls-files --others --exclude-standard)" ]; then
echo "Agent made no edits — commenting assessment on issue #$$NUM."
[ -s /tmp/alert-fix/summary.md ] \
|| echo "Agent made no edits and wrote no summary." > /tmp/alert-fix/summary.md
printf '\n\n<!-- alert-fix:assessed -->\n_Assessed by the issue-fix pipeline: no repo change proposed. Remove this comment to make the pipeline retry._\n' \
>> /tmp/alert-fix/summary.md
jq -n --rawfile body /tmp/alert-fix/summary.md '{body: $$body}' > /tmp/gitea-comment.json
code=$$(curl -s -o /tmp/gitea-resp.json -w '%{http_code}' \
-X POST -H "Authorization: token $$GITEA_TOKEN" \
-H "Content-Type: application/json" --data @/tmp/gitea-comment.json \
"$$API/issues/$$NUM/comments")
echo "POST comment -> HTTP $$code"
[ "$$code" -ge 200 ] && [ "$$code" -lt 300 ] || { cat /tmp/gitea-resp.json; exit 1; }
touch /tmp/alert-fix/no-edits
fi
- |
# Edits → commit, push, open the PR (Closes #<n> so the merge closes
# the issue), and link the PR from the issue.
[ -f /tmp/alert-fix/issue.json ] || exit 0
if [ -f /tmp/alert-fix/no-edits ]; then exit 0; fi
set -eu
API="https://gitea.renner.uno/api/v1/repos/k.renner/homelab"
NUM=$$(jq -r '.number' /tmp/alert-fix/issue.json)
BRANCH=$$(cat /tmp/alert-fix/branch)
TITLE="fix: $$(jq -r '.title' /tmp/alert-fix/issue.json) (#$$NUM)"
[ -s /tmp/alert-fix/summary.md ] \
|| echo "Agent-proposed fix (no summary written by the agent)." > /tmp/alert-fix/summary.md
printf '\n\nCloses #%s\n' "$$NUM" >> /tmp/alert-fix/summary.md
git add -A
git commit -m "$$TITLE"
git push "https://$$PUSH_TOKEN@gitea.renner.uno/k.renner/homelab.git" HEAD:"$$BRANCH"
jq -n --arg title "$$TITLE" --rawfile body /tmp/alert-fix/summary.md \
--arg head "$$BRANCH" \
'{title: $$title, body: $$body, head: $$head, base: "master"}' > /tmp/gitea-pr.json
code=$$(curl -s -o /tmp/gitea-resp.json -w '%{http_code}' \
-X POST -H "Authorization: token $$PUSH_TOKEN" \
-H "Content-Type: application/json" --data @/tmp/gitea-pr.json \
"$$API/pulls")
echo "POST pull -> HTTP $$code"
[ "$$code" -ge 200 ] && [ "$$code" -lt 300 ] || { cat /tmp/gitea-resp.json; exit 1; }
jq '{number, html_url, title}' /tmp/gitea-resp.json
PR_URL=$$(jq -r '.html_url' /tmp/gitea-resp.json)
jq -n --arg body "🤖 Opened $$PR_URL with a proposed fix." '{body: $$body}' > /tmp/gitea-comment.json
code=$$(curl -s -o /tmp/gitea-resp.json -w '%{http_code}' \
-X POST -H "Authorization: token $$GITEA_TOKEN" \
-H "Content-Type: application/json" --data @/tmp/gitea-comment.json \
"$$API/issues/$$NUM/comments")
echo "POST comment -> HTTP $$code"
[ "$$code" -ge 200 ] && [ "$$code" -lt 300 ] || { cat /tmp/gitea-resp.json; exit 1; }
+4 -4
View File
@@ -2,9 +2,9 @@
# pull requests. This pipeline only starts when triggered by hand and is kept for reference.
#
# PR review bot — per-repo STUB. All logic lives centrally in
# k.renner/homelab: ci/agents/pr-review/run.sh (plus prompt.md,
# konairius/homelab: ci/agents/pr-review/run.sh (plus prompt.md,
# settings.json and scripts/ci/). This file is deployed byte-identical into every
# reviewed repo (k.renner/homelab, shelly-manager, authentik-samba-bridge,
# reviewed repo (konairius/homelab, shelly-manager, authentik-samba-bridge,
# homeassistant) and holds NO logic, so the copies cannot drift apart: change the
# review in homelab and every repo picks it up on its next PR event. Only edit this
# stub if the trigger, the image or the secrets change — then change all copies in
@@ -13,7 +13,7 @@
# Triggers on pull_request: PR opened AND new commits pushed to an open PR.
# Approves only when the review found nothing red/yellow (see run.sh); humans merge.
#
# The central code is cloned from public homelab@master on every run, never taken
# The central code is cloned from public homelab@main on every run, never taken
# from the PR checkout, so a PR cannot alter the rubric or helper scripts it is
# reviewed with.
#
@@ -43,5 +43,5 @@ steps:
from_secret: review_bot_token
commands:
- rm -rf /tmp/pr-review-central
- git clone --quiet --depth 1 https://gitea.renner.uno/k.renner/homelab /tmp/pr-review-central
- git clone --quiet --depth 1 https://gitea.renner.uno/konairius/homelab /tmp/pr-review-central
- sh /tmp/pr-review-central/ci/agents/pr-review/run.sh
+1 -1
View File
@@ -6,7 +6,7 @@ when:
steps:
- name: go-test
image: golang:1.27.2-bookworm@sha256:5cf287a799e6b94384bad13d16b14904c531f51ba65792237e122ce42b392f61
image: golang:1.27.3-bookworm@sha256:972b4110ba0f47539a975c31e52c64765e1ff19f2d74469ae4a595c6676e80a5
commands:
- test -z "$(gofmt -l review-bot)"
- go -C review-bot vet ./...
+9 -9
View File
@@ -5,7 +5,7 @@
# - cron : the named `daily-security-scan` cron, matched by NAME.
# Crons cannot carry variables — `woodpecker-cli repo cron add`
# has no --var — so a variable gate can never match a cron.
# - deployment : woodpecker-cli pipeline deploy k.renner/homelab <n> security-scan
# - deployment : woodpecker-cli pipeline deploy konairius/homelab <n> security-scan
# The target rides in pipeline metadata as
# CI_PIPELINE_DEPLOY_TARGET, which the workflow-root filter
# does see, unlike manual-run variables on Woodpecker 3.18
@@ -18,12 +18,12 @@ when:
steps:
- name: iac-scan
image: aquasec/trivy:latest@sha256:2416d1f74045b57274df1a340eee6b510cacd73c66a6ccb8da092b117eb7d222
image: aquasec/trivy:latest@sha256:790fd66d1697395d8693d1acaa1ea702406a20f109b6fc7bac8db623eca6c06c
commands:
- trivy fs --format json -o trivy-iac.json --severity CRITICAL,HIGH --ignore-unfixed .
- name: image-scans
image: aquasec/trivy:latest@sha256:2416d1f74045b57274df1a340eee6b510cacd73c66a6ccb8da092b117eb7d222
image: aquasec/trivy:latest@sha256:790fd66d1697395d8693d1acaa1ea702406a20f109b6fc7bac8db623eca6c06c
commands:
- trivy image --download-db-only
- |
@@ -65,12 +65,12 @@ steps:
failure: ignore
- name: security-fix-agent
# Auto-fix run: only on master (cron / manual / direct push). On the
# Auto-fix run: only on main (cron / manual / direct push). On the
# bot's own PR branches, the scans re-run as a re-validation gate but
# this step is skipped — otherwise we'd fork-bomb PRs.
when:
- branch: master
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.303
- branch: main
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.311
environment:
CLAUDE_CODE_OAUTH_TOKEN:
from_secret: claude_code_oauth_token
@@ -147,15 +147,15 @@ steps:
TITLE="security: agent-proposed fixes ($$(date +%Y-%m-%d))"
git add -A
git commit -m "$$TITLE"
git push "https://$$GITEA_TOKEN@gitea.renner.uno/k.renner/homelab.git" HEAD:"$$BRANCH"
git push "https://$$GITEA_TOKEN@gitea.renner.uno/konairius/homelab.git" HEAD:"$$BRANCH"
jq -n \
--arg title "$$TITLE" \
--arg body "$$BODY" \
--arg head "$$BRANCH" \
'{title: $$title, body: $$body, head: $$head, base: "master"}' \
'{title: $$title, body: $$body, head: $$head, base: "main"}' \
| curl -sfL -X POST \
-H "Authorization: token $$GITEA_TOKEN" \
-H "Content-Type: application/json" \
--data @- \
https://gitea.renner.uno/api/v1/repos/k.renner/homelab/pulls \
https://gitea.renner.uno/api/v1/repos/konairius/homelab/pulls \
| jq '{number, html_url, title}'
+5 -5
View File
@@ -14,9 +14,9 @@
# `repo cron add` takes name, branch, schedule and enabled — so the
# name filter is the only thing that can select a workflow for a
# scheduled run:
# woodpecker repo cron add --repo k.renner/homelab \
# --name update-audit --branch master --schedule '@weekly'
# - deploy : woodpecker-cli pipeline deploy k.renner/homelab <n> update-audit
# woodpecker repo cron add --repo konairius/homelab \
# --name update-audit --branch main --schedule '@weekly'
# - deploy : woodpecker-cli pipeline deploy konairius/homelab <n> update-audit
# where <n> is an existing pipeline to promote.
#
# NOTE: e2e.yml runs on an explicit list of cron names that includes this one,
@@ -30,7 +30,7 @@ when:
steps:
- name: update-audit-agent
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.303
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.311
environment:
CLAUDE_CODE_OAUTH_TOKEN:
from_secret: claude_code_oauth_token
@@ -111,7 +111,7 @@ steps:
set -eu
TITLE="Infrastructure update audit"
STAMP=$$(date -u +%Y-%m-%dT%H:%M:%SZ)
API="https://gitea.renner.uno/api/v1/repos/k.renner/homelab"
API="https://gitea.renner.uno/api/v1/repos/konairius/homelab"
# write <method> <url> <payload-file> -> prints HTTP code, fails non-2xx
gitea_write() {
+8 -2
View File
@@ -1,6 +1,6 @@
# homelab
GitOps source for the Renner homelab cluster. Flux applies `master` to
GitOps source for the Renner homelab cluster. Flux applies `main` to
production, so every merge is a production change. Changes go in by pull
request only; see [CONTRIBUTING.md](CONTRIBUTING.md) for YAML conventions.
@@ -33,6 +33,12 @@ fully automatic by owner decision. If one breaks Home Assistant, roll it
back with [RUNBOOK-home-assistant-image-rollback.md](kubernetes/RUNBOOK-home-assistant-image-rollback.md).
An incident rollback is not planned work; the owner decides its timing.
Also not covered, by owner decision: the Hermes `ha-updates` job
(`kubernetes/apps/hermes/skills/ha-updates/`) installs HACS and device-firmware
updates that Home Assistant offers, and restarts Home Assistant for them, on
its own inside the 02:00–05:00 window (UniFi and SMLIGHT firmware excluded;
reported only). The window is enforced by its `ha.py`, not only by the prompt.
### 2. HA-impact review before merge
Every PR that touches `kubernetes/apps/home-assistant/`, or makes a
@@ -42,7 +48,7 @@ Assistant will notice (restart, lost integration, lost history, none) and
approves.
- Reviewer: Hestia, the Home Assistant maintainer.
- Until Hestia exists: the owner does the HA-impact review.
- Until the owner hands this review to Hestia (the `hestia` Hermes profile, which today only states the expected impact in its PRs): the owner does the HA-impact review.
This is in addition to the normal review and merge by Argus. Argus does
not merge such a PR without the HA-impact approval.
+10 -5
View File
@@ -112,7 +112,7 @@
# (string) This setting controls the default policy of fact gathering (facts discovered about remote systems).
# This option can be useful for those wishing to save fact gathering time. Both 'smart' and 'explicit' will use the cache plugin.
;gathering=implicit
gathering=smart
# (list) Set the `gather_subset` option for the :ref:`ansible_collections.ansible.builtin.setup_module` task in the implicit fact gathering. See the module documentation for specifics.
# It does **not** apply to user defined ``ansible.builtin.setup`` tasks.
@@ -134,7 +134,7 @@
;hash_behaviour=replace
# (pathlist) Comma separated list of Ansible inventory sources
inventory=~/source/homelab/ansible/inventory
inventory=inventory
# (pathspec) Colon separated paths in which Ansible will search for HttpApi Plugins.
;httpapi_plugins={{ ANSIBLE_HOME ~ "/plugins/httpapi:/usr/share/ansible/plugins/httpapi" }}
@@ -206,7 +206,7 @@ inventory=~/source/homelab/ansible/inventory
;poll_interval=15
# (path) Option for connections using a certificate or key file to authenticate, rather than an agent or passwords, you can set the default value here to avoid re-specifying --private-key with every invocation.
private_key_file=~/.ssh/id_ed25519
;private_key_file=
# (boolean) By default, imported roles publish their variables to the play and other roles, this setting can avoid that.
# This was introduced as a way to reset role variables to default values if a role is used more than once in a playbook.
@@ -274,7 +274,7 @@ roles_path=../roles:./roles
# (path) The vault password file to use. Equivalent to --vault-password-file or --vault-id
# If executable, it will be run and the resulting stdout will be used as the password.
vault_password_file=~/source/homelab/ansible/vault-password.sh
vault_password_file=vault-password.sh
# (integer) Sets the default verbosity, equivalent to the number of ``-v`` passed in the command line.
;verbosity=0
@@ -484,7 +484,7 @@ vault_password_file=~/source/homelab/ansible/vault-password.sh
# It can result in a very significant performance improvement when enabled.
# However this conflicts with privilege escalation (become). For example, when using 'sudo:' operations you must first disable 'requiretty' in /etc/sudoers on all managed hosts, which is why it is disabled by default.
# This setting will be disabled if ``ANSIBLE_KEEP_REMOTE_FILES`` is enabled.
;pipelining=False
pipelining=True
[colors]
@@ -694,3 +694,8 @@ vault_password_file=~/source/homelab/ansible/vault-password.sh
# (list) default list of tags to skip in your plays, has precedence over Run Tags
;skip=
[ssh_connection]
# Connections stay open across the plays of a run, so each host costs one
# YubiKey PIN; plays/close-connections.yml closes them at the end of a run.
ssh_args=-C -o ControlMaster=auto -o ControlPersist=30m
+17 -21
View File
@@ -41,13 +41,11 @@ Build and boot the dedicated installer image — see
4. Add the host to `[edge_host]` in `inventory/pve_hosts.yml`, by name.
That group is the base: every edge thin client belongs to it, and it
assumes no peripherals.
5. From the workstation:
5. From the workstation, in `ansible/`:
```
ansible-playbook -i inventory/pve_hosts.yml plays/install-edge-host.yml
ansible-playbook site.yml
```
One unrestricted run over the whole group. The play is self-contained --
it carries `certificates` and `common` itself, so there is no second
command and no `--limit`. Running it converges every edge host, which is
One unrestricted run, no `--limit`. It converges every host, which is
the point: a run that touches only the new box tells you nothing about
the others.
@@ -72,14 +70,14 @@ none of these commands.
## Secrets (before first play run)
Create `inventory/group_vars/edge_host/vault.yml` with ansible-vault; the
current live values come straight out of the cluster:
Create `inventory/group_vars/edge_host/vault.yml` with ansible-vault. The
cluster broker has no `open3e` user: edge-1 logs in only as the register
account `edge-1` (see "MQTT bridge" below), so
`vault_edge_open3e_mqtt_password` reaches only the loopback broker, which
allows anonymous clients; any random value works (`openssl rand -hex 24`).
The zwave-js value comes out of the cluster:
```
# sml2mqtt broker password
kubectl -n home-assistant get secret mosquitto-sml2mqtt-credentials -o jsonpath='{.data.password}' | base64 -d
# open3e broker password
kubectl -n home-assistant get secret mosquitto-open3e-credentials -o jsonpath='{.data.password}' | base64 -d
# zwave-js session secret
kubectl -n home-assistant get secret zwave-js-session -o jsonpath='{.data.session-secret}' | base64 -d
```
@@ -230,15 +228,14 @@ They connect to a **local mosquitto on loopback** (`127.0.0.1:1883`,
broker is briefly unreachable, and flushes on reconnect — edge-1 no longer
hard-depends on cluster/network uptime for every publish.
Two bridge `connection`s preserve the existing cluster identities, so **no
cluster-side change was needed**: one authenticates as the `open3e` user
(carries `open3e/#` out + `open3e/cmnd` back), one as `sml2mqtt` (`sml2mqtt/#`
out). The local broker is `allow_anonymous` on loopback — the trust boundary
is the host; nothing off-host can reach it.
The local broker is `allow_anonymous` on loopback — the trust boundary is the
host; nothing off-host can reach it.
**Bridge credential (REN-1307).** The two vault-password bridges are being
replaced by one bridge as the register account `edge-1`
(`kubernetes/apps/home-assistant/mqtt-accounts.yaml`). Its password is pushed
**Bridge credential (REN-1307).** One bridge `connection` logs in as the
register account `edge-1` (`kubernetes/apps/home-assistant/mqtt-accounts.yaml`)
and carries `open3e/#` out and `open3e/cmnd` back. The cluster broker does not
accept the vault-password bridges in `bridge.d/legacy.conf`, which exists only
until the first push. Its password is pushed
by mqtt-account-controller to `edge-mqtt-cred` (`:8443`, the controller's
esp32 API over HTTPS). That endpoint accepts only a client certificate from
the MQTT CA with CN `mqtt-account-controller`; edge-1 holds the public CA and
@@ -246,8 +243,7 @@ its own server key, nothing else. On a push it writes
`/etc/mosquitto/bridge.d/edge-1.conf`, deletes `bridge.d/legacy.conf` and
restarts the local mosquitto. The controller sets a new password whenever the
bridge reports "not connected" (also after a reinstall), so no play run is
needed for a rotation. `.woodpecker/deploy-edge-mqtt-bridge.yml` runs
`plays/edge-mqtt-bridge.yml` on merge. Diagnosis: `journalctl -u
needed for a rotation. Diagnosis: `journalctl -u
edge-mqtt-cred`, and `mosquitto_sub -t '$SYS/broker/connection/edge-1/state'`
(retained `1` = connected).
-67
View File
@@ -1,67 +0,0 @@
#!/usr/bin/env python3
"""
Discover Shelly devices on the network via HTTP API
Returns JSON array of discovered devices
"""
import sys
import json
import ipaddress
import concurrent.futures
import urllib.request
import urllib.error
def check_shelly(ip):
"""Check if IP is a Shelly device and return info"""
try:
url = f"http://{ip}/shelly"
req = urllib.request.Request(url, headers={'User-Agent': 'Ansible-Shelly-Discovery'})
with urllib.request.urlopen(req, timeout=2) as response:
data = json.loads(response.read().decode())
# Gen1 devices don't have 'gen' field, default to 1
gen = data.get('gen', 1)
if gen is None:
gen = 1
return {
'ip': str(ip),
'type': data.get('type', 'unknown'),
'mac': data.get('mac', ''),
'gen': gen,
'name': data.get('name', data.get('id', str(ip))),
'fw_id': data.get('fw_id', data.get('fw', 'unknown'))
}
except (urllib.error.URLError, urllib.error.HTTPError, OSError, json.JSONDecodeError):
return None
except Exception:
return None
def main():
if len(sys.argv) < 2:
print("Usage: discover_shelly.py <network1> [network2] ...")
print("Example: discover_shelly.py 10.2.30.0/24 10.2.20.0/24")
sys.exit(1)
networks = sys.argv[1:]
devices = []
# Collect all IPs to scan
all_ips = []
for network in networks:
try:
all_ips.extend(ipaddress.IPv4Network(network).hosts())
except ValueError as e:
print(f"Invalid network: {network} - {e}", file=sys.stderr)
continue
# Scan in parallel
with concurrent.futures.ThreadPoolExecutor(max_workers=100) as executor:
results = executor.map(check_shelly, all_ips)
for result in results:
if result:
devices.append(result)
# Output JSON
print(json.dumps(devices, indent=2))
if __name__ == "__main__":
main()
+7 -24
View File
@@ -5,27 +5,10 @@ pve_token_id: "ansible"
ansible_user: "ladmin"
ansible_python_interpreter: /usr/bin/python3
# SSH Public Keys for Cloud-Init
# ansible-runner@ci-new removed (issue #184): dead key, no such host exists.
common_ssh_public_keys: |
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPzFNBP3bq2m/6JqDqod9w+FP/uxXxHMolqhq3Ojflr1 krenner@fortress
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICyNnX1I4W9jyDvCJ1DJauHSmbo1ZXSyBxVhSAwMWgen woodpecker-ci@homelab
# Network-of-origin restriction for the woodpecker-ci@homelab CI key
# (issue #184). Consumed by plays/configure-ssh-keys.yml as the authorized_key
# `from=` option so the CI key only authenticates from within the cluster's
# pod network — NOT from any host-pinned IP.
#
# The in-cluster Woodpecker step pods SSH to fleet hosts using their POD IP as
# source, not a node IP: Cilium runs `ipv4-native-routing-cidr=10.0.0.0/8` +
# `ipv6-native-routing-cidr=fd00::/8` with masquerade enabled, so pod egress to
# any 10.x / fd.. LAN destination is NOT SNAT'd, and each node's PodCIDR is
# advertised to the UDM over BGP (kubernetes/infrastructure/post-crds/
# cilium-bgp.yaml) so return traffic L3-routes back to the pod. Hosts therefore
# see the real pod source IP.
#
# The cluster pod subnets (kubernetes/talos/patches/cluster.yaml podSubnets)
# are the stable boundary — they survive node DHCP-lease churn and pod
# rescheduling across k8s-1/2/3, unlike pinning any node's current IP.
# v6 is included because some SSH targets (edge IoT hosts) are IPv6-only.
ci_ssh_from_cidrs: '10.244.0.0/16,fd10:244::/48'
# The only plain key the admin logins accept on [ssh_keys_managed] hosts
# (ssh-ca role, tasks/authorized_keys.yml). People log in with OpenBao SSH CA
# certificates; this one is for when that path is unavailable.
# breakglass-neo: PIV key (slot 9a, PIN) on the offline YubiKey NEO.
# ssh -I /usr/lib/opensc-pkcs11.so root@<host>
ssh_admin_authorized_keys:
- key: "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKvSl9LUP8u3S2Sq5YTWpW0Jxbue8cJhD7/LMFQbEsa3xo145HVR7pBzRxW71MUy+jgrgmpSlDhIb606Hswhvoo= breakglass-neo-6532348"
@@ -1,16 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
35646538363164363061366433343963623166336630376233333033646637336266343337343230
3233356135323762636439336466663430366238363338650a633762623366643137303333383634
62623739363132303335636261626263333332623066303161633466306431623930666166323833
6439663964353338350a656435626664646666363831363164393335386666356637613037323838
63653461656366613331353064656161346263356131346437666632386166623037373363333534
37323435623366643534633333303534313434613135653237303966656162633266623433363934
36343133393834393765353338383764303664363431653865633764306138376366623832346262
36303766623331666632613639366139333661636665363631326565653938343637323861653064
37393465383263376337376639613162306563653365623036376662303030613264653534353332
66363030356363373439306164386561363734353631363738656236633164633062613437663366
62386430396262366336316166353366383233316333333234666538643962336361363630363762
31653963303032373531386566336632336130383034343430303964396538663237346434613737
39643765623766373639306132316635376434643232336163303066393736313130323065666232
39393038616162666666383837326137376233613437636361636238663566336365653863643933
353338646134383038323134323034653564
@@ -50,3 +50,11 @@ edge_mqtt_host: 127.0.0.1
edge_mqtt_port: 1883
edge_open3e_mqtt_user: open3e
edge_open3e_mqtt_topic: open3e
# Units claude-bot may restart (ssh-ca role); the containers go through docker.
ssh_ca_claude_sudo_units:
- mosquitto
- edge-mqtt-cred
- edge-alloy
- keepalived
- chronyd
@@ -0,0 +1,9 @@
---
# The host NetBird client (wt0) must not take over DNS: resolv.conf is pinned to
# the systemd-resolved stub by the netbird-proxy role.
netbird_disable_dns: true
ssh_ca_claude_sudo_units:
- netbird
- netbird-proxy-flood-watchdog
- crowdsec-firewall-bouncer
@@ -2,3 +2,6 @@
# NetBird server - VPS not managed by Proxmox
# Enable Docker monitoring (cAdvisor) for container metrics
docker_monitoring_enabled: true
ssh_ca_claude_sudo_units:
- netbird
+28 -10
View File
@@ -13,11 +13,11 @@
# Their hosts no longer resolve, except the three that resolve to Talos nodes.
[netbird_server]
netbird.renner.uno ansible_user=root
netbird.renner.uno ansible_host=netbird.nb.renner.uno ansible_user=root
[netbird_proxy]
proxy-1.renner.uno ansible_user=root
proxy-2.renner.uno ansible_user=root
proxy-1.renner.uno ansible_host=proxy-1.nb.renner.uno ansible_user=root
proxy-2.renner.uno ansible_host=proxy-2.nb.renner.uno ansible_user=root
# Every bare-metal edge thin client. Gets the host-generic roles only:
# flash-wear handling, the log shipper, the MQTT bridge, the VLAN
@@ -62,10 +62,28 @@ heating_can
[ntp_cluster:children]
edge_host
# Off-site Debian VM (Synology VMM on nas-2, 10.3.40.0/24) running Claude Code.
# Reached over the site-to-site tunnel at its current DHCP lease. Switch
# ansible_host to the stable Netbird mesh IP once the host is enrolled — the
# obg.renner.uno FQDN is split-horizon and resolves to the public proxy from
# home, so it must NOT be used as ansible_host.
[claude_workstation]
claude-ws ansible_host=10.3.40.78 ansible_user=root
# Hosts that trust the OpenBao SSH user CA (plays/configure-ssh-ca.yml).
# Rolled out one host at a time: add the next host after the previous one
# was verified.
[ssh_ca]
proxy-1.renner.uno
proxy-2.renner.uno
netbird.renner.uno
edge-1.iot.renner.uno
# Hosts whose admin logins accept only ssh_admin_authorized_keys (break-glass);
# everything else needs a CA certificate. Members must be in [ssh_ca].
# Added one host at a time after the [ssh_ca] report was reviewed.
[ssh_keys_managed]
proxy-1.renner.uno
proxy-2.renner.uno
netbird.renner.uno
edge-1.iot.renner.uno
# Internet hosts whose sshd listens on the NetBird interface only
# (plays/configure-ssh-mesh-only.yml). Members need the host NetBird client.
# Added one host at a time after the previous one was verified.
[ssh_mesh_only]
proxy-1.renner.uno
proxy-2.renner.uno
netbird.renner.uno
+11
View File
@@ -0,0 +1,11 @@
---
# Last play of every playbook that is run directly (site.yml and the one-off
# actions). SSH connections stay open for 30 minutes (ansible.cfg) so a run
# costs one YubiKey PIN per host; closing them at the end leaves nothing that
# another process of the same user could reuse.
- name: Close the SSH connections
hosts: all
gather_facts: false
tasks:
- name: Close the connection
ansible.builtin.meta: reset_connection
+2 -1
View File
@@ -13,4 +13,5 @@
roles:
- common
- qemu-guest-agent
- role: qemu-guest-agent
when: ansible_facts['virtualization_role'] == 'guest'
-125
View File
@@ -1,125 +0,0 @@
---
# Configure NTP server on all Shelly devices
# Discovers Shelly devices via network scan and configures them to use local NTP server
#
# Usage:
# ansible-playbook plays/configure-shelly-ntp.yml
# ansible-playbook plays/configure-shelly-ntp.yml -e "shelly_ntp_server=10.2.40.4"
# ansible-playbook plays/configure-shelly-ntp.yml -e "shelly_networks=10.2.30.0/24,10.2.20.0/24"
- name: Configure Shelly NTP Settings
hosts: localhost
connection: local
gather_facts: no
vars:
shelly_ntp_server: "ntp.renner.uno"
shelly_networks: "10.2.30.0/24 10.2.20.0/24"
shelly_timeout: 5
tasks:
- name: Discover Shelly devices on network
script: "{{ playbook_dir }}/../files/discover_shelly.py {{ shelly_networks }}"
args:
executable: python3
register: discovered_devices
changed_when: false
- name: Parse discovered devices
set_fact:
shelly_devices: "{{ discovered_devices.stdout | from_json }}"
- name: Display discovered Shelly devices
debug:
msg: "Found {{ shelly_devices | length }} Shelly devices"
- name: Show device list
debug:
msg: "{{ item.name }} ({{ item.type }}) - {{ item.ip }} - Gen{{ item.gen }}"
loop: "{{ shelly_devices }}"
when: shelly_devices | length > 0
- name: Configure NTP on Gen1 devices
uri:
url: "http://{{ item.ip }}/settings?sntp_server={{ shelly_ntp_server }}"
method: GET
timeout: "{{ shelly_timeout }}"
return_content: yes
loop: "{{ shelly_devices | selectattr('gen', 'equalto', 1) | list }}"
register: gen1_results
ignore_errors: yes
when: shelly_devices | length > 0
- name: Configure NTP on Gen2+ devices
uri:
url: "http://{{ item.ip }}/rpc/Sys.SetConfig"
method: POST
body_format: json
body:
config:
sntp:
server: "{{ shelly_ntp_server }}"
timeout: "{{ shelly_timeout }}"
return_content: yes
loop: "{{ shelly_devices | selectattr('gen', 'greaterthan', 1) | list }}"
register: gen2_results
ignore_errors: yes
when: shelly_devices | length > 0
- name: Verify Gen1 NTP configuration
uri:
url: "http://{{ item.ip }}/settings"
method: GET
timeout: "{{ shelly_timeout }}"
return_content: yes
loop: "{{ shelly_devices | selectattr('gen', 'equalto', 1) | list }}"
register: gen1_verify
ignore_errors: yes
when: shelly_devices | length > 0
- name: Verify Gen2+ NTP configuration
uri:
url: "http://{{ item.ip }}/rpc/Sys.GetConfig"
method: GET
timeout: "{{ shelly_timeout }}"
return_content: yes
loop: "{{ shelly_devices | selectattr('gen', 'greaterthan', 1) | list }}"
register: gen2_verify
ignore_errors: yes
when: shelly_devices | length > 0
- name: Summary - Gen1 devices configured
debug:
msg: "{{ item.item.name }} ({{ item.item.ip }}): NTP={{ item.json.sntp.server | default('unknown') }}"
loop: "{{ gen1_verify.results | default([]) }}"
when:
- gen1_verify is defined
- gen1_verify.results is defined
- item.json is defined
- item.json.sntp is defined
loop_control:
label: "{{ item.item.name | default(item.item.ip) }}"
- name: Summary - Gen2+ devices configured
debug:
msg: "{{ item.item.name }} ({{ item.item.ip }}): NTP={{ item.json.sntp.server | default('unknown') }}"
loop: "{{ gen2_verify.results | default([]) }}"
when:
- gen2_verify is defined
- gen2_verify.results is defined
- item.json is defined
- item.json.sntp is defined
loop_control:
label: "{{ item.item.name | default(item.item.ip) }}"
- name: Final summary
debug:
msg: |
==========================================
Shelly NTP Configuration Complete
==========================================
Total devices found: {{ shelly_devices | length }}
Gen1 devices: {{ shelly_devices | selectattr('gen', 'equalto', 1) | list | length }}
Gen2+ devices: {{ shelly_devices | selectattr('gen', 'greaterthan', 1) | list | length }}
NTP Server: {{ shelly_ntp_server }}
==========================================
+23
View File
@@ -0,0 +1,23 @@
---
# Trust the OpenBao SSH user CA (ssh-client-signer) on the hosts in [ssh_ca]:
# owner certificates (principal k.renner) for root/ladmin, Claude's 1h
# certificates (principal claude-bot) for its own claude-bot account with
# limited sudo. The role reports the admin logins' authorized_keys; on
# [ssh_keys_managed] they are then reduced to ssh_admin_authorized_keys.
#
# serial: 1 so a host whose sshd rejects the change stops the run before the
# next host is touched. One play, so each host needs one login (one YubiKey
# PIN from a workstation).
- name: Configure the SSH user CA
hosts: ssh_ca
become: true
gather_facts: true
serial: 1
roles:
- ssh-ca
tasks:
- name: Reduce authorized_keys to the break-glass key
ansible.builtin.include_role:
name: ssh-ca
tasks_from: authorized_keys
when: inventory_hostname in groups['ssh_keys_managed']
-48
View File
@@ -1,48 +0,0 @@
---
- name: Deploy authorized SSH keys to all hosts
hosts: all:!localhost
become: true
gather_facts: false
# Authorized keys deployed to root and ladmin on every managed host.
#
# - krenner@fortress (human): unrestricted.
# - woodpecker-ci@homelab (CI): restricted with from= to the cluster's pod
# network (ci_ssh_from_cidrs in group_vars/all/vars.yml). The in-cluster
# Woodpecker step pods SSH to fleet hosts presenting their POD IP as source
# (Cilium native-routing-cidr covers the LAN, so no SNAT; PodCIDRs are
# BGP-advertised). This is a network-of-origin restriction, NOT host-pinned,
# so it survives node DHCP churn and pod rescheduling. See vars.yml for the
# full derivation.
# - ansible-runner@ci-new: removed — dead key, no such host exists.
vars:
authorized_keys:
- key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPzFNBP3bq2m/6JqDqod9w+FP/uxXxHMolqhq3Ojflr1 krenner@fortress"
- key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICyNnX1I4W9jyDvCJ1DJauHSmbo1ZXSyBxVhSAwMWgen woodpecker-ci@homelab"
options: 'from="{{ ci_ssh_from_cidrs }}"'
tasks:
- name: Check SSH connectivity
ansible.builtin.wait_for_connection:
timeout: 5
ignore_errors: true
register: ssh_check
- name: Skip unreachable hosts
ansible.builtin.meta: end_host
when: ssh_check is failed
- name: Deploy authorized keys to root
ansible.builtin.authorized_key:
user: root
key: "{{ item.key }}"
key_options: "{{ item.options | default(omit) }}"
state: present
loop: "{{ authorized_keys }}"
- name: Deploy authorized keys to ladmin
ansible.builtin.authorized_key:
user: ladmin
key: "{{ item.key }}"
key_options: "{{ item.options | default(omit) }}"
state: present
loop: "{{ authorized_keys }}"
ignore_errors: true
+15
View File
@@ -0,0 +1,15 @@
---
# sshd on the hosts in [ssh_mesh_only] accepts connections only on the NetBird
# interface; nothing listens on their public addresses. Run from a workstation
# in the mesh. A switchover reverts by itself unless the play logs in again
# through the new listener.
#
# serial: 1 so a host that does not come back stops the run before the next
# host is touched.
- name: Restrict sshd to the mesh interface
hosts: ssh_mesh_only
become: true
gather_facts: true
serial: 1
roles:
- ssh-mesh-only
+2
View File
@@ -29,6 +29,7 @@
- name: Check if systemd-timesyncd is installed
command: systemctl list-unit-files systemd-timesyncd.service
register: timesyncd_installed
check_mode: false
failed_when: false
changed_when: false
@@ -56,6 +57,7 @@
- name: Verify time sync status
command: timedatectl show --property=NTPSynchronized
register: timesync_status
check_mode: false
changed_when: false
failed_when: false
-33
View File
@@ -1,33 +0,0 @@
---
# Local MQTT bridge and its credential receiver only (REN-1307). Run by
# .woodpecker/deploy-edge-mqtt-bridge.yml on merge, so a change to this role
# reaches edge-1 without a play run by hand. The full base play
# (install-edge-host.yml) carries the same role.
- name: Converge the edge MQTT bridge
hosts: edge_host
become: true
# The SML power-meter reader (sml2mqtt) is retired for good: owner decision
# 2026-09-19, grid data comes from the E380 on the CAN bus. Its role and
# play are gone; this removes the leftover compose project from edge-1 on
# the next pipeline run. Idempotent: a no-op once the directory is gone.
pre_tasks:
- name: Check for the retired sml2mqtt compose project
ansible.builtin.stat:
path: /opt/edge-host/sml2mqtt/docker-compose.yml
register: edge_sml2mqtt_compose
- name: Stop the retired sml2mqtt container
ansible.builtin.command:
cmd: docker compose down --remove-orphans
chdir: /opt/edge-host/sml2mqtt
when: edge_sml2mqtt_compose.stat.exists
changed_when: true
- name: Remove the retired sml2mqtt directory
ansible.builtin.file:
path: /opt/edge-host/sml2mqtt
state: absent
roles:
- mqtt-bridge
@@ -1,20 +0,0 @@
---
# Off-site Debian VM running Claude Code — reattachable interactive sessions
# plus an unattended notes-distill timer. Host creation (Synology VMM), the
# Netbird dashboard route and secret material are manual prerequisites; see
# roles/claude-workstation/README.md and docs/claude-workstation.md.
#
# CI reaches this off-site host over the site-to-site tunnel (home -> off-site
# works), same as it reaches every other inventory host.
- name: Deploy the Claude Code workstation
hosts: claude_workstation
become: true
# qemu-guest-agent is applied
# to every inventory host by the umbrella plays/common.yml, same as for the
# netbird-proxy host — run that against this host too (see RUNBOOK Step 5).
roles:
- common
- role: netbird-client # mesh enrolment (needs netbird_setup_key in vault)
when: netbird_setup_key is defined
- claude-workstation
+10 -11
View File
@@ -6,26 +6,25 @@
# - host_vars/<hostname>/vars.yml - per-host key (overrides group)
# - group_vars/all/vault.yml - encrypted keys
#
# Usage:
# ansible-playbook -i inventory/ plays/setup-netbird-client.yml
#
# Limit to specific hosts:
# ansible-playbook -i inventory/ plays/setup-netbird-client.yml --limit caddy_servers
# Applied by site.yml.
- name: Install NetBird client on hosts with setup key defined
hosts: all
become: true
gather_facts: true
# One host at a time: from a workstation every new SSH session asks for the
# YubiKey PIN and a touch, and parallel hosts would prompt at once.
serial: 1
# Facts only after the skip: gathering them first opens an SSH session (a
# YubiKey touch from a workstation) to every host, including skipped ones.
gather_facts: false
pre_tasks:
- name: Check if netbird_setup_key is defined
ansible.builtin.debug:
msg: "NetBird setup key is defined for {{ inventory_hostname }}"
when: netbird_setup_key is defined
- name: Skip hosts without netbird_setup_key
ansible.builtin.meta: end_host
when: netbird_setup_key is not defined
- name: Gather facts
ansible.builtin.setup:
roles:
- netbird-client
+1 -1
View File
@@ -1,6 +1,6 @@
---
# Deploy the NetBird reverse-proxy HA cluster members (the public edge).
# Usage: ansible-playbook -i inventory/ plays/install-netbird-proxy.yml
# Applied by site.yml.
#
# Prerequisites:
# - Proxy VPS provisioned (proxy-1 is Arch Linux), root SSH reachable, and
+1 -1
View File
@@ -1,6 +1,6 @@
---
# Deploy NetBird Server to VPS
# Usage: ansible-playbook -i inventory/ plays/install-netbird-server.yml
# Applied by site.yml.
#
# Prerequisites:
# - VPS provisioned with Ubuntu 22.04/24.04
-22
View File
@@ -1,22 +0,0 @@
---
# Install Node Exporter on all managed hosts
# Usage: ansible-playbook -i inventory/ plays/install-node-exporter.yml
- name: Install Node Exporter
hosts: all
become: yes
gather_facts: yes
roles:
- node-exporter
post_tasks:
- name: Verify node-exporter is running
uri:
url: "http://127.0.0.1:9100/metrics"
status_code: 200
register: exporter_health
retries: 3
delay: 5
until: exporter_health.status == 200
ignore_errors: yes
+44 -20
View File
@@ -102,32 +102,45 @@
ansible.builtin.pause:
seconds: 5
- name: Verify chrony is serving NTP
ansible.builtin.shell: chronyc clients | head -10
register: chrony_clients
- name: Verify chronyd answers
ansible.builtin.command:
argv:
- chronyc
- -n
- tracking
check_mode: false
changed_when: false
- name: Check NTP port is listening
ansible.builtin.shell: ss -lun | grep ':123 '
- name: Verify chronyd listens on udp/123
ansible.builtin.command:
argv:
- ss
- -Hlunp
- sport = :123
register: ntp_port
failed_when: false
check_mode: false
changed_when: false
- name: Display NTP port status
ansible.builtin.debug:
msg: "NTP port 123: {{ 'LISTENING' if ntp_port.rc == 0 else 'NOT LISTENING' }}"
failed_when: "'chronyd' not in ntp_port.stdout"
- name: Check if this server has the VIP
ansible.builtin.shell: ip addr show | grep {{ ntp_vip }}
ansible.builtin.command:
argv:
- ip
- -4
- addr
- show
- to
- "{{ ntp_vip }}"
register: vip_check
failed_when: false
check_mode: false
failed_when: vip_check.rc != 0
changed_when: false
when: ntp_keepalived_enabled | default(false)
- name: Display VIP status
ansible.builtin.debug:
msg: >
{% if vip_check.rc == 0 %}
{% if vip_check.stdout | default('') | length > 0 %}
This server ({{ inventory_hostname }}) is MASTER and holds the VIP {{ ntp_vip }}
{% else %}
This server ({{ inventory_hostname }}) is BACKUP
@@ -159,7 +172,8 @@
- to
- "{{ ntp_vip6 }}"
register: vip6_check
failed_when: false
check_mode: false
failed_when: vip6_check.rc != 0
changed_when: false
when: ntp_keepalived_enabled | default(false)
@@ -184,18 +198,28 @@
(keepalived not enabled on this host).
when: not (ntp_keepalived_enabled | default(false))
- name: Test NTP via VIP (only on master)
ansible.builtin.shell: |
chronyc -h {{ ntp_vip }} tracking 2>&1 || echo "Cannot connect to VIP (may need to wait for failover)"
# chronyc talks to the command port, which is loopback-only; this is a real
# NTP query. Directives on the command line mean no config file and no
# pidfile, and -Q opens no server or command port, so it runs alongside
# the live daemon.
- name: Query NTP through the VIP (only on master)
ansible.builtin.command:
argv:
- chronyd
- -Q
- -t
- "10"
- "server {{ ntp_vip }} iburst maxsamples 1"
register: ntp_vip_test
check_mode: false
when:
- ntp_keepalived_enabled | default(false)
- vip_check.rc == 0
- vip_check.stdout | default('') | length > 0
changed_when: false
- name: Display VIP NTP test result
ansible.builtin.debug:
msg: "{{ ntp_vip_test.stdout_lines | default(['Not master, skipping VIP test']) }}"
msg: "{{ ntp_vip_test.stderr_lines + ntp_vip_test.stdout_lines }}"
when:
- ntp_keepalived_enabled | default(false)
- vip_check.rc == 0
- vip_check.stdout | default('') | length > 0
+5 -2
View File
@@ -1,11 +1,14 @@
---
# Deploy Uptime Kuma to the NetBird VPS
# Usage: ansible-playbook -i inventory/ plays/install-uptime-kuma.yml
# Applied by site.yml.
#
# Prerequisites:
# - netbird-server play applied (docker, Traefik on netbird_netbird)
# - OpenBao homelab/infrastructure/uptime-kuma with keys username, password
# - VAULT_TOKEN in the environment (policy: uptime-kuma-vps)
# - OpenBao homelab/infrastructure/uptime-kuma/smtp with keys server, port, username, token
# - homelab/infrastructure/uptime-kuma-metrics (key api_key) is written by the role
# - an OpenBao token with policy uptime-kuma-vps: `bao login -method=oidc`
# (role owner) or VAULT_TOKEN
# - DNS for kuma.renner.uno pointing at the VPS
- name: Deploy Uptime Kuma
+3
View File
@@ -248,3 +248,6 @@
- "Commit inventory/group_vars/all/netbird-rotatable.yml — it is encrypted."
- "NOT rotated: datastore_key (needs dump/restore), auth_client_secret (Authentik side)."
- "OpenBao is unaffected by design — its NetBird credentials are separate ones."
- name: Close the SSH connections
ansible.builtin.import_playbook: close-connections.yml
+3 -1
View File
@@ -43,7 +43,6 @@
- ubuntu_upgrade.rc != 0
- "'No new release found' not in ubuntu_upgrade.stdout"
- "'No new release found' not in ubuntu_upgrade.stderr"
ignore_errors: true
- name: Display Upgrade Result
ansible.builtin.debug:
@@ -111,3 +110,6 @@
when:
- (ansible_distribution == 'Ubuntu' and reboot_required.stat.exists) or
(ansible_distribution == 'Debian')
- name: Close the SSH connections
ansible.builtin.import_playbook: close-connections.yml
+33
View File
@@ -0,0 +1,33 @@
---
# Package upgrade + reboot for netbird_proxy, edge_host and netbird_server,
# one host at a time.
# Usage (from ansible/): ansible-playbook plays/update-os.yml
#
# Plays run in order; a failed host stops the whole run (max_fail_percentage: 0).
- name: Update NetBird proxies
hosts: netbird_proxy
serial: 1
max_fail_percentage: 0
become: true
roles:
- os-update
- name: Update edge hosts
hosts: edge_host
serial: 1
max_fail_percentage: 0
become: true
roles:
- os-update
- name: Update NetBird server
hosts: netbird_server
serial: 1
max_fail_percentage: 0
become: true
roles:
- os-update
- name: Close the SSH connections
ansible.builtin.import_playbook: close-connections.yml
@@ -18,6 +18,7 @@
- name: Get installed version
command: "{{ chrony_exporter_binary }} --version"
register: installed_version
check_mode: false
when: chrony_exporter_installed.stat.exists
changed_when: false
failed_when: false
@@ -1,57 +0,0 @@
# claude-workstation
An always-on, **off-site** headless Claude Code host (Debian 12 VM under Synology
VMM on nas-2). It runs (a) reattachable interactive `tmux` sessions and (b) an
unattended notes-distill timer. It deliberately holds the **least** privilege
that still does the job.
## What lives here vs. what's manual
This role configures everything **inside** the VM. Three things are **manual**
(no IaC path) and precede/accompany it — see [`RUNBOOK.md`](RUNBOOK.md) for the
full step-by-step:
1. **VM creation** in Synology VMM (`ladmin` has no sudo; the DSM API is
root-only), with a cloud-init drive that installs the CI SSH key.
2. **Netbird dashboard route** advertising the k8s API to the mesh, and the
**site-to-site return route** on the off-site gateway (backup path).
3. **Secret material**: `claude setup-token` (subscription OAuth), the claude-bot
creds, and the read-only SA kubeconfig — encrypted into the group vault.
## Credential isolation
Two Unix users with separate credential stores so an unattended job cannot read
the interactive session's secrets:
| User | Holds | Runs |
|------|-------|------|
| `claude` | OAuth token, claude-bot creds, **read-only** SA kubeconfig | interactive tmux |
| `claude-job` | its **own** OAuth token, claude-bot creds (no kubeconfig) | notes-distill timer |
**No talosconfig, no SOPS age key** ever land here (Fable review #1). The
kubeconfig is a read-only `view` ServiceAccount (`kubernetes/apps/claude-workstation/`).
## Egress lockdown (staged)
`claude_ws_egress_enforce` ships **`false`** so a fresh host is never bricked.
The deny-default nftables ruleset, the DNS-resolver, and its refresh timer are
installed regardless. Flip to `true` (in host/group vars) only after confirming
`claude_ws_egress_allow_fqdns` / `claude_ws_egress_allow_cidrs*` cover real
traffic — watch the `claude-egress-dropped` counter first.
## Vault keys (encrypt into `inventory/group_vars/claude_workstation/vault.yml`)
```
netbird_setup_key # from the Netbird dashboard
claude_ws_oauth_token_interactive # `claude setup-token` (interactive user)
claude_ws_oauth_token_job # `claude setup-token` (job user, separate)
claude_ws_gitea_token # claude-bot PAT
claude_ws_gitea_git_credentials # https://claude-bot:<pat>@gitea.renner.uno
claude_ws_kubeconfig # read-only SA kubeconfig (literal YAML)
```
## Kill switch
Everything unattended hangs off systemd timers; `systemctl disable --now
claude-notes-distill.timer` (and the egress refresh) stops it. Every credential
is independently revocable (SA token, claude-bot PAT, OAuth token, Netbird peer).
-222
View File
@@ -1,222 +0,0 @@
# Runbook — off-site Claude Code workstation (nas-2)
Operator guide for the manual steps around the `claude-workstation` role. The
role automates everything **inside** the VM; this covers what it can't:
VM creation, networking, secret material, egress cutover, rotation and DR.
## Architecture (scope)
An always-on **Debian 13 VM under Synology VMM on the off-site nas-2**
(DS1522+, 10.3.40.0/24, reached over the site-to-site VPN, ~55 ms). It runs:
- **Reattachable interactive sessions** (`tmux` over SSH as user `claude`).
- **Unattended notes-distill timer** (as user `claude-job`).
- **A thin is-home-up signal** (the existing external Gatus on the Netbird VPS
already covers this — don't duplicate it).
**Out of scope (runs in-cluster instead):** scheduled repo-automation and
cluster-reports go in as Woodpecker cron / CronJobs with an in-cluster
ServiceAccount — *not* on this VM, so the VM holds no cluster-write creds.
Credentials on the VM are minimal: a **read-only** `view` SA kubeconfig,
claude-bot (non-admin) gitea creds, and a Claude subscription OAuth token.
**No talosconfig, no SOPS age key.**
---
## Step 1 — Create + install the VM (Synology VMM)
`ladmin` has no sudo and the DSM API is root-only, so VMM is driven through the
DSM **web UI**. Two hard facts dictate the method (all confirmed 2026-07-16, as
built): **VMM has no cloud-init**, and its ISO-install wizard only creates blank
disks. So the OS is installed from a **remastered Debian netinst ISO that
auto-boots a preseed** — no console interaction, no boot-menu race.
VMM gotchas that shape this (see the wiki build-record):
- VMM refuses to change/unmount a VM's ISO while it is **running** ("Failed to
replace ISO files"). Do all ISO/boot-device edits with the VM **off**.
- A **guest reboot does not re-read** VMM's boot-device/ISO config — only a full
VMM power-cycle applies it. So an auto-booting install ISO **loops** (reboot →
CD → reinstall, wiping the disk). Break it by preseeding the installer to
**power off** at the end: `d-i debian-installer/exit/poweroff boolean true`.
- Attach the NIC to the **untagged `Default VM Network`** — the VLAN-40
`40_Server` network is isolated (no DHCP, no network). The LAN has DHCP.
Procedure (build the ISO on a host with `xorriso`):
1. Download the current Debian **netinst** (`.../debian-cd/current/amd64/iso-cd/`).
2. Remaster it — add `/preseed.cfg` and replace `/isolinux/isolinux.cfg` with a
minimal one (`default preseed`, `timeout 1`, one label:
`kernel /install.amd/vmlinuz` /
`append auto=true priority=critical preseed/file=/cdrom/preseed.cfg vga=788 initrd=/install.amd/initrd.gz --- quiet`):
`xorriso -indev in.iso -outdev out.iso -boot_image any replay -map preseed.cfg /preseed.cfg -map isolinux.cfg /isolinux/isolinux.cfg`.
The preseed uses **DHCP** (`netcfg/dhcp_timeout 120` — the virtual-switch port
is slow to link), disk **`/dev/sda`** (VirtIO SCSI), **no user** + a locked
random root hash (key-only via `PermitRootLogin prohibit-password`), packages
`openssh-server sudo qemu-guest-agent python3`, and a `late_command` that
injects the SSH keys (`krenner@fortress`, `woodpecker-ci@homelab`, your
workstation key) into `/root/.ssh/authorized_keys`, plus the `poweroff` line.
3. Upload to nas-2 via `ssh 'cat > /volume1/Install/<iso>' < <iso>` — **scp /
sftp / rsync are blocked on DSM**. Then VMM → Image → Add → From Synology NAS
→ import (VMM **copies** it; re-import if you change the source file).
4. Create VM: 2 vCPU, 4 GB, 50 GB on `/volume1`, **Default VM Network**, Legacy
BIOS, **Autostart: Yes**; attach the ISO, **Boot from DVD/CD-ROM**, power on.
5. It installs unattended and **powers off**. Then (VM off) set **ISO =
Unmounted**, **Boot from = Virtual Disk**, power on → boots the installed
Debian. `qemu-guest-agent` reports the DHCP lease in VMM's IP column.
6. **Pin a DSM update window** (Control Panel → Update & Restore) so an
auto-reboot doesn't kill tmux/jobs.
> As built 2026-07-16: Debian 13 (trixie), got DHCP `10.3.40.78`, all three keys
> injected, packages present. Freeing RAM required powering off the pre-existing
> `pbs1` PBS VM (kept its 3.4 TB backup disk).
> **At-rest encryption (Fable #6).** Off-site physical custody is weaker than
> home. For true at-rest protection of the VM's secrets *with* unattended
> autostart, use **network-bound decryption** (clevis + a Tang server at home):
> a stolen disk off-site can't unlock because it can't reach Tang. Full-disk
> LUKS with a manual passphrase would break autostart. Until Tang is stood up,
> secrets rely on 0600 perms + VM access control — documented gap, not a fix.
---
## Step 2 — Networking (two paths)
**Netbird mesh (done via CI):** mint a setup key in the dashboard
(`https://netbird.renner.uno`), vault it as `netbird_setup_key` under
`group_vars/claude_workstation/`, and run `.woodpecker/deploy-netbird-client.yml`
(`install-netbird-client.yml --limit claude_workstation`). As built 2026-07-16
the VM enrolled as `claude-ws-190-112.nb.renner.uno` / `100.96.190.112` (+ IPv6).
> **Mesh reachability caveat.** The mesh IP (`100.96.x`) is only reachable from
> **other Netbird peers**. The home workstation and the Woodpecker CI agent are
> **not** peers — they reach the VM only via the site-to-site tunnel at its DHCP
> lease. So a *stable* mesh-based `ansible_host` needs CI (or a home host) on the
> mesh first, or a Netbird routing peer bridging tunnel↔mesh. Until then the
> inventory targets the tunnel DHCP IP.
> **DNS trap.** `claude-ws.obg.renner.uno` resolves to the VM's lease **only at
> the off-site DNS** (`@10.3.40.1`). The home resolver catch-alls `*.renner.uno`
> to the public proxy (`162.55.50.97`, the Netbird VPS) — so from home the FQDN
> lands on `root@netbird`, **not** the VM. Never use it as `ansible_host`.
**Optional — mesh route to the k8s API (redundant read path):** to reach the API
over the mesh too, add a Netbird dashboard **network route** advertising the
apiserver's ClusterIP to the `netbird-ingress` peer group, and add an egress
rule to the `netbird-ingress-egress` CiliumNetworkPolicy
(`kubernetes/infrastructure/network-policies/ingress-isolation.yaml`) permitting
`app: netbird-ingress` pods to reach `kube-apiserver:443`. Deferred from this PR
because it edits a security-critical CNP that can't be validated offline — do it
as a follow-up when you want the redundant API path.
---
## Step 3 — Read-only SA kubeconfig
After the `kubernetes/apps/claude-workstation/` PR merges and Flux reconciles:
```sh
NS=apps
TOKEN=$(kubectl -n $NS get secret claude-workstation-token -o jsonpath='{.data.token}' | base64 -d)
kubectl -n $NS get secret claude-workstation-token -o jsonpath='{.data.ca\.crt}' | base64 -d > /tmp/ca.crt
# server = the cluster's stable API endpoint (kubernetes/talos/patches/cluster.yaml).
# Use the name, not an address: it is what the API server certificate carries as a
# SAN, so an IP here fails TLS verification even when it is reachable. It must
# resolve from the workstation over the site-to-site route.
kubectl config set-cluster homelab --server=https://k8s.renner.uno:6443 \
--certificate-authority=/tmp/ca.crt --embed-certs=true --kubeconfig=/tmp/claude-ws.kubeconfig
kubectl config set-credentials claude-workstation --token="$TOKEN" --kubeconfig=/tmp/claude-ws.kubeconfig
kubectl config set-context homelab --cluster=homelab --user=claude-workstation --kubeconfig=/tmp/claude-ws.kubeconfig
kubectl config use-context homelab --kubeconfig=/tmp/claude-ws.kubeconfig
# verify read-only:
KUBECONFIG=/tmp/claude-ws.kubeconfig kubectl get nodes # works
KUBECONFIG=/tmp/claude-ws.kubeconfig kubectl get secrets -A # Forbidden (view excludes secrets)
```
The resulting file becomes the `claude_ws_kubeconfig` vault value.
---
## Step 4 — Secret material → vault
```sh
# Two independent OAuth tokens so job jobs can't impersonate the interactive user:
claude setup-token # -> claude_ws_oauth_token_interactive
claude setup-token # -> claude_ws_oauth_token_job (run again / separate session)
```
Encrypt into `ansible/inventory/group_vars/claude_workstation/vault.yml`
(ansible-vault; same VAULT_PASS the CI uses):
```yaml
netbird_setup_key: "..."
claude_ws_oauth_token_interactive: "..."
claude_ws_oauth_token_job: "..."
claude_ws_gitea_token: "..." # claude-bot PAT
claude_ws_gitea_git_credentials: "https://claude-bot:<PAT>@gitea.renner.uno"
claude_ws_kubeconfig: |
apiVersion: v1
... # the file from Step 3
```
> **Never run `claude` with `--bare`** here or on the VM — bare mode silently
> ignores `CLAUDE_CODE_OAUTH_TOKEN` and the jobs will fail auth.
---
## Step 5 — Deploy
Merge the PR, then trigger the pipeline (Woodpecker → Run → `PIPELINE ==
"deploy-claude-workstation"`), or push a change under the role's paths. CI SSHes
to `10.3.40.60` over the tunnel and applies `common`, `netbird-client`, and this
role. Also run the umbrella `plays/common.yml` against the new host once, so it
picks up `qemu-guest-agent` like every other inventory host.
---
## Step 6 — Egress cutover (staged)
The nftables allowlist ships **disabled**. To enforce:
1. Leave it off for a few days; watch what the box actually talks to.
2. Confirm `claude_ws_egress_allow_fqdns` + `claude_ws_egress_allow_cidrs*`
(home Prometheus/Loki/API) cover it.
3. Set `claude_ws_egress_enforce: true` in host/group vars, redeploy.
4. Watch the `claude-egress-dropped` nft counter (`nft list ruleset`) and Loki
for anything legitimate being dropped; widen the allowlist as needed.
---
## Step 7 — Notes (Syncthing pairing)
The role installs Syncthing for `claude-job` and starts
`syncthing@claude-job`. Pair it once (manual): from the VM's GUI (SSH tunnel to
`127.0.0.1:8384`) add your existing vault's device ID and accept the shared
`Notes` folder pointed at `{{ claude_ws_notes_dir }}`. The distill timer runs
daily at 04:30 and only ever **creates** new atomic notes.
---
## Rotation
- **OAuth token** (expires/can be revoked): re-run `claude setup-token` on your
laptop, update the two vault keys, redeploy. Headless auth failures surface in
Loki (the wrapper logs `result=failure`) — don't let them go quiet.
- **claude-bot PAT**: rotate in Gitea, update `claude_ws_gitea_*`, redeploy.
- **SA token**: `kubectl -n apps delete secret claude-workstation-token` (Flux
recreates it), re-assemble the kubeconfig (Step 3), update vault, redeploy.
## Kill switch
```sh
systemctl disable --now claude-notes-distill.timer claude-egress-refresh.timer
```
Every credential is independently revocable: delete the SA, revoke the PAT,
revoke the OAuth token, or remove the Netbird peer — no shared blast radius.
## Disaster recovery (cattle, not pet)
The VM holds no unique state — the only real state is the Notes replica, which
re-syncs from Syncthing. To rebuild: redo **Step 1** (VM + cloud-init), then
**Step 5** (pipeline). No VMM snapshots needed (they'd bloat the 86%-full
`/volume1`).
@@ -1,68 +0,0 @@
---
# claude-workstation role defaults
#
# An always-on headless host that runs Claude Code for (a) reattachable
# interactive sessions and (b) unattended notes/wiki timers. It deliberately
# holds the LEAST privilege that still lets it do its job: a read-only k8s
# ServiceAccount kubeconfig, claude-bot (non-admin) gitea creds, and a Claude
# subscription OAuth token — NO talosconfig and NO SOPS age key. See README.
# --- Users -----------------------------------------------------------------
# Two Unix users with separate credential stores so an unattended (timer) job
# cannot read the interactive session's OAuth token / kube / gitea creds.
claude_ws_interactive_user: claude # human tmux sessions
claude_ws_job_user: claude-job # unattended systemd-timer jobs
claude_ws_base_dir: /opt/claude-workstation
# --- Toolchain -------------------------------------------------------------
claude_ws_node_major: 22 # matches the ci-claude image
claude_ws_claude_code_pkg: "@anthropic-ai/claude-code"
claude_ws_base_packages:
- git
- tmux
- jq
- curl
- ca-certificates
- ripgrep
- unzip
- nftables
- python3
- python3-venv
# --- Egress allowlist ------------------------------------------------------
# Deny-default OUTPUT is the target end-state, but it can brick a fresh host if
# an allowed destination is missed, so it ships DISABLED and is tightened after
# observing real egress (staged rollout). Flip claude_ws_egress_enforce to true
# once the allowlist below is confirmed complete. See templates/nftables.conf.j2.
claude_ws_egress_enforce: false
# Static destinations the host must always reach. CDN-backed hosts (Anthropic,
# npm, apt) are matched by name at apply time via the fqdn set; home services
# are matched by IP. Tune in host_vars.
claude_ws_egress_allow_fqdns:
- api.anthropic.com
- statsig.anthropic.com
- gitea.renner.uno
- fsn1.your-objectstorage.com # Hetzner Object Storage (SOPS bundle)
- deb.debian.org
- security.debian.org
- deb.nodesource.com
- pkgs.netbird.io
- registry.npmjs.org
claude_ws_egress_allow_cidrs: [] # home Prometheus/Loki/API (v4), per-host
claude_ws_egress_allow_cidrs6: [] # same (v6) — IPv6-first, prefer these
# --- Notes / wiki pipeline -------------------------------------------------
# The Obsidian vault syncs onto this host via Syncthing (matches the user's
# existing multi-device setup). Unattended pipeline jobs must CREATE new atomic
# files rather than rewrite existing ones, to keep Syncthing conflicts rare.
claude_ws_notes_enabled: true
claude_ws_notes_dir: "/home/{{ claude_ws_job_user }}/Notes"
claude_ws_syncthing_gui_bind: "127.0.0.1:8384"
# --- Secrets (populated from the ansible-vault'd group_vars — see README) ---
# claude_ws_oauth_token_interactive : CLAUDE_CODE_OAUTH_TOKEN for the human user
# claude_ws_oauth_token_job : CLAUDE_CODE_OAUTH_TOKEN for timer jobs
# claude_ws_gitea_token : claude-bot PAT
# claude_ws_gitea_git_credentials : https://claude-bot:<pat>@gitea.renner.uno line
# claude_ws_kubeconfig : read-only SA kubeconfig (base64 or literal)
@@ -1,22 +0,0 @@
You are running unattended as a scheduled job on the claude-workstation host.
Your job is a conservative distillation pass over the Obsidian wiki vault.
Scope and rules (follow exactly — you have only Read, Write, Glob, Grep):
1. Look at `~/Notes/raw/` (ignore `~/Notes/raw/_processed/` and `~/Notes/_archive/`
entirely) for source material.
2. For each raw source, check whether `~/Notes/wiki/` already contains a note
grounded in it (Grep the wiki for the source filename / its `sources:` slug).
If a note already exists, SKIP that source — do not rewrite or duplicate it.
3. For raw sources with NO corresponding wiki note yet, create new atomic
concept notes in `~/Notes/wiki/`: one concept per file, self-contained,
tagged, cross-linked with `[[wikilinks]]`, every claim grounded in a
`sources:` entry. Never invent facts not present in the source.
4. CREATE new files only. Never rewrite, move, delete, or truncate an existing
file in `~/Notes/` — appending a missing cross-link to a note you created
THIS run is fine; touching pre-existing notes is not.
5. If there is nothing new to distill, do nothing and stop. Do not manufacture
work.
Preserve disagreement: if sources conflict, surface the conflict in the note
rather than silently picking a winner. Keep each note short and single-purpose.
@@ -1,8 +0,0 @@
# claude-workstation shared tmux config — reattachable long-running sessions.
set -g history-limit 100000
set -g mouse on
set -g base-index 1
setw -g pane-base-index 1
set -g status-right "#H %Y-%m-%d %H:%M"
# Keep sessions alive across client disconnects (the whole point of this host).
set -g destroy-unattached off
@@ -1,10 +0,0 @@
---
- name: Reload systemd
ansible.builtin.systemd:
daemon_reload: true
- name: Reload nftables
ansible.builtin.systemd:
name: nftables.service
state: reloaded
when: claude_ws_egress_enforce | bool
@@ -1,42 +0,0 @@
---
# Deny-default egress allowlist. Ships DISABLED (claude_ws_egress_enforce:
# false) so a fresh host is never bricked by a missed destination; the ruleset,
# the FQDN-resolver, and its refresh timer are installed regardless, and the
# operator flips the toggle to true once egress is confirmed complete against
# real traffic (staged rollout). CDN-backed hosts are matched via nft named
# sets that the refresh unit repopulates from DNS; static home services are
# matched by claude_ws_egress_allow_cidrs.
- name: Deploy the egress-refresh resolver
ansible.builtin.template:
src: claude-egress-refresh.sh.j2
dest: "{{ claude_ws_base_dir }}/claude-egress-refresh.sh"
mode: "0755"
- name: Deploy the egress-refresh service + timer
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/etc/systemd/system/{{ item }}"
mode: "0644"
loop:
- claude-egress-refresh.service
- claude-egress-refresh.timer
notify: Reload systemd
- name: Deploy the nftables ruleset
ansible.builtin.template:
src: nftables.conf.j2
dest: /etc/nftables.conf
mode: "0644"
validate: "nft -c -f %s"
notify: Reload nftables
- name: Enforce or relax egress lockdown
ansible.builtin.systemd:
name: "{{ item }}"
enabled: "{{ claude_ws_egress_enforce | bool }}"
state: "{{ 'started' if (claude_ws_egress_enforce | bool) else 'stopped' }}"
daemon_reload: true
loop:
- nftables.service
- claude-egress-refresh.timer
@@ -1,183 +0,0 @@
---
# claude-workstation: an always-on headless Claude Code host.
# Debian 12 VM on the off-site nas-2 (Synology VMM). See README for the manual
# bootstrap (VM creation, Netbird route, secret material) that precedes this.
#
# common.yml already applies `common` and `qemu-guest-agent`
# to every inventory host, so this role owns only the
# Claude-specific surface: toolchain, the two credential-isolated users, the
# read-only creds, notes sync, the unattended timers, and egress lockdown.
- name: Assert we are on Debian (role is apt-only)
ansible.builtin.assert:
that:
- ansible_facts['os_family'] == 'Debian'
fail_msg: "claude-workstation targets Debian; got {{ ansible_facts['os_family'] }}."
# --- Base packages ---------------------------------------------------------
- name: Install base packages
ansible.builtin.apt:
name: "{{ claude_ws_base_packages }}"
state: present
update_cache: true
# --- Node.js 22 + Claude Code (matches the ci-claude image toolchain) -------
- name: Add NodeSource signing key
ansible.builtin.get_url:
url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key
dest: /usr/share/keyrings/nodesource.gpg
mode: "0644"
force: false
- name: Add NodeSource apt repository
ansible.builtin.apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ claude_ws_node_major }}.x nodistro main"
state: present
filename: nodesource
- name: Install Node.js
ansible.builtin.apt:
name: nodejs
state: present
update_cache: true
# NodeSource installs Node under /usr, so global npm modules land in
# /usr/lib/node_modules and `claude` is on PATH for every user/timer. `creates`
# keeps it idempotent (re-run `npm install -g` manually to bump the version).
- name: Install Claude Code globally
ansible.builtin.command:
cmd: "npm install -g {{ claude_ws_claude_code_pkg }}"
creates: /usr/lib/node_modules/@anthropic-ai/claude-code
# --- Credential-isolated users --------------------------------------------
- name: Create Claude users
ansible.builtin.user:
name: "{{ item }}"
shell: /bin/bash
create_home: true
loop:
- "{{ claude_ws_interactive_user }}"
- "{{ claude_ws_job_user }}"
- name: Create the role base directory (scripts, prompts)
ansible.builtin.file:
path: "{{ claude_ws_base_dir }}"
state: directory
mode: "0755"
# Let the interactive user's tmux server survive SSH logout / reboot.
- name: Enable lingering for the interactive user
ansible.builtin.command: "loginctl enable-linger {{ claude_ws_interactive_user }}"
args:
creates: "/var/lib/systemd/linger/{{ claude_ws_interactive_user }}"
- name: Deploy shared tmux config
ansible.builtin.copy:
src: tmux.conf
dest: "/home/{{ item }}/.tmux.conf"
owner: "{{ item }}"
group: "{{ item }}"
mode: "0644"
loop:
- "{{ claude_ws_interactive_user }}"
- "{{ claude_ws_job_user }}"
# --- Secrets: each user gets only what its role needs ----------------------
# The interactive user gets gitea + OAuth + read-only kubeconfig. The job user
# gets its OWN OAuth token + gitea (to open PRs) but NO kubeconfig.
- name: Create ~/.config/claude-bot for the interactive user
ansible.builtin.file:
path: "/home/{{ item }}/.config/claude-bot"
state: directory
owner: "{{ item }}"
group: "{{ item }}"
mode: "0700"
loop:
- "{{ claude_ws_interactive_user }}"
- "{{ claude_ws_job_user }}"
- name: Deploy claude-bot gitea token
ansible.builtin.copy:
content: "{{ claude_ws_gitea_token }}\n"
dest: "/home/{{ item }}/.config/claude-bot/gitea-token"
owner: "{{ item }}"
group: "{{ item }}"
mode: "0600"
loop:
- "{{ claude_ws_interactive_user }}"
- "{{ claude_ws_job_user }}"
no_log: true
- name: Deploy claude-bot git-credentials
ansible.builtin.copy:
content: "{{ claude_ws_gitea_git_credentials }}\n"
dest: "/home/{{ item }}/.config/claude-bot/git-credentials"
owner: "{{ item }}"
group: "{{ item }}"
mode: "0600"
loop:
- "{{ claude_ws_interactive_user }}"
- "{{ claude_ws_job_user }}"
no_log: true
# CLAUDE_CODE_OAUTH_TOKEN is delivered as an EnvironmentFile so both interactive
# shells and timer units can source it without it landing in shell history.
# NEVER run claude with --bare here: bare mode silently ignores this token.
- name: Deploy per-user Claude OAuth environment file
ansible.builtin.copy:
content: "CLAUDE_CODE_OAUTH_TOKEN={{ item.token }}\n"
dest: "/home/{{ item.user }}/.config/claude-code.env"
owner: "{{ item.user }}"
group: "{{ item.user }}"
mode: "0600"
loop:
- { user: "{{ claude_ws_interactive_user }}", token: "{{ claude_ws_oauth_token_interactive }}" }
- { user: "{{ claude_ws_job_user }}", token: "{{ claude_ws_oauth_token_job }}" }
loop_control:
label: "{{ item.user }}"
no_log: true
- name: Create ~/.kube for the interactive user
ansible.builtin.file:
path: "/home/{{ claude_ws_interactive_user }}/.kube"
state: directory
owner: "{{ claude_ws_interactive_user }}"
group: "{{ claude_ws_interactive_user }}"
mode: "0700"
- name: Deploy read-only SA kubeconfig (interactive user only)
ansible.builtin.copy:
content: "{{ claude_ws_kubeconfig }}"
dest: "/home/{{ claude_ws_interactive_user }}/.kube/config"
owner: "{{ claude_ws_interactive_user }}"
group: "{{ claude_ws_interactive_user }}"
mode: "0600"
no_log: true
# This VM's only git identity IS claude-bot (unlike the shared human
# workstation, where a global credential.helper is forbidden), so a per-user
# ~/.gitconfig pointing at each user's own claude-bot store is appropriate.
- name: Configure git identity + credential store for the Claude users
ansible.builtin.copy:
dest: "/home/{{ item }}/.gitconfig"
owner: "{{ item }}"
group: "{{ item }}"
mode: "0644"
content: |
[user]
name = Claude Bot
email = claude-bot@renner.uno
[credential]
helper = store --file=/home/{{ item }}/.config/claude-bot/git-credentials
loop:
- "{{ claude_ws_interactive_user }}"
- "{{ claude_ws_job_user }}"
# --- Notes / wiki pipeline (Syncthing + timers) ----------------------------
- name: Notes pipeline
ansible.builtin.include_tasks: notes.yml
when: claude_ws_notes_enabled | bool
# --- Egress lockdown -------------------------------------------------------
- name: Egress firewall
ansible.builtin.include_tasks: firewall.yml
@@ -1,48 +0,0 @@
---
# Notes/wiki pipeline: the Obsidian vault syncs onto this host via Syncthing
# (matching the user's existing multi-device setup), and a hardened, bounded
# systemd timer runs an unattended `claude -p` distill pass over it as the
# credential-isolated job user. Device pairing is a one-time manual step (see
# README) — this only installs Syncthing and the timer.
- name: Install Syncthing
ansible.builtin.apt:
name: syncthing
state: present
update_cache: true
- name: Enable Syncthing for the job user
ansible.builtin.systemd:
name: "syncthing@{{ claude_ws_job_user }}.service"
enabled: true
state: started
daemon_reload: true
- name: Deploy the notes-distill prompt
ansible.builtin.copy:
src: claude-notes-distill-prompt.md
dest: "{{ claude_ws_base_dir }}/claude-notes-distill-prompt.md"
mode: "0644"
- name: Deploy the notes-distill wrapper
ansible.builtin.template:
src: claude-notes-distill.sh.j2
dest: "{{ claude_ws_base_dir }}/claude-notes-distill.sh"
mode: "0755"
- name: Deploy the notes-distill service + timer
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/etc/systemd/system/{{ item }}"
mode: "0644"
loop:
- claude-notes-distill.service
- claude-notes-distill.timer
notify: Reload systemd
- name: Enable the notes-distill timer
ansible.builtin.systemd:
name: claude-notes-distill.timer
enabled: true
state: started
daemon_reload: true
@@ -1,10 +0,0 @@
[Unit]
# {{ ansible_managed }}
Description=Refresh claude-workstation egress allowlist from DNS
After=nftables.service network-online.target
Wants=network-online.target
Requires=nftables.service
[Service]
Type=oneshot
ExecStart={{ claude_ws_base_dir }}/claude-egress-refresh.sh
@@ -1,27 +0,0 @@
#!/usr/bin/env bash
# {{ ansible_managed }}
# Resolve the egress FQDN allowlist to current IPs and load them into the
# nftables @allow4/@allow6 sets. CDN IPs rotate, so this runs on a timer.
# No-op unless the claude_egress table is loaded (i.e. enforcement is on).
set -euo pipefail
TABLE="inet claude_egress"
FQDNS=(
{% for fqdn in claude_ws_egress_allow_fqdns %}
"{{ fqdn }}"
{% endfor %}
)
nft list table $TABLE >/dev/null 2>&1 || { echo "claude_egress table not loaded; enforcement off"; exit 0; }
v4=(); v6=()
for host in "${FQDNS[@]}"; do
while read -r ip; do [ -n "$ip" ] && v4+=("$ip"); done < <(getent ahostsv4 "$host" | awk '{print $1}' | sort -u)
while read -r ip; do [ -n "$ip" ] && v6+=("$ip"); done < <(getent ahostsv6 "$host" | awk '{print $1}' | sort -u)
done
nft flush set $TABLE allow4
nft flush set $TABLE allow6
[ ${#v4[@]} -gt 0 ] && nft add element $TABLE allow4 "{ $(IFS=,; echo "${v4[*]}") }"
[ ${#v6[@]} -gt 0 ] && nft add element $TABLE allow6 "{ $(IFS=,; echo "${v6[*]}") }"
echo "claude-egress-refresh: ${#v4[@]} v4 + ${#v6[@]} v6 addresses loaded"
@@ -1,10 +0,0 @@
[Unit]
# {{ ansible_managed }}
Description=Periodically refresh the claude-workstation egress allowlist
[Timer]
OnBootSec=30s
OnUnitActiveSec=15min
[Install]
WantedBy=timers.target
@@ -1,32 +0,0 @@
[Unit]
# {{ ansible_managed }}
Description=Claude Code unattended notes-distill pass
After=network-online.target syncthing@{{ claude_ws_job_user }}.service
Wants=network-online.target
[Service]
Type=oneshot
User={{ claude_ws_job_user }}
Group={{ claude_ws_job_user }}
EnvironmentFile=/home/{{ claude_ws_job_user }}/.config/claude-code.env
ExecStart={{ claude_ws_base_dir }}/claude-notes-distill.sh
# Hard wall-clock kill — the runaway/kill switch for this unattended agent.
TimeoutStartSec=1800
# --- Hardening: an unattended LLM job on internet-influenced input ----------
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ReadWritePaths=/home/{{ claude_ws_job_user }}
# Credential isolation: cannot read the interactive session's tokens/kubeconfig.
InaccessiblePaths=/home/{{ claude_ws_interactive_user }}
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictNamespaces=true
LockPersonality=true
MemoryDenyWriteExecute=false
[Install]
WantedBy=multi-user.target
@@ -1,32 +0,0 @@
#!/usr/bin/env bash
# {{ ansible_managed }}
# Unattended notes-distill pass. Prompt via stdin (never shell-substituted),
# tool-allowlisted, no --bare (bare silently drops CLAUDE_CODE_OAUTH_TOKEN).
# Bounded by the unit's TimeoutStartSec, not a CLI flag (--max-turns is absent
# in the installed Claude Code). Emits a terminal state line to the journal on
# EVERY outcome so a Loki alert can catch silent failures (dead-man switch).
set -euo pipefail
export HOME="/home/{{ claude_ws_job_user }}"
NOTES="{{ claude_ws_notes_dir }}"
PROMPT="{{ claude_ws_base_dir }}/claude-notes-distill-prompt.md"
log() { logger -t claude-notes-distill -- "$*"; echo "claude-notes-distill: $*"; }
if [ ! -d "$NOTES/raw" ]; then
log "result=skipped reason=no-vault path=$NOTES"
exit 0
fi
log "result=start"
if claude -p \
--add-dir "$NOTES" \
--allowedTools "Read,Write,Glob,Grep" \
--model sonnet \
< "$PROMPT"; then
log "result=success"
else
rc=$?
log "result=failure rc=$rc"
exit "$rc"
fi
@@ -1,11 +0,0 @@
[Unit]
# {{ ansible_managed }}
Description=Run the Claude Code notes-distill pass daily
[Timer]
OnCalendar=*-*-* 04:30:00
Persistent=true
RandomizedDelaySec=900
[Install]
WantedBy=timers.target
@@ -1,55 +0,0 @@
#!/usr/sbin/nft -f
# {{ ansible_managed }}
# Deny-default egress for the claude-workstation. CDN-backed destinations are
# matched via the @allow4/@allow6 named sets, repopulated from DNS by
# claude-egress-refresh. Static home services are matched by the @static* sets.
# Only loaded when claude_ws_egress_enforce is true.
flush ruleset
table inet claude_egress {
set allow4 { type ipv4_addr; flags interval; }
set allow6 { type ipv6_addr; flags interval; }
set static4 {
type ipv4_addr
flags interval
{% if (claude_ws_egress_allow_cidrs | default([])) | length > 0 %}
elements = { {{ claude_ws_egress_allow_cidrs | join(', ') }} }
{% endif %}
}
set static6 {
type ipv6_addr
flags interval
{% if (claude_ws_egress_allow_cidrs6 | default([])) | length > 0 %}
elements = { {{ claude_ws_egress_allow_cidrs6 | join(', ') }} }
{% endif %}
}
chain output {
type filter hook output priority 0; policy drop;
oif "lo" accept
ct state established,related accept
# DNS — required to resolve the allowlist itself.
udp dport 53 accept
tcp dport 53 accept
# Diagnostics + DHCP lease renewal on the bridged interface.
ip protocol icmp accept
ip6 nexthdr icmpv6 accept
udp dport { 67, 68 } accept
# NetBird / WireGuard control + data plane (initial handshakes).
udp dport { 3478, 51820 } accept
# Allowed destinations.
ip daddr @allow4 accept
ip6 daddr @allow6 accept
ip daddr @static4 accept
ip6 daddr @static6 accept
# Everything else is dropped and counted for inspection.
counter comment "claude-egress-dropped"
}
}
+2 -4
View File
@@ -51,10 +51,8 @@
# -------------------------------------------------------
# 4. SSH Configuration
# -------------------------------------------------------
# Authorized keys (human + woodpecker-ci, the latter from=-restricted) are
# managed by the dedicated ansible/plays/configure-ssh-keys.yml play. The old
# "Add Ansible Runner SSH Key" task deployed ansible-runner@ci-new, a dead key
# for a host that no longer exists — removed (issue #184).
# SSH access (CA trust, admin authorized_keys) is managed by the ssh-ca role
# via plays/configure-ssh-ca.yml.
# -------------------------------------------------------
# 5. Disable NTP on VMs/LXC (use host time)
@@ -3,7 +3,7 @@
#
# Enforces the decisions the in-cluster CrowdSec already detects, at the point
# where public traffic actually enters: these hosts terminate TLS for every
# *.renner.uno name. A drop here never reaches the mesh, the relay or the
# public renner.uno name. A drop here never reaches the mesh, the relay or the
# cluster.
#
# Detection stays in the cluster. The reverse-proxy produces no parseable
@@ -29,9 +29,11 @@
# upstream ships no container image for this bouncer, which is expected —
# it manipulates host netfilter.
#
# The CI runner has v4, so it does the fetching. The checksum is verified
# there, before anything is copied to a host.
# The controller has v4, so it does the fetching. The checksum is verified
# there, before anything is copied to a host. Also in check mode: the fetch
# only writes on the controller, and the copy below needs the file.
- name: Fetch the pinned bouncer release on the controller
check_mode: false
ansible.builtin.get_url:
url: >-
https://github.com/crowdsecurity/cs-firewall-bouncer/releases/download/{{
+1
View File
@@ -87,6 +87,7 @@
ansible.builtin.command:
argv: [pgrep, -af, "edge-host/(open3e|e3oncan)"]
register: heating_can_survivors
check_mode: false
changed_when: false
failed_when: false
+4 -3
View File
@@ -65,6 +65,7 @@
- /etc/network/interfaces
- /etc/network/interfaces.d/
register: keepalived_ntp_static6_ifupdown
check_mode: false
changed_when: false
failed_when: false
when:
@@ -123,6 +124,7 @@
- "{{ keepalived_ntp_vip6.split('/')[0] }}\\b"
- /etc/systemd/network/
register: keepalived_ntp_static6_networkd
check_mode: false
changed_when: false
failed_when: false
when:
@@ -140,9 +142,8 @@
Handing the address to keepalived while networkd also assigns it means
it would NOT be withdrawn when check_ntp fails -- the host would keep
serving time on an address VRRP believes it has released.
Re-apply the edge-vlan role first, whose template no longer carries the
[Address] block:
ansible-playbook -i inventory/pve_hosts.yml plays/install-edge-host.yml
Re-apply the edge-vlan role first (site.yml runs it before this play),
whose template no longer carries the [Address] block.
success_msg: >-
No static networkd assignment of {{ keepalived_ntp_vip6 }}; safe for
keepalived to own it.
@@ -6,3 +6,13 @@ netbird_management_url: "https://netbird.renner.uno"
# Setup key - should be defined in group_vars or host_vars
# netbird_setup_key: ""
# Release installed on hosts without a NetBird package repository (Arch).
# Debian/Ubuntu follow the apt repository instead.
netbird_client_version: "0.75.0"
netbird_release_url: "https://github.com/netbirdio/netbird/releases/download/v{{ netbird_client_version }}"
# On the controller; the archive is copied from there to the hosts.
netbird_download_dir: "{{ lookup('ansible.builtin.env', 'HOME') }}/.cache/ansible/netbird"
# Leave the host's DNS configuration alone (hosts with a pinned resolv.conf).
netbird_disable_dns: false
+88 -36
View File
@@ -2,47 +2,79 @@
# NetBird Client Installation Role
# Installs and configures NetBird client on hosts with netbird_setup_key defined
- name: Install required packages
ansible.builtin.apt:
name:
- curl
- ca-certificates
- gnupg
state: present
update_cache: true
- name: Install NetBird from the NetBird apt repository
when: ansible_facts['os_family'] == 'Debian'
block:
- name: Install required packages
ansible.builtin.apt:
name:
- curl
- ca-certificates
- gnupg
state: present
update_cache: true
- name: Add NetBird repository key
ansible.builtin.shell:
cmd: |
curl -sSL https://pkgs.netbird.io/debian/public.key | gpg --dearmor -o /usr/share/keyrings/netbird-archive-keyring.gpg
creates: /usr/share/keyrings/netbird-archive-keyring.gpg
- name: Add NetBird repository key
ansible.builtin.shell:
cmd: |
curl -sSL https://pkgs.netbird.io/debian/public.key | gpg --dearmor -o /usr/share/keyrings/netbird-archive-keyring.gpg
creates: /usr/share/keyrings/netbird-archive-keyring.gpg
- name: Add NetBird repository
ansible.builtin.apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/netbird-archive-keyring.gpg] https://pkgs.netbird.io/debian stable main"
state: present
filename: netbird
- name: Add NetBird repository
ansible.builtin.apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/netbird-archive-keyring.gpg] https://pkgs.netbird.io/debian stable main"
state: present
filename: netbird
- name: Install NetBird client
ansible.builtin.apt:
name: netbird
state: present
update_cache: true
- name: Install NetBird client
ansible.builtin.apt:
name: netbird
state: present
update_cache: true
- name: Check if NetBird is already connected
ansible.builtin.command: netbird status
register: netbird_status
changed_when: false
failed_when: false
# Arch has no netbird package in its repositories; the release binary is
# verified against the release's checksums file. It is downloaded on the
# controller and copied over: github.com has no IPv6 address, and proxy-1 is
# IPv6-only. The controller steps also run in check mode: they only write on
# the controller, and the install step needs the archive.
- name: Install NetBird from the release tarball
when: ansible_facts['os_family'] == 'Archlinux'
block:
- name: Create the controller download directory
ansible.builtin.file:
path: "{{ netbird_download_dir }}"
state: directory
mode: "0755"
delegate_to: localhost
become: false
run_once: true
check_mode: false
- name: Connect NetBird to management server
ansible.builtin.command: >
netbird up
--management-url {{ netbird_management_url }}
--setup-key {{ netbird_setup_key }}
when: "'Connected' not in netbird_status.stdout"
register: netbird_connect
changed_when: netbird_connect.rc == 0
- name: Download the NetBird release on the controller
check_mode: false
ansible.builtin.get_url:
url: "{{ netbird_release_url }}/netbird_{{ netbird_client_version }}_linux_amd64.tar.gz"
dest: "{{ netbird_download_dir }}/netbird_{{ netbird_client_version }}_linux_amd64.tar.gz"
checksum: "sha256:{{ netbird_release_url }}/netbird_{{ netbird_client_version }}_checksums.txt"
mode: "0644"
delegate_to: localhost
become: false
run_once: true
- name: Install the NetBird binary
ansible.builtin.unarchive:
src: "{{ netbird_download_dir }}/netbird_{{ netbird_client_version }}_linux_amd64.tar.gz"
dest: /usr/local/bin
include:
- netbird
owner: root
group: root
mode: "0755"
- name: Install the NetBird service
ansible.builtin.command: netbird service install
args:
creates: /etc/systemd/system/netbird.service
- name: Enable NetBird service
ansible.builtin.service:
@@ -50,9 +82,29 @@
state: started
enabled: true
- name: Check if NetBird is already connected
ansible.builtin.command: netbird status
register: netbird_status
check_mode: false
changed_when: false
failed_when: false
# "Disconnected" contains "Connected", so match the management line.
- name: Connect NetBird to management server
ansible.builtin.command: >
netbird up
--management-url {{ netbird_management_url }}
--setup-key {{ netbird_setup_key }}
{{ '--disable-dns' if netbird_disable_dns else '' }}
when: "'Management: Connected' not in netbird_status.stdout"
register: netbird_connect
changed_when: netbird_connect.rc == 0
no_log: true
- name: Get NetBird status
ansible.builtin.command: netbird status
register: netbird_final_status
check_mode: false
changed_when: false
- name: Display NetBird status
+26 -12
View File
@@ -136,27 +136,41 @@
- /opt/netbird/proxy
- /opt/netbird/proxy-state
# The management store has no cluster-side backup. Pulling one put a root
# key on this host that the cluster held, and this server's own state is
# its own business to protect rather than the cluster's. Dropping the two
# tasks that placed them would only stop ansible managing the key and the
# script — the pair below revokes them instead, and can go once the role
# has run against every host that ever carried them.
# The management store has no cluster-side backup; the cluster's backup
# key is gone with the managed authorized_keys (ssh-ca role).
- name: Remove the backup dump script
ansible.builtin.file:
path: /usr/local/bin/netbird-backup-dump
state: absent
- name: Revoke the cluster backup key
ansible.posix.authorized_key:
user: root
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFeW/L9bHMTSa5/Qb0ClppCf4Z0hL39JwzI6tBmKd2FG netbird-backup@homelab-cluster"
state: absent
- name: Wait for management container to be ready
ansible.builtin.pause:
seconds: 10
# The host's mesh client must not manage DNS: containers here resolve through
# the host stub, and the renner.uno nameserver group is unreachable from it.
- name: Check for the host NetBird client
ansible.builtin.stat:
path: /usr/bin/netbird
register: _netbird_client
- name: Read the host NetBird client config
ansible.builtin.command: netbird debug config
register: _netbird_client_config
check_mode: false
changed_when: false
when: _netbird_client.stat.exists
# disable-dns is only applied on a fresh `up`, not to a connected client.
- name: Reconnect the host NetBird client with DNS management disabled
ansible.builtin.shell: |
set -eu
netbird down
netbird up --disable-dns
when:
- _netbird_client.stat.exists
- not (_netbird_client_config.stdout | from_json).disableDns
- name: Display deployment status
ansible.builtin.debug:
msg: |
@@ -61,6 +61,10 @@ services:
- AUTH_AUDIENCE={{ netbird_auth_audience }}
- AUTH_CLIENT_ID={{ netbird_auth_client_id }}
- AUTH_AUTHORITY={{ netbird_auth_issuer }}
# The CSP allows AUTH_AUTHORITY only as a path (/application/o/netbird/);
# Authentik's token/userinfo endpoints sit outside it, so the browser
# would block the code exchange and every token refresh.
- NETBIRD_CSP={{ netbird_auth_issuer | urlsplit('scheme') }}://{{ netbird_auth_issuer | urlsplit('netloc') }}
- USE_AUTH0=false
- AUTH_SUPPORTED_SCOPES=openid profile email
- NETBIRD_TOKEN_SOURCE=idToken
@@ -1,20 +0,0 @@
---
# Node Exporter defaults
node_exporter_version: "1.8.2"
node_exporter_port: 9100
node_exporter_user: node-exporter
node_exporter_group: node-exporter
# Installation paths
node_exporter_install_dir: /opt/node-exporter
node_exporter_binary: "{{ node_exporter_install_dir }}/node_exporter"
# Collectors to enable (defaults are usually sufficient)
node_exporter_enabled_collectors:
- systemd
- processes
- timex
# Collectors to disable
node_exporter_disabled_collectors: []
@@ -1,62 +0,0 @@
#!/bin/bash
# Generate Prometheus metrics from chronyc tracking output
# Runs as a cron job and outputs to textfile collector directory
OUTPUT_FILE="${1:-/var/lib/node-exporter/chrony.prom}"
# Get chrony tracking info
tracking=$(chronyc tracking 2>/dev/null)
if [ -z "$tracking" ]; then
echo "chrony_up 0" > "$OUTPUT_FILE.tmp"
mv "$OUTPUT_FILE.tmp" "$OUTPUT_FILE"
exit 0
fi
# Parse values
stratum=$(echo "$tracking" | grep "^Stratum" | awk '{print $3}')
system_time=$(echo "$tracking" | grep "^System time" | awk '{print $4}')
root_delay=$(echo "$tracking" | grep "^Root delay" | awk '{print $4}')
root_dispersion=$(echo "$tracking" | grep "^Root dispersion" | awk '{print $4}')
last_offset=$(echo "$tracking" | grep "^Last offset" | awk '{print $4}')
rms_offset=$(echo "$tracking" | grep "^RMS offset" | awk '{print $4}')
frequency=$(echo "$tracking" | grep "^Frequency" | awk '{print $3}')
ref_id=$(echo "$tracking" | grep "^Reference ID" | awk '{print $4}' | tr -d '()')
# Handle negative offsets (remove leading + or keep -)
system_time=$(echo "$system_time" | sed 's/^+//')
last_offset=$(echo "$last_offset" | sed 's/^+//')
rms_offset=$(echo "$rms_offset" | sed 's/^+//')
# Output Prometheus metrics
cat > "$OUTPUT_FILE.tmp" << EOF
# HELP chrony_stratum Current stratum of the NTP server
# TYPE chrony_stratum gauge
chrony_stratum ${stratum:-0}
# HELP chrony_system_time_offset_seconds System time offset from NTP time
# TYPE chrony_system_time_offset_seconds gauge
chrony_system_time_offset_seconds ${system_time:-0}
# HELP chrony_root_delay_seconds Total round-trip delay to the primary reference clock
# TYPE chrony_root_delay_seconds gauge
chrony_root_delay_seconds ${root_delay:-0}
# HELP chrony_root_dispersion_seconds Total dispersion to the primary reference clock
# TYPE chrony_root_dispersion_seconds gauge
chrony_root_dispersion_seconds ${root_dispersion:-0}
# HELP chrony_last_offset_seconds Estimated offset of the last update
# TYPE chrony_last_offset_seconds gauge
chrony_last_offset_seconds ${last_offset:-0}
# HELP chrony_rms_offset_seconds RMS offset
# TYPE chrony_rms_offset_seconds gauge
chrony_rms_offset_seconds ${rms_offset:-0}
# HELP chrony_frequency_ppm Frequency offset in parts per million
# TYPE chrony_frequency_ppm gauge
chrony_frequency_ppm ${frequency:-0}
# HELP chrony_up Whether chrony is running and synchronized
# TYPE chrony_up gauge
chrony_up 1
# HELP chrony_reference_info Reference clock information
# TYPE chrony_reference_info gauge
chrony_reference_info{reference="${ref_id:-unknown}"} 1
EOF
mv "$OUTPUT_FILE.tmp" "$OUTPUT_FILE"
@@ -1,9 +0,0 @@
---
- name: Reload systemd
systemd:
daemon_reload: yes
- name: Restart node-exporter
systemd:
name: node-exporter
state: restarted
@@ -1,88 +0,0 @@
---
# Install and configure Node Exporter
- name: Create node-exporter system group
group:
name: "{{ node_exporter_group }}"
system: yes
state: present
- name: Create node-exporter system user
user:
name: "{{ node_exporter_user }}"
group: "{{ node_exporter_group }}"
system: yes
shell: /usr/sbin/nologin
home: "{{ node_exporter_install_dir }}"
createhome: no
- name: Create installation directory
file:
path: "{{ node_exporter_install_dir }}"
state: directory
owner: "{{ node_exporter_user }}"
group: "{{ node_exporter_group }}"
mode: '0755'
- name: Check if node_exporter is already installed
stat:
path: "{{ node_exporter_binary }}"
register: node_exporter_installed
- name: Get installed version
command: "{{ node_exporter_binary }} --version"
register: installed_version
when: node_exporter_installed.stat.exists
changed_when: false
failed_when: false
- name: Download node_exporter
get_url:
url: "https://github.com/prometheus/node_exporter/releases/download/v{{ node_exporter_version }}/node_exporter-{{ node_exporter_version }}.linux-amd64.tar.gz"
dest: /tmp/node_exporter.tar.gz
mode: '0644'
when: not node_exporter_installed.stat.exists or (installed_version.stdout is defined and node_exporter_version not in installed_version.stdout)
- name: Extract node_exporter
unarchive:
src: /tmp/node_exporter.tar.gz
dest: /tmp
remote_src: yes
when: not node_exporter_installed.stat.exists or (installed_version.stdout is defined and node_exporter_version not in installed_version.stdout)
- name: Install node_exporter binary
copy:
src: "/tmp/node_exporter-{{ node_exporter_version }}.linux-amd64/node_exporter"
dest: "{{ node_exporter_binary }}"
owner: "{{ node_exporter_user }}"
group: "{{ node_exporter_group }}"
mode: '0755'
remote_src: yes
when: not node_exporter_installed.stat.exists or (installed_version.stdout is defined and node_exporter_version not in installed_version.stdout)
notify: Restart node-exporter
- name: Create systemd service
template:
src: node_exporter.service.j2
dest: /etc/systemd/system/node-exporter.service
owner: root
group: root
mode: '0644'
notify:
- Reload systemd
- Restart node-exporter
- name: Enable and start node-exporter service
systemd:
name: node-exporter
enabled: yes
state: started
daemon_reload: yes
- name: Clean up downloaded files
file:
path: "{{ item }}"
state: absent
loop:
- /tmp/node_exporter.tar.gz
- "/tmp/node_exporter-{{ node_exporter_version }}.linux-amd64"
@@ -1,38 +0,0 @@
[Unit]
Description=Prometheus Node Exporter
Documentation=https://github.com/prometheus/node_exporter
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User={{ node_exporter_user }}
Group={{ node_exporter_group }}
ExecStart={{ node_exporter_binary }} \
--web.listen-address=:{{ node_exporter_port }} \
{% for collector in node_exporter_enabled_collectors %}
--collector.{{ collector }} \
{% endfor %}
{% for collector in node_exporter_disabled_collectors %}
--no-collector.{{ collector }} \
{% endfor %}
{% if node_exporter_textfile_dir is defined %}
--collector.textfile \
--collector.textfile.directory={{ node_exporter_textfile_dir }} \
{% endif %}
--collector.filesystem.mount-points-exclude='^/(sys|proc|dev|host|etc)($$|/)'
Restart=on-failure
RestartSec=10s
# Security hardening
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
ReadOnlyPaths=/
{% if node_exporter_textfile_dir is defined %}
ReadWritePaths={{ node_exporter_textfile_dir }}
{% endif %}
[Install]
WantedBy=multi-user.target
+142
View File
@@ -0,0 +1,142 @@
---
- name: Fail on unsupported distribution
ansible.builtin.fail:
msg: >-
os-update supports Debian and Archlinux only;
this host reports os_family={{ ansible_facts['os_family'] }}
when: ansible_facts['os_family'] not in ['Debian', 'Archlinux']
# --- Baseline: what is healthy before the upgrade must be healthy after ---
- name: Record failed units before upgrade
ansible.builtin.command: systemctl list-units --state=failed --plain --no-legend --no-pager
register: os_update_failed_before
changed_when: false
check_mode: false
- name: Check for docker
ansible.builtin.stat:
path: /usr/bin/docker
register: os_update_docker
- name: Record running containers before upgrade
ansible.builtin.command: docker ps --format "{{ '{{' }}.Names{{ '}}' }}"
register: os_update_containers_before
changed_when: false
check_mode: false
when: os_update_docker.stat.exists
- name: Assert at least 1 GiB free on /
ansible.builtin.assert:
that: >-
(ansible_facts['mounts'] | selectattr('mount', 'equalto', '/') | first)['size_available']
>= 1073741824
fail_msg: "Less than 1 GiB free on / -- free space before upgrading"
# --- Arch Linux ---
- name: Upgrade keyring first (Arch)
community.general.pacman:
name: archlinux-keyring
state: latest
update_cache: true
when: ansible_facts['os_family'] == 'Archlinux'
- name: Upgrade all packages (Arch)
community.general.pacman:
upgrade: true
register: os_update_pacman
when: ansible_facts['os_family'] == 'Archlinux'
# --- Debian/Ubuntu ---
- name: Upgrade all packages (Debian)
ansible.builtin.apt:
update_cache: true
upgrade: full
autoremove: true
environment:
DEBIAN_FRONTEND: noninteractive
when: ansible_facts['os_family'] == 'Debian'
- name: Check reboot-required flag (Debian)
ansible.builtin.stat:
path: /var/run/reboot-required
register: os_update_reboot_flag
when: ansible_facts['os_family'] == 'Debian'
# --- Reboot ---
- name: Read running kernel before reboot (Arch)
ansible.builtin.command: uname -r
register: os_update_kernel_before
changed_when: false
check_mode: false
when: ansible_facts['os_family'] == 'Archlinux'
# Missing modules dir: a newer kernel is installed but not booted, including
# from an earlier interrupted run where pacman now reports no change.
- name: Check running kernel is still installed (Arch)
ansible.builtin.stat:
path: "/usr/lib/modules/{{ os_update_kernel_before.stdout }}/vmlinuz"
register: os_update_kernel_present
when: ansible_facts['os_family'] == 'Archlinux'
- name: Reboot
ansible.builtin.reboot:
msg: "Rebooting after package upgrade"
reboot_timeout: 900
post_reboot_delay: 30
when: >-
(ansible_facts['os_family'] == 'Archlinux' and
(os_update_pacman is changed or not os_update_kernel_present.stat.exists)) or
(ansible_facts['os_family'] == 'Debian' and os_update_reboot_flag.stat.exists)
# --- Verify ---
- name: Read running kernel
ansible.builtin.command: uname -r
register: os_update_kernel
changed_when: false
check_mode: false
# Arch keeps only the installed kernel's modules; the directory existing means
# the host booted the kernel pacman installed.
- name: Assert running kernel is the installed one (Arch)
ansible.builtin.stat:
path: "/usr/lib/modules/{{ os_update_kernel.stdout }}/vmlinuz"
register: os_update_kernel_installed
failed_when: not os_update_kernel_installed.stat.exists
when: ansible_facts['os_family'] == 'Archlinux'
- name: Assert no reboot pending (Debian)
ansible.builtin.stat:
path: /var/run/reboot-required
register: os_update_reboot_flag_after
failed_when: os_update_reboot_flag_after.stat.exists
when: ansible_facts['os_family'] == 'Debian'
- name: Wait for previously running containers
ansible.builtin.command: docker ps --format "{{ '{{' }}.Names{{ '}}' }}"
register: os_update_containers_after
changed_when: false
check_mode: false
until: >-
os_update_containers_before.stdout_lines
| difference(os_update_containers_after.stdout_lines)
| length == 0
retries: 20
delay: 15
when: os_update_docker.stat.exists
- name: Wait for no new failed units
ansible.builtin.command: systemctl list-units --state=failed --plain --no-legend --no-pager
register: os_update_failed_after
changed_when: false
check_mode: false
until: >-
os_update_failed_after.stdout_lines
| map('split') | map('first')
| difference(os_update_failed_before.stdout_lines | map('split') | map('first'))
| length == 0
retries: 10
delay: 15
- name: Report kernel
ansible.builtin.debug:
msg: "{{ inventory_hostname }} runs {{ os_update_kernel.stdout }}"
+18
View File
@@ -0,0 +1,18 @@
---
# SSH user CA (OpenBao ssh-client-signer). Hosts trust certificates signed by
# it; the public key is fetched from OpenBao on the controller at run time.
ssh_ca_public_key_url: "https://openbao.renner.uno/v1/ssh-client-signer/public_key"
# Owner certificates (role owner) carry this principal. It is accepted for
# whichever admin login the distro has; users that do not exist are skipped.
ssh_ca_owner_principal: k.renner
ssh_ca_owner_users:
- root
- ladmin
# Claude's own account. Certificates (role claude, 1h) carry the principal.
ssh_ca_claude_user: claude-bot
ssh_ca_claude_principal: claude-bot
# Units claude-bot may restart/reload via sudo on this host, e.g. [netbird].
ssh_ca_claude_sudo_units: []
+2
View File
@@ -0,0 +1,2 @@
# Public keys whose certificates sshd must reject (one per line, OpenSSH format).
# Revoking a key also revokes every certificate issued for it.
@@ -0,0 +1,23 @@
---
# Replaces the admin logins' authorized_keys with ssh_admin_authorized_keys
# (break-glass + CI). Everything else logs in with a CA certificate.
- name: Look up the admin logins
ansible.builtin.getent:
database: passwd
key: "{{ item }}"
fail_key: false
loop: "{{ ssh_ca_owner_users }}"
register: ssh_ca_admin_lookup
- name: Set the admin logins' authorized_keys to the managed list
ansible.posix.authorized_key:
user: "{{ item.item }}"
key: |
{% for k in ssh_admin_authorized_keys %}
{{ (k.options ~ ' ') if (k.options | default('')) else '' }}{{ k.key }}
{% endfor %}
exclusive: true
loop: "{{ ssh_ca_admin_lookup.results }}"
loop_control:
label: "{{ item.item }}"
when: (item.ansible_facts.getent_passwd | default({})).get(item.item) is not none
+167
View File
@@ -0,0 +1,167 @@
---
- name: Fetch the SSH CA public key from OpenBao
ansible.builtin.uri:
url: "{{ ssh_ca_public_key_url }}"
return_content: true
delegate_to: localhost
become: false
run_once: true
register: ssh_ca_key
check_mode: false
- name: Check the fetched CA key is an SSH public key
ansible.builtin.assert:
that:
- ssh_ca_key.content is match('^ssh-ed25519 AAAA')
fail_msg: "Unexpected CA key from {{ ssh_ca_public_key_url }}"
run_once: true
- name: Install the trusted user CA key
ansible.builtin.copy:
content: "{{ ssh_ca_key.content | trim }}\n"
dest: /etc/ssh/trusted_user_ca_keys
owner: root
group: root
mode: "0644"
# sshd refuses all public key logins when RevokedKeys is set but unreadable,
# so the file is always deployed, even when empty.
- name: Install the revoked keys list
ansible.builtin.copy:
src: revoked_keys
dest: /etc/ssh/revoked_keys
owner: root
group: root
mode: "0644"
# systemd-journal: read every journal without sudo (see sudoers-claude.j2).
- name: Create the Claude account
ansible.builtin.user:
name: "{{ ssh_ca_claude_user }}"
shell: /bin/bash
create_home: true
password: "!"
groups: systemd-journal
append: true
- name: Look up the owner admin logins
ansible.builtin.getent:
database: passwd
key: "{{ item }}"
fail_key: false
loop: "{{ ssh_ca_owner_users }}"
register: ssh_ca_owner_lookup
- name: Create the principals directory
ansible.builtin.file:
path: /etc/ssh/auth_principals
state: directory
owner: root
group: root
mode: "0755"
- name: Accept the owner principal for the existing admin logins
ansible.builtin.copy:
content: "{{ ssh_ca_owner_principal }}\n"
dest: "/etc/ssh/auth_principals/{{ item.item }}"
owner: root
group: root
mode: "0644"
loop: "{{ ssh_ca_owner_lookup.results }}"
loop_control:
label: "{{ item.item }}"
when: (item.ansible_facts.getent_passwd | default({})).get(item.item) is not none
- name: Accept the Claude principal for the Claude account
ansible.builtin.copy:
content: "{{ ssh_ca_claude_principal }}\n"
dest: "/etc/ssh/auth_principals/{{ ssh_ca_claude_user }}"
owner: root
group: root
mode: "0644"
- name: Install the Claude sudo rules
ansible.builtin.template:
src: sudoers-claude.j2
dest: "/etc/sudoers.d/{{ ssh_ca_claude_user }}"
owner: root
group: root
mode: "0440"
validate: visudo -cf %s
# A broken drop-in only bites on the next sshd restart, so it is tested here
# and removed again if the full config does not parse.
- name: Configure sshd for the user CA
block:
- name: Install the sshd drop-in
ansible.builtin.template:
src: ssh-ca.conf.j2
dest: /etc/ssh/sshd_config.d/50-ssh-ca.conf
owner: root
group: root
mode: "0644"
- name: Test the full sshd config
ansible.builtin.command: sshd -t
changed_when: false
rescue:
- name: Remove the drop-in that broke sshd -t
ansible.builtin.file:
path: /etc/ssh/sshd_config.d/50-ssh-ca.conf
state: absent
- name: Fail the host
ansible.builtin.fail:
msg: "sshd -t failed with the SSH CA drop-in; it was removed again"
- name: Read the effective sshd settings
ansible.builtin.command: sshd -T
changed_when: false
register: ssh_ca_effective
# Keyword case in sshd -T output differs between OpenSSH versions (mixed case
# on 10.6), so the lines are compared lowercased. Not in check mode: sshd -T
# reads the files on disk, which check mode has not written.
- name: Check sshd uses the CA, principals and revocation list
when: not ansible_check_mode
vars:
ssh_ca_effective_lines: "{{ ssh_ca_effective.stdout_lines | map('lower') | list }}"
ansible.builtin.assert:
that:
- "'trustedusercakeys /etc/ssh/trusted_user_ca_keys' in ssh_ca_effective_lines"
- "'authorizedprincipalsfile /etc/ssh/auth_principals/%u' in ssh_ca_effective_lines"
- "'revokedkeys /etc/ssh/revoked_keys' in ssh_ca_effective_lines"
- "'passwordauthentication no' in ssh_ca_effective_lines"
- "'kbdinteractiveauthentication no' in ssh_ca_effective_lines"
fail_msg: "sshd -T does not show the SSH CA settings; another config line takes precedence"
# The unit is sshd.service on Arch and RedHat, ssh.service on Debian/Ubuntu,
# where sshd.service is an alias that resolves to it. sshd -T only parses the
# files, so the running daemon is reloaded on every run; a reload keeps open
# sessions. None runs when sshd is socket activated and stopped, or per
# connection (ssh-mesh-only role); the next start reads the config.
# systemctl directly: service_facts took 3-12 s per host.
- name: Find the running sshd unit
ansible.builtin.command: systemctl list-units --state=running --plain --no-legend --type=service sshd.service ssh.service
changed_when: false
register: ssh_ca_sshd_running
check_mode: false
- name: Reload the running sshd unit
vars:
ssh_ca_sshd_units: "{{ ssh_ca_sshd_running.stdout_lines | map('split') | map('first') | unique | list }}"
block:
- name: Check at most one sshd unit is running
ansible.builtin.assert:
that:
- ssh_ca_sshd_units | length <= 1
fail_msg: "Expected at most one running sshd.service or ssh.service, found {{ ssh_ca_sshd_units }}"
- name: Reload sshd so the running daemon uses the CA config
ansible.builtin.systemd:
name: "{{ ssh_ca_sshd_units | first }}"
state: reloaded
when: ssh_ca_sshd_units | length == 1
- name: Report the admin logins' authorized keys
ansible.builtin.include_tasks: report.yml
+27
View File
@@ -0,0 +1,27 @@
---
# Read-only: what the admin logins accept besides certificates. Hosts in
# [ssh_keys_managed] have this reduced to ssh_admin_authorized_keys.
- name: Find the admin logins' authorized_keys
ansible.builtin.stat:
path: "{{ item.ansible_facts.getent_passwd[item.item][4] }}/.ssh/authorized_keys"
loop: "{{ ssh_ca_owner_lookup.results }}"
loop_control:
label: "{{ item.item }}"
when: (item.ansible_facts.getent_passwd | default({})).get(item.item) is not none
register: ssh_ca_keyfiles
- name: Fingerprint the admin logins' authorized keys
ansible.builtin.command: ssh-keygen -lf {{ item.stat.path }}
loop: "{{ ssh_ca_keyfiles.results | selectattr('stat', 'defined') | selectattr('stat.exists') | list }}"
loop_control:
label: "{{ item.stat.path }}"
changed_when: false
register: ssh_ca_fingerprints
check_mode: false
- name: Report the admin logins' authorized keys
ansible.builtin.debug:
msg: "{{ item.item.stat.path }}: {{ item.stdout_lines }}"
loop: "{{ ssh_ca_fingerprints.results }}"
loop_control:
label: "{{ item.item.stat.path }}"
@@ -0,0 +1,6 @@
# {{ ansible_managed }}
TrustedUserCAKeys /etc/ssh/trusted_user_ca_keys
AuthorizedPrincipalsFile /etc/ssh/auth_principals/%u
RevokedKeys /etc/ssh/revoked_keys
PasswordAuthentication no
KbdInteractiveAuthentication no
@@ -0,0 +1,12 @@
# {{ ansible_managed }}
# Logs and unit status come from the systemd-journal group, not sudo:
# journalctl as root would also allow --vacuum-*/--rotate.
# Commands are listed for both the Arch and the Debian/Ubuntu path.
# nft only with fixed arguments: it joins argv into one command line, so a
# wildcard would admit "; flush ruleset". No docker start: -a/-i attach to a
# container's stdin; docker restart also starts stopped containers.
{{ ssh_ca_claude_user }} ALL=(root) NOPASSWD:NOEXEC: /usr/bin/ss -tulpn, /usr/sbin/sshd -T, /usr/bin/nft list ruleset, /usr/sbin/nft list ruleset, /usr/bin/netbird status, /usr/bin/netbird status *, /usr/local/bin/netbird status, /usr/local/bin/netbird status *
{{ ssh_ca_claude_user }} ALL=(root) NOPASSWD:NOEXEC: /usr/bin/docker ps, /usr/bin/docker ps *, /usr/bin/docker logs *, /usr/bin/docker stats --no-stream, /usr/bin/docker restart *
{% for unit in ssh_ca_claude_sudo_units %}
{{ ssh_ca_claude_user }} ALL=(root) NOPASSWD:NOEXEC: /usr/bin/systemctl restart {{ unit }}, /usr/bin/systemctl reload {{ unit }}
{% endfor %}
@@ -0,0 +1,9 @@
---
# The only interface sshd accepts connections on.
ssh_mesh_interface: wt0
# Minutes until a switchover reverts to the distro listener, unless a new
# login through the mesh-only listener confirms it first.
ssh_mesh_revert_minutes: 5
ssh_mesh_udev_rule: /etc/udev/rules.d/90-ssh-mesh-only.rules
+114
View File
@@ -0,0 +1,114 @@
---
- name: Load the distro's sshd unit names
ansible.builtin.include_vars: "{{ ansible_facts['os_family'] }}.yml"
- name: Look for the mesh interface
ansible.builtin.stat:
path: "/sys/class/net/{{ ssh_mesh_interface }}"
register: ssh_mesh_iface
- name: Check the mesh interface exists
ansible.builtin.assert:
that:
- ssh_mesh_iface.stat.exists
fail_msg: "No {{ ssh_mesh_interface }}: sshd would be unreachable. Install the NetBird client first."
- name: Create the socket unit directory
ansible.builtin.file:
path: "{{ ssh_mesh_socket_file | dirname }}"
state: directory
owner: root
group: root
mode: "0755"
- name: Install the mesh-only socket
ansible.builtin.template:
src: "{{ ssh_mesh_socket_template }}"
dest: "{{ ssh_mesh_socket_file }}"
owner: root
group: root
mode: "0644"
- name: Bind the sshd service to the socket
when: ssh_mesh_service_dropin | length > 0
block:
- name: Create the service drop-in directory
ansible.builtin.file:
path: "{{ ssh_mesh_service_dropin | dirname }}"
state: directory
owner: root
group: root
mode: "0755"
- name: Install the service drop-in
ansible.builtin.template:
src: ssh.service-dropin.conf.j2
dest: "{{ ssh_mesh_service_dropin }}"
owner: root
group: root
mode: "0644"
- name: Install the udev rule that starts the socket with the interface
ansible.builtin.template:
src: udev.rules.j2
dest: "{{ ssh_mesh_udev_rule }}"
owner: root
group: root
mode: "0644"
register: ssh_mesh_udev
- name: Reload the udev rules
ansible.builtin.command: udevadm control --reload
when: ssh_mesh_udev is changed
changed_when: true
- name: Install the switch and revert scripts
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/usr/local/sbin/{{ item }}"
owner: root
group: root
mode: "0755"
loop:
- ssh-mesh-switch
- ssh-mesh-revert
- name: Reload systemd units
ansible.builtin.systemd:
daemon_reload: true
- name: Read the sshd listeners
ansible.builtin.command: ss -Htln 'sport = :22'
changed_when: false
register: ssh_mesh_listeners
check_mode: false
# Each run that finds a listener outside the interface switches over. An
# include, because meta reset_connection ignores when: and a reconnect costs a
# YubiKey PIN from a workstation.
- name: Switch sshd to the mesh-only socket
ansible.builtin.include_tasks: switch.yml
when: >-
ssh_mesh_listeners.stdout_lines | length == 0 or
ssh_mesh_listeners.stdout_lines | reject('search', '%' ~ ssh_mesh_interface ~ ':22\s') | list | length > 0
- name: Check sshd listens on the mesh interface only
ansible.builtin.assert:
that:
- ssh_mesh_listeners.stdout_lines | length > 0
- ssh_mesh_listeners.stdout_lines | reject('search', '%' ~ ssh_mesh_interface ~ ':22\s') | list | length == 0
fail_msg: "Listeners outside {{ ssh_mesh_interface }}: {{ ssh_mesh_listeners.stdout_lines }}"
- name: Cancel the revert timer
ansible.builtin.command: systemctl stop ssh-mesh-revert.timer
changed_when: false
failed_when: false
- name: Check the public name refuses SSH
ansible.builtin.wait_for:
host: "{{ inventory_hostname }}"
port: 22
state: stopped
timeout: 15
delegate_to: localhost
become: false
@@ -0,0 +1,27 @@
---
# The revert timer runs in its own unit, so a switch that locks the play out is
# undone after ssh_mesh_revert_minutes. main.yml cancels it after checking the
# listeners read through the new one.
- name: Clear a revert timer left by an earlier run
ansible.builtin.command: systemctl stop ssh-mesh-revert.timer ssh-mesh-revert.service
changed_when: false
failed_when: false
- name: Arm the revert timer
ansible.builtin.command: >-
systemd-run --unit=ssh-mesh-revert --collect
--on-active={{ ssh_mesh_revert_minutes }}min
/usr/local/sbin/ssh-mesh-revert
changed_when: true
- name: Switch the listener
ansible.builtin.command: systemd-run --unit=ssh-mesh-switch --collect --wait /usr/local/sbin/ssh-mesh-switch
changed_when: true
- name: Reconnect through the new listener
ansible.builtin.meta: reset_connection
- name: Read the sshd listeners after reconnecting
ansible.builtin.command: ss -Htln 'sport = :22'
changed_when: false
register: ssh_mesh_listeners
@@ -0,0 +1,9 @@
#!/bin/sh
# {{ ansible_managed }}
# Restores the distro listener on all addresses. Armed as a timer by every
# switchover; the play cancels it after a login through the new listener.
systemctl stop {{ ssh_mesh_service }} {{ ssh_mesh_socket }}
rm -f {{ ssh_mesh_udev_rule }} {{ ssh_mesh_socket_file }}{{ (' ' ~ ssh_mesh_service_dropin) if ssh_mesh_service_dropin else '' }}
udevadm control --reload
systemctl daemon-reload
systemctl enable --now {{ ssh_mesh_distro_listener }}
@@ -0,0 +1,11 @@
#!/bin/sh
# {{ ansible_managed }}
# Replaces the distro listener with the {{ ssh_mesh_interface }}-only socket.
# Open sessions survive: they run in logind scopes and the sshd units use
# KillMode=process. Any failure restores the distro listener at once.
set -eu
trap '/usr/local/sbin/ssh-mesh-revert' EXIT
systemctl disable {{ ssh_mesh_disable_units }}
systemctl stop {{ ssh_mesh_service }} {{ ssh_mesh_socket }}
systemctl start {{ ssh_mesh_socket }}
trap - EXIT
@@ -0,0 +1,7 @@
# {{ ansible_managed }}
# sshd holds the socket's listener; it stops with the socket, so it never keeps
# a listener on a removed {{ ssh_mesh_interface }}. Replaces the Requires= that
# enabling {{ ssh_mesh_socket }} would add.
[Unit]
BindsTo={{ ssh_mesh_socket }}
After={{ ssh_mesh_socket }}
@@ -0,0 +1,8 @@
# {{ ansible_managed }}
# Listen on {{ ssh_mesh_interface }} only. The unit is disabled; the udev rule
# starts it whenever {{ ssh_mesh_interface }} appears.
[Socket]
ListenStream=
ListenStream=22
BindToDevice={{ ssh_mesh_interface }}
BindIPv6Only=both
@@ -0,0 +1,12 @@
# {{ ansible_managed }}
# Started by the udev rule whenever {{ ssh_mesh_interface }} appears; BindToDevice
# stops it when the interface goes away. No [Install]: waiting for the device
# from sockets.target would hold up boot until NetBird is up.
[Unit]
Description=OpenSSH on {{ ssh_mesh_interface }} only
[Socket]
ListenStream=22
BindToDevice={{ ssh_mesh_interface }}
BindIPv6Only=both
Accept=yes
@@ -0,0 +1,3 @@
# {{ ansible_managed }}
# NetBird deletes and recreates {{ ssh_mesh_interface }} on every engine restart.
SUBSYSTEM=="net", KERNEL=="{{ ssh_mesh_interface }}", ENV{SYSTEMD_WANTS}+="{{ ssh_mesh_socket }}"
@@ -0,0 +1,10 @@
---
# No packaged socket; sshd.socket (Accept=yes) pairs with the packaged
# per-connection sshd@.service, since sshd -D cannot take a listening fd.
ssh_mesh_socket: sshd.socket
ssh_mesh_service: sshd.service
ssh_mesh_distro_listener: sshd.service
ssh_mesh_disable_units: sshd.service
ssh_mesh_socket_file: /etc/systemd/system/sshd.socket
ssh_mesh_socket_template: sshd.socket.j2
ssh_mesh_service_dropin: ""
@@ -0,0 +1,10 @@
---
# Ubuntu's ssh.socket (Accept=no) hands its listener to ssh.service. The
# drop-in is named like sshd-socket-generator's output so it masks it.
ssh_mesh_socket: ssh.socket
ssh_mesh_service: ssh.service
ssh_mesh_distro_listener: ssh.socket
ssh_mesh_disable_units: ssh.service ssh.socket
ssh_mesh_socket_file: /etc/systemd/system/ssh.socket.d/addresses.conf
ssh_mesh_socket_template: ssh.socket-addresses.conf.j2
ssh_mesh_service_dropin: /etc/systemd/system/ssh.service.d/ssh-mesh-only.conf
+12 -2
View File
@@ -1,11 +1,21 @@
---
uptime_kuma_version: "2.5.6"
uptime_kuma_host: kuma.renner.uno
# Not routed yet; reserved for the public status page.
uptime_kuma_status_host: uptime.renner.uno
uptime_kuma_base_url: "https://{{ uptime_kuma_host }}"
uptime_kuma_dir: /opt/uptime-kuma
uptime_kuma_traefik_network: netbird_netbird
uptime_kuma_smtp_from: uptime@renner.uno
# Alertmanager email receiver in kubernetes/apps/monitoring/helmrelease-prometheus.yaml.
uptime_kuma_smtp_to: admin@renner.uno
uptime_kuma_openbao_url: https://openbao.renner.uno
uptime_kuma_openbao_mount: homelab
uptime_kuma_openbao_path: infrastructure/uptime-kuma
uptime_kuma_openbao_smtp_path: infrastructure/uptime-kuma/smtp
uptime_kuma_openbao_metrics_path: infrastructure/uptime-kuma-metrics
# Token with policy uptime-kuma-vps, looked up like the bao CLI does:
# VAULT_TOKEN, else the token helper file written by `bao login -method=oidc`.
uptime_kuma_openbao_token: >-
{{ lookup('ansible.builtin.env', 'VAULT_TOKEN')
or (lookup('ansible.builtin.file', '~/.vault-token', errors='ignore') | default('', true)) }}
+161 -28
View File
@@ -1,46 +1,179 @@
// Creates the Uptime Kuma admin user on first start; exits 0 if already set up.
// Credentials come from KUMA_SETUP_USERNAME / KUMA_SETUP_PASSWORD only.
// Bootstraps Uptime Kuma: admin user, general settings, SMTP notification,
// and (when KUMA_METRICS_ROTATE=true) a fresh Prometheus API key written to KUMA_METRICS_KEY_FILE.
// All input comes from environment variables; secrets are never printed.
// Output lines: "admin user created" / "already set up", then "changed: <step>" or "ok: <step>".
const fs = require("fs");
const { io } = require("socket.io-client");
const username = process.env.KUMA_SETUP_USERNAME;
const password = process.env.KUMA_SETUP_PASSWORD;
if (!username || !password) {
console.error("KUMA_SETUP_USERNAME and KUMA_SETUP_PASSWORD must be set");
const KUMA_URL = "http://127.0.0.1:3001";
const EMIT_TIMEOUT_MS = 30000;
const TOTAL_TIMEOUT_MS = 180000;
// Defaults the Kuma settings page applies to unset keys before saving (src/pages/Settings.vue).
const SETTINGS_DEFAULTS = {
checkUpdate: true,
searchEngineIndex: false,
entryPage: "dashboard",
nscd: true,
keepDataPeriodDays: 180,
tlsExpiryNotifyDays: [7, 14, 21],
domainExpiryNotifyDays: [7, 14, 21],
trustProxy: false,
};
const REQUIRED = [
"KUMA_SETUP_USERNAME",
"KUMA_SETUP_PASSWORD",
"KUMA_BASE_URL",
"KUMA_SMTP_HOST",
"KUMA_SMTP_PORT",
"KUMA_SMTP_USERNAME",
"KUMA_SMTP_PASSWORD",
"KUMA_SMTP_FROM",
"KUMA_SMTP_TO",
];
const missing = REQUIRED.filter((name) => !process.env[name]);
const rotateMetricsKey = process.env.KUMA_METRICS_ROTATE === "true";
if (rotateMetricsKey && !process.env.KUMA_METRICS_KEY_FILE) {
missing.push("KUMA_METRICS_KEY_FILE");
}
if (missing.length > 0) {
console.error(`missing environment variables: ${missing.join(", ")}`);
process.exit(2);
}
const env = process.env;
const socket = io("http://127.0.0.1:3001", { transports: ["websocket"], reconnection: false });
const timer = setTimeout(() => {
console.error("timeout: no response from Uptime Kuma within 30s");
process.exit(1);
}, 30000);
const socket = io(KUMA_URL, { transports: ["websocket"], reconnection: false });
const lists = {};
const LIST_EVENTS = ["notificationList", "apiKeyList"];
for (const event of LIST_EVENTS) {
socket.on(event, (data) => {
lists[event] = data;
});
}
let finished = false;
function done(code, msg) {
if (finished) return;
finished = true;
clearTimeout(timer);
(code === 0 ? console.log : console.error)(msg);
clearTimeout(watchdog);
if (msg) (code === 0 ? console.log : console.error)(msg);
socket.close();
process.exit(code);
}
const watchdog = setTimeout(() => done(1, `timeout: bootstrap did not finish within ${TOTAL_TIMEOUT_MS / 1000}s`), TOTAL_TIMEOUT_MS);
socket.on("connect_error", (err) => done(1, `connect_error: ${err.message}`));
socket.on("disconnect", (reason) => done(1, `disconnected before setup finished: ${reason}`));
socket.on("disconnect", (reason) => done(1, `disconnected before bootstrap finished: ${reason}`));
// Kuma registers socket handlers only after emitting info.
socket.once("info", () => {
socket.emit("needSetup", (needSetup) => {
if (!needSetup) {
done(0, "already set up");
return;
}
socket.emit("setup", username, password, (res) => {
if (res && res.ok) {
done(0, "admin user created");
} else {
done(1, `setup failed: ${res && res.msg ? res.msg : JSON.stringify(res)}`);
}
function call(event, ...args) {
return new Promise((resolve, reject) => {
const timer = setTimeout(() => reject(new Error(`timeout waiting for ${event}`)), EMIT_TIMEOUT_MS);
socket.emit(event, ...args, (res) => {
clearTimeout(timer);
resolve(res);
});
});
});
}
async function callOk(event, ...args) {
const res = await call(event, ...args);
if (!res || !res.ok) {
throw new Error(`${event} failed: ${res && res.msg ? res.msg : JSON.stringify(res)}`);
}
return res;
}
function report(step, changed) {
console.log(`${changed ? "changed" : "ok"}: ${step}`);
}
// Kuma registers socket handlers only after emitting info.
function waitForInfo() {
return new Promise((resolve) => socket.once("info", resolve));
}
async function setupAdmin() {
const needSetup = await call("needSetup");
if (!needSetup) {
console.log("already set up");
return;
}
await callOk("setup", env.KUMA_SETUP_USERNAME, env.KUMA_SETUP_PASSWORD);
console.log("admin user created");
}
async function login() {
await callOk("login", { username: env.KUMA_SETUP_USERNAME, password: env.KUMA_SETUP_PASSWORD, token: "" });
// afterLogin sends the lists before the login ack but swallows send failures.
for (const event of LIST_EVENTS) {
if (lists[event] === undefined) {
throw new Error(`${event} not received after login`);
}
}
}
async function ensureSettings() {
const { data } = await callOk("getSettings");
if (data.trustProxy === true && data.primaryBaseURL === env.KUMA_BASE_URL) {
report("settings", false);
return;
}
const updated = { ...SETTINGS_DEFAULTS, ...data, trustProxy: true, primaryBaseURL: env.KUMA_BASE_URL };
await callOk("setSettings", updated, "");
report("settings", true);
}
async function ensureNotification() {
const port = Number(env.KUMA_SMTP_PORT);
const desired = {
name: "email",
type: "smtp",
isDefault: true,
smtpHost: env.KUMA_SMTP_HOST,
smtpPort: port,
// 465 is implicit TLS; any other port uses STARTTLS.
smtpSecure: port === 465,
smtpIgnoreSTARTTLS: false,
smtpUsername: env.KUMA_SMTP_USERNAME,
smtpPassword: env.KUMA_SMTP_PASSWORD,
smtpFrom: env.KUMA_SMTP_FROM,
smtpTo: env.KUMA_SMTP_TO,
};
const existing = (lists.notificationList || []).filter((n) => n.name === desired.name).sort((a, b) => a.id - b.id)[0];
const current = existing ? JSON.parse(existing.config || "{}") : {};
const upToDate =
existing && existing.isDefault === true && Object.keys(desired).every((key) => current[key] === desired[key]);
if (upToDate) {
report("notification", false);
return;
}
await callOk("addNotification", { ...current, ...desired, applyExisting: true }, existing ? existing.id : null);
report("notification", true);
}
async function rotateMetricsApiKey() {
if (!rotateMetricsKey) {
report("metrics api key", false);
return;
}
for (const key of (lists.apiKeyList || []).filter((k) => k.name === "prometheus")) {
await callOk("deleteAPIKey", key.id);
}
const res = await callOk("addAPIKey", { name: "prometheus", expires: null, active: 1 });
fs.writeFileSync(env.KUMA_METRICS_KEY_FILE, res.key, { mode: 0o600 });
report("metrics api key", true);
}
async function main() {
await waitForInfo();
await setupAdmin();
await login();
await ensureSettings();
await ensureNotification();
await rotateMetricsApiKey();
}
main().then(
() => done(0),
(err) => done(1, err.message)
);

Some files were not shown because too many files have changed in this diff Show More