fix(notify): open configured web run pages from ntfy

This commit is contained in:
2026-10-21 13:05:10 +01:00
parent 870c70aefa
commit 9ee2e003bf
12 changed files with 201 additions and 14 deletions
+24
View File
@@ -0,0 +1,24 @@
# Notification web run links
Run-attention/completion notifications and stage hooks now use
`PIPELINES_WEB_PUBLIC_URL` to build `<origin>/runs/<id>` links to the authenticated
web app. This is an operator-controlled origin, not an inferred API/ntfy host.
Credentials, queries, fragments and subpaths are rejected; invalid configuration
omits the link with a diagnostic. Existing Android-only deployments without this
setting retain their original scheme. Already-sent notifications are unchanged.
Native setup saves its advertised web address by default and retains explicit
origin overrides across reinstalls. Custom service generation preserves the
variable; Docker Compose forwards it. Authenticated proxy login already preserves
the target run and is covered by a new isolated HTTP regression.
Verified: full Go race suite, build/vet, installer unit tests, stage-hook web links
(including attachments), waiting/failed run web payloads, URL validation and
service-environment retention on both renderers. The isolated real proxy test
checks unauthenticated gating, wrong-password rejection and return to the exact
run after login. No production notification was sent to test this fix.
Code is not deployed/configured on the live server: the operator's phone-facing
web URL is still needed, and a backend update must wait for safe deployment.
Dummy run #22 completed with its old `pipelines://run/22` notification acknowledged
by ntfy; that verifies publishing, not reception or correct web navigation.
+29 -3
View File
@@ -74,9 +74,35 @@ artifacts=markdown,files
Independently of any `notify` block, the server publishes one run-level
notification to the `system` destination when a run needs a person: when it enters
`waiting` (a human stage asked for a decision) and when it fails. Nothing else
notifies — queued, running, succeeded, canceled and interrupted runs are silent.
The payload names the run and its pipeline and carries a `click` action
`pipelines://run/<id>` that opens that run in the Android app.
notifies by default — queued, running, canceled and interrupted runs are silent.
Runs explicitly started with notifications **on** also notify on success.
The payload names the run and its pipeline. Run notifications and stage hooks
use the configured web run link described below.
### Open notifications in the web app
Set `PIPELINES_WEB_PUBLIC_URL` on the **Pipelines server** to the authenticated web
proxy's phone-reachable origin, for example `https://pipelines.example.com` or
`http://192.168.1.20:8082` on a trusted LAN. Notifications then carry
`https://pipelines.example.com/runs/<id>`, opening that exact run in the browser
(or installed web app). The existing sign-in gate remains; after login the web
proxy returns to the requested run.
Use the address you actually open on the phone, not localhost, the API port, or
the ntfy address. No credentials, query, fragment or subpath are allowed. This
does not expose a port or add authentication to the underlying control API.
An invalid configured origin omits the click action and logs a configuration
warning rather than leaking credentials. Without this setting, existing
Android-only installations retain `pipelines://run/<id>` for compatibility.
Native installs save a default from the web proxy's advertised LAN address/port.
Override it with `PIPELINES_WEB_PUBLIC_URL=https://pipelines.example.com ./install`;
reinstalls preserve that saved choice unless overridden. Custom services set the
environment variable in their service definition; `pipelines service enable`
preserves it. Docker Compose accepts the same variable, pointing to a separately
reachable authenticated web proxy. Apply service changes only after active work
is finished. Already-delivered notifications keep their original click target;
verify a new notification after configuration is installed.
A genuine event notifies once: a run that stays `waiting` is not republished on a
read or restart, and a stage `notify` policy that already covers the same event