Skip to content

feat(alerting): the ntfy.sh copies rendered like the in-house ones (#136) - #719

Merged
Gerrrt merged 1 commit into
mainfrom
gerrrt/ntfy-sh-inline-template-136
Sep 29, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
gerrrt/ntfy-sh-inline-template-136

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Sep 29, 2026

Copy link
Copy Markdown
Owner

What changed

scripts/render-config.sh builds an inline-template query from stacks/sensitive/ntfy/templates/homelab.yml on every render, and appends it to the two *_external_url values. That query is tpl=yes plus t, m and p for title, message and priority. Any query already on the SOPS value is replaced, so SOPS holds the bare https://ntfy.sh/<topic>. The render fails loudly if the file is missing or lacks a key.

Why

ntfy.sh can't load a template file, so the off-network copies of urgent and security arrived as raw JSON, or at best in ntfy's built-in layout. It does run inline templates. Building the query from the tracked file keeps one template instead of a second copy in SOPS that would drift.

Blast radius

  • prometheus only: two rendered URL files change on the next make render. No SOPS edit is needed; any ?template=alertmanager already there is overwritten in the rendered file.

  • One more job for homelab.yml: a change to it now needs make render on prometheus as well as make up STACK=sensitive on trinity. The file's header and the stack README say so.

  • No change to network segmentation or firewall rules

  • No new port published to a VLAN that could not already reach the service

  • No credential added outside secrets/*.sops.yaml

Verification

  • Pinned image: all six payload shapes render through the inline query exactly as through the template file: critical, resolved, grouped, Watchdog, and no annotations. Priority included.

  • ntfy.sh itself: one synthetic payload, no house names, sent to a random throwaway topic. It rendered as P5 | 🔴 example service is not reachable / Synthetic payload to test inline templating. / 📍 example-host.

  • Query: the same 2,444-character URL is produced from a bare SOPS value and from one already carrying ?template=alertmanager.

  • Checks: make validate and shellcheck pass.

  • make validate passes

  • Deployed: git pull --ff-only && make render on prometheus, then a test page seen off Wi-Fi

  • Docs updated

Refs #136

🤖 Generated with Claude Code

)

ntfy.sh cannot load stacks/sensitive/ntfy/templates/homelab.yml, so the
off-network copies of urgent and security arrived as raw JSON, or at best
as ntfy's built-in `alertmanager` layout. It does run inline templates:
tpl=yes plus the title, message and priority templates as t, m and p.

render-config.sh now builds that query from homelab.yml on every render
and appends it to the two *_external_url values, replacing any query SOPS
held. There is one template, not a second copy in SOPS. It fails loudly if
the file is missing or lacks a key.

Checked on the pinned image against the six payload shapes, and on
ntfy.sh with one synthetic payload to a throwaway topic: identical title,
message and priority 5. The query is about 2.4 KB.

Refs #136

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit 0701fb3 into main Sep 29, 2026
7 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/ntfy-sh-inline-template-136 branch September 29, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant