Compare commits

...
Author SHA1 Message Date
claude-botandClaude Opus 5 d62c5da5a0 fix(multus): include dhcp in the cni-plugins build assertion
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Review point on #447. The build-time check asserted macvlan, static and
host-local were executable but omitted dhcp, which the sibling
cni-dhcp-daemon DaemonSet runs and which its own comment says ships from
this installer ("the dhcp binary ships from the sibling
cni-plugins-installer DaemonSet ... whole tarball extracted").

Verified that dependency in kubernetes/infrastructure/multus/
cni-dhcp-daemon.yaml before changing anything, rather than taking the
review's word for it.

Consequence of the omission: since the whole /plugins directory is copied
regardless of what the loop checks, nothing is broken today — but the
"fail loudly if upstream restructures the archive" guarantee only covered
three of the four binaries this repo depends on. Upstream dropping dhcp
while keeping the others would have built green and surfaced later as a
broken DHCP daemon on whichever node rolled first.

Confirmed all four are executable in the already-published image, so this
tightens the assertion without changing what ships.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 14:30:20 +02:00
claude-botandClaude Opus 5 8ac30b0ef7 fix(multus): bake CNI plugins into an image, drop the node-side fetch
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Supersedes the wget-instead-of-curl approach in #446, which removed the
`apk add` but left the real problems in place.

The installer fetched the containernetworking/plugins release tarball from
GitHub on the node and extracted it into /opt/cni/bin with NO integrity
verification of any kind. That directory is executed as root in the CNI
path on every node, so a tampered or MITM'd artifact would have obtained
privileged execution cluster-wide with nothing to detect it. It also put
github.com on the critical path of every node rebuild.

Now the binaries are baked into ci/images/cni-plugins, where the download
happens once and the sha256 IS verified, and the installer is a local file
copy with zero network calls (verified: no wget/curl/apk/https in the
rendered script).

The pinned digest was cross-checked against upstream's own published
cni-plugins-linux-amd64-v1.5.1.tgz.sha256 asset, not merely recorded from a
local download — a download can be tampered with, so comparing against
what upstream states is the point:

  77baa2f669980a82255ffa2f2717de823992480271ee778aa51a9c60ae89ff9b

Verified the gate actually gates: with the correct digest the layer logic
downloads, verifies, extracts and asserts macvlan/static/host-local are
executable; with a deliberately wrong digest `sha256sum -c` FAILS and the
extract step is never reached.

Install script changes beyond dropping the fetch:

- Copies unconditionally instead of the old "already installed?" guard.
  The guard existed to avoid re-downloading; a local copy is cheap, so
  copying every time means a node always matches the version pinned in the
  manifest rather than keeping whatever it first installed.
- Copies to a temp name in the same directory then rename(2)s over the
  target. `cp` onto a plugin the kubelet is currently executing can fail
  with ETXTBSY; rename never does and is atomic, so a concurrent CNI
  invocation sees either the old or the new binary, never a partial one.
- LICENSE and README.md are no longer installed into /opt/cni/bin; the old
  tar extraction put them there.

The chown 0:0 is kept but re-framed as a REPAIR. Its original cause is
gone — extraction applied the archive's `./` uid/gid (1001/127, the
github-actions runner) to the destination, and `cp` into an existing
directory does not touch its ownership. It still runs because nodes
provisioned by the old installer may already carry the wrong ownership,
which breaks Cilium's apply-sysctl-overwrites init container.

Verified end-to-end with the rendered script, including that repair path:

  pre-seeded owner 1001:127 -> 0:0 after run
  fresh install  -> host-local/macvlan/static present, macvlan executes
                    and reports "CNI macvlan plugin v1.5.1", exit 0
  re-run         -> idempotent, exit 0, 18 plugins, no .tmp files left

Note the image carries ~80MB of extracted plugins (18 binaries), matching
what the old installer put on each node. All are kept rather than trimming
to the few in use, to avoid removing plugins already present on nodes as a
side effect of this change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 14:15:53 +02:00
k.renner d36fefd721 Merge pull request 'docs(zigbee2mqtt): correct the network_key extraction comment' (#445) from fix-jq-comment into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/e2e Pipeline was successful
ci/woodpecker/cron/security-scan Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#445
2026-07-30 10:49:48 +00:00
claude-botandClaude Opus 5 c133f44d28 docs(zigbee2mqtt): correct the network_key extraction comment
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Review point on #444, which merged before this could be folded in.

The comment claimed the listed shapes yield "null" at rc=0. That describes
BARE `.network_key.key`, not the expression actually written, and it
contradicted its own closing line two lines below. Measured against jq
1.7.1 in the image, `(.network_key?.key? // "")` returns an EMPTY string at
rc=0 for all of:

  {}  {"devices":[]}  {"network_key":{}}  {"network_key":null}
  {"network_key":"abc"}  {"network_key":123}
  []  "a string"

and never the literal text null, because `// ""` maps a null result to
empty. Bare `.network_key.key` is what exits 5 on the last four shapes.

Checking that also turned up something the review did not mention: because
KEY can never be "null" with the current expression, the `[ "$KEY" =
"null" ]` arm is dead code today. Kept deliberately as belt-and-braces for
a future edit that drops the `// ""` fallback, and now labelled as such
rather than left looking like the arm that fires.

Comment-only: `git diff` shows zero changed lines outside comments, and the
rendered script is unchanged in behaviour.

NOTE: this text lives in the Deployment's init container command, so it is
part of the pod template — merging rolls the zigbee2mqtt pod (~20s of
Zigbee downtime, replicas: 1 + Recreate). Incidental benefit: the restart
resets Z2M's in-memory configure attempt counter, giving the Philips
devices that are interviewed but not yet bound (both RDM001 Treppenhaus
switches, the RWL022, and Sarah) three fresh configure attempts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 12:30:23 +02:00
k.renner 4c994d1ce3 Merge pull request 'refactor(zigbee2mqtt): use alpine-jq image, drop apk add from seed-data' (#444) from rename-alpine-jq into master
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: k.renner/homelab#444
2026-07-30 10:19:19 +00:00
claude-botandClaude Opus 5 8439a99a98 fix(zigbee2mqtt): guard the network_key selector at both levels
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Round-3 review on #444. Both suggestions were optional; both were cheap to
close properly.

`.network_key.key?` only shielded the leaf selector. If the backup's TOP
level were not an object, `.network_key` itself raises before `?` applies.
Verified in the image with jq 1.7.1:

  []          (.network_key.key? // "")   -> rc=5 Cannot index array ...
  "a string"  (.network_key.key? // "")   -> rc=5 Cannot index string ...
  []          (.network_key?.key? // "")  -> rc=0 empty
  "a string"  (.network_key?.key? // "")  -> rc=0 empty

So `?` now sits on both selectors. Not a realistic shape for an Open
Coordinator Backup export and it failed closed either way, but it was the
last path that produced jq's raw error rather than a tailored FATAL line.

Full matrix against the rendered script, on the alpine-jq:2026-07-30 tag:

  real backup            -> exit 0, hash 27c5c77a945bcecc (matches live)
  non-hex key            -> FATAL: contains non-hex characters
  4-char key             -> FATAL: length 4, expected 32 hex chars
  no network_key         -> FATAL: .network_key.key absent
  network_key non-object -> FATAL: .network_key.key absent
  network_key number     -> FATAL: .network_key.key absent
  top-level array        -> FATAL: .network_key.key absent
  top-level string       -> FATAL: .network_key.key absent
  device link_key in doc -> correctly ignored; network_key used

On the registry suggestion: re-verified the tag pulls immediately before
merge — jq 1.7.1, alpine 3.21.7. It was published by pipeline 3060, the
push build for this branch. No build ran for the later commits because they
touch only kubernetes/apps/**, which correctly does not match the build
step's when.path; the image content is unchanged by them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 10:45:38 +02:00
claude-botandClaude Opus 5 6e4729c7d0 fix(zigbee2mqtt): harden network_key extraction against malformed shapes
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Round-2 review on #444.

The 🟡 identified a real gap, though not via the input shape it described.
Verified against jq 1.7.1 in the actual image:

  {"devices":[]}            -> "null", rc=0   (absent path is LENIENT)
  {"network_key":{}}        -> "null", rc=0
  {"network_key":null}      -> "null", rc=0
  {"network_key":"abc"}     -> rc=5, Cannot index string with string "key"
  {"network_key":123}       -> rc=5, Cannot index number with string "key"

So a missing network_key was already handled correctly and did produce the
intended FATAL line. What was NOT handled is a network_key that exists but
is not an object: plain `.key` exits 5 there, and under `set -e` that
aborts before the checks run, surfacing jq's raw error instead. Fixed with
`.network_key.key?`, which yields empty for those shapes and routes them
into the existing absent-key branch.

Now every malformed shape reports the same readable message:

  real backup            -> exit 0, hash 27c5c77a945bcecc (matches live)
  non-hex key            -> FATAL: contains non-hex characters
  4-char key             -> FATAL: length 4, expected 32 hex chars
  no network_key         -> FATAL: .network_key.key absent
  network_key non-object -> FATAL: .network_key.key absent
  network_key number     -> FATAL: .network_key.key absent
  device link_key in doc -> correctly ignored; network_key used

Verification ran against the alpine-jq:2026-07-30 tag itself.

On the 🔴: the premise does not hold — that tag already exists and is
pullable, verified twice by pulling it. The build step fires on branch
pushes as well as master, so pipeline 3060 published it when this branch
was pushed; the reviewer could not query the registry to see that. The
underlying caution is still worth recording, so the manifest now documents
that TAG is derived from `date` AT RUN TIME, that a date must never be
written here before a build has produced it, and that a later master build
publishes its own tag without deleting this one — so this keeps resolving,
though the image then came from a branch build rather than master. Also
recorded why it matters: Flux reconciles on a 10m poll with no ordering
against kaniko, and replicas: 1 + Recreate means an unpullable init image
would leave the sole coordinator in ImagePullBackOff.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 10:39:57 +02:00
claude-botandClaude Opus 5 f66b127035 refactor(zigbee2mqtt): pin alpine-jq to a dated tag, not :latest
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Review point on #444. The reviewer cited a precedent I had missed:
ci-ansible:2026-04-29 in kubernetes/infrastructure/netbird-backup/
cronjob.yaml. Verified — for self-built images referenced by tag rather
than digest, this repo already uses DATED tags, with :latest used nowhere.

The argument holds independently of convention: with :latest, rebuilding
this base for some unrelated consumer silently changes what the seed-data
init container runs on its next pod restart, with no diff here to review.
That container renders the Zigbee network key, so "what exactly does it
run" should be visible in the manifest. A dated tag makes a change to it a
deliberate, reviewable act.

This does give up automatic pickup of rebuilds, which is the tradeoff the
previous commit chose the other way round. Given the base is thin and
rarely changes, and the consumer is security-sensitive, reviewability wins
— and it stays consistent with the owner directive that our own images do
not need digest pinning, since a dated tag is not a digest.

Verified gitea.renner.uno/gitea_admin/alpine-jq:2026-07-30 pulls and
carries jq 1.7.1, so the reference resolves before merge rather than after.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 10:01:13 +02:00
claude-botandClaude Opus 5 c3280310b5 refactor(zigbee2mqtt): use alpine-jq image, drop apk add from seed-data
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Owner directives, both applied here:

- "z2m-seed is a shit name for the image — name it for what it is, not for
  how it is used." Renamed to alpine-jq. Nothing in it is
  zigbee-specific; it is alpine plus jq, useful to anything that needs to
  read JSON from a shell script. The Containerfile now describes it that
  way, with the zigbee2mqtt case recorded as its first consumer rather
  than its identity.
- "You do not need to pin the digest for our own images." Referenced by
  tag. This also collapses what was going to be two PRs into one, since
  the digest no longer has to exist before the Deployment can name it.

The seed-data init container now uses that image instead of
`apk add --no-cache jq` on every pod start.

Two consequences of dropping digest pinning, both good:

- The whole --image-name-with-digest-file / "PIN THIS:" apparatus is gone
  from the pipeline. That machinery existed only to hand a digest to a
  follow-up commit, and it is what broke every pipeline in the repo (#443)
  via an unquoted ": " in a YAML scalar. Less surface, same outcome.
- :latest means Kubernetes defaults imagePullPolicy to Always, so a
  rebuilt image is picked up without editing the manifest.

Kept the fail-loudly validation, since a wrong network_key costs the whole
Zigbee network: explicit checks for an absent key (jq prints "null" for a
missing path, so that is checked separately rather than being reported as
merely "non-hex"), non-hex characters, and a length other than 32.

Verified by running the manifest's RENDERED script, against the real
coordinator backup and synthetic fixtures. The alpine-jq tag does not
exist until this merges and builds, so the run used the existing image of
identical content (alpine 3.21.7 + jq 1.7.1, verified present):

  real backup          -> exit 0, network_key line byte-identical to the
                          live value (sha256 27c5c77a945bcecc)
  non-hex key          -> exit 1, "contains non-hex characters"
  4-char key           -> exit 1, "length 4, expected 32 hex chars"
  absent network_key   -> exit 1, ".network_key.key absent from ..."
  device link_key also
  present in the doc   -> correctly ignored; the network_key is used

Validated with `woodpecker lint` (not just `yq`, which is what let #443
through), plus kustomize build and a server-side dry run. No stale
z2m-seed references remain.

NOTE: the now-orphaned z2m-seed package is still in the registry and
should be deleted; that needs package-delete rights this account does not
have.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 09:55:03 +02:00
k.renner d1b3521b7f Merge pull request 'fix(ci): repair pipeline config broken by unquoted ": " in echo' (#443) from fix-ci-yaml into master
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: k.renner/homelab#443
2026-07-30 07:31:57 +00:00
claude-botandClaude Opus 5 f7d79e6c70 fix(ci): repair pipeline config broken by unquoted ": " in echo
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
URGENT: this restores CI for the WHOLE repo. My commit 66dfd56b (merged
via #442) left an unquoted YAML scalar containing ": ", so Woodpecker
failed to compile the config:

  yaml: construct errors: line 152: cannot unmarshal
  'map[echo "PIN THIS:gitea.renner.uno/gitea_admin/z2m-seed@$DIGEST"]'
  of type map[string]interface {} into a string value

Because a compile error rejects the entire pipeline set, every pipeline on
master has errored since that merge — not only build-ci-images. Confirmed
from pipeline history: 3048 (the push that introduced it) is the first
failure, and 3049-3053 follow, including an unrelated merge (#440) and the
alert-monitor cron.

Fixed by quoting the command as a single YAML scalar.

Why my pre-merge validation missed it: I checked with `yq '.' >/dev/null`,
which passed because the unquoted form IS valid YAML — it just parses as a
map instead of a string. Parsing successfully is not the same as matching
the schema. `woodpecker lint` catches it immediately and is now noted in a
comment at the line, along with the specific failure mode, so the trap is
not reinstated.

All 17 .woodpecker/*.yml files now lint clean apart from pre-existing
"Additional property timeout is not allowed" warnings in four deploy-*
files, which are untouched by this change and are warnings rather than
errors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 09:20:14 +02:00
k.renner 42596daf3e Merge pull request 'fix: [alert] KubeJobFailed (velero) (#439)' (#440) from alert-fix/issue-439 into master
Reviewed-on: k.renner/homelab#440
2026-07-30 07:12:15 +00:00
k.renner dde14f657b Merge pull request 'build(ci): add z2m-seed runtime image (alpine + jq)' (#442) from z2m-seed-drop-apk into master
Reviewed-on: k.renner/homelab#442
2026-07-30 07:11:37 +00:00
k.renner 4ab099f4c0 Merge pull request 'feat(zigbee2mqtt): add re-interview watchdog sidecar' (#441) from z2m-interview-watchdog into master
Reviewed-on: k.renner/homelab#441
2026-07-30 07:11:24 +00:00
claude-botandClaude Opus 5 66dfd56b4d build(ci): emit a single digest line for z2m-seed
Review point on #442: kaniko writes one line per --destination to
--image-name-with-digest-file, so with both :$TAG and :latest the file
holds two entries carrying the same digest, and "PIN THIS:" would print
two near-identical lines for whoever does step 2 to choose between.

Rather than just comment on the ambiguity, remove it: reduce to the bare
digest, dedupe, and print one unambiguous copy-pasteable reference. The
multi-line behaviour is documented inline so a future edit does not
reintroduce it.

Verified the reduction against a two-line fixture matching kaniko's
format:

  gitea.renner.uno/gitea_admin/z2m-seed:2026-07-30@sha256:abc123
  gitea.renner.uno/gitea_admin/z2m-seed:latest@sha256:abc123
  -> PIN THIS: gitea.renner.uno/gitea_admin/z2m-seed@sha256:abc123

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 09:09:21 +02:00
claude-botandClaude Opus 5 a75c482f7d feat(zigbee2mqtt): add watchdog heartbeat and document seed-only log keys
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Addresses the round-3 review (commit 39616401), which I failed to reply to
before pushing the next change.

Add an unconditional heartbeat logging the outstanding PENDING/FAILED
count. The main loop is purely event-driven, so if the
"Received payload: clusterID=" format ever changes (herdsman upgrade, log
format change) it would match nothing forever while still logging
"following <file>" and looking healthy. The per-frame recount cannot
detect that either, because it only runs when a frame is matched. The
heartbeat runs off a timer instead, so a count that never falls while
devices are demonstrably in use is a visible signal that the matcher
broke.

Document, in the ConfigMap itself rather than only in the PR body, that
the two log_* keys are seed-only and do not reach a running Z2M whose PVC
is already seeded. Both were therefore also applied to the live
configuration.yaml via bridge/request/options; verified they persist there
(lines 29-31 of the on-PVC file) so they survive a restart. Also noted
that log_symlink_current only takes effect on a Z2M restart, since the
symlink is created when the log directory is opened — until then the
sidecar waits and says so.

Not changed: resources.limits.cpu is still unset on the sidecar. The
review flagged it as consistent with the sibling containers in this file
and asked only whether it was intentional — it is. A CPU limit on a
mostly-idle process whose value is reacting inside a device's short wake
window buys nothing and risks throttling at exactly the wrong moment; the
memory limit already bounds the real risk.

Verified in eclipse-mosquitto:2.0.22 as uid 1883 with HEARTBEAT=5: the
heartbeat interleaves with frame handling and the simulated Z2M restart
without disturbing either.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 09:07:32 +02:00
claude-botandClaude Opus 5 ee15cdeb13 fix(zigbee2mqtt): follow a stable log path across Z2M restarts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was canceled
Addresses the blocking review point on #441, which was correct.

`tail -F` follows a PATHNAME: it re-opens that name when the inode behind
it changes, but it can never notice that Z2M has started writing to a
different directory. Z2M creates log/<start-timestamp>/log.log fresh on
every start, so tailing the newest directory breaks as soon as Z2M
restarts — the old file merely goes quiet, so the pipe never ends, the
outer loop never re-resolves, "following <file>" still shows the stale
path, and the sidecar looks healthy while never seeing another frame.

Worse than the review assumed: this is not limited to the planned
"interview a batch, then restart Z2M once" step. The Z2M *container* has
restarted 38 times on its own from DNS flaps, each time into a new log
directory, while the pod (and so the sidecar) kept running.

Fixed at the source rather than with a polling watchdog: set
advanced.log_symlink_current: true so Z2M maintains log/current -> the
active directory, and follow that stable path. Verified that BusyBox
`tail -F` in eclipse-mosquitto:2.0.22 does follow a symlink repointed to a
new target mid-follow.

No fallback to the newest directory, deliberately: falling back could
silently tail a frozen file, which is the failure being fixed. A missing
symlink is instead reported loudly and repeatedly while waiting.

Also from this round:

- Short-circuit while nothing needs interviewing. The namespaced debug log
  covers all of zh:controller, so every device on the network produces
  frames; without this the script forked awk over database.db for each of
  ~30 devices' traffic forever. Recounted at most once a minute, so a
  device regressing to PENDING is still picked up.
- Bound mosquitto_pub with `timeout`, so a hanging TCP connect cannot
  stall the single-threaded read loop.
- Wire MQTT_HOST and MQTT_USER explicitly from the Deployment, like
  BASE_TOPIC, instead of relying on the script's defaults.
- imagePullPolicy: IfNotPresent, matching the sibling container.

Two bugs found by testing this, not by inspection:

- `mosquitto_pub -W` does not exist (it is a mosquitto_sub flag). Adding
  it made every publish fail on a usage error. Removed; `timeout` alone
  bounds the call. Same class as the earlier `grep --line-buffered`
  mistake, and again only visible by running it.
- `grep -c` prints "0" AND exits 1 when nothing matches, so
  `grep -c ... || echo 0` emitted two lines ("0\n0") and every `-eq` test
  died with "bad number". This surfaced only once no devices needed an
  interview — the steady end state this feature exists to reach.

Verified in eclipse-mosquitto:2.0.22 as uid 1883, simulating Z2M's layout
and a restart (new directory + repointed symlink):

  frame before restart -> interview requested
  symlink repointed to a new directory
  frame after restart  -> interview requested   <- the reviewed failure case
  zero-pending fixture -> "no devices need an interview; idling", no errors

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 09:03:10 +02:00
claude-botandClaude Opus 5 0d7fecad8d build(ci): add z2m-seed runtime image (alpine + jq)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Step 1 of 2 toward removing `apk add` from the zigbee2mqtt seed-data init
container, which currently installs jq on every pod start. Owner
directive: baking tools into a layered image is fine, adding them at
runtime is not.

This commit only adds the image and its build step; nothing consumes it
yet, so it is inert on merge. The Deployment cannot be switched in the
same commit because runtime images in this repo are pinned by DIGEST (as
the secret-rotator CronJobs are), and the digest does not exist until
this has built and pushed. The build therefore writes it out via kaniko's
--image-name-with-digest-file and echoes it as "PIN THIS:", so the
follow-up commit can copy the reference straight from the build log
without a separate registry query.

Why a real JSON parser rather than busybox sed/awk: "key" occurs 12 times
in the actual backup — once per device with an APS link_key — and the
FIRST occurrence is a device key, because "devices" sorts before
"network_key". An extraction that is not correctly anchored yields a
device link key, herdsman then forms a NEW network, and every device
drops off. This was reproduced while prototyping the awk approach, which
is what makes jq worth an image here rather than clever one-liners in the
manifest.

Follows the existing conventions: Containerfile alongside the other
ci/images entries, base pinned by digest to the same alpine:3.21 the
ci-k8s image uses, kaniko build gated on its own path so unrelated pushes
do not rebuild it, and date + latest tags pushed as the other images do.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 08:51:38 +02:00
claude-botandClaude Opus 5 834ded5e9d refactor(zigbee2mqtt): drop apk add from watchdog sidecar
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Owner directive: `apk add` at container start is not acceptable.

Replace alpine:3.21 + `apk add mosquitto-clients` with the broker image
eclipse-mosquitto:2.0.22, used purely for its bundled mosquitto_pub. No
packages are installed at runtime, so the sidecar no longer depends on
network or package-index availability at start.

Every tool the script needs was verified present in that exact image
rather than assumed: sh, tail (including -F, which BusyBox does support),
awk with match()/RSTART/RLENGTH, cat, date, mkdir, mosquitto_pub. The awk
extraction was re-run there and resolves a PENDING device, skips a
SUCCESSFUL one, and skips an unknown address.

Pinned WITHOUT a Flux $imagepolicy marker on purpose: this sidecar is
temporary and must not drag the broker's image-automation policy with it.

Now genuinely non-root (1883/1883, the image's own mosquitto user). The
previous commit justified running as root because `apk add` needed it;
with that gone the only remaining requirement is reading /app/data, and
those paths are world-readable (dirs 0755, files 0644 — verified against
the live PVC), so runAsNonRoot is viable. Cooldown stamps moved to an
explicit emptyDir at /state rather than the image's /tmp, so they stay
writable as non-root without relying on the container filesystem.

Re-verified end-to-end in this image as uid 1883 with no package install:

    running as: uid=1883(mosquitto) gid=1883(mosquitto)
    interview-watch: 1 device(s) currently need an interview
    interview-watch: following /app/data/log/.../log.log
    interview-watch: frame from 0xdeadbeefdeadbeef (nwk=65001 cluster=6) ...
    interview-watch:   interview requested for 0xdeadbeefdeadbeef

with the negative paths also holding: a frame from an already-SUCCESSFUL
device is ignored, and a malformed address neither fires nor crashes.

NOTE: the pre-existing seed-data init container still runs
`apk add --no-cache jq` (line 49). Untouched here as it is out of scope
for this PR, but it violates the same directive and is raised separately.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 08:37:35 +02:00
claude-botandClaude Opus 5 3961640130 fix(zigbee2mqtt): drop BusyBox-incompatible grep from watchdog
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Second review round on #441. The first point was a real blocking defect
that would have shipped silently.

BusyBox grep does not support --line-buffered. Confirmed by running it:

    $ grep --line-buffered -oE '...' <<< 'Received payload: ...'
    grep: unrecognized option: line-buffered
    GREP_EXIT=2

The sidecar runs alpine:3.21 and `apk add mosquitto-clients` does not
pull GNU grep, so the `tail -F | grep --line-buffered | while read` pipe
would have produced zero lines forever while the container still logged
"following <file>" and appeared healthy — a silent no-op of the entire
feature, undetectable from the diff.

Fixed by removing the grep stage rather than installing GNU grep: match
in the read loop with a `case` glob and extract the fields with parameter
expansion. `tail` writes per line and `read` consumes per line, so there
is no buffering question and no extra package. Added a numeric guard on
the extracted address so a future log-format change cannot feed garbage
downstream.

Also from this round:

- Write the cooldown stamp only on a SUCCESSFUL publish. Stamping before
  the result was known burned a device's wake window whenever
  mosquitto_pub failed, then refused to retry for the full 300s despite
  no interview having been requested.
- Derive the request topic from BASE_TOPIC (env, defaulting to
  zigbee2mqtt) instead of hardcoding it, so it cannot silently drift from
  mqtt.base_topic. Noted that the MQTT ACL is scoped to zigbee2mqtt/# and
  would need changing too.
- Harden the sidecar with allowPrivilegeEscalation: false and
  capabilities drop ALL. Deliberately no runAsNonRoot: apk add needs
  root, and Z2M writes database.db and the log dir as root, so a non-root
  uid could not read either input.
- Runbook callout said "Step 2" where it meant item 2 within Step 5.

Verified end-to-end in an alpine:3.21 pod against this script (the
earlier "verified live" evidence came from the session prototype, which
resolved friendly names and is not this code — see PR discussion):
counts only PENDING devices, fires on a frame from a PENDING device with
mosquitto_pub returning success, ignores a frame from an
already-SUCCESSFUL device, and survives a malformed address without
firing or crashing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 08:22:40 +02:00
claude-botandClaude Opus 5 ead4aa3f01 fix(zigbee2mqtt): address review on interview watchdog
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Review points from review-bot on #441.

Stay resident instead of exiting on log-stream end. Previously the
sidecar exit 1'd so the kubelet would restart it and re-resolve the log
file, but that re-ran `apk add mosquitto-clients` over the network every
time and, worse, incurred kubelet crash-loop backoff — which climbs to
5 minutes unless the container stays up >=10 min. Z2M restarts and log
rotations land closer together than that (notably during the "interview
a batch, then restart Z2M once" workflow), so backoff would have kicked
in exactly when a device's short wake window needs a prompt reaction.
The log file is now re-resolved in an outer loop, which also drops the
post-startup network dependency. Chosen over baking a custom image
because it removes the restart entirely rather than making restarts
cheaper.

Match ieeeAddr/nwkAddr independently rather than with one combined sed
pattern. JSON does not guarantee key order, so the old pattern's
assumption that "ieeeAddr" precedes "nwkAddr" held only by virtue of
herdsman's current serialization. Had that changed, the regex would
capture nothing and a device would silently never be picked up — no
error, no log. Now extracted per-field with awk match(), with the
rationale recorded in a comment. Verified against the live database.db
under busybox awk (the sidecar runs alpine): resolves both still-pending
devices, and correctly returns nothing for one that has since been
interviewed.

Flag Step 5 of the migration runbook as automated, so operators do not
hand-chase devices the sidecar already handles. Includes the two
caveats that cost real debugging time: interviewing does not bind
manuSpecificPhilips (needs one Z2M restart), and a device that never
transmits is offline rather than un-interviewed — check lastSeen before
hunting a Z2M-side fault, because a flat battery presents identically.

Not changed: mosquitto_pub takes a password only via argv (-P, or an -L
URL) — it has no --pw-file or env option, verified against the client in
the cluster — so the 🟢 nit cannot be resolved with this client. Not a
cross-container exposure, as the pod does not set shareProcessNamespace;
noted in a comment at the call site.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 08:10:50 +02:00
claude-botandClaude Opus 5 b39a186b7e feat(zigbee2mqtt): add re-interview watchdog sidecar
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The ZHA->Z2M cutover adopted the existing Zigbee network, so devices
stayed joined but database.db started empty — every device needs an
interview before Z2M knows its modelId and can match a converter.

Mains routers interviewed immediately. 16 battery end devices did not,
and they do not self-heal: zigbee-herdsman only retries an interview on
a ZDO device announce, which sleepy devices essentially never emit. They
sat PENDING for six days across 38 process restarts, exposing only a
generic "Automatically generated definition" (battery/linkquality)
instead of action/contact/moisture entities.

A device that transmits is awake, which is exactly when an interview can
succeed. The sidecar watches Z2M's log for the zh:controller frame-receipt
line and fires a forced interview for any device still PENDING/FAILED.
Verified in practice: interviews completed in 11-34s, including
Xiaomi/Aqara sensors, and two fired with no human interaction at all
(a periodic OTA check and an illuminance report).

Implementation notes:

- Sidecar, not a separate Deployment: it reads Z2M's log file and
  database.db, and the PVC is RWO/single-writer. Mounted read-only.
- Signal comes from the log file, not MQTT: an un-interviewed Xiaomi
  device publishes nothing at all (its manufacturer-specific attributes
  cannot be mapped by the auto-generated definition), and
  bridge/logging carries only info-level messages.
- Needs advanced.log_namespaced_levels {zh:controller: debug}. Namespaced
  rather than global debug on purpose: global adds the unpi:parser
  byte-level firehose (~90 lines/min measured) vs ~6 lines/min here.
- database.db is newline-delimited JSON despite the extension, so the
  nwk->IEEE lookup needs no jq and is re-read per frame, which keeps it
  correct across network-address changes and drops devices as they pass.

Interviewing is only half the job: Philips devices also need configure to
bind manuSpecificPhilips (0xFC00), and that cluster is registered only on
Z2M's start event, so a device interviewed mid-run stays unbound until the
next restart. One restart after a batch of interviews completes the binds.

Both the sidecar and the namespaced log level are temporary — remove them
once every device is interviewed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 08:00:50 +02:00
issue-fix-bot 1f29f7221e fix: [alert] KubeJobFailed (velero) (#439)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
2026-07-30 02:45:02 +00:00
security-bot 4dd2eeb264 chore(image-automation): bump ghcr.io/immich-app/immich-machine-learning:v3.1.0
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-29 14:45:04 +00:00
security-bot 529e0db260 chore(image-automation): bump ghcr.io/immich-app/immich-server:v3.1.0
ci/woodpecker/cron/issue-fix Pipeline was successful
Updates managed by image-automation-controller.
2026-07-29 14:39:12 +00:00
security-bot 73c6d131fc chore(image-automation): bump ghcr.io/cloudnative-pg/plugin-barman-cloud:v0.14.0
ci/woodpecker/cron/e2e Pipeline was successful
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-07-29 10:31:57 +00:00
security-bot d92bb12504 chore(image-automation): bump ghcr.io/advplyr/audiobookshelf:2.36.0
ci/woodpecker/cron/e2e Pipeline was successful
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-07-27 23:27:49 +00:00
k.renner a67eee0e48 Merge pull request 'fix(dns): cache floor + serve_stale so UDM blips stop resolving to the WAN proxy' (#435) from claude-bot/dns-serve-stale into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#435
2026-07-27 20:18:59 +00:00
k.renner 07517f0a16 Merge pull request 'fix(monitoring): scrape operator-created ServiceMonitors (Ceph had none)' (#432) from claude-bot/prometheus-scrape-ceph into master
Reviewed-on: k.renner/homelab#432
2026-07-27 20:16:38 +00:00
k.renner 1c7bbc7de7 Merge pull request 'fix(e2e): stop the velero roundtrip cancelling its own DataUpload' (#430) from claude-bot/e2e-velero-dataupload-race into master
Reviewed-on: k.renner/homelab#430
2026-07-27 20:16:19 +00:00
k.renner 2ed257bc6a Merge pull request 'fix(opentofu): correct swapped proxy-1/proxy-2 IPv6 attribution' (#431) from claude-bot/fix-proxy-v6-labels into master
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
Reviewed-on: k.renner/homelab#431
2026-07-27 20:15:56 +00:00
k.renner 6a06e8b0df Merge pull request 'fix(triage): give the CI diagnostics SA read access to Loki' (#429) from claude-bot/triage-loki-access into master
Reviewed-on: k.renner/homelab#429
2026-07-27 20:15:31 +00:00
claude-botandClaude Opus 5 adbdd53a38 fix(dns): cache floor + serve_stale so UDM blips stop resolving to the WAN proxy
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Root cause of #393, confirmed. Three things combine:

1. The public renner.uno zone has a *.renner.uno CNAME to proxy.renner.uno
   that matches at EVERY depth, so renner.uno never returns NXDOMAIN:
     definitely-not-real-xyz123.iot.renner.uno -> proxy.renner.uno -> 45.157.177.26
   Any name that fails locally resolves publicly to the WAN proxy instead of
   failing honestly.

2. TTL asymmetry. The correct answer is a dnsmasq DHCP-lease record with
   TTL 5 (verified: `dig @10.2.50.1 shellyplusi4-....iot.renner.uno` returns
   `aa` + TTL 5). The wrong wildcard answer has TTL 300 — 60x more durable.
   So one 5-second failure pins a wrong answer for 5 minutes. That is exactly
   the "correct at 14:10, wildcard-only at 15:45" report in the issue.

3. The UDM's dnsmasq refuses connections in bursts — 330 "connection refused"
   errors in the last 3000 k8s-gateway log lines, on BOTH 10.2.40.1 and
   fd00::1.

Note the issue's premise was wrong: there is no "pinning job". The device
records are ephemeral DHCP-lease records in dnsmasq, not IaC. external-dns-unifi
is also NOT the culprit despite running --policy=sync: it writes the UDM's
static-DNS list, not the lease table, and --registry=txt confines deletion to
records carrying its own TXT.

Fix: raise the cache floor and serve through upstream outages.
  success ... 60      clamps the 5s TTL up to a 60s floor
  serve_stale 1h immediate  keeps answering while the upstream refuses

This also fixes the zigbee2mqtt crash-loop, which has the same cause — z2m
exits on `getaddrinfo EAI_AGAIN slzb-zigbee.renner.uno` with no retry, and the
k8s-gateway log shows that exact name failing against both UDM addresses.

Validated before committing, because CoreDNS is cluster-critical and the
`template` plugin previously broke cluster DNS here (7a09bad5):
- The repo's full Corefile runs under the real coredns:v1.13.2 image (parses;
  only the expected out-of-cluster kubernetes-plugin error).
- The repo's k8s-gateway values render via `helm template` (rc=0) and the
  resulting Corefile starts under the real k8s_gateway:1.7.0 image
  (CoreDNS 1.14.2).
- The cache parameters MUST stay on one line: a multi-line value breaks the
  chart's ConfigMap render with "could not find expected ':'". Confirmed by
  hitting it.
- The forward block is deliberately untouched — its options require newlines
  and cannot be expressed through the chart's single-line parameters.
- The `template` plugin is NOT reintroduced.

Known not fixed: AAAA for lease-backed names is deterministically shadowed
(dnsmasq has an A from the lease but no AAAA, so AAAA forwards upstream and
hits the wildcard every time). That needs a NODATA response for those names
and is a separate, tightly-scoped change — filing separately.

Refs #393

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 21:43:57 +02:00
claude-botandClaude Opus 5 de7e668f49 fix(monitoring): scrape operator-created ServiceMonitors (Ceph had none)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
There are zero ceph_* series in Prometheus, and there have been for all 79
days of the cluster's life:

  count of ceph_ metrics in Prometheus: 0
  rook-ceph active scrape targets:      0

Not a Rook misconfiguration — `monitoring.enabled: true` is set and both
ServiceMonitors exist. They are simply never selected:

  Prometheus serviceMonitorSelector : matchLabels {release: kube-prometheus-stack}
  rook-ceph-mgr / rook-ceph-exporter: labels      {team: rook}

The Rook operator creates those ServiceMonitors at runtime with its own
hardcoded label, so no static manifest or Kustomize patch in this repo can
relabel them.

Cluster-wide this was dropping 12 of 30 ServiceMonitors:
  rook-ceph/rook-ceph-mgr, rook-ceph/rook-ceph-exporter   (team: rook)
  authentik/ak-outpost-* x10                              (goauthentik.io/...)

Consequences: the entire storage layer had no telemetry and no history — so
Ceph trend analysis is impossible for anything before this lands, and any Ceph
PrometheusRule added today would have silently had nothing to fire on.

This is the ServiceMonitor twin of the trap already documented for rules in
monitoring-rules/prometheusrule-velero.yaml ("without this label the rule is
created but never loaded into Prometheus").

ruleSelector is deliberately NOT loosened — this repo's PrometheusRules all
carry the release label on purpose, and keeping that selector strict stops a
stray third-party rule from firing here.

Blast radius: 12 new scrape targets. The 10 authentik outposts come along with
the 2 rook ones; they are legitimate targets, but they are a side effect of
this change rather than its goal.

Found while investigating the Ceph BLUESTORE_SLOW_OP_ALERT warning, which
itself turned out to be a benign self-limiting event.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 21:30:43 +02:00
claude-botandClaude Opus 5 5a46db78ce fix(opentofu): correct swapped proxy-1/proxy-2 IPv6 attribution
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The two v6 addresses in hairpin_endpoints were attributed to the opposite
proxy members. DNS is the operational truth, verified independently:

  getent ahosts proxy-1.renner.uno -> 2a03:4000:28:f6e:a4c7:59ff:fe1e:9a29
                                      (v6-only member, single AAAA)
  getent ahosts proxy-2.renner.uno -> 2a03:4000:4b:c1e:4474:43ff:fedf:8f85
                                      45.157.177.26   (dual-stack member)

Purely a labelling fix with zero functional impact: both entries DNAT to the
same target (fd99::86), so the hairpin behaved identically before and after.
Slots are untouched — the file's "never reuse a freed slot" rule applies to
the keys, not the values.

Also trims the now-stale NOTE in probes-blackbox.yaml that existed only to warn
readers away from the wrong labels; the two files now agree.

Surfaced while triaging #392/#420, both of which turned out to be already
fixed. `tofu validate` passes. (Note: `tofu fmt` reports pre-existing
alignment drift further down this file, at the jsonencode block around line
108 — present on master before this change and deliberately left alone.)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 21:28:00 +02:00
claude-botandClaude Opus 5 2797f64bb0 fix(e2e): stop the velero roundtrip cancelling its own DataUpload
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The velero e2e check manufactured phantom PartiallyFailed Backups that then
polluted backup-health triage. Sequence, from Loki for e2e-1785031248:

  02:01:05  Backup + PVC created (DataUpload -> phase Prepared)
            ... data path never starts (node-agent slot held elsewhere)
  ~02:06    the 60x5s = 300s wait expires -> check FAIL, but does NOT abort
            -> script deletes ns velero-e2e and creates the Restore
  02:07:03  restore error "no DataUpload result cm found" -> PartiallyFailed
  02:10:08  script deletes Backup+Restore -> "Cancel du under phase Prepared
            because it is being deleted" -> Backup lands PartiallyFailed

Both 2026-07-26 occurrences (02:00:55 and 12:04:05) fall inside a running
restore-test sweep. node-agent-config.yaml sets no loadConcurrency, so Velero's
default of one data path per node applies and the sweep's data-mover pods hold
the slot — a 1 GiB e2e DataUpload then sits in Prepared well past 5 minutes.
The backup was never actually faulty; the test cancelled it.

Three changes:
- Wait 120x15s (30 min) instead of 60x5s (5 min), so a queued DataUpload has
  time to run once the slot frees.
- Guard the destructive half (namespace teardown + restore roundtrip) behind
  whether the backup check actually passed. Tearing down while the upload is
  in flight is what cancels it.
- Do not delete the Backup on the failure path either — that is the same race
  relocated to cleanup. The Backup carries ttl: 2h0m0s, so Velero's GC reaps
  it regardless and leaving it costs nothing.

Cleanup of the restore, namespace and released PVs stays unconditional, so
nothing leaks. Verified with `bash -n`.

Found while triaging #427; the restore-test failure there was unrelated and
is already fixed.

Refs #427

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 21:26:14 +02:00
k.renner 211d661c75 Merge pull request 'chore(reloader): bump chart constraint from the dead 1.x line to 2.2.x' (#428) from claude-bot/reloader-chart-2x into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#428
2026-07-27 19:22:42 +00:00
claude-botandClaude Opus 5 39a9519ed3 fix(triage): give the CI diagnostics SA read access to Loki
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The alert triage agents could reach Prometheus and Alertmanager through the
apiserver service proxy, but not Loki:

  kubectl auth can-i get "services/loki:3100" --subresource=proxy -n monitoring \
    --as=system:serviceaccount:monitoring:ci-diagnostics   -> no
  (same check for kube-prometheus-stack-prometheus:9090     -> yes)

That gap has a sharp edge. A KubeJobFailed-class alert can only be cleared by
DELETING the failed Job — the rule's own annotation instructs this — and the
deletion destroys the pod and its logs. So the agents would inspect a failed
Job, find no live pod, declare the root cause "unconfirmable", and then delete
the last copy of the evidence.

The evidence was never actually gone: Alloy ships all pod logs to Loki with
retention_period: 2160h (90d). Issue #380 declared velero/restore-test-29740440
"probably unconfirmable" and its full failure output was in Loki the whole time
(FAIL: 3 — apps restore phase + two PVC parity checks).

Adds `loki` / `loki:3100` to the existing service-proxy Role (read-only GET,
same bare + :port-qualified pattern the other entries use, verified against the
live Service which exposes http-metrics:3100), and teaches both agent prompts
the query recipe so "the pod is gone" stops being accepted as a dead end.

No new privilege class: the agents already hold pods/log cluster-wide. This
mainly extends their reach to *deleted* pods.

Refs #427, #380

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 21:21:38 +02:00
claude-botandClaude Opus 5 3a001c5f46 chore(reloader): bump chart constraint from the dead 1.x line to 2.2.x
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The `>=1.0.0 <2.0.0` ceiling had reached its practical maximum: chart 1.3.0
(app v1.3.0) is the last 1.x ever published, so the bound was holding the
cluster on a dead line while upstream had moved on to app v1.4.19.

Verified before bumping:
- The only breaking change at the 1.x->2.0.0 boundary is the relocation of
  `deployment.image.*` to top-level `image.*`. This HelmRelease sets
  `values: {}`, so neither key is in play and the bump is a drop-in.
- `helm template stakater/reloader --version 2.2.14` renders cleanly with
  default values (rc=0, image v1.4.19).
- ClusterRole rules are byte-identical between 1.3.0 and 2.2.14 — the
  cluster-wide privileges of this restart-authority controller do not change.
  2.x additionally ships a namespace-scoped Role (configmaps
  list/get/watch/create/update) used for leader election. Additive only.
- `kubectl kustomize kubernetes/infrastructure` renders 199 resources with the
  HelmRelease resolving to the new constraint.

Floored at 2.2.0 rather than 2.0.0 to skip the early 2.0/2.1 line outright.
Resolves to 2.2.14 today.

Blast radius on upgrade: reloader itself rolls; the 7 annotated workloads
(apps/external-dns, apps/woodpecker-agent, apps/woodpecker-server,
home-assistant/home-assistant, home-assistant/shelly-manager,
monitoring/pve-exporter, paperless/paperless) are not restarted by a
controller upgrade alone.

Refs #426

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 21:18:32 +02:00
k.renner 70a5361ef5 Merge pull request 'feat(netbird): pull-based off-VPS backup of the controller store' (#417) from netbird-vps-backup into master
ci/woodpecker/push/deploy-netbird-server Pipeline was successful
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/cron/e2e Pipeline was successful
ci/woodpecker/cron/security-scan Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#417
2026-07-27 10:38:50 +00:00
k.renner 7eb8677147 Merge pull request 'fix: [alert] KubePodCrashLooping (apps) (#424)' (#425) from alert-fix/issue-424 into master
Reviewed-on: k.renner/homelab#425
2026-07-27 10:37:55 +00:00
k.renner e710b5d207 Merge pull request 'velero: put restore-test probe PVCs on a Delete class, sweep orphans from dead runs' (#422) from claude-bot/restore-test-ephemeral-sc into master
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/update-audit Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#422
2026-07-26 19:53:34 +00:00
issue-fix-bot 5f7e3c1268 fix: [alert] KubePodCrashLooping (apps) (#424)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
2026-07-26 11:46:36 +00:00
claude-botandClaude Fable 5 d70ebe9ce3 Merge master: resolve monitoring-rules kustomization conflict with #415
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 10:55:49 +02:00
claude-botandClaude Opus 5 e16dfd8603 velero: put restore-test probe PVCs on a Delete class, sweep orphans from dead runs
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Follow-up to #416 (ceph-block-ephemeral) for restore-test.sh's own PV leak
(incident 2026-05-17, ~2.7 TB of orphan CephFS subvolumes).

The intent was to retire purge_released_pvs entirely. That is not safely
possible, and the reason is worth recording. Three categories of throwaway
PVC exist per iteration; only one is ours to pick a StorageClass for:

  1. source snapshot-probe PVCs (rt-src-*) — this script creates them.
     FIXED HERE: the CephFS branch of sc_for_snapshot_probe returned
     `ceph-filesystem` (Retain), so every probe leaked a Released PV. It
     now returns `ceph-filesystem-ephemeral` (Delete). The two classes are
     identical apart from reclaimPolicy — same provisioner, parameters and
     mountOptions — so the snapshot restores into it unchanged.

     The ceph-block branch needed no change and must not get one: it
     already uses ceph-block-snapshot-readonly, which is Delete, and whose
     `noload` mountOption is load-bearing (skips ext4 journal replay on the
     RO snapshot mount). ceph-block-ephemeral lacks noload, so pointing the
     probe at it would reintroduce the dirty-journal mount failure.

  2. destination PVCs in *-restore-test namespaces — Velero creates them
     from the backed-up PVC spec, so the class is whatever production uses
     (Retain). The only remap knob is the change-storage-class
     RestoreItemAction ConfigMap, which Velero applies to EVERY restore in
     the installation with no per-restore scoping. Using it would strip
     Retain from a real disaster-recovery restore. Rejected.

  3. Velero data-mover staging PVCs in velero/ (*-rtest-*) — derived from
     the target PVC. The node-agent restorePVC config supports only
     `ignoreDelayBinding`; unlike backupPVC there is no storageClass field
     on Velero v1.18.

So 2 and 3 keep purge_released_pvs load-bearing; it stays, now documented.

Also fixes a real residual leak the ephemeral class does not address:
cleanup_service's purge is scoped to ${RUN_ID}, which is right during a run
but means a run that dies before cleanup (activeDeadlineSeconds, OOM, node
eviction, killed Job) strands its PVs forever — no later run's pattern ever
matches an older RUN_ID. Adds an unscoped sweep at run start. Safe because
concurrencyPolicy Forbid guarantees no other restore-test Job is active, and
it only ever touches Released PVs whose claimRef matches restore-test-only
naming patterns.

Verified against the live cluster: the sweep pattern matches zero PVs today,
and in particular does not match the three intentional Retain safety PVs
(crowdsec/crowdsec-db-pvc, openbao/data-openbao-0,
home-assistant/mosquitto-data). Categories 2 and 3 were confirmed to
provision on Retain classes by observing an in-flight run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 10:52:07 +02:00
k.renner 41676a85fc Merge pull request 'fix: [alert] TargetDown (monitoring) (#419)' (#421) from alert-fix/issue-419 into master
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
Reviewed-on: k.renner/homelab#421
2026-07-26 08:49:25 +00:00
k.renner 0dc79d4a11 Merge pull request 'fix(netbird-proxy): pin resolv.conf — proxy-1 lost DNS on host network' (#414) from netbird-proxy-dns-fix into master
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
Reviewed-on: k.renner/homelab#414
2026-07-26 08:47:52 +00:00
issue-fix-bot 4448a7c96d fix: [alert] TargetDown (monitoring) (#419)
ci/woodpecker/pr/ci-scripts-test Pipeline is pending
ci/woodpecker/pr/pr-review Pipeline was canceled
2026-07-26 08:44:03 +00:00
k.renner 443d41e792 Merge pull request 'feat(monitoring): WAN-path probes for the NetBird edge, controller, relays' (#415) from netbird-monitoring-probes into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#415
2026-07-26 07:29:33 +00:00
k.renner 2db4a57052 Merge pull request 'velero: exclude transient subtrees from restore-test parity, move sweep off backup window' (#418) from claude-bot/restore-test-volatile-paths into master
Reviewed-on: k.renner/homelab#418
2026-07-26 07:28:01 +00:00
claude-botandClaude Fable 5 c9009ffd3f review: pin the VPS host key; dump store.db only (no secrets in tarball)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
- No TOFU: the CronJob writes a pinned known_hosts (ed25519 key captured
  via ssh-keyscan 2026-07-26 and cross-checked against the workstation's
  trusted entry) and uses StrictHostKeyChecking=yes. A reprovisioned VPS
  makes the job fail loudly — desired.
- The dump now contains ONLY store.db: /opt/netbird/config is fully
  regenerable from the role's templates + vault, and including it put
  the plaintext TURN secret into every nightly tarball. Restore is
  role-run (rebuilds config) + untar into /opt/netbird/management/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 09:26:18 +02:00
claude-botandClaude Fable 5 2bd54ef378 review: escape dots in relay health instance regex
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 09:24:38 +02:00
claude-botandClaude Fable 5 9b353b49eb review: dhcpcd reload instead of restart; ensure persistent
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The restart could in principle deconfigure the interface and cut the
SSH connection Ansible rides on (dhcpcd default without persistent).
Verified live: persistent is in fact already set on both members (line
19), so the risk was theoretical here — but 'dhcpcd -n' (reload config
+ rebind, verified supported) achieves the same effect with no
deconfigure window at all, and the role now asserts persistent
explicitly instead of relying on it being there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 09:24:28 +02:00
claude-botandClaude Opus 5 e8c2e400e5 velero: verify prune expression in the probe image, rename expr -> find_expr
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Addresses the automated review on #418.

Closes the review's open question about whether the -prune/-path/paren
grouping behaves the same in the probe pod's own busybox build. Rather
than leaving it as a "watch the first real run" note, it was tested
directly: an alpine:3.21 pod (BusyBox v1.37.0) with the same
securityContext and read-only mount as count_files_in_pvc's probe,
against the live audiobookshelf-metadata volume.

  unfiltered:            2339
  pruned streams + tmp:   775   == 2339 - 1531 - 33

Two robustness properties also confirmed in that image:
  - pruning a path that does not exist on the volume is a no-op with
    exit 0, so a stale entry degrades gracefully instead of zeroing the
    count and faking a catastrophic-loss FAIL;
  - each prune subtracts exactly its own subtree (tmp alone -> 2306).

Also renames the local `expr` to `find_expr` so it cannot be misread as
the expr(1) command by someone skimming for invocations. No behaviour
change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 09:16:51 +02:00
claude-botandClaude Fable 5 10489eedd0 review: allowlist netbird-backup on the ClusterSecretStore + hygiene
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
- The blocking catch: the openbao ClusterSecretStore's namespace
  conditions did not include the new netbird-backup namespace, so the
  ExternalSecret could never sync even after key provisioning. Added
  (sorted, with consumer comment).
- rm -f /backup/*.part up front — aborted-run leftovers are outside the
  retention glob.
- storageClassName: ceph-block explicit, matching the repo's other
  single-PVC manifests.

Keeping the key on root with restrict,command= rather than a dedicated
VPS user: the forced command is the actual privilege boundary (the key
can only ever produce a dump), and a separate user would need read
access to root-owned live SQLite + config either via group surgery on
/opt/netbird or sudo rules — more moving parts for the same effective
capability.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 09:15:31 +02:00
claude-botandClaude Fable 5 e3bc00916d review: full per-member/family edge coverage; DNS is the member truth
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The review flagged the v6 target as 'proxy-2 per unifi_nat_hairpin.tf'.
The tf label keys are the swapped ones: DNS (dig) and the live hosts
(the v6-only member with the nameserver-less dhcpcd lease answers as
proxy-1.renner.uno = 2a03:…:28:f6e…; the dual-stack member answers as
proxy-2.renner.uno = 45.157.177.26 + 2a03:…:4b:c1e…) both agree with
the probe's original attribution, as does the netbird-proxy role's
'proxy-1 is v6-only' doc. Keep DNS attribution, document the tf
mislabel (tracked for a separate relabel — renaming those tf map keys
churns NAT rule resources, so it doesn't belong in this PR), and:

- add proxy-2's v6 address as a third target (previously its v6 path
  was unprobed; verified live from a pod, returns 200)
- pin job="blackbox-http" on NetbirdControllerUnreachable for
  consistency with the other rules

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 09:15:15 +02:00
claude-botandClaude Fable 5 214c211377 review: BOF-pin nohook, inline dhcpcd restart, drop handler
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
- insertbefore: BOF so nohook stays global if an interface stanza ever
  appears (none exist today, verified live on both members).
- dhcpcd restart is now an inline when-changed task instead of a
  handler: nohook must take effect before a lease renewal can re-clobber
  the pinned file, and meta: flush_handlers would also fire the
  proxy-recreate handler before the compose file exists on a fresh host.
  Unit name verified as plain dhcpcd.service on both members.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 09:15:02 +02:00
k.renner 4383f28dc1 Merge pull request 'fix(ceph): add ceph-block-ephemeral SC for throwaway test PVCs (stop RBD leak)' (#416) from ceph-block-ephemeral-sc into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#416
2026-07-26 07:07:17 +00:00
claude-botandClaude Opus 5 e41730e8bb velero: exclude transient subtrees from restore-test parity, move sweep off backup window
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The 2026-07-26 restore-test run failed 1 of 40 checks:

  audiobookshelf: PVC audiobookshelf-metadata file count parity (±10%)
    -- source=2339 restored=803

This was a false positive. The backup was complete: backup
audiobookshelf-daily-20260725034518 is phase=Completed with no errors or
warnings, and all four of its DataUploads finished with bytesDone ==
totalBytes.

The parity check compares a backup taken up to ~24 h ago against the live
volume *now*, counting files with an unfiltered `find`. Between the backup
(07-25 03:45) and the source probe (07-26 02:12), one Audiobookshelf
playback session wrote 1531 HLS transcode files (~153 MiB) into
metadata/streams/. Excluding that directory: 2339 - 1531 = 808 persistent
files vs 803 restored, a 0.6% delta — comfortably inside the tolerance.
The next day's metadata DataUpload was +157 MB, independently confirming
the stream segments were the only thing that changed.

Fixes:

1. Add volatile_paths_for(), a per-"<namespace>/<pvc>" list of transient
   subtrees pruned from BOTH the source and restored counts. Only
   streams/ and tmp/ are excluded for audiobookshelf-metadata; cache/ is
   left counted deliberately, since it is stable enough not to threaten
   the tolerance and dropping it would cost real coverage. Every entry is
   a blind spot, so the list is kept minimal. Volumes with no entry keep
   the exact previous behaviour.

2. Move the CronJob from Sunday 02:00 to Sunday 08:00 UTC. The old slot
   was picked as "well before Monday's daily backups", which missed that
   the daily schedules also fire on Sunday — a ~5 h sweep starting at
   02:00 sat on top of the whole 03:15-07:15 backup window and starved it
   of node-agent DataUpload concurrency. audiobookshelf-daily took 2 h
   18 m (07-19) and 2 h 33 m (07-26) against a ~1 min baseline, with the
   books DataUpload not starting until 06:18. Both Sundays; no other day
   shows it.

The pruning find expression was verified against the live
audiobookshelf-metadata volume (busybox find, same as the alpine probe
image): it returns 775, matching 2339 - 1531 - 33.

Refs #380.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 09:06:25 +02:00
claude-botandClaude Opus 4.8 20e41ac289 docs(ceph): address review nits on ceph-block-ephemeral (#416)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
- e2e-test.sh: note that purge_released_pvs '^default/e2e-pvc$' is now a
  one-time safety net (e2e-pvc uses ceph-block-ephemeral, so it normally
  no-ops) rather than dead weight.
- RECOVERY.md: explain why Delete reclaim is safe *here* specifically — this is
  the throwaway restore-test, never a real DR target (a real cold-rebuild uses
  the live cluster's Retain ceph-block storage).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 09:04:56 +02:00
claude-botandClaude Fable 5 37d9eafecf feat(netbird): pull-based off-VPS backup of the controller store
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Closes the last big SPOF-assessment item: the management SQLite store
(peers, setup keys, groups, routes) had zero backup coverage — losing
the Hetzner VPS meant re-enrolling the entire mesh. The VPS cannot
reach any PBS (both PBS names resolve to the public proxy, ports
closed), so the cluster pulls instead of the VPS pushing:

- VPS (netbird-server role): a dump script takes a CONSISTENT snapshot
  via sqlite3 .backup (online-backup API, safe against the live writer)
  plus /opt/netbird/config and streams a tar.gz to stdout. A dedicated
  ed25519 key is authorized for root restricted to exactly that script
  (restrict,command=…) — the puller can run nothing else.
- Cluster (kubernetes/infrastructure/netbird-backup): nightly CronJob
  (02:45) ssh-pulls the dump onto a 5Gi Ceph PVC, gzip-verifies before
  renaming, keeps 14 dumps; ExternalSecret syncs the private key from
  OpenBao (homelab/infrastructure/netbird-backup, one-time manual
  provisioning like the rotator bootstraps); restricted-profile pod.
- Offsite: new Velero Schedule netbird-backup-daily (07:45, PVC-only,
  snapshotMoveData, 30 d TTL) ships the PVC to Hetzner Object Storage.
- Alerts: NetbirdVpsBackupStale (critical, >26 h without success) and
  NetbirdVpsBackupNeverRan (warning — catches the unprovisioned-secret
  state so the backup cannot die silently).

Restore: untar over /opt/netbird/{management,config} after the role
rebuilds the stack.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 09:03:08 +02:00
claude-botandClaude Opus 4.8 b240a203cf fix(ceph): add ceph-block-ephemeral SC for throwaway test PVCs (stop RBD leak)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Root cause of the daily RBD-image leak (found while reclaiming 15 orphaned
images on 2026-07-26): throwaway block PVCs used the default ceph-block
StorageClass, which is reclaimPolicy: Retain. On PVC deletion the PV goes
Released (image retained), and the ad-hoc reclaim (patch reclaimPolicy=Delete ->
delete pv) races the ceph-csi provisioner — if it acts on the stale Retain
policy it removes the PV but orphans the RBD image. Same class of bug as #262,
which was already fixed for CephFS via ceph-filesystem-ephemeral but never for
RBD.

- Add ceph-block-ephemeral (reclaimPolicy: Delete), the RBD mirror of the
  existing ceph-filesystem-ephemeral, in rook-ceph-cluster/storageclass.yaml.
- e2e-test.sh: point the throwaway default/e2e-pvc at it (this was the ~1
  image/day source via the daily e2e crons).
- RECOVERY.md: point the CNPG restore-test drill's throwaway cluster at it and
  simplify the teardown — with Delete reclaim, deleting the cluster removes the
  PVC -> PV -> RBD image automatically, so the manual PV-reclaim dance is gone.

Residual (separate): the velero restore-test (Sundays) restores PVCs with the
source's storageClass (ceph-block, Retain) and can't be repointed the same way;
it still relies on its purge_released_pvs helper.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 08:57:48 +02:00
claude-botandClaude Fable 5 8b1480f429 feat(monitoring): WAN-path probes for the NetBird edge, controller, relays
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Closes the vantage-point gap that let the 2026-07-24 controller outage
run ~20 h unnoticed: every existing probe of the public names resolves
in-cluster (CoreDNS/k8s_gateway) or gets hairpinned, so nothing measured
the actual WAN path.

- blackbox module http_2xx_wan_edge: probes the edge by proxy IP
  literal with SNI/Host pinned to home.renner.uno. The Server/Ingress
  VLANs are deliberately absent from the UniFi hairpin, so IP-literal
  probes from the in-cluster exporter genuinely leave via the WAN and
  come back through the netcup edge (verified live from a pod: v4
  returns 200; v6 currently fails against proxy-1 — real breakage,
  fixed separately by the resolv.conf PR).
- New probes: WAN edge per member/family (proxy-2 v4, proxy-1 v6),
  https://netbird.renner.uno (controller), relay :9000/health on both
  netcup members, tcp :33080 relay listeners.
- New PrometheusRule netbird-availability: controller unreachable
  (critical 10m), whole edge down from WAN (critical 5m), single edge
  member down (warning 15m), relay member down (warning 15m).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 08:57:01 +02:00
claude-botandClaude Fable 5 db255b2a73 fix(netbird-proxy): pin resolv.conf — proxy-1 lost DNS on host network
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
dhcpcd's resolv.conf hook overwrites the systemd-resolved stub file that
/etc/resolv.conf symlinks to. On v6-only proxy-1 the lease carries no
resolver options, leaving the file with zero nameserver lines; host
tools keep working via nss-resolve, but the host-network proxy container
copies that file at create time and Go's resolver falls back to
localhost:53. Result: proxy-1's reverse-proxy has been unable to reach
management since the host-network switch — no cert mapping, TLS
'unknown domain "home.renner.uno"' for v6 edge clients that resolve to
its address. Bridge mode had masked the broken file via Docker's
embedded DNS; proxy-2 only survived because its v4 lease happened to
write usable nameservers into the same clobbered file.

Fix on both members: nohook resolv.conf for dhcpcd (+ restart handler so
it takes effect immediately) and a static /etc/resolv.conf pointing at
the resolved stub (127.0.0.53, healthy netcup upstreams on both hosts),
then force-recreate the proxy so it picks up the fixed file.

Found by the WAN-path edge probe work: the v4 probe returned 200 while
the v6 probe failed TLS against proxy-1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 08:56:26 +02:00
k.renner 43808f206b Merge pull request 'docs: normalize prune-guard comment tense post seed->apps migration' (#413) from normalize-prune-guard-comments into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#413
2026-07-26 06:42:00 +00:00
claude-botandClaude Opus 4.8 1550256d5f docs: normalize prune-guard comment tense post seed->apps migration
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The seed->apps ownership handoffs are complete, so the prune: disabled comments
on the folded CNPG DB objects no longer read 'ahead of the ... handoff' (future
tense). Normalize the 17 comments across authentik/immich/paperless/woodpecker/
influxdb to standing-guard/past tense. Comment-only; no manifest changes.

Closes the tense-normalization item flagged on the immich fold review (#405).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 08:38:14 +02:00
k.renner 76e35dc8ac Merge pull request 'feat(netbird): relay + STUN cluster members on the netcup proxy hosts' (#412) from netbird-netcup-relays into master
ci/woodpecker/push/deploy-netbird-server Pipeline was successful
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: k.renner/homelab#412
2026-07-26 06:26:55 +00:00
claude-botandClaude Fable 5 c6a578b4f2 docs(netbird-proxy): document relay watchdog decision + health endpoint
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Review follow-up: note in the compose template why the relay is not
covered by the proxy watchdog (fallback component, client-side relay
failover, restart: unless-stopped) and record the :9000/health endpoint
(verified on 0.73.2) for future active monitoring.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 08:18:50 +02:00
k.renner 8b1fa7b724 Merge pull request 'refactor(authentik): fold seed-authentik into the authentik KS — retire the seed layer (stage 2)' (#411) from authentik-dedicated-fold into master
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
Reviewed-on: k.renner/homelab#411
2026-07-26 06:17:21 +00:00
security-bot 918e15efcb chore(image-automation): bump redis:7.4.10-alpine
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-26 06:09:55 +00:00
claude-botandClaude Fable 5 7eff0940da feat(netbird): relay + STUN cluster members on the netcup proxy hosts
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Second/third NetBird relay (netbirdio/relay, host network, ws :33080,
embedded STUN :3478/udp) on proxy-1/proxy-2, sharing the existing relay
auth secret, and registered in management.json Relay.Addresses and
Stuns. Clients pick a relay at random and fail over automatically, so
relayed connections and — via the added STUN — new P2P candidate
discovery now survive a controller-VPS (Hetzner) outage. Closes
mitigation option 2 from the 2026-07-25 SPOF assessment.

Plaintext rel:// is deliberate: :443/:80 on these hosts belong to the
reverse-proxy and redirect (no HTTP-01/ALPN slot), and a zone-wide
DNS-01 token on an internet-facing host is a worse trade. Peer payload
stays WireGuard-encrypted end to end; exposure is relay framing
metadata and credential sniff-and-reuse bounded by the 24h TTL.

proxy-1 is v6-only — v4-only clients that draw it fail over to the
dual-stack members.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 08:03:40 +02:00
claude-botandClaude Opus 4.8 91f5baf661 refactor(authentik): fold seed-authentik into the authentik KS — retire the seed layer (stage 2)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The last app in the seed->apps migration. Folds authentik's ak-pg CNPG backend
into the existing dedicated authentik KS and, since authentik was the final
holdout, fully retires kubernetes/seed/.

- git mv seed/authentik/{cluster,objectstore,scheduled-backup,barman-creds-
  externalsecret,hetzner-creds-externalsecret}.yaml -> apps/authentik/, add to
  apps/authentik/kustomization.yaml (authentik has no data PVCs — all state is
  in ak-pg).
- authentik KS: drop 'dependsOn: seed-authentik', add
  'dependsOn: infrastructure-cnpg-barman', add the CNPG Cluster healthCheckExprs.
- Delete clusters/homelab/seed-authentik.yaml and the now-empty seed/authentik/.

Seed-layer retirement cleanup (kubernetes/seed/ is now empty):
- git mv seed/RECOVERY.md -> kubernetes/RECOVERY.md (sibling to the MIGRATION-*
  docs); fix its stale 'flux reconcile kustomization seed-authentik' example to
  'authentik'.
- e2e-test.sh: drop the last seed-* readiness check (seed-authentik).
- bootstrap.sh: rewrite the obsolete 'per-app seed-<app> KSes' gating comment to
  reflect that app KSes now own their CNPG DBs directly, and de-'seed' the
  wait-description labels (the one-shot rsync/pg_restore seed Jobs are long gone).
- opentofu/object_storage.tf: fix the CNPG ObjectStore path comment
  (kubernetes/seed/* -> kubernetes/apps/*).

Safe ownership transfer (nothing pruned): all 5 seed/authentik objects carry
prune: disabled (from stage 1 #407), so deleting seed-authentik skips them in GC
and the authentik KS adopts them in place. No CNPG restart, no app restart.
Restore-test passed first: ak-pg backup restored cleanly (25 users, 368 tables,
1225 MB) using the corrected RECOVERY.md recipe, with a clean no-leak teardown.

Verified: kubectl kustomize apps/authentik builds with Cluster/ak-pg + exactly
5 prune-protected; bash -n bootstrap.sh + e2e-test.sh OK; kubernetes/seed/ fully
removed; no stale seed file-path references remain.

Left intentionally: barman/hetzner ExternalSecrets still read OpenBao keys under
seed/authentik/... (vault paths, not repo paths).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 08:00:32 +02:00
k.renner 8d6857d394 Merge pull request 'chore(authentik): pre-stage prune:disabled on the ak-pg CNPG objects (stage 1)' (#407) from authentik-prune-protect into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#407
2026-07-26 05:52:52 +00:00
k.renner dd119cf7dc Merge pull request 'fix: [alert] KubePodCrashLooping (apps) (#408)' (#410) from alert-fix/issue-408 into master
Reviewed-on: k.renner/homelab#410
2026-07-26 05:51:55 +00:00
issue-fix-bot ebf93db191 fix: [alert] KubePodCrashLooping (apps) (#408)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
2026-07-26 05:44:41 +00:00
k.renner d0b449ed74 Merge pull request 'hotfix(netbird-proxy): allow non-root :443 bind on the host network' (#409) from netbird-proxy-port-sysctl into master
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#409
2026-07-26 05:44:06 +00:00
claude-botandClaude Fable 5 5fa8c03827 hotfix(netbird-proxy): allow non-root :443 bind on the host network
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
The host-network switch (#406) broke both proxy members: the
reverse-proxy runs as a non-root user, and on the host netns the default
ip_unprivileged_port_start=1024 denies binding :443 — the container
crash-loops with 'listen tcp :443: bind: permission denied'. In bridge
mode Docker set the sysctl to 0 inside the container netns, which is why
the published-port setup never hit this.

Set net.ipv4.ip_unprivileged_port_start=443 persistently on the proxy
hosts (governs v6 binds too, despite the name). The crash-looping
container self-heals within its restart backoff once the sysctl lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 07:41:10 +02:00
k.renner 6d286ac00a Merge pull request 'fix(netbird): direct P2P for proxy→cluster and intra-cluster peers' (#406) from netbird-p2p-direct into master
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: k.renner/homelab#406
2026-07-26 05:35:02 +00:00
claude-botandClaude Opus 4.8 833a2ca274 chore(authentik): pre-stage prune:disabled on the ak-pg CNPG objects (stage 1)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Stage 1 of folding seed-authentik into the existing dedicated authentik KS — the
last app in the seed-layer retirement, and the highest blast radius (ak-pg backs
the SSO identity provider). Adds prune: disabled, in place, to the 5 CNPG DB
objects under seed/authentik/ so the ownership handoff can never prune them:

- Cluster/ak-pg (HA, 2 instances — pruning deletes the identity DB's data PVCs)
- ObjectStore/ak-pg-store, ScheduledBackup/ak-pg-daily
- ExternalSecret/barman-cloud-creds, ExternalSecret/hetzner-s3-creds

authentik has no data PVCs in seed/ (all state is in ak-pg). Metadata-only; no
CNPG restart. ak-pg has 30 completed barman backups (last ~6.7h) as a backstop,
and a restore-test is running against it now (corrected #404 recipe) before the
stage 2 fold.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 11:12:44 +02:00
claude-botandClaude Fable 5 23654d8b4b fix(netbird): direct P2P for proxy→cluster and intra-cluster peers
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Every connection of the k8s netbird-ingress peers relays through the
single controller-VPS relay (verified 2026-07-25: 5/5 connected peers
Relayed, zero P2P) — which is why the 2026-07-24 Hetzner DC outage took
the public edge down even though the reverse-proxy cluster runs at a
different provider. Three structural blockers, two fixed here:

- netcup proxy members: run the reverse-proxy container on the host
  network instead of bridge+443:443. Behind the bridge the embedded
  client's WireGuard/ICE UDP sat on a random Docker-NAT66 port that the
  pods' egress policy could never match; on the host network its ICE
  host candidates are the un-NATed public addresses, reachable
  outbound-only from the pods (no hole punching). proxy-2 serves
  v4+v6, proxy-1 v6-only — pods have working egress on both families
  (verified). :443 binds as before; the hosts run no firewall
  (verified), so exposure is unchanged.
- netbird-ingress-egress CNP: allow pod-to-pod between the ingress
  peers (previously absent entirely — even same-cluster peers relayed
  via Hetzner) and any-port UDP-capable egress to the three proxy
  addresses (the embedded client's port is 51820 by default but not
  contractual).

The controller relay remains available as designed fallback. Merging
auto-triggers the deploy-netbird-proxy Woodpecker pipeline (serial: 1,
one member at a time) and Flux applies the CNP.

Verify after rollout: netbird status -d in a netbird-ingress pod should
show 'Connection type: P2P' for the proxy peers and the sibling ingress
peers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 11:11:30 +02:00
k.renner 3eda0a7130 Merge pull request 'refactor(immich): fold seed-immich into the immich KS (stage 2)' (#405) from immich-dedicated-fold into master
ci/woodpecker/cron/security-scan Pipeline was successful
ci/woodpecker/cron/update-all Pipeline failed
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#405
2026-07-25 09:08:28 +00:00
claude-botandClaude Opus 4.8 ab65898234 refactor(immich): fold seed-immich into the immich KS (stage 2)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Completes the immich seed->apps move (same single-transfer pattern as paperless
#400). Restore-test passed first (im-pg backup restorable: 33316 rows in asset).

- git mv seed/immich/{cluster,objectstore,scheduled-backup,barman-creds-
  externalsecret,hetzner-creds-externalsecret,pvcs}.yaml -> apps/immich/, add to
  apps/immich/kustomization.yaml.
- immich KS: drop 'dependsOn: seed-immich', add
  'dependsOn: infrastructure-cnpg-barman', add the CNPG Cluster healthCheckExprs.
- Delete clusters/homelab/seed-immich.yaml and the now-empty seed/immich/.
- e2e-test.sh: drop seed-immich, add immich to the app-KS readiness checks
  (immich was previously only covered via seed-immich).
- Fix the last stale seed/immich comment path in
  infrastructure/openbao/snapshot-pvc.yaml (seed/immich -> apps/immich).

Safe ownership transfer (nothing pruned): all 7 seed/immich objects carry
prune: disabled (5 CNPG from stage 1 #401, 2 PVCs pre-existing), so deleting
seed-immich skips them in GC and the immich KS adopts them in place. No CNPG
restart, no app restart.

Verified: kubectl kustomize apps/immich builds 17 objects incl. Cluster/im-pg,
exactly 7 prune-protected; bash -n e2e-test.sh OK; seed/immich fully removed.

Left intentionally: the hetzner-creds ExternalSecret still reads OpenBao key
seed/immich/... (vault path, not a repo path).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 10:45:46 +02:00
k.renner d5c7cea403 Merge pull request 'docs(recovery): fix CNPG restore-test drill for the plugin-based barman' (#404) from fix-recovery-md-cnpg-restore-test into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#404
2026-07-25 08:42:19 +00:00
k.renner 07d9f33174 Merge pull request 'feat(ci): select agent model from the live catalog, not hardcoded ids' (#395) from claude-bot/ci-dynamic-model-selection into master
Reviewed-on: k.renner/homelab#395
2026-07-25 08:41:39 +00:00
k.renner 983ade2d1a Merge pull request 'fix(netbird-ingress): restart peers stuck in NeedsLogin, alert on NotReady' (#403) from netbird-needslogin-probe into master
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: k.renner/homelab#403
2026-07-25 08:40:04 +00:00
claude-botandClaude Opus 4.8 6274dd66fb docs(recovery): fix CNPG restore-test drill for the plugin-based barman
ci/woodpecker/pr/pr-review Pipeline was successful
The restore-test drill in RECOVERY.md told you to omit spec.plugins from the
throwaway cluster ('NO spec.plugins / isWALArchiver here'). With the plugin-based
barman this homelab now uses (barmancloud.cnpg.io ObjectStore + the
barman-cloud.cloudnative-pg.io plugin), that is invalid: the instance manager
can't load the plugin it needs to replay WAL during restore and dies at startup
with 'Unknown plugin: barman-cloud.cloudnative-pg.io' — the cluster never becomes
healthy. A real cold-rebuild DR following this drill would have failed the same
way. Found + fixed by running the drill against im-pg on 2026-07-25 (restore
succeeded once the plugin was declared; 33316 rows in 'asset', 584 MB DB).

- Declare the barman plugin in spec.plugins with isWALArchiver: false — loaded so
  it can READ WAL for the restore, but never archives (stays read-only against
  the backup path). Update the intro prose to match.
- Verification: pg_stat_user_tables n_live_tup reads 0 right after a restore
  (stats not gathered), so that view is not a data check — add pg_database_size
  and note counting a real table instead.
- Teardown: the old 'reclaim the released PV afterwards' was too vague and leaks
  the Retain PV's RBD image (issue #262). Give the explicit recipe: capture the
  PV name, delete the cluster, then patch the released PV to Delete so the CSI
  reclaims the RBD image.

The in-place cold-rebuild section (which keeps the live cluster's existing
spec.plugins isWALArchiver: true) was already correct and is unchanged.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 09:11:51 +02:00
claude-botandClaude Opus 4.8 1992fabb12 fix(ci): make model-picker actually tool-less; gate tests on PRs
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Addresses the 14aa6415 review.

- pick-model.sh: the picker relied on `--allowedTools ""` to be tool-less, but an
  empirical check showed an empty allowlist does NOT block tools (the Write tool
  still ran) -- it is treated as "unset" and the default toolset stays live. Add
  `--permission-mode plan`, which IS verified to block Write while still producing
  the selection JSON. --allowedTools "" + the Read deny-list remain as additional
  layers. Corrected the comments in pick-model.sh and the picker settings.json
  that claimed the empty allowlist made it tool-less.
- .woodpecker/ci-scripts-test.yml: new pull_request-triggered pipeline (homelab
  only) that runs scripts/ci/test-model-selection.sh, so a PR weakening the
  injection gate fails checks immediately instead of only on the next scheduled
  e2e cron (closes the coverage-timing gap the review flagged).
- Pin a recorded real /v1/models response (scripts/ci/testdata/v1-models-sample.json)
  and assert fetch-models.sh maps it correctly (opus effort=true, haiku
  effort=false), documenting the verified response shape.

Deferred with rationale: hard-failing a pipeline when the degraded-schema warning
fires -- the warning already reaches the job log (curl/jq stderr is no longer
suppressed), and hard-failing on a benign API schema addition would break all
model selection; graceful degradation to name+date is the deliberate choice.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 09:08:39 +02:00
claude-botandClaude Fable 5 c59ad31db9 fix(netbird-ingress): restart peers stuck in NeedsLogin, alert on NotReady
ci/woodpecker/pr/pr-review Pipeline was successful
A 24-min WAN outage to netbird.renner.uno on 2026-07-24 exceeded the
10-min ephemeral-peer lifetime, so management deregistered all three
routing peers. The client treats 'peer is not registered' as
unrecoverable and parks in NeedsLogin; that fails readiness but not the
'--check live' liveness probe, so the pods sat Running-but-NotReady for
~20 h until they were deleted by hand.

- liveness probe now fails on the dead auth states (NeedsLogin /
  LoginFailed / SessionExpired) and only on those: a restart re-runs the
  entrypoint, which re-enrolls with NB_SETUP_KEY. Transient
  Disconnected/Connecting states still retry silently, so a management
  outage does not kill the working WireGuard data plane.
- new PrometheusRule: warning when the DaemonSet runs degraded >10m,
  critical when 0 peers are Ready >5m.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 09:06:01 +02:00
claude-botandClaude Opus 4.8 14aa641560 fix(ci): validate pr-review model pick against pre-triage catalog snapshot
ci/woodpecker/pr/pr-review Pipeline was successful
The pr-review triage agent runs with an unscoped Write tool and its cwd contains
./.pr-review (-> $D), so a prompt-injected diff could make it overwrite
./.pr-review/models.txt and then name a smuggled token as its `model`. Validation
re-read models.txt FROM DISK after the triage ran, so the catalog-membership
check was defeated by the agent's own writeback -- letting an attacker force a
weaker real model, or a syntactically-valid fake id that makes the review's
`claude --model <fake>` fail and silently suppress the review entirely.

Validate against $MODELS_TABLE -- the catalog captured in a shell variable BEFORE
the triage runs -- instead of re-reading the file the triage can overwrite. This
mirrors pick-model.sh, which already validates against its in-memory table before
its (tool-less) picker runs. The triage still reads models.txt for its own pick;
tampering only misleads that pick, which is then rejected against the pristine
snapshot -> CLI default (so the review still runs, it can't be suppressed).

Verified: a token present only in a tampered on-disk file but absent from the
pre-triage snapshot is now rejected (it was accepted before). Added a regression
test to scripts/ci/test-model-selection.sh, and fixed the header comment to note
the complex-review override as another path to the CLI default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 08:29:18 +02:00
k.renner 6f29ca56b6 Merge pull request 'chore(immich): pre-stage prune:disabled on the im-pg CNPG objects (stage 1)' (#401) from immich-prune-protect into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#401
2026-07-25 06:27:38 +00:00
claude-botandClaude Opus 4.8 44a429685c fix(ci): round-3 pr-review hardening — REVIEW_TOKEN, no-die selection, tests
ci/woodpecker/pr/pr-review Pipeline was successful
Addresses the a7890e0a review.

- pr-review.yml: strip REVIEW_TOKEN from the valid-model.sh call too (it runs a
  script from $HOMELAB, branch-supplied for a homelab PR), and guard it with
  `|| true` so a missing script can't kill the step -- restoring the stated "a
  run never dies on selection" invariant. For a complex/security-sensitive
  review, ignore the (injectable) triage pick and run on the CLI default
  (strongest configured) model.
- valid-model.sh: reject a leading dash at the shape check (making the header
  accurate) so an option-like value is refused even without a catalog.
- fetch-models.sh: --retry 2 --retry-connrefused so a transient blip doesn't
  drop the run to the default; add a FETCH_MODELS_BODY_FILE test seam.
- pick-model.sh: pass --settings (new ci/agents/model-picker/settings.json,
  Read deny-list) as belt-and-suspenders behind --allowedTools "".
- test-model-selection.sh: add fetch-models.sh mapping tests (well-formed body
  -> non-null capability columns; degraded body -> loud warning) via the seam,
  and wire the whole suite into .woodpecker/e2e.yml so it runs in CI.
- Condense the duplicated model-selection comment in the four fixed jobs to a
  one-line pointer to pick-model.sh.
- PR description: state the cost / no-fixed-ceiling property change.

Deferred with rationale (in the PR thread): selected-model in the four crons'
posted artifacts (already logged per run), pagination past limit=1000 (API max;
has_more warns), and unit-testing pick-model.sh's JSON extraction (its output
always passes through the tested valid-model.sh gate, and the picker prompt is
developer-controlled, not attacker input).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 07:43:08 +02:00
claude-botandClaude Opus 4.8 38370f9054 chore(immich): pre-stage prune:disabled on the im-pg CNPG objects (stage 1)
ci/woodpecker/pr/pr-review Pipeline was successful
Stage 1 of folding seed-immich into the existing dedicated immich KS (same
pattern as paperless #399/#400). Adds prune: disabled, in place, to the 5 CNPG
DB objects under seed/immich/ so the ownership handoff can never prune them:

- Cluster/im-pg (pruning deletes its data PVCs)
- ObjectStore/im-pg-store, ScheduledBackup/im-pg-daily
- ExternalSecret/barman-cloud-creds, ExternalSecret/hetzner-s3-creds

The immich-library (300Gi) + ml-cache PVCs already carry the annotation.
Metadata-only; no CNPG restart. im-pg has 30 completed barman backups (last
~2.5h) as a backstop.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 07:34:31 +02:00
security-bot 60ee1cade4 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784957186
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-25 05:33:14 +00:00
k.renner 90e4800304 Merge pull request 'refactor(paperless): fold seed-paperless into the paperless KS (stage 2)' (#400) from paperless-dedicated-fold into master
Reviewed-on: k.renner/homelab#400
2026-07-25 05:30:29 +00:00
claude-botandClaude Opus 4.8 a7890e0aa2 test(ci): extract + unit-test model validation; cut triage cost; doc nits
ci/woodpecker/pr/pr-review Pipeline was successful
Addresses the remaining pr-review items.

- Extract the untrusted-model validation out of the pipeline YAML into
  scripts/ci/valid-model.sh (single safe-token + catalog-membership gate) and
  reuse it from both pick-model.sh and pr-review.yml, so the security-critical
  logic lives in one tested place. Add scripts/ci/test-model-selection.sh, an
  offline fixture test (no network / claude / Woodpecker) that pins the
  behaviour: valid ids pass; hallucinated, empty, space-, newline-, leading-
  dash-, and metachar-injected values are rejected; empty catalog rejects all.
  This is the regression test for the flag-injection fix.
- pr-review triage cost: hand the triage the COMPLETE changed-file list
  (files.txt) plus a diff capped at 4000 lines (diff.triage.patch) instead of
  the full up-to-20k review diff, so classifying a PR on the default model stays
  cheap. stats.txt still carries the true totals; triage-prompt.md updated.
- Doc nits: note the new helpers are POSIX `sh` (not `bash` like the older
  scripts/ci/*.sh), and that fetch-models.sh's json mode is a debug affordance.

Deferred with rationale (also in the PR thread):
- Model id in the four cron jobs' posted artifacts: selection (including the
  fallback-to-default) is already logged per run in the CI output, the
  operational surface for this; threading it through four different posted
  formats is a separate observability follow-up.
- --settings sandbox on the picker: it is granted no tools (--allowedTools ""),
  so there is nothing for a Read-deny sandbox to constrain -- the other agents'
  sandboxes exist to scope tools they DO have.
- Pagination past limit=1000: that is the API's max page size; >1000 models is
  not a real scenario, and the has_more warning turns even that into a visible
  log line rather than silent truncation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 07:27:02 +02:00
claude-botandClaude Opus 4.8 8a63be8515 refactor(paperless): fold seed-paperless into the paperless KS (stage 2)
ci/woodpecker/pr/pr-review Pipeline was successful
Completes the paperless seed->apps move. Unlike woodpecker this is a single
ownership transfer into the app's existing dedicated KS.

- git mv seed/paperless/{cluster,objectstore,scheduled-backup,barman-creds-
  externalsecret,hetzner-creds-externalsecret,pvcs}.yaml -> apps/paperless/, and
  add them to apps/paperless/kustomization.yaml.
- paperless KS: drop 'dependsOn: seed-paperless', add
  'dependsOn: infrastructure-cnpg-barman', add the CNPG Cluster healthCheckExprs
  (moved off seed-paperless), refresh the stale 'seed phase' comment.
- Delete clusters/homelab/seed-paperless.yaml and the now-empty
  kubernetes/seed/paperless/.
- e2e-test.sh: drop the seed-paperless readiness check (the paperless app KS is
  already checked).
- Fix two stale file-path comments that pointed at the old location:
  apps/woodpecker/objectstore.yaml and infrastructure/openbao/snapshot-pvc.yaml
  (seed/paperless -> apps/paperless).

Safe ownership transfer (nothing pruned): all 9 seed/paperless objects carry
prune: disabled (5 CNPG objects from stage 1 #399, 4 PVCs pre-existing), so
deleting seed-paperless skips them in GC and the paperless KS adopts them in
place. No CNPG restart (Cluster is not a Deployment), no app restart.

Verified: kubectl kustomize apps/paperless builds 40 objects incl. Cluster/
pprl-pg, exactly 9 prune-protected; bash -n e2e-test.sh OK; seed/paperless fully
removed; no stale file-path refs remain (only the dated migration log + the
OpenBao KV path pending the separate hetzner-creds decoupling).

Left intentionally: the hetzner-creds ExternalSecret still reads OpenBao key
seed/paperless/hetzner-creds (a vault path, not a repo path).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 07:25:09 +02:00
k.renner c0635775e5 Merge pull request 'chore(paperless): pre-stage prune:disabled on the pprl-pg CNPG objects (stage 1)' (#399) from paperless-prune-protect into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#399
2026-07-25 05:20:37 +00:00
claude-botandClaude Opus 4.8 555c783774 chore(paperless): pre-stage prune:disabled on the pprl-pg CNPG objects (stage 1)
ci/woodpecker/pr/pr-review Pipeline was successful
Stage 1 of folding seed-paperless into the existing dedicated paperless KS.
Adds kustomize.toolkit.fluxcd.io/prune: disabled, in place, to the five CNPG DB
objects under seed/paperless/ so the ownership handoff can never prune them:

- Cluster/pprl-pg (HA, 2 instances — pruning deletes its data PVCs)
- ObjectStore/pprl-pg-store, ScheduledBackup/pprl-pg-daily
- ExternalSecret/barman-cloud-creds, ExternalSecret/hetzner-s3-creds

The 4 data/media/consume/redis PVCs already carry the annotation. Landing it via
the existing seed-paperless KS guarantees it's live before the move. Metadata-
only; no spec change, so CNPG and the running pprl-pg instances are untouched.

Unlike woodpecker this is a single ownership transfer (seed-paperless ->
paperless KS, both already dedicated), so no app-object commonAnnotations / CI
restart is involved. pprl-pg has healthy barman backups (last ~2.7h) as a
backstop.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 07:16:27 +02:00
claude-botandClaude Opus 4.8 f333dfd606 fix(ci): block flag injection via agent-supplied model id (pr-review)
ci/woodpecker/pr/pr-review Pipeline is running
The pr-review triage agent reads the attacker-controlled PR diff and writes
triage.json; its Write tool is not path-scoped, so a prompt-injected diff can
make it emit any `model` string. The catalog validation used
`grep -qxF -- "$MODEL"`, and grep -F treats a MULTI-LINE operand as
newline-separated patterns: a value like
"claude-sonnet-5\n--dangerously-skip-permissions" matches on its first line,
passes validation, and -- via the unquoted `${MODEL:+--model $MODEL}` expansion
-- word-splits into an extra argv entry, injecting a CLI flag into the review
agent's own `claude` invocation (defeating its --allowedTools allowlist and Read
sandbox, with CLAUDE_CODE_OAUTH_TOKEN in that process's env).

Removing map_model() (which returned one of three literal ids) is what opened
this; restore the invariant with a single-token guard before the expansion:
`case "$MODEL" in ""|*[!A-Za-z0-9._-]*) MODEL= ;; esac`. Verified it turns the
newline/space/hallucinated payloads into a plain `claude -p` (CLI default) while
still passing real ids. Mirrored the guard in pick-model.sh as defence in depth
(its grep -oE already keeps CHOICE single-line, so it was not exploitable).

Also from the review:
- pr-review.yml: correct the HOMELAB comment -- the fetch-models.sh call is
  env -u REVIEW_TOKEN'd, so CLAUDE_CODE_OAUTH_TOKEN (not REVIEW_TOKEN) is what
  branch-supplied shell there can see.
- pick-model.sh / triage-prompt.md: stop asking the picker to weigh "cost" the
  catalog does not expose; reason from the visible capability signals (context /
  max_output / effort|thinking|code_exec) as the scale proxy instead.
- fetch-models.sh: drop 2>/dev/null on curl so its -S error reaches the log.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 07:12:06 +02:00
k.renner 9819c83045 Merge pull request 'chore(woodpecker): drop the transitional commonAnnotations prune-guard (stage 3)' (#398) from woodpecker-drop-transient-prune-guard into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#398
2026-07-25 05:11:20 +00:00
claude-botandClaude Opus 4.8 80098afd8d chore(woodpecker): drop the transitional commonAnnotations prune-guard (stage 3)
ci/woodpecker/pr/pr-review Pipeline was successful
Final stage of the seed-woodpecker -> dedicated woodpecker KS move. The
commonAnnotations prune:disabled guard on apps/woodpecker/ has done its job: the
ownership handoff completed (verified — wp-pg + all app objects adopted by the
woodpecker KS, RESTARTS=0, nothing pruned), so the app objects no longer need
blanket prune protection and should be normally prunable by their owning KS again.

Removes only the commonAnnotations block. The 4 CNPG DB objects keep their
per-file prune: disabled (permanent data-guard on Cluster/wp-pg etc.) — verified
kubectl kustomize apps/woodpecker now annotates exactly those 4, not the 13 app
objects.

Rolls woodpecker-server + agent once more as the annotation leaves their pod
templates — the same accepted CI restart as stage 1.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 07:07:37 +02:00
k.renner 44134dc5d2 Merge pull request 'refactor(woodpecker): dedicated woodpecker KS, retire seed-woodpecker (stage 2)' (#396) from woodpecker-dedicated-ks into master
Reviewed-on: k.renner/homelab#396
2026-07-25 05:04:43 +00:00
claude-botandClaude Opus 4.8 9d36087857 fix(ci): second-round pr-review hardening for model selection
ci/woodpecker/pr/pr-review Pipeline was successful
- pick-model.sh: stop swallowing fetch-models.sh and claude stderr so the real
  cause of a fallback (no token / HTTP 401 / parse error / auth) reaches the job
  log instead of just "no catalog available"; time-bound the selection call with
  a self-probing `timeout` (the wrapper is skipped unless a probe confirms the
  image's timeout takes coreutils "SECS CMD" syntax, so it can never silently
  route every run to the default); strip PUSH_TOKEN and REVIEW_TOKEN as well --
  issue-fix binds its bot PAT a second time as PUSH_TOKEN, which survived the
  original `env -u GITEA_TOKEN`; `grep -qxF --`.
- fetch-models.sh: warn loudly when every model returns a null context window,
  so a /v1/models schema change surfaces as a message rather than silently
  reducing both selectors to name+date guessing.
- pr-review.yml: `env -u REVIEW_TOKEN` on the fetch-models.sh call (it needs only
  CLAUDE_CODE_OAUTH_TOKEN), matching the agent calls below it; `grep -qxF --`.

Deferred with rationale: hard-bounding the triage's diff input (kept as prompt
guidance -- a hard cap risks its security-sensitivity judgment) and an offline
fallback-path test harness (tracked as a follow-up).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 07:01:27 +02:00
claude-botandClaude Opus 4.8 b329c432c5 fix(ci): address pr-review feedback on dynamic model selection
ci/woodpecker/pr/pr-review Pipeline was successful
- fetch-models.sh: request ?limit=1000 so older/cheaper models are not dropped
  by the API's 20-item default page; warn on has_more. Add a --table mode so
  the catalog format lives in ONE place (pick-model.sh and pr-review.yml now
  consume it instead of each re-deriving the jq table). Clean up the HTTP-000
  double-print and surface jq parse errors instead of hiding them.
- pick-model.sh: run the picker with GITEA_TOKEN stripped from its env and
  without acceptEdits (it is granted no tools); consume fetch-models.sh --table.
- pr-review.yml: print model `CLI default` instead of an empty backtick pair on
  the fallback path; document that the fetch-models.sh call runs branch-supplied
  shell (not a new exposure -- Woodpecker already runs the pipeline YAML from
  the PR branch).
- triage-prompt.md: read stats + the changed-file list first and pull the full
  diff only when needed, so the triage (now on a capable default model) does not
  read a 20k-line diff just to classify a trivial PR.

Verified against the live catalog: all 11 currently-listed ids run under
`claude --model`, and the capability fields (context/effort/thinking/...) are
present in the OAuth /v1/models response -- so the reviewer's blocking concern
(a listed-but-CLI-unusable id) has no live trigger, and the fallback-to-default
path still covers it if that ever changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 06:34:38 +02:00
claude-botandClaude Opus 4.8 6900271f86 refactor(woodpecker): dedicated woodpecker KS, retire seed-woodpecker (stage 2)
ci/woodpecker/pr/pr-review Pipeline was successful
Restructures woodpecker into its own Flux Kustomization instead of splitting its
app across the catch-all apps KS and its DB across seed-woodpecker.

- Add clusters/homelab/woodpecker.yaml: dedicated KS over apps/woodpecker with
  the infrastructure-cnpg-barman dep + CNPG Cluster healthCheckExprs (moved off
  seed-woodpecker) so the CNPG concerns live here, not in the shared apps KS.
- Remove woodpecker/ from apps/kustomization.yaml (catch-all apps KS no longer
  owns the woodpecker app objects).
- git mv seed/woodpecker/{cluster,objectstore,scheduled-backup,
  hetzner-creds-externalsecret}.yaml + MIGRATION.md -> apps/woodpecker/, and add
  the four DB manifests to apps/woodpecker/kustomization.yaml.
- Delete clusters/homelab/seed-woodpecker.yaml and the now-empty
  kubernetes/seed/woodpecker/.
- bootstrap.sh: add a wait_kustomization woodpecker entry (it used to be covered
  by 'wait apps'); e2e-test.sh: add woodpecker to the KS readiness checks.

Safe dual ownership transfer (nothing pruned): every object carries prune:
disabled from stage 1 (#394) — the app objects via commonAnnotations, the DB
objects per-file — so when the apps KS drops woodpecker/ and seed-woodpecker is
deleted, both GC sweeps skip these live objects and the new woodpecker KS adopts
them in place. No CNPG restart (Cluster is not a Deployment); no app restart
(manifests unchanged, only the owning KS label flips).

Verified: kubectl kustomize apps/woodpecker builds 17 objects (13 app + 4 DB
incl. wp-pg Cluster), all prune-protected; bash -n bootstrap.sh + e2e-test.sh
OK; wp-pg is the sole CNPG cluster in apps ns and hetzner-s3-creds is used only
by wp-pg-store; seed/woodpecker fully removed.

Stage 3 will drop the transient commonAnnotations (one more accepted app roll).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 06:18:54 +02:00
claude-botandClaude Opus 4.8 ffe3be4b54 feat(ci): select agent model from the live catalog, not hardcoded ids
ci/woodpecker/pr/pr-review Pipeline was successful
The pr-review, update-audit, security-scan, alert-monitor and issue-fix
pipelines each pinned a dated model id (--model claude-sonnet-5, plus
pr-review's haiku/sonnet/opus map_model allowlist). Those go stale every
time a new model ships and bake in assumptions about which model families
exist, so a newly released model could never be chosen without a code edit.

Replace all of it with selection driven only by what is available right now:

- scripts/ci/fetch-models.sh queries the catalog the CLI itself uses
  (Anthropic GET /v1/models, via the existing CLAUDE_CODE_OAUTH_TOKEN and the
  required anthropic-beta: oauth-2025-04-20 header) and emits each model with
  its objective capability signals -- context, max_output, effort, thinking,
  code_exec, release date -- with no id patterns and no family names.
- scripts/ci/pick-model.sh lets a triage agent choose the best-fit id from
  that catalog for a one-line task description, weighing every listed model
  on its merits. pr-review's existing per-PR triage agent now does the same,
  reading the live catalog instead of emitting a fixed haiku/sonnet/opus tier.

No model id -- and no model family -- is baked into any pipeline. A model
released tomorrow, of any family, becomes eligible the day the API lists it.
The bootstrap selection call runs on the CLI default model, and if the catalog
is ever unreachable --model is simply omitted (CLI default) rather than falling
back to a named model, so a run never dies over model selection.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 06:14:45 +02:00
k.renner 5d3f94fd8b Merge pull request 'chore(woodpecker): pre-stage prune:disabled on the wp-pg CNPG objects (stage 1)' (#394) from woodpecker-prune-protect into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#394
2026-07-25 04:12:21 +00:00
claude-botandClaude Opus 4.8 27d338f9be chore(woodpecker): also prune-guard the app objects via commonAnnotations
ci/woodpecker/pr/pr-review Pipeline was successful
Folds the app-object protection into stage 1 now that a woodpecker CI restart is
acceptable. commonAnnotations adds kustomize.toolkit.fluxcd.io/prune: disabled to
every object under apps/woodpecker/ (the woodpecker-ci Namespace, server/agent
Deployments, Service, Ingress, PDB, NetworkPolicy, ResourceQuota/LimitRange,
RBAC, ExternalSecret), so when 'woodpecker/' is later removed from
apps/kustomization.yaml the catch-all apps KS can't prune them mid-handoff.

Trade-off accepted: kustomize propagates commonAnnotations into the two
Deployments' pod templates, so this rolls woodpecker-server + agent once on
apply (and once more when removed in the final stage). Confirmed harmless — the
DB (wp-pg) is a separate CNPG resource, untouched.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 05:59:37 +02:00
claude-botandClaude Opus 4.8 a7b4e2b996 chore(woodpecker): pre-stage prune:disabled on the wp-pg CNPG objects
ci/woodpecker/pr/pr-review Pipeline is pending
Stage 1 of moving woodpecker off seed-woodpecker into a dedicated woodpecker KS.
Adds kustomize.toolkit.fluxcd.io/prune: disabled, in place, to the four
data-bearing DB objects in seed/woodpecker/ so the later ownership handoff can
never prune them:

- Cluster/wp-pg           (pruning deletes the DB's data PVCs)
- ObjectStore/wp-pg-store (barman backup target)
- ScheduledBackup/wp-pg-daily
- ExternalSecret/hetzner-s3-creds (barman S3 creds)

Landing the annotation via the existing seed-woodpecker KS guarantees it is live
on the objects before any move. Metadata-only; no spec change, so CNPG/the
running wp-pg pod are untouched. The Cluster keeps the annotation permanently as
a data-guard; the others are incidental to the same handoff.

The woodpecker *app* objects (server/agent/Namespace/etc., currently under the
catch-all apps KS) are protected separately in the next stage — they need
per-object top-level annotations rather than commonAnnotations, which would
propagate into the Deployments' pod templates and needlessly restart live CI.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 05:55:36 +02:00
security-bot 0802b42146 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784949660
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-25 03:33:14 +00:00
k.renner 7430b8ea90 Merge pull request 'refactor(influxdb): move seed-influxdb to apps/influxdb (step 2/2)' (#390) from move-influxdb-step2 into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#390
2026-07-25 03:16:31 +00:00
k.renner 9a4e8b0a1d Merge pull request 'fix(shelly-manager): set ShellyManager__DnsSuffix=iot.renner.uno' (#391) from fix/389-shelly-manager-dnssuffix into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#391
2026-07-25 03:11:51 +00:00
security-bot cd5cd05741 chore(image-automation): bump redis:8.8.1-alpine
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-24 18:27:08 +00:00
claude-botandClaude Opus 4.8 ffc3b2d468 docs(influxdb): purge remaining stale seed-Job references in helmrelease/ha-token-job
ci/woodpecker/pr/pr-review Pipeline was successful
Addresses the follow-up review on #390: three more comments still described the
removed influxdb-seed Job, some in the present tense (contradicting the note the
prior commit added).

- helmrelease.yaml adminUser comment: drop the 'sibling influxdb-seed Job reads
  the secret / deletes the bucket' description; state the admin token comes from
  the influxdb-bootstrap Secret (OpenBao via ESO).
- helmrelease.yaml resource/timeout rationale: reword 'after a partial seed' and
  'batches from the seed Job' to the seed-independent conditions (large dataset /
  large write batches) that still justify the 6Gi limit + 60s write timeout.
- ha-token-job.yaml: drop 'Same wait pattern as the seed Job's wait-for-influxd';
  describe the two-stage wait directly.

Verified: kubectl kustomize apps/influxdb builds; the only remaining 'seed'
strings are accurate migration-rationale comments and the OpenBao KV path.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 15:06:31 +02:00
security-bot 153ae5d219 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784897722
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-24 13:03:13 +00:00
claude-botandClaude Fable 5 4956f47354 fix(shelly-manager): set ShellyManager__DnsSuffix=iot.renner.uno
ci/woodpecker/pr/pr-review Pipeline was successful
Without the suffix the app resolves devices only via its 2-minute mDNS
cache; the authoritative-DNS leg of MdnsConnectCallback is disabled and
the presence sweep falsely marks online always-on devices missing
(5 devices confirmed online but flagged, 2026-07-24).

Fixes #389

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 15:01:25 +02:00
claude-botandClaude Opus 4.8 9f49b705ed docs(influxdb): note why the cnpg-barman dep was dropped
ci/woodpecker/pr/pr-review Pipeline was successful
Addresses the doc-only suggestion on #390: explain in the new influxdb KS that
dropping seed-influxdb's infrastructure-cnpg-barman dependency is intentional
(copy-paste boilerplate; InfluxDB has no CNPG cluster, only a ceph-block PVC).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 15:00:37 +02:00
claude-botandClaude Opus 4.8 2c8a91162c refactor(influxdb): move seed-influxdb to apps/influxdb (step 2/2)
ci/woodpecker/pr/pr-review Pipeline was successful
Step 2 of the InfluxDB seed->apps handoff. #388 already landed
prune: disabled on the live HelmRelease/HelmRepository/ExternalSecret, so
retiring seed-influxdb here cannot trigger a helm uninstall — GC skips the
annotated objects and the new influxdb KS adopts them in place.

- git mv kubernetes/seed/influxdb/ -> kubernetes/apps/influxdb/ (annotations
  from #388 travel with the files).
- Add kubernetes/clusters/homelab/influxdb.yaml (KS 'influxdb', path
  apps/influxdb, deps infrastructure/crds/ceph). Delete seed-influxdb.yaml.

Review fixes from the closed atomic PR (#387):
- bootstrap.sh: wait on 'influxdb' instead of the deleted 'seed-influxdb'
  (would otherwise spin the full 600s timeout on cold bootstrap).
- e2e-test.sh: swap the seed-influxdb readiness check for 'influxdb'.
- Fix stale comment paths kubernetes/seed/influxdb/... -> apps/influxdb/... in
  network-policies/home-assistant-ns.yaml and apps/monitoring/
  helmrelease-prometheus.yaml.
- Trim the helmrelease.yaml comment that described the removed seed-job.yaml,
  and the ha-token-job.yaml 'at cutover moves to apps/influxdb' note (this is
  that cutover).

Left intentionally: externalsecret.yaml key 'seed/influxdb/bootstrap' is an
OpenBao KV path, not a repo path — moving it needs a vault-side secret
migration, out of scope here.

Verified: kubectl kustomize apps/influxdb builds all objects with the right
prune/force annotations; bash -n passes on bootstrap.sh + e2e-test.sh; no
remaining seed-influxdb references in the repo (only the OpenBao KV path).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 14:56:11 +02:00
k.renner 37920ff0be Merge pull request 'chore(influxdb): pre-stage prune:disabled on live seed-influxdb objects (step 1/2)' (#388) from annotate-influxdb-prune-disabled into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#388
2026-07-24 12:51:08 +00:00
claude-botandClaude Opus 4.8 ed17ac78d9 chore(influxdb): pre-stage prune:disabled on live seed-influxdb objects
ci/woodpecker/pr/pr-review Pipeline was successful
Step 1 of a two-step seed->apps handoff for InfluxDB (the move itself follows
in a separate PR). Adds kustomize.toolkit.fluxcd.io/prune: disabled to the
HelmRelease, HelmRepository, and ExternalSecret *in place* under
kubernetes/seed/influxdb/, with no move and no KS changes.

Why split: doing the annotate + move + delete-old-KS in one commit races the
new KS's first reconcile (which stamps the annotation onto the live objects)
against the old KS's deletion-GC. If GC wins, it prunes the un-annotated
HelmRelease -> helm uninstall -> the running InfluxDB StatefulSet is torn down.
Landing the annotation via the existing seed-influxdb KS first guarantees it is
live on the objects before any prune can run, per Flux's documented pattern.

No behavioural change: only a kustomize metadata annotation is added, so
helm-controller performs no upgrade and the server is untouched. After merge,
verify the annotation is live on all three objects, then land the move PR.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 14:05:01 +02:00
k.renner 7f48bfd68e Merge pull request 'refactor(audiobookshelf): fold seed KS into the app KS' (#386) from move-audiobookshelf-to-apps into master
ci/woodpecker/cron/e2e Pipeline was successful
ci/woodpecker/cron/security-scan Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#386
2026-07-24 11:47:57 +00:00
claude-botandClaude Opus 4.8 978cc704a0 refactor(audiobookshelf): fold seed KS into the app KS
ci/woodpecker/pr/pr-review Pipeline was successful
Second step of dissolving the transitional 'seed' layer (after
music-assistant). Move the audiobookshelf config/metadata/books PVCs from
seed-audiobookshelf into the app's own Kustomization and retire the seed KS.

- git mv kubernetes/seed/audiobookshelf/pvcs.yaml -> kubernetes/apps/audiobookshelf/
  and add it to the app kustomization.
- Drop 'dependsOn: seed-audiobookshelf' from the audiobookshelf KS (it now owns
  the 3 PVCs directly; ceph dep already present, no CNPG involved).
- Delete kubernetes/clusters/homelab/seed-audiobookshelf.yaml and the now-empty
  kubernetes/seed/audiobookshelf/.
- Remove seed-audiobookshelf from the e2e-test.sh Kustomization readiness checks
  (it no longer exists post-merge) — same fix the review flagged on the
  music-assistant PR, done proactively here.

Safe ownership transfer: all 3 PVCs carry kustomize.toolkit.fluxcd.io/prune:
disabled, so Flux GC skips them when seed-audiobookshelf is pruned; the
audiobookshelf KS adopts them on reconcile. Verified: PVCs Bound + prune-disabled
live; kubectl kustomize apps/audiobookshelf builds all 3.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 13:43:36 +02:00
k.renner 80666a8323 Merge pull request 'refactor(music-assistant): fold seed KS into the app KS (seed->apps pilot)' (#385) from move-music-assistant-to-apps into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#385
2026-07-24 11:40:27 +00:00
claude-botandClaude Opus 4.8 9b3cb98bc6 fix(e2e): drop retired seed-music-assistant from Kustomization checks
ci/woodpecker/pr/pr-review Pipeline was successful
Addresses review on #385.

Blocking: e2e-test.sh asserted kustomization/seed-music-assistant Ready, but
this PR deletes that KS — the test would fail post-merge with 'not found'.
Remove it from the checked list (line 110).

Also add a clarifying note in MIGRATION-sops-openbao.md that
seed-music-assistant has since been retired (the 2026-07-14 log line is left
factually intact as a historical record).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 13:26:12 +02:00
claude-botandClaude Opus 4.8 efa5d6833c refactor(music-assistant): fold seed KS into the app KS
ci/woodpecker/pr/pr-review Pipeline was successful
First step of dissolving the transitional 'seed' layer: move the
music-assistant-data PVC from seed-music-assistant into the app's own
Kustomization and retire the seed KS.

- git mv kubernetes/seed/music-assistant/pvcs.yaml -> kubernetes/apps/music-assistant/
  and add it to the app kustomization.
- Drop 'dependsOn: seed-music-assistant' from the music-assistant KS (it now
  owns the PVC directly; ceph dep already present, no CNPG involved).
- Delete kubernetes/clusters/homelab/seed-music-assistant.yaml and the now-empty
  kubernetes/seed/music-assistant/.

Safe ownership transfer: the PVC already carries
kustomize.toolkit.fluxcd.io/prune: disabled, so Flux GC skips it even when the
seed-music-assistant KS is pruned — the object is never torn down, and the
music-assistant KS adopts it on next reconcile. Verified: PVC is Bound and
prune-disabled live; kubectl kustomize apps/music-assistant builds with the PVC.

Pilot for the per-app seed->apps relocation; remaining apps (audiobookshelf,
influxdb, woodpecker, paperless, immich, authentik) follow the same pattern.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 13:20:14 +02:00
k.renner 5313806a44 Merge pull request 'chore(flux): retire deprecated monolithic seed Kustomization' (#384) from retire-seed-monolith into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#384
2026-07-24 11:19:53 +00:00
claude-botandClaude Opus 4.8 e606a15d96 chore(flux): retire deprecated monolithic seed Kustomization
ci/woodpecker/pr/pr-review Pipeline was successful
The monolithic `Kustomization/seed` was split into per-app `seed-<app>`
KSes; it was left suspended + prune-disabled only so its inventory could
be pruned by a follow-up commit. That inventory is now empty (ownership
fully migrated to the per-app KSes), so the object owns nothing and can
be removed cleanly — flux-system (prune: true) will garbage-collect the
now-absent Kustomization/seed, and its own prune: false + empty inventory
means zero live resources are torn down.

Also drop kubernetes/seed/kustomization.yaml, the aggregator that only the
monolith referenced (path ./kubernetes/seed); it was already stale (missing
woodpecker). The per-app KSes target ./kubernetes/seed/<app> subdirs and are
unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 11:52:21 +02:00
k.renner f933ae5a6e Merge pull request 'fix(gitea): retire deprecated [server] LFS_CONTENT_PATH; disable query auth tokens' (#383) from gitea-lfs-deprecation into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#383
2026-07-24 08:41:15 +00:00
claude-botandClaude Opus 4.8 d09688bac9 fix(gitea): retire deprecated [server] LFS_CONTENT_PATH; disable query auth tokens
ci/woodpecker/pr/pr-review Pipeline was successful
Gitea 1.21.4 logs a deprecation warning for [server] LFS_CONTENT_PATH
(superseded by [lfs] PATH) and recommends DISABLE_QUERY_AUTH_TOKEN
(default from 1.23). Both surface as startup notices on the admin
dashboard.

Add the replacements as GITEA__ env overrides so they are tracked in
git. environment-to-ini can only add keys, so the stale
[server] LFS_CONTENT_PATH was also removed from the on-PVC app.ini by
hand (same path value -> existing data/lfs objects untouched).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 10:36:59 +02:00
security-bot f50e0e06f4 chore(image-automation): bump ghcr.io/home-assistant/home-assistant:2026.7.4
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-24 08:27:10 +00:00
security-bot 60985c79e2 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784879999
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-24 08:03:12 +00:00
security-bot 9bd4c23af9 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784872746
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-24 06:26:12 +00:00
k.renner 6b905c6b37 Merge pull request 'chore(ci): bump ci-claude image to 2.1.218' (#382) from ci-image/claude-2.1.218 into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#382
2026-07-24 04:40:07 +00:00
security-bot 5a96a46ea4 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784866857
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-24 04:26:12 +00:00
claude-bot d4f91779a1 chore(ci): bump ci-claude image to 2.1.218
ci/woodpecker/pr/pr-review Pipeline was successful
2026-07-24 04:25:34 +00:00
k.renner 0810d4464d Merge pull request 'chore(ci): make ci-claude reproducible and keep it on latest (#351)' (#378) from claude-bot/ci-claude-reproducible into master
ci/woodpecker/push/ci-claude-refresh Pipeline was successful
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: k.renner/homelab#378
2026-07-24 04:24:50 +00:00
security-bot 46a63eaee7 chore(image-automation): bump netbirdio/netbird:v0.75.0-rootless
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-23 17:26:53 +00:00
claude-botandClaude Opus 4.8 f414f6e7bb fix(ci): only build/push ci-claude from master, never a PR branch
ci/woodpecker/pr/pr-review Pipeline was successful
The push trigger matched any branch, so pushing this feature branch ran the
refresh pipeline from the branch: it built and pushed ci-claude:2.1.218 and
opened a bump PR (#379) prematurely. Restrict the push event to branch: master
so only master ever builds/pushes images or opens bump PRs; cron and manual
are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 17:19:17 +02:00
claude-botandClaude Opus 4.8 16eecf07e8 chore(ci): provision ci-claude bump token; use claude-bot identity
ci/woodpecker/push/ci-claude-refresh Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was canceled
The bump credential is a claude-bot PAT scoped write:repository only (a
dedicated Gitea user needs admin to create, which claude-bot lacks; the
scoped-down PAT is the same least-privilege at the token level). Token minted
and stored as the ci_claude_bump_bot_token Woodpecker secret (events:
push/cron/manual). Commit author set to claude-bot accordingly. Only the cron
registration remains, to be done after this merges to master.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 17:12:47 +02:00
claude-botandClaude Opus 4.8 a675bf6cf0 chore(ci): make ci-claude reproducible and keep it on latest (#351)
ci/woodpecker/pr/pr-review Pipeline was successful
The ci-claude image installed a fixed, pinned Claude Code version and every
consumer pipeline pinned a stale dated image tag. Two problems:

- The npm install layer changed on every build (install-time mtimes + the
  npm cache), so it never deduped in the Gitea registry — the single largest
  orphan pattern behind #336 (~260 MB orphaned per no-op rebuild).
- A frozen version silently rots: old Claude Code releases eventually stop
  working against the API.

Containerfile: default to @latest (npm auto-selects the musl native binary on
this alpine base) and make the install layer byte-stable — clean the npm cache
and normalize install-time mtimes on the installed tree and the directories the
RUN touches. Two independent --no-cache builds now produce a byte-identical npm
layer, so a rebuild of the same version dedups instead of orphaning a copy.

New ci-claude-refresh.yml owns the image lifecycle: weekly (and on-demand) it
resolves the latest published version, and only when it differs from what the
consumers pin does it build ci-claude:<version> (+:latest) and open a PR
rewiring the 5 consumer pipelines. Version tags make "did it change?" a
race-free string compare and keep the cron from opening no-op PRs. Nothing
auto-merges. build-ci-images.yml no longer builds ci-claude so the two never
fight over tags.

Requires owner setup before it does anything (documented in the pipeline
header): a dedicated ci-claude-bump-bot identity (write:repository only) as the
ci_claude_bump_bot_token secret, and a cron named "ci-claude-refresh".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 16:58:36 +02:00
k.renner 2c5e54865a Merge pull request 'Stable predictable interface names (net.ifnames=1) — fixes the v30iot NIC shuffle' (#375) from claude-bot/talos-predictable-naming into master
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#375
2026-07-23 14:29:32 +00:00
security-bot f65f52f160 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784816363
Updates managed by image-automation-controller.
2026-07-23 14:26:48 +00:00
claude-botandClaude Fable 5 3939fe51f6 fix(ci): ash-portable schematic substring; actually finish the eth1 sweep
ci/woodpecker/pr/pr-review Pipeline was successful
Review blocker: my previous filename fix used bash substring syntax
${TALOS_SCHEMATIC:0:12}, but the apply step runs under busybox ash
(Alpine /bin/sh) which errors 'Bad substitution' — the repo already uses
cut for this exact reason. Replaced with $(echo "$TALOS_SCHEMATIC" |
cut -c1-12). The HCL substr() in talos_image.tf is unaffected (not shell).

Also finishes the comment sweep the prior commit claimed but didn't: 4
more stale 'eth1' host-NIC references in the matter/otbr/music-assistant
NAD headers are now ens19. Grep confirms zero eth1 left in the v30iot
NAD/deployment files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 16:21:37 +02:00
k.renner 40a20cb3bd Merge pull request 'fix(ci): strip REVIEW_TOKEN from the review agents' environment' (#377) from claude-bot/pr-review-strip-review-token into master
Reviewed-on: k.renner/homelab#377
2026-07-23 14:18:51 +00:00
claude-botandClaude Opus 4.8 a4836879a9 fix(ci): strip REVIEW_TOKEN from the review agents' environment
ci/woodpecker/pr/pr-review Pipeline was successful
The step exports REVIEW_TOKEN (write:repository PAT) for its own curl/gitea_post
calls, but that also placed it in the environment of the claude triage+review
agents, which process attacker-controlled PR content — a prompt-injected diff
could read /proc/self/environ and exfiltrate it into the public report. The
agents never call Gitea (the shell does, via $AUTH), so run them under
'env -u REVIEW_TOKEN'. Defence in depth alongside the settings.json /proc deny.
Caught by the review bot; matches the fix applied to the other fleet repos.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 16:12:27 +02:00
claude-botandClaude Fable 5 b762cc7941 docs(nad): finish the eth1->ens19 comment sweep in the NAD headers
ci/woodpecker/pr/pr-review Pipeline was successful
Review follow-up (optional): the shelly/matter/otbr NAD header comments
still described the old eth1 probe-order naming, contradicting this PR's
own root-cause writeup. Updated to the stable ens19 predictable name and
dropped the stale k8s-edge/probe-order narration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 16:12:23 +02:00
claude-botandClaude Fable 5 7eb2e02b1d fix(ci): key Talos image cache on schematic; reconcile stale comments
ci/woodpecker/pr/pr-review Pipeline was successful
Review blocker: the Proxmox image-exists check derived TALOS_FILENAME
from version only, so bumping the schematic left the cached filename
unchanged — a future VM (re)provision would find the stale old-schematic
image and skip the download, silently reintroducing net.ifnames=0. Embed
the schematic hash in the filename (pipeline + opentofu/talos_image.tf,
kept in sync) so a schematic bump forces a fresh download.

Also reconciles stale comments the rename left behind: the MA reconcile
docstring (hostNetwork-era eth1 explanation), cluster.yaml kubelet nodeIP
(eth1->ens19), and the matter NAD's k8s-edge claim (edge isn't migrated
and isn't a current node; the pod is pinned off it anyway).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 15:59:18 +02:00
k.renner 285b52eb55 Merge pull request 'feat(secret-rotator): pin image, reconcile path, unsuspend the two rotators' (#373) from claude-bot/rotator-pin-unsuspend into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#373
2026-07-23 13:54:10 +00:00
claude-botandClaude Fable 5 4ee087ec5b fix(talos): stable predictable interface names (net.ifnames=1) for v30iot
ci/woodpecker/pr/pr-review Pipeline was successful
Root cause of the IoT NIC name shuffle: the nocloud platform driver
unconditionally injects net.ifnames=0, disabling systemd predictable
naming, so eth0/1/2 followed driver-probe order and renamed across
reboots (a k8s-3 reboot put the v30iot NIC on eth2 and mgmt on eth1,
silently mis-targeting the v6-disable sysctl onto mgmt and attaching
macvlan children to the Server VLAN). LinkAliasConfig cannot fix this
(it only sets a cosmetic IFLA_IFALIAS, invisible to sysctl/CNI).

Fix: re-enable predictable naming via a new Image Factory schematic
(extraKernelArgs: -net.ifnames=0, net.ifnames=1). Because the cluster
boots sd-boot/UKI, the cmdline is baked into the image — machine.install
extraKernelArgs is silently ignored — so this MUST be delivered as a
schematic + talosctl upgrade, not a config patch. The busPath-derived
names are topology-stable and identical across the three identical VMs:
  0000:06:13.0 (v30iot) -> ens19
  0000:06:12.0 (mgmt)   -> ens18
  0000:02:00.0 (ceph)   -> enp2s0np1

Re-keys everything that referenced the volatile eth1 onto the stable
ens19: the four v30iot macvlan NADs (matter/otbr/shelly/music-assistant)
and the per-node v6-disable sysctl. Bumps the schematic id in the deploy
pipeline. Applied live via rolling talosctl upgrade (one node at a time,
full Ceph recovery between each); verified ens19 identical on all three,
v30iot NIC addressless v4+v6, macvlan children retain their own v6.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 15:47:42 +02:00
claude-botandClaude Opus 4.8 0b4ccd66f8 fix(secret-rotator): restore spec: key in claude-oauth CronJob
ci/woodpecker/pr/pr-review Pipeline was successful
The earlier edit that removed the stale suspend-comment block also dropped the
'spec:' line, leaving suspend/schedule/jobTemplate nested under metadata: — an
invalid CronJob that would be rejected by the API server (kustomize build does
not validate against the k8s schema, so it passed). Re-add spec: and sync the
top-of-file doc comment to the reconciled infrastructure/claude#setup-token
path. Caught by the review bot on this PR; verified with kubectl --dry-run=server.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 15:25:50 +02:00
k.renner 211f1314ba Merge pull request 'Expose Zigbee2MQTT frontend via Authentik gate (zigbee2mqtt.home.renner.uno)' (#374) from claude-bot/zigbee2mqtt-ingress into master
ci/woodpecker/manual/alert-monitor Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#374
2026-07-23 13:08:45 +00:00
claude-botandClaude Opus 4.8 de402ba531 Expose Zigbee2MQTT frontend via Authentik gate
ci/woodpecker/pr/pr-review Pipeline was successful
Gate zigbee2mqtt.home.renner.uno behind the same passkey-step-up Authentik
proxy-outpost pattern used for esphome/shelly-manager/vscode. The Z2M frontend
has no auth of its own (anyone on :8080 controls the whole Zigbee network), so
Traefik only ever routes the hostname to a dedicated outpost that validates the
session before forwarding.

New:
  - apps/home-assistant/zigbee2mqtt-gate-service.yaml — ExternalName mirror to
    ak-outpost-zigbee2mqtt-gate in the authentik ns (:9000).
  - apps/home-assistant/zigbee2mqtt-ingress.yaml — zigbee2mqtt.home.renner.uno →
    the outpost; cert-manager ingress-shim issues zigbee2mqtt-tls.
  - apps/authentik/zigbee2mqtt-gate-egress.yaml — CNP letting the outpost egress
    to the zigbee2mqtt pod on :8080.

Edited:
  - apps/authentik/blueprints-configmap.yaml — 5-entry blueprint block (group /
    proxyprovider / application / policybinding / outpost) named zigbee2mqtt-gate;
    internal_host carries the explicit :8080 (Service listens on 8080, unlike
    esphome's :80). Authentik spawns the ak-outpost-zigbee2mqtt-gate Deployment
    +Service from the outpost entry.
  - infrastructure/network-policies/home-assistant-ns.yaml — fromEndpoints rule
    admitting the zigbee2mqtt-gate outpost to :8080 (shared 8080 with vscode/
    shelly-manager; the fromEndpoints selector + the authentik-side egress scope
    it to the zigbee2mqtt pod).
  - the two kustomizations registering the new files.

DNS (k8s-gateway watches Ingress) and TLS (cert-manager) are automatic. Access
limited to the "Zigbee2MQTT Managers" group (k.renner). Verified: kustomize
builds, dry-run OK, blueprint YAML parses with the new block.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 15:03:37 +02:00
claude-botandClaude Opus 4.8 a9e1dfc85a feat(secret-rotator): activate review-bot + claude-oauth rotators
ci/woodpecker/pr/pr-review Pipeline was successful
Pin both CronJobs to the built secret-rotator image that carries woodpecker-secret
mode (sha256:828bf486…), flip suspend:false, and reconcile the claude-oauth
BAO path to homelab/infrastructure/claude#setup-token (where the OAuth value is
actually seeded) — with the matching policy update (applied out-of-band).

Bootstraps + policies/roles are already applied and the org secrets are live, so
the rotators now maintain them on schedule: review-bot mints+syncs review_bot_token
quarterly; claude-oauth syncs claude_code_oauth_token daily.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 15:00:35 +02:00
k.renner e2045eeb0b Merge pull request 'Z2M: adopt coordinator via explicit network params (final cutover fix)' (#371) from claude-bot/zha-to-zigbee2mqtt into master
ci/woodpecker/cron/e2e Pipeline is running
ci/woodpecker/cron/security-scan Pipeline is running
ci/woodpecker/manual/alert-monitor Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#371
2026-07-23 11:53:14 +00:00
claude-botandClaude Opus 4.8 796d9688da Z2M: adopt coordinator via explicit network params (not backup restore)
The coordinator_backup.json approach did NOT make herdsman adopt the existing
network. herdsman's zstack manager compares the CONFIG network params against
the adapter's NV and refuses on mismatch; a backup only prevents accidental
re-commissioning, it does not supply the network to an already-commissioned
adapter. So Z2M sat on defaults (PAN 0x1a62 / channel 11) vs the real network
(PAN 0x8b2b / channel 25) and correctly refused — no re-pair, no damage.

Set the real network params explicitly (values are the adapter's own, read from
herdsman's own mismatch log, cross-checked against the OpenBao backup which
matches exactly: key fe0b..2d, pan 8b2b, ext fc7a735d08c15476, ch 25):

  advanced:
    channel: 25
    pan_id: 0x8B2B
    ext_pan_id: [0xfc,0x7a,0x73,0x5d,0x08,0xc1,0x54,0x76]   # natural order
    network_key: "!secret network_key"

Byte order pinned against zigbee-herdsman v10.6.1 source (determineStrategy):
ext_pan_id is reversed only when WRITING to NV, but compared/logged
non-reversed, and the network key is never reversed — so both go in natural
order matching the displayed adapter hex.

network_key stays secret: the init container extracts it from the OpenBao
coordinator backup (jq + sed -> natural-order int array) into
/app/data/secret.yaml, referenced by the config as a quoted "!secret" ref.
channel/pan_id/ext_pan_id are non-secret and live in the ConfigMap.

Verified: kustomize builds, deployment dry-run OK, extraction produces the
correct 16-byte array, config schema types valid. The final config<->adapter
match is confirmed at startup, where the coordinator_backup.json guarantees a
safe refusal (never a re-commission) if anything is still off.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 13:46:04 +02:00
k.renner 44c0abd484 Merge pull request 'Remove k8s node host addressing on the IoT VLAN (security + hairpin fix)' (#369) from claude-bot/iot-nic-unaddress into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#369
2026-07-23 11:42:09 +00:00
security-bot a3a3b9e6b7 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784804902
ci/woodpecker/cron/issue-fix Pipeline was successful
Updates managed by image-automation-controller.
2026-07-23 11:32:53 +00:00
claude-botandClaude Fable 5 5a9693bdd8 fix(music-assistant): macvlan child on v30iot instead of hostNetwork
ci/woodpecker/pr/pr-review Pipeline was successful
Unblocks the node-unaddressing change: MA ran hostNetwork and its
reconcile initContainer fails closed if no 10.2.30.0/24 address exists
on a host interface — removing node host addressing would crash-loop it
on every node it can schedule to (no edge toleration).

MA now attaches net1 via macvlan on v30iot (DHCP-leased), exactly like
matter-server/otbr/shelly-manager: its own IoT address, direct L2
adjacency for Snapcast/SlimProto/Sendspin audio sync (macvlan bridge
mode puts frames straight on the wire — same property hostNetwork gave,
without the node holding an IoT address). The reconcile script is
unchanged in logic: it scans the pod's interfaces for the 10.2.30.0/24
address and now finds net1 (Multus attaches it with its lease before any
container runs) instead of the host eth1. bind_ip stays 0.0.0.0 -> binds
eth0 + net1; publish_ip = net1's leased IP. NAD omits matter's Thread
accept_ra tuning (MA has no Thread); keeps sbr (leased default gateway
would otherwise blackhole cluster-internal replies).

Folded into this PR so the change is atomic: on merge Flux migrates MA
to its own IoT lease before the manual node-unaddressing rollout removes
the host addresses.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 13:31:50 +02:00
k.renner 8ebd870459 Merge pull request 'Z2M: quote the !secret ref (fixes 'unknown scalar tag', Z2M won't start)' (#370) from claude-bot/zha-to-zigbee2mqtt into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#370
2026-07-23 11:28:21 +00:00
claude-botandClaude Opus 4.8 8a7557eb3c Z2M: quote the !secret ref (fixes "unknown scalar tag")
Root cause of Z2M refusing to start, verified against Z2M's own validator: the
MQTT password was written as a bare YAML tag `password: !secret mqtt_password`,
and Z2M 2.x does NOT register a `!secret` YAML tag — js-yaml throws
"unknown scalar tag !<!secret>", which surfaces as the generic
"configuration is invalid (use yaml-validator)" message.

Z2M's secret mechanism is parseValueRef (settings.ts read()): it matches the
regex `!<file> <key>` against the STRING VALUE of mqtt.user/password/server,
advanced.network_key, frontend.auth_token. So the reference must be a QUOTED
string, not a tag:

    password: "!secret mqtt_password"

Reverted the interim env-override attempt: ZIGBEE2MQTT_CONFIG_* is applied only
in write()/onboarding, not on a plain read of an existing config, so it did NOT
set mqtt.password (confirmed: mqtt.password was empty). The quoted-!secret +
init-rendered /app/data/secret.yaml path is the one Z2M actually resolves on
read.

Verified end-to-end on the REAL rendered ConfigMap via `settings.validate()` in
the running image: VALIDATE_ERRORS: [], mqtt.password resolves from secret.yaml,
31 devices parsed.

Post-merge: the PVC still holds the pre-fix seeded configuration.yaml (init only
seeds when absent), so it must be cleared once so it re-seeds from this fixed
ConfigMap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 13:25:35 +02:00
k.renner 6b578aa35b Merge pull request 'feat(secret-rotator): sync bot tokens into Woodpecker org secrets' (#363) from claude-bot/rotator-woodpecker-secrets into master
ci/woodpecker/push/build-ci-images Pipeline was successful
Reviewed-on: k.renner/homelab#363
2026-07-23 11:23:59 +00:00
claude-botandClaude Fable 5 02c6128dc6 docs(talos,shelly): flag the eth1 name dependency; fix stale eth2 comment
ci/woodpecker/pr/pr-review Pipeline was successful
Review follow-ups (non-blocking):
- The disable_ipv6 sysctl keys on the literal 'eth1' while the interface
  is selected by busPath; a rename would no-op the sysctl SILENTLY and
  leave the host v6-addressed on IoT. Document the dependency and that
  the rollout must verify eth1 is addressless per node.
- shelly-manager-deployment comment said 'master: eth2' — the NAD uses
  eth1. Last lingering eth2-means-v30iot reference, corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 13:08:40 +02:00
k.renner be30af53d0 Merge pull request 'Z2M cutover fix: remove permit_join (invalid in 2.x), replicas 1' (#368) from claude-bot/zha-to-zigbee2mqtt into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#368
2026-07-23 11:04:00 +00:00
claude-botandClaude Opus 4.8 0f41efee35 chore(secret-rotator): address pr-review — suspend rotators, doc caveats
ci/woodpecker/pr/pr-review Pipeline was successful
Review on PR #363:
- Suspend both CronJobs at merge (review-bot quarterly, claude-oauth daily):
  the pinned image is still :latest and predates woodpecker-secret mode, so an
  un-suspended merge would fail on schedule with 'unknown mode'. The image-pin
  follow-up flips them on. (suggestion 2)
- GITEA_VERIFY_REPO: note shelly-manager verified private 2026-07-23 (unauth
  404 + Woodpecker SCM PRIVATE=yes) and the degradation-if-public risk, so the
  pull-only gate's assumption is documented. (suggestion 1)
- make-before-break header: caveat that the 'sync-fail keeps working' property
  holds for one cycle; a persistent sync failure must be fixed before the next
  quarterly run reaps the still-referenced token. (suggestion 3)

Left as-is per the review: the woodpecker.rs defensive else-arms (mirror
bao.rs) and no ureq-mocking test (repo convention).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 13:03:44 +02:00
claude-botandClaude Fable 5 b077de8556 fix(talos): remove node host addressing on the v30iot NIC
ci/woodpecker/pr/pr-review Pipeline was successful
Security + routing. The k8s nodes held a DHCP-leased v4 address and an
RA-derived v6 address on the IoT VLAN — a network that must be treated
as compromised. That gave every IoT device an L3-reachable path to the
node (kubelet, SSH-equivalent apid, any host service) and, as a side
effect, installed a connected 10.2.30.0/24 route so node replies to
IoT-subnet clients bypassed the UDM entirely — breaking every UDM-DNATed
flow (the hairpin NAT: un-translated SYN-ACK -> client kernel RST,
verified live 2026-07-23).

The NIC (busPath 0000:06:13.0) stays up as the macvlan PARENT for the
v30iot pod attachments (matter-server, otbr, shelly-manager), whose
children do their own DHCP in their own netns — host addressing was
never needed for that. dhcp: false drops the v4 address+route;
sysctl net.ipv6.conf.eth1.disable_ipv6=1 drops v6 including link-local,
so the host has no addressable presence on the L2 at all. The old
comment's claimed purpose (Cilium L2 announce for an IoT LB pool) does
not exist — no L2AnnouncementPolicy, BGP-only pool.

RESIDUAL (not addressed here): the NIC remains a macvlan parent, so the
node kernel still processes frames from the IoT L2. Full node isolation
from IoT would require relocating how those three pods reach IoT devices
— a separate, larger change.

Same suppression pattern the repo already uses (edge-host 10-vlan40,
HA macvlan /32) rather than policy routing (Talos 1.12 has no
RoutingRuleConfig; that is 1.13+).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 13:03:14 +02:00
claude-botandClaude Opus 4.8 37f8758150 Z2M cutover: remove permit_join (invalid in 2.x), set replicas 1
Live cutover fix. Two changes:

1. Remove the top-level `permit_join: false` from the Z2M config. It was
   REMOVED in Zigbee2MQTT 2.0 — a config containing it fails schema validation
   and Z2M refuses to start (serves the failure page). Joining is runtime-only
   now (default off; toggled via frontend or the bridge/request/permit_join
   topic), which is what we want anyway. Verified the other 2.x-sensitive keys
   (homeassistant.enabled, frontend.enabled, mqtt.*) against the current docs —
   they were already correct.

2. Flip replicas 0 -> 1. The cutover is committed: ZHA is disabled, the
   coordinator-backup Secret is populated in OpenBao, and Z2M is now the live
   Zigbee stack. Flux owns this field, so it must be 1 in git (a manual
   `kubectl scale` gets reverted on the next reconcile). Rollback = set 0 and
   re-enable ZHA.

Note: the running PVC still holds the pre-fix seeded configuration.yaml; the
init container only seeds when absent, so after merge that stale file must be
cleared once (delete it + restart the pod) so it re-seeds from this fixed
ConfigMap. Tracked as the immediate post-merge step.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 13:02:07 +02:00
claude-botandClaude Opus 4.8 16013a4ca0 feat(secret-rotator): sync bot tokens into Woodpecker org secrets
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Add a woodpecker-secret mode to secret-rotator that upserts an OpenBao-held
value into a Woodpecker ORG-level CI secret (create if absent, else patch
value+events), and wire two rotators that use it — moving review_bot_token and
claude_code_oauth_token off hand-loading into the rotation toolchain and onto
org-level secrets every repo inherits.

secret-rotator:
- woodpecker.rs: org-id lookup, existence probe (404=absent), create/patch an
  org secret via a dedicated woodpecker-bot bearer token. Never logs the value.
- main.rs: woodpecker-secret mode reads a value from BAO_PATH#BAO_FIELD (errors
  if missing/empty, so a blank never overwrites a working secret) and the
  woodpecker-bot token from the bootstrap, then upserts the org secret with the
  configured events (must include pull_request for the PR-review pipeline).

rotators (kubernetes/infrastructure/openbao/rotation/):
- review-bot.yaml: one CronJob, init step mints review-bot's PAT (gitea-token
  mode, pull-verified against a private repo it collaborates on; push not
  verified — it's a read collaborator that posts reviews via the API), main step
  syncs it to org secret review_bot_token (events cron,manual,pull_request).
- claude-oauth.yaml: sync-only (the OAuth token is interactive setup-token, not
  mintable) — daily push of an owner-seeded OpenBao value to org secret
  claude_code_oauth_token.
- policies/rotator-{review-bot,claude-oauth}.hcl: least-privilege OpenBao
  policies + documented hand-seeded bootstraps (review-bot password,
  woodpecker-bot token, seeded OAuth/token fields).

netpol: rotator-{review-bot,claude-oauth}-egress (openbao-ns) +
gitea-allow-review-bot-rotator + a new woodpecker-allow-rotators, so the
rotators reach gitea:3000 / woodpecker:8000 through apps default-deny.

Deploy prerequisites (can't be done from git): pin the image @sha256 once a
build including woodpecker-secret mode lands; apply the two OpenBao policies/
roles; seed the bootstraps. After the org secrets exist, drop homelab's
repo-level claude_code_oauth_token / review_bot_token copies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 12:52:49 +02:00
k.renner 35ba7bc63c Merge pull request 'fix(ci): pr-review.yml parse error — literal ${...} in a comment broke the live pipeline' (#367) from claude-bot/fix-pr-review-var-comment into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#367
2026-07-23 10:52:30 +00:00
claude-botandClaude Opus 4.8 2573547753 fix(ci): remove literal ${...} from pr-review.yml comment
ci/woodpecker/pr/pr-review Pipeline was successful
Woodpecker runs its ${...} variable substitution over the ENTIRE pipeline YAML
including comments, so the literal dollar-brace in the triggering comment
(added when documenting the dropped manual path) failed to parse — 'unable to
parse variable name' — erroring every pull_request pipeline before any step
ran. Reword the comment to avoid the glyph; the live homelab pipeline was down
since #362 merged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 12:50:29 +02:00
k.renner 8b9468caa3 Merge pull request 'feat(ci): trigger pr-review on pull_request events instead of hourly cron' (#362) from claude-bot/pr-review-on-pr-events into master
Reviewed-on: k.renner/homelab#362
2026-07-23 10:45:29 +00:00
k.renner d72ca03fe8 Merge pull request 'Z2M migration: restore via coordinator_backup.json (fix ext_pan_id byte-order trap)' (#366) from claude-bot/zha-to-zigbee2mqtt into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#366
2026-07-23 10:33:45 +00:00
claude-botandClaude Opus 4.8 7e40d443de fix(ci): sandbox the pr-review agents' Read tool against token exfil
The triage + review agents run with REVIEW_TOKEN and CLAUDE_CODE_OAUTH_TOKEN in
their environment, process attacker-controlled PR title/body/diff, and their
output is posted verbatim as a public PR comment. Without a Read sandbox a
prompt-injected diff could read /proc/self/environ (the tokens) or .git/config
(Woodpecker's clone credential) and get it published. Every other agent
pipeline already denies this via --settings; pr-review had none.

Add ci/agents/pr-review/settings.json (mirrors issue-fix/update-audit, gitea
#197) denying Read on /proc,/root,/home,/etc,.git, and pass --settings
$PROMPTS/settings.json to both claude invocations (resolves alongside the
prompts, so it works for the repos that fetch prompts from the homelab clone).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 12:33:03 +02:00
claude-botandClaude Opus 4.8 8ca0b0995c Switch Z2M network migration to coordinator_backup.json restore
Correct the cutover mechanism before it ever runs. The prior approach hand-set
advanced.pan_id/ext_pan_id/network_key in the Z2M config from the ZHA values.
That is the risky path: the extended PAN ID byte order is REVERSED between ZHA
(zigpy) and Z2M (zigbee-herdsman), so loading the ZHA value as-is makes herdsman
see a mismatch and FORM A NEW network — dropping every device (the explicit
non-goal). Mixing a manual ext_pan_id with a backup also conflicts (Z2M ignores
the reversed value).

Instead restore an Open Coordinator Backup, the shared zigpy<->herdsman
interchange format, which pins byte orders in-spec and handles the reversal on
import:
  - New zigbee2mqtt-coordinator-backup ExternalSecret (OpenBao) holds the full
    backup JSON (contains the network key -> OpenBao only, never git), replacing
    zigbee2mqtt-network-externalsecret.yaml.
  - Init container seeds /app/data/coordinator_backup.json on first run only
    (guarded on database.db too, so Z2M's own state is never overwritten), and
    now renders only the mqtt password into secret.yaml.
  - Config drops advanced.pan_id/ext_pan_id/network_key/channel entirely; the
    network comes from the restored backup.

Runbook updated: Step 1 exports the Open Coordinator Backup from zigbee.db via
zigpy (non-disruptive — no second radio session); Step 2 stores it in OpenBao;
added an explicit device re-interview step (devices stay joined but Z2M's
database starts empty), and a PVC-clear note in rollback.

Verified live: coordinator has pan 0x8b2b, ext_pan_id fc7a735d08c15476,
channel 25; zigpy emits a valid open-coordinator-backup for it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 12:30:51 +02:00
claude-botandClaude Opus 4.8 2a65066672 fix(ci): review the workspace checkout, not a hand-cloned copy
On a pull_request event Woodpecker's built-in clone already checks the repo out
at the PR head in the workspace, so the agents read that directly for context.
Restores full-context review (the prior commit over-corrected to diff-only)
while keeping the manual, token-bearing clone gone. Prompts point at the
working-directory checkout instead of ./work/target.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 12:03:35 +02:00
k.renner 8d840b0c55 Merge pull request 'Zigbee2MQTT deployment for no-re-pair ZHA migration' (#364) from claude-bot/zha-to-zigbee2mqtt into master
ci/woodpecker/manual/pr-review Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#364
2026-07-23 10:02:17 +00:00
claude-botandClaude Opus 4.8 8aa3bbf761 refactor(ci): review from the diff, don't clone the target repo
The clone existed only to hand review_bot_token to git, which persisted it in
work/target/.git/config — a file the review agent (Read/Glob/Grep, output
posted publicly) could read. Nothing needed the checkout that the API-fetched
diff + metadata don't already provide, so drop the clone entirely: no token on
disk, no work/target, no cleanup. The PR + diff are still read over the API
with ephemeral curl Authorization headers (never written to disk).

Prompts updated to match: the agents review the diff alone (no ./work/target),
and are told to flag, not guess, when a judgement needs code they can't see.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 11:59:59 +02:00
claude-botandClaude Opus 4.8 c1c636e299 Pre-seed Z2M friendly names + HA-side entity reconciliation audit
Pull the live ZHA device registry (31 devices + coordinator) and pre-seed each
device's friendly_name in the Z2M config, keyed by IEEE. Devices then come up as
"EG Küche Tischlampe Oben" instead of "0x001788010856bb17" the moment Z2M
re-interviews them on the adopted network — which is what keeps the HA-side
entity reconciliation small and mechanical. Two devices that were both bare
"Deckenlampe" in ZHA are disambiguated by area (Z2M requires unique friendly
names): EG Galerie (Hue LTC001) and DG Lager (LUMI N1 switch).

Add zigbee2mqtt-entity-reconciliation.md: an audit of exactly which ZHA entities
the git-tracked config references, so the cutover knows what must be re-pointed.
Key result — the HA-side change is FAR smaller than "rewire everything":

  - 216 ZHA entities exist, but only 16 distinct entity_ids are referenced in
    the repo (200 are unreferenced diagnostics/config entities).
  - 14 of the 16 are physical-device entities, all mapping cleanly into the
    31-device inventory (no orphans).
  - The remaining 2 are the `light.texas_instruments_coordinator_*` entities —
    now identified as ZHA *groups* on the coordinator (not physical devices),
    accounting for 14 references. These don't come from Z2M device discovery and
    must be re-created as Z2M groups and re-pointed by hand.

Scope note captured in the doc: only git-tracked YAML/JSON was audited; live
.storage Lovelace dashboards and UI-created automations/helpers must be
reconciled separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 11:57:14 +02:00
claude-botandClaude Opus 4.8 01f79b4315 fix(ci): don't persist review_bot_token in the PR checkout config
Replace the credential-in-URL clone (which git wrote into
work/target/.git/config, readable by the review agent whose output is posted
publicly) with a tokenless clone that supplies auth via an HTTP header through
GIT_CONFIG_* env. The persisted remote is tokenless, so no repo file holds the
PAT — fixing the leak at the source instead of deleting .git after the fact.

Supersedes the previous rm -rf .git stopgap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 11:54:49 +02:00
claude-botandClaude Opus 4.8 2073cedbcf fix(ci): strip review_bot_token from the PR checkout before the agent runs
The clone embedded REVIEW_TOKEN in the URL, which git persists in
work/target/.git/config. The review agent runs next cd'd into the workspace
with Read/Glob/Grep and its report is posted verbatim as a public PR comment,
so the write:repository PAT was readable and could be exfiltrated via prompt
injection from the reviewed PR (caught by the review bot on PR #180). The
agent needs only the working tree, so drop .git entirely after checkout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 11:49:41 +02:00
claude-botandClaude Opus 4.8 becd041b21 Add Zigbee2MQTT deployment for no-re-pair ZHA migration
Lay down Zigbee2MQTT (Z2M) in the home-assistant namespace as the eventual
replacement for the ZHA integration, wired to drive the SAME coordinator ZHA
uses today (SMLIGHT SLZB-06 / TI CC2652, tcp://slzb-zigbee.renner.uno:6638).

Devices are joined to the network on the coordinator chip, so if Z2M comes up
with the existing network parameters (pan_id, ext_pan_id, network_key, channel)
zigbee-herdsman ADOPTS that network instead of forming a new one — every device
stays joined, no re-pairing.

Ships INERT and safe to merge:
  - Deployment is replicas: 0. Reconciling this PR starts nothing.
  - The ZHA network params come from the `zigbee2mqtt-network` ExternalSecret
    (OpenBao), populated only at cutover. Until then the ExternalSecret is
    NotReady and the pod cannot start, so it can never accidentally form a new
    network (which would drop every device).
The cutover is a manual, documented, reversible procedure — see
zigbee2mqtt-migration-runbook.md.

Contents:
  - zigbee2mqtt-{pvc,config,deployment,service}.yaml — the app. Config template
    is seeded to the PVC once; secrets (mqtt password + ZHA network params) are
    injected via /app/data/secret.yaml (rendered each start by an init
    container) and referenced with Z2M `!secret`, keeping the network key out
    of git and out of the ConfigMap.
  - zigbee2mqtt-network-externalsecret.yaml — OpenBao-backed network params,
    populated at cutover from a ZHA network backup.
  - New `zigbee2mqtt` Mosquitto broker user: bootstrap Job
    (mosquitto-bootstrap.yaml) + passwd/ACL/env (mosquitto-deployment.yaml),
    scoped to zigbee2mqtt/# plus write homeassistant/# for HA MQTT discovery.
  - zigbee2mqtt-migration-runbook.md — the cutover + rollback procedure.

No new egress CiliumNetworkPolicy is needed: the namespace-wide default-deny
policy already grants same-namespace (mosquitto), DNS, and world (the IoT-VLAN
coordinator) to every pod.

Follow-up (separate homeassistant-repo PR): re-point automations/dashboards
from ZHA entity ids to the new Z2M MQTT-discovery entities.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 11:10:05 +02:00
claude-botandClaude Opus 4.8 e96056dabd fix(ci): drop the no-op manual re-review path from pr-review
Woodpecker exposes --var values to YAML ${...} substitution and when-filters
only, not as a step's shell environment, so the documented
'--var PIPELINE=pr-review --var PR=<n>' re-review read an unset shell var and
silently no-opped with a green build (caught by the review bot on PR #49).

Trigger on pull_request only; re-review by pushing a commit (new head sha
clears the dedup marker). Resolve the PR from CI_COMMIT_PULL_REQUEST alone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 10:56:25 +02:00
claude-botandClaude Opus 4.8 f9c5ab6b1b feat(ci): trigger pr-review on pull_request events instead of hourly cron
Switch the PR review bot from a homelab-hosted hourly cron that polls four
repos over the Gitea API to a per-repo, event-driven pipeline that reviews
only the PR that triggered it (CI_REPO + CI_COMMIT_PULL_REQUEST). Fires on
pull_request, which Woodpecker raises on both PR-open and push-to-open-PR.

Drops the cross-repo discovery loop and MAX_PRS cap; keeps the sha-dedup
marker (now guarding pipeline retries), Haiku triage, model selection, and
never-approve posture. Resolves the agent prompts from the local checkout or
a shallow homelab clone so the identical file drops into every reviewed repo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 09:13:37 +02:00
k.renner ec78cad10a Merge pull request 'Hairpin NAT for NetBird proxy addresses + public-DNS cutover for roaming clients' (#361) from claude-bot/netbird-proxy-2-hairpin into master
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
ci/woodpecker/cron/pr-review Pipeline was successful
ci/woodpecker/push/deploy-netbird-proxy Pipeline was successful
ci/woodpecker/manual/deploy-infrastructure Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/manual/pr-review Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#361
2026-07-23 07:11:32 +00:00
claude-botandClaude Fable 5 4806e55617 fix(dns): k.renner.uno stays out of domainFilters, no exceptions
Owner directive: .k is never reintroduced, not even as a temporary
garbage-collection scope. The leftover k. records on the UDM are out of
external-dns's view and get deleted once via the UDM UI at cutover.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 09:09:26 +02:00
claude-botandClaude Fable 5 757cd828a4 fix(dns): keep k.renner.uno filter as temporary garbage collector
Review finding: domain filters gate deletion as well as creation, so
dropping the suffix would orphan the retired k. records instead of
removing them. The filter entry stays until sync has deleted them all
(no resource carries a k. host, so desired state for the suffix is
empty), then gets dropped — the comment says exactly when. Also fixes
the stale excludeDomains mention and the '13 networks' miscount in the
NAT header comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 09:08:00 +02:00
claude-botandClaude Fable 5 239151b6b4 fix(dns): purge every remaining .k.renner.uno reference
*.k.renner.uno was a temporary migration namespace and is banned (owner
directive 2026-07-14, documented in openbao/ingress.yaml) — it was never
the live naming. Removes the .k. hosts/SANs from ical-proxy, loki,
grafana and the mosquitto cert, renames syslog.k.renner.uno to
syslog.renner.uno (cert + external-dns annotation; any syslog sender
still configured with the k. name must be repointed), fixes the stale
comments, updates e2e-test.sh probes to the real names, and drops
k.renner.uno from the external-dns domainFilters so leftover k. records
get garbage-collected by policy: sync.

The migration script's historical docstring reference stays — it
documents what the migration did.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 08:55:05 +02:00
claude-botandClaude Fable 5 b894fdb11d fix(dns): label filter needs no manual record cleanup
Correction: only domain filters apply to both desired and current
state. The label filter is source-side only, so the registry-owned UDM
records for newly labeled resources stay visible and policy: sync
deletes them itself — the cutover is fully automatic.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 08:50:29 +02:00
claude-botandClaude Fable 5 ca61ff493c feat(dns): label-driven registration replaces the excludeDomains list
The dns.renner.uno/public=true label on an Ingress marks it as publicly
registered (Cloudflare wildcard -> NetBird proxy); external-dns-unifi
now runs with labelFilter dns.renner.uno/public!=true and skips those
resources entirely. Visibility is a property of the app resource itself
— there is no central name list to keep in sync with the proxy.

Also removes the dead .k.renner.uno hosts from the public apps'
Ingresses (their TLS certs reissue without those SANs) and splits
photos.renner.uno onto its own unlabeled Ingress: the label filter is
per-resource and that name stays LAN-registered. Remaining .k. names on
LAN-only apps (loki, ical-proxy, syslog) are untouched here.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 08:38:17 +02:00
claude-botandClaude Fable 5 8003f6a1ef fix(opentofu): no hairpin on VLANs with cluster-node legs; tidy
Review finding: on (40) Server, (42) Ingress and (49) k8s Ceph the
cluster nodes sit on the same L2 as the client, so a DNATed flow's
reply bypasses the UDM conntrack (asymmetric) — and clients there are
the nodes themselves, which already resolve the public names in-cluster.
Their idx slots stay reserved. Also records the restapi provider in the
lock file and trims trailing blank lines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 08:20:05 +02:00
claude-botandClaude Fable 5 a7ab5c6b27 docs(external-dns): excluding a domain hides records, does not delete them
Review finding: the domain filter applies to current state as well, so
pre-existing LAN records for newly excluded names are orphaned on the
UDM and must be removed once by hand as part of the cutover.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 08:09:30 +02:00
claude-botandClaude Fable 5 c74966808b refactor(opentofu): uniform hairpin rule shape for both address families
Per review: no family-specific behavior. Every rule is the same
ADDRESS_AND_PORT specific-address shape (endpoint x port x network,
6 rules per network), matching the pre-existing hand-made rules'
structure. Drops the tofu-owned firewall groups and the v4-only
FIREWALL_GROUPS path entirely.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 07:56:25 +02:00
claude-botandClaude Fable 5 1e6ed460ed feat(opentofu): hairpin DNAT rules for NetBird proxy addresses as code
No UniFi Terraform provider models v2 NAT translation fields
(ubiquiti-community 0.55 none, filipowm #104 open, resnickio shell-only),
so the rules go through Mastercard/restapi against the controller's
/proxy/network/v2/api/site/default/nat endpoint, same API key as the
unifi provider.

Rule shapes follow the behaviorally verified matrix on Network 10.5.62:
v4 uses FIREWALL_GROUPS (tofu-owned address+port groups); v6 must use
ADDRESS_AND_PORT specific-address rules (4 per network) because v6
group-based DNAT silently drops the address match and rewrites all
traffic on the listed ports. rule_index is static per network to keep
indices collision-free and stable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S5CLfizEtzHS51kxJFQgc
2026-07-23 07:49:04 +02:00
security-bot 16c1ea1d04 chore(image-automation): bump gitea.renner.uno/k.renner/vsftpd:build.1784731469
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/pr-review Pipeline was successful
Updates managed by image-automation-controller.
2026-07-22 14:57:57 +00:00
k.renner ed567f300a Merge pull request 'feat(woodpecker): upgrade to v3.16.0 + enable 3.x image automation' (#359) from claude-bot/woodpecker-316-imgauto into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#359
2026-07-22 14:38:14 +00:00
security-bot 463f9e59be chore(image-automation): bump gitea.renner.uno/k.renner/vsftpd:build.1784729100
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-22 14:27:57 +00:00
claude-botandClaude Opus 4.8 511904ae9e feat(woodpecker): upgrade to v3.16.0 + enable 3.x image automation
Now that woodpecker runs on postgres (not the previously-pinned sqlite), the
"never surprise-bump a live sqlite DB" hazard is gone. Bump server + agent
3.13.0 -> 3.16.0 (a reviewed minor jump: no breaking config changes for our
kubernetes+gitea+postgres setup, no risky migrations per the changelog; direct
3.13->3.16 is supported, migrations run on startup).

Add Flux image automation (image-automation/woodpecker.yaml) at range 3.x, so
minor + patch releases auto-update; only the 4.0 major stays a reviewed bump.
Server and agent share the same range/tag-filter and both carry an $imagepolicy
marker, so they bump in lockstep (gRPC version parity is required).

Pre-upgrade CNPG base backup taken (wp-pg-preupgrade-316) as the rollback path,
since migrations are forward-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 16:24:27 +02:00
k.renner 52a36336f1 Merge pull request 'feat(woodpecker): drop the sqlite PVC, StatefulSet->Deployment (#295, #324)' (#357) from claude-bot/woodpecker-drop-pvc into master
ci/woodpecker/cron/pr-review Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#357
2026-07-22 14:11:37 +00:00
claude-botandClaude Opus 4.8 709854c6b4 feat(woodpecker): drop the sqlite PVC, StatefulSet->Deployment (#295, #324)
Stage 3/3, the finale of the sqlite->CNPG migration. woodpecker-server is now
stateless (DB in wp-pg Postgres, verified end-to-end incl. a live pipeline run),
so convert the StatefulSet to a Deployment and remove the volumeClaimTemplates +
/var/lib/woodpecker mount. strategy: Recreate keeps a single control-plane
instance (no two servers on one DB during a roll).

This deletes the last use of the data-woodpecker-server-0 PVC, whose ext4
CSI-snapshot backup failed permanently ("structure needs cleaning"). Once the
PVC itself is removed, Velero's apps-daily stops trying to snapshot it —
resolving #295 and #324. The agent reaches the server via the standalone
`woodpecker` Service (label selector), so a Deployment pod is reachable
unchanged.

Closes #295
Closes #324

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 16:10:25 +02:00
k.renner 4fbd437e78 Merge pull request 'feat(woodpecker): cut server over to wp-pg postgres (#295, #324)' (#356) from claude-bot/woodpecker-pg-cutover into master
Reviewed-on: k.renner/homelab#356
2026-07-22 14:02:18 +00:00
claude-botandClaude Opus 4.8 7849b6bb64 feat(woodpecker): cut server over to wp-pg postgres (#295, #324)
Stage 2/3 of the sqlite->CNPG migration. Points woodpecker-server at the
wp-pg Postgres cluster (creds from the CNPG-generated wp-pg-app secret via a
lib/pq keyword DSN). The sqlite data was migrated one-time via pgloader
(schema-first/data-only, per seed/woodpecker/MIGRATION.md); parity verified
(all 18 tables match, booleans correct, sequences reset).

The sqlite PVC + volumeMount are intentionally KEPT for now (rollback = revert
these env vars) — they're dropped in stage 3 (StatefulSet->Deployment) after a
soak. Image stays v3.13.0 (no version bump during the migration).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 15:56:45 +02:00
claude-botandClaude Opus 4.8 66c2f8d9ea fix(external-dns): stop publishing LAN-only records for public hostnames
A phone that caches the LAN answer for a public app on wifi (10.2.99.86 /
fd99::86) and then roams to cellular blackholes on it: RFC1918 and ULA give
no RST and no ICMP, so the app hangs until TCP timeout instead of failing
fast. That is why restarting the app does not always help — the OS resolver
still hands back the unroutable address.

Excluding these eight names from the UniFi provider makes LAN fall through to
the public *.renner.uno wildcard, so every network returns the same answer and
a stale cache stays correct. LAN traffic still stays local: the UDM hairpins
the proxy addresses back to 10.2.99.86 / fd99::86 (Policy Table -> NAT).

Excluded by record name rather than by label because these Ingresses are
multi-host — immich.k.renner.uno and immich.renner.uno share one object, and
*.renner.uno cannot cover a three-label name, so a label filter would make the
.k. name unresolvable on LAN.

policy: sync, so this deletes 16 UDM records (8 names x A/AAAA) on reconcile.

The source of truth for the list is the NetBird proxy's tunnelled domains, not
the cluster; it must be updated when an app is published or unpublished.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 15:45:46 +02:00
k.renner 61b1f7b64d Merge pull request 'feat(woodpecker): provision wp-pg CNPG cluster to migrate off sqlite (#295, #324)' (#355) from claude-bot/woodpecker-cnpg into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#355
2026-07-22 13:30:07 +00:00
claude-botandClaude Opus 4.8 5cb90432e7 feat(woodpecker): provision wp-pg CNPG cluster to migrate off sqlite (#295, #324)
woodpecker-server runs sqlite on a ceph-block PVC (data-woodpecker-server-0)
whose Velero CSI-snapshot backup fails permanently (ext4 "structure needs
cleaning" — the source fs is error-flagged and journal replay can't clear it).
Rather than repeatedly fsck a fragile sqlite, move woodpecker's DB onto CNPG
postgres like authentik/immich/monitoring/paperless already do — giving proper
WAL-based barman backups and letting the PVC be removed entirely, which
resolves #295/#324 by deletion.

This PR (stage 1 of 3) provisions only the empty backend — no woodpecker
impact:
- kubernetes/seed/woodpecker/: wp-pg Cluster (1 instance, initdb woodpecker),
  ObjectStore -> Hetzner S3 (s3://renner-uno-k8s-cnpg/wp-pg), ScheduledBackup,
  and a hetzner-s3-creds ExternalSecret (reuses the shared paperless S3 path to
  avoid seeding a new OpenBao key; follow-up noted inline to give it its own).
- seed-woodpecker Flux Kustomization (dependsOn infrastructure + cnpg-barman,
  CNPG health-gated), auto-synced from clusters/homelab/.
- MIGRATION.md: the one-time schema-first / data-only pgloader runbook and the
  staged cutover (PR 2 = server.yaml -> postgres; PR 3 = drop PVC, STS->Deploy).

sqlite PVC is untouched; rollback is reverting env vars until PR 3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 15:28:37 +02:00
k.renner f14fb80589 Merge pull request 'fix(flux): scope infrastructure health to its operators, not every resource' (#354) from fix/infra-healthchecks into master
Reviewed-on: k.renner/homelab#354
2026-07-22 13:26:25 +00:00
claude-botandClaude Opus 4.8 93944ff525 fix(flux): scope infrastructure health to its operators, not every resource
The infrastructure Kustomization used wait: true with no healthChecks. With
wait: true Flux ignores healthChecks and blocks the Kustomization's Ready on
EVERY resource it applies (hundreds). Because ~28 kustomizations dependsOn
infrastructure, one crashlooping workload froze the entire GitOps apply chain:
a crowdsec-agent crashloop held all of GitOps hostage for hours — merges didn't
go live — even though crowdsec is a non-critical app nothing depends on for
startup. The 15m health-check timeout looped every 10m, so infrastructure never
reported Ready and every dependent stayed blocked.

Switch to wait: false + explicit healthChecks covering only the operators and
providers dependents actually consume: cilium (CNI), cert-manager (TLS Secrets),
external-secrets + openbao (the ESO backend ExternalSecrets resolve against),
rook-ceph-operator (storage), cloudnative-pg (DB operator for seed jobs).
Everything else still applies — it just no longer gates readiness, so a
non-critical crashloop can't cascade across the cluster. This mirrors the
pattern infrastructure-ceph-cluster already uses (healthCheckExprs for Rook).

Verified live: infrastructure reconciles Ready on the 6 checks (wait=false),
and all dependent kustomizations stayed Ready.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:15 +02:00
claude-botandClaude Opus 4.8 3984cd0d14 feat(netbird-proxy): add proxy-2 member, restore port 80, stop needless restarts
Adds proxy-2.renner.uno (netcup, Arch) as a second proxy-only cluster member
so proxy.renner.uno can move off netbird.renner.uno entirely. The controller
host shared one IP and port with the reverse proxy, separated only by TLS SNI,
which made destination NAT for LAN hairpin impossible without also capturing
NetBird control-plane traffic.

netbird-proxy listens on :443 only (NB_PROXY_ADDRESS=:443) and has no HTTP
listener, so once proxy.renner.uno stopped resolving to the controller host,
port 80 went unanswered for every off-LAN client. Adds a minimal nginx
redirector publishing :80 on every member to restore the 301.

Deploying that sidecar exposed two defects in the role:

- Any docker-compose.yml change notified the force-recreate handler, rebuilding
  the proxy container even for edits that do not touch the proxy service.
  `docker compose up -d` already recreates only changed services, so the notify
  is dropped there; proxy.env keeps it because compose cannot detect env_file
  content changes.
- The play restarted every cluster member in parallel, taking the whole proxy
  cluster down at once. Now serial: 1.

Verified: both members serve :443 (200) and :80 (301); a repeat run reports
changed=0 on both with no handler firing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 14:54:05 +02:00
k.renner ab66e4c67e Merge pull request 'feat(flux): auto-rotate the Flux git token (gitea-token mode)' (#353) from feat/flux-token-rotation into master
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/cron/pr-review Pipeline was successful
Reviewed-on: k.renner/homelab#353
2026-07-22 11:54:39 +00:00
claude-botandClaude Opus 4.8 9f43ad7abb chore(flux): pin GITEA_REQUIRE_PUSH=true on the flux-git rotator
Per review. k.renner/homelab is public, so the pull verification passes for any
valid token — push is the only load-bearing check. It already defaulted to true
in the binary, but pinning it in the manifest documents the safety invariant at
the call site so it can't silently degrade if the default ever changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 13:49:44 +02:00
claude-botandClaude Opus 4.8 0d6fc81e9b feat(flux): auto-rotate the Flux git token (gitea-token mode)
Wires the Flux git credential — the dedicated `flux` gitea account — into the
rotation fleet, so it can't silently die again (the cause of the recent GitOps
outage). Quarterly, via the secret-rotator binary's gitea-token mode.

Flow: mint a new PAT (basic auth, the flux password bootstrap) -> VERIFY it can
pull AND push (Flux image-automation writes back) -> store in OpenBao -> ESO
merges it into the flux-system secret -> source-controller reads it fresh. A
token that fails verification is deleted and the run aborts without storing, and
the reap keeps the two newest tokens so the previous one stays valid through the
ESO propagation window — Flux is never stranded.

Reachability: gitea via the in-cluster Service gitea.apps.svc:3000 — the public
gitea.renner.uno name hairpins off the ingress LB from a pod (same as
pve.renner.uno). Needs both netpol halves (gitea-allow-flux-rotator in apps +
rotator-gitea-flux-egress in openbao). Added flux-system to the openbao
ClusterSecretStore's allowed namespaces so the ExternalSecret can sync there.
The ExternalSecret uses creationPolicy: Merge, so an ESO failure leaves the
last-good credential in place rather than blanking Flux's secret.

Tested live end-to-end: job minted flux-gitops-1b8d20, verified pull+push,
stored (OpenBao e26e8bf1 -> 9666320e), kept the previous token (2 tokens, 0
reaped), ESO synced, Flux pull fetched, and image-automation pushed
(Ready=True). OpenBao policy/role + the gitea-flux password bootstrap are
provisioned by hand (see rotator-gitea-flux.hcl).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 12:57:25 +02:00
k.renner f5fa8f5a1d Merge pull request 'feat(secret-rotator): gitea-token mode' (#348) from feat/gitea-token-mode into master
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/cron/pr-review Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#348
2026-07-22 10:48:01 +00:00
claude-botandClaude Opus 4.8 59e804d9a4 fix(secret-rotator): keep the previous gitea token through the ESO propagation window
ci/woodpecker/push/build-ci-images Pipeline was successful
Second review pass (no blocking issues). The important one: the reap deleted
EVERY other prefix token right after store, including the previous run's token —
which is still the live credential in the k8s Secret until ESO syncs the new
value and source-controller re-reads it. Deleting it immediately opens an
availability window (ESO refreshInterval + reconcile lag) where Flux's stored
token has just been revoked. Since this mode exists specifically to avoid
stranding Flux, that window shouldn't exist.

Now the reap keeps the TWO newest tokens (the one just stored + the previous)
and deletes only older ones. tokens_with_prefix returns (id, name) so the
caller can order by recency; the previous token survives until the next
quarterly run, long after ESO has synced.

Also:
- doc-note that PUSH is the load-bearing gate check: for a public verify_repo,
  git-upload-pack returns 200 for any valid token, so pull barely gates —
  don't set GITEA_REQUIRE_PUSH=false against a public repo.
- fetch tokens with limit=50 (single effective page) and note the count stays
  tiny given keep-two reaping, so pagination can't silently miss old tokens.
- tidy the cleanup error message connector.

clippy -D warnings clean; 14 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 12:45:07 +02:00
k.renner 84d94186ec Merge pull request 'fix(#336): stop the registry filling — frequent GC + stop needless CI rebuilds' (#350) from claude-bot/gitea-registry-gc into master
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/cron/pr-review Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#350
2026-07-22 09:03:59 +00:00
claude-botandClaude Opus 4.8 f6bee49e6d fix(gitea): set volumeClaimTemplate to 40Gi to match the live PVC (#336)
Reflect the live 20Gi->40Gi expansion in the manifest as source of truth.
volumeClaimTemplates is immutable on an existing StatefulSet, so landing
this needs a one-time `kubectl delete statefulset gitea -n apps
--cascade=orphan` (pod + PVC survive) for Flux to re-create the STS from
the updated template. Documented inline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 11:01:29 +02:00
claude-botandClaude Opus 4.8 09945402f3 fix(ci): only rebuild the image whose source changed (#336)
ci/woodpecker/push/build-ci-images Pipeline was successful
build-ci-images had a pipeline-level path trigger but no per-step
filters, so any push touching ci/images/** or secret-rotator/** rebuilt
ALL five images. The recent burst of secret-rotator commits therefore
needlessly rebuilt the four ~1.3G ci-* images each time, re-pushing and
overwriting :latest and orphaning ~5G of registry layers per run — a
primary source of the orphaned-blob pileup that filled data-gitea-0.

Add per-step when:path so each build runs only when its own source (or
the pipeline file) changed, or on a manual run. A secret-rotator change
now rebuilds only secret-rotator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 10:25:30 +02:00
claude-botandClaude Opus 4.8 e7e22cdd8e fix(gitea): run package-registry GC every 6h to stop orphan blobs filling the volume (#336)
data-gitea-0 hit 100% and gitea started failing writes ("database or
disk is full"). Root cause was NOT tag accumulation — live images are
only 8.7G and well-deduplicated. It was 10.4G (54% of the volume) of
ORPHANED, unreferenced blobs: every time an image tag is overwritten
(the ci-* images and shelly-manager rebuild frequently, shelly-manager
on both cron and push), the previous multi-GB layer set is orphaned.
Gitea's default cleanup_packages GC runs only @midnight with
OLDER_THAN=24h, so a day's worth of orphans piled up faster than it
collected them and filled the disk. A manual GC run reclaimed nothing
because every orphan was <24h old and thus skipped by the age cutoff.

Set the GC to run @every 6h with OLDER_THAN=4h so orphans are reclaimed
same-day. 4h is well beyond any in-flight push, so a live upload is
never collected. Applying this restarts gitea and its RUN_AT_START GC
reclaims the existing ~10G backlog (usage drops to ~9G).

Emergency relief was already applied out-of-band: the PVC was expanded
20Gi -> 40Gi (ceph-block online resize) to clear the outage without a
risky restart at 0 bytes free; documented on the volumeClaimTemplate.

Supersedes #349 (which targeted tag count, the wrong layer).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 10:20:36 +02:00
claude-botandClaude Opus 4.8 82f6bc765f fix(secret-rotator): clean up orphaned gitea token on all post-mint failures
ci/woodpecker/push/build-ci-images Pipeline failed
Addresses the review on the gitea-token mode.

Blocking: the cleanup only ran on the Ok(false) gate branch. If token_allows
returned Err (a wrong GITEA_VERIFY_REPO, a 5xx) or the OpenBao store failed
after verification passed, the `?` propagated and the just-minted, write-scoped
PAT was orphaned with no delete and no log — contradicting the stated
guarantee, and unlike ha.rs which logs its orphan. Fixed: verify+store now run
in a closure, and ANY error after the mint deletes the token; if the delete
also fails, a CRITICAL line names the live token so it can be revoked by hand.

Also from the review:
- distinguish 401 (minted token rejected — auth, surfaced as an error) from 403
  (valid token, insufficient scope — a real gate "no") in token_allows, instead
  of collapsing both to Ok(false).
- reject an empty GITEA_SCOPES up front, matching BAO_FIELDS / NB_AUTO_GROUPS.
- add a basic() unit test (gitea.rs had none) pinning the auth-header format;
  crate now has 14 tests.
- tighten the doc comments that overstated the guarantee.

clippy -D warnings clean; 14 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 09:25:20 +02:00
claude-botandClaude Opus 4.8 3862e9a806 feat(secret-rotator): gitea-token mode
ci/woodpecker/push/build-ci-images Pipeline was successful
Rotates a gitea PAT used as a git credential — for Flux's own flux-system
secret. Gitea blocks token-from-token (403), so minting uses BASIC auth with a
dedicated service account's password as the bootstrap, like the Cloudflare and
Proxmox privileged bootstraps.

Make-before-break with a hard safety gate: mint a new token, VERIFY it can both
pull (git-upload-pack) AND push (git-receive-pack, since Flux image-automation
writes back), and only then store it. A token that fails verification is
deleted and the rotation aborts WITHOUT storing — so a bad rotation can never
strand Flux the way a revoked token did. Old rotated tokens (same name prefix)
are reaped after, non-fatally.

The push check is required by default but env-toggleable (GITEA_REQUIRE_PUSH)
for read-only consumers. Scopes, verify-repo, name prefix and field names are
all env-driven.

Validated against the real gitea API on throwaway tokens (zero blast radius,
live flux token untouched):
  - write token -> pull 200 + push 200 -> gate PASS
  - read-only token -> pull 200 + push 403 -> gate REJECTS it (correctly refuses
    to store a token that cannot push)
  - list-by-prefix + delete (reap) works
clippy -D warnings clean; 13 tests pass.

No rotator uses it yet — the ExternalSecret + CronJob follow once CI publishes
the image.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 08:46:07 +02:00
security-bot 8449636d2d chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784697139 gitea.renner.uno/k.renner/vsftpd:build.1784697262
ci/woodpecker/cron/pr-review 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-07-22 06:42:30 +00:00
k.renner 72ec3396d2 Merge pull request 'fix(crowdsec): set tls secretTemplate so cert-manager accepts the certs (#340)' (#345) from claude-bot/crowdsec-cert-secrettemplate into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: k.renner/homelab#345
2026-07-22 06:23:56 +00:00
claude-botandClaude Opus 4.8 3a152ef28f fix(crowdsec): set tls secretTemplate so cert-manager accepts the certs (#340)
The mTLS fix in #343 failed to apply: chart 0.24.0's agent/bouncer/appsec
Certificate templates emit `secretTemplate:` unconditionally while its
child blocks are guarded, so with nothing configured it rendered as null
and cert-manager's webhook rejected it (spec.secretTemplate must be of
type object). The helm upgrade failed and rolled back, so agents stayed
on the fragile register-based path.

Set tls.certManager.secretTemplate.labels so secretTemplate renders as a
valid object. Verified via kubectl apply --dry-run=server against the
live cert-manager webhook: all 4 Certificates now accepted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 07:46:48 +02:00
k.renner ea2689c6a4 Merge pull request 'fix(crowdsec): mTLS agent auth to end the LAPI-restart auth loop (#340)' (#343) from claude-bot/crowdsec-mtls-340 into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/pr-review Pipeline was successful
Reviewed-on: k.renner/homelab#343
2026-07-22 05:26:56 +00:00
k.renner e752495848 Merge pull request 'fix(flux): point GitRepository at the renamed k.renner/homelab URL' (#342) from fix/flux-git-url into master
Reviewed-on: k.renner/homelab#342
2026-07-22 05:23:51 +00:00
claude-botandClaude Opus 4.8 5ff9725d3c fix(crowdsec): mTLS agent auth to end the LAPI-restart auth loop (#340)
The crowdsec-agent DaemonSet CrashLoops whenever the LAPI pod restarts.
Root cause: the LAPI has no persistence (PVCs disabled in 629a303d to
break the Ceph bootstrap circular-dependency), so its sqlite machine-
registration DB is ephemeral. Agents register once (init container) and
cache a password; a wiped LAPI no longer knows it -> 401 "machine not
found" -> CrashLoop -> DaemonSet never Ready -> the crowdsec HelmRelease
upgrade --wait times out -> the whole `infrastructure` Kustomization and
every app that depends on it stays unhealthy.

Enable chart mTLS (tls.enabled + tls.agent.tlsClientAuth, cert-manager
self-signed CA). With client-cert auth the agent no longer runs
`cscli lapi register`; the LAPI auto-recreates each machine record from
the presented cert on connect, so a wiped/restarted LAPI self-heals with
no PVC and no manual re-registration. Verified via `helm template`
against chart 0.24.0: register step gone, 4 certs emitted, zero PVCs.

Supersede the #337 persistence attempt (revert lapi.persistentVolume.
data.enabled to false): it reintroduced the Ceph circular-dependency and
did not heal the agents (fresh volume = empty DB). mTLS makes the
ephemeral DB harmless instead of trying to persist it.

Pin the chart to 0.24.x: the floating ">=0.12.0" silently upgraded to
0.24.0 (changed persistence defaults), part of this incident.

Note in traefik/crowdsec-middleware.yaml that the inert ingress bouncer
now needs https + CA trust before it can be re-enabled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 07:22:42 +02:00
claude-botandClaude Opus 4.8 8a54323e09 fix(flux): point GitRepository at the renamed k.renner/homelab URL
The repo was renamed gitea_admin/homelab -> k.renner/homelab. Flux's
GitRepository still fetched the old URL, which now 307-redirects, and an
authenticated git fetch does not survive a cross-repo redirect
("authentication required: Verify"). Flux froze at revision 90d7a7c4
(2026-07-21 22:45); nothing merged since was being applied.

Point spec.url at the canonical k.renner/homelab.git so source-controller can
fetch again. Applied live in parallel (kubectl patch) to break the chicken-and-
egg — Flux can't read git to fix the URL that stops it reading git.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 07:22:02 +02:00
k.renner 25281137cd Merge pull request 'refactor(rotation): port pve-exporter to proxmox-token mode' (#341) from feat/port-proxmox-rotator into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/pr-review Pipeline was successful
Reviewed-on: k.renner/homelab#341
2026-07-22 05:09:39 +00:00
claude-botandClaude Opus 4.8 810b68b11f refactor(rotation): port pve-exporter to proxmox-token mode
The LAST rotator. Replaces the inline python with the secret-rotator binary's
proxmox-token mode. Net -48 lines; inline Python is now fully retired — every
rotator runs the one binary, and the openbao image is left only to the
raft-snapshot job.

Tested live end-to-end via the real binary image — the destructive test that
could not be zero-blast-radius, since it rotates the real monitoring token:
  - job Complete: DELETE+recreated pve-exporter@pve!monitoring (privsep=0),
    OpenBao pve.yml rotated 529d7f66 -> f7ca2141, document well-formed
  - the no-verify TLS path worked against the real in-cluster Service (valid LE
    cert, hostname mismatch) — the piece that could only be compile-proven
  - PVE token recreated privsep=0 (inherits the user's PVEAuditor ACL)
  - ESO synced, Reloader restarted pve-exporter, and it recovered: OpenBao and
    k8s token_values match, the new token authenticates (/version 8.4.18), and
    pve_up=1.0 for the cluster and all three nodes

The brief metrics gap between delete and Reloader-restart is inherent to
Proxmox having no atomic roll (documented in the header); off-hours quarterly
makes it acceptable.

Flux strips the old python `command` on apply (verified on the earlier ports);
port via Flux, not kubectl apply.

Image digest sha256:97c22bcf…

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 07:06:47 +02:00
k.renner 7faf106550 Merge pull request 'feat(secret-rotator): proxmox-token mode' (#339) from feat/proxmox-token-mode into master
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#339
2026-07-22 04:56:15 +00:00
claude-botandClaude Opus 4.8 af1737a657 fix(secret-rotator): correct proxmox TLS rationale + log DELETE failures
ci/woodpecker/push/build-ci-images Pipeline was successful
Addresses the advisory review on the proxmox-token mode.

The code claimed the PVE cert is self-signed. It is not — the in-cluster
Service presents a VALID Let's Encrypt cert (verified live: CN=neptune.renner.uno,
issuer Let's Encrypt). Verification fails only on HOSTNAME mismatch: the job
connects to the pve.apps.svc.cluster.local Service (for 3-node failover) while
the cert is for a node FQDN. Corrected the module header and the insecure_agent
comment to say this accurately, and spelled out the real tradeoff — ureq 3 has
no skip-hostname-only option, so it's disable-verification-with-failover (this,
matching the python's prior CERT_NONE) vs pin-to-one-node-FQDN-with-full-verify
-but-SPOF. Noted the deferred improvement (a custom rustls verifier that
validates the LE chain but skips hostname).

Also from the review:
- log a warning when the DELETE result is an Err, so a re-run needn't
  rediscover why a first attempt behaved oddly (still non-fatal — a leftover
  token makes the POST fail loud).
- documented why the raw URL-path interpolation is safe (fixed operator config,
  never untrusted; percent-encoding @ to %40 would break PVE's userid lookup).

No behaviour change to the rotation itself. clippy -D warnings clean; 13 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 06:52:37 +02:00
claude-botandClaude Opus 4.8 1324728721 feat(secret-rotator): proxmox-token mode
ci/woodpecker/push/build-ci-images Pipeline was successful
Adds the last mode — the one that will replace the pve-exporter python rotator,
the hardest of the fleet. Proxmox has no in-place token roll, so this DELETEs
and recreates the token with the same id, then patches OpenBao with a rendered
pve.yml document.

Two capabilities new to the binary:
  - no-verify TLS: a dedicated agent with rustls verification disabled, used
    ONLY for the PVE calls. The API is reached via the in-cluster Service
    ClusterIP, whose cert never matches *.svc.cluster.local, so webpki
    verification can't apply. OpenBao still uses the normal agent.
  - a rendered document, not a bare value: pve.yml is emitted byte-identical to
    the python template (2-space indent, trailing newline, verify_ssl:false),
    unit-tested.

privsep=0 on recreate makes the token inherit pve-exporter@pve's own
permissions, so no separate token ACL is re-applied — verified against the live
cluster earlier (the PVEAuditor ACL is on the user, not the token). The auth
credential is the least-privilege secret-rotator@pve!rotate identity, not root.

DELETE ignores its own outcome (a missing token is a no-op; a real auth/perm
problem surfaces at the POST, where it's fatal — a delete that leaves the token
in place makes the POST fail loud with "already exists"). If the recreate fails
after a successful delete, the store never happens and the error is hard: the
consumer is down until re-run. This destructive window is inherent to Proxmox
and unavoidable without changing the token id each rotation.

Validated against real Proxmox 8.4.18 on a throwaway token (zero blast radius,
never touched the real 'monitoring' token): DELETE 200 -> POST privsep=0 form
-> 36-char value, no trailing newline, and the new token authenticates
(/version 8.4.18). render_pve_yml is byte-exact unit-tested. clippy -D warnings
clean; 13 tests pass.

No rotator uses it yet — the manifest port follows once CI publishes the image.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 00:51:30 +02:00
k.renner 90d7a7c41b Merge pull request 'fix: [alert] KubePodCrashLooping (crowdsec) (#337)' (#338) from alert-fix/issue-337 into master
ci/woodpecker/manual/security-scan Pipeline was successful
ci/woodpecker/cron/pr-review Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#338
2026-07-21 22:44:46 +00:00
k.renner 733e645638 Merge pull request 'refactor(rotation): port netbird-ingress to netbird-key mode' (#335) from feat/port-netbird-rotator into master
Reviewed-on: k.renner/homelab#335
2026-07-21 22:43:43 +00:00
issue-fix-bot 96b0d70767 fix: [alert] KubePodCrashLooping (crowdsec) (#337) 2026-07-21 19:43:56 +00:00
security-bot b0e852542e chore(image-automation): bump ghcr.io/home-assistant/home-assistant:2026.7.3
ci/woodpecker/cron/pr-review Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
Updates managed by image-automation-controller.
2026-07-21 19:23:43 +00:00
claude-botandClaude Opus 4.8 92b59f7c88 refactor(rotation): port netbird-ingress to netbird-key mode
Replaces the inline python NetBird rotator with the secret-rotator binary's
netbird-key mode. Net -30 lines; the login+POST+parse python and the
python:3.13-alpine image go away.

Mints a fresh reusable setup key via POST /api/setup-keys and patches it into
OpenBao. Create-new, not roll-in-place: the old key is left to expire, so
there is no window — it stays valid while the netbird-ingress DaemonSet
re-enrolls its pods on the new one. Nothing is deleted (deliberately — a past
manual delete-filter bug wiped unrelated keys).

Tested live end-to-end via the real binary image:
  - job Complete: minted 'ingress-rotated', OpenBao rolled 8a0aa8d4 -> 77f1be0c
  - NetBird now has 2 'ingress-rotated' keys (new added, old kept — create-new)
  - ESO synced; Reloader restarted the DaemonSet; rolling update (maxUnavailable
    1) completed 3/3 with 0 errors
  - all 3 pods re-enrolled: the new key shows used_times=3, last_used just now;
    pods actively handshaking peers (WireGuard/relay connected)
  - old key still valid, untouched

Flux server-side apply strips the old python `command` (verified on the other
ports); a manual `kubectl apply` would not, so port via Flux.

Image digest sha256:49bfddd8…

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 17:32:17 +02:00
k.renner 57362a35ed Merge pull request 'feat(secret-rotator): netbird-key mode' (#334) from feat/netbird-key-mode into master
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/manual/security-scan Pipeline failed
ci/woodpecker/manual/pr-review Pipeline was successful
ci/woodpecker/manual/update-audit Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/pr-review Pipeline was successful
Reviewed-on: k.renner/homelab#334
2026-07-21 15:23:19 +00:00
k.renner 28f500d566 Merge pull request 'security(ci): add Read sandbox to alert-monitor and issue-fix agents' (#329) from claude-bot/scope-ci-bot-identities into master
Reviewed-on: k.renner/homelab#329
2026-07-21 15:22:31 +00:00
claude-botandClaude Opus 4.8 2611d7bc81 feat(secret-rotator): netbird-key mode
ci/woodpecker/push/build-ci-images Pipeline was successful
Adds the mode that will replace the NetBird python rotator. Mints a fresh
reusable setup key via POST /api/setup-keys and patches it into OpenBao.

Create-new, not roll-in-place: the old key is left to expire (keys are
ephemeral with a bounded expiry), so nothing is deleted — no destructive step,
no window. This deliberately does NOT delete old keys; a past manual cleanup
that filtered keys for deletion wiped unrelated ones (a jq precedence bug), and
that risk has no place in an automated rotator.

NetBird auth is `Authorization: Token <pat>` — NOT Bearer. The key/type/
usage_limit semantics (reusable, unlimited) are fixed; name, expiry, ephemeral,
allow_extra_dns_labels and auto_groups come from the environment. The returned
key is used verbatim (serde_json, no trailing newline). assert_fields_exist
guards the target path. An error that echoes the response redacts the `key`
field so a value can never leak into logs.

Validated against the real NetBird API on a throwaway key (created then
deleted, zero blast radius): TLS verifies with the built-in webpki roots (no
no-verify context needed), POST with Token auth returns a 36-char key with no
trailing newline and the expected settings (reusable/ephemeral/usage_limit 0/
1 auto_group). clippy -D warnings clean; 12 tests pass; the in-cluster pieces
are the same code already proven live by the other modes.

No rotator uses it yet — the manifest port follows once CI publishes the image.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 17:20:43 +02:00
k.renner 99d559dbda Merge pull request 'security(ci): retire the admin gitea_token from CI entirely' (#333) from claude-bot/cutover-bot-tokens into master
ci/woodpecker/push/build-ci-images Pipeline failed
Reviewed-on: k.renner/homelab#333
2026-07-21 15:20:35 +00:00
claude-botandClaude Opus 4.8 43ed92b148 security(ci): move image builds off the admin token to a package-scoped PAT
ci/woodpecker/push/build-ci-images Pipeline was successful
build-ci-images.yml was the last consumer of gitea_token. It used the
admin-owned credential purely as a container-registry login, which meant a
credential that could do anything the admin account could was sitting in a
pipeline that only ever needed to push images.

Replace it with ci_images_token: a PAT scoped to `package: read+write` and
nothing else. Verified — 403 on /user/repos, /admin/users and the issues
API; 200 on the /v2/ registry endpoints kaniko authenticates against.

gitea_token is now unreferenced across every pipeline and can be removed
from Woodpecker and rotated.

The token remains OWNED by gitea_admin because Gitea scopes packages to a
user/org namespace and these images live under gitea_admin/*; a different
account cannot publish there. Moving them to a dedicated org is a
38-reference migration across pipelines and Flux-deployed CronJobs and is
tracked in #330.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 17:18:49 +02:00
k.renner 5a6b60094b Merge pull request 'refactor(rotation): port cloudflare + external-dns to cloudflare-roll mode' (#332) from feat/port-cloudflare-rotators into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#332
2026-07-21 15:11:24 +00:00
claude-botandClaude Opus 4.8 c0c5ea4e5a security(ci): give each agent pipeline its own scoped bot identity
Removes the admin-owned gitea_token from every pipeline that runs an LLM
agent, and stops issue-fix borrowing the security-review pipeline's
identity. Each pipeline now holds a credential that can do only what that
pipeline needs.

  alert-monitor  -> alert_monitor_bot_token   (write:issue)
  issue-fix      -> issue_fix_bot_token       (write:issue, write:repository)
  update-audit   -> update_audit_bot_token    (write:issue)

The accounts are write collaborators, but the PAT scope is the effective
cap — verified empirically: the write:issue-only tokens return 200 on the
issues API and 403 on /user/repos and /admin/users.

Also retires two stale rationales in the comments (the gitea_token
workaround and the security_bot_token 403 that motivated it), and changes
issue-fix's git identity from security-bot@renner.uno to
issue-fix-bot@renner.uno so alert fixes no longer appear as
security-review output.

build-ci-images.yml still uses gitea_token for registry/release writes and
needs a write:package token before gitea_token can be retired and rotated;
tracked in #330.

Refs #330. Closes #197.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 17:11:00 +02:00
claude-botandClaude Opus 4.8 96f0ff0ed4 refactor(rotation): port cloudflare + external-dns to cloudflare-roll mode
Replaces the two identical Cloudflare python rotators with the secret-rotator
binary's cloudflare-roll mode (added in the prior PR). Net -65 lines; the
duplicated OpenBao-login + PUT-and-parse python and the python:3.13-alpine
runtime image go away.

Both roll their token value in place (PUT /user/tokens/{id}/value) and patch
OpenBao. They differ only in two env values, both parameterised:
  cloudflare    BOOTSTRAP_TOKENID_FIELD=token-id              -> infrastructure/cloudflare
  external-dns  BOOTSTRAP_TOKENID_FIELD=external-dns-token-id -> apps/external-dns
The admin token comes from the same shared bootstrap, so it stays in one place.

Behaviour preserved: roll-in-place keeps the token id/scope (no window), the
API value is stored verbatim (no trailing newline), and assert_fields_exist
guards the target path. cert-manager needs no reload (reads fresh per DNS-01
challenge); external-dns keeps its Reloader annotation (startup env var).

Tested: the cert-manager rotator was rolled live end-to-end via the real
binary image — OpenBao rolled (d6a4d73b -> 9bd47674), new token verifies active
with the SAME id af708481 (roll-in-place), no trailing newline, ESO synced,
27/27 certs still Ready. external-dns is the identical code path (only the
token-id field + target path differ) and was not rolled to avoid a needless
restart; its PUT/parse was additionally proven against the real Cloudflare API
on a throwaway token in the mode PR.

Note: Flux server-side apply strips the old python `command` when it applies
these (verified against the already-ported Class-A CronJobs, which show
command=<none> live). A manual `kubectl apply` would NOT — it merges and keeps
the stale command — so port these via Flux, not kubectl apply.

Image digest sha256:978fe53c…

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 17:07:00 +02:00
k.renner f15a47db30 Merge pull request 'feat(secret-rotator): cloudflare-roll mode' (#331) from feat/cloudflare-roll-mode into master
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#331
2026-07-21 14:59:16 +00:00
claude-botandClaude Opus 4.8 d88c4a6cd9 feat(secret-rotator): cloudflare-roll mode
ci/woodpecker/push/build-ci-images Pipeline was successful
Adds the mode that will replace the two identical Cloudflare python rotators
(cert-manager's token and external-dns's). They differ only in which bootstrap
field holds the token id and which OpenBao path receives the value:

  cloudflare   bootstrap#token-id              -> infrastructure/cloudflare#api-token
  external-dns bootstrap#external-dns-token-id -> apps/external-dns#api-token

Both read the admin token from the same shared bootstrap, so it lives in one
place; only the token-id pin differs, keeping the two tokens rolling
independently.

Rolls the token value in place via PUT /user/tokens/{id}/value — same id,
scope and policy, new value — so there is no make-before-break and no
destructive window. assert_fields_exist guards the target path (a typo would
strand the real token), and the API value is used verbatim: a stray newline
would surface as "invalid header field value for Authorization" and crash the
consumer (the bug that hit external-dns once), so the string comes straight
from serde_json with nothing appended.

Handles result as either a bare string or {value: ...} so a future API shape
change fails loud rather than storing "null".

Validated against the real Cloudflare API on a throwaway token (zero blast
radius): PUT with empty body returns success + a bare-string value, new != old
with no trailing newline, new verifies active while the old immediately reads
"Invalid API Token" (confirming roll-in-place has no window). clippy
-D warnings clean; 12 tests pass.

No rotator uses it yet — the manifest port follows once CI publishes the image.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 16:58:40 +02:00
claude-botandClaude Opus 4.8 ab105233d9 security(ci): add Read sandbox to alert-monitor and issue-fix agents
Both agent steps hold Gitea write credentials in their environment
(issue-fix holds a push token too), but neither passed --settings, so
their Read tool was unrestricted — unlike update-audit, which got a
Read sandbox for exactly this reason (gitea issue #197).

That left a complete exfil path: Read /proc/self/environ yields the
token, Write puts it in the agent's output file, and the pipeline posts
that output verbatim as a Gitea issue body / PR body on a PUBLIC repo.

Add the same deny-list used by update-audit (/proc, /root, /home, /etc,
.git) to both agents and wire --settings into each invocation. The repo
checkout, .ci-alert-monitor/ and /tmp/alert-fix/ stay readable, which is
all either agent needs.

This is defense-in-depth only. The root cause — CI pipelines holding an
admin-owned token at all — is tracked separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 16:55:23 +02:00
k.renner 7320342d15 Merge pull request 'refactor(rotation): port the five Class-A rotators to the secret-rotator binary' (#328) from feat/port-class-a-rotators into master
Reviewed-on: k.renner/homelab#328
2026-07-21 14:47:23 +00:00
claude-botandClaude Opus 4.8 3f344a4fdf refactor(rotation): port the five Class-A rotators to the secret-rotator binary
Replaces the inline `head -c N /dev/urandom | base64 | tr -d '\n'` +
`bao kv patch` shell in each of paperless, woodpecker, shelly-manager,
authentik and crowdsec-bouncer-key with the secret-rotator binary's `random`
mode. Net -49 lines; the OpenBao login boilerplate (duplicated in all five)
and the busybox/openbao runtime image go away.

Behaviour preserved exactly:
  - byte-compatible output — N raw bytes, STANDARD base64 with padding (RFC
    4648 unit-tested); 50 bytes for the Django keys (paperless, authentik),
    32 for the rest
  - merge-patch, so co-located fields are untouched (WOODPECKER_GITEA_*,
    authentik smtp-password)
  - shelly-manager's two fields (admin-password, api-key) still land in ONE
    patch, no split state
  - same k8s-auth roles, SAs, schedule, quarterly timing — the roles already
    grant read+patch, which the binary's assert_fields_exist needs

Plus a new safety property the shell lacked: assert_fields_exist refuses to
run if a target field is absent, turning a typo into a loud failure with the
old secret untouched, instead of a silent no-op that adds a stray field.

Image pinned by digest sha256:159e5888… (all three ha-token fixes; the shared
OpenBao code path is the same one `random` uses).

Tested against real OpenBao on a throwaway path+role (zero blast radius, no
live consumer touched):
  - happy path: two fields rotated to 44-char values (32-byte base64),
    co-located field preserved, multi-field single patch
  - fail-safe: a nonexistent target field -> job Failed, clear error, the real
    field left unchanged (whole patch aborted, no partial write)
All five pass server-side admission dry-run under the restricted PSA.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 16:44:11 +02:00
k.renner 71c65fde79 Merge pull request 'feat(ci): add pr-review agent — scheduled AI review of open PRs' (#323) from claude-bot/pr-review-bot into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#323
2026-07-21 14:32:45 +00:00
k.renner 36accd4359 Merge pull request 'feat(home-assistant): automated rotation of the three HA long-lived tokens' (#322) from feat/ha-token-rotation into master
Reviewed-on: k.renner/homelab#322
2026-07-21 14:32:19 +00:00
claude-botandClaude Opus 4.8 9ad08ad931 feat(ci): add pr-review agent — scheduled AI review of open PRs
New Woodpecker cron pipeline that mirrors the alert-monitor / issue-fix
fleet pattern (cron -> headless `claude` -> Gitea API), but reviews open
pull requests instead of triaging alerts:

- .woodpecker/pr-review.yml: hourly `pr-review` cron. Discovers open PRs
  across k.renner/{homelab,shelly-manager,authentik-samba-bridge,
  homeassistant}, skips drafts/WIP and PRs already reviewed at their
  current head sha (dedup marker), caps at 5/run. For each: clones the PR
  head, has a cheap Haiku triage agent pick the model by complexity
  (haiku/sonnet/opus; security-sensitive paths force opus), runs the
  review with that model, and posts a detailed report as a Gitea PR
  review (COMMENT, or REQUEST_CHANGES on a real defect — never APPROVE).
- ci/agents/pr-review/triage-prompt.md: model-selection rubric.
- ci/agents/pr-review/prompt.md: the reviewer's task + report format.

Runs under a dedicated `review-bot` Gitea account (secret
review_bot_token) so reviews are visibly bot-authored and independently
revocable. Static review only — no cluster access; agent tools are
Read/Glob/Grep/Write with no Bash.

Not yet active: needs the review-bot account + token, the review_bot_token
Woodpecker secret, and the `pr-review` cron registered (see file header).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 12:23:01 +02:00
claude-botandClaude Opus 4.8 6807da02be feat(home-assistant): automated rotation of the three HA long-lived tokens
Rotates prometheus-token, config-sync-token and shelly-manager-llat via the
secret-rotator binary's ha-token mode (HA mints/revokes LLATs only over its
WebSocket API). All three tested end-to-end against live HA before shipping.

Network: HA is the first IN-CLUSTER rotation target, so it needs BOTH netpol
halves — the openbao default-deny only permits TCP egress to
openbao/kube-dns/apiserver/world (the external-API rotators ride `world`):
  - home-assistant-rotator-ingress (home-assistant ns): rotator -> HA :8123
  - rotator-home-assistant-egress (openbao ns): the egress complement
Reaches HA on :8123 (HA itself, not the :8124 XFF-anchor proxy) via the
home-assistant-bgp Service ClusterIP; the public name hairpins off the LB.
Both dedicated policies, scoped by the rotator label, not rules on the
namespace-wide default-deny (which would leak to every pod on that port).

Reloader wiring — each token's consumer picks up the new value differently:
  - prometheus-token: Prometheus config-reloader auto-reloads; no restart.
  - shelly-manager-llat: added to shelly-manager's reload annotation (it reads
    the token as a startup env var).
  - config-sync-token: the config-sync sidecar reads it at startup and lives in
    the HA pod, so the HA Deployment gets a reload annotation. This restarts HA
    itself quarterly (04:05, off-hours) — accepted so the full-admin token is
    lifetime-bounded like the others.

The binary identifies the outgoing token by its JWT `iss`, not client_name
(the stored names are misleading — prometheus-token is "ServiceMonitor",
config-sync-token was "laptop local"), mints under a unique name (HA rejects a
duplicate), and revokes the old token over a fresh new-token session.

OpenBao policy/role bootstrapped out-of-band (rotator-home-assistant.hcl,
committed for provenance; not Flux-managed).

Tested: prometheus-token and shelly-manager-llat rotated live end-to-end —
OpenBao updated, ESO synced, consumer restarted/reloaded, old token revoked and
gone, new token authenticates (Prometheus scrape 200 with 22k metrics;
shelly-manager 0 HA-auth errors).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 12:22:51 +02:00
k.renner 3f7aab0c56 Merge pull request 'fix(secret-rotator): revoke old HA token over a new-token session' (#321) from fix/ha-revoke-new-session into master
ci/woodpecker/push/build-ci-images Pipeline was successful
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
Reviewed-on: k.renner/homelab#321
2026-07-21 10:16:11 +00:00
claude-botandClaude Opus 4.8 2e18d68a94 fix(secret-rotator): revoke old HA token over a new-token session
ci/woodpecker/push/build-ci-images Pipeline was successful
Found by running the ha-token rotation end-to-end against live HA. The rotation
was fully correct — new token minted, stored, and the old one revoked — but the
job logged a false "OLD token REMAINS VALID" warning.

Root cause: HA binds a WebSocket session to the refresh token behind its access
token. The rotator authenticated with the OLD token and revoked that same token
over that same session, so HA tore the session down as it processed the delete
— the delete succeeded server-side but the ack could not be read, surfacing as
"connection closed by HA". Verified: after the false-warning run, the old
token's refresh id was already gone from HA.

Fix: after storing the new token, drop the old session and reconnect with the
NEW token to perform the revoke. The session is then not the one being deleted,
so the ack reads cleanly and the report is accurate.

This matters beyond cosmetics: the false warning fired on every successful
rotation, which would train an operator to ignore it — and a genuine revoke
failure would then be indistinguishable noise. With the fix, a warning means a
real un-revoked token.

Verified end-to-end against live HA on a throwaway token: revoke over the new
session returns success=True and the old token is confirmed gone (where the old
flow got "connection closed"). clippy -D warnings clean; 12 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 12:14:55 +02:00
k.renner db6a17cbfd Merge pull request 'fix(secret-rotator): mint HA tokens under a unique name' (#320) from fix/ha-token-unique-name into master
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: k.renner/homelab#320
2026-07-21 10:06:15 +00:00
k.renner 0eca6f5396 Merge pull request 'fix(ci): point automation pipelines at renamed k.renner/homelab repo' (#319) from claude-bot/fix-ci-gitea-repo-path into master
Reviewed-on: k.renner/homelab#319
2026-07-21 10:06:02 +00:00
claude-botandClaude Opus 4.8 30c0e5632a fix(secret-rotator): mint HA tokens under a unique name
ci/woodpecker/push/build-ci-images Pipeline was successful
Found by testing ha-token mode against live HA before wiring up the CronJobs.
Home Assistant refuses to mint a second long-lived access token whose
client_name already exists — and make-before-break necessarily mints while the
outgoing token (same base name) is still present. So every real rotation would
fail at the mint step with "Unknown error", exactly as observed:

  same-name mint   -> FAIL {'code':'unknown_error'}
  unique-name mint -> SUCCESS

The earlier ad-hoc test only passed because it minted a NEW name
("Config Sync") rather than rotating an existing one.

Fix: mint under "<base> [<6 hex>]". Correctness does not depend on the name —
the outgoing token is identified by its JWT `iss`, never by name — so a random
tag is free, and it also avoids colliding with an orphan left by a prior failed
run. The failure mode was safe throughout: mint fails before store or revoke,
so the old token stays valid and stored (a no-op, not an outage).

Verified end-to-end against live HA on a throwaway token: unique mint succeeds,
the outgoing token is found by iss, store patches OpenBao, and the old token is
revoked and stops authenticating.

clippy -D warnings clean; 12 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 12:03:23 +02:00
claude-botandClaude Opus 4.8 86b07d591a fix(ci): point automation pipelines at renamed k.renner/homelab repo
The homelab repo was transferred from owner `gitea_admin` to `k.renner`.
Gitea keeps a 307 redirect for the old path, so git clone/push (which
follow redirects) kept working — but the pipelines' `curl -sf` API reads
do NOT follow redirects, so instead of JSON they received the redirect's
HTML body and the next `jq` died with:

    jq: parse error: Invalid numeric literal at line 1, column 3

Under `set -eu` this failed the step before any issue/PR was created,
which is why every alert-monitor / issue-fix / update-audit / security-scan
cron run has been failing and no alert issues were being filed.

- Replace hardcoded `gitea_admin/homelab` -> `k.renner/homelab` in all
  API bases, git-push URLs, and cron-add doc comments.
- Add `-L` to the read curls that pipe JSON into jq, so a future rename
  degrades gracefully instead of feeding HTML to jq.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 09:18:45 +02:00
k.renner b0de345fc6 Merge pull request 'feat(secret-rotator): Rust rotator binary in a FROM-scratch image' (#318) from feat/secret-rotator-rs into master
ci/woodpecker/push/build-ci-images Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#318
2026-07-21 07:14:42 +00:00
claude-botandClaude Opus 4.8 808cb5397d fix(secret-rotator): HTTP/WS timeouts, entropy floor, orphan-token logging
ci/woodpecker/push/build-ci-images Pipeline was successful
Addresses three review findings, all real bugs rather than style:

1. No timeouts anywhere. The Python this replaces passed timeout=30 on every
   call; ureq 3's default agent has none and tungstenite has no read timeout,
   so a hung endpoint would stall the Job silently until activeDeadlineSeconds
   with no useful error — and the cluster demonstrably has hanging paths (the
   ingress-LB hairpin). Now: a shared ureq::Agent with timeout_global(30s)
   threaded through every OpenBao call, and a 30s read timeout set on the
   TcpStream under tungstenite's socket (handling both plain and rustls
   streams).

2. RANDOM_BYTES=0 would generate a near-empty secret, store it, and report
   success — the same silent-misconfig class assert_fields_exist guards. Now
   floored at 16 bytes (128 bits); every real rotator uses 32 or 50.

3. If mint succeeds but the OpenBao store fails, the freshly minted token is
   valid for its full lifespan, referenced nowhere, and never auto-revoked
   (revocation only targets the OLD stored id). The store error path now logs
   the orphan's refresh-token id — recovered from its own JWT — so it can be
   revoked by hand, and makes clear the consumer is unaffected because the old
   token is still stored and valid.

clippy -D warnings clean; 10 tests pass; scratch image builds (4.92 MB) and
all error paths exit non-zero.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 09:07:52 +02:00
claude-botandClaude Opus 4.8 49b2eaf819 feat(secret-rotator): random mode, replacing the five Class-A rotators
ci/woodpecker/push/build-ci-images Pipeline was successful
paperless, authentik, woodpecker, crowdsec-bouncer-key and shelly-manager all
ran the same shell one-liner:

    head -c <N> /dev/urandom | base64 | tr -d '\n'

so the port has to be byte-compatible, not merely similar: N raw bytes, the
STANDARD base64 alphabet (+ and /, not URL-safe), WITH = padding, no newline.
Consumers store these verbatim and none filter the character set, so quietly
switching to base64url or dropping padding would change the credential shape
for no reason. The encoder is verified against the RFC 4648 vectors, which are
what coreutils base64 produces, plus a case asserting + and / rather than - and _.

BAO_FIELDS is comma-separated and each field gets its own independent value,
written in ONE merge-patch. That preserves shelly-manager's behaviour, where
admin-password and api-key must land together rather than leaving a window
with one rotated and one stale.

Adds assert_fields_exist as a pre-flight guard. Merge-patch CREATES a field
that isn't present, so a typo in BAO_FIELDS would add `secret-ky`, report
success, and leave the real credential un-rotated — a silent no-op that would
only surface during an incident. Rotation only ever replaces existing fields,
so a missing field is now a hard error that names both what is missing and
what is actually there.

Byte lengths preserved from the originals: 50 for the Django-style keys
(paperless, authentik), 32 for the rest.

Module is `secretgen`, not `gen` — the latter is a reserved keyword in the
2024 edition. 11 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 13:47:09 +02:00
claude-botandClaude Opus 4.8 fdf3818ac5 fix(secret-rotator): identify the outgoing token by JWT iss, not client_name
ci/woodpecker/push/build-ci-images Pipeline was successful
Revoking by client_name would have destroyed live credentials. Checked the
three stored HA tokens against auth/refresh_tokens by decoding each one's JWT
iss claim, and the names are not what they look like:

  apps/home-assistant/prometheus-token   -> "ServiceMonitor"
  apps/home-assistant/config-sync-token  -> "laptop local"
  apps/home-assistant/shelly-manager-llat-> "Shelly Manager"

Separate, unrelated "Prometheus" and "Config Reconciler" tokens also exist. A
name-matching rotator pointed at prometheus-token would have revoked
"Prometheus" — a live credential belonging to something else — and left the
actual stored token valid. Same for config-sync.

An HA long-lived access token is a JWT whose iss claim IS its own
refresh-token id, so the outgoing token identifies itself exactly. The
rotator now reads that, confirms with HA that the id really is a long-lived
access token, and refuses to proceed if it is not. No name matching anywhere.

The JWT signature is deliberately not verified: this is not authentication,
only reading which id the token claims, and HA remains the authority via the
auth/refresh_tokens confirmation before any revoke.

Adds a small base64url decoder (payloads are unpadded) with unit tests
covering iss extraction, unpadded decoding, non-JWT input, and a JWT with no
iss. 6 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 13:31:57 +02:00
claude-botandClaude Opus 4.8 d78e703575 feat(secret-rotator): Rust rotator binary in a FROM-scratch image
ci/woodpecker/push/build-ci-images Pipeline was successful
Replaces the inline-Python approach before it grows a tenth copy. Today the
fleet carries ~130 lines of Python embedded in YAML strings across 9 manifests,
with auth/kubernetes/login duplicated in all 9 and the call()/merge-patch
helpers in 4 — none of it lintable, testable, or reviewable as code.

The Home Assistant rotator would have been the worst of them: a hand-rolled
WebSocket handshake with frame masking inside a YAML string. HA mints
long-lived access tokens only over its WebSocket API (verified against
2026.7.2 — auth/long_lived_access_token and auth/delete_refresh_token both
exist; the REST API has no equivalent).

Ships as a static musl binary in FROM scratch: 4.85 MB, one file, no libc, no
shell, no package manager. Nothing to patch and nothing for a compromised
rotator to exec. rustls with webpki-roots compiles the trust store into the
binary, so TLS works without a CA bundle on disk — in-cluster traffic is plain
HTTP, but that keeps the door open to take over the Cloudflare and Proxmox
rotators.

ha-token mode is make-before-break, and the ordering is load-bearing: list
existing token ids for the client_name BEFORE minting (so the new token can
never land in the revocation set), mint, write to OpenBao, and only then
revoke. If the OpenBao write fails, the old token is still valid and still
stored, so the run is a no-op rather than an outage.

A failed revoke is deliberately non-fatal but logged loudly: the new token is
already live, and a token meant to be retired that is still valid is a real
finding, not noise.

Verified: static-pie linked and stripped; image contains only the binary
(3.2 MB binary, 4.85 MB image); /bin/sh absent; exits non-zero on usage error;
cargo test passes. The pipeline path trigger now includes secret-rotator/**,
without which source changes would silently not rebuild the image.

No CronJob uses it yet — the Home Assistant rotator needs a network decision
first: the home-assistant namespace is default-deny-ingress, so openbao cannot
reach it, and the public name hairpins off the ingress LB.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 12:14:39 +02:00
k.renner 756edc4060 Merge pull request 'fix(edge-host): restore IPv6 addressing on the VLAN 40 sub-interface' (#316) from claude-bot/edge1-vlan40-ipv6 into master
ci/woodpecker/cron/update-audit Pipeline failed
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#316
2026-07-19 20:24:47 +00:00
claude-botandClaude Opus 4.8 d465de603e fix(edge-host): restore IPv6 addressing on the VLAN 40 sub-interface
The previous config set IPv6AcceptRA=false on enp1s0.40, which left the
interface with only a link-local address and made edge-1 unreachable over IPv6
on the service VLAN. IPv6 is the primary address family on this network, so
suppressing it to guard against a routing problem in the legacy family was the
wrong trade.

The concern that motivated it was real -- a second default route from the VLAN
40 lease would make return traffic asymmetric across the two VLANs -- but it
only required suppressing the default route and DNS, not addressing itself.
RAs are now accepted with [IPv6AcceptRA] UseGateway=false and UseDNS=false,
mirroring what UseRoutes=false and UseDNS=false already do for DHCPv4. Both
options verified present in systemd 261 (UseGateway added in v250).

Verified after applying to edge-1:
  - enp1s0.40 now holds fd40::/64 and 2003:d6:9717:a702::/64 alongside
    10.2.40.153/24
  - exactly one IPv6 default route, still via enp1s0 (VLAN 30)
  - exactly one IPv4 default route, still via 10.2.30.1 on enp1s0
  - no DNS servers on the VLAN 40 link
  - chronyd and keepalived unaffected

Separately discovered and NOT addressed here: all four NTP servers bind only
0.0.0.0:123, so the service has no IPv6 listener at all -- this predates edge-1
and affects jupiter, saturn and neptune equally. No -4 flag is set and IPv6 is
not disabled in the kernel; the cause is not yet determined.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 22:23:51 +02:00
k.renner 0ca9635d4b Merge pull request 'feat(ntp): extend NTP roles to edge-1, restore keepalived-ntp' (#315) from claude-bot/ntp-edge-1 into master
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#315
2026-07-19 20:05:44 +00:00
claude-botandClaude Opus 4.8 f29ab51bf1 feat(ntp): enable keepalived on edge-1
The VLAN 40 prerequisite is now in place and verified: enp1s0.40 is up with a
DHCP lease of 10.2.40.153/24, and both jupiter (10.2.40.201) and the VIP
(10.2.40.4) answer at ~0.5ms over that interface, confirming layer-2 adjacency
with the existing VRRP members.

NOT APPLIED. The playbook run was blocked pending authorisation, so edge-1
currently has chronyd active and serving but keepalived not installed and the
VIP not held. Applying this flag is what actually joins the VRRP group.

Expected on apply: edge-1 comes up BACKUP at priority 70, below neptune's 80,
so the VIP stays with jupiter. The failure mode to watch for is edge-1 not
seeing the existing advertisements, concluding it is alone, and claiming
10.2.40.4 -- a duplicate holder of the address ~150 clients use. Verify
immediately after applying that edge-1 is BACKUP and does not hold the VIP,
and stop keepalived if it does.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 21:50:09 +02:00
claude-botandClaude Opus 4.8 6928448cbe feat(edge-host): add tagged VLAN 40 sub-interface
Prerequisite for enabling keepalived on edge-1: VRRP needs layer-2 adjacency
with the other NTP members on the service VLAN, and the host has only untagged
VLAN 30. The switch port already permits VLAN 40.

Built to be additive and revertible, because enp1s0 is this headless host's
only path to the network:

  - The parent's 20-wired.network is not edited. The VLAN is attached through
    a 20-wired.network.d/ drop-in instead, so reverting is deleting three paths.
  - The VLAN .network sorts before 20-wired.network and matches explicitly on
    Name=. 20-wired.network matches broadly on Type=ether; a VLAN link types as
    'vlan' rather than 'ether' (confirmed against networkctl output) so it
    should not match anyway, but ordering makes that belt-and-braces.
  - UseRoutes, UseDNS, UseNTP and IPv6AcceptRA are all disabled on the VLAN.
    Taking a second default route and DNS from the VLAN 40 lease would make
    return traffic asymmetric across the two VLANs; untagged VLAN 30 stays the
    only default route.

Tasks are tagged vlan40 so they can be applied without running the whole
edge-host role, which would restart the Z-Wave, open3e and alloy services.

Reconfiguring the parent link is what materialises the VLAN child -- a bare
networkctl reload leaves existing links untouched -- so the handler does that
explicitly. That re-runs DHCP on enp1s0 and is the one genuinely risky step;
worth running with console access to hand.

Not yet applied: the apply was blocked pending authorisation, so edge-1 remains
in its original network state with only 20-wired.network and 80-can0.network.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 21:44:10 +02:00
claude-botandClaude Opus 4.8 53ebbdf0ae feat(ntp): extend NTP roles to edge-1, restore keepalived-ntp
The three PVE hosts currently serve NTP to ~150 LAN clients via chrony with
keepalived holding VIP 10.2.40.4, handed out by UniFi DHCP option 42. Talos
cannot run either daemon, so the planned bare-metal migration removes this
role entirely. edge-1 is brought into the NTP group to take it over.

chrony-ntp-server gains Debian/Arch support. The two distros differ in three
ways that would each have broken on edge-1: config path (/etc/chrony/chrony.conf
vs /etc/chrony.conf), unit name (chrony vs chronyd), and service user (_chrony
vs chrony). Arch also ships no /var/lib/chrony or /var/log/chrony, deferring
them to tmpfiles.d, so the role now creates them explicitly rather than relying
on pacman hook ordering. systemd-timesyncd is stopped where present, since
edge-1 runs it today and it contends with chrony for the clock.

keepalived-ntp is restored -- install-ntp-ha.yml referenced it but the role was
absent from master, so the playbook could not resolve. Recovered from the
homelab-migration-summary worktree with three fixes:

  - The health check hardcoded `systemctl is-active chrony`. On Arch that unit
    does not exist, so every check would fail, parking the host in permanent
    FAULT so it never takes the VIP -- surfacing only at cutover, once the PVE
    nodes were already gone. The unit name is now templated.
  - Install branches on os_family. Config path and unit name are identical
    across distros here, unlike chrony, so nothing else needed changing.
  - The sysctl list is now a variable. It unconditionally set
    net.ipv4.ip_forward=1, which is correct on the hypervisors but would make
    edge-1 a router between IoT VLAN 30 and service VLAN 40 once the tagged
    interface exists, bypassing the UDM's inter-VLAN policy. edge_host keeps
    only ip_nonlocal_bind; VRRP does not need forwarding.

The two roles have different reach by design. chrony runs everywhere: edge-1
serves from its VLAN 30 address (10.2.30.108) and `allow 10.2.0.0/16` plus
inter-VLAN routing covers every client, so no network reconfiguration is
needed. keepalived is gated on ntp_keepalived_enabled, currently false for
edge-1, because VRRP needs layer-2 adjacency on VLAN 40 and the host has no
enp1s0.40 yet -- the switch port permits the VLAN but /etc/systemd/network/
has no matching .netdev/.network pair.

edge-1's keepalived priority is 70, the lowest, so it stays BACKUP while the
PVE nodes exist and wins the VIP by default once they are gone, with no
config change at cutover.

Verified: playbook syntax-checks; ntp_cluster resolves to the four hosts;
Arch paths confirmed against the package file list. Not yet run against any
host, and runtime var resolution is unverified (needs the vault password).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 21:26:57 +02:00
k.renner 1637a178b5 Merge pull request 'feat(external-dns): automated Cloudflare token rotation' (#314) from feat/external-dns-token-rotation into master
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#314
2026-07-19 12:36:34 +00:00
k.renner 71b86e8558 Merge pull request 'fix(pve): accept IPv6 RAs on forwarding nodes, converge vmbr0 MTU' (#313) from claude-bot/pve-node-network-ipv6-mtu into master
Reviewed-on: k.renner/homelab#313
2026-07-19 12:36:17 +00:00
claude-botandClaude Opus 4.8 6f0c9eda5d feat(external-dns): automated Cloudflare token rotation
external-dns was the last Cloudflare consumer without rotation automation. It
now holds a dedicated single-zone token, so it can roll like the cert-manager
one: PUT /user/tokens/{id}/value keeps scope and policy, changes the value.

Unlike the cert-manager rotator, this needs Reloader — external-dns reads
CF_API_TOKEN as a startup env var. The annotation added in #311 is exercised
by this job and confirmed working: Reloader restarted the Deployment 10s after
the Secret changed, with no manual intervention.

Reuses the existing cloudflare bootstrap so the admin-token lives in one place,
but pins a SEPARATE token-id (external-dns-token-id) so the two tokens roll
independently. Verified: rolling external-dns left the cert-manager token
untouched and all 27 Certificates True.

ExternalSecret refresh 1h -> 10m to match the rest of the rotation fleet.

Tested end-to-end: job completed in 5s, OpenBao patched, ESO synced, Reloader
restarted the pod automatically, external-dns resumed with 0 errors, and the
stored value verifies as the correct active token with no trailing newline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 14:31:05 +02:00
k.renner a2f26c8947 Merge pull request 'docs(external-dns): correct the Reloader annotation-placement claim' (#312) from fix/reloader-annotation-comment into master
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#312
2026-07-19 12:26:16 +00:00
claude-botandClaude Opus 4.8 2d6452650f fix(pve): accept IPv6 RAs on forwarding nodes, converge vmbr0 MTU
Live inspection of the PVE cluster on 2026-07-19 found two defects.

1. No IPv6 address on any external interface, on all three nodes.

   /etc/frr/frr.conf enables "ipv6 forwarding" for the OSPFv3 Thunderbolt
   mesh that carries corosync, which sets net.ipv6.conf.all.forwarding=1.
   The kernel default accept_ra=1 means "accept RAs only while NOT
   forwarding", so the nodes silently discarded the Router Advertisements
   the gateway sends on VLAN 40. Every external interface was left with
   only a link-local address; the sole non-link-local IPv6 anywhere on the
   nodes was the corosync mesh /128, which is static in frr.conf and never
   depended on RAs.

   Verified the gateway is not at fault: RAs arrive on vmbr1.40 from
   fe80::265a:4cff:fea6:fd3c every ~10-15s, carrying both the Telekom GUA
   prefix and a ULA, and non-forwarding hosts on the LAN autoconfigure
   normally. The PVE nodes are the only hosts running FRR.

   Fixed with a sysctl drop-in setting accept_ra=2, the value a forwarding
   host needs in order to still autoconfigure its own uplink.

2. saturn's vmbr0 is at MTU 1500 while its own uplink enp2s0f0np0 and both
   peer nodes' bridges are at 9000. Since the three bridges share one L2
   domain, large frames between saturn's guests and the other nodes' guests
   blackhole rather than fragmenting. saturn's vmbr0 stanza is simply
   missing the mtu line that jupiter and neptune both have.

The two fixes are separated by risk. The sysctl change is non-disruptive
and applies on every run. The MTU change is staged as a pending PVE network
change and applied only when pve_node_network_apply_pending is set, because
applying it reloads networking on the node and briefly interrupts the Talos
k8s VM and its Ceph OSD. The play uses serial: 1 so nodes converge one at a
time.

The MTU task reconstructs the full bridge definition from a pvesh GET before
issuing the PUT. A PUT on /nodes/<node>/network/<iface> replaces rather than
merges, so passing only --mtu would silently drop bridge_ports,
bridge_vlan_aware and bridge_vids, detaching the uplink and flattening every
SDN VNet.

Not applied yet — no run has been made against the cluster.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 14:21:01 +02:00
claude-botandClaude Opus 4.8 9e9851f77d docs(external-dns): correct the Reloader annotation-placement claim
The previous comment asserted the annotation "must" sit on the Deployment
rather than the pod template. That is wrong. An A/B test (two identical
Deployments consuming one Secret, differing only in annotation placement)
showed Reloader acting on BOTH within 10s, naming each in its log.

deploymentAnnotations is still used here, but only to match the prevailing
idiom in this repo — not because pod-template annotations are ineffective.
This also clears the suspicion raised against authentik-server,
authentik-worker and crowdsec-lapi: their placement is fine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 14:19:34 +02:00
k.renner b86d879f86 Merge pull request 'fix(external-dns): dedicated Cloudflare token + reload on rotation' (#311) from feat/external-dns-dedicated-token into master
Reviewed-on: k.renner/homelab#311
2026-07-19 12:16:53 +00:00
claude-botandClaude Opus 4.8 661af32aea fix(external-dns): reload on Cloudflare token change
external-dns was moved off the shared 4-zone "Caddy" Cloudflare token onto a
dedicated single-zone token (Kubernetes External-DNS: Zone Read + DNS Write on
renner.uno only). Rotating that Secret alone is not enough: external-dns reads
CF_API_TOKEN as an env var at startup, so it kept serving with the old token
until the pod happened to restart. During this cutover that restart had to be
done by hand.

Add the Reloader annotation via deploymentAnnotations so a future rotation
restarts the Deployment automatically.

Placement matters: the annotation goes on the Deployment, not the pod template.
Reloader has only ever been observed acting on workload-level annotations in
this cluster (woodpecker, paperless, netbird-ingress, pve-exporter); the chart
exposes deploymentAnnotations for exactly this.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 11:41:07 +02:00
k.renner 6ca65e5a7a Merge pull request 'feat(proxmox): enable pve-exporter token rotation after end-to-end test' (#310) from feat/pve-rotation-enable into master
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/security-scan Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#310
2026-07-19 09:16:32 +00:00
claude-botandClaude Opus 4.8 fbc3c64969 feat(proxmox): enable pve-exporter token rotation after end-to-end test
#306 landed suspended pending a privsep check and a bootstrap credential.
Both are now done and the job is verified, so enable the schedule.

privsep caveat RESOLVED: pve-exporter@pve!monitoring is privsep=0 and its
ACL (/ -> PVEAuditor) is on the USER, not the token. DELETE+re-create with
privsep=0 therefore loses no permission and needs no ACL re-grant.

Bootstrap credential is a dedicated least-privilege PVE identity rather than
root@pam. PVE rejects per-user ACL paths and authorises the token endpoints
via a userid-group check, so the tightest available scope is a group whose
only member is the target user:

  role SecretRotator (User.Modify)
  user secret-rotator@pve
  ACL  /access/groups/secret-rotated -> SecretRotator

Verified it can mint/delete pve-exporter tokens, sees no VMs or storage,
and gets 403 minting a root@pam token.

api-url is the in-cluster Service (all three nodes back it). The external
name pve.renner.uno cannot be used from a pod: pods cannot hairpin to their
own cluster's ingress LB, which hangs the job. A node IP or single node
FQDN would be a needless SPOF.

Tested: two full rotations; OpenBao patched, ESO synced, Reloader restarted
the exporter, pve_up returned 1.0 for all three nodes both times.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 11:10:05 +02:00
k.renner 7ec7eb8929 Merge pull request 'feat(proxmox): automated pve-exporter token rotation (Class-B) — SUSPENDED/UNTESTED' (#306) from feat/pve-exporter-token-rotation into master
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#306
2026-07-19 08:34:49 +00:00
k.renner f57d954b89 Merge pull request 'fix(cloudflare-rotation): enable — tested; pinned to the dedicated cert-manager token' (#309) from fix/cloudflare-rotation-enable into master
Reviewed-on: k.renner/homelab#309
2026-07-19 08:32:52 +00:00
claude-botandClaude Opus 4.8 1f40366c48 fix(cloudflare-rotation): enable — tested; pinned to the dedicated cert-manager token
Staged verification found cert-manager was using an unrelated 4-zone token named 'Caddy' (renner.uno + 3 personal zones, shared with something outside this repo), not the dedicated 'Kubernetes Cert-Manager' token that already existed (renner.uno only). Switched cert-manager to the dedicated token and pinned the rotation token-id to it, so Caddy is never rolled. Net: cert-manager drops write access to 3 personal zones.
Verified end-to-end: job rolls token af708481, OpenBao rotates, rolled token stays active/same scope, ESO syncs, cert-manager writes the DNS-01 TXT record (publicly resolvable), 27/27 prod certs Ready. suspend: false.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-19 10:31:15 +02:00
claude-bot 5a7b122157 Merge remote-tracking branch 'origin/master' into feat/pve-exporter-token-rotation
# Conflicts:
#	kubernetes/infrastructure/openbao/rotation/kustomization.yaml
2026-07-19 09:55:56 +02:00
k.renner 2d57420e1b Merge pull request 'feat(cloudflare): automated api-token rotation (Class-B) — SUSPENDED/UNTESTED' (#305) from feat/cloudflare-token-rotation into master
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#305
2026-07-19 07:54:41 +00:00
claude-botandClaude Opus 4.8 fd85dbb901 fix(proxmox-rotation): python:alpine (apk fails non-root; lesson from netbird test)
Same fix proven on netbird (#307/#308): alpine+apk -> python:3.13-alpine stdlib so it runs under the non-root restricted PSA. Uses a dedicated no-verify SSL context for the self-signed Proxmox API only (OpenBao stays plain http). Still suspended + untested; the privsep=0 caveat + brief monitoring gap on DELETE+recreate remain documented in the header.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-19 09:13:55 +02:00
claude-bot 3d6caa75bf merge master (netbird kustomization) 2026-07-19 09:13:55 +02:00
claude-botandClaude Opus 4.8 20a1998b95 fix(cloudflare-rotation): python:alpine (apk fails non-root; lesson from netbird test)
Applies the same fix proven on netbird (#307/#308): switch alpine+apk to python:3.13-alpine stdlib so the job runs under the non-root restricted PSA. CF's roll is in-place (PUT /tokens/{id}/value) so no key-settings pitfall like netbird had. Still suspended + untested (needs the bootstrap admin-token + token-id).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-19 09:12:24 +02:00
claude-bot 589f0e0f0b merge master (netbird kustomization) 2026-07-19 09:12:24 +02:00
k.renner 084644da43 Merge pull request 'fix(netbird-rotation): match key settings (ephemeral+dns), fill group, enable' (#308) from fix/netbird-rotation-key-settings into master
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#308
2026-07-19 07:08:02 +00:00
claude-botandClaude Opus 4.8 bbdd488710 fix(netbird-rotation): match key settings (ephemeral+dns), fill group, enable
Testing #304 end-to-end revealed the minted setup key had the WRONG settings vs the ingress key: ephemeral=false (should be true — peers must be auto-reaped; these DaemonSet peers re-enroll fresh each restart) and allow_extra_dns_labels=false (should be true — the DNS capability). Remediated live and fixed the payload:
- add ephemeral: true, allow_extra_dns_labels: true to the setup-keys POST.
- NB_AUTO_GROUPS = d8umic2oc9cs73d4e1f0 (k8s-ingress-router).
- KEEP the 1y expiry (intentional: an auto-rotated key should expire so a broken rotation surfaces — do NOT match the original's never-expire).
- suspend: false (tested + enabled).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-19 09:06:50 +02:00
k.renner 30561a62a3 Merge pull request 'fix(netbird-rotation): use python:alpine — apk install fails under non-root PSA' (#307) from fix/class-b-rotation-image into master
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#307
2026-07-19 06:48:43 +00:00
claude-botandClaude Opus 4.8 71c4b33374 fix(netbird-rotation): use python:alpine (apk install fails under non-root PSA)
Testing #304 revealed the runtime 'apk add curl jq' fails ('Unable to lock database: Permission denied') because the job runs non-root (runAsUser 65534) and the openbao ns enforces restricted PSA — apk needs root. Switch to python:3.13-alpine and do the HTTP/JSON via stdlib (urllib/json), no package install, non-root-safe. Same fix must be applied to the still-open cloudflare (#305) and proxmox (#306) Class-B jobs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-19 08:45:13 +02:00
k.renner ea9eed7216 Merge pull request 'feat(netbird): automated setup-key rotation (Class-B, openbao-ns) — SUSPENDED/UNTESTED' (#304) from feat/netbird-setup-key-rotation into master
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#304
2026-07-19 06:38:32 +00:00
claude-botandClaude Opus 4.8 69ecab3a06 feat(proxmox): automated pve-exporter token rotation (Class-B, openbao-ns) — SUSPENDED
Rotates pve-exporter@pve!monitoring via the Proxmox API. Proxmox has no in-place secret roll, so DELETE+re-create (privsep=0), regenerate pve.yml with the new token_value, patch OpenBao. openbao-ns pattern; per-secret rotator-proxmox role reads a bootstrap privileged Proxmox token + patches pve-exporter-config. refreshInterval 1h->10m; Reloader restarts pve-exporter.
SHIPPED SUSPENDED + UNTESTED (riskiest Class-B): needs a bootstrap privileged Proxmox token at homelab/infrastructure/secret-rotators-bootstrap/proxmox, VERIFICATION that the token uses privsep=0 (else re-grant its ACL after re-create), and awareness of the brief monitoring gap during DELETE+create. Test before spec.suspend=false.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-19 00:11:22 +02:00
claude-botandClaude Opus 4.8 0ddef38d31 feat(cloudflare): automated api-token rotation (Class-B, openbao-ns) — SUSPENDED
Rolls the cert-manager DNS-01 Cloudflare token in place (PUT /user/tokens/{id}/value) then patches OpenBao. openbao-ns pattern; per-secret rotator-cloudflare role reads a bootstrap admin-token+token-id and patches the api-token path. refreshInterval 1h->10m; no Reloader (cert-manager reads fresh per challenge).
SHIPPED SUSPENDED + UNTESTED: needs the bootstrap admin-token (Edit User API Tokens perm) + the cert-manager token-id provisioned to homelab/infrastructure/secret-rotators-bootstrap/cloudflare, then a manual test (issue/renew a cert) before spec.suspend=false. Risk: a bad roll breaks TLS issuance.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-19 00:08:32 +02:00
claude-botandClaude Opus 4.8 1fc2f84b74 feat(netbird): automated setup-key rotation (Class-B, openbao-ns) — SUSPENDED
First Class-B rotation: calls the self-hosted NetBird mgmt API to mint a fresh reusable setup key, then patches OpenBao (ESO syncs, Reloader restarts the netbird-ingress DaemonSet to re-enroll). openbao-ns pattern; per-secret rotator-netbird role/policy that reads a bootstrap NetBird PAT + patches the setup-key path. refreshInterval 1h->10m.
SHIPPED SUSPENDED + UNTESTED: needs (1) the bootstrap PAT provisioned to homelab/infrastructure/secret-rotators-bootstrap/netbird, (2) NB_AUTO_GROUPS filled with real NetBird group IDs, (3) a manual on-demand test, before spec.suspend is set false. Class-B template for the cloudflare + proxmox rotations to follow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-19 00:06:29 +02:00
gitea_admin b173f64976 Merge pull request 'feat(crowdsec): automated bouncer-key rotation (openbao-ns)' (#303) from feat/crowdsec-bouncer-key-rotation into master
ci/woodpecker/cron/update-all Pipeline failed
ci/woodpecker/cron/e2e Pipeline failed
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#303
2026-07-18 21:27:05 +00:00
claude-bot 61456ddccc Merge remote-tracking branch 'origin/master' into feat/crowdsec-bouncer-key-rotation
# Conflicts:
#	kubernetes/infrastructure/openbao/rotation/kustomization.yaml
2026-07-18 23:26:42 +02:00
claude-bot 6d28ab21ea Merge remote-tracking branch 'origin/master' into feat/crowdsec-bouncer-key-rotation
# Conflicts:
#	kubernetes/infrastructure/openbao/rotation/kustomization.yaml
2026-07-18 23:24:43 +02:00
k.renner d09d458235 Merge pull request 'feat(authentik): automated SECRET_KEY rotation (openbao-ns)' (#302) from feat/authentik-secret-rotation into master
Reviewed-on: k.renner/homelab#302
2026-07-18 21:24:32 +00:00
claude-bot 0443107992 Merge remote-tracking branch 'origin/master' into feat/authentik-secret-rotation
# Conflicts:
#	kubernetes/infrastructure/openbao/rotation/kustomization.yaml
2026-07-18 23:24:06 +02:00
k.renner e0e42f763e Merge pull request 'feat(shelly-manager): automated auth-secret rotation (openbao-ns)' (#301) from feat/shelly-manager-auth-rotation into master
Reviewed-on: k.renner/homelab#301
2026-07-18 21:20:38 +00:00
claude-botandClaude Opus 4.8 ad5ea965e3 feat(crowdsec): automated bouncer-key rotation (openbao-ns)
Rotates crowdsec-bouncer-key:key quarterly + on-demand via the openbao-ns pattern (per-secret rotator-crowdsec-bouncer role/policy, no netpol). Self-sync: the single KV path feeds both the crowdsec + ingress ns Secrets; Reloader restarts crowdsec-lapi. Both ExternalSecrets refreshInterval 1h->10m.
CAVEAT handled: traefik/crowdsec-middleware.yaml has a THIRD hardcoded copy of this key (not Secret-sourced) — that middleware is inert, and a loud guard comment now warns it must be refreshed from OpenBao before re-enabling. Requires the one-time OpenBao bootstrap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-18 22:09:16 +02:00
claude-botandClaude Opus 4.8 dc42781a47 feat(authentik): automated SECRET_KEY rotation (openbao-ns)
Rotates authentik-secrets:secret-key (Django signing key) quarterly + on-demand via the openbao-ns pattern (per-secret rotator-authentik role/policy, no netpol). Self-sync 2-sided: server + worker read the same secret; Reloader restarts both via global.podAnnotations. smtp-password in the same KV entry is preserved. externalsecret refreshInterval 1h->10m. BLAST RADIUS: invalidates active SSO sessions + in-flight signed links (re-login); downstream LDAP/proxy outposts unaffected. Requires the one-time OpenBao bootstrap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-18 22:06:58 +02:00
claude-botandClaude Opus 4.8 5c0412b86a feat(shelly-manager): automated auth-secret rotation (openbao-ns)
Rotates shelly-manager-auth (admin-password + api-key) quarterly + on-demand via the openbao-ns pattern (per-secret rotator-shelly-manager role/policy, no netpol). Reloader restarts shelly-manager; externalsecret refreshInterval 1h->10m. Requires the one-time OpenBao bootstrap (rotator-shelly-manager.hcl).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-18 22:04:00 +02:00
k.renner 9254eb04b7 Merge pull request 'feat(paperless): automated secret-key rotation (openbao-ns pattern)' (#300) from feat/paperless-secret-rotation into master
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#300
2026-07-18 19:45:21 +00:00
claude-botandClaude Opus 4.8 2fa3e7738f refactor(woodpecker): migrate secret rotation to openbao-ns pattern, drop netpol
Moves the WOODPECKER_AGENT_SECRET rotation from the apps namespace to the openbao namespace (matching the new paperless prototype), so it reaches OpenBao intra-namespace:
- openbao/rotation/woodpecker.yaml: SA + CronJob now in openbao ns, per-secret role rotator-woodpecker.
- openbao/policies/rotator-woodpecker.hcl: replaces the shared rotator policy (retired); per-secret least-privilege.
- REVERTS the #299 netpol pair (apps egress + openbao ingress) — no longer needed intra-ns.
- deletes apps/woodpecker/rotate-agent-secret.yaml and the old rotator.hcl.
server.yaml/agent.yaml (Reloader annotations) and externalsecret.yaml (10m) are unchanged.
Bootstrap: create rotator-woodpecker role/policy in openbao and delete the old rotator role/policy (documented in rotator-woodpecker.hcl).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-18 21:35:47 +02:00
claude-botandClaude Opus 4.8 ab6589aced feat(paperless): automated secret-key rotation (openbao-ns pattern)
First fan-out of the secret-rotation pattern proven on woodpecker, now using the cleaner openbao-namespace design: the rotation Job runs in the openbao ns so it reaches OpenBao intra-namespace — NO NetworkPolicy edits needed (unlike woodpecker's apps-ns job). Per-secret isolation: its own scoped policy+role (rotator-paperless) so a compromised job can only touch the paperless KV path.
- openbao/rotation/paperless.yaml: SA + quarterly/on-demand CronJob (openbao ns) that bao kv patch's secret-key at homelab/apps/paperless (DB creds preserved).
- openbao/policies/rotator-paperless.hcl: least-privilege policy (manual bootstrap, documented in-file).
- paperless.yaml: reloader annotation; externalsecret.yaml: refreshInterval 1h->10m.
Rotating the Django SECRET_KEY invalidates paperless sessions (re-login); no data loss. Requires the one-time OpenBao bootstrap before first run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-18 21:29:49 +02:00
k.renner 9cc0a42134 Merge pull request 'fix(netpol): allow woodpecker secret-rotator to reach OpenBao' (#299) from fix/woodpecker-rotator-openbao-netpol into master
ci/woodpecker/cron/alert-monitor Pipeline failed
ci/woodpecker/cron/issue-fix Pipeline failed
Reviewed-on: k.renner/homelab#299
2026-07-18 19:17:11 +00:00
claude-botandClaude Opus 4.8 687e022e9f fix(netpol): allow woodpecker secret-rotator to reach OpenBao
The woodpecker-secret-rotate CronJob (#297) runs in ns apps and could not reach OpenBao (i/o timeout on auth/kubernetes/login) — blocked on BOTH sides: apps is egress-default-deny (no openbao allow) and openbao is ingress-default-deny (rotator not allowlisted). The snapshot job avoids this by living in the openbao ns; ESO is explicitly allowlisted.
- default-deny.yaml (apps egress): namespace-wide allow to openbao:8200, scoped in effect by openbao's ingress (mosquitto pattern).
- openbao-ns.yaml (openbao ingress): scoped allow from the rotator pod labels (apps/woodpecker/secret-rotator) — the real security boundary.
Verified apps has no other blocking egress; kustomize build + yamllint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-18 20:57:27 +02:00
k.renner 92146ffb5c Merge pull request 'feat(woodpecker): automated WOODPECKER_AGENT_SECRET rotation (OpenBao + ESO + Reloader)' (#297) from feat/woodpecker-secret-auto-rotation into master
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: k.renner/homelab#297
2026-07-18 18:38:19 +00:00
k.renner 1f67d1d081 Merge pull request 'feat(monitoring): woodpecker secret-rotation convergence alerts' (#298) from feat/woodpecker-rotation-alerts into master
Reviewed-on: k.renner/homelab#298
2026-07-18 18:37:55 +00:00
claude-botandClaude Opus 4.8 a3dc001361 feat(monitoring): woodpecker secret-rotation convergence alerts
Closes the H2 gap from the rotation PR (#297) adversarial review: the rotation Job is fire-and-forget, so a downstream failure (ESO/Reloader/pod-reschedule) yields a green Job with no signal. ESO metrics aren't scraped here, so these are kube-state-metrics based:
- WoodpeckerServerNotReady (critical): server StatefulSet 0 ready for 20m.
- WoodpeckerAgentNotReady (warning): agent Deployment 0 available for 20m.
- WoodpeckerSecretRotationJobFailed (warning): named signal for a failed rotation Job (e.g. missing OpenBao bootstrap).
- WoodpeckerSecretRotationStale (warning): quarterly CronJob hasn't succeeded in >100d; absent-until-first-success so it can't false-fire early.
Independent of #297: readiness alerts are useful immediately; the Job/CronJob series stay empty until that PR merges.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-18 20:32:56 +02:00
claude-botandClaude Opus 4.8 142ff676bb fix(woodpecker-rotation): address adversarial review (pin Reloader, doc gaps)
- H1: pin Reloader chart >=1.0.0 <2.0.0 (was open upper bound; a cluster-wide restart-authority controller must not float across majors — repo pinning discipline).
- M2: correct the restart-downtime comment (server StatefulSet is unavailable for tens of seconds, not 'within seconds').
- M1: note the on-demand/emergency rotation runs during incidents (the 'outside CI hours' safety doesn't apply there).
- H2: document the no-convergence-check limitation + follow-up (add rollout/health check or alert before scaling the pattern).
- L1: correct rotator.hcl rationale — native 'bao kv patch' is a server-side merge, needs no client read-modify; 'read' is surplus.
- L2: warn against token_no_default_policy=true (breaks the kv-v2 preflight).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-18 15:12:34 +02:00
claude-botandClaude Opus 4.8 646bbf41e4 feat(woodpecker): automated WOODPECKER_AGENT_SECRET rotation (OpenBao + ESO + Reloader)
End-to-end cluster-internal rotation of the shared server<->agent gRPC secret, no per-rotation human step:
- rotate-agent-secret.yaml: quarterly CronJob (+ on-demand) logs into OpenBao via k8s-auth role 'rotator', generates a random value, bao kv patch's homelab/apps/woodpecker (Gitea OAuth fields untouched).
- infrastructure/reloader: Stakater Reloader restarts annotated workloads on Secret change.
- server.yaml/agent.yaml: reloader annotation for woodpecker-secret.
- externalsecret.yaml: refreshInterval 1h -> 10m so a rotation propagates within ~10m.
- openbao/policies/rotator.hcl: least-privilege policy (patch on the one path only); NOT Flux-applied, one-time manual bootstrap documented in-file (eso-read.hcl convention).

PoC scope: woodpecker only. Requires a one-time OpenBao bootstrap (rotator policy + role) before the CronJob succeeds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-18 14:46:21 +02:00
security-bot eaa0988dd4 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784370668
ci/woodpecker/cron/e2e Pipeline was successful
ci/woodpecker/cron/security-scan Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Updates managed by image-automation-controller.
2026-07-18 11:02:42 +00:00
k.renner f75e6aa6ac Merge pull request 'fix(monitoring): scrape pve via Service VIP + node FQDNs, no hardcoded IPs' (#296) from claude-bot/pve-cluster-vip-target into master
ci/woodpecker/cron/issue-fix Pipeline failed
ci/woodpecker/cron/alert-monitor Pipeline failed
Reviewed-on: gitea_admin/homelab#296
2026-07-17 18:29:44 +00:00
claude-botandClaude Opus 4.8 74f387f185 fix(monitoring): use node FQDNs for pve-node scrape, drop raw IPs
No hardcoded IP remains in the pve scrape config: the node job now
targets jupiter/neptune/saturn.renner.uno. instance label reads the
hostname, and a renumbered node follows DNS without a config edit.

Verified: exporter returns node-local metrics when targeted at
jupiter.renner.uno from inside the cluster.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-17 20:23:56 +02:00
claude-botandClaude Opus 4.8 26aadd0629 fix(monitoring): scrape pve cluster metrics via Service VIP, not a fixed node
The pve cluster-collector job hardcoded 10.2.40.201, so cluster-wide
metrics (pve_up, guest info, storage) paused whenever jupiter
specifically was down, even with the cluster healthy. Point it at the
pve Service DNS (pve.apps.svc.cluster.local) whose EndpointSlice
load-balances the PVE API across all three nodes, so the scrape
follows whichever node is up. Node-local job keeps the three explicit
targets — it needs per-node identity.

Verified: exporter returns pve_up for cluster + all nodes when
targeted at the Service DNS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K7gLUVVnutvDnzV2TrMRJ
2026-07-17 20:22:35 +02:00
security-bot 46e35a824d chore(image-automation): bump ghcr.io/music-assistant/server:2.9.9
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-17 18:03:01 +00:00
security-bot 81f3e764b1 chore(image-automation): bump netbirdio/netbird:v0.74.7-rootless
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-17 14:58:46 +00:00
k.renner cbe30ed119 Merge pull request 'fix(home-security): repair alarm stats, curate sensor lists, dedup batteries' (#282) from claude-bot/dash-home-security into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#282
2026-07-17 13:18:07 +00:00
k.renner bf534e3f45 Merge pull request 'fix(postgresql-overview): scrape CNPG metrics and rewrite dead pg_* queries' (#286) from claude-bot/dash-postgresql-overview into master
Reviewed-on: gitea_admin/homelab#286
2026-07-17 13:17:58 +00:00
k.renner fa1b526fe4 Merge pull request 'fix(proxmox-cluster): dedupe 3x-scraped series, repair broken panels' (#287) from claude-bot/dash-proxmox-cluster into master
Reviewed-on: gitea_admin/homelab#287
2026-07-17 13:17:23 +00:00
k.renner cf9dc7c3ea Merge pull request 'fix(blackbox-overview): revive dead dashboard (retired datasource, dead TCP/DNS panels)' (#288) from claude-bot/dash-blackbox-overview into master
Reviewed-on: gitea_admin/homelab#288
2026-07-17 13:17:12 +00:00
k.renner 21353fd931 Merge pull request 'fix(node-overview): repair 4 dead panels, exclude rbd/lxc devices, nodename legends' (#289) from claude-bot/dash-node-overview into master
Reviewed-on: gitea_admin/homelab#289
2026-07-17 13:17:02 +00:00
k.renner 76404f6bd9 Merge pull request 'fix(heatpump-roi): repair solar ratio in cost chart, honest annual savings, since-install blended price' (#290) from claude-bot/dash-heatpump-roi into master
Reviewed-on: gitea_admin/homelab#290
2026-07-17 13:16:48 +00:00
k.renner 0225dabe0e Merge pull request 'fix(authentik-overview): repair dead Status panel, dedupe stats, fix outpost panel' (#291) from claude-bot/dash-authentik-overview into master
Reviewed-on: gitea_admin/homelab#291
2026-07-17 13:16:33 +00:00
k.renner 9e3385e821 Merge pull request 'fix(pv-system-roi): repair Cumulative Value panel, honest current-power stat, unit + gap fixes' (#285) from claude-bot/dash-pv-system-roi into master
Reviewed-on: gitea_admin/homelab#285
2026-07-17 13:16:00 +00:00
k.renner e8eee7800a Merge pull request 'fix(infrastructure-overview): repair all 5 panels (wrong job, missing labels, Talos mountpoint)' (#284) from claude-bot/dash-infrastructure-overview into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#284
2026-07-17 13:15:37 +00:00
k.renner 0861299314 Merge pull request 'fix(home-energy): repair dead panels, wrong queries, misleading semantics' (#283) from claude-bot/dash-home-energy into master
Reviewed-on: gitea_admin/homelab#283
2026-07-17 13:15:20 +00:00
security-bot e1b91e5a33 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784289602
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-07-17 12:02:40 +00:00
k.renner 7b84daa74f Merge pull request 'fix(node-metrics): repair dead dashboard — nonexistent 'host' label broke every panel' (#281) from claude-bot/dash-node-metrics into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#281
2026-07-17 11:21:40 +00:00
k.renner 33cbf94cd8 Merge pull request 'fix(power-flow): dead sensors, balance-based Home total, dedup history' (#278) from claude-bot/dash-power-flow into master
Reviewed-on: gitea_admin/homelab#278
2026-07-17 11:21:05 +00:00
k.renner 8a13629803 Merge pull request 'fix(home-climate): real room sensors only, repair empty heating panels, readable legends' (#280) from claude-bot/dash-home-climate into master
Reviewed-on: gitea_admin/homelab#280
2026-07-17 11:20:48 +00:00
k.renner a1a68e0230 Merge pull request 'fix(heatpump-heating-loading): Duplikat-Serien kollabieren, ehrliches No-Data' (#277) from claude-bot/dash-heatpump-heating-loading into master
Reviewed-on: gitea_admin/homelab#277
2026-07-17 11:20:14 +00:00
k.renner 5cdec44ed6 Merge pull request 'fix(heatpump-dhw-loading): dedupe scrape-residue series (broken scatter, 8x stat)' (#276) from claude-bot/dash-heatpump-dhw-loading into master
Reviewed-on: gitea_admin/homelab#276
2026-07-17 11:19:49 +00:00
k.renner 808e832ad3 Merge pull request 'feat(claude-workstation): off-site headless Claude Code host on nas-2' (#247) from feat/claude-workstation-nas2 into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#247
2026-07-17 11:00:27 +00:00
k.renner 5febd33298 Merge pull request 'fix(gitea-overview): repair fully dead dashboard (unreachable prometheus-legacy datasource)' (#292) from claude-bot/dash-gitea-overview into master
Reviewed-on: gitea_admin/homelab#292
2026-07-17 10:59:51 +00:00
k.renner 874c3c8e55 Merge pull request 'fix(alloy-overview): repoint retired prometheus-legacy datasource, repair host-label legends' (#293) from claude-bot/dash-alloy-overview into master
Reviewed-on: gitea_admin/homelab#293
2026-07-17 10:59:37 +00:00
k.renner cbf642430f Merge pull request 'fix(monitoring): stop 3x-ingesting pve cluster metrics' (#294) from claude-bot/pve-scrape-dedup into master
Reviewed-on: gitea_admin/homelab#294
2026-07-17 10:59:21 +00:00
k.renner 8e2c569bb0 Merge pull request 'fix(homeassistant-overview): repair dead panels, curate sensors, honest stats' (#279) from claude-bot/dash-homeassistant-overview into master
Reviewed-on: gitea_admin/homelab#279
2026-07-17 10:59:08 +00:00
claude-botandClaude Fable 5 16d4996dff fix(monitoring): stop 3x-ingesting pve cluster metrics
The single pve scrape job hit all three node IPs with cluster=1, and
pve-exporter returns the full cluster-wide resource set regardless of
which node answers - every node/guest series landed in the TSDB three
times (same id, differing instance). Dashboards papered over it with
max by (id); the cardinality cost stayed.

Split per upstream prometheus-pve-exporter guidance: cluster collectors
scrape one node only, node-local collectors keep scraping all three
under a new pve-node job. No dashboard queries filter on job=, and all
already aggregate by id, so this is query-compatible.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 08:46:30 +02:00
claude-botandClaude Opus 4.8 8519ad875d fix(alloy-overview): repoint retired prometheus-legacy datasource, repair host label legends
Every panel was dead: all 11 datasource refs pointed at the
prometheus-legacy datasource (retired 2026-05-09). Repoint to the
active prometheus datasource.

The alloy job also carries no 'host' label, so all legends and the
Agent Versions table rendered empty labels. Join via kube_pod_info
(pod -> node) so DaemonSet panels are labelled k8s-1/2/3, collapse
the eval-time histogram per pod before quantile, and tidy the
versions table to node/pod/version columns.

All queries verified against live Prometheus (3 agents, one clean
series per node).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:30:10 +02:00
claude-bot 035f46cd04 fix(gitea-overview): point panels at live Prometheus, dedupe migration residue
All 10 panels were dead: the dashboard queried datasource uid
prometheus-legacy (prometheus.srv.renner.uno:9090), which no longer
resolves (Grafana proxy: 502 dial tcp lookup i/o timeout). Gitea now
runs in-cluster and is scraped by the in-cluster Prometheus
(job="gitea", instance gitea.apps.svc.cluster.local:3000), so switch
every panel to uid prometheus.

Also wrap all targets in max(): the pre-migration instance
gitea.srv.renner.uno:3000 stopped 2026-07-12, and windows spanning
that date would otherwise render two identically-named series per
query. Stat panels additionally get instant:true so a dead exporter
shows No data instead of a stale last value.
2026-07-17 01:28:53 +02:00
claude-botandClaude Opus 4.8 0cda291aba fix(heatpump-roi): repair solar ratio in cost chart, honest annual savings, since-install blended price
- Historical Cost Comparison: the chained joins renamed _value columns to
  _value_j2/_value (not _value_gi/_value_sp as the map expected), so the
  solar ratio was always null->0 and the whole cost line was priced at full
  grid price (EUR 4.67K instead of ~3.4K). Streams now pre-rename columns
  to h/d/gi/ge/sp so the join is unambiguous.
- Blended price now uses counter deltas since heat-pump install (Oct 2024)
  instead of device-lifetime counters that include 1.4 years of PV-only
  history from May 2023 (ratio 0.369 vs 0.322 -> EUR 0.236/kWh vs 0.248).
  Applied consistently to all cost/savings/ROI stats and the cost chart
  (chart subtracts install-date counter baselines).
- Annual savings / payback: replace the calendar-YTD extrapolation
  (12 / (month + day/30) - which overcounts elapsed time by a month and is
  seasonally biased) with the actual trailing-365-day consumption spread.
- Fix stale legend 'Last' values (10734/1230/EUR 9.47K): the counters'
  friendly_name tag changed 2026-03-04, splitting each series into two
  tables; group()+sort() merges them before aggregateWindow.
- New oil_baseline dashboard variable (6650) replaces six hardcoded copies.
- Running Cost: neutral color (was green/yellow/red on a forever-growing
  cumulative), retitled '(Since Install)'; added descriptions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:20:50 +02:00
claude-botandClaude Opus 4.8 81281ca20e fix(authentik-overview): repair dead Status panel, dedupe stats, fix outpost panel labels
- App Servers Up: job="authentik" matches nothing (real job label is
  authentik-server-metrics) -> panel showed 'No data'. Also 'or vector(0)'
  + red threshold so a dead scrape shows a red 0 instead of No data.
- Task/Admin Workers, Flows/Policies Cached: raw gauges return 4 series
  (2 pods x 2 pids) -> stats rendered 8 repeated numbers. Wrapped in max().
- Outposts Connected: raw per-outpost/per-pid series rendered an unreadable
  grid of ~30 0/1 values (0s were per-process views, not real disconnects).
  Now counts outposts with >=1 active WebSocket connection (10/10).
- Outpost Connections: legendFormat used non-existent labels {{name}}/{{uid}}
  (real: outpost_name/uuid) -> every legend row was '-'. Replaced with
  server-side authentik_outposts_connected as a state-timeline, one row per
  outpost, red mapping for 'getrennt'; covers all 10 outposts instead of the
  4 with scraped sidecar metrics.
- All stat queries switched to instant so dead sensors render honestly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:20:50 +02:00
claude-botandClaude Opus 4.8 ac623c1e9c fix(node-overview): repair 4 dead panels, exclude rbd/lxc devices, nodename legends
- Nodes Online/Down used job="node" but the scrape job is "node-exporter":
  both stats showed No data. Nodes Down additionally gets OR on() vector(0)
  so it renders 0 instead of No data when all nodes are up, and green-at-0/
  red-at-1 thresholds (was permanently red).
- Avg Disk Usage + Disk Usage by Node filtered mountpoint="/" which does not
  exist on Talos (only /var is a real xfs filesystem): both panels were empty.
- Disk I/O summed all block devices including the ~12 Rook-Ceph rbd* mappings
  per node (~438 kB/s vs 8-129 kB/s physical): filter to nvme.*|vd.*.
- Network I/O filter was written for a Docker host (veth/docker/br-) and let
  ~40 Cilium lxc* per-pod interfaces plus kernel pseudo-devices through,
  double-counting pod traffic: filter to eth.* (bond0 is down, 0 slaves).
- Legends showed instance IP:port; join node_uname_info via
  on(instance) group_left(nodename) so panels label k8s-1/2/3. Both join
  sides are wrapped in max by (...) so historical duplicate series from
  pod restarts / the pre-2026-07-16 duplicate-scrape residue cannot break
  the join or rainbow-duplicate long-window views.
- Stat panels reduce lastNotNull instead of mean: show current value, not
  a time-average over the selected window.

All queries verified against live Prometheus before applying.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:08:35 +02:00
claude-botandClaude Opus 4.8 30d6eb3af8 fix(blackbox-overview): repoint retired datasource, drop dead TCP/DNS panels
The dashboard was 100% dead: every panel still referenced the
prometheus-legacy datasource retired on 2026-05-09, so all panels
rendered 'No data' with datasource errors.

- Repoint all panels prometheus-legacy -> prometheus
- Remove TCP Endpoint Status panel: the blackbox-tcp Probe was
  deliberately deleted 2026-05-20 (see probes-blackbox.yaml), the job
  no longer exists
- Remove DNS Status panel: no blackbox-dns job has ever existed in
  this Prometheus (the dns-servers job is Alloy on the DNS VMs, not a
  probe)
- Replace the freed row with HTTP Status Codes (probe_http_status_code,
  instant, 2xx green / 3xx orange / 4xx+ and probe-fail red)
- Convert SSL Certificate Expiry from a seconds-countdown timeseries to
  a days-remaining bar gauge (instant, red <7d, orange <30d, green)
- Make status stat queries instant so dead probes render No data
  instead of a stale last-known value
- Pin Uptime y-axis to 0-100% and drop the fill (10 overlapping series
  at 100% rendered as a muddy block)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:08:21 +02:00
claude-botandClaude Opus 4.8 7e5ebb1e3c fix(proxmox-cluster): dedupe 3x-scraped series, repair broken panels
The pve-exporter is scraped via all 3 PVE nodes and each scrape returns the
full cluster view, so every series exists in triplicate. All stat counts were
3x too high (Online Nodes showed 39 instead of 3) and every bargauge/table
row appeared three times. Wrap all queries in max by (id) / count by (id).

- Online Nodes: count unique node/* ids with pve_up==1 (was 39, now 3);
  threshold green at 3 so a lost node turns red
- Total VMs: count unique qemu guests excluding templates (was 12, now 3)
- Total LXC: count unique ids (was 9, now 3)
- Running Guests: pve_guest_info has no status label in this exporter
  version (panel showed No data); derive from pve_up==1 per guest instead
- Node CPU/Memory bargauges + timeseries: filter to id=~"node/.*" — they
  showed every guest (mostly lxc rows), not nodes
- Guest Status table: dedupe rows, add Status column from pve_up (color
  mapped 1=Running/0=Stopped), drop useless Info column, migrate
  custom.displayMode -> custom.cellOptions (schemaVersion 38 skips the
  Grafana 10 migration, so gradient gauges/color background were silently
  ignored)
- Node Disk I/O -> Guest Disk I/O: pve_disk_read/write metrics only exist
  for qemu/lxc guests, never node/* (panel was permanently No data); use
  the *_total counters with rate()

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:02:32 +02:00
claude-botandClaude Opus 4.8 c7e9fc8bb6 fix(postgresql-overview): scrape CNPG metrics and rewrite dead pg_* queries
The dashboard was entirely dead: every panel queried postgres_exporter
metrics (pg_up, pg_stat_activity_count, ...) that have never existed in
this Prometheus. Postgres runs as four CloudNativePG clusters (ak-pg,
im-pg, gf-pg, pprl-pg) whose built-in exporter on :9187 was not scraped
at all (enablePodMonitor is false and no PodMonitor existed).

- add PodMonitors for the four CNPG clusters in monitoring-rules,
  labelled release=kube-prometheus-stack so the Prometheus
  podMonitorSelector actually picks them up (CNPG's own
  enablePodMonitor would generate unlabelled PodMonitors that this
  Prometheus ignores)
- rewrite all dashboard queries to the cnpg_* metrics the exporter
  actually exposes (verified against the pods' /metrics endpoints)
- dedupe multi-instance clusters (max by namespace/datname for sizes,
  primary-only filter via cnpg_pg_replication_in_recovery == 0 for
  per-database counters)
- replace the Active Locks stat (no lock metric in the CNPG default
  queries) with Max Replication Lag
- instant queries on all stat panels so dead instances show No data
  instead of a stale last value

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:02:28 +02:00
claude-bot ccde43b367 fix(infrastructure-overview): repair all 5 panels (wrong job, missing labels, Talos mountpoint)
- Healthy Hosts: job 'integrations/unix' does not exist here -> node-exporter;
  thresholds now red/yellow/green(3) so a single down node shows yellow
- Unhealthy Services: 'count(up == 0)' returns empty vector when healthy ->
  'or vector(0)' renders an honest 0; both stats now instant queries
- CPU: 'avg by(host)' collapsed all 3 nodes into one series (no host label) ->
  avg by(instance) joined with node_uname_info for k8s-1/2/3 legend names
- Memory: legend showed raw label dumps ({{host}} does not exist) -> nodename join
- Disk: Talos has no '/' mountpoint in node_filesystem -> use /var (the
  persistent data disk); retitle panel accordingly
2026-07-17 00:48:31 +02:00
claude-botandClaude Opus 4.8 019f1bc47c fix(pv-system-roi): repair Cumulative Value panel, honest current-power stat, unit + gap fixes
- Cumulative Value: Self-Use Savings and Total Value series rendered nothing.
  The union'd solar/export/price tables had mismatched group keys (pivot ran
  per-table) AND the sparse strompreis series almost never landed in the same
  aggregation window. Fix: group() before pivot + fill(usePrevious) per column.
  Verified via /api/ds/query: 471 points, final value EUR 4363 == stat panel.
- Solar Power stat: was aggregateWindow(mean) over the dashboard range (~17 h
  windows at 3 y), showing 3.04 kW at midnight. Now last() -> honest 0 W at night.
- Solar Installed: HA input_number stores 8140 (Wp, mislabeled kWp); with unit
  kwatt the panel would read 8.14 MW. Divide by 1000 -> 8.14 kW, documented.
- Timeseries gap honesty: e3_* series have a real data hole (Nov 2025 - Feb 2026,
  verified 0 points/month). createEmpty:false let Grafana draw fake decay ramps
  across it. Now createEmpty:true so gaps render as gaps (panels 20/21/22).
- Units: 'kwh' is not a valid Grafana unit id (rendered lowercase 'kwh');
  replaced with 'kwatth' everywhere -> proper kWh/MWh scaling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:47:04 +02:00
claude-botandClaude Opus 4.8 91620e5f14 fix(home-energy): repair dead panels, wrong queries, misleading semantics
- Current by Phase: regex /smart_meter.*current/ matched nothing (smart
  meter exposes no current entities) -> use verified
  e380_energy_meter_e380_current_l[123]; spanNulls for sparse updates
- Energy Consumption: measurement "kWh" does not exist in the bucket
  -> plot verified Wh daily counters (grid import/export, PV production,
  battery charge/discharge) with readable display names
- Active Lights: light-domain data is never recorded under measurement
  "%" -> replace dead table with Lights/Standby/Switches power
  timeseries from verified powercalc aggregates (all_*_power)
- Top 20 Devices: add group() so sort/limit work globally (was
  alphabetical, unsorted, per-table); exclude grid meters, PV/battery,
  forecasts, powercalc room/floor aggregates and _device_power twins;
  fresh 30-min window instead of stale last() over the full range;
  rowsToFields for clean labels (was "_value xyz_power")
- Grid semantics: retitle Total Power -> Grid Power (+Import/-Export),
  blue threshold for export; unstack mixed-sign phase graph; short
  L1/L2/L3 legend names; taller voltage/current panels so the legend
  table is not cut off

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:43:57 +02:00
claude-botandClaude Opus 4.8 509163fbc4 fix(home-security): repair alarm stats, curate sensor lists, dedup batteries
- Alarm stats: '== 1' dropped the series when false, so Armed Home/Away and
  Triggered could only ever show 'No data' and never their 0-state; Disarmed
  rendered 5 overlapping series. Use min()/max() aggregation over the one-hot
  alarm_control_panel_state series so every tile always shows a real 0/1.
- Windows/Doors tables: replace friendly-name regexes (matched battery-low
  sensors, HmIP 'Window/door is CLOSED' entities with inverted semantics,
  intrusion/tamper diagnostics, _2 twins, pond-pump/fridge sensors) with a
  curated entity list: one canonical is-open entity per physical sensor.
  Collapse scrape labels via max by so the tables show Sensor/Name/Status.
- Motion panels: old regex required 'Bewegungs.*Occupancy' and missed the
  Eingang sensor (typo 'Bewegunsmelder'), all motion-class sensors and the
  mmWave Praesenzmelder. Curated list of physical detectors.
- Covers: name-based exclusion (.*Nord.*|.*Ost.* etc.) dropped 8 physical
  covers incl. the garage door while letting the eg_schlafzimmer/eg_kuche
  group entities through. Exclude the 5 group covers by entity instead;
  label bars by entity because friendly names repeat ('Rollo' x3).
- Batteries: filter battery_notes '+' twin entities, drop PV storage SoC,
  remove '> 0' (which would hide a 0% dead battery), sort ascending so the
  most critical batteries are on top, instant query so stale values drop.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:41:55 +02:00
claude-bot bd8a632334 fix(node-metrics): repair dead dashboard — nonexistent 'host' label broke every panel
The template variable queried label_values(node_uname_info, host), but no
node-exporter metric in this Prometheus carries a 'host' label (that label
only exists on blackbox-probe metrics). The variable resolved to empty and
all five panels rendered blank.

- Replace $host with a visible $node variable (nodename: k8s-1/2/3) plus a
  hidden chained $instance variable (nodename -> instance via node_uname_info)
- Filter Cilium pod interfaces (lxc*, cilium_*) and always-zero kernel
  pseudo-devices (ip6tnl0, sit0, teql0, tunl0) out of Network I/O
- Filter Ceph RBD-mapped volumes (rbd0..11) out of Disk I/O so the panel
  shows physical disks (nvme0n1, vda) only
- Exclude the rootfs bind mount (/etc/extensions.yaml) from Filesystem
  Usage, leaving the meaningful /var xfs mount

All queries verified against live Prometheus before commit.
2026-07-17 00:40:54 +02:00
claude-bot f248e0cc77 fix(home-climate): real room sensors only, repair empty heating panels, readable legends
- All temperature/humidity panels: replace vendor regexes (shelly.*temp etc.)
  that dragged in device-internal temperatures (pond pump 34C, power meter 60C,
  relay 76C) with explicit allow-lists of verified room sensors
- Add missing sensors: shelly_blu_h_t_7203 (KG Schlafzimmer),
  treppenhaus_eg_bewegungsmelder (EG Treppenhaus), vento humidity sensors,
  Shelly Wall Display (DG Buero)
- OG & DG panel: regex had no og_ alternative and showed only device internals;
  now honest DG-only series + description (OG deliberately has no sensor)
- Heating System / Hot Water panels were empty (domain climate/water_heater
  does not exist in the C measurement) -> use vitocal_250_a_* sensors
- Current-value panels: fixed -6h window so dead sensors (EG Shelly H&T trio,
  DG Meter Pro) disappear instead of showing stale values as live
- Legends: map entity_ids to room names in Flux + displayName, removes the
  '_value xyz' prefix
- Align CO2 thresholds between gauge and history (800/1000/1500)
2026-07-17 00:35:15 +02:00
claude-botandClaude Opus 4.8 1c333826ff fix(power-flow): dead sensors, balance-based Home total, dedup history
- Server node: sensor.keller_server_power is dead (UPS retired) -> Wave PM
  Mini server outlet (kg_vorratskeller_wave_pm_mini_server_steckdose)
- Garden node: sensor.eg_garten_teichpumpe_power_2 is dead ->
  sensor.shelly_teichpumpe_power_0 (live, peaks ~77 W)
- Home node/series: floor sums only cover submetered circuits (702 W shown
  vs ~1.1 kW real); Home is now the meter balance PV + Grid + Battery, with
  a new grey 'Rest' node for the non-submetered remainder
- Flow lines: Heat Pump is metered inside Keller (was drawn from EG);
  Garden is on floor Aussenbereich, in no floor sum (was drawn from OG)
- Drop redundant batteryIn target (derived from the signed battery sensor);
  update stale comments from the retired *_absolute sensors
- History: max by (entity) guards against duplicate-scrape residue that
  doubled the summed Home series; sign hints in Battery/Grid legends;
  grid query pinned to entity id instead of friendly_name

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:33:05 +02:00
claude-botandClaude Opus 4.8 4c16f6ac89 fix(homeassistant-overview): repair dead panels, curate sensors, honest stats
- Status panel: job label is home-assistant (hyphen), was homeassistant -> No data
- Doors & Windows / Motion: exporter has no device_class label; select curated
  entity lists instead (one canonical is-open entity per physical contact,
  physical motion/presence sensors without zone/magic_areas duplicates)
- Temperature: was all 61 temp series incl. device-internal electronics temps
  (fridge 5C, PoE switch 75C, Shelly 58-75C); curated to room/ambient sensors
  + outdoor temp, incl. currently-dead EG H&T sensors so they reappear
- Power Consumption: exclude non-consumption series (Solcast forecasts,
  battery max charge/discharge capability, derived night-load stats)
- Energy: cumulative lifetime counters (up to 80 MWh) told nothing; now
  bargauge of top 12 increase() over 24h, forecast counters excluded,
  max by () dedup against scrape residue
- Switches: 248 unreadable micro-tiles -> single 'Switches On' count stat
- Battery: bottomk(12) instant, battery_notes *_battery_plus twins excluded
- Entity counts: max by (entity) dedup, instant queries on all stats
- Unavailable Entities: neutral blue; ~1139 is the structural baseline
  (verified against HA API), old yellow>=1/red>=5 thresholds were meaningless

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:32:47 +02:00
claude-botandClaude Opus 4.8 1165afce02 fix(heatpump-heating-loading): collapse pod-churn duplicate series, honest no-data text
All queries selected raw series by entity label only; over a 90d window HA pod
restarts plus the (since fixed) duplicate proxy scrape produce 30 distinct
series per entity, rendering the Außentemperatur & Puffer panel as an
unreadable 30-entry legend jumble. Wrap every query in max() so exactly one
series per entity survives — this also keeps the xychart joinByField transform
correct once heating data arrives, since the join needs unique field names.

The stat panel now says 'keine Heizdaten im Zeitraum' instead of a giant
'No data': the logging sensor is intentionally unavailable outside active
heating loading, so an empty summer dashboard is by design.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:32:18 +02:00
claude-bot f9cbeb0fc0 fix(heatpump-dhw-loading): dedupe scrape-residue series with max by (entity)
All four panels queried raw HA metrics that still carry ~12 duplicate
series per entity in the 90d window (two scrape jobs x six pod
lifetimes; the duplicate-scrape bug was fixed 2026-07-16 but the
residue stays in range queries until it ages out). This broke the
scatter join (no points rendered), made the stat panel show 8
conflicting averages, and drew rainbow duplicates in both time series.

Wrapping every target in max by (entity) (...) collapses the residue
to one series per entity; values between the duplicate jobs were
near-identical, so max is lossless.
2026-07-17 00:20:41 +02:00
k.renner d24af8d12f Merge pull request 'fix(home-overview): repair broken tiles, wrong sensors, double-counted power' (#275) from claude-bot/dash-home-overview into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#275
2026-07-16 22:12:01 +00:00
claude-botandClaude Opus 4.8 05fd813e9f fix(home-overview): repair broken tiles, wrong sensors, double-counted power
- Windows/Doors/Batteries tiles: literal ${__value.raw} never interpolates in
  value mappings; replaced range mappings with suffix units. Counts now use
  curated entity lists (one canonical 'is open' entity per physical sensor)
  instead of friendly-name regexes that matched inverted *_is_closed sensors,
  'Battery low' sensors and duplicate _2 entities.
- Alarm tile: old min(...==1) query could never show TRIGGERED; now
  max(...{state="triggered"}) with 0=OK/1=TRIGGERED mapping.
- Power Usage: old regex summed phases A+B+C AND total_active_power AND
  device_power -> ~2x real value; now reads total_active_power only.
- Floor temperature panels: select verified room sensors by entity id instead
  of vendor regexes (which pulled 65-75C device-internal temps and missed the
  I-9PSL sensors that live in the EG). Instant queries so dead sensors do not
  render stale values. OG: no room sensor exists (owner-confirmed) -> honest
  noValue; DG SwitchBot offline -> noValue 'Sensor offline'.
- Tables: dedup via max by (entity, friendly_name), drop k8s scrape label
  columns, colour only the value column; battery list excludes battery_notes
  *_battery_plus twin entities and no longer hides 0% batteries.
- Power Consumption: L1/L2/L3 legends, Total from total_active_power.
- Indoor Temperatures: room sensors only (y-axis no longer squashed to 80C).
- Heating row: Hot Water/Heating pointed at post-open3e-migration vitocal
  sensors (old queries returned nothing resp. only the fridge); humidity/CO2
  deduplicated; row renamed to Heating & Air Quality.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:06:58 +02:00
k.renner 5996a72dcf Merge pull request 'fix(pv-system-roi): clean timeseries legend labels' (#274) from claude-bot/pv-roi-legend-fix into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#274
2026-07-16 20:36:42 +00:00
claude-botandClaude Opus 4.8 55596a2bac fix(pv-system-roi): clean timeseries legend labels
The union-based timeseries series were named via set(_field, ...), which Grafana's InfluxDB frontend rendered as "_value {_start=...}" instead of the intended labels (and broke the byName color overrides). Data was correct; only the legend/colors were affected.

Switch to the keep(columns:[_time,_value]) |> rename(_value -> "Name") pattern (as used in heatpump-roi), which names each series cleanly. Verified in Grafana Explore. No data/logic change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiLCinB7NLp7YdCjGYzvfh
2026-07-16 22:35:21 +02:00
k.renner 592fef04fc Merge pull request 'fix(dashboards): repoint power-flow + pv-system-roi to open3e entities' (#273) from claude-bot/pv-powerflow-open3e into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#273
2026-07-16 20:24:22 +00:00
k.renner d3841b6eb6 Merge pull request 'fix(decommission): rustfs shims v2 with explicit timeouts (stage 2 retry)' (#272) from chore/rustfs-destroy-stage2b into master
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
Reviewed-on: gitea_admin/homelab#272
2026-07-16 20:24:07 +00:00
claude-botandClaude Opus 4.8 2a2a5d9a0b fix(dashboards): repoint power-flow + pv-system-roi to open3e entities
The 2026-07 ViCare->open3e/MQTT migration renamed the Vitocharge PV/battery entities (e3_vitocharge_03_* -> vitocharge_vx3_vx3_*) and changed some units. Both dashboards still queried the retired entities and showed No data.

power-flow (Prometheus, real-time): solar_power->pv_power, battery SoC->battery_soc; the two absolute battery-power sensors are replaced by a single signed battery_power (open3e: positive=discharge, negative=charge), so charge/discharge derive from its sign.

pv-system-roi (InfluxDB): repoint every query; fix units (PV/battery energy now Wh not kWh -> /1000; grid energy now kWh not Wh); grid power sign unchanged (negative=export). Timeseries panels UNION pre-migration e3_* with post-migration series (unit-normalized) so history back to 2023 stays unbroken. Reserved Energy recomputed as capacity x backup_discharge_limit. strompreis + the two input_number config entities survived and are kept.

Validated live via Grafana Explore: signed-battery charge/discharge union, unit normalization, pivot/value patterns (reused from merged heatpump-roi fix #271).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiLCinB7NLp7YdCjGYzvfh
2026-07-16 22:22:26 +02:00
claude-botandClaude Fable 5 1b44ca5cfc fix(decommission): rustfs shims v2 with explicit timeouts (stage 2 retry)
Both destroy applies (runs 1180/1181) died instantly with 'context
deadline exceeded' on the pre-destroy status GET while the PVE API
answers in <1s: the bpg provider reads timeout_delete from STATE at
destroy time, and the stage-1 import stored 0 for the timeout-less
shims — a zero-second context. Read paths carry their own timeout,
which is why import and plan were clean.

v2 declares all timeouts explicitly (one in-place, no-API update
writes them into state) and mirrors the real container attributes
(unprivileged=true is ForceNew — mirroring prevents a replace).
No ignore_changes this time: the timeout update must actually apply.
Flow: merge -> plan (must be in-place only) -> apply -> follow-up PR
deletes the file -> destroy apply.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 21:58:04 +02:00
k.renner 9f996f9907 Merge pull request 'fix(heatpump-roi): rebuild dashboard on InfluxDB after ViCare->open3e migration' (#271) from claude-bot/heatpump-roi-influxdb into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#271
2026-07-16 19:56:59 +00:00
claude-botandClaude Opus 4.8 0aad90bea9 fix(heatpump-roi): rebuild dashboard on InfluxDB after ViCare->open3e migration
The ViCare cloud integration was replaced by open3e/MQTT (2026-07), renaming all heat-pump/PV entities (e3_vitocal_*/e3_vitocharge_03_* -> vitocal_250_a_vitocal_*/vitocharge_vx3_vx3_*). The dashboard still queried the retired IDs, and a duplicate Prometheus scrape broke the surviving-entity panels with many-to-many errors.

Rebuild every panel on InfluxDB (bucket suedstr28, authoritative + live) using current entity IDs. Where an entity was renamed, UNION the pre-migration e3_* series with the post-migration series (unit-normalized: PV Wh->kWh) so history stays unbroken. Drop all Prometheus targets. Add a grid_price variable (0.3271) replacing the retired live strompreis read.

Also rename the home-assistant-bgp Service port http->ha so the home-assistant ServiceMonitor no longer scrapes HA a second time via the LB (:8123), which duplicated homeassistant_sensor_* series cluster-wide.

Queries validated live via Grafana Explore: blended price 0.248 EUR/kWh, total consumption 14284 kWh, projected annual savings 4698 EUR, oil proration 11912 EUR, old-union-new grid-import continuous.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiLCinB7NLp7YdCjGYzvfh
2026-07-16 21:54:56 +02:00
k.renner fc4e30f469 Merge pull request 'chore(decommission): drop rustfs import shims — destroy via apply (stage 2/2)' (#270) from chore/rustfs-destroy-stage2 into master
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
ci/woodpecker/manual/deploy-infrastructure Pipeline failed
Reviewed-on: gitea_admin/homelab#270
2026-07-16 19:47:38 +00:00
claude-botandClaude Fable 5 ad6161c226 chore(decommission): drop rustfs import shims — apply destroys LXC 800/801/802 (stage 2/2)
Stage 1 (#268) adopted the never-tofu-managed rustfs containers into
state (import run 1173: all three imported, plan 'No changes').
Removing the shims makes the next apply destroy the containers —
guest lifecycle fully through tofu, per owner rule.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 21:07:29 +02:00
security-bot b6a5ae0877 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784228462
ci/woodpecker/manual/deploy-infrastructure 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-07-16 19:04:11 +00:00
k.renner 182bf8f5df Merge pull request 'chore(decommission): rustfs import shims — destroy via tofu (stage 1/2)' (#268) from chore/rustfs-import-adopt into master
ci/woodpecker/push/deploy-infrastructure Pipeline was successful
Reviewed-on: gitea_admin/homelab#268
2026-07-16 19:01:06 +00:00
k.renner e5a5c48431 Merge pull request 'feat(alert-monitor): blip lookback — catch alerts that resolve between ticks' (#269) from feat/alert-monitor-blip-lookback into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#269
2026-07-16 19:00:56 +00:00
claude-botandClaude Fable 5 c10c7af3c8 feat(alert-monitor): blip lookback — catch alerts that resolve between ticks
The live 15-min snapshot structurally misses anything that fires and
resolves between ticks: on 2026-07-16 a 17-minute KubeHpaMaxedOut
(authentik) and last evening's four-alert home-assistant incident were
invisible to the monitor (owner noticed the blips; monitor did not).

The fetch step now also queries Prometheus's ALERTS history over a
35-minute window (~2 ticks + jitter). The dedup step synthesizes
pseudo-alerts for series not currently firing at all — checked against
the PRE-filter snapshot so live-but-null-routed alerts don't reappear
as blips — with a stable sha256-derived fingerprint so one noise
verdict suppresses a flappy alert permanently. Blips then flow through
the same title/noise dedup and triage as live alerts; the prompt
explains their semantics (self-resolved; judge the underlying cause;
null-routed per the repo route config = noise).

Verified against live data: currently-firing KubeCPUOvercommit
excluded, injected KubeHpaMaxedOut blip synthesized correctly;
sha256sum confirmed present in ci-claude; lookback query tested via
the service proxy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 20:50:10 +02:00
claude-botandClaude Fable 5 5307d0db5b chore(decommission): import shims for rustfs LXCs — destroy via tofu, stage 1/2
Owner rule: ALL guest lifecycle goes through tofu; no manual pct/qm
destroy, by anyone. The rustfs trio (800/801/802) was never
tofu-managed, so the #265 sweep could not reach it. Stage 1 adopts the
stopped containers into state (pipeline TOFU_IMPORT hook, commands in
the file header); stage 2 deletes this file and the apply destroys
them.

lifecycle ignore_changes=all + started=false keep the shims inert:
tofu must never reconcile or start these, only own their destruction.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 19:27:30 +02:00
security-bot 396f02b35b chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784221484
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-16 17:16:27 +00:00
security-bot b9c4f3dd54 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784220647
ci/woodpecker/manual/deploy-infrastructure Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-16 16:53:40 +00:00
security-bot b594c57ac3 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784218615
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-07-16 16:19:25 +00:00
k.renner 0a90cef59b Merge pull request 'feat(shelly-manager): wire Home Assistant onboarding (token + BaseUrl)' (#267) from feat/shelly-manager-ha-onboarding into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#267
2026-07-16 15:58:28 +00:00
security-bot 0eee23c1f9 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784217013
Updates managed by image-automation-controller.
2026-07-16 15:53:04 +00:00
claude-botandClaude Fable 5 f6f5033b14 feat(shelly-manager): wire Home Assistant onboarding (BaseUrl + admin token)
Enables the single-click HA onboarding shipped in shelly-manager PR #41:
shelly-manager registers a provisioned Shelly into HA's native integration
by driving HA's config-flow + device-registry API.

- shelly-manager-llat ExternalSecret projects the full-admin HA LLAT from
  OpenBao (apps/home-assistant/shelly-manager-llat, key 'token').
- HomeAssistant__BaseUrl = http://home-assistant (in-namespace svc :80 → nginx
  sidecar → HA :8123; nginx forwards the WS upgrade, so both the REST config-
  flow and the device-registry websocket work). Reachability confirmed: same-
  namespace ingress is allowed by the default-deny-ingress CNP's home-assistant
  rule (probed :80 → 401 = reachable).
- HomeAssistant__Token from the new secret.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 17:50:35 +02:00
k.renner 2a4a1f3102 Merge pull request 'feat(issue-fix): pipeline-verified owner guidance re-opens assessed issues' (#266) from feat/issue-fix-owner-guidance into master
Reviewed-on: gitea_admin/homelab#266
2026-07-16 15:46:46 +00:00
k.renner 76cb7125ec Merge pull request 'chore(decommission): sweep all references to destroyed PVE guests' (#265) from chore/decommission-sweep into master
ci/woodpecker/push/deploy-infrastructure Pipeline failed
Reviewed-on: gitea_admin/homelab#265
2026-07-16 15:46:37 +00:00
claude-botandClaude Fable 5 abbc7a2d3f feat(issue-fix): pipeline-verified owner guidance re-opens assessed issues
The #259 lesson, both directions: the agent rightly refused
unauthenticated instructions embedded in the issue body — and then had
no channel for the owner's authentic reply 18 minutes later, so a
human ended up doing the sweep the agent should have owned.

- Pick step: an issue with an alert-fix:assessed marker becomes
  eligible again when a TRUSTED_AUTHORS comment is NEWER than the
  latest marker (timestamps compared in jq — busybox ash test has no
  string-<). Owner replies on the issue now drive the loop.
- Trusted comments are appended to the agent's issue.md as 'Verified
  owner guidance'. Trust anchor is the hardcoded author list in this
  file — deliberately not the Gitea permission API, because the
  pipeline itself comments as gitea_admin and agent-authored text must
  never be able to masquerade as owner guidance.
- Prompt: verified guidance is authoritative for intent and scope (may
  lift the surgical ceiling when it calls for a sweep), does not lift
  the edit-path allowlist, and factual mismatches with live state are
  surfaced, not silently resolved in either direction.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 16:55:50 +02:00
claude-botandClaude Fable 5 ca7a585eac chore(decommission): sweep all references to destroyed PVE guests
Owner directive: PVE runs ONLY the three k8s VMs. The proxmox-dns trio
(lxc 118/218/318), rustfs trio (lxc 800/801/802), fortress (vm 102)
and paperless (vm 111) are decommissioned; guest definitions are being
destroyed on PVE out-of-band.

Removed:
- opentofu: lxc_118_proxmox_dns.tf, vm_102_fortress.tf,
  vm_111_paperless.tf, backup_jobs.tf (the vzdump job covered ONLY
  destroyed guests — next tofu apply removes the job from PVE; k8s
  data protection is Velero/CNPG)
- ansible: roles/proxmox-dns, install-proxmox-dns{,-ha}.yml,
  check-chaos-testing.yml (tested failover of decommissioned DNS-HA
  and postgres LXCs), proxmox_dns_vault.yml, rustfs_vault.yml,
  [proxmox_dns_ha] inventory group
- monitoring: dns-servers scrape job in both the k8s HelmRelease and
  the legacy prometheus-server template — resolves TargetDown
  (dns-servers)

Closes #259

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 16:46:23 +02:00
k.renner fdfad3843b Merge pull request 'fix(woodpecker): ephemeral CephFS StorageClass for CI workspaces (PV leak)' (#264) from fix/woodpecker-pv-leak into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#264
2026-07-16 14:34:26 +00:00
claude-botandClaude Fable 5 73a485dbac fix(woodpecker): ephemeral CephFS class for CI workspaces — stop the PV leak
Woodpecker's k8s backend deletes each workspace PVC when a pipeline
ends, but ceph-filesystem has reclaimPolicy Retain, so every finished
pipeline left a Released PV pinning a CephFS subvolume — 191 of them
by 2026-07-16 (found in #262). New ceph-filesystem-ephemeral class
(identical parameters, reclaimPolicy Delete) used only by the CI
workspace volumes; production PVCs keep the undoable Retain default.

Existing Released woodpecker-ci PVs are swept out-of-band (they
predate this class and are unaffected by it).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 16:32:25 +02:00
k.renner e903beb4d1 Merge pull request 'fix(e2e): repair 5 structural defects that kept the suite red' (#263) from fix/e2e-structural-defects into master
ci/woodpecker/manual/e2e Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#263
2026-07-16 14:21:43 +00:00
claude-botandClaude Fable 5 3f1daea12b fix(e2e): repair 5 structural defects that kept the suite red (#262)
- obs checks: run e2e-helper in the monitoring namespace — default is
  not on monitoring's default-deny-ingress allow-list, so every
  loki/prometheus/alertmanager check timed out (curl exit 28)
- node count: 4 -> 3 (k8s-1/2/3; there is no 4th node)
- CNPG exec targets: resolve the primary via
  cnpg.io/cluster + cnpg.io/instanceRole=primary labels instead of
  hardcoding pod names (pprl-pg-1 no longer exists; ak-pg-1 was one
  failover away from the same break)
- no-failing-pods: exclude the woodpecker-ci namespace — the check
  raced the e2e run's own runner pod (ContainerCreating, 4s old)
- purge_released_pvs: drop jq (not in ci-k8s image — the function has
  been a silent no-op, 305 Released PVs currently pinned); jsonpath +
  awk instead

Closes #262

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 16:07:06 +02:00
claude-botandClaude Opus 4.8 9875498ec8 docs(claude-workstation): RUNBOOK as-built — preseed ISO, VMM gotchas, mesh/DNS caveats
VMM has no cloud-init and only makes blank disks, so replace the cloud-init VM
step with the real method: remastered netinst ISO auto-booting a preseed that
powers off at end (breaks the guest-reboot->CD reinstall loop). Debian 13, DHCP,
Default VM Network. Document the Netbird mesh-reachability caveat (CI/home not
peers) and the obg.renner.uno split-horizon DNS trap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-16 14:00:52 +02:00
security-bot cf0058376a chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784202373
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-07-16 11:48:56 +00:00
k.renner 3dcde7def6 Merge pull request 'feat(home-assistant): config-sync forces Lovelace YAML dashboard re-read' (#261) from chore/config-sync-lovelace-reload into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#261
2026-07-16 11:45:12 +00:00
claude-botandClaude Opus 4.8 48bc888d94 feat(claude-workstation): Netbird enrolment via CI
ci/woodpecker/manual/deploy-netbird-client Pipeline was successful
- inventory: claude-ws at its current DHCP lease (10.3.40.78). Switch to the
  stable Netbird mesh IP post-enrolment; 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.
- group_vars/claude_workstation/vault.yml: vault'd netbird_setup_key, scoped to
  the group so install-netbird-client.yml only enrols this host.
- .woodpecker/deploy-netbird-client.yml: pipeline running
  install-netbird-client.yml --limit claude_workstation (manual + master-path).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-16 13:43:02 +02:00
k.renner 1f521d8ec4 Merge pull request 'feat(shelly-manager): enable SSO header trust from the authentik gate' (#260) from feat/shelly-manager-sso into master
Reviewed-on: gitea_admin/homelab#260
2026-07-16 11:42:39 +00:00
claude-botandClaude Opus 4.8 7ceb69f35f feat(home-assistant): config-sync forces Lovelace YAML dashboard re-read
reload_all does not re-read YAML-mode Lovelace dashboards (HA caches them until
restart or a lovelace/config force=true WS call), so merged dashboard changes
never appeared without a manual force-reload.

After a pull-merge that touches dashboards/ or ui-lovelace.yaml, config-sync now
also calls shell_command.reload_lovelace_yaml (defined in the HA config repo,
packages/lovelace_reload.yaml) which runs a websockets helper inside the HA
container to force the re-read. busybox can't speak WebSocket, hence the hand-off.

Needs a one-time HA restart to register the shell_command domain (not covered by
reload_all); until then reload_lovelace logs a warning and sync is otherwise fine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiLCinB7NLp7YdCjGYzvfh
2026-07-16 13:42:26 +02:00
claude-botandClaude Fable 5 2478a3cfc2 feat(shelly-manager): enable SSO header trust from the authentik gate
Turns on the app's new Auth:ReverseProxy mode (shelly-manager PR #40) so
the X-authentik-username header injected by the proxy outpost signs the
gate session straight into the app — removing the double login introduced
with the auth hardening. Trust is scoped to the pod CIDR because the
outpost pod address is dynamic; the namespace CNP remains the control
that keeps other pods off the app port. Inert until the image built from
shelly-manager PR #40 is promoted (unknown env keys are ignored).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:31:07 +02:00
k.renner baf4ba3014 Merge pull request 'fix(alert-monitor): job-label fallback in issue titles (TargetDown collision)' (#258) from fix/alert-title-job-fallback into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: gitea_admin/homelab#258
2026-07-16 10:34:38 +00:00
claude-botandClaude Fable 5 74c2a2a75c fix(alert-monitor): use job label as title fallback for aggregate alerts
TargetDown carries no namespace label, so two simultaneous TargetDowns
(job=pve and job=dns-servers) collapsed into one '[alert] TargetDown
(cluster)' issue — the dns-servers root cause was never triaged
because the title dedup buried it under the pve issue. (Prometheus
shows 'context deadline exceeded' on all three dns-servers targets
since 2026-07-13: names resolve, the :12345 metrics endpoint doesn't
answer — cause to be triaged once the issue exists.)

Title key is now namespace // job // "cluster". Verified against the
live API: yields distinct '(pve)' and '(dns-servers)' titles.
Migration: retitle open issue #250 to '[alert] TargetDown (pve)' after
merge so the pve thread keeps deduping; the monitor then files a fresh
dns-servers issue for the fix agent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 12:26:58 +02:00
k.renner 3204cb9f97 Merge pull request 'fix(alert-monitor): skip alerts routed only to the null receiver' (#257) from fix/alert-monitor-null-receiver into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#257
2026-07-16 10:18:34 +00:00
claude-botandClaude Fable 5 c471fffb88 fix(alert-monitor): skip alerts routed only to the null receiver
The fix agent's #252 assessment surfaced this: KubeCPUOvercommit is
deliberately routed to receiver 'null' in the Alertmanager config
('by design unsatisfiable on a small homelab cluster'), yet the
triage pipeline filed an issue for it — re-litigating a decision the
owner already made in the route config. The Alertmanager v2 alerts
API returns each alert's matched receivers, so drop alerts whose
receivers are all 'null' before triage. Filter verified against the
live API: KubeCPUOvercommit and Watchdog drop, the email-routed
alerts stay.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 11:49:37 +02:00
k.renner c5b888ac5d Merge pull request 'chore(ci-agents): pin all four agent pipelines to claude-sonnet-5' (#256) from feat/pin-agent-models into master
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#256
2026-07-16 09:38:51 +00:00
claude-botandClaude Fable 5 b2861f72ae chore(ci-agents): pin all four agent pipelines to claude-sonnet-5
No pipeline passed --model, so runs floated on the ci-claude image's
CLI default — behavior could shift silently on the next image bump.
All four headless agents (alert-triage, issue-fix, security-fix,
update-audit) now pin claude-sonnet-5 explicitly; upgrade per-agent
by editing the flag.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 11:34:32 +02:00
k.renner 7ec96d349e Merge pull request 'fix: [alert] VeleroBackupFailed (velero) (#251)' (#255) from alert-fix/issue-251 into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#255
2026-07-16 08:53:17 +00:00
security-bot 428d9aa94e fix: [alert] VeleroBackupFailed (velero) (#251) 2026-07-16 08:49:46 +00:00
k.renner e298df0129 Merge pull request 'fix(ci-diagnostics): grant read on velero.io and postgresql.cnpg.io CRDs' (#254) from fix/diag-rbac-velero-cnpg into master
ci/woodpecker/cron/alert-monitor Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
Reviewed-on: gitea_admin/homelab#254
2026-07-16 08:37:48 +00:00
claude-botandClaude Fable 5 3e9e414018 fix(ci-diagnostics): grant read on velero.io and postgresql.cnpg.io CRDs
Found on the first real use of the restricted identity: assessing the
VeleroBackupFailed issue (#251) needs backups.velero.io (latest
apps-daily run is PartiallyFailed — data-mover pod unschedulable on an
unbound PVC), and the ClusterRole had neither velero.io nor CNPG.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 10:35:53 +02:00
k.renner 2505f1a46f Merge pull request 'feat(ci-agents): verified live diagnostics for the triage/fix agents (no more blind assessments)' (#253) from fix/agent-prompts-no-invented-state into master
Reviewed-on: gitea_admin/homelab#253
2026-07-16 08:31:38 +00:00
claude-botandClaude Fable 5 90aeaf1ef8 feat(ci-agents): give triage/fix agents verified read-only live diagnostics
Both wrong assessments (#249 openbao 'sealed', #250 three untested
hypotheses while one 'kubectl logs' showed the 401) share one root
cause: the agents diagnose blind, so they narrate plausible fiction.
Labeling unverified claims (previous commit) treats the symptom; this
gives them the means to verify:

- kubernetes/apps/monitoring/ci-diagnostics-rbac.yaml: ServiceAccount
  ci-diagnostics with a read-only ClusterRole (workloads, events,
  pods/log, Flux/ESO/cert-manager/monitoring/ceph CRDs — NO secrets)
  plus a namespaced services/proxy Role for the Prometheus and
  Alertmanager HTTP APIs.
- scripts/ci/make-diag-kubeconfig.sh: mints a 1h token per run from
  the admin kubeconfig (no new long-lived secret), builds
  .ci-diag/kubeconfig, copies the static kubectl binary for the
  jq-only ci-claude image, smoke-tests with the restricted identity,
  and degrades to snapshot-only mode when the SA isn't reconciled.
- alert-monitor.yml / issue-fix.yml: agents get exactly one extra tool,
  Bash(./.ci-diag/kubectl:*) — prefix match forbids pipes and any other
  binary; RBAC forbids mutation and secret reads.
- prompts: verification is now mandatory, not aspirational — 'a
  hypothesis you could have settled with one read-only command but
  didn't is a defect in your output'; fix agent must test the issue's
  claims before building on them; minimal-quote rule against dumping
  logs into public issues.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 10:30:29 +02:00
claude-botandClaude Fable 5 33eb6592c6 fix(ci-agents): forbid asserting unverified cluster state in triage/fix prompts
The first issue-fix run on #249 asserted the openbao pod was '0/1 and
sealed' — it was Ready and unsealed the whole time; the alert fired
because the chart's updateStrategy: OnDelete holds the 2.5.5→2.6.0
image bump until an operator deletes the pod. The agent has no cluster
access and invented runtime state from the alert's generic annotation
text.

- issue-fix prompt: runtime claims must be attributed or framed as
  hypothesis, with read-only verification commands in the summary.
- alert-monitor prompt: when context.txt does not confirm the alert's
  symptom, say so explicitly — the mismatch is often the real clue.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 10:12:59 +02:00
k.renner 610916bb72 Merge pull request 'feat(ci): alert-monitor + issue-fix agent pipelines (alert → issue → PR loop)' (#248) from feat/alert-monitor-pipelines into master
ci/woodpecker/manual/alert-monitor Pipeline was successful
ci/woodpecker/manual/issue-fix Pipeline was successful
ci/woodpecker/cron/issue-fix Pipeline was successful
ci/woodpecker/cron/alert-monitor Pipeline was successful
Reviewed-on: gitea_admin/homelab#248
2026-07-16 07:27:24 +00:00
claude-botandClaude Fable 5 b7ff28d6a6 feat(ci): alert-monitor and issue-fix agent pipelines
Two new cron pipelines closing the loop from firing alert to fix PR:

- alert-monitor (*/15 min): reads active alerts from Alertmanager via the
  apiserver service proxy (woodpecker-ci is netpol-blocked from monitoring
  ClusterIPs; the Authentik gate blocks the public hostname), dedups
  against open issues and a persistent noise-log issue, then a headless
  Claude agent triages the new ones against the repo plus a cluster
  snapshot. Confirmed problems become Gitea issues; noise is recorded in
  the noise log so it is never re-triaged.

- issue-fix (hourly): picks the oldest open '[alert] ...' issue with no
  fix branch and no assessed-marker comment, hands it to a fix agent
  (same tool sandbox as security-fix), pushes alert-fix/issue-<n> and
  opens a PR with 'Closes #<n>'. Not-repo-fixable verdicts are posted as
  an issue comment instead.

- e2e.yml: scope the bare 'event: cron' to the three existing cron names
  — otherwise the 15-minute cron would piggyback a full e2e run every 15
  minutes.

The ci-k8s image has no jq, so the alert fetch step only talks to the
cluster; all JSON filtering/dedup/gating lives in the ci-claude step.

Cron registration (after this lands on master):
  woodpecker repo cron add --repo gitea_admin/homelab \
    --name alert-monitor --branch master --schedule '*/15 * * * *'
  woodpecker repo cron add --repo gitea_admin/homelab \
    --name issue-fix --branch master --schedule '41 * * * *'

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NV7bZzZLeoFUEdAeCSLEei
2026-07-16 09:11:51 +02:00
k.renner 9170c4cf36 Merge pull request 'fix(shelly-manager): wire ADMIN_PASSWORD — app fails closed since auth hardening' (#246) from fix/shelly-manager-admin-password into master
Reviewed-on: gitea_admin/homelab#246
2026-07-15 23:04:45 +00:00
claude-botandClaude Opus 4.8 4c04069d26 feat(claude-workstation): off-site headless Claude Code host on nas-2
Always-on Debian VM (Synology VMM, off-site nas-2) running Claude Code for
reattachable tmux sessions plus an unattended, hardened, bounded notes-distill
timer. Scheduled repo/report jobs stay in-cluster (Woodpecker cron); this host
holds no cluster-write creds.

- ansible/roles/claude-workstation: two credential-isolated Unix users
  (interactive vs unattended), Node 22 + Claude Code, per-user claude-bot creds
  and OAuth token (never --bare), Syncthing notes sync, daily distill timer with
  systemd hardening + wall-clock kill, staged deny-default nftables egress
  allowlist (ships DISABLED) with a DNS-refreshed allow set.
- ansible/plays/install-claude-workstation.yml + .woodpecker pipeline +
  inventory group, mirroring the netbird-proxy off-site host pattern.
- kubernetes/apps/claude-workstation: read-only `view` ServiceAccount + token
  (no talosconfig, no age key; view excludes Secrets).
- RUNBOOK.md: manual VM creation (cloud-init), networking (mesh + scoped
  site-to-site backup), SA kubeconfig assembly, vault keys, egress cutover,
  rotation, and cattle DR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 19:07:25 +02:00
claude-botandClaude Fable 5 86f9fbe8af fix(shelly-manager): wire ADMIN_PASSWORD/API key — app fails closed since auth hardening
The public-release auth work (shelly-manager PR #38) makes the app refuse
to start without ADMIN_PASSWORD; Flux promoted the new image and the pod
went CrashLoopBackOff. Adds the shelly-manager-auth ExternalSecret
(OpenBao: apps/home-assistant/shelly-manager-auth) and the env wiring,
repoints both probes to the new unauthenticated /health endpoint (closes
the long-standing probe gap — / would now 302 to /login), and updates the
stale 'app has no auth of its own' annotation: the macvlan bind pinning
stays as defense in depth.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 18:41:51 +02:00
security-bot 569252995b chore(image-automation): bump ghcr.io/immich-app/immich-machine-learning:v3.0.3
Updates managed by image-automation-controller.
2026-07-15 14:56:30 +00:00
security-bot 8b31155a6f chore(image-automation): bump ghcr.io/immich-app/immich-server:v3.0.3
Updates managed by image-automation-controller.
2026-07-15 14:47:02 +00:00
security-bot 1694699e34 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784122031
Updates managed by image-automation-controller.
2026-07-15 13:58:13 +00:00
security-bot 36f6ffefe0 chore(image-automation): bump netbirdio/netbird:v0.74.6-rootless
Updates managed by image-automation-controller.
2026-07-15 12:57:54 +00:00
k.renner 5b5fdf22e7 Merge pull request 'fix(zone-configurator): raise memory limit 256Mi→512Mi + add liveness probe' (#245) from fix/zone-configurator-memory-limit into master
Reviewed-on: gitea_admin/homelab#245
2026-07-15 07:16:20 +00:00
claude-botandClaude Opus 4.8 5a6a47733d fix(zone-configurator): 256Mi→512Mi Memory-Limit + Liveness/Readiness-Probe
Der Configurator-Pod hing (UI nicht erreichbar, "No Room Selected" beim
Zonen-Editieren, Live-Tracking eingefroren): RSS lag bei 254Mi/256Mi und
~0,95 CPU-Kerne – klassisches Node/V8 GC-Thrashing am cgroup-Memory-Limit.
Der Prozess blieb knapp unter dem Limit, wurde also nie OOMKilled und kam
nie von selbst zurück; ein Neustart hat ihn befreit (frisch ~115Mi).

- limits.memory 256Mi → 512Mi (Headroom gegen GC-Thrash), requests.memory
  64Mi → 128Mi (realistischere Baseline).
- Liveness/Readiness httpGet auf / (Port http). Bisher gab es keine Probe,
  daher hat kubelet den hängenden Server nie neu gestartet. Jetzt schlägt
  die Probe beim Einfrieren fehl und der Pod wird automatisch recycelt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 09:08:25 +02:00
k.renner 58d36c28b6 Merge pull request 'feat(zone-configurator): Authentik-gated ingress (zone-configurator.home.renner.uno)' (#244) from feat/zone-configurator-authentik-gate into master
Reviewed-on: gitea_admin/homelab#244
2026-07-15 06:14:51 +00:00
claude-botandClaude Opus 4.8 a9cb28949f feat(zone-configurator): Authentik-gated ingress an zone-configurator.home.renner.uno
Der Everything-Presence mmWave Zone-Configurator lief bereits im Cluster
(Deployment in ns home-assistant, UI :42069), war aber nur ClusterIP-intern
erreichbar. Er hält ein HA Long-Lived Token und kann die ESPHome-Zonen-Entities
aller Präsenzmelder umschreiben, hat aber keine eigene Auth — daher wird er
(wie vscode/shelly-manager/esphome) hinter ein Authentik Passkey-Gate gelegt,
nicht nackt exponiert.

Neu:
- Authentik-Blueprint zone-configurator-gate: Group "Zone Configurators"
  (k.renner), ProxyProvider (passkey-stepup, internal_host …:42069,
  external_host zone-configurator.home.renner.uno), Application, PolicyBinding,
  dedizierter Outpost.
- ExternalName-Service ak-outpost-zone-configurator-gate + Traefik-Ingress
  (cert-manager letsencrypt-cluster) im app-Verzeichnis.
- Cilium-Egress (authentik) + Ingress-Allow (home-assistant-ns) für
  outpost -> zone-configurator:42069. Port 42069 ist eindeutig (wie esphome
  :6052), daher kein Port-Overlap mit anderen Apps.

Traffic: browser -> traefik -> ak-outpost-zone-configurator-gate -> Outpost
(Passkey) -> zone-configurator.svc:42069.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 08:12:15 +02:00
security-bot fc861a1683 chore(image-automation): bump netbirdio/netbird:v0.74.5-rootless
Updates managed by image-automation-controller.
2026-07-14 19:57:36 +00:00
security-bot 38fc970a37 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784057132
Updates managed by image-automation-controller.
2026-07-14 19:28:12 +00:00
k.renner 4bec0cdc01 Merge pull request 'fix(woodpecker): contain the privileged woodpecker-ci CI namespace (#193)' (#235) from fix/issue-193-woodpecker-ci-hardening into master 2026-07-14 19:20:33 +00:00
claude-botandClaude Opus 4.8 a07e54ec6a fix(woodpecker): contain the privileged woodpecker-ci CI namespace (#193)
The woodpecker-ci namespace enforces pod-security `privileged` (required for
the allow-listed docker/buildx plugin), Woodpecker runs WOODPECKER_OPEN=true,
and no admission controller exists. PodSecurity is all-or-nothing per
namespace, so the buildx exemption also un-gates hostPath/hostNetwork/hostPID/
hostIPC and privileged on every step pod a pipeline author can shape.

Reduce the blast radius with three defense-in-depth controls, none of which
weaken the actual build capability (this repo's builds use rootless kaniko;
only the external buildx plugin needs privileged, and it stays allow-listed):

- ValidatingAdmissionPolicy (GA/in-tree on k8s v1.35, no new controller):
  denies host namespaces + hostPath for all step pods, and privileged for
  every image except woodpeckerci/plugin-docker-buildx. Re-narrows the
  PodSecurity exemption at the authoritative K8s admission layer. CEL verified
  to compile via server-side dry-run.
- CiliumNetworkPolicy: ingress default-deny for step pods (house style,
  egress left default-allow so builds keep reaching the internet + Gitea).
- ResourceQuota + LimitRange: bound pods/CPU/memory/PVCs against a
  resource-exhaustion DoS; sized generously so current builds are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 21:17:37 +02:00
k.renner aaf880c55f Merge pull request 'security(cilium): stop committing CA + Hubble private keys (Fixes #188)' (#239) from fix/issue-188-cilium-keys into master 2026-07-14 19:10:52 +00:00
k.renner 4bfe98fa3a Merge pull request 'fix(opentofu): enable S3 versioning on Hetzner object storage buckets' (#227) from fix/issue-191 into master
ci/woodpecker/push/deploy-infrastructure Pipeline failed
2026-07-14 19:08:16 +00:00
k.renner d1faf94d75 Merge pull request 'CNPG disaster-recovery runbook + correct stale recovery comments (Fixes #190)' (#224) from fix/issue-190-cnpg-recovery into master 2026-07-14 19:08:09 +00:00
k.renner 1cef24475c Merge pull request 'docs: document SOPS age-key and Ansible Vault password backup procedure' (#228) from fix/issue-210 into master 2026-07-14 19:08:01 +00:00
security-bot e3286565e4 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784054477
Updates managed by image-automation-controller.
2026-07-14 18:42:59 +00:00
security-bot a551909f40 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784053385
Updates managed by image-automation-controller.
2026-07-14 18:24:42 +00:00
k.renner 37e364c58f Merge pull request 'fix(gatus): trim public status page to stop internal topology disclosure (Fixes #206)' (#243) from fix/issue-206 into master 2026-07-14 18:24:04 +00:00
claude-botandClaude Opus 4.8 db04f6f1c3 fix(gatus): trim public status page to stop internal topology disclosure (#206)
status.renner.uno / status.k.renner.uno is a public, unauthenticated gatus
page. Its endpoints named the internal service estate (Authentik, Gitea,
Immich, Grafana, HA, Paperless, Proxmox, PBS, UDM DNS, Mosquitto) and gatus
exposed each check's target hostname/URL/port — and on failure the error
text (e.g. mosquitto.home-assistant.svc.cluster.local, 10.2.40.1) — via the
public results and /api/v1/endpoints/statuses API (all hide-* default false).

Per owner decision keep the page public (not Authentik-gated) but scrub the
disclosure:
- rename every endpoint to an opaque label (Web Service N / Infrastructure N),
  removing product/vendor/hostname identifiers from the public `name`
- add a per-endpoint ui block with hide-hostname/hide-url/hide-port/
  hide-conditions/hide-errors: true so gatus scrubs targets server-side

All checks keep running unchanged (real targets stay in `url`, visible only
to git/cluster operators). Public page now shows group + opaque label +
up/down + response time only. Maintainer opaque->real map kept as a comment.

Fixes #206

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 20:21:56 +02:00
k.renner f9c5d53ec7 Merge pull request 'fix(ansible): restrict woodpecker-ci SSH key to pod network, drop dead ci-new key (Fixes #184)' (#242) from fix/issue-184 into master 2026-07-14 18:18:25 +00:00
claude-botandClaude Opus 4.8 94c6d5d71e fix(ansible): restrict woodpecker-ci SSH key to the pod network, drop dead ci-new key
The CI automation keys were deployed to root's (and ladmin's) authorized_keys
on every host with no key_options, giving any holder of a CI key unrestricted
root fleet-wide (issue #184).

- Restrict woodpecker-ci@homelab with from="10.244.0.0/16,fd10:244::/48" — a
  network-of-origin restriction to the cluster pod CIDRs, so the key only
  authenticates from within the CI's network segment. Determined by inspecting
  Cilium: routing-mode=tunnel with enable-ipv4-masquerade=true but
  ipv4-native-routing-cidr=10.0.0.0/8 (and v6 fd00::/8), which covers every
  10.2.x / fd.. LAN SSH target, so pod egress to the fleet is NOT SNAT'd to the
  node IP — pods present their real POD IP, BGP-advertised to the UDM
  (cilium-bgp.yaml). The stable boundary is therefore the pod subnet
  (talos cluster.yaml podSubnets: 10.244.0.0/16 + fd10:244::/48), which
  survives node DHCP-lease churn and pod rescheduling across k8s-1/2/3 — unlike
  pinning any node's current (DHCP) IP. Value lives in group_vars/all/vars.yml
  (ci_ssh_from_cidrs) as the single source of truth.
- Remove ansible-runner@ci-new entirely from the play, the common role, and
  common_ssh_public_keys — dead key, no such host exists anywhere in the repo.
- Keep krenner@fortress (human) unrestricted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 20:13:40 +02:00
k.renner bab4a62ced Merge pull request 'fix(velero): remove dead bootstrap-restore Job (Fixes #200)' (#241) from fix/issue-200 into master 2026-07-14 18:10:35 +00:00
security-bot 09aca0404c chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784052517
Updates managed by image-automation-controller.
2026-07-14 18:10:25 +00:00
claude-botandClaude Opus 4.8 952e61507f fix(velero): remove dead bootstrap-restore Job (Fixes #200)
The velero-bootstrap-restore Job (restore-job.yaml + its RBAC) was never
wired into any Flux Kustomization — no `path` field in
kubernetes/clusters/homelab/ referenced it, and the parent
infrastructure/kustomization.yaml only aggregates `velero/`, not
`velero-bootstrap-restore/`. It never ran, creating false confidence that
app-data auto-restore-on-bootstrap existed.

Per owner decision on #200: delete it and rely on the documented manual
restore procedure in kubernetes/RUNBOOK-cold-rebuild.md. The real seed
path is the seed-* Kustomizations (rsync from legacy host) plus the
per-app restore steps in the runbook.

Also updates two now-dangling doc comments in
post-crds/velero-schedules.yaml that referenced the deleted Job's
SCHEDULES mechanism, pointing them at the runbook instead.

kubectl kustomize on infrastructure/ and infrastructure/post-crds/ both
build clean after removal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 20:07:21 +02:00
k.renner ab018cc253 Merge pull request 'fix(bootstrap): break Flux<->Gitea circular bootstrap (Fixes #187)' (#226) from fix/issue-187-flux-gitea-bootstrap into master 2026-07-14 17:54:39 +00:00
claude-botandClaude Opus 4.8 2aa0989a8a fix(bootstrap): wire GitHub break-glass source to break Flux<->Gitea loop
Flux pulls manifests from the in-cluster Gitea, which is itself Flux-managed
(Ceph data, in-cluster DNS+Traefik), so a cold rebuild has no entry point.
Give it one:

- bootstrap.sh: FLUX_SOURCE=github selects 'flux bootstrap github' against the
  mirror (github.com/konairius/Homelab, branch master) instead of
  'flux bootstrap gitea'; defaults to gitea so steady-state is unchanged.
- kubernetes/RUNBOOK-cold-rebuild.md: single tofu->talos->flux->openbao->apps
  runbook, with the break-glass github bootstrap and the manual OpenBao
  snapshot-restore+unseal step wired in.

The GitHub mirror is already kept current by Gitea's own native push-mirror
(server-side, sync_on_commit=true) — no setup and no new credential required;
the runbook just references it. OpenBao restore stays manual (unseal key out
of CI, in pass).

Refs #187

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 19:53:28 +02:00
security-bot 6f87b2640a chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784051271
Updates managed by image-automation-controller.
2026-07-14 17:49:51 +00:00
k.renner 8ab5282b82 Merge pull request 'fix(opentofu): remove retired Gitea/Woodpecker LXC state drift (Fixes #199)' (#232) from fix/issue-199-tofu-state-drift into master
ci/woodpecker/push/deploy-infrastructure Pipeline failed
2026-07-14 17:41:09 +00:00
k.renner 22320f0f7c Merge pull request 'fix(openbao): add crowdsec to ClusterSecretStore namespaceSelector' (#240) from fix/openbao-css-crowdsec into master 2026-07-14 17:11:00 +00:00
security-bot c03df26203 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784048946
Updates managed by image-automation-controller.
2026-07-14 17:10:43 +00:00
claude-botandClaude Opus 4.8 82918c86a7 fix(openbao): add crowdsec to ClusterSecretStore namespaceSelector
PR #231 scoped the openbao ClusterSecretStore to the 12 namespaces that
had ExternalSecrets at the time. PR #236 then added a new consumer in the
crowdsec namespace (the bouncer key), which the selector refused
(SecretSyncedError). Add crowdsec to the allowed namespaces.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 19:10:37 +02:00
k.renner 98b1b1a153 Merge pull request 'fix(crowdsec): move bouncer key from cleartext Secret to OpenBao ExternalSecret' (#236) from fix/issue-212 into master 2026-07-14 17:04:47 +00:00
k.renner b1dec3e764 Merge pull request 'fix(ci): sandbox update-audit agent against prompt-injection exfil' (#238) from fix/issue-197 into master 2026-07-14 15:27:21 +00:00
k.renner 0a53419cd6 Merge pull request 'fix(openbao): harden secrets backend (prune-guard, versioned policy, store scoping, egress) — Fixes #202' (#231) from fix/issue-202-openbao-hardening into master 2026-07-14 15:25:36 +00:00
security-bot 55e444a8c4 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784042235
Updates managed by image-automation-controller.
2026-07-14 15:18:50 +00:00
k.renner 1e0af78a47 Merge pull request 'fix(traefik): add security-headers + rate-limit Middlewares as entrypoint defaults' (#229) from fix/issue-205 into master 2026-07-14 15:13:56 +00:00
k.renner 50f4cd0959 Merge pull request 'decommission test-browser (KasmWeb): remove app per owner directive' (#218) from fix/issue-195 into master 2026-07-14 15:11:08 +00:00
k.renner fa99b9081a Merge pull request 'fix(velero): add apps-daily schedule covering Gitea/Woodpecker PVCs' (#223) from fix/issue-186 into master 2026-07-14 15:08:23 +00:00
security-bot daf4c232b8 chore(image-automation): bump quay.io/ceph/ceph:v19.2.5
Updates managed by image-automation-controller.
2026-07-14 14:14:10 +00:00
k.renner 209be02796 Merge pull request 'Fixes #208 (partial): remove confirmed-dead stale artifacts' (#221) from fix/issue-208-stale-artifacts into master 2026-07-14 11:05:46 +00:00
claude-bot ab3c4581d5 fix(velero): add apps-daily schedule covering Gitea/Woodpecker PVCs
The apps namespace (Gitea, Woodpecker, gatus) had no Velero schedule at
all, so the in-cluster Gitea (data-gitea-0, the Flux GitOps source of
truth) and Woodpecker (data-woodpecker-server-0) PVCs migrated from the
legacy LXCs were unprotected. The only PBS coverage (opentofu/backup_jobs.tf
VMID 114/231) targets the original LXCs, not the live cluster PVCs.

Add an apps-daily Schedule (06:45 local, next free stagger slot) mirroring
the existing PVC-only pattern; no CNPG cluster runs in this namespace so no
labelSelector exclusion is needed. Also register it in the bootstrap-restore
Job's SCHEDULES list so a fresh-cluster bootstrap restores it like the
others.

Fixes #186

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 13:04:28 +02:00
k.renner 53d08c3e1c Merge pull request 'fix(network-policies): default-deny CNP for external-secrets namespace' (#237) from fix/issue-194 into master 2026-07-14 11:03:33 +00:00
k.renner 331351a4b0 Merge pull request 'fix(velero): add home-assistant-daily Schedule for 9 uncovered PVCs' (#217) from fix/issue-192 into master 2026-07-14 11:00:25 +00:00
k.renner 0dc687143a Merge pull request 'fix(image-automation): bound the netbird-ingress semver range' (#222) from fix/issue-204 into master 2026-07-14 10:58:26 +00:00
k.renner 2198c61d88 Merge pull request 'feat(k8s): PodDisruptionBudgets for single-replica stateful workloads' (#234) from fix/issue-201 into master 2026-07-14 10:56:10 +00:00
security-bot 7a12ae1198 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784026451
Updates managed by image-automation-controller.
2026-07-14 10:55:52 +00:00
k.renner 5681da8ccd Merge pull request 'fix(ci): pin base image digests, verify tool checksums, pin claude-code version' (#233) from fix/issue-209 into master
ci/woodpecker/push/build-ci-images Pipeline was successful
2026-07-14 10:54:49 +00:00
k.renner 35b96f8a49 Merge pull request 'fix(certificates): remove unverified authentik cert fetch into system CA trust' (#230) from fix/issue-185 into master 2026-07-14 10:53:26 +00:00
k.renner e94a92e9bb Merge pull request 'chore(ansible): delete decommissioned legacy roles (immich, grafana-observability, keepalived, postgres-simple-ha)' (#225) from fix/issue-198 into master 2026-07-14 10:51:21 +00:00
k.renner ecf4c7f492 Merge pull request 'fix(ansible): guard archived destructive plays with confirm_destroy' (#219) from fix/issue-207 into master 2026-07-14 10:51:08 +00:00
k.renner 3e84d07d40 Merge pull request 'fix(ci): gate plan/deploy pipelines to master, close secret-exfil path' (#215) from fix/issue-196 into master 2026-07-14 10:50:58 +00:00
k.renner e435415ca1 Merge pull request 'feat(shelly-manager): SA + RBAC for ESPHome firmware pipeline' (#214) from feat/shelly-manager-firmware-rbac into master
Reviewed-on: gitea_admin/homelab#214
2026-07-14 10:50:57 +00:00
k.renner 22369b59f3 Merge pull request 'fix(opentofu): remove tracked tfplan file and add to .gitignore' (#220) from fix/issue-213 into master
ci/woodpecker/push/deploy-infrastructure Pipeline failed
2026-07-14 10:47:24 +00:00
claude-bot 82292ee479 security(cilium): stop committing CA + Hubble private keys; generate in-cluster
The Talos bootstrap inline manifest (patches/cilium-cni.yaml) and its
standalone copy (cilium.yaml) embedded Secret/cilium-ca (RSA ca.key) and
Secret/hubble-server-certs (RSA tls.key) as plaintext base64 — rendered
Helm output from hubble.tls.auto.method=helm. Anyone with repo/history
read access could mint certs under the Cilium CA and impersonate/decrypt
the Hubble mTLS channel.

Switch to hubble.tls.auto.method=cronJob: replace the two committed-key
Secrets with the certgen ServiceAccount/Role/RoleBinding/Job/CronJob.
The Job generates (and the CronJob renews) Secret cilium-ca and issues
Secret/hubble-server-certs in-cluster at install. No private key material
is committed. Verified with `helm template cilium/cilium --version 1.19.2`:
the only delta between the two methods is exactly these 7 resources; the
ConfigMap and cilium-agent DaemonSet are unchanged, and the agent's
hubble-tls volume is already optional:true so it starts before certgen
runs. Both files and the inline block scalar validated as YAML.

This is the code half of the fix. Rotating the already-leaked live CA +
Hubble certs and scrubbing them from git history is an operator task
tracked on the issue.

Refs #188
2026-07-14 12:30:46 +02:00
claude-bot f354cb2862 chore(ansible): delete decommissioned legacy roles (immich, grafana-observability, keepalived, postgres-simple-ha)
Owner confirmed on #225 that all five roles flagged in #198 are legacy and
were decommissioned some time ago; the earlier inventory-presence liveness
check was wrong (inventory has stale entries for services migrated into the
k8s cluster). So instead of sanitizing committed secrets, remove the dead
code that held them.

Deleted role directories (all owner-confirmed legacy):
- ansible/roles/immich            -> now runs in-cluster (kubernetes/apps/immich, secrets via OpenBao ESO)
- ansible/roles/grafana-observability -> dashboards now live in kubernetes/apps/monitoring/dashboards
- ansible/roles/postgres-simple-ha
- ansible/roles/keepalived-ntp
- ansible/roles/keepalived-vip

Deleted plays that exclusively orchestrate the deleted legacy roles:
- ansible/plays/install-immich.yml
- ansible/plays/configure-grafana-observability.yml
- ansible/plays/backup-immich-db.yml            (one-time migration dump from legacy LXC 225)
- ansible/plays/configure-immich-db-password.yml (loads the deleted immich role)

Edited (kept, live):
- ansible/plays/update.yml -> dropped the `import_playbook: install-immich.yml`
  line so the CI update path (.woodpecker/update-all.yml -> plays/update.yml)
  keeps working.

NOT touched (ambiguous — reference companion roles the owner did NOT list as
legacy; flagged on #225 for owner decision, no dangling roles deleted here):
- install-ntp-ha.yml        (also uses chrony-ntp-server)
- install-proxmox-dns-ha.yml (also uses proxmox-dns, which is still live)
- install-authentik-ha.yml   (also uses authentik-stateless)
These three plays now reference deleted keepalived-*/postgres-simple-ha roles;
their companion roles + inventory groups need an owner call before removal.

Refs #198, #225. Coordinates with #208 (decommission sweep) for immich.
2026-07-14 12:26:11 +02:00
claude-bot e643533141 fix(ci): sandbox update-audit agent against prompt-injection exfil
Closes gitea issue #197. The update-audit agent fetches untrusted
third-party release pages via WebFetch/WebSearch and its Write output
is posted verbatim to a public Gitea issue, so injected content in a
fetched page could try to redirect the agent's behavior. Harden the
tool surface (verified empirically against the pinned Claude Code CLI):

- Drop WebSearch: it cannot be domain-scoped like WebFetch, and the
  prompt already gives explicit source URLs or a well-known registry
  for everything it needs to look up.
- Add ci/agents/update-audit/settings.json (loaded via --settings) that
  denies Read on /proc, /root, /home, /etc, and the repo's own .git/ —
  closing the credential-file and env-var-dump read paths a
  prompt-injected instruction could otherwise try. Verified this deny
  mechanism actually blocks reads, unlike Write path-scoping, which
  was tested and found NOT enforced under --permission-mode acceptEdits
  (documented in the pipeline comment; a full WebFetch domain allowlist
  was also considered and rejected, since Helm chart lookups legitimately
  hit whichever domain each HelmRelease's own trusted source URL points
  at).
- prompt.md now tells the agent fetched content is untrusted data, not
  instructions, and to never echo it verbatim into the report.

Not fixed here: GITEA_TOKEN is still the broad registry/release-writing
token (no write:issue-only token exists yet) — that requires an
operator to mint one; tracked via a comment on #197 and a code comment
at the secret binding.
2026-07-14 12:19:48 +02:00
claude-bot 2c349f728b scope down: drop woodpecker-ci and openbao egress, already covered elsewhere
PR #235 (fix/issue-193-woodpecker-ci-hardening) already adds
kubernetes/infrastructure/network-policies/woodpecker-ci-ns.yaml, with a
deliberately different (and better-informed) egress design: default-allow,
because a past attempt at egress enforcement in this namespace broke
crowdsec (66dbe9f) — history this branch didn't have context on.

PR #231 (fix/issue-202-openbao-hardening) already adds an egress block to
openbao-ns.yaml as part of a broader OpenBao hardening pass, including a
"world" allowance (OIDC) this branch's version omitted.

Dropping both here to avoid shipping a conflicting/duplicate policy;
external-secrets-ns.yaml (this issue's third gap, not covered by any other
open PR) is the only change left on this branch.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:14:40 +02:00
claude-bot 880bc9c9ac fix(crowdsec): move bouncer key from cleartext Secret to OpenBao ExternalSecret
bouncer-key.yaml committed the CrowdSec<->ingress-nginx bouncer key in
cleartext across two namespaces, outside the ESO/OpenBao pattern used
elsewhere in the cluster. Replace both Secrets with ExternalSecrets
pulling the same value from a single OpenBao KV path
(infrastructure/crowdsec-bouncer-key), matching the existing
apps/infrastructure ExternalSecret convention.

Requires the owner to populate OpenBao before merge:
  bao kv put -mount=homelab infrastructure/crowdsec-bouncer-key key=<value>

Fixes #212
2026-07-14 12:12:33 +02:00
claude-bot 8311ed12d3 fix(network-policies): default-deny CNPs for external-secrets, woodpecker-ci; openbao egress
Closes the gaps from #194: external-secrets and woodpecker-ci had no
CiliumNetworkPolicy at all (Cilium defaults to allow-all absent one), and
openbao-ns.yaml had an ingress-only CNP with no egress block, which leaves
egress from openbao pods completely unenforced rather than merely permissive.

- external-secrets-ns.yaml: default-deny-ingress; egress scoped to the
  namespace, DNS, and the openbao KV API on :8200 (the only
  ClusterSecretStore in this cluster) plus host/remote-node for
  kube-apiserver (webhook admission, Secret watch/create, leader election).
- woodpecker-ci-ns.yaml: this namespace hosts only ephemeral, sometimes
  privileged, pipeline-defined step pods (no static workloads) — the goal
  is blocking lateral movement into unrelated namespaces while still
  allowing the git clone (east-west via k8s_gateway -> traefik, since
  gitea.renner.uno now has an in-cluster Ingress) and the broad internet
  egress every CI system legitimately needs (image pulls, package
  managers).
- openbao-ns.yaml: added an egress block (DNS, intra-namespace, host/
  remote-node for the k8s auth method + kubelet) so egress enforcement is
  actually turned on, not just missing.

music-assistant is deliberately NOT covered here: its only workload runs
hostNetwork: true, so a namespace-scoped CiliumNetworkPolicy would select
no enforceable pod-network endpoint and be a no-op (same documented
limitation as the rook-ceph Ceph daemons). Left for a comment on #194
rather than shipping a policy that looks protective but isn't.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:11:33 +02:00
claude-bot 2feec4b193 fix(ci): pin base image digests, verify tool checksums, pin claude-code version
ci/woodpecker/push/build-ci-images Pipeline was successful
Addresses #209. All four ci/images/*/Containerfile FROM lines were
tag-pinned only (alpine:3.21, node:22-alpine), letting the base silently
change between builds. Pin each to its current manifest-list digest.

ci/images/k8s/Containerfile downloaded talosctl, kubectl, and velero via
curl with no integrity check, and installed flux via `curl | bash`
(itself an unpinned, unverified fetch-and-execute). Replace the flux
install with a pinned-version tarball download verified against its
published sha256 checksum, same as talosctl/kubectl/velero now are.
kubectl's version was also resolved dynamically from dl.k8s.io's
stable.txt at build time instead of being pinned; add KUBECTL_VERSION.

ci/images/tofu/Containerfile's tofu.zip download gets the same
sha256 verification.

ci/images/claude/Containerfile's CLAUDE_CODE_VERSION defaulted to
`latest` and was never overridden by build-ci-images.yml, so the image
holding repo/issue-write tokens floated to whatever npm resolved at
build time. Pin it to the current release (2.1.209).

Checksums and digests verified against the respective registries/release
APIs at fix time (2026-07-14).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:10:41 +02:00
claude-botandClaude Opus 4.8 2a76fd3689 feat(k8s): add PodDisruptionBudgets for single-replica stateful workloads
Adds minAvailable:1 PDBs for the data-bearing single-replica StatefulSets
that had no eviction protection: gitea, woodpecker-server, and paperless's
protonmail-bridge + syncthing sidecars. On a 1-replica workload this makes
the eviction API refuse *voluntary* evictions, so a node drain blocks and
surfaces the pod instead of yanking a live SQLite DB / RWO-PVC pod mid-write.
Involuntary disruptions (node crash, OOM) are unaffected.

Deliberately excluded, with rationale:
- CNPG clusters im-pg and gf-pg (instances:1): CloudNativePG intentionally
  omits a primary PDB for single-instance clusters (no failover target), and
  handles graceful primary shutdown itself. A manual maxUnavailable:0 would
  only wedge node drains with no HA benefit.
- Ceph mons: the Rook operator self-manages quorum-preserving mon/OSD PDBs
  (disruptionManagement.managePodBudgets default). A hand-written PDB would
  be redundant or fight the operator on each reconcile.
- Stateless single-replica Deployments (redis/tika/gotenberg caches, etc.):
  a blocking PDB gives no recoverability benefit, only blocks drains.

Refs #201

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 12:10:11 +02:00
claude-bot e3e8f57838 fix(certificates): remove unverified authentik cert fetch into system CA trust
The certificates role fetched https://authentik.renner.uno with
validate_certs: false and fed whatever it got back into
update-ca-certificates on every Ansible-managed host — an on-path/DNS
attacker during that fetch could plant a rogue CA cluster-wide.

authentik.renner.uno also turned out to be a stale hostname: it isn't
routed by the current Traefik/cert-manager ingress. The live service
(auth.renner.uno) already gets a publicly-trusted Let's Encrypt cert via
cert-manager, which the OS default CA bundle already trusts. Nothing else
in the repo depends on the installed authentik.crt, so removing the task
(and its now-unused handler) closes the hole with no functional loss.

Fixes #185

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:08:00 +02:00
claude-bot 0adf39c8a2 docs(kubernetes): decouple SOPS age-key backup from Phase 4 gate, document vault-password backup
Issue #210: neither the SOPS age key nor ANSIBLE_VAULT_PASSWORD has a
documented offline backup location. The age-key archive was previously
bundled into the Phase 4 point-of-no-return checklist, blocking it on the
reconcile/unseal soak for no reason — backing it up to pass is safe to do
immediately since it only adds a copy. Also documents a pass location and
verification procedure for the Ansible Vault password, which gates PBS and
other Ansible-Vault-encrypted credentials and had no backup plan at all.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:07:50 +02:00
claude-bot a33a186bf8 fix(traefik): add security-headers + rate-limit Middlewares as entrypoint defaults
Closes #205. The websecure entrypoint had zero response hardening and no
rate limiting — CrowdSec is detection-only since the 2026-06-27 IPv6
mass-ban outage, and no headers/rate-limit Middleware existed anywhere in
the cluster, so logins sat behind app-level throttling only.

Adds two Middlewares wired as entrypoint defaults via the same
additionalArguments mechanism the (still-detached) crowdsec-bouncer
Middleware documents for its own re-enable:

- security-headers: HSTS, nosniff, xss-filter, referrer-policy,
  permissions-policy, and a conservative frame-ancestors 'self' CSP
  (deliberately not a full default-src policy — apps here span Paperless,
  Immich, Grafana, Gitea, Home Assistant, etc. with very different
  script/style/font sources).
- rate-limit: generous defaults (100 req/s, burst 200) as a baseline
  abuse/brute-force backstop rather than traffic shaping, keyed off the
  real client IP via sourceCriterion.ipStrategy.excludedIPs (same trusted
  pod CIDRs as forwardedHeaders/crowdsec-bouncer) so it doesn't collapse
  every external client onto one shared budget — the same client-IP-
  visibility gap that caused the CrowdSec outage this fix is otherwise
  independent of.

CrowdSec enforcement itself stays disabled; that re-enable is separate,
documented, unaddressed work.
2026-07-14 12:07:44 +02:00
claude-botandClaude Opus 4.8 f9ace472fe fix(openbao): harden secrets backend (prune-guard, versioned policy, store scoping, egress)
Addresses the safely-codeable items of the #202 hardening bundle:

- snapshot-pvc: add kustomize.toolkit.fluxcd.io/prune: disabled so the sole
  supported restore artifact (raft snapshots PVC) survives a manifest
  rename/move, matching sibling data PVCs.
- policies/eso-read.hcl: version-control the eso-read policy that only lived
  as a heredoc in the migration doc + live config; reference-only (OpenBao
  policies aren't Flux-reconciled), with apply/verify commands inline.
- clustersecretstore: add conditions restricting the store to the exact
  current consumer namespaces, closing the "any namespace can read all of
  homelab/*" gap.
- network-policies/openbao-ns: add an egress stanza (default-deny egress,
  allowing intra-ns, kube-dns, kube-apiserver/host, world, ICMP) to block
  lateral in-cluster egress from the secrets backend.

Listener TLS/mTLS and per-app KV path re-segregation are the disruptive
remaining items and are raised as owner decisions on #202. Single-replica
raft is a documented/accepted tradeoff, not touched.

Fixes #202

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 12:07:40 +02:00
claude-botandClaude Opus 4.8 f006497378 fix(opentofu): remove retired Gitea/Woodpecker LXC state drift
ci/woodpecker/push/deploy-infrastructure Pipeline failed
gitea (LXC 114), the woodpecker server (231) and the woodpecker agents
(910/911) were migrated into the cluster (Phase 2: Service flipped
ExternalName -> ClusterIP, now in-cluster StatefulSets/Deployment; see
kubernetes/apps/MIGRATION-gitea-woodpecker.md) and the Proxmox guests
decommissioned -- but their OpenTofu declarations were left behind with
onboot/start = true. An unscoped `tofu apply` (deploy-infrastructure.yml)
would attempt to recreate the retired stack, and backup_jobs.tf still
advertised the dead VMIDs as PBS-protected.

- delete opentofu/woodpecker_agents.tf, lxc_231_woodpecker.tf,
  lxc_114_gitea_srv_renner_uno.tf
- drop VMIDs 114/231 and the 910.. agent loop from backup_jobs.tf
- remove the now-orphaned woodpecker_agents local + woodpecker_agent_count
  variable (only those files referenced them)
- delete the dead .woodpecker/deploy-woodpecker-agent.yml and
  install-woodpecker-server.yml pipelines (their ansible plays/roles no
  longer exist)

REQUIRES `tofu state rm` of the four module resources BEFORE this merges
/ any apply runs, otherwise the plan destroy-plans them. See PR body.

Refs #199

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 12:07:37 +02:00
claude-bot b028bf2336 fix(opentofu): enable S3 versioning on Hetzner object storage buckets
ci/woodpecker/push/deploy-infrastructure Pipeline failed
object_storage.tf provisioned all four Hetzner buckets (CNPG WAL/base
backups, Velero PVC backups, cluster bootstrap secrets, tfstate) with
object_locking = false and no versioning, so a single leaked/misused S3
credential could irrecoverably delete backups and state.

Add minio_s3_bucket_versioning for all four buckets: a plain
DeleteObject no longer destroys data, the prior version survives until
purged by version ID.

object_locking is NOT flipped to true here: per the aminueza/minio
provider source, object_locking is only consumed on bucket Create, has
no Update handling and no ForceNew, so setting it on these
already-live buckets would be silently ignored -- not a real fix.
Enabling it requires destroying and recreating each bucket (full data
migration), which needs an operator decision; left as a follow-up
(see gitea issue #191 comments).

Also add minio_s3_bucket_lifecycle noncurrent-version expiration
(30 days) on the two high-churn backup buckets (cnpg, velero) to match
the retention window already enforced at the app layer (CNPG Barman
ObjectStore retentionPolicy, Velero Schedule ttl), so old S3 versions
don't accumulate indefinitely. secrets/tfstate buckets are low-churn
and left uncapped.

Fixes #191

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:07:26 +02:00
claude-botandClaude Opus 4.8 260aec3d0b docs(seed): CNPG disaster-recovery runbook + correct stale initdb/recovery comments
The three backed-up CNPG clusters (ak-pg/im-pg/pprl-pg) bootstrap via
bootstrap.initdb, so a cold rebuild silently comes up with EMPTY databases:
barman WAL+base backups archive to Hetzner but are never wired back into a
rebuild, and the restore path was undocumented (issue #190).

- Add kubernetes/seed/RECOVERY.md: a tested manual recovery runbook with
  per-cluster bootstrap.recovery + externalClusters blocks, precondition
  checks, verify/revert steps, and a non-destructive CNPG restore-test drill.
- Explain the safety model: CNPG bootstrap is inert on a live cluster, so an
  initdb->recovery swap cannot clobber live data; recovery has no initdb
  fallback (hangs on an empty bucket), which is why permanent recovery is an
  owner decision, not flipped here.
- Fix the seed-authentik Flux KS comment that falsely claimed rebuilds
  auto-recover from Garage (decommissioned; backups are on Hetzner now).
- Point seed-immich / seed-paperless KS comments at the runbook.

Refs #190

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 12:07:15 +02:00
claude-bot 4ec322dfb6 fix(opentofu): remove tracked tfplan file and add to .gitignore
ci/woodpecker/push/deploy-infrastructure Pipeline failed
Remove opentofu/tfplan from git tracking (was committed with embedded
credentials). Add 'tfplan' and '*.tfplan' patterns to opentofu/.gitignore
to prevent future accidental commits. Embedded credentials already revoked.

Fixes #213

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:06:26 +02:00
claude-bot c107e0c00f fix(image-automation): bound the netbird-ingress semver range
netbird-ingress.yaml's ImagePolicy used ">=0.73.0" — unbounded above,
unlike every other of the 23 enrolled policies which pin to a major
(or major.minor). Since image-automation pushes bumps straight to
master with no PR gate, an unbounded range lets any future upstream
release (including a breaking 1.x) land automatically.

Bound it to "0.x", consistent with cnpg-barman-plugin's precedent for
pre-1.0 images: the currently deployed v0.74.4-rootless stays in
range, and a 1.x jump now requires a manual policy widen. Also adds
netbird-ingress to the README's enrolled-policies table, where it was
missing despite being wired into the kustomization.

Fixes #204 (partial — see issue comment for the scoped-token and
PR-gating items, which need an owner decision).

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:06:22 +02:00
claude-bot 2b2b9448d3 fix(ansible): guard archived destructive plays with confirm_destroy
remove_ceph_cpool.yml (fleet-wide zfs destroy on pve_cluster) and
cleanup-gitea-mess.yml (deletes gitea service/binary/config/user on
all:!gitea.srv.renner.uno) are archived but still directly runnable
with no confirmation guard. Add the same fail-task safety-switch
pattern already used in plays/update-dist-upgrade.yml, requiring
-e 'confirm_destroy=true' before either play executes.

Fixes #207
2026-07-14 12:06:00 +02:00
claude-bot b51e4cf6c1 decommission test-browser (KasmWeb): remove app per owner directive
Issue #195 flagged KasmWeb (browser.renner.uno) for having no Authentik
gate and hardcoded weak credentials. Owner comment overrides the
originally-proposed auth-gate fix: "can be decomissiond". Removes the
app dir, its apps/kustomization.yaml entry, the orphaned firefox
image-automation policy, and updates comments in the shared
insecure-backend ServersTransport and external-dns-unifi HelmRelease
that referenced test-browser as a consumer/example.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:05:43 +02:00
claude-bot 491d011398 fix(velero): add home-assistant-daily Schedule for the 9 uncovered PVCs
home-assistant, esphome, shelly-manager, matter-server, otbr, whisper,
speech-to-phrase, and zone-configurator all deploy into the
home-assistant namespace (per their Kustomization's `namespace:`
field, not their kubernetes/apps/ dir), and none of their PVCs were
covered by any Velero schedule -- including home-assistant-config,
which holds the .storage entity registry, recorder DB, and
secrets.yaml. Adds home-assistant-daily at the next free 06:45
stagger slot, PVC-scoped like the existing schedules.

Fixes #192
2026-07-14 12:05:28 +02:00
claude-botandClaude Opus 4.8 8a4d5719f2 chore(cleanup): remove confirmed-dead stale artifacts (partial #208)
Confirmed-dead, low-risk removals only. Ambiguous items (ansible immich
role, ansible-side proxmox-dns wiring) are left in place pending owner
confirmation; tofu LXC drift is owned by #199.

- cve_list.txt: orphaned agent output (added in f22927b), referenced by
  nothing; security-scan.yml uses trivy JSON outputs, not this file.
- .woodpecker/deploy-woodpecker-agent.yml: calls
  ansible/plays/install-woodpecker-agent.yml and role woodpecker-agent/,
  both of which no longer exist; push-trigger paths also gone.
- .woodpecker/install-woodpecker-server.yml: calls
  ansible/plays/install-woodpecker-server.yml, which no longer exists.
- kubernetes/apps/woodpecker/server.yaml: fix stale comment claiming the
  agent is replicas:0 (phase 2) with LXC agents still building —
  contradicted by agent.yaml replicas:1.

Fixes #208 (partial)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 12:05:13 +02:00
claude-bot 260baf7a3c fix(ci): gate plan/deploy pipelines to master, close secret-exfil path
deploy-infrastructure.yml's plan step ran tofu plan (which evaluates
provider/data-source code) on push to any branch, with proxmox/hetzner/unifi
secrets mounted — a malicious .tf on a feature branch could exfiltrate them
pre-merge. deploy-netbird-server.yml was missing the branch: master gate its
siblings (deploy-netbird-proxy.yml, deploy-woodpecker-agent.yml) already
have, so a push to any branch touching netbird-server files triggered a real
ansible deploy with SSH key, vault pass, and proxmox token.

Fixes #196

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 12:04:39 +02:00
claude-botandClaude Opus 4.8 33283754ba feat(shelly-manager): ServiceAccount + RBAC for ESPHome firmware pipeline
shelly-manager will build+flash BLE proxies by spawning short-lived
esphome Jobs (on the shelly-manager-iot macvlan → mDNS → OTA:3232) and
streaming their logs. Give it a namespace-scoped identity to do so:

- ServiceAccount shelly-manager + Role shelly-manager-firmware
  (jobs: create/get/list/watch/delete; pods: get/list/watch;
   pods/log: get) + RoleBinding. No cluster-wide, secret, or exec rights.
- Wire serviceAccountName into the Deployment.
- Sync esphome/shelly-ble-proxy.yaml logger to the lean level already
  OTA'd to the device (esp32_ble_client DEBUG, not VERBOSE) so the PVC
  stops filling; VERBOSE is now an on-demand diagnostic via the pipeline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:54:04 +02:00
security-bot 07c93e4aa3 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784021738
Updates managed by image-automation-controller.
2026-07-14 09:37:05 +00:00
security-bot 5d78e3ab81 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784021024
Updates managed by image-automation-controller.
2026-07-14 09:25:05 +00:00
security-bot 76c3905262 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784020215
Updates managed by image-automation-controller.
2026-07-14 09:16:01 +00:00
security-bot 9e0d555ca5 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784019615
Updates managed by image-automation-controller.
2026-07-14 09:01:39 +00:00
security-bot 6365b1b7de chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784019182
Updates managed by image-automation-controller.
2026-07-14 08:54:20 +00:00
security-bot 258d9995ad chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784018673
Updates managed by image-automation-controller.
2026-07-14 08:45:58 +00:00
security-bot 0631250e67 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784017466
Updates managed by image-automation-controller.
2026-07-14 08:34:54 +00:00
security-bot 3c4fa03d23 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784016459
Updates managed by image-automation-controller.
2026-07-14 08:12:44 +00:00
k.renner 5306c47600 Merge pull request 'feat(esphome): enable OTA + BLE debug logging on the shelly proxy' (#181) from feat/esphome-proxy-ota into master
Reviewed-on: gitea_admin/homelab#181
2026-07-14 07:39:20 +00:00
claude-bot 2990f6e425 feat(esphome): enable OTA + BLE debug logging on the shelly proxy
Provisioning a Shelly over BLE fails at the GATT connect and the cause is
inside the ESP's BLE stack — invisible from shelly-manager's side. To
diagnose and iterate without a USB re-flash per change:

  * ota: (esphome platform) so future config changes push over WiFi from the
    ESPHome Device Builder. Bootstrapping costs one USB flash; set
    shelly_ble_proxy_ota_password in the dashboard secrets first.
  * logger DEBUG with esp32_ble_client=VERBOSE / esp32_ble_tracker,
    bluetooth_proxy=DEBUG, so a connect attempt logs its progress and the
    failure reason.

Takes effect on the (one) USB re-flash; thereafter iterate remotely.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 09:19:59 +02:00
security-bot 1f1d8ea19a chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784011854
Updates managed by image-automation-controller.
2026-07-14 07:12:44 +00:00
security-bot 32d66baf92 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784011282
Updates managed by image-automation-controller.
2026-07-14 06:42:44 +00:00
security-bot 5dafcb9f03 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1784008879
Updates managed by image-automation-controller.
2026-07-14 06:12:44 +00:00
k.renner 7541ec5b23 Merge pull request 'fix(openbao): drop banned k. hostname → openbao.renner.uno + namespace CNP' (#180) from openbao-hostname-fix into master
Reviewed-on: gitea_admin/homelab#180
2026-07-14 06:06:31 +00:00
claude-botandClaude Fable 5 7cb7b9e0d1 fix(openbao): drop banned k.renner.uno hostname; fence namespace with CNP
openbao.k.renner.uno -> openbao.renner.uno. The k. subdomain is a
migration-era artifact, never a production convention, and is banned
per owner directive 2026-07-14 — the wiki note that claimed a
dual-hostname convention was wrong and is being corrected.

Non-public reachability is a real control, not a hostname: the public
edge serves only explicitly configured SNI (openbao is not configured),
and the new CiliumNetworkPolicy default-denies the namespace with
explicit grants (traefik->8200, ESO->8200, intra-ns for the snapshot
CronJob) matching the <app>-ns.yaml pattern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-14 08:03:19 +02:00
security-bot 9dfe35ae8b chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1783990880
Updates managed by image-automation-controller.
2026-07-14 01:12:44 +00:00
k.renner 94a3d7736f Merge pull request 'fix(dns): repoint k8s-gateway fallthrough off the decommissioned PVE DNS VIP' (#179) from worktree-fix-k8s-gateway-dns-upstream into master
Reviewed-on: gitea_admin/homelab#179
2026-07-14 00:56:49 +00:00
k.rennerandClaude Opus 4.8 12c2668865 fix(dns): repoint k8s-gateway fallthrough off the decommissioned PVE DNS VIP
The renner.uno fallthrough forwarder still pointed at the Proxmox DNS HA VIP
10.2.40.53, which is decommissioned/unreachable. Every non-Ingress renner.uno
name (device/service hostnames like udm.renner.uno) therefore dead-ended in
SERVFAIL/timeout. A routine home-assistant pod restart on 2026-07-14 forced HA
to re-resolve its device hostnames and left ~1374 entities unavailable / ~30
config entries stuck (ZHA, Shelly, UniFi, Bluetooth, cloud integrations).

Point the fallthrough at the UDM (10.2.40.1 / fd00::1), which serves the
split-horizon renner.uno zone (verified: it answers udm.renner.uno). Also
scrub the stale 10.2.40.53 references in the CoreDNS comment, bootstrap.sh
DNS_SERVER, and the Gatus monitor (which was pointlessly probing the dead VIP).

A live hotfix has already been applied to the k8s-gateway ConfigMap to restore
resolution; this makes it durable so Flux does not revert it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PwcQMntG9y9XRkNMPDq2fe
2026-07-14 02:53:33 +02:00
security-bot 1db8aa8247 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1783988815
Updates managed by image-automation-controller.
2026-07-14 00:42:44 +00:00
security-bot 5f7e10be51 chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1783987204
Updates managed by image-automation-controller.
2026-07-14 00:12:44 +00:00
k.renner 2e4fdff9e2 Merge pull request 'fix(openbao): restricted-PodSecurity compliance for snapshot CronJob' (#178) from openbao-snapshot-hardening into master
Reviewed-on: gitea_admin/homelab#178
2026-07-14 00:10:32 +00:00
claude-botandClaude Fable 5 476cfb2d12 fix(openbao): satisfy restricted PodSecurity in snapshot CronJob
allowPrivilegeEscalation=false + drop ALL capabilities on the snapshot
container — the manual verification run worked but tripped the
restricted:latest warning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-14 02:08:36 +02:00
k.renner cb3894b2f4 Merge pull request 'feat(openbao): nightly raft snapshots + velero offsite shipping' (#177) from openbao-snapshots into master
Reviewed-on: gitea_admin/homelab#177
2026-07-14 00:06:54 +00:00
claude-botandClaude Fable 5 6afff75b6e feat(openbao): nightly raft-snapshot CronJob + velero offsite schedule
bao operator raft snapshot save nightly at 03:00 to a dedicated PVC
(keep 7), authenticated via a new k8s-auth role openbao-snapshot ->
policy raft-snapshot (read on sys/storage/raft/snapshot only; applied
2026-07-14). Velero openbao-daily (06:15) ships ONLY the snapshot PVC
offsite via label selector — the live raft data PVC stays unbacked
(crash-consistent files; the .snap is the restore artifact). A failed
Job doubles as the sealed-after-restart alarm.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-14 02:04:33 +02:00
k.renner 38e0be5415 Merge pull request 'feat(shelly-manager): discover BLE proxies via mDNS, drop static hostname' (#176) from feat/ble-proxy-mdns-env into master
Reviewed-on: gitea_admin/homelab#176
2026-07-13 23:44:12 +00:00
security-bot f8010f436e chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1783986017
Updates managed by image-automation-controller.
2026-07-13 23:42:43 +00:00
claude-bot d386df84be feat(shelly-manager): discover BLE proxies via mDNS, drop static hostname
shelly-manager now auto-discovers esphome bluetooth_proxy nodes on the IoT
VLAN via mDNS (_esphomelib._tcp) — see k.renner/shelly-manager#14. Replace
the static Ble__Proxies__0__{Name,Host,Port} env (which addressed the proxy
by shelly-ble-proxy-1.iot.renner.uno — poisoned over IPv6 by the
*.renner.uno wildcard) with a single shared fleet Noise key exposed as
Ble__Discovery__Key, from the same shelly-ble-proxy-key secret.

Merge after #14's image is live so discovery is present when the static
entry goes away.

Co-Authored-By: Claude Bot <claude-bot@renner.uno>
2026-07-14 01:41:13 +02:00
k.renner 815a710549 Merge pull request 'feat(secrets): final batch — authentik to OpenBao/ESO (repo is sops-free)' (#175) from openbao-authentik into master
Reviewed-on: gitea_admin/homelab#175
2026-07-13 23:38:48 +00:00
claude-botandClaude Fable 5 fa437a608c feat(secrets): migrate authentik secrets to OpenBao (final batch)
authentik-secrets + samba-bridge config: values in OpenBao KV, both
round-trip-verified text. The identity provider was deliberately last —
every other consumer proved the pipeline first. ZERO sops files remain
under kubernetes/; authentik KS decryption dropped. Phase 4 (age-key
retirement) is now unblocked pending soak.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-14 01:34:04 +02:00
k.renner 977880908b Merge pull request 'feat(secrets): seed batch — CNPG/backup seed secrets to OpenBao/ESO' (#174) from openbao-seed into master
Reviewed-on: gitea_admin/homelab#174
2026-07-13 23:27:08 +00:00
claude-botandClaude Fable 5 1c732045d5 feat(secrets): migrate seed secrets to OpenBao (seed batch)
seed/{authentik,immich,paperless} barman+hetzner creds and
seed/influxdb bootstrap: values in OpenBao KV (homelab/seed/*), all
round-trip-verified text. Future cold rebuilds no longer need the age
key for the seed phase. Decryption blocks dropped from every seed-* KS
(incl. dormant seed-audiobookshelf/seed-music-assistant and the
suspended, deprecated seed KS).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-14 01:25:28 +02:00
k.renner beaa6bf0d4 Merge pull request 'feat(secrets): stateful batch — home-assistant, immich, paperless to OpenBao/ESO' (#173) from openbao-stateful into master
Reviewed-on: gitea_admin/homelab#173
2026-07-13 23:19:57 +00:00
claude-botandClaude Fable 5 94aa3e2fda feat(secrets): migrate stateful app secrets to OpenBao (stateful batch)
home-assistant (5), immich, paperless (2): values in OpenBao KV, all
verified text-safe via base64 round-trip before load. ExternalSecrets
keep the old Secret names. Decryption blocks dropped from
home-assistant/immich/paperless KS plus the dormant one on
speech-to-phrase.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-14 01:19:12 +02:00
k.renner 5ba99ebac1 Merge pull request 'feat(secrets): apps batch — non-critical app secrets to OpenBao/ESO' (#172) from openbao-apps into master
Reviewed-on: gitea_admin/homelab#172
2026-07-13 17:21:58 +00:00
claude-botandClaude Fable 5 a76b18a887 feat(secrets): migrate non-critical app secrets to OpenBao (apps batch)
evcc, otbr, libation, external-dns (apps), monitoring (4), woodpecker:
values in OpenBao KV (homelab/apps/*, loaded 2026-07-13), manifests are
now ExternalSecrets keeping the old Secret names. libation's payload is
a binary SQLite db — stored base64 in KV with decodingStrategy: Base64
on the ES. Decryption blocks dropped from apps/evcc/otbr/libation/
monitoring KS (paths sops-free) plus the dormant one on grafana-db.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-13 19:21:27 +02:00
k.renner 871cbfd96d Merge pull request 'feat(secrets): warm-up migration — infrastructure secrets to OpenBao/ESO' (#171) from openbao-warmup into master
Reviewed-on: gitea_admin/homelab#171
2026-07-13 17:10:49 +00:00
claude-botandClaude Fable 5 85cb236270 feat(secrets): migrate infrastructure secrets to OpenBao (warm-up batch)
external-dns-unifi, netbird-ingress, velero (both), cloudflare-api-token:
values live in OpenBao KV (homelab/infrastructure/*, loaded 2026-07-13),
manifests become ExternalSecrets targeting the same Secret names so
consumers see no change. Both infra KS paths are now sops-free, so their
decryption blocks go too. Rollback per file = git revert (age key still
active until phase 4).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-13 19:07:14 +02:00
k.renner 5991607e1c Merge pull request 'feat(secrets): ClusterSecretStore + declarative audit — SOPS migration phase 2' (#170) from openbao-phase2 into master
Reviewed-on: gitea_admin/homelab#170
2026-07-13 17:00:02 +00:00
k.renner 5c28c5114c Merge pull request 'feat(esphome): enable IPv6 on the shelly BLE proxy' (#169) from feat/esphome-proxy-ipv6 into master
Reviewed-on: gitea_admin/homelab#169
2026-07-13 16:59:54 +00:00
claude-botandClaude Fable 5 98346b370e feat(secrets): ClusterSecretStore + declarative audit (SOPS migration phase 2)
OpenBao was initialized and configured today (kv-v2 at homelab/, k8s
auth, eso-read policy + role bound to the external-secrets SA); the
store can therefore turn Ready and no longer endangers the post-crds
wait gate. Audit device moves into the server HCL because OpenBao 2.5
rejects API-managed audit devices; log_raw stays off so Loki only ever
sees HMAC-redacted values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-13 18:46:35 +02:00
claude-botandClaude Opus 4.8 ad35dc3189 feat(esphome): enable IPv6 on the shelly BLE proxy
The IoT VLAN advertises a global IPv6 prefix (RA/SLAAC), but the Atom Echo
ran v4-only because ESPHome defaults IPv6 off. Enable it so the device is a
proper dual-stack citizen of the segment and has a real global IPv6.

This is the prerequisite for the DNS-side fix: once the device has a real
AAAA, a `unifi_dns_record` AAAA for shelly-ble-proxy-1.iot.renner.uno can be
pinned to it (same pattern as the existing udm/captive records in
opentofu/dns_renner_uno.tf), so the name resolves to the device instead of
falling through to the *.renner.uno proxy wildcard.

Takes effect on the next USB re-flash (no OTA on this device by design).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 18:43:31 +02:00
k.renner 5e3c1fcff9 Merge pull request 'feat(secrets): OpenBao + External Secrets Operator — SOPS migration phase 1' (#168) from openbao-eso into master
Reviewed-on: gitea_admin/homelab#168
2026-07-13 16:30:29 +00:00
claude-botandClaude Fable 5 be59c4ae37 feat(secrets): deploy OpenBao + External Secrets Operator (SOPS migration phase 1)
Single-node raft OpenBao (5Gi ceph-block, UI at openbao.k.renner.uno,
internal-only ingress) and ESO 2.x. No ClusterSecretStore yet — it can
only turn Ready after manual init/unseal, and committing it now would
freeze the infrastructure-crds wait gate (2026-07-13 incident shape).
Full phased plan incl. per-file checklist and DR runbook in
kubernetes/MIGRATION-sops-openbao.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRgBFn9m8a2ncFMLusikH6
2026-07-13 18:26:01 +02:00
k.renner 1210d0da7a Merge pull request 'feat(shelly-manager): wire the ESPHome proxy Noise key' (#166) from feat/shelly-proxy-key into master
Reviewed-on: gitea_admin/homelab#166
2026-07-13 16:01:59 +00:00
claude-botandClaude Opus 4.8 2f2b96905e feat(shelly-manager): wire the ESPHome proxy Noise key
shelly-manager's native ESPHome-API client (PR k.renner/shelly-manager#12)
does the real Noise_NNpsk0 handshake to the Atom Echo bluetooth_proxy when
it has the api.encryption.key. Provide it:

  * shelly-ble-proxy-key.sops.yaml — SOPS Secret holding api-key, the same
    value as the ESPHome dashboard's shelly_ble_proxy_api_key.
  * shelly-manager-deployment: inject it as Ble__Proxies__0__Key via
    secretKeyRef.

Effect: /ble-radios upgrades from a bare TCP :6053 check to a real
handshake + DeviceInfo (device name/version), which also validates the
Noise/frame stack on live hardware ahead of the BLE scan/GATT work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 17:52:33 +02:00
security-bot 6025df7d1a chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1783956697
Updates managed by image-automation-controller.
2026-07-13 15:42:43 +00:00
k.renner 27adf660b0 Merge pull request 'fix(gitea): allow Prometheus to scrape in-cluster gitea /metrics' (#165) from fix/gitea-metrics-netpol into master
Reviewed-on: gitea_admin/homelab#165
2026-07-13 15:30:22 +00:00
claude-botandClaude Opus 4.8 c69fa9ac8a fix(gitea): allow Prometheus (monitoring ns) to scrape /metrics
After the LXC->in-cluster cutover the gitea scrape target became an in-cluster
pod, which the apps default-deny-ingress CiliumNetworkPolicy drops (it allows
only same-ns / home-assistant / host). Prometheus scrapes time out (context
deadline exceeded) and TargetDown keeps firing. Add a scoped CNP allowing the
monitoring namespace to reach the gitea pod on :3000. Monitoring egress is
unrestricted (its only policy is ingress-only), so this ingress allow is
sufficient.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-13 17:27:53 +02:00
k.renner 0d411be12a Merge pull request 'chore(ansible): retire gitea/woodpecker LXC provisioning + srv.renner.uno refs' (#164) from chore/retire-lxc-ansible into master
ci/woodpecker/push/deploy-woodpecker-agent Pipeline failed
Reviewed-on: gitea_admin/homelab#164
2026-07-13 15:16:41 +00:00
security-bot 9e7a7b175f chore(image-automation): bump gitea.renner.uno/k.renner/shelly-manager:build.1783933726
Updates managed by image-automation-controller.
2026-07-13 14:03:27 +00:00
claude-botandClaude Opus 4.8 d2c620f825 chore(ansible): drop remaining retired-runner/agent leftovers
Follow-up to the LXC retirement sweep:
- remove orphan inventory/group_vars/woodpecker_agents (group already deleted)
- drop the retired gitea-runner (root@10.2.40.214 act_runner) journalctl entry
  from .vscode/settings.json

Kept (live): the ci.renner.uno gatus check and the woodpecker-ci@homelab
authorized key, which belong to the in-cluster Woodpecker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-13 15:47:00 +02:00
claude-botandClaude Opus 4.8 dc36653808 chore(ansible): retire gitea/woodpecker LXC provisioning + refs
Gitea and Woodpecker now run in-cluster (k8s); their Proxmox LXCs are retired.
Remove the provisioning that rebuilt them and every reference to the dead hosts:

- delete roles gitea-lxc, gitea-runner, woodpecker-agent, woodpecker-server
- delete plays install-gitea, install-gitea-runner, configure-gitea-runner-logging,
  install-woodpecker-server, install-woodpecker-agent
- drop [woodpecker_server]/[woodpecker_agents] inventory groups + group_vars
- monitoring: remove the gitea Prometheus scrape job + gitea:22 blackbox target;
  repoint the gatus / blackbox-dns / chaos-test / proxmox-dns dig probes and the
  dns-overview dashboard panel from gitea.srv.renner.uno to k8s-1.srv.renner.uno
- drop the retired gitea-runner journalctl entries from .vscode/settings.json

Live services keep their public hostnames (gitea.renner.uno, ci.renner.uno),
untouched. Other *.srv.renner.uno hosts untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-13 15:44:56 +02:00
k.renner f5b46e7a28 Merge pull request 'fix(monitoring): scrape in-cluster Gitea, not retired LXC' (#163) from fix/prometheus-gitea-scrape into master
Reviewed-on: gitea_admin/homelab#163
2026-07-13 13:11:50 +00:00
k.renner 29416d7e05 Merge pull request 'feat(shelly-manager): register the Atom Echo BLE proxy as a radio' (#162) from feat/shelly-manager-ble-proxy into master
Reviewed-on: gitea_admin/homelab#162
2026-07-13 13:11:42 +00:00
claude-botandClaude Opus 4.8 59aa162a19 fix(monitoring): scrape in-cluster Gitea, not the retired LXC
Gitea moved in-cluster (apps ns StatefulSet); LXC 114 is stopped, so the static
`gitea` scrape target gitea.srv.renner.uno:3000 is down -> firing TargetDown.
Point it at the ClusterIP Service (gitea.apps.svc.cluster.local:3000), which
serves /metrics anonymously (verified HTTP 200 with gitea_* metrics).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-13 15:06:20 +02:00
claude-botandClaude Opus 4.8 0d7e530126 feat(shelly-manager): register the Atom Echo BLE proxy as a radio
Add Ble:Proxies[0] = { atom-echo-1, shelly-ble-proxy-1.iot.renner.uno, 6053 } to
the shelly-manager deployment so the flashed M5 Atom Echo esphome bluetooth_proxy
(now up at 10.2.30.109, ESPHome API :6053 open) shows on the /ble-radios page and
is liveness-probed. Reached over the same net1 macvlan route as the Shellys.
Provisioning THROUGH it is the native ESPHome-API client, still to come.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 15:04:07 +02:00
k.renner 365852efe4 Merge pull request 'chore(esphome): trim Shelly BLE proxy to WiFi + API only' (#161) from chore/esphome-proxy-trim into master
Reviewed-on: gitea_admin/homelab#161
2026-07-13 12:59:35 +00:00
claude-botandClaude Opus 4.8 fdddbe7e78 chore(esphome): trim Shelly BLE proxy to WiFi + API only
Per how it's actually run: drop OTA and the fallback AP/captive_portal — this is
a fixed, low-value proxy, so updates and any WiFi recovery are done by re-flashing
over USB. Secrets shrink to iot_wifi_ssid / iot_wifi_password /
shelly_ble_proxy_api_key (the api encryption key stays; it's the ble-agent
handoff). README secrets list + flashing note updated to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 11:01:51 +02:00
k.renner 71d1111879 Merge pull request 'feat(esphome): version the Atom Echo Shelly BLE proxy config' (#158) from feat/esphome-shelly-ble-proxy-config into master
Reviewed-on: gitea_admin/homelab#158
2026-07-13 06:13:49 +00:00
k.renner 91fceb11ac Merge pull request 'fix(gitea): BUILTIN_SSH_SERVER_USER=gitea for gitea@ auth' (#160) from fix/gitea-builtin-ssh-user into master
Reviewed-on: gitea_admin/homelab#160
2026-07-12 23:49:54 +00:00
claude-botandClaude Opus 4.8 c745723e82 fix(gitea): BUILTIN_SSH_SERVER_USER=gitea so gitea@ remotes authenticate
#159 set SSH_USER=gitea, but SSH_USER is cosmetic (clone-URL display only) and
does not change which login the built-in SSH server accepts — so gitea@ still got
Permission denied. BUILTIN_SSH_SERVER_USER is the setting the built-in server
checks the login name against (defaults to RUN_USER=git); pin it to gitea so the
existing gitea@ remotes (the LXC's non-default SSH user) authenticate with zero
client changes. git@ stops authenticating (single built-in login) — unused here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-13 01:46:31 +02:00
claude-bot f3cc5c7027 Merge pull request 'fix(gitea): SSH_USER=gitea for existing remotes' (#159) from fix/gitea-ssh-user into master 2026-07-12 23:28:52 +00:00
claude-botandClaude Opus 4.8 3d40ad3620 fix(gitea): SSH_USER=gitea so existing gitea@ remotes keep working
The retired LXC ran RUN_USER=gitea, so all clone URLs and git remotes are
gitea@gitea.renner.uno. The rootless image runs as `git`, defaulting SSH_USER to
`git` and rejecting `gitea@` logins (Permission denied). Pinning SSH_USER=gitea
restores the pre-migration convention with no per-repo remote changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-13 01:28:50 +02:00
claude-bot 33e04f0892 Merge pull request 'feat(woodpecker): cut over to in-cluster server + k8s-backend agent' (#157) from feat/woodpecker-cutover into master 2026-07-12 23:19:21 +00:00
claude-botandClaude Opus 4.8 04d8485b04 feat(esphome): version the Atom Echo Shelly BLE proxy config
Source-of-truth YAML (+ README) for the M5 Atom Echo dedicated Bluetooth proxy
that lends its BLE radio to shelly-manager's ble-agent for provisioning WiFi-less
Shellys over mOS RPC-over-BLE. Built/flashed via the in-cluster ESPHome Device
Builder (esphome.home.renner.uno).

Lean, dedicated config (no voice — bluetooth_proxy + voice boot-loops the
ESP32-PICO), esp-idf framework, bluetooth_proxy active. The api encryption key is
the handoff to the ble-agent (its BLE_PROXY_NOISE_PSK). The dashboard reads from
its PVC, not git, so these files are the reviewed/backed-up copy kept in sync by
hand.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 01:11:39 +02:00
claude-botandClaude Opus 4.8 2bd1acc7d5 feat(woodpecker): cut over to the in-cluster server + kubernetes-backend agent
Moves ci.renner.uno off LXC 231 onto the in-cluster StatefulSet (DB loaded from
the LXC beforehand) and brings the kubernetes-backend agent online, retiring the
docker agents (LXC 910/911). server replicas 0->1; Service ExternalName->ClusterIP
with http:8000 (UI) + grpc:9000 (agent<->server); agent replicas 0->1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-13 01:11:20 +02:00
claude-bot 515e9bf95c Merge pull request 'feat(gitea): phase 2 — flip Service to ClusterIP + SSH IngressRouteTCP' (#157) from feat/gitea-phase2-flip into master 2026-07-13 00:43:20 +02:00
claude-botandClaude Opus 4.8 52f5619e5a feat(gitea): phase 2 — flip Service to ClusterIP + SSH IngressRouteTCP
Moves gitea.renner.uno and git-over-ssh onto the in-cluster StatefulSet, which
has been loaded from LXC 114 and verified (data intact, SSH host-key identity
preserved, master at the revision Flux expects). gitea Service ExternalName ->
ClusterIP; adds the gitea-ssh IngressRouteTCP binding the Traefik entrypoint
(added in phase 1) to :2222. Woodpecker stays on the LXC (server replicas 0,
Service ExternalName) — its cutover is a separate migration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-13 00:42:41 +02:00
claude-bot fbed8bb392 Merge pull request 'feat(gitea,woodpecker): migrate off Proxmox LXC into the cluster' (#155) from feat/gitea-woodpecker-k8s into master 2026-07-12 22:15:43 +02:00
claude-botandClaude Opus 4.8 5d66fb5445 chore(woodpecker): add SOPS-encrypted secret and enable it for phase 1
woodpecker-server envFrom's woodpecker-secret; without it the pod crashloops and
holds the apps Kustomization (wait:true) red. Encrypted with the repo age
recipient (kubernetes/.sops.yaml); Flux decrypts it via the apps Kustomization's
sops provider. Values (AGENT_SECRET/GITEA_CLIENT/GITEA_SECRET) lifted from the
running CT 231 woodpecker-server.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-12 21:38:07 +02:00
claude-botandClaude Opus 4.8 287e01a95c feat(gitea,woodpecker): phase 1 — in-cluster workloads, Services stay ExternalName
Stand up Gitea + Woodpecker as in-cluster workloads beside the existing
Proxmox LXCs WITHOUT flipping any traffic. Both Services remain ExternalName
-> the LXCs, the Woodpecker agent ships replicas:0, and the gitea SSH
IngressRouteTCP is absent. Merging this changes nothing user-facing — Flux
brings up empty-PVC pods that get loaded and verified out-of-band before a
phase-2 PR flips the Services to ClusterIP.

Gitea: gitea/gitea:1.21.4-rootless (its entrypoint runs environment-to-ini,
so do NOT override it), built-in SSH server on 2222, forced GITEA__log__ROOT_PATH,
host-key reuse. Traefik gains an additive gitea-ssh TCP entrypoint (:22 on the
shared VIP). Woodpecker: kubernetes backend (build pods in ns woodpecker-ci on
ceph-filesystem RWX, privileged-plugin allow-list + PodSecurity label), agent
replicas:0; SOPS secret is created+committed at pre-flight, never kubectl-applied.

Cutover is fully GitOps: flux suspend + kubectl exec/scale data load, verify
via port-forward, phase-2 flip with a repo-resync; break-glass = repoint the
Flux source to the GitHub mirror (known-good tag before-k8s-migration). See
kubernetes/apps/MIGRATION-gitea-woodpecker.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQhvu1mrQ7EgwLhrzdNyY7
2026-07-12 20:55:15 +02:00
554 changed files with 17892 additions and 13660 deletions
+6
View File
@@ -20,5 +20,11 @@ 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
+268
View File
@@ -0,0 +1,268 @@
# 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 * * * *'
# - manual : woodpecker pipeline create --branch master \
# --var PIPELINE=alert-monitor k.renner/homelab
when:
- event: cron
cron: alert-monitor
- event: manual
evaluate: 'PIPELINE == "alert-monitor"'
steps:
- name: fetch-alerts
image: gitea.renner.uno/gitea_admin/ci-k8s:2026-05-01
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.218
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)
FPS=$$(printf '%s' "$$NOISE_BODY" | grep -oE '\b[0-9a-f]{16}\b' \
| jq -R -s -c 'split("\n") | map(select(length > 0))')
# 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." > /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
+110 -8
View File
@@ -1,7 +1,24 @@
# Builds the CI tooling images (and the secret-rotator runtime image) with
# kaniko and pushes them to the Gitea container registry.
#
# Credential: ci_images_token — a PAT scoped to `package: read+write` and
# NOTHING else (verified: 403 on /user/repos, /admin/users and the issues
# API; 200 on the /v2/ registry endpoints kaniko uses). It replaces the
# admin-owned gitea_token that used to sit here, which could do anything
# the admin account could (#330).
#
# The token is still OWNED by gitea_admin, because Gitea scopes packages to
# a user or org namespace and these images live under `gitea_admin/*` — a
# different account cannot publish there. Moving them to a dedicated org is
# the remaining cleanup; it is a 38-reference migration across pipelines and
# Flux-deployed CronJobs, so it is tracked separately in #330 rather than
# bundled here. Note this pipeline runs no LLM agent, so the exfil path that
# motivated the other cutovers does not apply to it.
when:
- event: push
path:
- "ci/images/**"
- "secret-rotator/**"
- ".woodpecker/build-ci-images.yml"
- event: manual
evaluate: 'PIPELINE == "build-ci-images"'
@@ -11,10 +28,18 @@ steps:
image: gcr.io/kaniko-project/executor:v1.23.2-debug
directory: ci/images/ansible
depends_on: []
# Only rebuild when THIS image's source (or the pipeline file) changed, or
# on a manual run. Without this every step ran on any matching push, so a
# secret-rotator commit needlessly rebuilt all four ~1.3G ci-* images and
# orphaned ~5G of registry layers per run — a main driver of #336.
when:
- event: manual
- event: push
path: ["ci/images/ansible/**", ".woodpecker/build-ci-images.yml"]
environment:
GITEA_USER: gitea_admin
GITEA_TOKEN:
from_secret: gitea_token
from_secret: ci_images_token
commands:
- mkdir -p /kaniko/.docker
- AUTH=$(printf '%s:%s' "$GITEA_USER" "$GITEA_TOKEN" | base64 | tr -d '\n')
@@ -31,10 +56,14 @@ steps:
image: gcr.io/kaniko-project/executor:v1.23.2-debug
directory: ci/images/k8s
depends_on: []
when:
- event: manual
- event: push
path: ["ci/images/k8s/**", ".woodpecker/build-ci-images.yml"]
environment:
GITEA_USER: gitea_admin
GITEA_TOKEN:
from_secret: gitea_token
from_secret: ci_images_token
commands:
- mkdir -p /kaniko/.docker
- AUTH=$(printf '%s:%s' "$GITEA_USER" "$GITEA_TOKEN" | base64 | tr -d '\n')
@@ -51,10 +80,14 @@ steps:
image: gcr.io/kaniko-project/executor:v1.23.2-debug
directory: ci/images/tofu
depends_on: []
when:
- event: manual
- event: push
path: ["ci/images/tofu/**", ".woodpecker/build-ci-images.yml"]
environment:
GITEA_USER: gitea_admin
GITEA_TOKEN:
from_secret: gitea_token
from_secret: ci_images_token
commands:
- mkdir -p /kaniko/.docker
- AUTH=$(printf '%s:%s' "$GITEA_USER" "$GITEA_TOKEN" | base64 | tr -d '\n')
@@ -67,14 +100,25 @@ steps:
--destination gitea.renner.uno/gitea_admin/ci-tofu:$TAG \
--destination gitea.renner.uno/gitea_admin/ci-tofu:latest
- name: build-claude
# NOTE: ci-claude is deliberately NOT built here. It tracks upstream Claude
# Code releases on its own cadence and is built + version-tagged by
# ci-claude-refresh.yml, which also opens the PR that rolls a new version out
# to the consumer pipelines. Building it here too would fight over tags.
# Runtime image, not CI tooling: a static musl binary in a FROM-scratch image,
# used as the base for secret-rotation CronJobs. Replaces per-job inline Python.
- name: build-secret-rotator
image: gcr.io/kaniko-project/executor:v1.23.2-debug
directory: ci/images/claude
directory: secret-rotator
depends_on: []
when:
- event: manual
- event: push
path: ["secret-rotator/**", ".woodpecker/build-ci-images.yml"]
environment:
GITEA_USER: gitea_admin
GITEA_TOKEN:
from_secret: gitea_token
from_secret: ci_images_token
commands:
- mkdir -p /kaniko/.docker
- AUTH=$(printf '%s:%s' "$GITEA_USER" "$GITEA_TOKEN" | base64 | tr -d '\n')
@@ -84,5 +128,63 @@ steps:
/kaniko/executor \
--context . \
--dockerfile Containerfile \
--destination gitea.renner.uno/gitea_admin/ci-claude:$TAG \
--destination gitea.renner.uno/gitea_admin/ci-claude:latest
--destination gitea.renner.uno/gitea_admin/secret-rotator:$TAG \
--destination gitea.renner.uno/gitea_admin/secret-rotator:latest
# Runtime image, not CI tooling: a general-purpose alpine + jq base for
# workloads that need to read JSON from a shell script. Named for what it IS,
# not for who uses it — its first consumer is the zigbee2mqtt seed-data init
# container, but nothing about it is zigbee-specific. Exists so tools come from
# the image rather than an `apk add` on every container start.
- name: build-alpine-jq
image: gcr.io/kaniko-project/executor:v1.23.2-debug
directory: ci/images/alpine-jq
depends_on: []
when:
- event: manual
- event: push
path: ["ci/images/alpine-jq/**", ".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
- TAG=$(date +%Y-%m-%d)
- |
/kaniko/executor \
--context . \
--dockerfile Containerfile \
--destination gitea.renner.uno/gitea_admin/alpine-jq:$TAG \
--destination gitea.renner.uno/gitea_admin/alpine-jq:latest
# Runtime image, not CI tooling: upstream containernetworking/plugins binaries
# baked in, consumed by the multus cni-plugins-installer DaemonSet. Replaces a
# node-side fetch from GitHub that had NO checksum verification and sat on the
# critical path of every node rebuild. The download now happens here, once,
# where the sha256 is checked — see the Containerfile for the full rationale.
- name: build-cni-plugins
image: gcr.io/kaniko-project/executor:v1.23.2-debug
directory: ci/images/cni-plugins
depends_on: []
when:
- event: manual
- event: push
path: ["ci/images/cni-plugins/**", ".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
- TAG=$(date +%Y-%m-%d)
- |
/kaniko/executor \
--context . \
--dockerfile Containerfile \
--destination gitea.renner.uno/gitea_admin/cni-plugins:$TAG \
--destination gitea.renner.uno/gitea_admin/cni-plugins:latest
+214
View File
@@ -0,0 +1,214 @@
# ci-claude refresh — keep the CI agent image on the LATEST Claude Code and
# roll that version out to every pipeline that runs it, automatically.
#
# Why this exists (#351, follow-up from #336): the ci-claude image used to pin
# a fixed Claude Code version in its Containerfile, and every consumer pipeline
# pinned a stale dated image tag. Old Claude Code releases eventually stop
# working against the API, so both pins silently rot the agent pipelines. This
# pipeline owns the whole lifecycle instead:
#
# 1. decide — resolve the latest published Claude Code version and compare
# it to the tag the consumer pipelines currently reference.
# 2. build — (only when a rebuild is warranted) kaniko-build the image
# pinned to that exact version and push ci-claude:<version>
# and ci-claude:latest. The Containerfile makes this layer
# byte-reproducible, so rebuilding an unchanged version dedups
# in the registry instead of orphaning a fresh ~260 MB copy.
# 3. bump-pr — (only when the version actually changed) rewrite the 5
# consumer pins to ci-claude:<version> and open a PR. A human
# reviews and merges it; nothing auto-merges.
#
# TAG SCHEME — deliberately version tags (ci-claude:2.1.218), NOT the dated
# tags the other ci-* images use. The tag encodes the thing that changes here
# (the Claude version), which makes "did it change?" a trivial, race-free
# string compare and keeps the weekly cron from opening no-op PRs. The other
# images change only when their Containerfile changes, so dated tags fit them;
# this one tracks an upstream release cadence.
#
# This pipeline OWNS building ci-claude: the image's build step was removed
# from build-ci-images.yml so the two never fight over tags.
#
# TOKENS — two least-privilege, single-purpose secrets, per the #330 rule that
# a pipeline never gets a broader credential than it needs and never the admin
# gitea_token:
# - ci_images_token : package read+write ONLY (the kaniko push).
# Shared with build-ci-images.yml — same job.
# - ci_claude_bump_bot_token : a claude-bot PAT scoped write:repository ONLY
# (verified: 200 on the repo, 403 on
# /admin/users). It pushes the bump branch and
# opens the PR; it does NOT comment on issues, so
# it carries no write:issue. A dedicated Gitea
# *user* would need admin to create, which
# claude-bot lacks; a scoped-down claude-bot PAT
# gives the same least-privilege at the token
# level. claude-bot is already a write
# collaborator here. Secret scoped to the
# 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
# 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'
# Weekly is plenty; the pipelines tolerate being a few days behind a release.
#
# Triggering:
# - cron : the cron NAMED exactly "ci-claude-refresh" (see above).
# - manual : woodpecker pipeline create --branch master \
# --var PIPELINE=ci-claude-refresh k.renner/homelab
# - push : a change to the Containerfile (or this file) ON master 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
# images), and without this filter every PR that edits these paths
# would do exactly that from its own branch.
when:
- event: cron
cron: ci-claude-refresh
- event: manual
evaluate: 'PIPELINE == "ci-claude-refresh"'
- event: push
branch: master
path:
- "ci/images/claude/**"
- ".woodpecker/ci-claude-refresh.yml"
steps:
# 1. Resolve latest vs. currently-pinned, and decide what to do. Writes
# sentinels to $CI_WORKSPACE/.ci-refresh/ (the workspace volume is the
# only path shared across steps; /tmp is per-container). Uses the ci-claude
# image purely as a toolbox (it ships npm, jq, git, curl).
- name: decide
image: gitea.renner.uno/gitea_admin/ci-claude:latest
commands:
- |
set -eu
mkdir -p "$$CI_WORKSPACE/.ci-refresh"
# Files that pin the image. Keep this list in sync with the consumers.
CONSUMERS="
.woodpecker/security-scan.yml
.woodpecker/alert-monitor.yml
.woodpecker/update-audit.yml
.woodpecker/pr-review.yml
.woodpecker/issue-fix.yml
"
NEW=$$(npm view @anthropic-ai/claude-code version)
case "$$NEW" in
[0-9]*.[0-9]*.[0-9]*) : ;;
*) echo "npm returned an implausible version '$$NEW' — aborting."; exit 1 ;;
esac
# The tag every consumer currently references. They are kept identical,
# so this must resolve to EXACTLY ONE non-empty tag; anything else
# (no match, or a partial/disagreeing set) aborts rather than risk a
# corrupting sed later. Counting with `grep -c .` (non-empty lines)
# instead of `wc -l` is deliberate: an empty result yields 0 here but
# 1 under wc -l, which would slip past the guard.
CUR=$$(grep -hoE 'ci-claude:[0-9A-Za-z._-]+' $$CONSUMERS | sed 's/^ci-claude://' | sort -u)
NTAGS=$$(printf '%s' "$$CUR" | grep -c . || true)
if [ -z "$$CUR" ] || [ "$$NTAGS" -ne 1 ]; then
echo "Expected exactly one ci-claude tag across the consumers, got [$$CUR]."
echo "Refusing to guess — fix the pins by hand."; exit 1
fi
echo "latest=$$NEW current=$$CUR event=$$CI_PIPELINE_EVENT"
printf '%s' "$$NEW" > "$$CI_WORKSPACE/.ci-refresh/version"
printf '%s' "$$CUR" > "$$CI_WORKSPACE/.ci-refresh/current"
# Build when the version changed, or on a push (Containerfile edit must
# ship even if the version is unchanged). Bump the pins only when the
# version the consumers reference is not the latest.
if [ "$$CUR" != "$$NEW" ] || [ "$$CI_PIPELINE_EVENT" = "push" ]; then
touch "$$CI_WORKSPACE/.ci-refresh/do-build"; echo "will build $$NEW"
else
echo "already on $$NEW — nothing to build"
fi
if [ "$$CUR" != "$$NEW" ]; then
touch "$$CI_WORKSPACE/.ci-refresh/do-bump"; echo "will open bump PR $$CUR -> $$NEW"
else
echo "consumers already pin $$NEW — no PR"
fi
# 2. Build the exact resolved version and push version + latest tags. Pinning
# --build-arg to the resolved version (not "latest") guarantees the tag and
# the image content agree even if a new release lands mid-run.
- name: build
image: gcr.io/kaniko-project/executor:v1.23.2-debug
directory: ci/images/claude
depends_on: [decide]
environment:
GITEA_USER: gitea_admin
GITEA_TOKEN:
from_secret: ci_images_token
commands:
- |
[ -f "$$CI_WORKSPACE/.ci-refresh/do-build" ] || { echo "no build needed"; exit 0; }
set -eu
VERSION=$$(cat "$$CI_WORKSPACE/.ci-refresh/version")
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
/kaniko/executor \
--context . \
--dockerfile Containerfile \
--build-arg CLAUDE_CODE_VERSION="$$VERSION" \
--destination gitea.renner.uno/gitea_admin/ci-claude:"$$VERSION" \
--destination gitea.renner.uno/gitea_admin/ci-claude:latest
# 3. Rewrite the consumer pins and open a PR. Never auto-merges. Skips itself
# when the version was unchanged, and when a bump branch already exists (a
# prior run's PR is still open / being merged).
- name: bump-pr
image: gitea.renner.uno/gitea_admin/ci-claude:latest
depends_on: [build]
environment:
PUSH_TOKEN:
from_secret: ci_claude_bump_bot_token
commands:
- |
[ -f "$$CI_WORKSPACE/.ci-refresh/do-bump" ] || { echo "no version change — no PR"; exit 0; }
set -eu
NEW=$$(cat "$$CI_WORKSPACE/.ci-refresh/version")
CUR=$$(cat "$$CI_WORKSPACE/.ci-refresh/current")
# 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"
BRANCH="ci-image/claude-$$NEW"
if git ls-remote --heads "https://gitea.renner.uno/k.renner/homelab.git" "$$BRANCH" | grep -q .; then
echo "Branch $$BRANCH already exists — a PR for $$NEW is already open. Nothing to do."
exit 0
fi
CONSUMERS="
.woodpecker/security-scan.yml
.woodpecker/alert-monitor.yml
.woodpecker/update-audit.yml
.woodpecker/pr-review.yml
.woodpecker/issue-fix.yml
"
# Exact-string swap of the current tag for the new one, consumers only.
for f in $$CONSUMERS; do
sed -i "s#ci-claude:$$CUR#ci-claude:$$NEW#g" "$$f"
done
# Author is claude-bot (the PAT's account); the commit subject makes
# the automated-bump nature clear.
git config user.email "claude-bot@renner.uno"
git config user.name "Claude Bot"
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"
{
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"
printf 'latest published `@anthropic-ai/claude-code`. This rewires the 5 pipelines that\n'
printf 'run the image so CI stops running a stale Claude Code.\n\n'
printf 'Merging is a human decision — review, then merge to roll it out.\n'
} > /tmp/pr-body.md
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
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")
echo "POST pull -> HTTP $$code"
[ "$$code" -ge 200 ] && [ "$$code" -lt 300 ] || { cat /tmp/resp.json; exit 1; }
jq '{number, html_url, title}' /tmp/resp.json
+22
View File
@@ -0,0 +1,22 @@
# Gate the CI helper-script unit tests on every homelab pull_request.
#
# scripts/ci/test-model-selection.sh is the regression test for the model-
# selection injection gate (valid-model.sh) and the fetch-models.sh response
# mapping. It is ALSO run on the daily/weekly crons via e2e.yml, but that would
# only catch a weakening of the gate up to a week after it merged — by which
# time pick-model.sh / pr-review.yml may have already run the weakened gate
# against adversarial PR input. Running it here fails the offending PR's checks
# before it can merge.
#
# Only in homelab (scripts/ci/ lives here); the file is not deployed to the
# mirrored repos, so it does not run on their PRs. The test is offline (no token,
# no network, no cluster) — the ci-claude image just provides sh + jq, and it is
# already pulled by pr-review.yml on the same event, so the runner has it cached.
when:
- event: pull_request
steps:
- name: model-selection-tests
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.218
commands:
- sh scripts/ci/test-model-selection.sh
+33
View File
@@ -0,0 +1,33 @@
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: manual
evaluate: 'PIPELINE == "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
+7 -2
View File
@@ -1,5 +1,10 @@
when:
# Plan only on master (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
path:
- "opentofu/**"
- ".woodpecker/deploy-infrastructure.yml"
@@ -126,9 +131,9 @@ steps:
- |
# Ensure Talos image exists on all Proxmox nodes via API
TALOS_VERSION="v1.12.6"
TALOS_SCHEMATIC="ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515"
TALOS_SCHEMATIC="88e3752db032a08082972bd0adf16a80849e3870c3f95cf5b669936c5699e5ad"
TALOS_URL="https://factory.talos.dev/image/$TALOS_SCHEMATIC/$TALOS_VERSION/nocloud-amd64.raw"
TALOS_FILENAME="talos-$TALOS_VERSION-nocloud-amd64.raw"
TALOS_FILENAME="talos-$TALOS_VERSION-$(echo "$TALOS_SCHEMATIC" | cut -c1-12)-nocloud-amd64.raw"
API_TOKEN="$TF_VAR_proxmox_user!$TF_VAR_proxmox_token_id=$TF_VAR_proxmox_token_secret"
for node in jupiter saturn neptune; do
EXISTS=$(curl -sk "$TF_VAR_proxmox_api_url/api2/json/nodes/$node/storage/local/content" \
+35
View File
@@ -0,0 +1,35 @@
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: manual
evaluate: 'PIPELINE == "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
+2
View File
@@ -1,5 +1,7 @@
when:
# Deploy only on master (merge) + manual — never auto-deploy from a branch.
- event: push
branch: master
path:
- "ansible/roles/netbird-server/**"
# install-netbird-server.yml also applies the netbird-proxy-watchdog role,
-43
View File
@@ -1,43 +0,0 @@
when:
# Deploy only on master (merge) + manual — never from a feature branch.
- event: push
branch: master
path:
- "ansible/roles/woodpecker-agent/**"
- "ansible/plays/install-woodpecker-agent.yml"
- ".woodpecker/deploy-woodpecker-agent.yml"
- event: manual
evaluate: 'PIPELINE == "deploy-woodpecker-agent"'
# NOTE: this deploys the agents *from* an agent, so applying a change that
# restarts Docker (e.g. the daemon.json IPv6 config) will kill this job's own
# container mid-run — the pipeline reports failure, but the change still
# applies on both agents (the restart commands are dispatched in parallel
# before the executing agent's daemon goes down). Re-run / re-trigger
# deploy-netbird-proxy afterwards.
timeout: 30
steps:
- name: deploy-woodpecker-agent
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-woodpecker-agent.yml -v
+20 -3
View File
@@ -2,16 +2,33 @@
# observability gap, OIDC config drift, RGW outage) on a schedule.
#
# Triggers:
# - cron : configure schedule via Woodpecker UI / API (Cron tab on this
# repo). Suggested: daily at 06:00 UTC (`0 6 * * *`).
# - manual : `woodpecker pipeline create --branch master --var PIPELINE=e2e gitea_admin/homelab`
# - 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.
# A new cron that SHOULD also run e2e gets its name added here.
# - manual : `woodpecker pipeline create --branch master --var PIPELINE=e2e k.renner/homelab`
when:
- event: cron
cron: daily-security-scan
- event: cron
cron: update-audit
- event: cron
cron: weekly-update
- event: manual
evaluate: 'PIPELINE == "e2e"'
steps:
- name: model-selection-tests
# Offline unit tests for the CI model-selection gate (valid-model.sh) and the
# 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.218
commands:
- sh scripts/ci/test-model-selection.sh
- name: e2e-test
image: gitea.renner.uno/gitea_admin/ci-k8s:2026-05-01
environment:
-28
View File
@@ -1,28 +0,0 @@
when:
- event: manual
evaluate: 'PIPELINE == "install-woodpecker-server"'
steps:
- name: run-playbook
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-woodpecker-server.yml -v
+217
View File
@@ -0,0 +1,217 @@
# 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 * * * *'
# - manual : woodpecker pipeline create --branch master \
# --var PIPELINE=issue-fix k.renner/homelab
when:
- event: cron
cron: issue-fix
- event: manual
evaluate: 'PIPELINE == "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-05-01
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.218
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; }
+301
View File
@@ -0,0 +1,301 @@
# PR review bot — event-driven. Woodpecker fires this on `pull_request` (which
# covers BOTH "PR opened" and "new commits pushed to an open PR"), so a review
# is produced the moment a PR appears or is updated — no polling, no cron.
#
# This file is deployed UNCHANGED into every repo the fleet wants reviewed
# (k.renner/homelab, shelly-manager, authentik-samba-bridge, homeassistant).
# Woodpecker events are per-repo, so each repo triggers a review of ITS OWN PR
# only; the triggering PR is identified from the CI event (CI_REPO +
# CI_COMMIT_PULL_REQUEST) instead of the old hourly cross-repo discovery loop.
# Because it runs on the PR event, Woodpecker's built-in clone hands the step
# THIS repo already checked out at the PR head — so, unlike the old cron model,
# there is no manual clone of the target repo (the source of an earlier token
# leak); the agents read the checkout in the workspace directly.
#
# Prompts: the two agent prompts live once, in k.renner/homelab under
# ci/agents/pr-review/. The homelab checkout already has them; the other repos
# don't, so the step falls back to a shallow clone of public homelab@master.
# One source of truth for the review rubric across all repos.
#
# Model selection: no model id — and no model family — is baked into this file.
# scripts/ci/fetch-models.sh pulls the LIVE catalog (Anthropic /v1/models, via
# CLAUDE_CODE_OAUTH_TOKEN), and a triage agent reads the PR diff + stats and
# picks whichever currently-available model best fits the review, judged on the
# catalog's own capability metadata. A model released tomorrow is eligible the
# day it appears. The shell validates the pick against the catalog snapshot taken
# BEFORE the triage runs; if the fetch fails, the pick is rejected, or the review
# is complex/security-sensitive (where the injectable pick is deliberately
# ignored), it leaves the model unset and the review runs on the CLI's default
# model. A wrong-way miss only over/under-spends one review.
#
# Posture: posted as a Gitea PR review, event COMMENT normally or
# REQUEST_CHANGES on a serious defect. It NEVER approves — a bot must not
# satisfy branch protection. Humans still merge.
#
# Dedup (guards pipeline retries/restarts, not cron re-runs anymore): the PR is
# skipped when review-bot already left a review carrying the marker
# "<!-- pr-review:sha=<head_sha> -->" for the PR's CURRENT head commit. A pushed
# commit changes the head sha and fires a fresh pull_request event -> fresh
# review.
#
# Tokens:
# CLAUDE_CODE_OAUTH_TOKEN (claude_code_oauth_token) — Claude subscription
# OAuth, how the `claude` CLI authenticates (same as the other agents).
# REVIEW_TOKEN (review_bot_token) — a dedicated `review-bot` Gitea account's
# PAT, scope write:repository. Reads the PR + diff and POSTs the review, all
# over the Gitea API (ephemeral curl Authorization headers — the token is
# never written to disk; the repo is NOT cloned). review-bot must be a
# collaborator (read) on every reviewed repo.
# Both secrets MUST be granted the `pull_request` event, or Woodpecker will
# withhold them from this pipeline. Because homelab is PUBLIC, it is also set
# to require approval for forked-PR pipelines, so an untrusted fork cannot
# rewrite this file to exfiltrate the tokens.
#
# Triggering: pull_request only — automatic on PR open + push-to-open-PR. To
# re-review a PR, push a commit (the new head sha clears the dedup marker below
# and earns a fresh review). There is deliberately no manual PIPELINE trigger:
# Woodpecker exposes a --var only to YAML variable substitution and `when`
# filters, NOT to a step's shell environment, so a --var PR=<n> re-review would
# silently no-op (the step would find no PR number and exit green).
# (Note: keep literal dollar-brace out of THIS file entirely, even in comments —
# Woodpecker runs its variable substitution over the whole YAML text, comments
# included, and an unparseable one errors the pipeline before any step runs.)
when:
- event: pull_request
steps:
- name: pr-review-agent
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.218
environment:
CLAUDE_CODE_OAUTH_TOKEN:
from_secret: claude_code_oauth_token
REVIEW_TOKEN:
from_secret: review_bot_token
commands:
- |
# ---- Resolve the single triggering PR --------------------------------
# Woodpecker hands us the repo (CI_REPO, canonical owner/repo) and the PR
# number (CI_COMMIT_PULL_REQUEST, a pull_request-event built-in). Build
# /tmp/pr-review/worklist.jsonl with 0 or 1 entries; an empty file makes
# the next block a no-op (the agent never starts).
set -eu
API="https://gitea.renner.uno/api/v1"
AUTH="Authorization: token $$REVIEW_TOKEN"
SLUG="$$CI_REPO"
NUM="$${CI_COMMIT_PULL_REQUEST:-}"
REVIEW_BOT_LOGIN="review-bot"
mkdir -p /tmp/pr-review
: > /tmp/pr-review/worklist.jsonl
if [ -z "$$NUM" ]; then
echo "No PR number in CI env (event=$${CI_PIPELINE_EVENT:-?}) — nothing to review."
exit 0
fi
echo "Triggered for $$SLUG#$$NUM (event $${CI_PIPELINE_EVENT:-?})."
if ! curl -sf -H "$$AUTH" "$$API/repos/$$SLUG/pulls/$$NUM" > /tmp/pr-review/pr.json; then
echo "Cannot fetch $$SLUG#$$NUM (review-bot not a collaborator / PR gone?) — skipping."
exit 0
fi
STATE=$$(jq -r '.state' /tmp/pr-review/pr.json)
DRAFT=$$(jq -r '.draft // false' /tmp/pr-review/pr.json)
TITLE=$$(jq -r '.title' /tmp/pr-review/pr.json)
HEAD=$$(jq -r '.head.sha' /tmp/pr-review/pr.json)
SHORT=$$(printf '%s' "$$HEAD" | cut -c1-8)
# Skip closed/merged, drafts, and WIP-titled PRs — not ready for review.
case "$$STATE" in open) ;; *) echo "#$$NUM is $$STATE — skip."; exit 0;; esac
case "$$DRAFT" in true) echo "#$$NUM draft — skip."; exit 0;; esac
case "$$TITLE" in [Ww][Ii][Pp]:*|[Ww][Ii][Pp]\ *) echo "#$$NUM WIP — skip."; exit 0;; esac
# Dedup: already reviewed at THIS head sha? (guards re-runs / restarts)
REVIEWED=$$(curl -sf -H "$$AUTH" "$$API/repos/$$SLUG/pulls/$$NUM/reviews?limit=50" \
| jq -r --arg u "$$REVIEW_BOT_LOGIN" --arg m "pr-review:sha=$$HEAD" \
'[.[] | select(.user.login == $$u) | select(.body | contains($$m))] | length' \
|| echo 0)
if [ "$${REVIEWED:-0}" -gt 0 ]; then
echo "#$$NUM already reviewed at $$SHORT — skip."
exit 0
fi
jq -c --arg slug "$$SLUG" \
'{slug: $$slug, number: .number, head: .head.sha, base: .base.sha,
title: .title, author: .user.login}' \
/tmp/pr-review/pr.json >> /tmp/pr-review/worklist.jsonl
echo "#$$NUM enqueued (head $$SHORT)."
- |
# ---- Clone, pick model, review, post ---------------------------------
set -eu
[ -s /tmp/pr-review/worklist.jsonl ] || { echo "Nothing to review."; exit 0; }
API="https://gitea.renner.uno/api/v1"
AUTH="Authorization: token $$REVIEW_TOKEN"
WS="$$PWD" # workspace = this repo, checked out at the PR head by Woodpecker
MAX_DIFF_LINES=20000
# Agent prompts: use the local homelab checkout if present, else clone
# public homelab@master for them (one source of truth for the rubric).
PROMPTS="$$WS/ci/agents/pr-review"
HOMELAB="$$WS" # repo root holding ci/ AND scripts/ci/
# NB: for a homelab PR, HOMELAB is the PR head checkout, so the
# fetch-models.sh run below executes branch-supplied shell. It is wrapped
# in `env -u REVIEW_TOKEN`, so the only credential it can see is
# CLAUDE_CODE_OAUTH_TOKEN. This is not a new exposure regardless: on
# pull_request Woodpecker already takes .woodpecker/*.yml itself from the
# PR branch, so a branch can run arbitrary commands in this step anyway.
if [ ! -f "$$PROMPTS/prompt.md" ]; then
rm -rf /tmp/pr-review/homelab
git clone --quiet --depth 1 https://gitea.renner.uno/k.renner/homelab \
/tmp/pr-review/homelab
PROMPTS=/tmp/pr-review/homelab/ci/agents/pr-review
HOMELAB=/tmp/pr-review/homelab
fi
echo "Using prompts from $$PROMPTS"
gitea_post() { # method url datafile ; echoes+checks HTTP
code=$$(curl -s -o /tmp/pr-review/resp.json -w '%{http_code}' \
-X "$$1" -H "$$AUTH" -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/pr-review/resp.json; echo; return 1
fi
}
while IFS= read -r ITEM; do
SLUG=$$(printf '%s' "$$ITEM" | jq -r '.slug')
NUM=$$(printf '%s' "$$ITEM" | jq -r '.number')
HEAD=$$(printf '%s' "$$ITEM" | jq -r '.head')
TITLE=$$(printf '%s' "$$ITEM" | jq -r '.title')
SHORT=$$(printf '%s' "$$HEAD" | cut -c1-8)
echo "=== Reviewing $$SLUG#$$NUM ($$SHORT) ==="
D="/tmp/pr-review/$$NUM"
rm -rf "$$D"; mkdir -p "$$D"
# PR metadata + unified diff (authenticated; private repos need it).
curl -sf -H "$$AUTH" "$$API/repos/$$SLUG/pulls/$$NUM" > "$$D/pr.json"
curl -sf -H "$$AUTH" "$$API/repos/$$SLUG/pulls/$$NUM.diff" > "$$D/diff.full.patch" \
|| { echo "Could not fetch diff for $$SLUG#$$NUM — skipping."; continue; }
FILES=$$(grep -c '^diff --git ' "$$D/diff.full.patch" || true)
ADDED=$$(grep -c '^+[^+]' "$$D/diff.full.patch" || true)
DELETED=$$(grep -c '^-[^-]' "$$D/diff.full.patch" || true)
TOTAL=$$(wc -l < "$$D/diff.full.patch")
if [ "$$TOTAL" -gt "$$MAX_DIFF_LINES" ]; then
head -n "$$MAX_DIFF_LINES" "$$D/diff.full.patch" > "$$D/diff.patch"
printf '\n... [diff truncated at %s of %s lines] ...\n' \
"$$MAX_DIFF_LINES" "$$TOTAL" >> "$$D/diff.patch"
else
cp "$$D/diff.full.patch" "$$D/diff.patch"
fi
printf 'repo: %s\nPR: #%s\nfiles_changed: %s\nlines_added: %s\nlines_deleted: %s\ndiff_total_lines: %s\n' \
"$$SLUG" "$$NUM" "$$FILES" "$$ADDED" "$$DELETED" "$$TOTAL" > "$$D/stats.txt"
# Cheaper inputs for the TRIAGE agent (which now runs on a capable
# default model): the COMPLETE changed-file list, plus a diff capped far
# smaller than the review's. Triage only gauges size/shape/sensitivity,
# so it never needs the full (up to 20k-line) review diff — this keeps
# "triage is cheap" true now that its model is no longer pinned to Haiku.
grep '^diff --git ' "$$D/diff.full.patch" | sed 's|^diff --git a/||; s| b/.*$$||' \
| sort -u > "$$D/files.txt"
head -n 4000 "$$D/diff.patch" > "$$D/diff.triage.patch"
# No manual clone of the target repo: this runs on a pull_request
# event, so Woodpecker's built-in clone already checked THIS repo out
# at the PR head in $$WS — the agents (which cd into $$WS) read it
# directly for context. The old cron model had to clone each target
# repo by hand (its workspace was homelab@master), and that clone
# embedded REVIEW_TOKEN in the URL, persisting a write-scoped PAT in
# work/target/.git/config — readable by the review agent whose report
# is posted publicly. Per-repo pull_request triggering makes the manual
# clone redundant AND keeps the token off disk (it now lives only in
# the ephemeral curl Authorization headers used for the API calls).
# Inputs the agents read live at ./.pr-review (symlink into $$D).
rm -f "$$WS/.pr-review"; ln -s "$$D" "$$WS/.pr-review"
# --- Triage: an agent picks the model from the LIVE catalog, so no
# model id and no model family is baked into this file.
# fetch-models.sh asks the Anthropic /v1/models list (via the same
# CLAUDE_CODE_OAUTH_TOKEN) and we hand the triage the result at
# ./.pr-review/models.txt. If the fetch fails the file is empty and
# MODEL stays empty below, so the review runs on the CLI default.
if MODELS_TABLE=$$(env -u REVIEW_TOKEN sh "$$HOMELAB/scripts/ci/fetch-models.sh" --table); then
printf '%s\n' "$$MODELS_TABLE" > "$$D/models.txt"
echo "Live model catalog ($$(wc -l < "$$D/models.txt") models) written for triage."
else
: > "$$D/models.txt"
echo "Model catalog fetch failed — triage/review will use the CLI default model."
fi
# env -u REVIEW_TOKEN: the agents never call Gitea (the shell does, via
# $$AUTH), so the write:repository PAT must not sit in the agent's env
# where a prompt-injected diff could read /proc/self/environ. Defence in
# depth alongside the settings.json Read-sandbox. Triage itself runs on
# the CLI default model (no --model) — we don't name a family even to
# bootstrap the pick.
cat "$$PROMPTS/triage-prompt.md" | env -u REVIEW_TOKEN claude \
--permission-mode acceptEdits \
--allowedTools "Read,Glob,Grep,Write" \
--settings "$$PROMPTS/settings.json" \
-p || echo "(triage agent exited non-zero)"
# Use the triage's pick only if it is a currently-available id;
# otherwise (hallucinated id, or empty catalog) leave MODEL empty so
# the review runs on the CLI default — a run never dies on selection.
MODEL=$$(jq -r '.model // empty' "$$D/triage.json" 2>/dev/null || true)
CPLX=$$(jq -r '.complexity // "unknown"' "$$D/triage.json" 2>/dev/null || echo unknown)
# triage.json is UNTRUSTED (the triage reads the attacker-controlled
# diff and its Write is not path-scoped). valid-model.sh is the single,
# unit-tested gate (scripts/ci/test-model-selection.sh): it echoes the id
# only if it is a safe [A-Za-z0-9._-] token present in the catalog, else
# nothing — so a value like "claude-x\n--dangerously-skip-permissions"
# can never reach the unquoted --model expansion below. Empty -> default.
# CRITICAL: validate against $$MODELS_TABLE — the catalog captured in a
# shell variable BEFORE the triage ran — NOT the on-disk ./.pr-review/
# models.txt, which the triage's unscoped Write could overwrite to smuggle
# an attacker-chosen token past the membership check (the triage reads the
# file, but only $$MODELS_TABLE is trusted). This mirrors pick-model.sh,
# which validates its pick against its in-memory table for the same reason.
# env -u REVIEW_TOKEN: like fetch-models.sh above, this runs a script from
# $$HOMELAB (branch-supplied for a homelab PR) — it must not see the PAT.
# `|| true`: keep the "a run never dies on selection" invariant even if
# the script is absent (e.g. a PR that moves scripts/ci/).
MODEL=$$(printf '%s\n' "$$MODELS_TABLE" | env -u REVIEW_TOKEN sh "$$HOMELAB/scripts/ci/valid-model.sh" "$$MODEL" || true)
[ -n "$$MODEL" ] || echo "Triage model rejected or not in live catalog — using the CLI default model."
# Defence in depth: for a complex / security-sensitive review, do NOT
# trust the triage's pick (it read the attacker-controlled diff and could
# be injected into naming the weakest catalog entry to get a shallow
# review). Fall back to the CLI default — the strongest configured model.
if [ "$$CPLX" = complex ] && [ -n "$$MODEL" ]; then
echo "complex review — ignoring triage pick '$$MODEL', using the CLI default (strongest) model."
MODEL=
fi
if [ -n "$$MODEL" ]; then echo "Triage: complexity=$$CPLX -> model=$$MODEL"; else echo "Triage: complexity=$$CPLX -> CLI default model"; fi
# --- Review with the chosen model ---
( cd "$$WS" && cat "$$PROMPTS/prompt.md" | env -u REVIEW_TOKEN claude $${MODEL:+--model $$MODEL} \
--permission-mode acceptEdits \
--allowedTools "Read,Glob,Grep,Write" \
--settings "$$PROMPTS/settings.json" \
-p ) || echo "(review agent exited non-zero)"
if [ ! -s "$$D/report.md" ]; then
echo "Agent wrote no report for $$SLUG#$$NUM — skipping post."
continue
fi
EVENT=$$(jq -r '.event // "COMMENT"' "$$D/verdict.json" 2>/dev/null || echo COMMENT)
case "$$EVENT" in REQUEST_CHANGES|COMMENT) ;; *) EVENT=COMMENT;; esac # never APPROVE
# Assemble the review body: header + report + marker footer.
{
printf '🤖 **Automated review** — model `%s` (complexity: %s), commit `%s`.\n\n' \
"$${MODEL:-CLI default}" "$$CPLX" "$${HEAD}"
printf '> Advisory review by the `review-bot` pipeline. It never approves; a human merges. Push new commits to get a fresh review.\n\n---\n\n'
cat "$$D/report.md"
printf '\n\n<!-- pr-review:sha=%s -->\n' "$$HEAD"
} > "$$D/body.md"
jq -n --rawfile b "$$D/body.md" --arg e "$$EVENT" --arg c "$$HEAD" \
'{body: $$b, event: $$e, commit_id: $$c}' > "$$D/review.json"
gitea_post POST "$$API/repos/$$SLUG/pulls/$$NUM/reviews" "$$D/review.json" \
&& echo "Posted $$EVENT review on $$SLUG#$$NUM." \
|| echo "FAILED to post review on $$SLUG#$$NUM (continuing)."
rm -f "$$WS/.pr-review"
done < /tmp/pr-review/worklist.jsonl
echo "PR review run complete."
+9 -5
View File
@@ -42,7 +42,7 @@ steps:
# this step is skipped — otherwise we'd fork-bomb PRs.
when:
- branch: master
image: gitea.renner.uno/gitea_admin/ci-claude:2026-05-01
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.218
environment:
CLAUDE_CODE_OAUTH_TOKEN:
from_secret: claude_code_oauth_token
@@ -96,7 +96,11 @@ steps:
# latter passes a multi-KB substituted string into the command
# line which busybox ash's tracer (set -x) misparsed under
# woodpecker, producing a spurious "unterminated quoted string".
cat ci/agents/security-fix/prompt.md | claude \
# 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 "fix CRITICAL/HIGH CVEs and IaC misconfigurations (Trivy findings) in Kubernetes/Ansible manifests by editing files; multi-step, security-sensitive work touching container versions, RBAC and configuration that needs careful, capable reasoning")
if [ -n "$$MODEL" ]; then echo "security-fix: selected model $$MODEL"; else echo "security-fix: no live catalog — using the CLI default model"; fi
cat ci/agents/security-fix/prompt.md | claude $${MODEL:+--model $$MODEL} \
--permission-mode acceptEdits \
--allowedTools "Read,Edit,Write,Glob,Grep" \
-p
@@ -115,15 +119,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/gitea_admin/homelab.git" HEAD:"$$BRANCH"
git push "https://$$GITEA_TOKEN@gitea.renner.uno/k.renner/homelab.git" HEAD:"$$BRANCH"
jq -n \
--arg title "$$TITLE" \
--arg body "$$BODY" \
--arg head "$$BRANCH" \
'{title: $$title, body: $$body, head: $$head, base: "master"}' \
| curl -sf -X POST \
| curl -sfL -X POST \
-H "Authorization: token $$GITEA_TOKEN" \
-H "Content-Type: application/json" \
--data @- \
https://gitea.renner.uno/api/v1/repos/gitea_admin/homelab/pulls \
https://gitea.renner.uno/api/v1/repos/k.renner/homelab/pulls \
| jq '{number, html_url, title}'
+53 -18
View File
@@ -14,14 +14,14 @@
# here (which gate on an injected `PIPELINE` var set at cron-create
# time in the UI), this uses Woodpecker's documented `cron:` name
# filter so the schedule can be created entirely from the CLI:
# woodpecker repo cron add --repo gitea_admin/homelab \
# woodpecker repo cron add --repo k.renner/homelab \
# --name update-audit --branch master --schedule '@weekly'
# - manual : woodpecker pipeline create --branch master \
# --var PIPELINE=update-audit gitea_admin/homelab
# --var PIPELINE=update-audit k.renner/homelab
#
# NOTE: e2e.yml has a bare `event: cron` (no filter), so it runs on EVERY cron,
# including this one — a weekly e2e run will piggyback on the audit. That's a
# pre-existing property of e2e.yml, not something this pipeline introduces.
# NOTE: e2e.yml runs on an explicit list of cron names that includes this one,
# so a weekly e2e run piggybacks on the audit (it was a bare `event: cron`
# until the 15-minute alert-monitor cron made that untenable).
when:
- event: cron
cron: update-audit
@@ -30,19 +30,25 @@ when:
steps:
- name: update-audit-agent
image: gitea.renner.uno/gitea_admin/ci-claude:2026-05-01
image: gitea.renner.uno/gitea_admin/ci-claude:2.1.218
environment:
CLAUDE_CODE_OAUTH_TOKEN:
from_secret: claude_code_oauth_token
# security_bot_token is scoped for code/PRs only — its issue POST
# returned HTTP 403 "token does not have ... write:issue", so the
# audit ran green but never created an issue. Switch to gitea_token,
# the broader machine account already used by build-caddy /
# build-ci-images for release + registry writes, which is the most
# likely existing secret to also carry write:issue. Audit issues are
# then attributed to this token's owner rather than the security bot.
# Dedicated identity: update-audit-bot, PAT scoped to write:issue ONLY.
#
# This resolves the gap #197 tracked. The history: security_bot_token is
# scoped for code/PRs, so its issue POST returned 403 and the audit ran
# green while creating nothing; the fix at the time was the admin-owned
# gitea_token, which handed a broad credential to a WebFetch-capable
# agent that reads untrusted third-party release pages. That is now a
# narrow token that cannot do anything but write issues — verified 403
# on /user/repos and /admin/users. See #330.
#
# The other mitigations still apply and are still load-bearing: tool
# scoping (no WebSearch), the Read sandbox in settings.json, and the
# prompt hardening that treats fetched content as untrusted data.
GITEA_TOKEN:
from_secret: gitea_token
from_secret: update_audit_bot_token
commands:
- |
# Hand off to Claude Code in headless mode. Same auth model as the
@@ -51,9 +57,38 @@ steps:
# pins, fetches upstream releases, and writes a report to /tmp. It
# has NO Edit/Bash, so it cannot mutate the repo. Prompt is piped via
# stdin (see security-scan.yml for why -p "$(cat ...)" is avoided).
cat ci/agents/update-audit/prompt.md | claude \
#
# Security hardening (gitea issue #197 — prompt-injection exfil via
# the untrusted release pages this agent fetches):
# - WebSearch is dropped. It can't be domain-scoped (unlike
# WebFetch) and the prompt already gives explicit source URLs or
# a well-known registry (Artifact Hub / chart source repo) for
# everything it needs to look up.
# - --settings loads ci/agents/update-audit/settings.json, which
# denies Read on /proc, /root, /home, /etc, and this repo's own
# .git/ — closing off the credential-file and env-dump read
# paths a prompt-injected instruction could otherwise try.
# (Write path-scoping was tested and found NOT to be enforced
# under --permission-mode acceptEdits in the current Claude Code
# CLI, so it's intentionally not relied on here; the pipeline
# only ever trusts /tmp/update-audit.md regardless of what else
# the agent writes.)
# - prompt.md now tells the agent fetched content is untrusted
# data, not instructions, and to never echo it verbatim.
# A full WebFetch domain allowlist was considered and rejected: the
# Helm-chart-version check legitimately needs to reach whichever
# chart-repo domain each HelmRelease's own (already-trusted)
# HelmRepository/OCIRepository URL points at — a fixed allowlist
# across ~20 charts would need updating every time a chart is added
# and would silently stop auditing anything not yet listed.
# 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 "weekly, read-only homelab infrastructure update audit: compare Talos/Kubernetes/Flux/Helm/Ansible/OpenTofu version pins against upstream releases and write a drift report; moderate-difficulty analysis, no code changes")
if [ -n "$$MODEL" ]; then echo "update-audit: selected model $$MODEL"; else echo "update-audit: no live catalog — using the CLI default model"; fi
cat ci/agents/update-audit/prompt.md | claude $${MODEL:+--model $$MODEL} \
--permission-mode acceptEdits \
--allowedTools "Read,Glob,Grep,Write,WebFetch,WebSearch" \
--allowedTools "Read,Glob,Grep,Write,WebFetch" \
--settings ci/agents/update-audit/settings.json \
-p
- |
# Bail cleanly if the agent produced no report.
@@ -76,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/gitea_admin/homelab"
API="https://gitea.renner.uno/api/v1/repos/k.renner/homelab"
# write <method> <url> <payload-file> -> prints HTTP code, fails non-2xx
gitea_write() {
@@ -90,7 +125,7 @@ steps:
fi
}
ISSUE=$$(curl -sf -H "Authorization: token $$GITEA_TOKEN" \
ISSUE=$$(curl -sfL -H "Authorization: token $$GITEA_TOKEN" \
"$$API/issues?state=open&type=issues&limit=50" \
| jq -r --arg t "$$TITLE" 'map(select(.title == $$t)) | .[0].number // empty')
-28
View File
@@ -23,34 +23,6 @@
"/^cd /home/krenner/opentofu && tofu validate$/": {
"approve": true,
"matchCommandLine": true
},
"/^ssh root@10\\.2\\.40\\.214 \"journalctl -u act_runner -n 50\"$/": {
"approve": true,
"matchCommandLine": true
},
"/^ssh -o StrictHostKeyChecking=no root@gitea-runner-1 \"journalctl -u act_runner -n 100 --no-pager\"$/": {
"approve": true,
"matchCommandLine": true
},
"/^ssh -o StrictHostKeyChecking=no root@gitea-runner-1 \"journalctl -u act_runner -n 50 --no-pager\"$/": {
"approve": true,
"matchCommandLine": true
},
"/^ssh -o StrictHostKeyChecking=no root@gitea-runner-1 \"journalctl -u act_runner -n 200 --no-pager\"$/": {
"approve": true,
"matchCommandLine": true
},
"/^sleep 5 && ssh -o StrictHostKeyChecking=no root@gitea-runner-1 \"journalctl -u act_runner -n 200 --no-pager\"$/": {
"approve": true,
"matchCommandLine": true
},
"/^sleep 15 && ssh -o StrictHostKeyChecking=no root@gitea-runner-1 \"journalctl -u act_runner -n 200 --no-pager\"$/": {
"approve": true,
"matchCommandLine": true
},
"/^sleep 20 && ssh -o StrictHostKeyChecking=no root@gitea-runner-1 \"journalctl -u act_runner -n 200 --no-pager\"$/": {
"approve": true,
"matchCommandLine": true
}
}
}
+20 -1
View File
@@ -6,7 +6,26 @@ 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 AAAAC3NzaC1lZDI1NTE5AAAAIGfe3HJqFR+jIGrboweseAO7XjIVE24sje/b1HybgU9C ansible-runner@ci-new
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'
@@ -0,0 +1,16 @@
$ANSIBLE_VAULT;1.1;AES256
35646538363164363061366433343963623166336630376233333033646637336266343337343230
3233356135323762636439336466663430366238363338650a633762623366643137303333383634
62623739363132303335636261626263333332623066303161633466306431623930666166323833
6439663964353338350a656435626664646666363831363164393335386666356637613037323838
63653461656366613331353064656161346263356131346437666632386166623037373363333534
37323435623366643534633333303534313434613135653237303966656162633266623433363934
36343133393834393765353338383764303664363431653865633764306138376366623832346262
36303766623331666632613639366139333661636665363631326565653938343637323861653064
37393465383263376337376639613162306563653365623036376662303030613264653534353332
66363030356363373439306164386561363734353631363738656236633164633062613437663366
62386430396262366336316166353366383233316333333234666538643962336361363630363762
31653963303032373531386566336632336130383034343430303964396538663237346434613737
39643765623766373639306132316635376434643232336163303066393736313130323065666232
39393038616162666666383837326137376233613437636361636238663566336365653863643933
353338646134383038323134323034653564
@@ -9,3 +9,30 @@ edge_zwavejs_session_secret: "{{ vault_edge_zwavejs_session_secret }}"
# loki.renner.uno ingress; the matching htpasswd line lives in the cluster
# secret kubernetes/apps/monitoring/loki-basic-auth.sops.yaml).
edge_loki_password: "{{ vault_edge_loki_password }}"
# --- NTP (see plays/install-ntp-ha.yml) ---
# edge-1 serves NTP from its untagged VLAN 30 address (10.2.30.108); clients on
# other VLANs reach it via inter-VLAN routing, so no tagged interface is needed
# for chrony itself.
#
# keepalived stays off until enp1s0.40 exists: VRRP needs layer-2 adjacency with
# the PVE members on VLAN 40, and the host currently has only untagged VLAN 30
# (the switch port now permits VLAN 40, but /etc/systemd/network/ has no matching
# .netdev/.network pair). Adding it needs care — 20-wired.network matches
# 'Type=ether' broadly, and this box is headless.
ntp_keepalived_enabled: true
ntp_keepalived_interface: "enp1s0.40"
# Tagged VLAN 40 sub-interface (switch port permits VLAN 40; VLAN 30 stays
# untagged/native). Prerequisite for ntp_keepalived_enabled.
edge_vlan40_enabled: true
# VRRP needs ip_nonlocal_bind but NOT ip_forward. The role's default enables
# both (correct on the PVE hypervisors); enabling forwarding here would make
# edge-1 a router between IoT VLAN 30 and service VLAN 40 once the tagged
# interface exists, bypassing the UDM's inter-VLAN policy.
keepalived_ntp_sysctl:
- {name: "net.ipv4.ip_nonlocal_bind", value: "1"}
# Realtek NIC on the Wyse 3040 has no hardware timestamping.
chrony_hwtimestamp: false
@@ -0,0 +1,8 @@
---
# --- NTP (see plays/install-ntp-ha.yml) ---
# The PVE hosts hold the 10.2.40.4 VIP via keepalived on the VLAN 40 bridge
# sub-interface. This role disappears when these nodes are rebuilt as bare-metal
# Talos, which cannot run chrony or keepalived — edge-1 is being brought into
# ntp_cluster to take over.
ntp_keepalived_enabled: true
ntp_keepalived_interface: "vmbr1.40"
@@ -1,2 +0,0 @@
---
woodpecker_grpc_secret: "{{ vault_woodpecker_grpc_secret }}"
@@ -1,4 +0,0 @@
---
woodpecker_grpc_secret: "{{ vault_woodpecker_grpc_secret }}"
woodpecker_gitea_client: "{{ vault_woodpecker_gitea_client }}"
woodpecker_gitea_secret: "{{ vault_woodpecker_gitea_secret }}"
+17 -12
View File
@@ -15,16 +15,12 @@ authentik_app
authentik-app-1.srv.renner.uno ansible_user=root
authentik-app-2.srv.renner.uno ansible_user=root
[proxmox_dns_ha]
proxmox-dns-1.srv.renner.uno ansible_host=10.2.40.54 ansible_user=root
proxmox-dns-2.srv.renner.uno ansible_host=10.2.40.55 ansible_user=root
proxmox-dns-3.srv.renner.uno ansible_host=10.2.40.56 ansible_user=root
[netbird_server]
netbird.renner.uno ansible_user=root
[netbird_proxy]
proxy-1.renner.uno ansible_user=root
proxy-2.renner.uno ansible_user=root
[synology_nas]
@@ -33,12 +29,21 @@ nas-1.renner.uno ansible_user=ladmin ansible_python_interpreter=/usr/bin/python3
[grafana]
grafana.srv.renner.uno ansible_user=ladmin
[woodpecker_server]
woodpecker.srv.renner.uno ansible_user=root
[woodpecker_agents]
wp-agent-1.srv.renner.uno ansible_user=root
wp-agent-2.srv.renner.uno ansible_user=root
[edge_host]
edge-1.iot.renner.uno ansible_user=root
# NTP servers. Includes edge-1 so the role survives the PVE hosts being
# retired for bare-metal Talos, which cannot run chrony or keepalived itself.
# See plays/install-ntp-ha.yml for why keepalived is scoped more narrowly
# than chrony within this group.
[ntp_cluster:children]
pve_cluster
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
+11 -1
View File
@@ -7,8 +7,18 @@
gitea_binary: "/usr/local/bin/gitea"
gitea_conf_dir: "/etc/gitea"
gitea_service_file: "/etc/systemd/system/gitea.service"
# Safety switch: must be set to true explicitly. This play is archived
# (one-off cleanup of an accidental install) and deletes the gitea
# service/binary/config/user on every host except gitea.srv.renner.uno
# if run unguarded.
confirm_destroy: false
tasks:
- name: Safety Check
ansible.builtin.fail:
msg: "This archived playbook removes the gitea service/binary/config/user on all hosts except gitea.srv.renner.uno. You must run with -e 'confirm_destroy=true'."
when: not confirm_destroy | bool
- name: Stop and disable gitea service
systemd:
name: gitea
@@ -2,7 +2,17 @@
- name: Remove cpool storage and uninstall Ceph
hosts: pve_cluster
become: true
vars:
# Safety switch: must be set to true explicitly. This play is archived
# (one-off Ceph decommission) and destroys ZFS volumes fleet-wide via
# `zfs destroy -rf` if run unguarded.
confirm_destroy: false
tasks:
- name: Safety Check
ansible.builtin.fail:
msg: "This archived playbook destroys Ceph OSD ZFS volumes and purges Ceph fleet-wide. You must run with -e 'confirm_destroy=true'."
when: not confirm_destroy | bool
- name: Remove cpool configuration from Proxmox storage
command: pvesm remove cpool
register: pvesm_remove
-59
View File
@@ -1,59 +0,0 @@
---
# Dump the Immich DB from the legacy LXC (225) to a local file on the
# controller (CI runner), where a downstream pipeline step consumes it
# to produce a Barman seed for the CNPG `bootstrap.recovery` path.
# The library tarball is handled separately by `backup-immich.yml`.
- name: Dump Immich DB from legacy LXC to CI runner
hosts: immich.srv.renner.uno
become: true
vars:
immich_db_name: immich
immich_db_user: immich
tasks:
- name: Find running Immich DB container
ansible.builtin.shell: >
docker ps --filter "label=com.docker.compose.service=database"
--format '{{ "{{" }}.Names{{ "}}" }}' | head -1
register: immich_db_container
changed_when: false
- name: Fail if DB container not found
ansible.builtin.fail:
msg: "Could not find Immich DB container (compose service=database)"
when: immich_db_container.stdout | trim == ""
- name: Dump DB to /tmp on legacy host
ansible.builtin.shell: >
docker exec -i {{ immich_db_container.stdout | trim }}
pg_dump --clean --if-exists --no-owner --no-privileges --format=custom
-U {{ immich_db_user }} {{ immich_db_name }}
> /tmp/immich-backup.dump
args:
executable: /bin/bash
changed_when: true
- name: Make dump readable
ansible.builtin.file:
path: /tmp/immich-backup.dump
mode: "0644"
- name: Report dump size
ansible.builtin.stat:
path: /tmp/immich-backup.dump
register: dump_stat
- name: Show dump size
ansible.builtin.debug:
msg: "Dump created: {{ (dump_stat.stat.size / 1024 / 1024) | round(1) }} MB"
- name: Fetch dump to controller
ansible.builtin.fetch:
src: /tmp/immich-backup.dump
dest: /tmp/immich-backup.dump
flat: true
- name: Remove remote dump
ansible.builtin.file:
path: /tmp/immich-backup.dump
state: absent
-200
View File
@@ -1,200 +0,0 @@
---
# Chaos Testing Playbook
# Tests failover capabilities of HA components
#
# Usage:
# # Test all components
# ansible-playbook -i inventory/ plays/chaos-testing.yml
#
# # Test specific component
# ansible-playbook -i inventory/ plays/chaos-testing.yml --tags dns
# ansible-playbook -i inventory/ plays/chaos-testing.yml --tags postgres
#
# WARNING: This will temporarily disrupt services. Run during maintenance windows.
- name: Chaos Testing - Infrastructure Failover Validation
hosts: localhost
gather_facts: no
vars:
dns_vip: "10.2.40.53"
dns_primary: "10.2.40.54"
dns_backup1: "10.2.40.55"
dns_backup2: "10.2.40.56"
postgres_vip: "10.2.40.135"
postgres_primary: "authentik-db-1.srv.renner.uno"
postgres_backup: "authentik-db-2.srv.renner.uno"
test_results: []
tasks:
# =========================================================================
# DNS CLUSTER FAILOVER TEST
# =========================================================================
- name: "DNS Test - Record initial state"
tags: [dns]
block:
- name: Check which node holds DNS VIP
shell: |
for ip in {{ dns_primary }} {{ dns_backup1 }} {{ dns_backup2 }}; do
if ssh -o ConnectTimeout=2 root@$ip 'ip addr show | grep -q {{ dns_vip }}' 2>/dev/null; then
echo $ip
exit 0
fi
done
echo "NONE"
register: dns_vip_holder
changed_when: false
- name: Record DNS VIP holder
set_fact:
dns_master_before: "{{ dns_vip_holder.stdout }}"
- name: Verify DNS resolution works before test
shell: dig @{{ dns_vip }} gitea.srv.renner.uno +short +time=2
register: dns_before
failed_when: dns_before.rc != 0
- name: "DNS CHAOS - Stop DNS service on master ({{ dns_master_before }})"
shell: ssh root@{{ dns_master_before }} 'systemctl stop proxmox-dns'
when: dns_master_before != "NONE"
- name: Wait for VIP migration (max 10 seconds)
pause:
seconds: 10
- name: Verify DNS still resolves via VIP
shell: dig @{{ dns_vip }} gitea.srv.renner.uno +short +time=5
register: dns_after
failed_when: dns_after.rc != 0
ignore_errors: yes
- name: Check which node now holds VIP
shell: |
for ip in {{ dns_primary }} {{ dns_backup1 }} {{ dns_backup2 }}; do
if ssh -o ConnectTimeout=2 root@$ip 'ip addr show | grep -q {{ dns_vip }}' 2>/dev/null; then
echo $ip
exit 0
fi
done
echo "NONE"
register: dns_vip_holder_after
changed_when: false
- name: Record DNS failover result
set_fact:
test_results: "{{ test_results + [{'component': 'DNS Cluster', 'status': 'PASS' if dns_after.rc == 0 else 'FAIL', 'master_before': dns_master_before, 'master_after': dns_vip_holder_after.stdout, 'failover_time': '< 10 seconds'}] }}"
- name: "DNS RESTORE - Restart DNS service on original master"
shell: ssh root@{{ dns_master_before }} 'systemctl start proxmox-dns'
when: dns_master_before != "NONE"
- name: Wait for service to stabilize
pause:
seconds: 5
# =========================================================================
# POSTGRESQL HA FAILOVER TEST
# =========================================================================
- name: "PostgreSQL Test - Record initial state"
tags: [postgres]
block:
- name: Check PostgreSQL replication status on primary
shell: |
ssh root@{{ postgres_primary }} 'sudo -u postgres psql -t -c "SELECT pg_is_in_recovery();"' 2>/dev/null | tr -d ' '
register: pg_primary_status
changed_when: false
ignore_errors: yes
- name: Check which node holds PostgreSQL VIP
shell: |
if ssh -o ConnectTimeout=2 root@{{ postgres_primary }} 'ip addr show | grep -q {{ postgres_vip }}' 2>/dev/null; then
echo "{{ postgres_primary }}"
elif ssh -o ConnectTimeout=2 root@{{ postgres_backup }} 'ip addr show | grep -q {{ postgres_vip }}' 2>/dev/null; then
echo "{{ postgres_backup }}"
else
echo "NONE"
fi
register: pg_vip_holder
changed_when: false
- name: Record PostgreSQL VIP holder
set_fact:
pg_master_before: "{{ pg_vip_holder.stdout }}"
- name: Verify PostgreSQL connection via VIP
shell: |
ssh root@{{ postgres_primary }} 'PGPASSWORD=test psql -h {{ postgres_vip }} -U postgres -c "SELECT 1;" 2>&1' || echo "Connection test skipped"
register: pg_before
changed_when: false
ignore_errors: yes
- name: "PostgreSQL CHAOS - Stop keepalived on VIP holder"
shell: ssh root@{{ pg_master_before }} 'systemctl stop keepalived'
when: pg_master_before != "NONE"
- name: Wait for VIP migration (max 10 seconds)
pause:
seconds: 10
- name: Check which node now holds PostgreSQL VIP
shell: |
if ssh -o ConnectTimeout=2 root@{{ postgres_primary }} 'ip addr show | grep -q {{ postgres_vip }}' 2>/dev/null; then
echo "{{ postgres_primary }}"
elif ssh -o ConnectTimeout=2 root@{{ postgres_backup }} 'ip addr show | grep -q {{ postgres_vip }}' 2>/dev/null; then
echo "{{ postgres_backup }}"
else
echo "NONE"
fi
register: pg_vip_holder_after
changed_when: false
- name: Record PostgreSQL failover result
set_fact:
test_results: "{{ test_results + [{'component': 'PostgreSQL HA', 'status': 'PASS' if pg_vip_holder_after.stdout != 'NONE' and pg_vip_holder_after.stdout != pg_master_before else 'FAIL', 'master_before': pg_master_before, 'master_after': pg_vip_holder_after.stdout, 'failover_time': '< 10 seconds'}] }}"
- name: "PostgreSQL RESTORE - Restart keepalived on original master"
shell: ssh root@{{ pg_master_before }} 'systemctl start keepalived'
when: pg_master_before != "NONE"
- name: Wait for service to stabilize
pause:
seconds: 5
# =========================================================================
# TEST SUMMARY
# =========================================================================
- name: Display test results
tags: [always]
debug:
msg: |
╔══════════════════════════════════════════════════════════════╗
║ CHAOS TESTING RESULTS - {{ ansible_date_time.iso8601 | default('NOW') }}
╠══════════════════════════════════════════════════════════════╣
{% for result in test_results %}
║ {{ result.component | ljust(20) }} │ {{ result.status | ljust(6) }} │ {{ result.get('failover_time', result.get('details', 'N/A')) }}
{% endfor %}
╚══════════════════════════════════════════════════════════════╝
{% if test_results | selectattr('status', 'equalto', 'FAIL') | list | length > 0 %}
⚠️ SOME TESTS FAILED - Review results above
{% else %}
✅ ALL TESTS PASSED - HA failover working correctly
{% endif %}
- name: Save test results to file
tags: [always]
copy:
content: |
# Chaos Test Results
# Date: {{ ansible_date_time.iso8601 | default('unknown') }}
{% for result in test_results %}
## {{ result.component }}
- Status: {{ result.status }}
- Master Before: {{ result.get('master_before', 'N/A') }}
- Master After: {{ result.get('master_after', 'N/A') }}
- Failover Time: {{ result.get('failover_time', 'N/A') }}
- Details: {{ result.get('details', 'N/A') }}
{% endfor %}
dest: "/tmp/chaos-test-results-{{ ansible_date_time.date | default('latest') }}.md"
delegate_to: localhost
@@ -1,72 +0,0 @@
---
# Setup log collection for Gitea runners
# Deploys Promtail to collect act_runner logs and ship to Loki
#
# Usage:
# ansible-playbook -i inventory/ plays/setup-gitea-runner-logging.yml
- name: Setup Gitea Runner Log Collection
hosts: proxmox_gitea_runner
become: yes
vars:
promtail_loki_url: "http://loki.srv.renner.uno:3100/loki/api/v1/push"
promtail_scrape_configs:
# Collect act_runner service logs via journald
- job_name: act_runner
journal:
max_age: 12h
matches: _SYSTEMD_UNIT=act_runner.service
relabel_configs:
- source_labels: ['__journal__systemd_unit']
target_label: unit
- source_labels: ['__journal__hostname']
target_label: host
# Collect system logs
- job_name: syslog
static_configs:
- targets:
- localhost
labels:
job: syslog
host: "{{ inventory_hostname }}"
service: gitea-runner
__path__: /var/log/syslog
# Collect Docker daemon logs (runners use Docker)
- job_name: docker
journal:
max_age: 12h
matches: _SYSTEMD_UNIT=docker.service
relabel_configs:
- source_labels: ['__journal__systemd_unit']
target_label: unit
- source_labels: ['__journal__hostname']
target_label: host
roles:
- promtail
post_tasks:
- name: Verify promtail is running
systemd:
name: promtail
state: started
register: promtail_status
- name: Display promtail status
debug:
msg: "Promtail is {{ 'running' if promtail_status.status.ActiveState == 'active' else 'not running' }} on {{ inventory_hostname }}"
- name: Test Loki connectivity
uri:
url: "http://loki.srv.renner.uno:3100/ready"
method: GET
status_code: 200
timeout: 10
register: loki_health
ignore_errors: yes
- name: Display Loki connectivity status
debug:
msg: "Loki server is {{ 'reachable' if loki_health.status == 200 else 'NOT reachable - check network' }}"
@@ -1,34 +0,0 @@
---
# Configure Grafana with observability data sources and dashboards
# Usage: ansible-playbook -i inventory/ plays/configure-grafana-observability.yml
- name: Configure Grafana Observability Stack
hosts: grafana.srv.renner.uno
become: yes
gather_facts: yes
vars:
# Data source URLs
loki_url: "http://loki.srv.renner.uno:3100"
prometheus_url: "http://prometheus.srv.renner.uno:9090"
# Alerting configuration - update these with your values
alerting_email_enabled: true
alerting_email_to: "" # Set in group_vars or command line
alerting_ha_webhook_enabled: true
alerting_ha_webhook_url: "" # Set to your Home Assistant webhook URL
roles:
- grafana-observability
post_tasks:
- name: Display configuration status
debug:
msg: |
Grafana observability stack configured:
- Prometheus data source: {{ prometheus_url }}
- Loki data source: {{ loki_url }}
- Dashboards deployed to {{ grafana_dashboards_dir }}
Access Grafana at https://grafana.renner.uno
@@ -1,25 +0,0 @@
---
- name: Fix Immich Database Passwords
hosts: immich.srv.renner.uno
become: true
tasks:
- name: Load Immich Role Variables
ansible.builtin.include_role:
name: immich
tasks_from: empty
public: yes
- name: Reset 'immich' user password
ansible.builtin.command:
cmd: >
docker exec -u postgres immich_postgres psql -c "ALTER USER {{ immich_db_user }} WITH PASSWORD '{{ immich_db_password }}';"
- name: Reset 'postgres' user password
ansible.builtin.command:
cmd: >
docker exec -u postgres immich_postgres psql -c "ALTER USER postgres WITH PASSWORD '{{ immich_db_password }}';"
- name: Restart Immich
community.docker.docker_compose_v2:
project_src: "{{ immich_data_dir }}"
state: restarted
@@ -0,0 +1,53 @@
---
# Configure Proxmox VE Node Host Networking
#
# Fixes two defects found by live inspection on 2026-07-19:
#
# 1. All three nodes had no IPv6 address on any external interface. FRR
# enables ipv6 forwarding for the OSPFv3 corosync mesh, and with the
# kernel default accept_ra=1 the nodes silently discarded the Router
# Advertisements the gateway sends on VLAN 40. Fixed with accept_ra=2.
#
# 2. saturn's vmbr0 sits at MTU 1500 while its own uplink and both peer
# nodes are at 9000, so large frames between saturn's guests and the
# other nodes' guests blackhole instead of fragmenting.
#
# The sysctl fix is non-disruptive and applies on every run. The MTU fix is
# staged as a pending PVE network change and only applied when explicitly
# requested, because applying it reloads networking on the node and briefly
# interrupts the Talos k8s VM and its Ceph OSD.
#
# Safe (converges IPv6, stages the MTU change without applying it):
# ansible-playbook -i inventory/ plays/configure-pve-node-network.yml
#
# Applying the staged MTU change, one node at a time:
# ansible-playbook -i inventory/ plays/configure-pve-node-network.yml \
# --limit saturn -e pve_node_network_apply_pending=true
#
# See wiki: pve-ipv6-accept-ra-forwarding-defect,
# pve-saturn-vmbr0-mtu-asymmetry
- name: Configure PVE node host networking
hosts: pve_cluster
become: yes
serial: 1
roles:
- role: pve-node-network
post_tasks:
- name: Summarise node IPv6 state
ansible.builtin.command: ip -6 addr show dev vmbr1.40 scope global
register: pve_node_network_v6_summary
changed_when: false
failed_when: false
- name: Display node IPv6 state
ansible.builtin.debug:
msg: >-
{{ inventory_hostname }}:
{{ pve_node_network_v6_summary.stdout_lines
| select('search', 'inet6')
| map('trim')
| list
| default(['no global IPv6'], true) }}
+22 -10
View File
@@ -3,6 +3,22 @@
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:
@@ -17,20 +33,16 @@
- name: Deploy authorized keys to root
ansible.builtin.authorized_key:
user: root
key: "{{ item }}"
key: "{{ item.key }}"
key_options: "{{ item.options | default(omit) }}"
state: present
loop:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPzFNBP3bq2m/6JqDqod9w+FP/uxXxHMolqhq3Ojflr1 krenner@fortress"
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGfe3HJqFR+jIGrboweseAO7XjIVE24sje/b1HybgU9C ansible-runner@ci-new"
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICyNnX1I4W9jyDvCJ1DJauHSmbo1ZXSyBxVhSAwMWgen woodpecker-ci@homelab"
loop: "{{ authorized_keys }}"
- name: Deploy authorized keys to ladmin
ansible.builtin.authorized_key:
user: ladmin
key: "{{ item }}"
key: "{{ item.key }}"
key_options: "{{ item.options | default(omit) }}"
state: present
loop:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPzFNBP3bq2m/6JqDqod9w+FP/uxXxHMolqhq3Ojflr1 krenner@fortress"
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGfe3HJqFR+jIGrboweseAO7XjIVE24sje/b1HybgU9C ansible-runner@ci-new"
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICyNnX1I4W9jyDvCJ1DJauHSmbo1ZXSyBxVhSAwMWgen woodpecker-ci@homelab"
loop: "{{ authorized_keys }}"
ignore_errors: true
@@ -0,0 +1,20 @@
---
# 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 + monitoring-agent (Alloy -> Loki/Prometheus) are 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
-18
View File
@@ -1,18 +0,0 @@
---
- name: Setup Gitea Action Runners
hosts: proxmox_gitea_runner
become: yes
gather_facts: yes
user: root
pre_tasks:
- name: Ensure python3 is installed
raw: apt-get update && apt-get install -y python3 python3-pip
register: output
changed_when: output.stdout != ""
when: ansible_python_interpreter is not defined
roles:
- common
- docker-install
- gitea-runner
-8
View File
@@ -1,8 +0,0 @@
---
- name: Install and configure Gitea on LXC
hosts: gitea.srv.renner.uno
remote_user: root
become: true
roles:
- common
- gitea-lxc
-8
View File
@@ -1,8 +0,0 @@
---
- name: Install and Configure Immich
hosts: proxmox_immich
become: true
roles:
- role: common
- role: docker-install
- role: immich
+4
View File
@@ -16,6 +16,10 @@
- name: Deploy NetBird reverse-proxy cluster member
hosts: netbird_proxy
# Roll through cluster members one at a time. proxy.renner.uno round-robins
# across every member, so restarting them in parallel takes the whole proxy
# cluster down at once and defeats the point of running more than one.
serial: 1
become: true
roles:
- common
+52 -13
View File
@@ -1,10 +1,30 @@
---
# Install NTP Server in High Availability Configuration on Proxmox Hosts
# Install NTP Server in High Availability Configuration
# Deploys chrony as NTP server + keepalived for VIP failover
#
# Targets the ntp_cluster group: the three PVE hosts plus edge-1.
#
# The two roles have different reach on purpose:
#
# chrony-ntp-server runs everywhere. It only needs to listen on udp/123 and
# 'allow 10.2.0.0/16' covers every VLAN via inter-VLAN
# routing, so edge-1 serves time from its VLAN 30 address
# (10.2.30.108) with no network reconfiguration.
#
# keepalived-ntp runs only where ntp_keepalived_enabled is true. VRRP
# requires layer-2 adjacency with the other members on
# VLAN 40, and edge-1 has no VLAN 40 sub-interface yet
# (only untagged VLAN 30 on enp1s0). Once enp1s0.40 exists
# and is verified, flip the flag below.
#
# Migration note: as the PVE hosts are retired for bare-metal Talos, edge-1 is
# intended to become the sole NTP server. Its keepalived priority is set lowest
# so it stays BACKUP while the PVE nodes exist and wins the VIP by default once
# they are gone -- no config change required at cutover.
- name: Install NTP Server (HA)
hosts: pve_cluster
become: yes
hosts: ntp_cluster
become: true
vars:
ntp_vip: "10.2.40.4"
@@ -18,58 +38,77 @@
neptune:
priority: 80
state: "BACKUP"
edge-1.iot.renner.uno:
priority: 70
state: "BACKUP"
roles:
- role: chrony-ntp-server
- role: keepalived-ntp
when: ntp_keepalived_enabled | default(false)
vars:
keepalived_ntp_vip: "{{ ntp_vip }}"
keepalived_ntp_state: "{{ ntp_servers[inventory_hostname].state }}"
keepalived_ntp_priority: "{{ ntp_servers[inventory_hostname].priority }}"
keepalived_ntp_interface: "{{ ntp_keepalived_interface }}"
post_tasks:
- name: Wait for chrony to settle
pause:
ansible.builtin.pause:
seconds: 5
- name: Verify chrony is serving NTP
shell: chronyc clients | head -10
ansible.builtin.shell: chronyc clients | head -10
register: chrony_clients
changed_when: false
- name: Check NTP port is listening
shell: ss -lun | grep ':123 '
ansible.builtin.shell: ss -lun | grep ':123 '
register: ntp_port
failed_when: false
changed_when: false
- name: Display NTP port status
debug:
ansible.builtin.debug:
msg: "NTP port 123: {{ 'LISTENING' if ntp_port.rc == 0 else 'NOT LISTENING' }}"
- name: Check if this server has the VIP
shell: ip addr show | grep {{ ntp_vip }}
ansible.builtin.shell: ip addr show | grep {{ ntp_vip }}
register: vip_check
failed_when: false
changed_when: false
when: ntp_keepalived_enabled | default(false)
- name: Display VIP status
debug:
ansible.builtin.debug:
msg: >
{% if vip_check.rc == 0 %}
This server ({{ inventory_hostname }}) is MASTER and holds the VIP {{ ntp_vip }}
{% else %}
This server ({{ inventory_hostname }}) is BACKUP
{% endif %}
when: ntp_keepalived_enabled | default(false)
- name: Report hosts serving NTP without participating in the VIP
ansible.builtin.debug:
msg: >
{{ inventory_hostname }} serves NTP directly on its own address
(keepalived not enabled on this host).
when: not (ntp_keepalived_enabled | default(false))
- name: Test NTP via VIP (only on master)
shell: |
ansible.builtin.shell: |
chronyc -h {{ ntp_vip }} tracking 2>&1 || echo "Cannot connect to VIP (may need to wait for failover)"
register: ntp_vip_test
when: vip_check.rc == 0
when:
- ntp_keepalived_enabled | default(false)
- vip_check.rc == 0
changed_when: false
- name: Display VIP NTP test result
debug:
ansible.builtin.debug:
msg: "{{ ntp_vip_test.stdout_lines | default(['Not master, skipping VIP test']) }}"
when: vip_check.rc == 0
when:
- ntp_keepalived_enabled | default(false)
- vip_check.rc == 0
-72
View File
@@ -1,72 +0,0 @@
---
# Install Proxmox DNS Server in High Availability Configuration
# This playbook installs the DNS servers + keepalived for VIP failover
- name: Install Proxmox DNS Server (HA)
hosts: proxmox_dns_ha
become: yes
vars:
dns_vip: "10.2.40.53"
dns_servers:
proxmox-dns-1.srv.renner.uno:
priority: 100
state: "MASTER"
proxmox-dns-2.srv.renner.uno:
priority: 90
state: "BACKUP"
proxmox-dns-3.srv.renner.uno:
priority: 80
state: "BACKUP"
roles:
- role: proxmox-dns
- role: keepalived-vip
vars:
keepalived_vip: "{{ dns_vip }}"
keepalived_state: "{{ dns_servers[inventory_hostname].state }}"
keepalived_priority: "{{ dns_servers[inventory_hostname].priority }}"
post_tasks:
- name: Wait for DNS server to start
wait_for:
port: 53
timeout: 30
- name: Wait for keepalived to start
wait_for:
timeout: 10
- name: Check if this server has the VIP
shell: ip addr show | grep {{ dns_vip }}
register: vip_check
failed_when: false
changed_when: false
- name: Display VIP status
debug:
msg: >
{% if vip_check.rc == 0 %}
This server ({{ inventory_hostname }}) is MASTER and holds the VIP {{ dns_vip }}
{% else %}
This server ({{ inventory_hostname }}) is BACKUP
{% endif %}
- name: Test DNS resolution locally
shell: |
dig @localhost gitea.srv.renner.uno +short
register: dns_test
failed_when: false
changed_when: false
- name: Display DNS test result
debug:
msg: "DNS test result: {{ dns_test.stdout if dns_test.stdout else 'No result (may be expected if host does not exist yet)' }}"
- name: Install notification script
copy:
src: "{{ playbook_dir }}/../ansible/roles/keepalived-vip/files/keepalived-notify.sh"
dest: /usr/local/bin/keepalived-notify.sh
owner: root
group: root
mode: '0755'
-28
View File
@@ -1,28 +0,0 @@
---
# Install Proxmox DNS Server
# This playbook installs the custom DNS server that resolves VM/LXC hostnames
# by querying the Proxmox API
- name: Install Proxmox DNS Server
hosts: proxmox_dns
become: yes
roles:
- proxmox-dns
post_tasks:
- name: Wait for DNS server to start
wait_for:
port: 53
timeout: 30
- name: Test DNS resolution
shell: |
dig @localhost gitea.srv.renner.uno +short
register: dns_test
failed_when: false
changed_when: false
- name: Display DNS test result
debug:
msg: "DNS test result: {{ dns_test.stdout }}"
@@ -1,8 +0,0 @@
---
- name: Install and Configure Woodpecker CI Agents
hosts: woodpecker_agents
become: true
roles:
- role: common
- role: docker-install
- role: woodpecker-agent
@@ -1,8 +0,0 @@
---
- name: Install and Configure Woodpecker CI Server
hosts: woodpecker_server
become: true
roles:
- role: common
- role: docker-install
- role: woodpecker-server
+1 -1
View File
@@ -11,7 +11,7 @@
- import_playbook: update-lxc.yml
- import_playbook: update-authentik.yml
# Re-render docker-compose templates before pulling updates
- import_playbook: install-immich.yml
# (immich decommissioned — migrated to in-cluster deployment, see kubernetes/apps/immich/)
- import_playbook: install-n8n.yml
- import_playbook: install-grist.yml
- import_playbook: install-music-assistant.yml
-8
View File
@@ -1,8 +0,0 @@
---
# Proxmox DNS Server Secrets
# Encrypt this file with: ansible-vault encrypt proxmox_dns_vault.yml
# Proxmox API token for DNS server
# Create in Proxmox: Datacenter > Permissions > API Tokens
# Format: <token-id>!<token-name> = <secret>
proxmox_dns_api_token_value: "CHANGEME-your-proxmox-api-token-here"
-7
View File
@@ -1,7 +0,0 @@
vault_rustfs_secret_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
32363232626635353039653538623036386161393539353265366433306533346666616362373036
3633316536626339386236333839636538643438616531650a316539373264636438363262333633
63653737363433643833393561343138303564623635653437636164306238303539343934646361
3666343466333439630a323432666430386637663165323165363536633838303938323239313762
62396631366438303265653566366462363137353135663839303439313537666531
@@ -19,10 +19,7 @@ blackbox_http_targets:
- name: "prometheus"
url: "https://prometheus.renner.uno"
blackbox_dns_targets:
- name: "proxmox-dns"
target: "gitea.srv.renner.uno"
server: "10.2.40.53"
blackbox_dns_targets: []
blackbox_tcp_targets:
- name: "postgres-ha"
@@ -38,7 +38,7 @@ modules:
prober: dns
timeout: 5s
dns:
query_name: "gitea.srv.renner.uno"
query_name: "k8s-1.srv.renner.uno"
query_type: "A"
valid_rcodes:
- NOERROR
@@ -1,4 +0,0 @@
---
- name: Update CA Trust
command: update-ca-certificates
listen: "Update CA Trust"
+20 -6
View File
@@ -1,7 +1,21 @@
---
- name: Fetch Authentik Certificate
get_url:
url: https://authentik.renner.uno
dest: /usr/local/share/ca-certificates/authentik.crt
validate_certs: false
notify: Update CA Trust
# This role previously fetched https://authentik.renner.uno with
# validate_certs: false and installed whatever certificate it returned into
# the system-wide CA trust store (update-ca-certificates) on every
# Ansible-managed host. That is a MITM hole: an on-path or DNS-spoofing
# attacker during the fetch could plant an attacker-controlled CA into every
# host's trust store (gitea_admin/homelab#185).
#
# It also turned out to be dead weight: authentik.renner.uno is a stale
# hostname that isn't routed by the current Traefik/cert-manager ingress.
# The live service (auth.renner.uno, ldap.renner.uno) gets a real
# publicly-trusted certificate from Let's Encrypt via cert-manager
# (kubernetes/infrastructure/post-crds/clusterissuer.yaml), which is already
# covered by the OS default CA bundle. No custom/internal CA needs to be
# trusted for authentik, so there is nothing for this role to install.
#
# Left intentionally empty: if a genuine internal/private CA ever needs to
# be trusted cluster-wide, add a task here that installs a CA cert checked
# into this repo (or fetched with validate_certs: true over a channel that
# is actually verified) — never re-introduce an unverified fetch feeding
# update-ca-certificates.
@@ -17,3 +17,9 @@ chrony_upstream_pools:
# Local stratum if disconnected from upstream
chrony_local_stratum: 10
# Hardware timestamping. Fine on the PVE nodes' Intel NICs; the Wyse 3040
# (edge-1) has a Realtek NIC that does not support it, and chronyd logs an
# error per interface when asked for it. Overridden to false in
# inventory/group_vars/edge_host.
chrony_hwtimestamp: true
@@ -1,7 +1,8 @@
---
# Chrony NTP Server Handlers
# chrony_service_name is set by tasks/main.yml (chrony on Debian, chronyd on Arch).
- name: restart chrony
systemd:
name: chrony
ansible.builtin.systemd:
name: "{{ chrony_service_name }}"
state: restarted
+67 -10
View File
@@ -1,25 +1,82 @@
---
# Chrony NTP Server Role
#
# Supports Debian (PVE cluster nodes) and Arch (edge-1). The package is named
# 'chrony' on both, but three things differ and are resolved from facts below:
# - config path: Debian /etc/chrony/chrony.conf Arch /etc/chrony.conf
# - unit name: Debian chrony.service Arch chronyd.service
# - service user: Debian _chrony Arch chrony
# Arch's package also ships no /var/lib/chrony or /var/log/chrony (it defers
# them to tmpfiles.d), so this role creates them explicitly rather than relying
# on pacman hook ordering. Both creations are idempotent on Debian.
- name: Ensure chrony is installed
apt:
- name: Fail on unsupported distribution
ansible.builtin.fail:
msg: >-
chrony-ntp-server supports Debian and Archlinux only;
this host reports os_family={{ ansible_facts['os_family'] }}
when: ansible_facts['os_family'] not in ['Debian', 'Archlinux']
- name: Resolve distro-specific chrony paths and identifiers
ansible.builtin.set_fact:
chrony_config_path: >-
{{ '/etc/chrony/chrony.conf'
if ansible_facts['os_family'] == 'Debian'
else '/etc/chrony.conf' }}
chrony_service_name: >-
{{ 'chrony' if ansible_facts['os_family'] == 'Debian' else 'chronyd' }}
chrony_system_user: >-
{{ '_chrony' if ansible_facts['os_family'] == 'Debian' else 'chrony' }}
- name: Install chrony (Debian)
ansible.builtin.apt:
name: chrony
state: present
update_cache: yes
update_cache: true
when: ansible_facts['os_family'] == 'Debian'
- name: Install chrony (Arch)
ansible.builtin.package:
name: chrony
state: present
when: ansible_facts['os_family'] == 'Archlinux'
# systemd-timesyncd and chrony both want to steer the clock. edge-1 currently
# runs timesyncd, so it has to be stopped before chronyd takes over.
- name: Gather service facts
ansible.builtin.service_facts:
- name: Disable systemd-timesyncd where present (conflicts with chrony)
ansible.builtin.systemd:
name: systemd-timesyncd
enabled: false
state: stopped
when: "'systemd-timesyncd.service' in ansible_facts.services"
- name: Ensure chrony state and log directories exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ chrony_system_user }}"
group: "{{ chrony_system_user }}"
mode: '0750'
loop:
- /var/lib/chrony
- /var/log/chrony
- name: Configure chrony as NTP server
template:
ansible.builtin.template:
src: chrony.conf.j2
dest: /etc/chrony/chrony.conf
dest: "{{ chrony_config_path }}"
owner: root
group: root
mode: '0644'
backup: yes
backup: true
notify: restart chrony
- name: Ensure chrony is enabled and running
systemd:
name: chrony
enabled: yes
ansible.builtin.systemd:
name: "{{ chrony_service_name }}"
enabled: true
state: started
daemon_reload: yes
daemon_reload: true
@@ -30,7 +30,9 @@ logdir /var/log/chrony
log measurements statistics tracking
# Use hardware timestamping if available
{% if chrony_hwtimestamp | default(true) %}
hwtimestamp *
{% endif %}
# Allow command access only from localhost
bindcmdaddress 127.0.0.1
@@ -0,0 +1,57 @@
# 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).
+220
View File
@@ -0,0 +1,220 @@
# 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 API endpoint reachable over the site-to-site route (a CP node or VIP):
kubectl config set-cluster homelab --server=https://10.2.40.201: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` and `monitoring-agent` (Alloy → Loki/Prometheus)
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`).
@@ -0,0 +1,68 @@
---
# 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)
@@ -0,0 +1,22 @@
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.
@@ -0,0 +1,8 @@
# 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
@@ -0,0 +1,10 @@
---
- 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
@@ -0,0 +1,42 @@
---
# 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
@@ -0,0 +1,183 @@
---
# 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`, `qemu-guest-agent` and `monitoring-agent`
# (Alloy -> Loki/Prometheus) 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
@@ -0,0 +1,48 @@
---
# 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
@@ -0,0 +1,10 @@
[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
@@ -0,0 +1,27 @@
#!/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"
@@ -0,0 +1,10 @@
[Unit]
# {{ ansible_managed }}
Description=Periodically refresh the claude-workstation egress allowlist
[Timer]
OnBootSec=30s
OnUnitActiveSec=15min
[Install]
WantedBy=timers.target
@@ -0,0 +1,32 @@
[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
@@ -0,0 +1,32 @@
#!/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
@@ -0,0 +1,11 @@
[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
@@ -0,0 +1,55 @@
#!/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"
}
}
+4 -9
View File
@@ -51,15 +51,10 @@
# -------------------------------------------------------
# 4. SSH Configuration
# -------------------------------------------------------
- name: Add Ansible Runner SSH Key
authorized_key:
user: "{{ item }}"
state: present
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGfe3HJqFR+jIGrboweseAO7XjIVE24sje/b1HybgU9C ansible-runner@ci-new"
loop:
- ladmin
- root
ignore_errors: true
# 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).
# -------------------------------------------------------
# 5. Disable NTP on VMs/LXC (use host time)
+11
View File
@@ -105,3 +105,14 @@ edge_e3oncan_mqtt_format: "{device}_{didNumber:04d}_{didName}"
# edge_sml2mqtt_mqtt_password: "{{ vault_edge_sml2mqtt_mqtt_password }}"
# edge_open3e_mqtt_password: "{{ vault_edge_open3e_mqtt_password }}"
# edge_zwavejs_session_secret: "{{ vault_edge_zwavejs_session_secret }}"
# --- Tagged VLAN 40 sub-interface. Off by default; enabled in
# inventory/group_vars/edge_host. Exists so edge-1 can join the NTP keepalived
# VRRP group, which needs layer-2 adjacency with the other members on the
# service VLAN. The untagged VLAN 30 lease stays this host's only default
# route -- see templates/10-vlan40.network.j2.
edge_vlan40_enabled: false
edge_vlan40_parent: enp1s0
edge_vlan40_id: 40
edge_vlan40_name: enp1s0.40
edge_vlan40_parent_network: 20-wired.network
@@ -6,6 +6,15 @@
cmd: networkctl reload && networkctl reconfigure {{ edge_can_interface }}
changed_when: true
# Reconfiguring the parent is what actually materialises the VLAN child -- a
# bare reload leaves the existing link as-is (see above). This re-runs DHCP on
# enp1s0, which is this headless host's only path to the network, so it is the
# one genuinely risky step in the VLAN change.
- name: Reload networkd for VLAN
ansible.builtin.shell:
cmd: networkctl reload && networkctl reconfigure {{ edge_vlan40_parent }}
changed_when: true
# Ordered before 'Restart edge compose services': the daemon must pick up the
# new default log driver before the containers are recreated onto it.
- name: Restart docker
+39
View File
@@ -172,6 +172,45 @@
mode: "0644"
notify: Reload networkd
# --- Tagged VLAN 40. Additive by construction: the parent link keeps its own
# .network file untouched and gains the VLAN via a drop-in, so reverting is a
# matter of deleting these three paths. This host is headless and enp1s0 is its
# only route to the network, hence the caution.
- name: Create VLAN sub-interface netdev
ansible.builtin.template:
src: 10-vlan40.netdev.j2
dest: "/etc/systemd/network/10-{{ edge_vlan40_name }}.netdev"
mode: "0644"
when: edge_vlan40_enabled
notify: Reload networkd for VLAN
tags: [vlan40]
- name: Configure VLAN sub-interface addressing
ansible.builtin.template:
src: 10-vlan40.network.j2
dest: "/etc/systemd/network/10-{{ edge_vlan40_name }}.network"
mode: "0644"
when: edge_vlan40_enabled
notify: Reload networkd for VLAN
tags: [vlan40]
- name: Ensure parent network drop-in directory exists
ansible.builtin.file:
path: "/etc/systemd/network/{{ edge_vlan40_parent_network }}.d"
state: directory
mode: "0755"
when: edge_vlan40_enabled
tags: [vlan40]
- name: Attach VLAN to parent link via drop-in
ansible.builtin.template:
src: vlan40-parent-dropin.conf.j2
dest: "/etc/systemd/network/{{ edge_vlan40_parent_network }}.d/10-vlan40.conf"
mode: "0644"
when: edge_vlan40_enabled
notify: Reload networkd for VLAN
tags: [vlan40]
- name: Enable systemd-networkd
ansible.builtin.service:
name: systemd-networkd
@@ -0,0 +1,11 @@
# Managed by Ansible - Do not edit manually
# Tagged VLAN {{ edge_vlan40_id }} sub-interface on {{ edge_vlan40_parent }}.
# Needed so edge-1 can join the NTP keepalived VRRP group, which requires
# layer-2 adjacency with the other members on the service VLAN.
[NetDev]
Name={{ edge_vlan40_name }}
Kind=vlan
[VLAN]
Id={{ edge_vlan40_id }}
@@ -0,0 +1,35 @@
# Managed by Ansible - Do not edit manually
# Address configuration for the VLAN {{ edge_vlan40_id }} sub-interface.
#
# Filename sorts before 20-wired.network deliberately. networkd applies the
# first matching .network in lexicographic order, and 20-wired.network matches
# broadly on Type=ether. A VLAN link types as 'vlan' rather than 'ether' so it
# should not match anyway, but ordering plus an explicit Name= match means this
# file wins regardless.
#
# The Use*=false settings keep VLAN 30 (untagged) as this host's only default
# route and DNS source in BOTH address families. A second default route from
# the VLAN 40 lease would make return traffic asymmetric across the two VLANs.
#
# RAs are accepted so the interface gets a global IPv6 address -- suppressing
# them entirely (the earlier approach here) left the interface with only a
# link-local address, which made this host unreachable over IPv6 on the service
# VLAN. IPv6 is the primary address family on this network; only the default
# route and DNS need suppressing, not addressing itself.
[Match]
Name={{ edge_vlan40_name }}
[Network]
DHCP=ipv4
IPv6AcceptRA=true
[DHCPv4]
UseRoutes=false
UseDNS=false
UseNTP=false
UseHostname=false
[IPv6AcceptRA]
UseGateway=false
UseDNS=false
@@ -0,0 +1,10 @@
# Managed by Ansible - Do not edit manually
# Drop-in for {{ edge_vlan40_parent_network }}, attaching the tagged VLAN
# sub-interface to the parent link.
#
# Deliberately a drop-in rather than an edit of the parent .network file: that
# file carries this headless host's only route to the network, so the change is
# kept additive and revertible by deleting this directory.
[Network]
VLAN={{ edge_vlan40_name }}
+1 -1
View File
@@ -258,7 +258,7 @@ endpoints:
url: 10.2.40.53
interval: 30s
dns:
query-name: gitea.srv.renner.uno
query-name: k8s-1.srv.renner.uno
query-type: A
conditions:
- "[DNS_RCODE] == NOERROR"
@@ -1,4 +0,0 @@
---
authentik_client_id: "{{ vault_gitea_authentik_client_id }}"
authentik_client_secret: "{{ vault_gitea_authentik_client_secret }}"
authentik_discovery_url: "https://auth.renner.uno/application/o/gittea/.well-known/openid-configuration"
@@ -1,5 +0,0 @@
---
- name: Restart gitea
systemd:
name: gitea
state: restarted
-117
View File
@@ -1,117 +0,0 @@
---
- name: Install dependencies
apt:
name:
- git
- sqlite3
- wget
- sudo
state: present
update_cache: yes
- name: Create gitea user
user:
name: "{{ gitea_user }}"
system: yes
shell: /bin/bash
home: "{{ gitea_home }}"
create_home: yes
- name: Create configuration directory
file:
path: "{{ gitea_conf_dir }}"
state: directory
owner: "{{ gitea_user }}"
group: "{{ gitea_user }}"
mode: '0770'
- name: Create data directories
file:
path: "{{ item }}"
state: directory
owner: "{{ gitea_user }}"
group: "{{ gitea_user }}"
mode: '0750'
loop:
- "{{ gitea_data_dir }}"
- "{{ gitea_data_dir }}/custom"
- "{{ gitea_data_dir }}/data"
- "{{ gitea_data_dir }}/log"
- name: Download Gitea binary
get_url:
url: "https://dl.gitea.com/gitea/{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64"
dest: "{{ gitea_binary }}"
mode: '0755'
- name: Deploy Gitea configuration
template:
src: app.ini.j2
dest: "{{ gitea_conf_dir }}/app.ini"
owner: "{{ gitea_user }}"
group: "{{ gitea_user }}"
mode: '0640'
notify: Restart gitea
- name: Create systemd service
template:
src: gitea.service.j2
dest: /etc/systemd/system/gitea.service
mode: '0644'
notify: Restart gitea
- name: Enable and start Gitea service
systemd:
name: gitea
state: started
enabled: yes
daemon_reload: yes
- name: Wait for Gitea to start
wait_for:
port: "{{ gitea_port }}"
delay: 5
- name: Check for existing Authentik provider
shell: >
{{ gitea_binary }} admin auth list
--config "{{ gitea_conf_dir }}/app.ini"
--work-path "{{ gitea_data_dir }}"
| grep authentik | awk '{print $1}'
register: authentik_provider_id
changed_when: false
become: yes
become_user: "{{ gitea_user }}"
failed_when: false
- name: Register Authentik as OAuth2 provider
command: >
{{ gitea_binary }} admin auth add-oauth
--name authentik
--provider openidConnect
--key "{{ authentik_client_id }}"
--secret "{{ authentik_client_secret }}"
--auto-discover-url "{{ authentik_discovery_url }}"
--group-claim-name groups
--admin-group admins
--config "{{ gitea_conf_dir }}/app.ini"
--work-path "{{ gitea_data_dir }}"
become: yes
become_user: "{{ gitea_user }}"
when: authentik_client_id is defined and authentik_client_id != "" and authentik_provider_id.stdout == ""
- name: Update Authentik OAuth2 provider
command: >
{{ gitea_binary }} admin auth update-oauth
--id {{ authentik_provider_id.stdout }}
--provider openidConnect
--key "{{ authentik_client_id }}"
--secret "{{ authentik_client_secret }}"
--auto-discover-url "{{ authentik_discovery_url }}"
--group-claim-name groups
--admin-group admins
--config "{{ gitea_conf_dir }}/app.ini"
--work-path "{{ gitea_data_dir }}"
become: yes
become_user: "{{ gitea_user }}"
when: authentik_client_id is defined and authentik_client_id != "" and authentik_provider_id.stdout != ""
@@ -1,67 +0,0 @@
APP_NAME = Gitea: Git with a cup of tea
RUN_USER = {{ gitea_user }}
RUN_MODE = prod
[database]
DB_TYPE = sqlite3
HOST = 127.0.0.1:3306
NAME = gitea
USER = gitea
PASSWD =
PATH = {{ gitea_data_dir }}/data/gitea.db
SSL_MODE = disable
[server]
PROTOCOL = http
HTTP_DOMAIN = {{ gitea_url | regex_replace('^https?://', '') }}
HTTP_PORT = {{ gitea_port }}
ROOT_URL = {{ gitea_url }}
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = {{ gitea_data_dir }}/data/lfs
OFFLINE_MODE = false
[security]
INSTALL_LOCK = true
SECRET_KEY = {{ gitea_secret_key | default('ChangeMe') }}
INTERNAL_TOKEN = {{ gitea_internal_token | default('ChangeMe') }}
[service]
DISABLE_REGISTRATION = false
REQUIRE_SIGNIN_VIEW = false
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = true
ENABLE_CAPTCHA = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.localhost
[picture]
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = true
[session]
PROVIDER = file
[webhook]
# Allow webhooks to private networks and Woodpecker CI endpoints
ALLOWED_HOST_LIST = *
[actions]
ENABLED = true
[packages]
ENABLED = true
[log]
MODE = console
LEVEL = info
ROOT_PATH = {{ gitea_data_dir }}/log
[metrics]
ENABLED = true
ENABLED_ISSUE_BY_LABEL = true
ENABLED_ISSUE_BY_REPOSITORY = true
@@ -1,19 +0,0 @@
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
[Service]
LimitNOFILE=524288:524288
RestartSec=2s
Type=simple
User={{ gitea_user }}
Group={{ gitea_user }}
WorkingDirectory={{ gitea_home }}
RuntimeDirectory=gitea
ExecStart={{ gitea_binary }} web --config {{ gitea_conf_dir }}/app.ini
Restart=always
Environment=USER={{ gitea_user }} HOME={{ gitea_home }} GITEA_WORK_DIR={{ gitea_data_dir }}
[Install]
WantedBy=multi-user.target
-9
View File
@@ -1,9 +0,0 @@
---
gitea_version: "1.21.4"
gitea_user: "gitea"
gitea_home: "/var/lib/gitea"
gitea_conf_dir: "/etc/gitea"
gitea_data_dir: "/var/lib/gitea"
gitea_binary: "/usr/local/bin/gitea"
gitea_url: "https://gitea.renner.uno"
gitea_port: 3000
@@ -1,13 +0,0 @@
gitea_url: "https://gitea.renner.uno"
gitea_runner_version: "0.2.10" # Updated to a recent version
gitea_runner_user: "gitea_runner"
gitea_runner_group: "gitea_runner"
gitea_runner_binary_url: "https://dl.gitea.com/act_runner/{{ gitea_runner_version }}/act_runner-{{ gitea_runner_version }}-linux-amd64"
gitea_runner_binary_path: "/usr/local/bin/act_runner"
gitea_runner_work_dir: "/var/lib/gitea_runner"
gitea_runner_config_path: "/etc/act_runner/config.yaml"
gitea_runner_name: "{{ inventory_hostname }}"
# Typical labels for a docker-based runner
gitea_runner_labels: "ubuntu-latest:docker://node:18-bullseye,ubuntu-22.04:docker://node:18-bullseye,debian-12:docker://node:18-bullseye"
gitea_admin_user: "gitea_admin"
gitea_admin_pass: "5y8grZ2yfOuP"
@@ -1,5 +0,0 @@
- name: Restart act_runner
systemd:
name: act_runner
state: restarted
daemon_reload: yes
-99
View File
@@ -1,99 +0,0 @@
- name: Generate Gitea Registration Token
command: "/usr/local/bin/gitea actions generate-runner-token --config /etc/gitea/app.ini"
delegate_to: gitea.srv.renner.uno
run_once: true
become: true
become_user: gitea
register: registration_token_cmd
- name: Set registration token fact
set_fact:
registration_token: "{{ registration_token_cmd.stdout_lines | last | trim }}"
run_once: true
- name: Install dependencies
apt:
name:
- curl
- git
- sudo
state: present
update_cache: yes
- name: Create runner group
group:
name: "{{ gitea_runner_group }}"
state: present
- name: Create runner user
user:
name: "{{ gitea_runner_user }}"
group: "{{ gitea_runner_group }}"
groups: "docker"
shell: /bin/bash
home: "{{ gitea_runner_work_dir }}"
create_home: yes
system: yes
append: yes
- name: Download act_runner binary
get_url:
url: "{{ gitea_runner_binary_url }}"
dest: "{{ gitea_runner_binary_path }}"
mode: '0755'
- name: Create configuration directory
file:
path: "{{ gitea_runner_config_path | dirname }}"
state: directory
owner: "{{ gitea_runner_user }}"
group: "{{ gitea_runner_group }}"
mode: '0755'
- name: Check if runner is already registered
stat:
path: "{{ gitea_runner_work_dir }}/.runner"
register: runner_registered_check
- name: Register runner
command: >
{{ gitea_runner_binary_path }} register
--instance {{ gitea_url }}
--token {{ registration_token }}
--name {{ gitea_runner_name }}
--labels {{ gitea_runner_labels }}
--no-interactive
become: yes
become_user: "{{ gitea_runner_user }}"
args:
chdir: "{{ gitea_runner_work_dir }}"
when: not runner_registered_check.stat.exists
- name: Generate config file (if missing)
command: "{{ gitea_runner_binary_path }} generate-config"
register: generated_config
changed_when: false
failed_when: generated_config.rc != 0
- name: Save config file
copy:
content: "{{ generated_config.stdout | replace('network: \"\"', 'network: \"host\"') }}"
dest: "{{ gitea_runner_config_path }}"
owner: "{{ gitea_runner_user }}"
group: "{{ gitea_runner_group }}"
mode: '0644'
notify: Restart act_runner
- name: Create systemd service
template:
src: act_runner.service.j2
dest: /etc/systemd/system/act_runner.service
mode: '0644'
notify: Restart act_runner
- name: Enable and start act_runner service
systemd:
name: act_runner
state: started
enabled: yes
daemon_reload: yes
@@ -1,17 +0,0 @@
[Unit]
Description=Gitea Actions Runner
Documentation=https://gitea.com/gitea/act_runner
After=docker.service network.target
Requires=docker.service
[Service]
ExecStart={{ gitea_runner_binary_path }} daemon --config {{ gitea_runner_config_path }}
ExecReload=/bin/kill -s HUP $MAINPID
WorkingDirectory={{ gitea_runner_work_dir }}
User={{ gitea_runner_user }}
Group={{ gitea_runner_group }}
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
@@ -1,35 +0,0 @@
---
# Grafana Observability Configuration
# Deploys data sources, dashboards, and alerting to existing Grafana instance
# Grafana configuration
grafana_provisioning_dir: "/etc/grafana/provisioning"
grafana_dashboards_dir: "/var/lib/grafana/dashboards"
# Data sources
loki_url: "http://loki.srv.renner.uno:3100"
prometheus_url: "http://prometheus.srv.renner.uno:9090"
influxdb_url: "http://influxdb.srv.renner.uno:8086"
influxdb_org: "renner"
influxdb_bucket: "suedstr28"
# Note: Token for internal InfluxDB instance - consider moving to vault
influxdb_token: "1GGjlE6gfk-Uc-GLW59mhNX3LirrgR6C7iAWT3BpITh4Ml63P3bgVdX20GFiU2H8Juadri13uGzMkCi7CLrmgg=="
# Alerting - Email
alerting_email_enabled: true
alerting_smtp_host: ""
alerting_smtp_user: ""
alerting_smtp_password: ""
alerting_email_from: "grafana@renner.uno"
alerting_email_to: ""
# Alerting - Home Assistant Webhook
alerting_ha_webhook_enabled: true
alerting_ha_webhook_url: ""
# Dashboard organization
grafana_dashboard_folder: "Homelab"
# Grafana plugins to install
grafana_plugins:
- volkovlabs-echarts-panel
@@ -1,253 +0,0 @@
{
"annotations": {"list": []},
"description": "Grafana Alloy Agent Monitoring",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 0},
"id": 100,
"title": "Agent Status",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 0, "y": 1},
"id": 1,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "count(alloy_build_info)", "legendFormat": "Agents", "refId": "A"}],
"title": "Active Agents",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [{"options": {"0": {"color": "red", "text": "Failed"}, "1": {"color": "green", "text": "OK"}}, "type": "value"}],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 4, "y": 1},
"id": 2,
"options": {"colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "min(alloy_config_last_load_successful)", "legendFormat": "Config Status", "refId": "A"}],
"title": "Config Status",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "yellow", "value": 1}, {"color": "red", "value": 5}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 8, "y": 1},
"id": 3,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "sum(alloy_config_load_failures_total)", "legendFormat": "Failures", "refId": "A"}],
"title": "Config Load Failures",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "blue", "value": null}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 12, "y": 1},
"id": 4,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "sum(alloy_component_controller_running_components)", "legendFormat": "Components", "refId": "A"}],
"title": "Running Components",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"custom": {"align": "auto", "cellOptions": {"type": "color-text"}, "inspect": false},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}
},
"overrides": [
{"matcher": {"id": "byName", "options": "version"}, "properties": [{"id": "custom.width", "value": 100}]},
{"matcher": {"id": "byName", "options": "host"}, "properties": [{"id": "custom.width", "value": 250}]}
]
},
"gridPos": {"h": 4, "w": 8, "x": 16, "y": 1},
"id": 5,
"options": {"showHeader": true, "cellHeight": "sm", "footer": {"show": false}},
"targets": [{"expr": "alloy_build_info", "format": "table", "instant": true, "refId": "A"}],
"title": "Agent Versions",
"transformations": [
{"id": "organize", "options": {"excludeByName": {"Time": true, "__name__": true, "branch": true, "goarch": true, "goos": true, "goversion": true, "instance": true, "job": true, "revision": true, "Value": true, "datacenter": true, "environment": true}, "renameByName": {}}}
],
"type": "table"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 5},
"id": 101,
"title": "Resource Usage",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 6},
"id": 10,
"options": {"legend": {"calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "alloy_resources_process_resident_memory_bytes", "legendFormat": "{{host}}", "refId": "A"}],
"title": "Memory Usage (RSS)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 6},
"id": 11,
"options": {"legend": {"calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "rate(alloy_resources_process_cpu_seconds_total[5m])", "legendFormat": "{{host}}", "refId": "A"}],
"title": "CPU Usage",
"type": "timeseries"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 14},
"id": 102,
"title": "Network Traffic",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 15},
"id": 20,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "rate(alloy_resources_machine_rx_bytes_total[5m])", "legendFormat": "{{host}} RX", "refId": "A"}],
"title": "Network RX",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 15},
"id": 21,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "rate(alloy_resources_machine_tx_bytes_total[5m])", "legendFormat": "{{host}} TX", "refId": "A"}],
"title": "Network TX",
"type": "timeseries"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 23},
"id": 103,
"title": "Component Health",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 24},
"id": 30,
"options": {"legend": {"calcs": ["mean"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "alloy_component_controller_running_components", "legendFormat": "{{host}}", "refId": "A"}],
"title": "Running Components per Host",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 24},
"id": 31,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "histogram_quantile(0.95, rate(alloy_component_evaluation_seconds_bucket[5m]))", "legendFormat": "{{host}}", "refId": "A"}],
"title": "Component Evaluation Time (p95)",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": ["alloy", "monitoring", "observability"],
"templating": {"list": []},
"time": {"from": "now-1h", "to": "now"},
"timepicker": {},
"timezone": "",
"title": "Alloy Agent Overview",
"uid": "alloy-overview",
"version": 1,
"weekStart": ""
}
@@ -1,209 +0,0 @@
{
"annotations": {"list": []},
"description": "Authentik Identity Provider Monitoring",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 0, "y": 0},
"id": 1,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "count(up{job=\"authentik\"} == 1)", "refId": "A"}],
"title": "App Servers Up",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "blue", "value": null}]}},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 4, "y": 0},
"id": 2,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "authentik_tasks_workers", "refId": "A"}],
"title": "Task Workers",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 8, "y": 0},
"id": 3,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "authentik_admin_workers", "refId": "A"}],
"title": "Admin Workers",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "purple", "value": null}]}},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 12, "y": 0},
"id": 4,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "authentik_flows_cached", "refId": "A"}],
"title": "Flows Cached",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "orange", "value": null}]}},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 16, "y": 0},
"id": 5,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "authentik_policies_cached", "refId": "A"}],
"title": "Policies Cached",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 20, "y": 0},
"id": 6,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "authentik_outposts_connected", "refId": "A"}],
"title": "Outposts Connected",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 4},
"id": 7,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.50, sum(rate(authentik_main_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p50", "refId": "A"},
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum(rate(authentik_main_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p95", "refId": "B"},
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.99, sum(rate(authentik_main_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p99", "refId": "C"}
],
"title": "Request Latency",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 4},
"id": 8,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum(rate(authentik_flows_execution_stage_time_bucket[5m])) by (le, stage_type))", "legendFormat": "{{stage_type}}", "refId": "A"}
],
"title": "Flow Stage Execution Time (p95)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 12},
"id": 9,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum(rate(authentik_flows_plan_time_bucket[5m])) by (le))", "legendFormat": "Flow Plan p95", "refId": "A"},
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum(rate(authentik_flows_stage_time_bucket[5m])) by (le))", "legendFormat": "Stage Time p95", "refId": "B"}
],
"title": "Flow Planning & Stage Time (p95)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 12},
"id": 10,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum(rate(authentik_policies_engine_time_total_seconds_bucket[5m])) by (le))", "legendFormat": "Policy Engine p95", "refId": "A"}
],
"title": "Policy Engine Time (p95)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 24, "x": 0, "y": 20},
"id": 11,
"options": {"legend": {"calcs": ["mean"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "authentik_outpost_connection", "legendFormat": "{{name}} - {{uid}}", "refId": "A"}
],
"title": "Outpost Connections",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": ["homelab", "authentik", "identity"],
"templating": {"list": []},
"time": {"from": "now-1h", "to": "now"},
"timepicker": {},
"timezone": "",
"title": "Authentik Overview",
"uid": "authentik-overview",
"version": 1,
"weekStart": ""
}
@@ -1,402 +0,0 @@
{
"annotations": {
"list": []
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [
{ "options": { "0": { "color": "red", "text": "DOWN" }, "1": { "color": "green", "text": "UP" } }, "type": "value" }
],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "red", "value": null },
{ "color": "green", "value": 1 }
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": { "h": 6, "w": 24, "x": 0, "y": 0 },
"id": 1,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [
{
"expr": "probe_success{job=\"blackbox-http\"}",
"legendFormat": "{{instance}}",
"refId": "A"
}
],
"title": "HTTP Endpoint Status",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null }
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 6 },
"id": 2,
"options": {
"legend": {
"calcs": ["mean", "max"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"expr": "probe_duration_seconds{job=\"blackbox-http\"}",
"legendFormat": "{{instance}}",
"refId": "A"
}
],
"title": "HTTP Response Time",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null }
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 6 },
"id": 3,
"options": {
"legend": {
"calcs": ["mean", "max"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"expr": "probe_ssl_earliest_cert_expiry{job=\"blackbox-http\"} - time()",
"legendFormat": "{{instance}}",
"refId": "A"
}
],
"title": "SSL Certificate Expiry (seconds until expiry)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [
{ "options": { "0": { "color": "red", "text": "DOWN" }, "1": { "color": "green", "text": "UP" } }, "type": "value" }
],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "red", "value": null },
{ "color": "green", "value": 1 }
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": { "h": 4, "w": 12, "x": 0, "y": 14 },
"id": 4,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [
{
"expr": "probe_success{job=\"blackbox-tcp\"}",
"legendFormat": "{{instance}}",
"refId": "A"
}
],
"title": "TCP Endpoint Status",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [
{ "options": { "0": { "color": "red", "text": "DOWN" }, "1": { "color": "green", "text": "UP" } }, "type": "value" }
],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "red", "value": null },
{ "color": "green", "value": 1 }
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": { "h": 4, "w": 12, "x": 12, "y": 14 },
"id": 5,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [
{
"expr": "probe_success{job=\"blackbox-dns\"}",
"legendFormat": "{{instance}}",
"refId": "A"
}
],
"title": "DNS Status",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null }
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 24, "x": 0, "y": 18 },
"id": 6,
"options": {
"legend": {
"calcs": ["mean", "min"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"expr": "avg_over_time(probe_success{job=\"blackbox-http\"}[1h])",
"legendFormat": "{{instance}}",
"refId": "A"
}
],
"title": "Uptime (1h average)",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": ["blackbox", "probes", "uptime"],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Blackbox Exporter - Endpoint Probes",
"uid": "blackbox-overview",
"version": 1,
"weekStart": ""
}
@@ -1,451 +0,0 @@
{
"annotations": {"list": []},
"description": "DNS Server Performance Monitoring - UDM vs Proxmox DNS",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 0},
"id": 200,
"title": "DNS Server Comparison",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [{"options": {"0": {"color": "red", "text": "DOWN"}, "1": {"color": "green", "text": "UP"}}, "type": "value"}],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 6, "x": 0, "y": 1},
"id": 201,
"options": {"colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "probe_success{instance=\"10.2.40.1\", job=~\"blackbox-dns-.*\"}", "legendFormat": "UDM", "refId": "A"}],
"title": "UDM DNS (10.2.40.1)",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [{"options": {"0": {"color": "red", "text": "DOWN"}, "1": {"color": "green", "text": "UP"}}, "type": "value"}],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 6, "x": 6, "y": 1},
"id": 202,
"options": {"colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "probe_success{instance=\"10.2.40.53\", job=~\"blackbox-dns-.*\"}", "legendFormat": "Proxmox DNS", "refId": "A"}],
"title": "Proxmox DNS VIP (10.2.40.53)",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "yellow", "value": 0.01}, {"color": "red", "value": 0.05}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 6, "x": 12, "y": 1},
"id": 203,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["mean"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "avg(probe_duration_seconds{instance=\"10.2.40.1\", job=~\"blackbox-dns-.*\"})", "legendFormat": "UDM Avg", "refId": "A"}],
"title": "UDM Avg Latency",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "yellow", "value": 0.01}, {"color": "red", "value": 0.05}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 6, "x": 18, "y": 1},
"id": 204,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["mean"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "avg(probe_duration_seconds{instance=\"10.2.40.53\", job=~\"blackbox-dns-.*\"})", "legendFormat": "Proxmox Avg", "refId": "A"}],
"title": "Proxmox DNS Avg Latency",
"type": "stat"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 5},
"id": 210,
"title": "Latency Comparison",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": [
{"matcher": {"id": "byRegexp", "options": ".*UDM.*"}, "properties": [{"id": "color", "value": {"fixedColor": "blue", "mode": "fixed"}}]},
{"matcher": {"id": "byRegexp", "options": ".*Proxmox.*"}, "properties": [{"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]}
]
},
"gridPos": {"h": 8, "w": 24, "x": 0, "y": 6},
"id": 211,
"options": {"legend": {"calcs": ["mean", "max", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"expr": "probe_duration_seconds{instance=\"10.2.40.1\", job=~\"blackbox-dns-.*\"}", "legendFormat": "UDM - {{job}}", "refId": "A"},
{"expr": "probe_duration_seconds{instance=\"10.2.40.53\", job=~\"blackbox-dns-.*\"}", "legendFormat": "Proxmox - {{job}}", "refId": "B"}
],
"title": "DNS Query Latency - UDM vs Proxmox DNS",
"type": "timeseries"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 14},
"id": 220,
"title": "Query Type Breakdown",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 8, "x": 0, "y": 15},
"id": 221,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"expr": "probe_duration_seconds{instance=\"10.2.40.1\", job=\"blackbox-dns-external\"}", "legendFormat": "UDM", "refId": "A"},
{"expr": "probe_duration_seconds{instance=\"10.2.40.53\", job=\"blackbox-dns-external\"}", "legendFormat": "Proxmox DNS", "refId": "B"}
],
"title": "External Queries (google.com)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 8, "x": 8, "y": 15},
"id": 222,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"expr": "probe_duration_seconds{instance=\"10.2.40.1\", job=\"blackbox-dns-internal\"}", "legendFormat": "UDM", "refId": "A"},
{"expr": "probe_duration_seconds{instance=\"10.2.40.53\", job=\"blackbox-dns-internal\"}", "legendFormat": "Proxmox DNS", "refId": "B"}
],
"title": "Internal Queries (gitea.srv.renner.uno)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 8, "x": 16, "y": 15},
"id": 223,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"expr": "probe_duration_seconds{instance=\"10.2.40.1\", job=\"blackbox-dns-cached\"}", "legendFormat": "UDM", "refId": "A"},
{"expr": "probe_duration_seconds{instance=\"10.2.40.53\", job=\"blackbox-dns-cached\"}", "legendFormat": "Proxmox DNS", "refId": "B"}
],
"title": "Cached Queries (cloudflare.com)",
"type": "timeseries"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 23},
"id": 230,
"title": "Success Rate",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "percentunit",
"min": 0,
"max": 1
},
"overrides": [
{"matcher": {"id": "byRegexp", "options": ".*UDM.*"}, "properties": [{"id": "color", "value": {"fixedColor": "blue", "mode": "fixed"}}]},
{"matcher": {"id": "byRegexp", "options": ".*Proxmox.*"}, "properties": [{"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]}
]
},
"gridPos": {"h": 6, "w": 12, "x": 0, "y": 24},
"id": 231,
"options": {"legend": {"calcs": ["mean", "min"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"expr": "avg_over_time(probe_success{instance=\"10.2.40.1\", job=~\"blackbox-dns-.*\"}[5m])", "legendFormat": "UDM - {{job}}", "refId": "A"},
{"expr": "avg_over_time(probe_success{instance=\"10.2.40.53\", job=~\"blackbox-dns-.*\"}[5m])", "legendFormat": "Proxmox - {{job}}", "refId": "B"}
],
"title": "DNS Probe Success Rate (5m avg)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "bars", "fillOpacity": 80, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 6, "w": 12, "x": 12, "y": 24},
"id": 232,
"options": {"legend": {"calcs": ["sum"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"expr": "sum(increase(probe_success{instance=\"10.2.40.1\", job=~\"blackbox-dns-.*\"}[1h])) by (job)", "legendFormat": "UDM - {{job}}", "refId": "A"},
{"expr": "sum(increase(probe_success{instance=\"10.2.40.53\", job=~\"blackbox-dns-.*\"}[1h])) by (job)", "legendFormat": "Proxmox - {{job}}", "refId": "B"}
],
"title": "Probe Count (1h)",
"type": "timeseries"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 30},
"id": 100,
"title": "Proxmox DNS Cluster Status",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "yellow", "value": 2}, {"color": "green", "value": 3}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 0, "y": 31},
"id": 1,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "count(node_uname_info{host=~\"proxmox-dns-.*\"})", "legendFormat": "Servers", "refId": "A"}],
"title": "DNS Servers",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [{"options": {"0": {"color": "red", "text": "DOWN"}, "1": {"color": "green", "text": "UP"}}, "type": "value"}],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 4, "y": 31},
"id": 2,
"options": {"colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "probe_success{instance=\"10.2.40.53\", job=~\"blackbox-dns-.*\"}", "legendFormat": "VIP Status", "refId": "A"}],
"title": "VIP Status (10.2.40.53)",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 35},
"id": 3,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "probe_dns_duration_seconds{instance=\"10.2.40.53\", job=~\"blackbox-dns-.*\"}", "legendFormat": "{{job}} - {{phase}}", "refId": "A"}],
"title": "Proxmox DNS Query Duration by Phase",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 35},
"id": 4,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "probe_dns_duration_seconds{instance=\"10.2.40.1\", job=~\"blackbox-dns-.*\"}", "legendFormat": "{{job}} - {{phase}}", "refId": "A"}],
"title": "UDM DNS Query Duration by Phase",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"custom": {"align": "auto", "cellOptions": {"type": "color-text"}, "inspect": false},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}
},
"overrides": [
{"matcher": {"id": "byName", "options": "host"}, "properties": [{"id": "custom.width", "value": 250}]},
{"matcher": {"id": "byName", "options": "uptime"}, "properties": [{"id": "unit", "value": "dtdurations"}]}
]
},
"gridPos": {"h": 4, "w": 12, "x": 12, "y": 31},
"id": 5,
"options": {"showHeader": true, "cellHeight": "sm", "footer": {"show": false}},
"targets": [{"expr": "node_uname_info{host=~\"proxmox-dns-.*\"} * on(host) group_left() (time() - node_boot_time_seconds{host=~\"proxmox-dns-.*\"})", "format": "table", "instant": true, "refId": "A"}],
"title": "DNS Server Info",
"transformations": [
{"id": "organize", "options": {"excludeByName": {"Time": true, "Value": true, "__name__": true, "domainname": true, "instance": true, "job": true, "machine": true, "release": true, "sysname": true, "version": true, "datacenter": true, "environment": true}, "renameByName": {"nodename": "hostname"}, "indexByName": {"host": 0, "nodename": 1}}}
],
"type": "table"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 43},
"id": 102,
"title": "Proxmox DNS Server Resources",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "percentunit",
"max": 1,
"min": 0
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 44},
"id": 20,
"options": {"legend": {"calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "1 - avg by(host) (rate(node_cpu_seconds_total{host=~\"proxmox-dns-.*\", mode=\"idle\"}[5m]))", "legendFormat": "{{host}}", "refId": "A"}],
"title": "CPU Usage",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "percentunit",
"max": 1,
"min": 0
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 44},
"id": 21,
"options": {"legend": {"calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "1 - (node_memory_MemAvailable_bytes{host=~\"proxmox-dns-.*\"} / node_memory_MemTotal_bytes{host=~\"proxmox-dns-.*\"})", "legendFormat": "{{host}}", "refId": "A"}],
"title": "Memory Usage",
"type": "timeseries"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 52},
"id": 103,
"title": "Proxmox DNS Network Traffic",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 53},
"id": 30,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "rate(node_network_receive_bytes_total{host=~\"proxmox-dns-.*\", device!~\"lo|veth.*\"}[5m])", "legendFormat": "{{host}} {{device}}", "refId": "A"}],
"title": "Network RX",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 53},
"id": 31,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "rate(node_network_transmit_bytes_total{host=~\"proxmox-dns-.*\", device!~\"lo|veth.*\"}[5m])", "legendFormat": "{{host}} {{device}}", "refId": "A"}],
"title": "Network TX",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": ["dns", "infrastructure", "ha-cluster", "comparison"],
"templating": {"list": []},
"time": {"from": "now-1h", "to": "now"},
"timepicker": {},
"timezone": "",
"title": "DNS Overview",
"uid": "dns-overview",
"version": 1,
"weekStart": ""
}
@@ -1,273 +0,0 @@
{
"annotations": {"list": []},
"description": "Docker Container Monitoring via cAdvisor",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 0},
"id": 100,
"title": "Container Overview",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 0, "y": 1},
"id": 1,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "count(container_last_seen{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}) or vector(0)", "legendFormat": "Containers", "refId": "A"}],
"title": "Running Containers",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "blue", "value": null}]}
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 4, "y": 1},
"id": 2,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "count(count by (host) (container_last_seen{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}))", "legendFormat": "Hosts", "refId": "A"}],
"title": "Docker Hosts",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "yellow", "value": 50}, {"color": "red", "value": 80}]},
"unit": "percent"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 8, "y": 1},
"id": 3,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["mean"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "avg(sum by (host) (rate(container_cpu_usage_seconds_total{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}[5m]))) * 100", "legendFormat": "CPU", "refId": "A"}],
"title": "Avg CPU Usage",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 12, "y": 1},
"id": 4,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "sum(container_memory_usage_bytes{id=~\".*/docker-[a-f0-9]+\\\\.scope\"})", "legendFormat": "Memory", "refId": "A"}],
"title": "Total Memory",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 16, "y": 1},
"id": 5,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "sum(rate(container_network_receive_bytes_total{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}[5m]))", "legendFormat": "RX", "refId": "A"}],
"title": "Network RX",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 20, "y": 1},
"id": 6,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"expr": "sum(rate(container_network_transmit_bytes_total{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}[5m]))", "legendFormat": "TX", "refId": "A"}],
"title": "Network TX",
"type": "stat"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 5},
"id": 101,
"title": "CPU Usage",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "normal"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {"h": 10, "w": 24, "x": 0, "y": 6},
"id": 10,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "topk(15, sum by (host, id) (label_replace(rate(container_cpu_usage_seconds_total{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}[5m]), \"container\", \"$1\", \"id\", \".*/docker-([a-f0-9]{12}).*\")))", "legendFormat": "{{host}}/{{container}}", "refId": "A"}],
"title": "CPU Usage by Container (Top 15, Stacked)",
"type": "timeseries"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 16},
"id": 102,
"title": "Memory Usage",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "normal"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {"h": 10, "w": 24, "x": 0, "y": 17},
"id": 20,
"options": {"legend": {"calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "topk(15, label_replace(container_memory_usage_bytes{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}, \"container\", \"$1\", \"id\", \".*/docker-([a-f0-9]{12}).*\"))", "legendFormat": "{{host}}/{{container}}", "refId": "A"}],
"title": "Memory Usage by Container (Top 15, Stacked)",
"type": "timeseries"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 27},
"id": 103,
"title": "Network I/O",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 28},
"id": 30,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "topk(10, sum by (host, id) (label_replace(rate(container_network_receive_bytes_total{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}[5m]), \"container\", \"$1\", \"id\", \".*/docker-([a-f0-9]{12}).*\")))", "legendFormat": "{{host}}/{{container}}", "refId": "A"}],
"title": "Network RX by Container (Top 10)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 28},
"id": 31,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "topk(10, sum by (host, id) (label_replace(rate(container_network_transmit_bytes_total{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}[5m]), \"container\", \"$1\", \"id\", \".*/docker-([a-f0-9]{12}).*\")))", "legendFormat": "{{host}}/{{container}}", "refId": "A"}],
"title": "Network TX by Container (Top 10)",
"type": "timeseries"
},
{
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 36},
"id": 104,
"title": "Disk I/O",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 37},
"id": 40,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "topk(10, sum by (host, id) (label_replace(rate(container_fs_reads_bytes_total{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}[5m]), \"container\", \"$1\", \"id\", \".*/docker-([a-f0-9]{12}).*\")))", "legendFormat": "{{host}}/{{container}}", "refId": "A"}],
"title": "Disk Read by Container (Top 10)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 37},
"id": 41,
"options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [{"expr": "topk(10, sum by (host, id) (label_replace(rate(container_fs_writes_bytes_total{id=~\".*/docker-[a-f0-9]+\\\\.scope\"}[5m]), \"container\", \"$1\", \"id\", \".*/docker-([a-f0-9]{12}).*\")))", "legendFormat": "{{host}}/{{container}}", "refId": "A"}],
"title": "Disk Write by Container (Top 10)",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": ["docker", "containers", "cadvisor"],
"templating": {"list": []},
"time": {"from": "now-1h", "to": "now"},
"timepicker": {},
"timezone": "",
"title": "Docker Container Overview",
"uid": "docker-overview",
"version": 2,
"weekStart": ""
}
@@ -1,137 +0,0 @@
{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, "unit": "short" }, "overrides": [] },
"gridPos": { "h": 4, "w": 4, "x": 0, "y": 0 },
"id": 1,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "gitea_users", "legendFormat": "Users", "refId": "A" }],
"title": "Total Users",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] }, "unit": "short" }, "overrides": [] },
"gridPos": { "h": 4, "w": 4, "x": 4, "y": 0 },
"id": 2,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "gitea_repositories", "legendFormat": "Repos", "refId": "A" }],
"title": "Repositories",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "yellow", "value": null }] }, "unit": "short" }, "overrides": [] },
"gridPos": { "h": 4, "w": 4, "x": 8, "y": 0 },
"id": 3,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "gitea_issues_open", "legendFormat": "Open Issues", "refId": "A" }],
"title": "Open Issues",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "purple", "value": null }] }, "unit": "short" }, "overrides": [] },
"gridPos": { "h": 4, "w": 4, "x": 12, "y": 0 },
"id": 4,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "gitea_organizations", "legendFormat": "Orgs", "refId": "A" }],
"title": "Organizations",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "orange", "value": null }] }, "unit": "short" }, "overrides": [] },
"gridPos": { "h": 4, "w": 4, "x": 16, "y": 0 },
"id": 5,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "gitea_stars", "legendFormat": "Stars", "refId": "A" }],
"title": "Stars",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, "unit": "short" }, "overrides": [] },
"gridPos": { "h": 4, "w": 4, "x": 20, "y": 0 },
"id": 6,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "gitea_releases", "legendFormat": "Releases", "refId": "A" }],
"title": "Releases",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, "unit": "short" }, "overrides": [] },
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 },
"id": 7,
"options": { "legend": { "calcs": ["lastNotNull"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [
{ "expr": "gitea_issues_open", "legendFormat": "Open", "refId": "A" },
{ "expr": "gitea_issues_closed", "legendFormat": "Closed", "refId": "B" },
{ "expr": "gitea_issues", "legendFormat": "Total", "refId": "C" }
],
"title": "Issues Over Time",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, "unit": "short" }, "overrides": [] },
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 },
"id": 8,
"options": { "legend": { "calcs": ["lastNotNull"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [
{ "expr": "gitea_repositories", "legendFormat": "Repositories", "refId": "A" },
{ "expr": "gitea_users", "legendFormat": "Users", "refId": "B" },
{ "expr": "gitea_organizations", "legendFormat": "Organizations", "refId": "C" }
],
"title": "Growth Over Time",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, "unit": "bytes" }, "overrides": [] },
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 12 },
"id": 9,
"options": { "legend": { "calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [
{ "expr": "go_memstats_alloc_bytes{job=\"gitea\"}", "legendFormat": "Heap Alloc", "refId": "A" },
{ "expr": "go_memstats_sys_bytes{job=\"gitea\"}", "legendFormat": "System", "refId": "B" },
{ "expr": "go_memstats_heap_inuse_bytes{job=\"gitea\"}", "legendFormat": "Heap In Use", "refId": "C" }
],
"title": "Memory Usage",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, "unit": "short" }, "overrides": [] },
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 12 },
"id": 10,
"options": { "legend": { "calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [
{ "expr": "go_goroutines{job=\"gitea\"}", "legendFormat": "Goroutines", "refId": "A" }
],
"title": "Goroutines",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": ["gitea", "devops"],
"templating": { "list": [] },
"time": { "from": "now-6h", "to": "now" },
"timepicker": {},
"timezone": "",
"title": "Gitea Overview",
"uid": "gitea-overview",
"version": 1,
"weekStart": ""
}
@@ -1,428 +0,0 @@
{
"annotations": {"list": []},
"description": "Heat Pump ROI Analysis - Viessmann Vitocal 250-A",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "blue", "value": null}]}, "unit": "currencyEUR"},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 0, "y": 0},
"id": 1,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "vector(${investment_cost})", "refId": "A"}],
"title": "Investment Cost",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "orange", "value": null}]}, "unit": "currencyEUR"},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 4, "y": 0},
"id": 2,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "vector(6650)", "refId": "A"}],
"title": "Oil Baseline (Annual)",
"description": "Based on 2022-2023 oil orders: ~5,000L at ~1.33 EUR/L average",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, "unit": "currencyEUR"},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 8, "y": 0},
"id": 3,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "(\n (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n) * ${solar_price} + on() (\n 1 - (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n) * on() homeassistant_input_number_state_eur_per_kwh{entity=\"input_number.strompreis\"}", "instant": true, "refId": "A"}],
"title": "Blended Price",
"description": "Actual weighted average from Vitocharge data: solar self-consumption @ €${solar_price}, grid @ strompreis",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "purple", "value": null}]}, "unit": "kwh"},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 12, "y": 0},
"id": 4,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_total\"} + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_total\"}", "instant": true, "refId": "A"}],
"title": "Total Consumption",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "yellow", "value": 3000}, {"color": "red", "value": 5000}]}, "unit": "currencyEUR"},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 16, "y": 0},
"id": 5,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "(homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_total\"} + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_total\"}) * on() (\n (\n (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * ${solar_price} + on() (\n 1 - (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * on() homeassistant_input_number_state_eur_per_kwh{entity=\"input_number.strompreis\"}\n)", "instant": true, "refId": "A"}],
"title": "Running Cost (Total)",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, "unit": "currencyEUR"},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 20, "y": 0},
"id": 6,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "(homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_this_year\"} + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_this_year\"}) * on() (\n (\n (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * ${solar_price} + on() (\n 1 - (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * on() homeassistant_input_number_state_eur_per_kwh{entity=\"input_number.strompreis\"}\n)", "instant": true, "refId": "A"}],
"title": "Cost This Year",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "decimals": 1, "mappings": [], "max": 5, "min": 1, "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "yellow", "value": 2.5}, {"color": "green", "value": 3}]}},
"overrides": []
},
"gridPos": {"h": 5, "w": 3, "x": 0, "y": 4},
"id": 7,
"options": {"minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "showThresholdLabels": false, "showThresholdMarkers": true},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_state{entity=\"sensor.e3_vitocal_seasonal_performance_factor\"}", "instant": true, "refId": "A"}],
"title": "Overall SPF",
"type": "gauge"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "decimals": 1, "mappings": [], "max": 5, "min": 1, "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "yellow", "value": 2.5}, {"color": "green", "value": 3}]}},
"overrides": []
},
"gridPos": {"h": 5, "w": 3, "x": 3, "y": 4},
"id": 8,
"options": {"minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "showThresholdLabels": false, "showThresholdMarkers": true},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_state{entity=\"sensor.e3_vitocal_seasonal_performance_factor_heating\"}", "instant": true, "refId": "A"}],
"title": "Heating SPF",
"type": "gauge"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "decimals": 1, "mappings": [], "max": 5, "min": 1, "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "yellow", "value": 2.5}, {"color": "green", "value": 3}]}},
"overrides": []
},
"gridPos": {"h": 5, "w": 3, "x": 6, "y": 4},
"id": 9,
"options": {"minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "showThresholdLabels": false, "showThresholdMarkers": true},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_state{entity=\"sensor.e3_vitocal_seasonal_performance_factor_domestic_hot_water\"}", "instant": true, "refId": "A"}],
"title": "DHW SPF",
"type": "gauge"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, "unit": "currencyEUR"},
"overrides": []
},
"gridPos": {"h": 5, "w": 4, "x": 9, "y": 4},
"id": 10,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "6650 - ((homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_this_year\"} + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_this_year\"}) * on() (\n (\n (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * ${solar_price} + on() (\n 1 - (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * on() homeassistant_input_number_state_eur_per_kwh{entity=\"input_number.strompreis\"}\n) * 12 / (month(vector(time())) + (day_of_month(vector(time())) / 30)))", "instant": true, "refId": "A"}],
"title": "Projected Annual Savings",
"description": "Oil baseline minus projected annual electricity cost",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "decimals": 1, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "yellow", "value": 15}, {"color": "red", "value": 20}]}, "unit": "short"},
"overrides": []
},
"gridPos": {"h": 5, "w": 4, "x": 13, "y": 4},
"id": 11,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "${investment_cost} / (6650 - ((homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_this_year\"} + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_this_year\"}) * on() (\n (\n (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * ${solar_price} + on() (\n 1 - (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * on() homeassistant_input_number_state_eur_per_kwh{entity=\"input_number.strompreis\"}\n) * 12 / (month(vector(time())) + (day_of_month(vector(time())) / 30))))", "instant": true, "refId": "A"}],
"title": "Payback Period (Years)",
"description": "Investment / Annual Savings",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, "unit": "currencyEUR"},
"overrides": []
},
"gridPos": {"h": 5, "w": 4, "x": 17, "y": 4},
"id": 12,
"options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "(6650 * (time() - 1727740800) / 31536000) - ((homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_total\"} + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_total\"}) * on() (\n (\n (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * ${solar_price} + on() (\n 1 - (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * on() homeassistant_input_number_state_eur_per_kwh{entity=\"input_number.strompreis\"}\n))", "instant": true, "refId": "A"}],
"title": "Savings Since Install",
"description": "Oil baseline prorated since Oct 2024 minus actual costs",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "decimals": 1, "mappings": [], "max": 100, "min": 0, "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "yellow", "value": 25}, {"color": "green", "value": 50}]}, "unit": "percent"},
"overrides": []
},
"gridPos": {"h": 5, "w": 3, "x": 21, "y": 4},
"id": 40,
"options": {"minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "showThresholdLabels": false, "showThresholdMarkers": true},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "((6650 * (time() - 1727740800) / 31536000) - ((homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_total\"} + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_total\"}) * on() (\n (\n (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * ${solar_price} + on() (\n 1 - (homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n / on() (homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_import_from_grid\"} / 1000 + on() homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocharge_03_solar_energy_production_total\"} - on() homeassistant_sensor_energy_wh{entity=\"sensor.e3_vitocharge_03_energy_export_to_grid\"} / 1000)\n ) * on() homeassistant_input_number_state_eur_per_kwh{entity=\"input_number.strompreis\"}\n))) / ${investment_cost} * 100", "instant": true, "refId": "A"}],
"title": "ROI Progress",
"description": "Percentage of investment recovered through savings",
"type": "gauge"
},
{
"collapsed": false,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 9},
"id": 30,
"panels": [],
"title": "Historical Data (InfluxDB - Oct 2024 to Sep 2025)",
"type": "row"
},
{
"datasource": {"type": "influxdb", "uid": "influxdb"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": true, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "kwh"
},
"overrides": [
{"matcher": {"id": "byName", "options": "Heating Total"}, "properties": [{"id": "color", "value": {"fixedColor": "red", "mode": "fixed"}}]},
{"matcher": {"id": "byName", "options": "DHW Total"}, "properties": [{"id": "color", "value": {"fixedColor": "blue", "mode": "fixed"}}]}
]
},
"gridPos": {"h": 10, "w": 12, "x": 0, "y": 10},
"id": 21,
"options": {"legend": {"calcs": ["min", "max", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{
"datasource": {"type": "influxdb", "uid": "influxdb"},
"query": "from(bucket: \"suedstr28\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"kWh\")\n |> filter(fn: (r) => r.entity_id == \"e3_vitocal_heating_energy_consumption_total\")\n |> filter(fn: (r) => r._field == \"value\")\n |> aggregateWindow(every: 1d, fn: last, createEmpty: false)\n |> keep(columns: [\"_time\", \"_value\"])\n |> rename(columns: {_value: \"Heating Total\"})",
"refId": "A"
},
{
"datasource": {"type": "influxdb", "uid": "influxdb"},
"query": "from(bucket: \"suedstr28\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"kWh\")\n |> filter(fn: (r) => r.entity_id == \"e3_vitocal_dhw_energy_consumption_total\")\n |> filter(fn: (r) => r._field == \"value\")\n |> aggregateWindow(every: 1d, fn: last, createEmpty: false)\n |> keep(columns: [\"_time\", \"_value\"])\n |> rename(columns: {_value: \"DHW Total\"})",
"refId": "B"
}
],
"title": "Historical Energy Consumption",
"type": "timeseries"
},
{
"datasource": {"type": "influxdb", "uid": "influxdb"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": true, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "currencyEUR"
},
"overrides": [
{"matcher": {"id": "byName", "options": "Electricity Cost"}, "properties": [{"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]},
{"matcher": {"id": "byName", "options": "Oil Baseline"}, "properties": [{"id": "color", "value": {"fixedColor": "orange", "mode": "fixed"}}]}
]
},
"gridPos": {"h": 10, "w": 12, "x": 12, "y": 10},
"id": 22,
"options": {"legend": {"calcs": ["min", "max", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{
"datasource": {"type": "influxdb", "uid": "influxdb"},
"query": "// Heat pump consumption (cumulative)\nheatpump_heating = from(bucket: \"suedstr28\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"kWh\" and r.entity_id == \"e3_vitocal_heating_energy_consumption_total\" and r._field == \"value\")\n |> aggregateWindow(every: 1d, fn: last, createEmpty: false)\n |> keep(columns: [\"_time\", \"_value\"])\n\nheatpump_dhw = from(bucket: \"suedstr28\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"kWh\" and r.entity_id == \"e3_vitocal_dhw_energy_consumption_total\" and r._field == \"value\")\n |> aggregateWindow(every: 1d, fn: last, createEmpty: false)\n |> keep(columns: [\"_time\", \"_value\"])\n\n// Grid import (Wh -> kWh)\ngrid_import = from(bucket: \"suedstr28\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r.entity_id == \"e3_vitocharge_03_energy_import_from_grid\" and r._field == \"value\")\n |> aggregateWindow(every: 1d, fn: last, createEmpty: false)\n |> map(fn: (r) => ({_time: r._time, _value: r._value / 1000.0}))\n |> keep(columns: [\"_time\", \"_value\"])\n\n// Grid export (Wh -> kWh)\ngrid_export = from(bucket: \"suedstr28\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r.entity_id == \"e3_vitocharge_03_energy_export_to_grid\" and r._field == \"value\")\n |> aggregateWindow(every: 1d, fn: last, createEmpty: false)\n |> map(fn: (r) => ({_time: r._time, _value: r._value / 1000.0}))\n |> keep(columns: [\"_time\", \"_value\"])\n\n// Solar production (already kWh)\nsolar_prod = from(bucket: \"suedstr28\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r.entity_id == \"e3_vitocharge_03_solar_energy_production_total\" and r._field == \"value\")\n |> aggregateWindow(every: 1d, fn: last, createEmpty: false)\n |> keep(columns: [\"_time\", \"_value\"])\n\n// Chain joins (Flux only supports 2-way joins)\njoin1 = join(tables: {h: heatpump_heating, d: heatpump_dhw}, on: [\"_time\"])\njoin2 = join(tables: {j1: join1, gi: grid_import}, on: [\"_time\"])\njoin3 = join(tables: {j2: join2, ge: grid_export}, on: [\"_time\"])\njoin(tables: {j3: join3, sp: solar_prod}, on: [\"_time\"])\n |> map(fn: (r) => {\n heatpump = r._value_h + r._value_d\n self_consumption = r._value_sp - r._value_ge\n total_consumption = r._value_gi + self_consumption\n solar_ratio = if total_consumption > 0.0 then self_consumption / total_consumption else 0.0\n return {_time: r._time, _value: heatpump * ((1.0 - solar_ratio) * 0.3271 + solar_ratio * ${solar_price})}\n })\n |> rename(columns: {_value: \"Electricity Cost\"})",
"refId": "A"
},
{
"datasource": {"type": "influxdb", "uid": "influxdb"},
"query": "from(bucket: \"suedstr28\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"kWh\")\n |> filter(fn: (r) => r.entity_id == \"e3_vitocal_heating_energy_consumption_total\")\n |> filter(fn: (r) => r._field == \"value\")\n |> aggregateWindow(every: 1d, fn: last, createEmpty: false)\n |> keep(columns: [\"_time\", \"_value\"])\n |> map(fn: (r) => ({_time: r._time, _value: 6650.0 * float(v: uint(v: r._time) - uint(v: 2024-10-01T00:00:00Z)) / 31536000000000000.0}))\n |> rename(columns: {_value: \"Oil Baseline\"})",
"refId": "B"
}
],
"title": "Historical Cost Comparison",
"description": "Actual electricity cost vs what oil would have cost",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 20},
"id": 31,
"panels": [],
"title": "Current Data (Prometheus - Real-time)",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "kwh"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 21},
"id": 13,
"options": {"legend": {"calcs": ["mean", "max", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_total\"}", "legendFormat": "Heating Total", "refId": "A"},
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_total\"}", "legendFormat": "DHW Total", "refId": "B"}
],
"timeFrom": "7d",
"title": "Cumulative Energy Consumption (Recent)",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "kwh"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 21},
"id": 15,
"options": {"legend": {"calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_last_seven_days\"}", "legendFormat": "Heating (7 days)", "refId": "A"},
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_last_seven_days\"}", "legendFormat": "DHW (7 days)", "refId": "B"}
],
"timeFrom": "7d",
"title": "Weekly Consumption",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 24, "x": 0, "y": 29},
"id": 16,
"options": {"legend": {"calcs": ["mean", "min", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}},
"targets": [
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_state{entity=\"sensor.e3_vitocal_seasonal_performance_factor\"}", "legendFormat": "Overall SPF", "refId": "A"},
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_state{entity=\"sensor.e3_vitocal_seasonal_performance_factor_heating\"}", "legendFormat": "Heating SPF", "refId": "B"},
{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_state{entity=\"sensor.e3_vitocal_seasonal_performance_factor_domestic_hot_water\"}", "legendFormat": "DHW SPF", "refId": "C"}
],
"timeFrom": "7d",
"title": "Seasonal Performance Factor Over Time",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "blue", "value": null}]}, "unit": "kwh"},
"overrides": []
},
"gridPos": {"h": 4, "w": 6, "x": 0, "y": 37},
"id": 17,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_this_year\"}", "instant": true, "refId": "A"}],
"title": "Heating This Year",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "blue", "value": null}]}, "unit": "kwh"},
"overrides": []
},
"gridPos": {"h": 4, "w": 6, "x": 6, "y": 37},
"id": 18,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_this_year\"}", "instant": true, "refId": "A"}],
"title": "DHW This Year",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "purple", "value": null}]}, "unit": "kwh"},
"overrides": []
},
"gridPos": {"h": 4, "w": 6, "x": 12, "y": 37},
"id": 19,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_heating_energy_consumption_last_seven_days\"}", "instant": true, "refId": "A"}],
"title": "Heating Last 7 Days",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {
"defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "purple", "value": null}]}, "unit": "kwh"},
"overrides": []
},
"gridPos": {"h": 4, "w": 6, "x": 18, "y": 37},
"id": 20,
"options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"},
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "homeassistant_sensor_energy_kwh{entity=\"sensor.e3_vitocal_dhw_energy_consumption_last_seven_days\"}", "instant": true, "refId": "A"}],
"title": "DHW Last 7 Days",
"type": "stat"
}
],
"refresh": "5m",
"schemaVersion": 38,
"style": "dark",
"tags": ["homelab", "heatpump", "energy", "roi"],
"templating": {"list": [
{
"current": {"selected": true, "text": "72968", "value": "72968"},
"description": "Heat pump investment cost (excluding water softener €9,225)",
"hide": 0,
"label": "Investment",
"name": "investment_cost",
"options": [
{"selected": true, "text": "72968", "value": "72968"}
],
"query": "72968",
"type": "custom"
},
{
"current": {"selected": true, "text": "0.08", "value": "0.08"},
"description": "Electricity price when battery full/solar excess",
"hide": 0,
"label": "Solar Price",
"name": "solar_price",
"options": [
{"selected": true, "text": "0.08", "value": "0.08"}
],
"query": "0.08",
"type": "custom"
}
]},
"time": {"from": "2024-10-01T00:00:00.000Z", "to": "now"},
"timepicker": {},
"timezone": "",
"title": "Heat Pump ROI",
"uid": "heatpump-roi",
"version": 1,
"weekStart": ""
}
@@ -1,253 +0,0 @@
{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [
{ "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": true, "tags": [], "targetBlank": false, "title": "Back to Overview", "type": "link", "url": "/d/home-overview/home-overview" }
],
"liveNow": false,
"panels": [
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 },
"id": 100,
"title": "Current Temperatures",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"max": 30,
"min": 10,
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }, { "color": "green", "value": 18 }, { "color": "yellow", "value": 24 }, { "color": "red", "value": 28 }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 6, "w": 24, "x": 0, "y": 1 },
"id": 1,
"options": { "displayMode": "lcd", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "showUnfilled": true, "valueMode": "color" },
"targets": [{ "expr": "homeassistant_sensor_temperature_celsius{friendly_name=~\".*Shelly.*[Tt]emp.*|.*Meter Pro.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "All Room Temperatures",
"type": "bargauge"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 7 },
"id": 101,
"title": "Temperature History",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": 3600000, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 8 },
"id": 10,
"options": { "legend": { "calcs": ["mean", "min", "max", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_sensor_temperature_celsius{friendly_name=~\"EG.*Shelly.*[Tt]emp.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Erdgeschoss Temperatures",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": 3600000, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 10, "w": 12, "x": 0, "y": 18 },
"id": 11,
"options": { "legend": { "calcs": ["mean", "min", "max", "lastNotNull"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_sensor_temperature_celsius{friendly_name=~\".*KG.*Shelly.*[Tt]emp.*|.*[Kk]eller.*[Tt]emp.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Keller Temperatures",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": 3600000, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 10, "w": 12, "x": 12, "y": 18 },
"id": 12,
"options": { "legend": { "calcs": ["mean", "min", "max", "lastNotNull"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_sensor_temperature_celsius{friendly_name=~\".*DG.*|.*Meter Pro.*|.*I-9PSL.*[Tt]emp.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Obergeschoss & Dachgeschoss",
"type": "timeseries"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 28 },
"id": 102,
"title": "Humidity",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"max": 100,
"min": 0,
"thresholds": { "mode": "absolute", "steps": [{ "color": "yellow", "value": null }, { "color": "green", "value": 40 }, { "color": "yellow", "value": 60 }, { "color": "red", "value": 70 }] },
"unit": "percent"
},
"overrides": []
},
"gridPos": { "h": 5, "w": 12, "x": 0, "y": 29 },
"id": 20,
"options": { "displayMode": "lcd", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "showUnfilled": true, "valueMode": "color" },
"targets": [{ "expr": "homeassistant_sensor_humidity_percent{friendly_name=~\".*Shelly.*[Hh]umidity.*|.*I-9PSL.*[Hh]umidity.*|.*Meter Pro.*[Hh]umidity.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Current Humidity",
"type": "bargauge"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": 3600000, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "percent"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 29 },
"id": 21,
"options": { "legend": { "calcs": ["mean", "min", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_sensor_humidity_percent{friendly_name=~\".*Shelly.*[Hh]umidity.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Humidity History",
"type": "timeseries"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 37 },
"id": 103,
"title": "Air Quality",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"max": 2000,
"min": 400,
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 800 }, { "color": "orange", "value": 1000 }, { "color": "red", "value": 1500 }] },
"unit": "ppm"
},
"overrides": []
},
"gridPos": { "h": 6, "w": 8, "x": 0, "y": 38 },
"id": 30,
"options": { "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true },
"targets": [{ "expr": "homeassistant_sensor_carbon_dioxide_ppm", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "CO2 Levels",
"type": "gauge"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": 3600000, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "line+area" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "transparent", "value": null }, { "color": "yellow", "value": 800 }, { "color": "red", "value": 1000 }] },
"unit": "ppm"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 16, "x": 8, "y": 38 },
"id": 31,
"options": { "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_sensor_carbon_dioxide_ppm", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "CO2 History",
"type": "timeseries"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 46 },
"id": 104,
"title": "Heating System",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": 3600000, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 47 },
"id": 40,
"options": { "legend": { "calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [
{ "expr": "homeassistant_climate_current_temperature_celsius", "legendFormat": "{{friendly_name}} (current)", "refId": "A" },
{ "expr": "homeassistant_climate_target_temperature_celsius", "legendFormat": "{{friendly_name}} (target)", "refId": "B" }
],
"title": "Heating System Temperatures",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": 3600000, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 47 },
"id": 41,
"options": { "legend": { "calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [
{ "expr": "homeassistant_water_heater_current_temperature_celsius", "legendFormat": "{{friendly_name}}", "refId": "A" }
],
"title": "Hot Water Temperature",
"type": "timeseries"
}
],
"refresh": "1m",
"schemaVersion": 38,
"style": "dark",
"tags": ["home", "climate", "temperature", "smart-home"],
"templating": { "list": [] },
"time": { "from": "now-24h", "to": "now" },
"timepicker": {},
"timezone": "",
"title": "Home Climate Details",
"uid": "home-climate",
"version": 1,
"weekStart": ""
}
@@ -1,273 +0,0 @@
{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [
{ "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": true, "tags": [], "targetBlank": false, "title": "Back to Overview", "type": "link", "url": "/d/home-overview/home-overview" }
],
"liveNow": false,
"panels": [
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 },
"id": 100,
"title": "Power Overview",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 2000 }, { "color": "orange", "value": 4000 }, { "color": "red", "value": 6000 }] },
"unit": "watt"
},
"overrides": []
},
"gridPos": { "h": 6, "w": 6, "x": 0, "y": 1 },
"id": 1,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_power_w{friendly_name=\"Smart Meter Sum active instantaneous power\"}", "legendFormat": "Total Power", "refId": "A" }],
"title": "Total Power",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1000 }, { "color": "red", "value": 2000 }] },
"unit": "watt"
},
"overrides": []
},
"gridPos": { "h": 6, "w": 6, "x": 6, "y": 1 },
"id": 2,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_power_w{friendly_name=\"Smart Meter L1 active instantaneous power\"}", "legendFormat": "L1", "refId": "A" }],
"title": "Phase L1",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1000 }, { "color": "red", "value": 2000 }] },
"unit": "watt"
},
"overrides": []
},
"gridPos": { "h": 6, "w": 6, "x": 12, "y": 1 },
"id": 3,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_power_w{friendly_name=\"Smart Meter L2 active instantaneous power\"}", "legendFormat": "L2", "refId": "A" }],
"title": "Phase L2",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1000 }, { "color": "red", "value": 2000 }] },
"unit": "watt"
},
"overrides": []
},
"gridPos": { "h": 6, "w": 6, "x": 18, "y": 1 },
"id": 4,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_power_w{friendly_name=\"Smart Meter L3 active instantaneous power\"}", "legendFormat": "L3", "refId": "A" }],
"title": "Phase L3",
"type": "stat"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 7 },
"id": 101,
"title": "Power History",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "watt"
},
"overrides": []
},
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 8 },
"id": 10,
"options": { "legend": { "calcs": ["mean", "max", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [
{ "expr": "homeassistant_sensor_power_w{friendly_name=~\"Smart Meter L[123] active instantaneous power\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }
],
"title": "Power by Phase (Stacked)",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "watt"
},
"overrides": []
},
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 18 },
"id": 11,
"options": { "legend": { "calcs": ["mean", "max", "lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_sensor_power_w{friendly_name=\"Smart Meter Sum active instantaneous power\"}", "legendFormat": "Total Power", "refId": "A" }],
"title": "Total Power Over Time",
"type": "timeseries"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 28 },
"id": 102,
"title": "Voltage & Current",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "line" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "yellow", "value": 220 }, { "color": "green", "value": 230 }, { "color": "yellow", "value": 240 }, { "color": "red", "value": 250 }] },
"unit": "volt"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 29 },
"id": 20,
"options": { "legend": { "calcs": ["mean", "min", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_sensor_voltage_v{friendly_name=~\"Smart Meter L[123] active instantaneous voltage\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Voltage by Phase",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "amp"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 29 },
"id": 21,
"options": { "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_sensor_current_a{friendly_name=~\"Smart Meter.*current.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Current by Phase (if available)",
"type": "timeseries"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 37 },
"id": 103,
"title": "Device Power Consumption",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"max": 500,
"min": 0,
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 100 }, { "color": "orange", "value": 200 }, { "color": "red", "value": 300 }] },
"unit": "watt"
},
"overrides": []
},
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 38 },
"id": 30,
"options": { "displayMode": "lcd", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "showUnfilled": true, "valueMode": "color" },
"targets": [{ "expr": "topk(20, homeassistant_sensor_power_w{friendly_name!~\".*Phase.*\"} > 0)", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Top 20 Power Consuming Devices",
"type": "bargauge"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 48 },
"id": 104,
"title": "Energy Consumption",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 5, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "kwatth"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 24, "x": 0, "y": 49 },
"id": 40,
"options": { "legend": { "calcs": ["lastNotNull", "diff"], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_sensor_energy_kwh{friendly_name=~\".*[Ee]nergy.*|.*[Vv]erbrauch.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Energy Consumption (kWh)",
"type": "timeseries"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 57 },
"id": 105,
"title": "Lights",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"custom": { "align": "auto", "cellOptions": { "type": "color-background" }, "inspect": false },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "dark-green", "value": null }, { "color": "yellow", "value": 1 }, { "color": "orange", "value": 50 }, { "color": "light-yellow", "value": 100 }] },
"unit": "percent"
},
"overrides": []
},
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 58 },
"id": 50,
"options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false }, "sortBy": [{ "desc": true, "displayName": "Brightness" }] },
"pluginVersion": "10.0.0",
"targets": [{ "expr": "homeassistant_light_brightness_percent > 0", "format": "table", "instant": true, "refId": "A" }],
"title": "Active Lights",
"transformations": [
{ "id": "organize", "options": { "excludeByName": { "Time": true, "__name__": true, "domain": true, "entity": true, "instance": true, "job": true }, "renameByName": { "Value": "Brightness", "friendly_name": "Light" } } }
],
"type": "table"
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": ["home", "energy", "power", "smart-home"],
"templating": { "list": [] },
"time": { "from": "now-24h", "to": "now" },
"timepicker": {},
"timezone": "",
"title": "Home Energy Details",
"uid": "home-energy",
"version": 1,
"weekStart": ""
}
@@ -1,412 +0,0 @@
{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [
{ "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": true, "tags": [], "targetBlank": true, "title": "Climate Details", "type": "link", "url": "/d/home-climate/home-climate-details" },
{ "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": true, "tags": [], "targetBlank": true, "title": "Security Details", "type": "link", "url": "/d/home-security/home-security-details" },
{ "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": true, "tags": [], "targetBlank": true, "title": "Energy Details", "type": "link", "url": "/d/home-energy/home-energy-details" }
],
"liveNow": false,
"panels": [
{
"gridPos": { "h": 2, "w": 24, "x": 0, "y": 0 },
"id": 100,
"options": { "content": "# House Status Overview\nQuick glance at your home. Green = OK, Yellow = Attention, Red = Action Required", "mode": "markdown" },
"pluginVersion": "10.0.0",
"title": "",
"transparent": true,
"type": "text"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [
{ "options": { "0": { "color": "red", "index": 0, "text": "TRIGGERED" }, "1": { "color": "green", "index": 1, "text": "OK" } }, "type": "value" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 4, "w": 4, "x": 0, "y": 2 },
"id": 1,
"options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "min(homeassistant_alarm_control_panel_state{state=\"disarmed\"} == 1 or homeassistant_alarm_control_panel_state{state=\"armed_home\"} == 1 or homeassistant_alarm_control_panel_state{state=\"armed_away\"} == 1 or homeassistant_alarm_control_panel_state{state=\"armed_night\"} == 1)", "legendFormat": "Alarm Status", "refId": "A" }],
"title": "Alarm System",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [
{ "options": { "0": { "color": "green", "index": 0, "text": "All Closed" } }, "type": "value" },
{ "options": { "from": 1, "to": 99, "result": { "color": "yellow", "index": 1, "text": "${__value.raw} Open" } }, "type": "range" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 4, "w": 4, "x": 4, "y": 2 },
"id": 2,
"options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "count(homeassistant_binary_sensor_state{friendly_name=~\".*[Ff]enster.*|.*[Ww]indow.*\"} == 1) or vector(0)", "legendFormat": "Windows Open", "refId": "A" }],
"title": "Windows",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [
{ "options": { "0": { "color": "green", "index": 0, "text": "All Closed" } }, "type": "value" },
{ "options": { "from": 1, "to": 99, "result": { "color": "yellow", "index": 1, "text": "${__value.raw} Open" } }, "type": "range" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 4, "w": 4, "x": 8, "y": 2 },
"id": 3,
"options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "count(homeassistant_binary_sensor_state{friendly_name=~\".*[Tt](ü|u)r.*|.*[Dd]oor.*\"} == 1) or vector(0)", "legendFormat": "Doors Open", "refId": "A" }],
"title": "Doors",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [
{ "options": { "0": { "color": "green", "index": 0, "text": "All OK" } }, "type": "value" },
{ "options": { "from": 1, "to": 99, "result": { "color": "red", "index": 1, "text": "${__value.raw} Low!" } }, "type": "range" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "red", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 4, "w": 4, "x": 12, "y": 2 },
"id": 4,
"options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "count(homeassistant_sensor_battery_percent < 20 and homeassistant_sensor_battery_percent > 0) or vector(0)", "legendFormat": "Low Batteries", "refId": "A" }],
"title": "Batteries <20%",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 2000 }, { "color": "red", "value": 5000 }] },
"unit": "watt"
},
"overrides": []
},
"gridPos": { "h": 4, "w": 4, "x": 16, "y": 2 },
"id": 5,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "sum(homeassistant_sensor_power_w{friendly_name=~\".*[Pp]hase.*[Pp]ower.*|.*shellypro3em.*[Pp]ower\"})", "legendFormat": "Total Power", "refId": "A" }],
"title": "Power Usage",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 5 }, { "color": "red", "value": 10 }] },
"unit": "short"
},
"overrides": []
},
"gridPos": { "h": 4, "w": 4, "x": 20, "y": 2 },
"id": 6,
"options": { "colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "count(homeassistant_light_brightness_percent > 0)", "legendFormat": "Lights On", "refId": "A" }],
"title": "Lights On",
"type": "stat"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 6 },
"id": 200,
"title": "Temperature by Floor",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }, { "color": "green", "value": 18 }, { "color": "yellow", "value": 24 }, { "color": "red", "value": 28 }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 5, "w": 6, "x": 0, "y": 7 },
"id": 10,
"options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_temperature_celsius{friendly_name=~\".*Shelly.*[Tt]emp.*\", entity=~\".*kg.*|.*keller.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Keller",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }, { "color": "green", "value": 18 }, { "color": "yellow", "value": 24 }, { "color": "red", "value": 28 }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 5, "w": 6, "x": 6, "y": 7 },
"id": 11,
"options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_temperature_celsius{friendly_name=~\"EG.*Shelly.*[Tt]emp.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Erdgeschoss",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }, { "color": "green", "value": 18 }, { "color": "yellow", "value": 24 }, { "color": "red", "value": 28 }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 5, "w": 6, "x": 12, "y": 7 },
"id": 12,
"options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_temperature_celsius{friendly_name=~\"OG.*Shelly.*[Tt]emp.*|.*I-9PSL.*[Tt]emp.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Obergeschoss",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }, { "color": "green", "value": 18 }, { "color": "yellow", "value": 24 }, { "color": "red", "value": 28 }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 5, "w": 6, "x": 18, "y": 7 },
"id": 13,
"options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_temperature_celsius{friendly_name=~\"DG.*[Tt]emp.*|.*Meter Pro.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Dachgeschoss",
"type": "stat"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 12 },
"id": 201,
"title": "Alerts & Attention",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"custom": { "align": "auto", "cellOptions": { "type": "color-background" }, "inspect": false },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "yellow", "value": 10 }, { "color": "green", "value": 20 }] }
},
"overrides": [
{ "matcher": { "id": "byName", "options": "Battery %" }, "properties": [{ "id": "unit", "value": "percent" }] }
]
},
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 13 },
"id": 20,
"options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false }, "sortBy": [{ "desc": false, "displayName": "Battery %" }] },
"pluginVersion": "10.0.0",
"targets": [{ "expr": "sort(homeassistant_sensor_battery_percent < 30 and homeassistant_sensor_battery_percent > 0)", "format": "table", "instant": true, "legendFormat": "", "refId": "A" }],
"title": "Low Battery Devices (<30%)",
"transformations": [
{ "id": "organize", "options": { "excludeByName": { "Time": true, "__name__": true, "domain": true, "entity": true, "instance": true, "job": true }, "indexByName": {}, "renameByName": { "Value": "Battery %", "friendly_name": "Device" } } }
],
"type": "table"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"custom": { "align": "auto", "cellOptions": { "type": "color-text" }, "inspect": false },
"mappings": [
{ "options": { "0": { "color": "green", "text": "Closed" }, "1": { "color": "yellow", "text": "OPEN" } }, "type": "value" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 13 },
"id": 21,
"options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false } },
"pluginVersion": "10.0.0",
"targets": [
{ "expr": "homeassistant_binary_sensor_state{friendly_name=~\".*[Ff]enster.*|.*[Ww]indow.*is open$|.*[Tt](ü|u)r.*\"} == 1", "format": "table", "instant": true, "legendFormat": "", "refId": "A" }
],
"title": "Open Doors & Windows",
"transformations": [
{ "id": "organize", "options": { "excludeByName": { "Time": true, "__name__": true, "domain": true, "entity": true, "instance": true, "job": true }, "indexByName": {}, "renameByName": { "Value": "Status", "friendly_name": "Name" } } }
],
"type": "table"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 21 },
"id": 202,
"title": "Energy & Climate",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "watt"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 22 },
"id": 30,
"options": { "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [
{ "expr": "homeassistant_sensor_power_w{friendly_name=~\".*Phase.*Power.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" },
{ "expr": "sum(homeassistant_sensor_power_w{friendly_name=~\".*Phase.*Power.*\"})", "legendFormat": "Total", "refId": "B" }
],
"title": "Power Consumption",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 22 },
"id": 31,
"options": { "legend": { "calcs": ["mean", "lastNotNull"], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [
{ "expr": "homeassistant_sensor_temperature_celsius{friendly_name=~\".*Shelly.*[Tt]emp.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }
],
"title": "Indoor Temperatures",
"type": "timeseries"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 30 },
"id": 203,
"title": "Heating System",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }, { "color": "green", "value": 40 }, { "color": "yellow", "value": 50 }, { "color": "red", "value": 60 }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 4, "w": 6, "x": 0, "y": 31 },
"id": 40,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_water_heater_current_temperature_celsius{friendly_name=~\".*[Ww]armwasser.*|.*[Dd]omestic.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Hot Water",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }, { "color": "green", "value": 10 }, { "color": "yellow", "value": 20 }, { "color": "red", "value": 25 }] },
"unit": "celsius"
},
"overrides": []
},
"gridPos": { "h": 4, "w": 6, "x": 6, "y": 31 },
"id": 41,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_climate_current_temperature_celsius{friendly_name=~\".*[Hh]eating.*|.*Vitodens.*|.*Vitocal.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Heating System",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 60 }, { "color": "red", "value": 80 }] },
"unit": "percent"
},
"overrides": []
},
"gridPos": { "h": 4, "w": 6, "x": 12, "y": 31 },
"id": 42,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_humidity_percent{friendly_name=~\".*Shelly.*[Hh]umidity.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Humidity",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 800 }, { "color": "red", "value": 1000 }] },
"unit": "ppm"
},
"overrides": []
},
"gridPos": { "h": 4, "w": 6, "x": 18, "y": 31 },
"id": 43,
"options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_sensor_carbon_dioxide_ppm", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "CO2 Levels",
"type": "stat"
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": ["home", "overview", "smart-home"],
"templating": { "list": [] },
"time": { "from": "now-6h", "to": "now" },
"timepicker": {},
"timezone": "",
"title": "Home Overview",
"uid": "home-overview",
"version": 1,
"weekStart": ""
}
@@ -1,257 +0,0 @@
{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [
{ "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": true, "tags": [], "targetBlank": false, "title": "Back to Overview", "type": "link", "url": "/d/home-overview/home-overview" }
],
"liveNow": false,
"panels": [
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 },
"id": 100,
"title": "Alarm Status",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [
{ "options": { "0": { "color": "semi-dark-red", "text": "Not Active" }, "1": { "color": "green", "text": "ACTIVE" } }, "type": "value" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 4, "w": 6, "x": 0, "y": 1 },
"id": 1,
"options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_alarm_control_panel_state{state=\"disarmed\"} == 1", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Disarmed",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [
{ "options": { "0": { "color": "semi-dark-green", "text": "Not Active" }, "1": { "color": "yellow", "text": "ARMED HOME" } }, "type": "value" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 4, "w": 6, "x": 6, "y": 1 },
"id": 2,
"options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_alarm_control_panel_state{state=\"armed_home\"} == 1", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Armed Home",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [
{ "options": { "0": { "color": "semi-dark-green", "text": "Not Active" }, "1": { "color": "orange", "text": "ARMED AWAY" } }, "type": "value" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "orange", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 4, "w": 6, "x": 12, "y": 1 },
"id": 3,
"options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_alarm_control_panel_state{state=\"armed_away\"} == 1", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Armed Away",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [
{ "options": { "0": { "color": "semi-dark-green", "text": "OK" }, "1": { "color": "red", "text": "TRIGGERED!" } }, "type": "value" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "red", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 4, "w": 6, "x": 18, "y": 1 },
"id": 4,
"options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_alarm_control_panel_state{state=\"triggered\"} == 1", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Triggered",
"type": "stat"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 5 },
"id": 101,
"title": "Doors & Windows",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"custom": { "align": "auto", "cellOptions": { "type": "color-background" }, "inspect": false },
"mappings": [
{ "options": { "0": { "color": "green", "text": "Closed" }, "1": { "color": "yellow", "text": "OPEN" } }, "type": "value" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 10, "w": 12, "x": 0, "y": 6 },
"id": 10,
"options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false }, "sortBy": [{ "desc": true, "displayName": "Status" }] },
"pluginVersion": "10.0.0",
"targets": [{ "expr": "homeassistant_binary_sensor_state{friendly_name=~\".*[Ff]enster.*|.*Window.*is open$\"}", "format": "table", "instant": true, "refId": "A" }],
"title": "All Windows",
"transformations": [
{ "id": "organize", "options": { "excludeByName": { "Time": true, "__name__": true, "domain": true, "entity": true, "instance": true, "job": true }, "renameByName": { "Value": "Status", "friendly_name": "Window" } } }
],
"type": "table"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"custom": { "align": "auto", "cellOptions": { "type": "color-background" }, "inspect": false },
"mappings": [
{ "options": { "0": { "color": "green", "text": "Closed" }, "1": { "color": "yellow", "text": "OPEN" } }, "type": "value" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 10, "w": 12, "x": 12, "y": 6 },
"id": 11,
"options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false }, "sortBy": [{ "desc": true, "displayName": "Status" }] },
"pluginVersion": "10.0.0",
"targets": [{ "expr": "homeassistant_binary_sensor_state{friendly_name=~\".*[Tt](ü|u)r.*|.*[Dd]oor.*is open$|.*Terassen.*|.*Garten.*\"}", "format": "table", "instant": true, "refId": "A" }],
"title": "All Doors",
"transformations": [
{ "id": "organize", "options": { "excludeByName": { "Time": true, "__name__": true, "domain": true, "entity": true, "instance": true, "job": true }, "renameByName": { "Value": "Status", "friendly_name": "Door" } } }
],
"type": "table"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 16 },
"id": 102,
"title": "Motion Sensors",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [
{ "options": { "0": { "color": "semi-dark-green", "text": "Clear" }, "1": { "color": "yellow", "text": "Motion!" } }, "type": "value" }
],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1 }] }
},
"overrides": []
},
"gridPos": { "h": 4, "w": 24, "x": 0, "y": 17 },
"id": 20,
"options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto" },
"targets": [{ "expr": "homeassistant_binary_sensor_state{friendly_name=~\".*[Bb]ewegungs.*[Oo]ccupancy.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Current Motion Status",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "points", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 8, "scaleDistribution": { "type": "linear" }, "showPoints": "always", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } },
"mappings": [],
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] },
"unit": "short"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 24, "x": 0, "y": 21 },
"id": 21,
"options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } },
"targets": [{ "expr": "homeassistant_binary_sensor_state{friendly_name=~\".*[Bb]ewegungs.*[Oo]ccupancy.*\"} == 1", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Motion Detection History",
"type": "timeseries"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 29 },
"id": 103,
"title": "Covers (Blinds)",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"max": 100,
"min": 0,
"thresholds": { "mode": "absolute", "steps": [{ "color": "dark-blue", "value": null }, { "color": "blue", "value": 25 }, { "color": "light-blue", "value": 50 }, { "color": "super-light-blue", "value": 75 }] },
"unit": "percent"
},
"overrides": []
},
"gridPos": { "h": 8, "w": 24, "x": 0, "y": 30 },
"id": 30,
"options": { "displayMode": "lcd", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "showUnfilled": true, "valueMode": "color" },
"targets": [{ "expr": "homeassistant_cover_position{friendly_name!~\".*Alle.*|.*Süd.*|.*[Nn]ord.*|.*[Oo]st.*|.*[Ww]est.*\"}", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "Blind Positions (0% = closed, 100% = open)",
"type": "bargauge"
},
{
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 38 },
"id": 104,
"title": "Batteries",
"type": "row"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"mappings": [],
"max": 100,
"min": 0,
"thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "orange", "value": 10 }, { "color": "yellow", "value": 20 }, { "color": "green", "value": 50 }] },
"unit": "percent"
},
"overrides": []
},
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 39 },
"id": 40,
"options": { "displayMode": "lcd", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "showUnfilled": true, "valueMode": "color" },
"targets": [{ "expr": "sort_desc(homeassistant_sensor_battery_percent > 0)", "legendFormat": "{{friendly_name}}", "refId": "A" }],
"title": "All Battery Levels",
"type": "bargauge"
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": ["home", "security", "smart-home"],
"templating": { "list": [] },
"time": { "from": "now-12h", "to": "now" },
"timepicker": {},
"timezone": "",
"title": "Home Security Details",
"uid": "home-security",
"version": 1,
"weekStart": ""
}

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