Remove ntfy: notifications go only through the app notification stream
Server: drop ntfy publishing (stage hooks, run outbox, chat attention, chat tool notify, auto-switch and schedule notices), the chat push outbox (its table is dropped at startup), ntfy status/endpoints and PIPELINES_NTFY_*. The app_notifications stream, subscribe/clear and kinds are unchanged. Notification settings keep run_finished/chat_needs_you/chat_reply_finished; ntfy_enabled is accepted and ignored and its stored row is never read. Stage type=ntfy is rejected: "ntfy stages were removed; notifications go to the Pipelines apps — use the stage notify hook". The notify hook remains. Installer: no ntfy build, accounts, config or supervisor child; manifest gets top-level "mode" (legacy ntfy.mode still read). Reinstall retires an old ntfy (safe PID-file stop, deletes binary, config, data dir, token, log, with a note in logs/install.log); uninstall cleans leftovers. App: ntfy settings section replaced by "Notification events"; texts updated. Docs: docs/ntfy.md folded into docs/notifications.md; install, docker, cli, author skill references updated; security review M1 marked resolved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-18
@@ -78,20 +78,15 @@ the sum of the per-run totals `inspect` shows. Only usage rows whose recorded
|
||||
step still exists are counted, so rows orphaned by an old history wipe are ignored
|
||||
(not deleted). `pipelines stats --json` exposes these aggregates.
|
||||
|
||||
Use `:status` on any TUI page to open server and ntfy information. Scroll with
|
||||
Use `:status` on any TUI page to open server information. Scroll with
|
||||
arrows or `j/k`, PgUp/PgDn; `r` refreshes and Esc closes without changing the page.
|
||||
`pipelines status [--json]` returns the same server data, including hostname,
|
||||
start/uptime, the connected server endpoint/port, active interface IPs, ntfy
|
||||
publishing health, public phone URL/topic/port and candidate URLs. It does not
|
||||
start services or send a notification. The ntfy health probe has a two-second
|
||||
deadline; it checks the publishing server, not phone reachability.
|
||||
start/uptime, the connected server endpoint/port, active interface IPs and
|
||||
candidate URLs. It does not start services or send a notification.
|
||||
|
||||
IPs belong to the **server computer or container**, not necessarily the client.
|
||||
Candidate IP/port combinations are not reachability checks: loopback bindings,
|
||||
firewalls, container port mapping and TLS can prevent access. ntfy candidates
|
||||
are only derived when a configured endpoint identifies this computer; remote
|
||||
ntfy hosts are not misrepresented as local. Publishing URLs and credentials are
|
||||
never returned. Missing public phone configuration is labeled explicitly.
|
||||
firewalls, container port mapping and TLS can prevent access.
|
||||
`pipelines service status` remains the separate OS autostart status command.
|
||||
|
||||
## Search
|
||||
@@ -334,7 +329,7 @@ Submitting activates included schedules, so review them before publishing.
|
||||
| Resume a run parked for a usage limit | `resume ID --yes --json` |
|
||||
| Default whole-run budget | `run-budget [USD\|off] --json` |
|
||||
| Connection and phone settings | `connection --json`, `ping --json` |
|
||||
| Server/ntfy status popup | `status --json` |
|
||||
| Server status popup | `status --json` |
|
||||
| Usage statistics/charts | `stats --json` |
|
||||
| Run-history retention | `retention report --keep N --json`, `retention apply --keep N --yes` |
|
||||
| Retire an unused pipeline | `archive NAME --yes`, `unarchive NAME`, `list --archived` |
|
||||
@@ -359,13 +354,12 @@ optional `kind` and `limit`) and returns a `search_results` response whose ranke
|
||||
and matched field. `list_runs` also returns all-history `usage`
|
||||
aggregates. `attention_acks` reads and `ack_attention` adds to the operator's
|
||||
shared in-app acknowledgements (dismissed Needs-you entries and chat read
|
||||
watermarks; see [ntfy.md](ntfy.md#clearing-notifications-across-devices)); other
|
||||
watermarks; see [notifications.md](notifications.md#clearing-notifications-across-devices)); other
|
||||
connections receive an `attention_acks_changed` push. `subscribe_notifications`
|
||||
(optional `after` cursor) streams the same notifications the server publishes to
|
||||
ntfy as `notification` pushes, `clear_notifications` (`ids`) clears them on every
|
||||
device, and `notifications_cleared` reports clears; `ntfy_enabled` in the
|
||||
notification settings turns the ntfy publish off without stopping the stream (see
|
||||
[ntfy.md](ntfy.md#app-notification-stream-no-ntfy-app-needed)).
|
||||
(optional `after` cursor) streams the operator's notifications as `notification`
|
||||
pushes, `clear_notifications` (`ids`) clears them on every device, and
|
||||
`notifications_cleared` reports clears (see
|
||||
[notifications.md](notifications.md#app-notification-stream-protocol)).
|
||||
|
||||
Every run summary (`list_runs` rows, `get_run`, subscribe snapshots and terminal
|
||||
`run_event` frames) carries `size_bytes`: bytes on disk for the run (artifact tree
|
||||
@@ -1176,8 +1170,6 @@ or that has no tools block never replays admitted tool work or invalid results.
|
||||
Budget failures always stop. Cleanup must be confirmed before another attempt.
|
||||
Existing explicit `retries=0` settings remain unchanged. The old 30-minute run deadline no longer truncates
|
||||
stage timeouts; the 30-step and five-visits-per-stage limits still apply.
|
||||
Native ntfy stages also accept `timeout` (default `1h`), but never automatically
|
||||
retry potentially delivered notifications and do not accept model budgets.
|
||||
|
||||
Pinned definitions contain the configured limits. Run transcripts retain limits,
|
||||
attempt counts and reported budget usage, also shown in the TUI's Evidence pane.
|
||||
|
||||
+50
-91
@@ -1,84 +1,72 @@
|
||||
# Pipeline server + ntfy in one Compose project (Android)
|
||||
# Pipeline server in a Compose project
|
||||
|
||||
## Complete installer (recommended for both services in Docker)
|
||||
## Complete installer (recommended for Docker)
|
||||
|
||||
Run `./install --docker` from an interactive terminal (Docker is the explicit
|
||||
`--docker`/`docker` mode; `./install.sh` remains a compatibility alias, and a bare
|
||||
`./install` now performs the native host installation). It handles Compose
|
||||
configuration, ntfy users/permissions/token, image build, container skill install,
|
||||
first-time container harness provider login (OpenCode by default; `./install
|
||||
--docker --harness pi` configures Pi and skips OpenCode login), startup, and an
|
||||
authenticated test notification. Choose your own provider in the configured
|
||||
configuration, image build, container skill install, first-time container
|
||||
harness provider login (OpenCode by default; `./install --docker --harness pi`
|
||||
configures Pi and skips OpenCode login), startup and a status check. Choose your
|
||||
own provider in the configured
|
||||
harness; signup/login credentials stay in the Docker volume, not your host
|
||||
account. Re-run to update while
|
||||
preserving `.env`, tokens, histories and volumes. Use `--relogin` to connect another
|
||||
provider. No fixed OpenCode Go login is required. Health/publishing checks do not
|
||||
prove model inference or phone reception.
|
||||
The phone-facing ntfy URL uses the detected LAN IP; both services bind `0.0.0.0` by default.
|
||||
There are no networking questions. Advanced URL/bind/timezone flags remain optional.
|
||||
preserving `.env`, histories and volumes. Use `--relogin` to connect another
|
||||
provider. No fixed OpenCode Go login is required. Health checks do not prove
|
||||
model inference. The server binds `0.0.0.0` by default. There are no networking
|
||||
questions; `--timezone` and `--port` remain optional.
|
||||
|
||||
The steps below are for manual setup or a developer/legacy local Pipelines server
|
||||
with Docker ntfy; they are **not** the supported installation and are not needed when
|
||||
you use `./install`.
|
||||
Notifications reach the Pipelines apps through the server itself (browser
|
||||
notifications in the web app, the **Receive notifications in Pipelines**
|
||||
background service or the open app on Android, the app on iOS and macOS); see
|
||||
[Notifications](notifications.md). There is no ntfy service any more.
|
||||
|
||||
## Manual developer/legacy: local pipeline server, Docker ntfy
|
||||
Re-running `./install --docker` over an installation from before this change
|
||||
retires its ntfy: it removes the Compose project's `ntfy` container and
|
||||
`<project>_ntfy-data` volume (ntfy's caches and accounts, which nothing reads any
|
||||
more), `secrets/ntfy-token.txt` and the `NTFY_BASE_URL`/`NTFY_BIND_ADDRESS` lines
|
||||
in `.env`, and recreates the server with `--remove-orphans`. Running it again
|
||||
finds nothing left to remove. `./uninstall` removes any leftover ntfy container
|
||||
and volume too.
|
||||
|
||||
The steps below are for manual setup or a developer/legacy local Pipelines
|
||||
server; they are **not** the supported installation and are not needed when you
|
||||
use `./install`.
|
||||
|
||||
## Manual developer/legacy: local pipeline server
|
||||
|
||||
To reuse your host OpenCode login without container authentication (manual,
|
||||
developer/legacy use—not a supported installation):
|
||||
developer/legacy use, not a supported installation):
|
||||
|
||||
```sh
|
||||
docker compose up -d ntfy
|
||||
# Bootstrap ntfy users/token as described below, then:
|
||||
sh scripts/run-local-server.sh
|
||||
go run ./cmd/pipelines-tui -url ws://127.0.0.1:8080/connect
|
||||
```
|
||||
|
||||
Do not run `docker compose up -d` for this mode: that starts the pipeline container
|
||||
too. The local launcher uses the existing host database and OpenCode account,
|
||||
publishes via localhost:8090, and advertises `.env`'s `NTFY_BASE_URL` to the TUI.
|
||||
The top bar shows **ntfy**, the external server URL, and topic beside the pipeline
|
||||
server address on every page.
|
||||
No credentials are included in the public setup data. Stop any existing local
|
||||
pipeline server before launching another against the same database/port.
|
||||
The local launcher uses the existing host database and OpenCode account. Stop
|
||||
any existing local pipeline server before launching another against the same
|
||||
database/port.
|
||||
|
||||
`compose.yaml` runs two services: `pipelines` (Go server + OpenCode V2) and `ntfy`.
|
||||
The pipeline server publishes internally to `http://ntfy/pipelines`; Android connects
|
||||
to your host's LAN/VPN URL. No host OpenCode service or credential database is
|
||||
mounted. Separate volumes persist pipeline history, workspace files, OpenCode
|
||||
credentials/sessions, and ntfy data. Do not use `docker compose down -v` unless
|
||||
you intend to delete those volumes.
|
||||
|
||||
**Verification:** `docker compose build pipelines` completed, and
|
||||
`docker compose up -d ntfy` started ntfy. A local authenticated Markdown upload
|
||||
was accepted with a phone-facing attachment URL. The local server's WebSocket
|
||||
advertised the public URL/topic and accepted the notification test pipeline.
|
||||
Go race tests and vet passed. Pipeline-container startup/model authentication
|
||||
and Android delivery are still **not tested**. Existing host history is preserved;
|
||||
the local server was restarted with notification configuration. The image now
|
||||
also includes python3 so the installer regression suite can run inside the
|
||||
container; a real 40x16/80x24/120x36 terminal UI review remains an independent
|
||||
step.
|
||||
`compose.yaml` runs one service, `pipelines` (Go server + OpenCode V2). No host
|
||||
OpenCode service or credential database is mounted. Separate volumes persist
|
||||
pipeline history, workspace files and OpenCode credentials/sessions. Do not use
|
||||
`docker compose down -v` unless you intend to delete those volumes.
|
||||
|
||||
## 1. Local settings
|
||||
|
||||
Start Docker Desktop/Colima/your Docker daemon first. Choose the host address your
|
||||
phone can reach. Example (replace the LAN IP):
|
||||
Start Docker Desktop/Colima/your Docker daemon first.
|
||||
|
||||
```sh
|
||||
python3 scripts/configure-compose.py \
|
||||
--ntfy-url http://192.168.1.20:8090 \
|
||||
--bind-address 0.0.0.0
|
||||
python3 scripts/configure-compose.py
|
||||
docker compose config --quiet
|
||||
```
|
||||
|
||||
The helper detects the **host's timezone** and writes it to `.env`, so the Linux
|
||||
containers do not silently schedule in UTC. It refuses to overwrite `.env` or an
|
||||
existing token. If detection is unavailable, use `--timezone Europe/London` (or
|
||||
your actual IANA timezone). Rerun/edit settings if you move/change timezones.
|
||||
containers do not silently schedule in UTC. It refuses to overwrite `.env`. If
|
||||
detection is unavailable, use `--timezone Europe/London` (or your actual IANA
|
||||
timezone). Rerun/edit settings if you move/change timezones.
|
||||
|
||||
The helper creates an empty, protected token file for bootstrap; no notifications
|
||||
are sent until it is filled. `.env`, `secrets/`, and `data/` are git-ignored and
|
||||
excluded from image builds. The container publishes port **8080**; the default
|
||||
`.env`, `secrets/`, and `data/` are git-ignored and excluded from image builds. The container publishes port **8080**; the default
|
||||
host mapping is **8081**, bound to host `0.0.0.0`, avoiding the existing native
|
||||
server on 8080. Query the actual mapped port with
|
||||
`docker compose port pipelines 8080`. The unauthenticated pipeline WebSocket API
|
||||
@@ -86,32 +74,11 @@ shares that port, so expose it only on a trusted LAN/VPN and never to the public
|
||||
internet.
|
||||
|
||||
Use HTTP only on a trusted LAN or encrypted VPN. For public access, use HTTPS
|
||||
with a reverse proxy/VPN; configure the external URL in `NTFY_BASE_URL`. The
|
||||
container's attachment URLs use that external URL, not the internal service name.
|
||||
Both host port mappings default to `0.0.0.0`; firewall them appropriately. The
|
||||
Pipelines API has no authentication and must not be exposed to untrusted networks.
|
||||
with a reverse proxy/VPN. The host port mapping defaults to `0.0.0.0`; firewall
|
||||
it appropriately. The Pipelines API has no authentication and must not be
|
||||
exposed to untrusted networks.
|
||||
|
||||
## 2. Bootstrap ntfy users and token
|
||||
|
||||
```sh
|
||||
docker compose up -d ntfy
|
||||
docker compose exec ntfy ntfy user add pipeline-publisher
|
||||
docker compose exec ntfy ntfy access pipeline-publisher pipelines write-only
|
||||
docker compose exec ntfy ntfy user add phone-reader
|
||||
docker compose exec ntfy ntfy access phone-reader pipelines read-only
|
||||
docker compose exec -T ntfy ntfy token add pipeline-publisher | python3 scripts/save-ntfy-token.py
|
||||
```
|
||||
|
||||
User creation prompts for passwords. Keep `secrets/` mode **0700** on the host.
|
||||
The helper extracts only the raw token (the ntfy CLI includes prose in its response)
|
||||
and makes the final file readable inside the non-root pipeline container: local Compose
|
||||
file secrets are bind mounts and do not reliably remap uid/mode. Its private parent
|
||||
directory protects the source file from other host users. Do not commit tokens
|
||||
or paste them into a chat. Recreating/replacing the secret file requires restarting
|
||||
the pipeline container. The application accepts `_TOKEN_FILE` or `_TOKEN`, not
|
||||
both, and never puts the token in model prompts, outputs, or diagnostics.
|
||||
|
||||
## 3. Authenticate the harness, then start the server
|
||||
## 2. Authenticate the harness, then start the server
|
||||
|
||||
```sh
|
||||
python3 scripts/build_metadata.py # resolve releases and stamp revision/dirty identity
|
||||
@@ -151,18 +118,11 @@ bundled example pipelines, seeded once; an existing database is never changed.
|
||||
Open `:templates` and use **Submit template** to name/review/publish another copy,
|
||||
or **Customize** to edit it first. All bundled examples are manual-only.
|
||||
|
||||
## 4. Android
|
||||
## 3. Notifications
|
||||
|
||||
Install ntfy, add the custom server `http://192.168.1.20:8090` (or your HTTPS/VPN
|
||||
URL), sign in as `phone-reader`, and subscribe to **pipelines**. This is the single
|
||||
system-wide notification topic, shared by every pipeline. Grant notifications
|
||||
and background operation as required by your Android app/device. Outside your
|
||||
LAN, enable the VPN or use your HTTPS address. `localhost` on Android is the
|
||||
phone, not your server. No iOS/APNS upstream is needed for this Android setup.
|
||||
|
||||
Use the app to confirm a test notification and download an attachment before
|
||||
relying on unattended schedules. This phone/background-delivery check has **not
|
||||
been performed**. Attachments/messages expire after seven days in this config.
|
||||
Notifications come through the Pipelines apps, connected to this server; see
|
||||
[Notifications](notifications.md). If you subscribed to the old `pipelines`
|
||||
topic in the ntfy app, remove that subscription.
|
||||
|
||||
## Existing data and rebuilds
|
||||
|
||||
@@ -179,8 +139,7 @@ resolves the current releases, use `python3 scripts/build_metadata.py`. A plain
|
||||
The workspace volume does not automatically replace its existing source tree
|
||||
on image rebuild; back it up and update it explicitly if you need new source for
|
||||
Go verification. Do not delete it casually: it may contain user-created artifacts.
|
||||
`compose.yaml` still uses ntfy's `latest` tag; pin a tested version/digest before
|
||||
production. OpenCode and Pi are not fixed version pins: `./install` resolves the
|
||||
OpenCode and Pi are not fixed version pins: `./install` resolves the
|
||||
current supported OpenCode V2 release from the single documented complete
|
||||
`GET /repos/{owner}/{repo}/git/matching-refs/tags/v2` response — a complete bounded
|
||||
array with no page/per_page query and no `Link` pagination (never the moving
|
||||
|
||||
@@ -11,7 +11,7 @@ service or a guarantee that a model's answer is correct.
|
||||
Docker is optional with `./install --docker`.
|
||||
3. Open the web address reported by setup. For terminal use, put the installation's
|
||||
`bin` directory on PATH and run `pipelines` from your project directory.
|
||||
4. Setup also starts the authenticated web proxy, server, and ntfy and enables
|
||||
4. Setup also starts the authenticated web proxy and server and enables
|
||||
login startup. See [installation](install.md) for the private web credential
|
||||
location. The installed CLI's `pipelines service enable` / `service status`
|
||||
manage that same service; do not start another server manually.
|
||||
@@ -59,9 +59,7 @@ a new execution can repeat side effects. Never delete data/volumes to fix a run.
|
||||
|
||||
Browser alerts require the page to be open; closed-app web push is not supported.
|
||||
The Android app delivers notifications in the background over its own
|
||||
connection. ntfy is an optional fallback channel that works without the
|
||||
Pipelines Android app. Installation verifies publishing, not reception. Check
|
||||
device reception before relying on it. See [Notifications](notifications.md).
|
||||
connection. Check device reception before relying on it. See [Notifications](notifications.md).
|
||||
|
||||
## Known limits
|
||||
|
||||
|
||||
+69
-28
@@ -17,11 +17,10 @@ them, and it stops naming whatever is missing.
|
||||
|
||||
| Tool | Why |
|
||||
| --- | --- |
|
||||
| Go (version in `go.mod`, currently 1.27) | builds `pipelines-server`, `pipelines` and ntfy |
|
||||
| Go (version in `go.mod`, currently 1.27) | builds `pipelines-server` and `pipelines` |
|
||||
| Node.js 18+ | runs the authenticated web proxy (`web/serve.mjs`) |
|
||||
| Python 3.9+ | installer and the lifecycle manager (`manage.py`) |
|
||||
| git, curl | source checkout, updates, release lookup |
|
||||
| C compiler (`cc`, `clang` or `gcc`) | ntfy's SQLite driver is cgo (Xcode Command Line Tools on macOS) |
|
||||
| **Docker, running** | builds the Flutter web app and the APK |
|
||||
| OpenCode on `PATH` | required; default stage and chat harness (`curl -fsSL https://opencode.ai/install \| bash`) |
|
||||
| Pi, Claude Code, Codex | optional; set up after install with `pipelines harness setup <name>` |
|
||||
@@ -52,18 +51,69 @@ Linux needs `systemctl --user`. Other platforms are refused.
|
||||
6. Writes host harness profiles to `~/.config/pipelines/harnesses.json`. If no
|
||||
usable OpenCode default model is found, it opens the model picker in the
|
||||
terminal (or fails without a terminal; pass `--model`).
|
||||
7. Builds ntfy from its pinned Go module, writes its config and creates the
|
||||
`pipeline-publisher` and `phone-reader` accounts.
|
||||
8. Migrates data from an earlier Docker installation, if its volumes exist.
|
||||
7. Migrates data from an earlier Docker installation, if its volumes exist.
|
||||
8. Retires the ntfy server an older installation ran, if any (see
|
||||
[Reinstalling over an ntfy installation](#reinstalling-over-an-ntfy-installation)).
|
||||
9. Registers the login service, writes the manifest
|
||||
`<prefix>/pipelines-install.json`, saves `ws://127.0.0.1:<port>/connect` as
|
||||
the CLI default in `~/.config/pipelines/client.json`, and starts everything.
|
||||
the CLI default in `~/.config/pipelines/client.json`, and starts everything
|
||||
that is not already running. A running service keeps the previous build
|
||||
until `pipelines restart`.
|
||||
10. Retires the legacy standalone web agent `net.awan.pipelines.web` on macOS
|
||||
(stopped, plist renamed to `.disabled`), so only one web app is served.
|
||||
11. If `PIPELINES_WEB_PUBLIC_URL` is an `https://…ts.net` address, runs
|
||||
`tailscale serve --bg --https=<port> http://127.0.0.1:<web-port>`.
|
||||
12. Prints the browser URLs and the next step, setting up harnesses.
|
||||
|
||||
## Notifications
|
||||
|
||||
Pipelines sends notifications through its own server to the Pipelines apps;
|
||||
there is nothing to install or subscribe to:
|
||||
|
||||
- **Web app**: browser notifications, once allowed in the browser.
|
||||
- **Android**: the **Receive notifications in Pipelines** background service,
|
||||
or in the app while it is open.
|
||||
- **iOS and macOS**: in the app.
|
||||
|
||||
See [Notifications](notifications.md).
|
||||
|
||||
### Reinstalling over an ntfy installation
|
||||
|
||||
Installations from before this change ran an ntfy server beside Pipelines.
|
||||
`./install` retires it, once, after the new build is in place and before the
|
||||
new manifest is written (`Setup.retire_ntfy` in `scripts/setup-native.py`,
|
||||
using `retire_ntfy` in `scripts/manage.py`):
|
||||
|
||||
1. It records the paths it removes and the old ntfy version, from the old
|
||||
manifest, in `<prefix>/logs/install.log`. No credentials are written there.
|
||||
2. It stops the old ntfy process from `<prefix>/ntfy.pid`, but only while that
|
||||
PID's command line is still `<prefix>/bin/ntfy serve …`; any other PID is
|
||||
left alone and the stale PID file is removed.
|
||||
3. It deletes `<prefix>/bin/ntfy`, `<prefix>/ntfy.pid`, `<prefix>/logs/ntfy.log`,
|
||||
`<prefix>/secrets/publisher-token` and the whole `<prefix>/data/ntfy/`
|
||||
directory.
|
||||
|
||||
`<prefix>/data/ntfy/` is deleted rather than kept: it held only ntfy's
|
||||
configuration, its message and attachment caches, and its account database
|
||||
(`phone-reader`, `pipeline-publisher`), which nothing reads any more. Pipelines
|
||||
history lives in `<prefix>/data/pipelines.db` and is untouched.
|
||||
|
||||
The new manifest has a top-level `"mode": "native"` and no `ntfy`, `ntfy_port`,
|
||||
`topic`, `username` or `public_url` entries. Until that reinstall, a manifest
|
||||
with the older `ntfy.mode: "native"` marker is still treated as native.
|
||||
|
||||
`./install` does not restart a service that is already running, so the old
|
||||
server keeps running (without ntfy) until `pipelines restart`. The restart stops
|
||||
the old supervisor; the new one starts only the server and web proxy, and stops
|
||||
an ntfy that is somehow still running from the PID file under the same check.
|
||||
Running `./install` again finds nothing left to retire. On a phone, remove the
|
||||
old Pipelines subscription from the ntfy app.
|
||||
|
||||
Docker installations (`./install --docker`) retire ntfy the same way: the
|
||||
installer removes the old `ntfy` container and its `<project>_ntfy-data` volume,
|
||||
`secrets/ntfy-token.txt` and the `NTFY_*` lines in `.env`, and recreates the
|
||||
server with `--remove-orphans`.
|
||||
|
||||
## Set up harnesses
|
||||
|
||||
One command per harness, the same on native and Docker installations:
|
||||
@@ -90,7 +140,6 @@ one; it does not touch that binary.
|
||||
| --- | --- | --- |
|
||||
| Web proxy (sign-in, web app, `/updates/`) | port 8082, loopback + tailnet only | `--web-port`, `--web-host`, `--web-lan` |
|
||||
| Server API (no auth) | `127.0.0.1:8080` | `--port`, `--bind-address` |
|
||||
| ntfy | `:8090` | `--ntfy-port`, `--ntfy-url` |
|
||||
|
||||
Expose only the web proxy. It listens on loopback and this machine's Tailscale
|
||||
addresses unless you opt into the LAN; see
|
||||
@@ -131,8 +180,6 @@ From `arguments()` in `scripts/setup-native.py`:
|
||||
| `--web-host tailnet\|IP` | web proxy access: `tailnet` (default for new installs: loopback and Tailscale addresses only) or a literal IPv4 bind such as `0.0.0.0`; existing installs keep theirs and get a warning |
|
||||
| `--web-lan` | also accept plain-HTTP LAN connections; sign-in over them stays refused |
|
||||
| `--web-lan-plain-login` | allow sign-in over plain-HTTP LAN (unencrypted password and cookie; trusted networks only) |
|
||||
| `--ntfy-port N` | ntfy port (default 8090) |
|
||||
| `--ntfy-url URL` | ntfy address given to phones (default `http://<LAN IP>:<ntfy-port>`) |
|
||||
| `--timezone TZ` | override the detected timezone (fallback UTC) |
|
||||
| `--model PROVIDER/MODEL` | default model for new starters and missing OpenCode profile fields |
|
||||
| `--allow-authoring` | allow creating and publishing pipelines (fresh installs default to this) |
|
||||
@@ -166,7 +213,7 @@ This reset has no confirmation prompt. Do not use it merely to update the app.
|
||||
```sh
|
||||
./install --web # rebuild and install only the web app (Docker), then reload the page
|
||||
./install --apk # build the Android APK (Docker, slower) and offer it to phones
|
||||
./install --docker # server and ntfy in Docker Compose instead of native
|
||||
./install --docker # server in Docker Compose instead of native
|
||||
```
|
||||
|
||||
`./install --apk` builds a release APK for this installation's web address,
|
||||
@@ -252,11 +299,11 @@ another installation.
|
||||
|
||||
| Command | Effect |
|
||||
| --- | --- |
|
||||
| `pipelines start` | start server, web proxy and ntfy; print the startup report |
|
||||
| `pipelines stop` | stop all three; harness sessions keep running and the next start reattaches them (see below) |
|
||||
| `pipelines start` | start server and web proxy; print the startup report |
|
||||
| `pipelines stop` | stop both; harness sessions keep running and the next start reattaches them (see below) |
|
||||
| `pipelines restart` | stop then start, keeping data; chat turns and stage sessions continue |
|
||||
| `pipelines doctor` | startup report, health of server and ntfy, OpenCode API check (no inference) |
|
||||
| `pipelines status` | server, host and ntfy publishing health, from the running server |
|
||||
| `pipelines doctor` | startup report, server health, OpenCode API check (no inference) |
|
||||
| `pipelines status` | server and host health, from the running server |
|
||||
| `pipelines logs` | follow `logs/server.log` |
|
||||
| `pipelines update` | pull and reinstall the same way, then restart (see below) |
|
||||
| `pipelines uninstall [--purge] [--yes]` | remove the service and binaries; `--purge` also deletes data |
|
||||
@@ -310,7 +357,7 @@ endpoint and the Codex App Server are separate processes anyway.
|
||||
|
||||
The login service is `~/Library/LaunchAgents/net.a-wan.pipelines.plist` on
|
||||
macOS and `~/.config/systemd/user/net.a-wan.pipelines.service` on Linux. It
|
||||
runs `manage.py supervise`, which owns all three processes. This is login
|
||||
runs `manage.py supervise`, which owns the server and web proxy processes. This is login
|
||||
autostart, not boot-without-login.
|
||||
|
||||
## Where things live
|
||||
@@ -318,12 +365,10 @@ autostart, not boot-without-login.
|
||||
| Path | Contents |
|
||||
| --- | --- |
|
||||
| `<prefix>/pipelines-install.json` | manifest (ports, paths, install args, environment) |
|
||||
| `<prefix>/bin/` | `pipelines`, `pipelines-server`, `pipelines-claude-host`, `pipelines-codex-host`, `ntfy` |
|
||||
| `<prefix>/bin/` | `pipelines`, `pipelines-server`, `pipelines-claude-host`, `pipelines-codex-host` |
|
||||
| `<prefix>/data/pipelines.db` | SQLite database (definitions, runs, chats, settings) |
|
||||
| `<prefix>/data/artifacts/` | run artifacts and session exports |
|
||||
| `<prefix>/data/ntfy/` | ntfy config, cache and accounts |
|
||||
| `<prefix>/secrets/publisher-token` | ntfy publishing token |
|
||||
| `<prefix>/logs/` | `server.log`, `web.log`, `ntfy.log`, `supervisor.log` |
|
||||
| `<prefix>/logs/` | `server.log`, `web.log`, `supervisor.log`, `install.log` |
|
||||
| `~/.config/pipelines/web-auth.json` | web password and cookie secret (`PIPELINES_WEB_AUTH_FILE`) |
|
||||
| `~/.config/pipelines/harnesses.json` | harness profiles (`PIPELINES_HARNESS_CONFIG`) |
|
||||
| `~/.config/pipelines/client.json` | default server URL for the CLI/TUI |
|
||||
@@ -342,9 +387,6 @@ twice). Without a terminal, set `PIPELINES_WEB_PASSWORD`. It is stored in
|
||||
and reused unchanged on every reinstall. An invalid or non-private file stops
|
||||
the installer rather than being reset.
|
||||
|
||||
The same password is given to the ntfy `phone-reader` account when that account
|
||||
is first created; existing ntfy accounts keep their passwords.
|
||||
|
||||
After updating the installation, change the web sign-in password from the
|
||||
checkout with:
|
||||
|
||||
@@ -356,8 +398,7 @@ It prompts twice without echoing the password, requires at least eight
|
||||
characters, and writes the private password file atomically. The updated web
|
||||
proxy picks it up on the next request; no service restart is needed, and existing
|
||||
sessions and running tasks remain connected. SSH is supported with an interactive
|
||||
TTY. This changes the web/app sign-in password; the ntfy notification account's
|
||||
password is unchanged. `--prefix PATH` selects another installation, and
|
||||
TTY. This changes the web/app sign-in password. `--prefix PATH` selects another installation, and
|
||||
`PIPELINES_WEB_AUTH_FILE` selects an explicitly configured password file.
|
||||
|
||||
## Upgrading
|
||||
@@ -369,8 +410,8 @@ pipelines update
|
||||
`update` refuses while runs are executing (finish or cancel them first). It
|
||||
then runs `git pull --ff-only` in the checkout it was installed from (skipped
|
||||
when the branch has no upstream), re-runs `./install` with the recorded
|
||||
arguments, restarts, and prints the startup report. Data, passwords, ntfy
|
||||
accounts and the signing key are kept. If the installer fails, the previous
|
||||
arguments, restarts, and prints the startup report. Data, passwords and the signing key
|
||||
are kept. If the installer fails, the previous
|
||||
version keeps running.
|
||||
|
||||
Running `./install` again from the checkout does the same without the pull.
|
||||
@@ -403,8 +444,8 @@ per-user data directory (`XDG_DATA_HOME`, or Application Support on macOS).
|
||||
## Troubleshooting
|
||||
|
||||
- **"Docker is not running"**: start Docker Desktop (or the daemon) and rerun.
|
||||
- **Ports busy**: a Docker installation or an old server may hold 8080, 8082 or
|
||||
8090. Stop it, or choose other ports with the flags above.
|
||||
- **Ports busy**: a Docker installation or an old server may hold 8080 or 8082.
|
||||
Stop it, or choose other ports with the flags above.
|
||||
- **"No usable configured harness model"**: rerun `./install` in a terminal to
|
||||
pick models, or pass `--model PROVIDER/MODEL`.
|
||||
- **CLI talks to the wrong server**: `PIPELINES_URL` overrides the saved
|
||||
|
||||
+173
-43
@@ -1,29 +1,37 @@
|
||||
# Notifications
|
||||
|
||||
The server records every notification once and delivers it two ways:
|
||||
The server records every notification once, in its `app_notifications` table,
|
||||
and streams it over the app's own connection (`/connect`) to every signed-in
|
||||
Pipelines client, which posts it as a system notification:
|
||||
|
||||
1. **In the Pipelines app** (Android, and the web page while it is open), over
|
||||
the app's own connection. No ntfy app is needed.
|
||||
2. **ntfy** (optional fallback), for devices that still use the ntfy app.
|
||||
- **Web** (each tab and installed web app window): a browser `Notification`,
|
||||
while the page is open and the browser allows it. Closed-browser web push is
|
||||
not implemented.
|
||||
- **Android**: the **Receive notifications in Pipelines** background service
|
||||
(keeps its own connection, also with the app closed), or the in-app bridge
|
||||
while the app runs.
|
||||
- **iOS and macOS**: the in-app bridge while the app runs.
|
||||
|
||||
The same settings decide what is sent on both paths.
|
||||
No other app, server or account is involved. (Earlier versions also published
|
||||
to a self-hosted ntfy server; that was removed. See
|
||||
[Upgrading from ntfy](#upgrading-from-ntfy).)
|
||||
|
||||
## What notifies
|
||||
|
||||
| Event | When |
|
||||
| --- | --- |
|
||||
| Run needs your decision | a run reaches a human decision stage (runs not set to Silent) |
|
||||
| Run failed / succeeded | runs started with **Notify me** (`--notify on`), or every run when **Notify when any run ends** is on |
|
||||
| Stage hook | a stage's own `notify` block fires ([ntfy reference](ntfy.md)) |
|
||||
| Run failed / succeeded | runs started with **Notify me** (`--notify on`), or every run when **Notify when any run ends** is on; unexpected failures always |
|
||||
| Stage hook | a stage's own `notify` block fires ([below](#stage-notify-hooks)) |
|
||||
| Chat needs you | a chat asks a question or requests approval |
|
||||
| Chat replied | an assistant turn ends (off by default) |
|
||||
| Agent notification | a chat's agent calls its `notify` tool (always on; a turn that notified sends no separate "Chat replied") |
|
||||
| Schedule delayed / skipped | a scheduled run could not start on time (low priority) |
|
||||
|
||||
Each event notifies once, on every device signed in (each web tab or installed
|
||||
web app window, the Android app, the macOS app) and on ntfy. Opening the chat
|
||||
or run, tapping the notification, or dismissing it in the app or the Android
|
||||
notification shade clears it on every device, including the ntfy app for chat
|
||||
notifications (see [Clearing notifications across devices](ntfy.md#clearing-notifications-across-devices)).
|
||||
Each event notifies once, on every signed-in device. Opening the chat or run,
|
||||
tapping the notification, or dismissing it in the app or the Android
|
||||
notification shade clears it on every device (see
|
||||
[Clearing notifications across devices](#clearing-notifications-across-devices)).
|
||||
|
||||
Chat events do not need the chat to be open. When the last app or browser
|
||||
leaves a chat whose turn is still running, or which has an unanswered question
|
||||
@@ -61,48 +69,170 @@ In the app, **Settings**:
|
||||
- **Allow background delivery**: asks Android to exempt Pipelines from battery
|
||||
optimisation so delivery stays instant while the phone is idle. Grant it.
|
||||
|
||||
**Phone notifications** (stored on the server, shared by every device):
|
||||
**Notification events** (stored on the server, shared by every device):
|
||||
|
||||
| Setting | Default |
|
||||
| --- | --- |
|
||||
| Notify when any run ends (otherwise only runs started with **Notify me**) | off |
|
||||
| Chat needs your answer or approval | on |
|
||||
| Chat reply finished | off |
|
||||
| Also send to ntfy (for devices that still use the ntfy app) | on |
|
||||
| Setting | Key | Default | Effect |
|
||||
| --- | --- | --- | --- |
|
||||
| Notify when any run ends | `run_finished` | off | every **auto**-mode run that fails or succeeds notifies; otherwise only runs started with **Notify me** announce their end |
|
||||
| Chat needs your answer or approval | `chat_needs_you` | on | chat questions/forms and approval requests notify |
|
||||
| Chat reply finished | `chat_reply_finished` | off | each finished assistant turn notifies |
|
||||
|
||||
Turning **Also send to ntfy** off stops publishing to ntfy; the app still
|
||||
receives everything.
|
||||
They are stored in the server database (`server_settings`, keys `notify.*`) and
|
||||
survive restarts. Per-stage `notify` hooks are not affected by them. Over the
|
||||
websocket protocol, `{"type":"notification_settings"}` reads them and
|
||||
`{"type":"set_notification_settings","notification_settings":{"chat_reply_finished":true}}`
|
||||
changes any subset; both reply with type `notification_settings` carrying every
|
||||
key. Unknown keys and non-boolean values are refused with an `error` reply and
|
||||
nothing is written. The removed `ntfy_enabled` key is accepted and ignored, so an
|
||||
older app's switch does not fail; a stored `notify.ntfy_enabled` row is never
|
||||
read.
|
||||
|
||||
`run_finished` changed meaning once: it meant "auto runs announce success" and
|
||||
defaulted on. It is stored under `notify.any_run_ended`, so a value saved under
|
||||
the old meaning (`notify.run_finished`) is ignored.
|
||||
|
||||
Per run, choose **Notify me**, the default (auto), or **Silent** when starting
|
||||
it. From the CLI: `pipelines run … --notify on|auto|off`.
|
||||
|
||||
## The web app
|
||||
## Run notifications
|
||||
|
||||
The web page shows notifications only while it is open and the browser allows
|
||||
them. Closed-browser web push is not implemented.
|
||||
Independently of any `notify` block, the server records one run-level
|
||||
notification when a run needs a person or ends and was marked to notify:
|
||||
|
||||
## ntfy (optional)
|
||||
| Run notify mode | Enters `waiting` | Fails / succeeds |
|
||||
| --- | --- | --- |
|
||||
| **on** ("Notify me", `--notify on`) | `Run needs your decision` | `Run failed` / `Run succeeded` |
|
||||
| **auto** (default) | `Run needs your decision` | unexpected failure or interruption; success only when **Notify when any run ends** is on |
|
||||
| **off** ("Silent") | silent | silent |
|
||||
|
||||
`./install` builds and runs ntfy on port 8090 with a private `pipelines` topic.
|
||||
The installer prints the subscription details at the end, and
|
||||
`pipelines doctor` repeats them (`Phone server … · topic: pipelines ·
|
||||
username: phone-reader`).
|
||||
A deliberate route to `#failure` with its reason is an expected failure: it does
|
||||
not notify in auto mode. Queued, running and canceled runs are silent. The
|
||||
setting is read in the same transaction that records the run's final state.
|
||||
|
||||
To subscribe from the ntfy app:
|
||||
Run events go through a durable outbox (`run_notifications`): the event is
|
||||
queued with the run's state change and recorded on the app stream at once; a
|
||||
crash before it is recorded is recovered after a restart. A run that stays
|
||||
`waiting` is not announced again on a read or restart, and a stage `notify` hook
|
||||
that already covered the same event (`on=waiting`, or a failure hook)
|
||||
suppresses the run-level one, so one event means one notification. A
|
||||
notification problem is logged and never changes the run.
|
||||
|
||||
1. Add a server: the ntfy address (default `http://<LAN IP>:8090`, or the
|
||||
`--ntfy-url` you installed with). Off your home network, use a VPN such as
|
||||
Tailscale.
|
||||
2. Sign in as `phone-reader`. A freshly created account uses the web sign-in
|
||||
password; an account kept from an earlier install keeps its old password.
|
||||
3. Subscribe to the topic `pipelines`.
|
||||
A tap opens `pipelines://run/<id>` in the app (the web app opens the same run).
|
||||
|
||||
A tap opens `pipelines://run/<id>` or `pipelines://chat/<id>` in the Android
|
||||
app; the **Open in browser** action opens the same page on
|
||||
`PIPELINES_WEB_PUBLIC_URL`.
|
||||
## Stage notify hooks
|
||||
|
||||
Notifications already shown by the ntfy app cannot be retracted by the server;
|
||||
swipe them away there.
|
||||
Every stage can have an optional `notify` block:
|
||||
|
||||
See [ntfy reference](ntfy.md) for stage `notify` hooks, explicit ntfy stages,
|
||||
the app notification protocol and network troubleshooting.
|
||||
````markdown
|
||||
# stage compose
|
||||
|
||||
```notify
|
||||
on=success,failure
|
||||
open=*.md
|
||||
link=standup-link.txt
|
||||
```
|
||||
````
|
||||
|
||||
- `on` is `success`, `failure`, `waiting`, or a comma list. A failure is an
|
||||
execution error, the `error` outcome, or a route to `#failure`; any other
|
||||
completed stage is a success. It reports the stage's result, not the run's.
|
||||
- For a sequential workflow whose error routes go to `#failure`, add
|
||||
`on=failure` to intermediate stages and `on=success,failure` to the final
|
||||
stage: one notification on every normal terminal path, without progress
|
||||
alerts.
|
||||
- `open=<pattern>` attaches one file from the run's shared `public/` directory
|
||||
to the notification (with a short text preview) and makes a tap open it. The
|
||||
pattern is a relative glob without absolute paths, `..` or hidden segments;
|
||||
the most recently modified match wins. Without `open=`, exactly one regular
|
||||
file in `public/` is attached automatically; zero or several attach nothing.
|
||||
- `link=<pattern>` makes a tap open a URL the stage produced (for example a
|
||||
published doc): the matched `public/` file's first non-empty line must be an
|
||||
absolute http(s) URL without credentials or fragment. The run stays reachable
|
||||
from the notification's run action. A missing file or invalid URL keeps the
|
||||
usual tap target and is noted on the stage's notification receipt.
|
||||
- `artifacts=` and `destination=` lines from older definitions still parse but
|
||||
do nothing: they configured ntfy attachments and connections.
|
||||
|
||||
Hooks run after the stage completes and before the run's final status is saved.
|
||||
They are not a finalizer for cancellation, crashes or runtime limits, and loops
|
||||
can notify more than once. The receipt (recorded or not) appears in the stage's
|
||||
**Metadata**; it never changes routing.
|
||||
|
||||
The former `type=ntfy` delivery stage was removed. A definition that still uses
|
||||
it is refused by validation with: "ntfy stages were removed; notifications go
|
||||
to the Pipelines apps — use the stage notify hook".
|
||||
|
||||
## Clearing notifications across devices
|
||||
|
||||
The app's attention state is shared through the server: dismissing an entry or
|
||||
using **Clear all** in the Needs-you sheet, and opening a chat (which clears its
|
||||
**New** badge), clears it on every connected browser and phone at once, and on a
|
||||
disconnected device when it next connects. The protocol is
|
||||
`{"type":"attention_acks"}` (read the whole set) and
|
||||
`{"type":"ack_attention","attention_acks":{"dismissed":["42:Failed"],"chat_seen":{"ses_x":1730000000000}}}`
|
||||
(add to it). Both reply `attention_acks`, and every other connection receives an
|
||||
`attention_acks_changed` frame. Acknowledgements for deleted runs or sessions,
|
||||
or older than 30 days, are pruned.
|
||||
|
||||
Every client removes its system notification when the clear reaches it:
|
||||
|
||||
- **Web**: the page closes the browser `Notification` with that tag and tells
|
||||
the origin's other tabs to close theirs over a `BroadcastChannel`. A click
|
||||
sends `clear_notifications`. A browser *close* event is not reported back
|
||||
(browsers raise it for timeouts and same-tag replacements too).
|
||||
- **Android with Receive notifications in Pipelines**: the background service
|
||||
cancels it; a tap or a swipe sends `clear_notifications`.
|
||||
- **Android without the service, iOS and macOS** (the in-app bridge while the
|
||||
app runs): it is removed by its tag; a tap clears it. A swipe is not reported.
|
||||
|
||||
## App notification stream (protocol)
|
||||
|
||||
```text
|
||||
→ {"type":"subscribe_notifications","id":"1","after":"run:7:3:waiting"}
|
||||
← {"type":"notifications_subscribed","id":"1","notifications":[N...],"ids":["<cleared id>",...]}
|
||||
← {"type":"notification","notification":N} (push)
|
||||
← {"type":"notifications_cleared","ids":["run:7:3:waiting"]} (push)
|
||||
→ {"type":"clear_notifications","id":"2","ids":["run:7:3:waiting"]}
|
||||
← {"type":"notifications_cleared","id":"2","ids":[<ids it cleared>]}
|
||||
|
||||
N = {"id":"run:7:3:waiting","kind":"run_waiting","title":"Run needs your decision",
|
||||
"message":"Run #7 · release · waiting for a human decision at stage approve",
|
||||
"click":"pipelines://run/7","priority":3,"tags":[],
|
||||
"created_at":"2026-11-01T10:00:00Z","group":"run:7"}
|
||||
```
|
||||
|
||||
- `id` is stable: `run:<run>:<step>:<event>` (event `waiting`, `failed`,
|
||||
`succeeded`, or `success` for a mid-run stage hook),
|
||||
`chat:<session>:<form|permission|reply|notify|auto-switch>:<id>` or
|
||||
`schedule:<id>:<due>:<event>`. `kind` is one of `run_waiting`, `run_failed`,
|
||||
`run_succeeded`, `stage_failed`, `stage_succeeded`, `chat_question`,
|
||||
`chat_approval`, `chat_reply`, `chat_notify`, `schedule`. `group` is
|
||||
`run:<id>`, `chat:<id>` or `schedule:<id>`.
|
||||
- `priority` is 1–5 (3 default). Schedule notices and the Claude account
|
||||
auto-switch notice are 2; an agent's `notify` uses the tool's priority (`low`
|
||||
2, `default` 3, `high` 4).
|
||||
- A stage hook notification may carry `artifact` (the `open=` file) and
|
||||
`preview`; with a `link=` its `click` is the link and `run_click` the run.
|
||||
- The subscribe reply holds the active (uncleared) notifications newer than the
|
||||
`after` cursor, oldest first, at most 100; an empty, unknown or pruned cursor
|
||||
replays them all. Its `ids` lists notifications cleared within the 7-day
|
||||
retention (newest first, at most 500) so a reconnecting device can dismiss
|
||||
ones it still shows. Pushes follow in order; subscribing again replaces the
|
||||
subscription.
|
||||
- `clear_notifications` has the same effect as the matching `ack_attention`:
|
||||
`run_waiting` dismisses `<run>:Decision`, `run_failed`/`stage_failed`
|
||||
`<run>:Failed`, and a chat notification marks the chat seen (clearing its
|
||||
other notifications too).
|
||||
- Notifications are also cleared, with a push, by `ack_attention` from any
|
||||
client, by a run leaving `waiting`, by deleting a run, and by an answered or
|
||||
cancelled chat question or approval.
|
||||
|
||||
## Upgrading from ntfy
|
||||
|
||||
Installs made before the removal ran a bundled ntfy server on port 8090. The
|
||||
installer retires it on reinstall and `./uninstall` removes any leftover (see
|
||||
[Install](install.md)). Phones that subscribed in the ntfy app keep the old
|
||||
subscription but receive nothing further: remove the Pipelines server from the
|
||||
ntfy app, and turn on **Receive notifications in Pipelines** in the Android app
|
||||
instead. Old stored settings keep their meaning; the `ntfy_enabled` choice and
|
||||
the old chat push outbox (`chat_notifications`, dropped at startup) are ignored.
|
||||
|
||||
-415
@@ -1,415 +0,0 @@
|
||||
# Self-hosted ntfy delivery
|
||||
|
||||
For the user-facing overview (in-app Android delivery, settings, subscribing)
|
||||
see [Notifications](notifications.md). This page is the reference for stage
|
||||
hooks, the app notification protocol and ntfy itself.
|
||||
|
||||
Every stage can have an optional `notify` property block. Notifications go to
|
||||
your own ntfy instance and can attach Markdown and output files. It does not ask
|
||||
an LLM to handle credentials or run curl. The full Markdown remains in the run
|
||||
audit as well as the ntfy attachment. A separate HTML report viewer is not included.
|
||||
|
||||
## Per-stage notifications (recommended)
|
||||
|
||||
### One terminal-path alert without adding stages
|
||||
|
||||
For a sequential workflow such as `research → report`, where intermediate
|
||||
blocked/error routes go straight to `#failure`, add `on=failure` notification
|
||||
hooks to intermediate stages and `on=success,failure` to the final stage.
|
||||
Keep the graph and output contracts unchanged; omit `artifacts` for event-only
|
||||
alerts. This avoids intermediate success alerts while covering early stage
|
||||
errors and the final success/error result. Putting a hook only on the last stage
|
||||
misses earlier failures; putting success hooks on every stage sends progress alerts.
|
||||
|
||||
These are stage hooks, not a universal run-finalizer: they run before the final
|
||||
status is saved, and do not guarantee notifications for cancellation, crashes,
|
||||
persistence failures or runtime step/visit limits. Recovery routes and loops can
|
||||
notify before termination or more than once. An explicit native publisher stage
|
||||
is not necessary for ordinary completion alerts and cannot reliably consume the
|
||||
required `title`/`summary`/`markdown` after an upstream execution error.
|
||||
|
||||
The installed authoring skill includes this recipe and native-delivery details in
|
||||
`references/notifications.md`; authoring does not require a checkout of this project.
|
||||
|
||||
````markdown
|
||||
# stage compose
|
||||
|
||||
```notify
|
||||
on=success,failure
|
||||
artifacts=markdown,files
|
||||
```
|
||||
|
||||
...stage output, prompt, tools, edges, and configs...
|
||||
````
|
||||
|
||||
- `on` is `success`, `failure`, or `success,failure`. A failure is an execution
|
||||
error, the `error` outcome, or a route to `#failure`; any other completed stage
|
||||
is a success. This reports the stage's result, not the final run's result.
|
||||
- All notification hooks use one system-wide server-to-phone connection. Stages
|
||||
do not choose topics or addresses. Configure `PIPELINES_NTFY_URL` (publishing
|
||||
topic URL), `PIPELINES_NTFY_PUBLIC_URL` (phone-facing server base URL), and
|
||||
`PIPELINES_NTFY_TOKEN` or `PIPELINES_NTFY_TOKEN_FILE` once on the server.
|
||||
The topic is `pipelines` in the provided setup. No block means no per-stage
|
||||
notifications; a run that needs a person is still announced automatically (see
|
||||
below). Legacy `destination` lines remain parseable for immutable-history compatibility
|
||||
but no longer select a connection for notification hooks. Explicit native
|
||||
`type=ntfy` stages retain their separate destination configuration.
|
||||
- `artifacts=markdown` sends the string in `output.markdown` as `digest.md`.
|
||||
- `artifacts=files` sends paths listed in `output.artifacts`, e.g.
|
||||
`["reports/result.txt", "screenshots/chart.png"]`. Model stages with this policy
|
||||
are instructed to list files they actually created/modified. No workspace scan
|
||||
or file discovery occurs; an invalid model response may leave no artifact list.
|
||||
- Both artifact kinds can be selected. Each file gets a separate notification
|
||||
(ntfy supports one attachment per notification). If none were produced, an
|
||||
event-only notification is still sent, including on failure.
|
||||
- Files must be workspace-relative regular files, at most 1 MiB each and 10 files
|
||||
per stage. Traversal, absolute paths, symlinks, hidden paths, known database/key
|
||||
paths, `secrets/`, and `node_modules/` are rejected. These guards are not a
|
||||
content scanner/DLP system: only list files you intend to share.
|
||||
- Notifications have a 30-second total budget, with no automatic retries. Their
|
||||
receipts/failures appear in the selected run stage's **Metadata**, separately
|
||||
from output. They do not change routing or convert a successful stage into a
|
||||
failed run. A crash can leave a `sending` receipt with uncertain delivery;
|
||||
notifications are not replayed during recovery. Tool access follows the stage's
|
||||
declared tools; notification settings do not grant additional tools.
|
||||
|
||||
## Automatic run-attention notifications
|
||||
|
||||
Independently of any `notify` block, the server publishes one run-level
|
||||
notification to the `system` destination when a run needs a person or ends and
|
||||
was marked to notify. The run's notify mode decides:
|
||||
|
||||
| Run notify mode | Enters `waiting` | Fails / succeeds |
|
||||
| --- | --- | --- |
|
||||
| **on** ("Notify me" in the app, `--notify on` in the CLI) | `Run needs your decision` | `Run failed` / `Run succeeded` |
|
||||
| **auto** (default) | `Run needs your decision` | silent, unless **Notify when any run ends** is on |
|
||||
| **off** ("Silent") | silent | silent |
|
||||
|
||||
Queued, running, canceled and interrupted runs are always silent. The **Notify
|
||||
when any run ends** setting (`run_finished`, off by default) makes every auto
|
||||
run's end notify too; it is read in the same transaction that records the run's
|
||||
final state, so a change applies to runs finishing after it. A stage `notify`
|
||||
block is the pipeline's own opt-in and still publishes for an auto run; when it
|
||||
covers the same event the run-level alert is not sent again.
|
||||
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
|
||||
(`on=waiting`, or a failure hook) suppresses the run-level default, so one event
|
||||
means one notification. A failed delivery is logged, never fails the run, and is
|
||||
not retried. The Android app shows the same information in one attention surface
|
||||
ordered by importance — a run waiting for a decision, then a failed run, then a
|
||||
run that finished since the operator last looked — derived from the run events the
|
||||
server already pushes, so it needs no refresh and starts nothing.
|
||||
|
||||
## Tapping a notification
|
||||
|
||||
Run notifications (stage hooks and run-level waiting/failed/succeeded alerts)
|
||||
set the ntfy `Click` to the app deep link `pipelines://run/<id>`, so a tap on the
|
||||
phone opens the native Pipelines app at that run. When `PIPELINES_WEB_PUBLIC_URL`
|
||||
is set to a valid HTTP(S) origin (no credentials, path, query or fragment), each
|
||||
notification also gets one ntfy `view` action, **Open in browser**, pointing at
|
||||
`<web>/runs/<id>`. Without it, or with an invalid value, only the app link is
|
||||
sent. Queued run notifications derive both links from the run id at delivery,
|
||||
so rows queued by older servers (which stored a web URL) also open the app.
|
||||
|
||||
## Chats that need you
|
||||
|
||||
When a chat asks the operator something — an unresolved question/form or a
|
||||
permission (approval) request — the server publishes one notification to the
|
||||
`system` destination: title `<chat title> needs your answer` (or `... needs your
|
||||
approval` for permissions; `Chat` when the session has no title), the question or
|
||||
permission text as the body, `Click` `pipelines://chat/<session id>`, and the
|
||||
**Open in browser** action to `<web>/chat/<session id>` when
|
||||
`PIPELINES_WEB_PUBLIC_URL` is set. These are controlled by the **Chat needs your
|
||||
answer or approval** setting (`chat_needs_you`, on by default).
|
||||
|
||||
Finished replies notify only when **Chat reply finished**
|
||||
(`chat_reply_finished`) is turned on (off by default): when an assistant turn
|
||||
ends (the authoritative, non-intermediate step end), the server publishes
|
||||
`<chat title> replied` (`Chat replied` without a title) with the first ~200
|
||||
characters of the turn's final assistant text as the body, or `The agent
|
||||
finished its reply.` when no text was retained, plus the same click and browser
|
||||
action. Each turn notifies once: a repeated or replayed end with no turn
|
||||
observed in between, or a turn id already announced, publishes nothing, and
|
||||
reading history never publishes.
|
||||
|
||||
- Each form/request id notifies at most once per server process: duplicate
|
||||
events, reconnects and replays of a still-pending question are deduplicated in
|
||||
memory, and a form first seen already resolved or cancelled never notifies.
|
||||
The record is not persisted, so a request still pending across a server
|
||||
restart can notify once more.
|
||||
- The server only observes a chat while at least one client is subscribed to
|
||||
it, so questions raised while no client watches the session are not seen.
|
||||
- Publishing is asynchronous within the same 30-second budget, never blocks or
|
||||
fails chat handling, and failures are only logged. Nothing is sent when
|
||||
`PIPELINES_NTFY_URL` is not configured.
|
||||
|
||||
## Notification settings
|
||||
|
||||
Global, server-side switches choose which of these events are published.
|
||||
They are stored in the server database (`server_settings`), survive restarts and
|
||||
apply to every device subscribed to the topic. Per-stage `notify` hooks and
|
||||
explicit `type=ntfy` stages are not affected.
|
||||
|
||||
| Setting | Default | Effect |
|
||||
| --- | --- | --- |
|
||||
| `run_finished` — Notify when any run ends | off | every **auto**-mode run that fails or succeeds notifies; otherwise only runs started with **Notify me** (`on`) announce their end |
|
||||
| `chat_needs_you` — Chat needs your answer or approval | on | chat question/form and approval requests notify |
|
||||
| `chat_reply_finished` — Chat reply finished | off | each finished assistant turn in a chat notifies |
|
||||
| `ntfy_enabled` — Also send to ntfy | on | when off, nothing is published to ntfy; the app notification stream (below) still delivers every notification |
|
||||
|
||||
Change them in the app under **Settings → Phone notifications** (checkboxes; a
|
||||
refused change reverts and shows the server's reason). Over the websocket
|
||||
protocol, `{"type":"notification_settings"}` reads them and
|
||||
`{"type":"set_notification_settings","notification_settings":{"chat_reply_finished":true}}`
|
||||
changes any subset; both reply with type `notification_settings` carrying every
|
||||
key. Unknown keys and non-boolean values are refused with an `error`
|
||||
reply and nothing is written.
|
||||
|
||||
`run_finished` changed meaning: it once meant "auto runs announce success" and
|
||||
defaulted on. It is now stored under `notify.any_run_ended`, so a value saved
|
||||
under the old meaning (`notify.run_finished`) is ignored and every server starts
|
||||
from the new default (off).
|
||||
|
||||
## Clearing notifications across devices
|
||||
|
||||
The app's in-app attention state is shared through the server: dismissing an
|
||||
entry or using **Clear all** in the Needs-you sheet, and opening a chat (which
|
||||
clears its **New** badge), clears it on every connected browser and phone at
|
||||
once, and on a disconnected device when it next connects. The protocol is
|
||||
`{"type":"attention_acks"}` (read the whole set) and
|
||||
`{"type":"ack_attention","attention_acks":{"dismissed":["42:Failed"],"chat_seen":{"ses_x":1730000000000}}}`
|
||||
(add to it). Both reply `attention_acks`, and every other connection receives an
|
||||
`attention_acks_changed` frame with the change. Acknowledgements for deleted runs
|
||||
or sessions, or older than 30 days, are pruned.
|
||||
|
||||
Every client removes its system notification when the clear reaches it:
|
||||
|
||||
- **Web** (every tab and installed web app window): the page closes the browser
|
||||
`Notification` with that tag, and tells the origin's other tabs to close
|
||||
theirs over a `BroadcastChannel`. A click on a browser notification sends
|
||||
`clear_notifications` for it. A browser *close* event is not reported back:
|
||||
browsers raise it for a notification daemon's timeout and for a same-tag
|
||||
replacement too, so treating it as a dismissal would clear the notification on
|
||||
every device seconds after it appeared.
|
||||
- **Android with Receive notifications in Pipelines**: the background service
|
||||
cancels it; a tap or a swipe (delete intent) sends `clear_notifications`.
|
||||
- **Android without the service, iOS and macOS** (the in-app
|
||||
`flutter_local_notifications` bridge while the app runs): it is cancelled /
|
||||
removed from the notification centre by its tag; a tap clears it. The plugin
|
||||
reports no dismissal, so a swipe there is not sent back.
|
||||
- **ntfy**: chat notifications (questions, approvals, replies and agent
|
||||
`notify`) are published with an ntfy sequence id derived from their app id
|
||||
(`X-Sequence-ID: pl-<24 hex of sha256(id)>`), and clearing one sends
|
||||
`PUT /<topic>/<sequence id>/clear`. ntfy (v2.15 or later; verified with
|
||||
v2.38.1) emits `message_clear` and its Android and web apps dismiss the
|
||||
notification. Run notifications carry no sequence id and stay in the ntfy app
|
||||
until swiped away. An older ntfy does not support clearing; a failed clear is
|
||||
only logged.
|
||||
|
||||
## App notification stream (no ntfy app needed)
|
||||
|
||||
Every notification the server publishes to ntfy — run waiting/failed/succeeded
|
||||
alerts from the run outbox, stage `notify` hook events, and chat
|
||||
question/approval/reply alerts — is first recorded in the `app_notifications`
|
||||
table (kept 7 days) and streamed over `/connect` to clients that subscribe, so
|
||||
the Pipelines app can post them itself. The same settings decide what is
|
||||
recorded, so the stream carries exactly the set ntfy gets, with the same title,
|
||||
message and `click` deep link. A stage hook with several attachments is one
|
||||
stream notification per step event; explicit `type=ntfy` stages are not
|
||||
streamed.
|
||||
|
||||
```text
|
||||
→ {"type":"subscribe_notifications","id":"1","after":"run:7:3:waiting"}
|
||||
← {"type":"notifications_subscribed","id":"1","notifications":[N...],"ids":["<cleared id>",...]}
|
||||
← {"type":"notification","notification":N} (push)
|
||||
← {"type":"notifications_cleared","ids":["run:7:3:waiting"]} (push)
|
||||
→ {"type":"clear_notifications","id":"2","ids":["run:7:3:waiting"]}
|
||||
← {"type":"notifications_cleared","id":"2","ids":[<ids it cleared>]}
|
||||
|
||||
N = {"id":"run:7:3:waiting","kind":"run_waiting","title":"Run needs your decision",
|
||||
"message":"Run #7 · release · waiting for a human decision at stage approve",
|
||||
"click":"pipelines://run/7","priority":3,"tags":[],
|
||||
"created_at":"2026-11-01T10:00:00Z","group":"run:7"}
|
||||
```
|
||||
|
||||
- `id` is stable: `run:<run>:<step>:<event>` (event `waiting`, `failed`,
|
||||
`succeeded`, or `success` for a mid-run stage hook) or
|
||||
`chat:<session>:<form|permission|reply|notify>:<id>`. `kind` is one of `run_waiting`,
|
||||
`run_failed`, `run_succeeded`, `stage_failed`, `stage_succeeded`,
|
||||
`chat_question`, `chat_approval`, `chat_reply`, `chat_notify`. `group` is `run:<id>` or
|
||||
`chat:<id>`. `priority` is 3 and `tags` empty, matching what ntfy receives,
|
||||
except `chat_notify`: an agent's `notify` tool call, whose priority is the
|
||||
tool's (`low` 2, `default` 3, `high` 4). Every subscribed client receives it,
|
||||
whichever chat it shows; each posts it as a system notification, so an
|
||||
agent's notify reaches the operator without ntfy. A turn that sent one does
|
||||
not also send its `chat_reply`.
|
||||
- The subscribe reply holds the active (uncleared) notifications newer than the
|
||||
`after` cursor (the last id the client holds), oldest first, at most 100;
|
||||
an empty, unknown or pruned cursor replays them all. Its `ids` lists
|
||||
notifications cleared within the 7 days (newest first, at most 500) so a
|
||||
reconnecting device can dismiss ones it still shows. Pushes follow in order;
|
||||
subscribing again replaces the subscription.
|
||||
- `clear_notifications` (the app's dismiss or tap) has the same effect as the
|
||||
matching `ack_attention`: `run_waiting` dismisses `<run>:Decision`,
|
||||
`run_failed`/`stage_failed` `<run>:Failed`, and a chat notification marks the
|
||||
chat seen (clearing its other notifications too). Other subscribers receive
|
||||
`notifications_cleared`; connections receive `attention_acks_changed`.
|
||||
- Notifications are also cleared, with a push, by `ack_attention` from any
|
||||
client, by a run leaving `waiting` (its waiting notifications), by deleting a
|
||||
run, and by an answered or cancelled chat question or approval.
|
||||
|
||||
## Explicit delivery stage (optional)
|
||||
|
||||
The preceding stage must output three nonempty UTF-8 strings: `title`, `summary`,
|
||||
and `markdown`. Title/summary must be single-line (256/2048 byte limits); Markdown
|
||||
is limited to 1 MiB. Native delivery stages do not accept model prompts/tools or
|
||||
inline credentials. They require `destination` and a `success` edge:
|
||||
|
||||
````markdown
|
||||
# stage notify
|
||||
|
||||
```configs
|
||||
type=ntfy
|
||||
destination=system
|
||||
```
|
||||
|
||||
```edges
|
||||
success -> #success
|
||||
error -> #failure
|
||||
```
|
||||
````
|
||||
|
||||
Configure the **pipeline server process** outside the pipeline file:
|
||||
|
||||
```sh
|
||||
export PIPELINES_NTFY_URL='https://ntfy.your-domain.example/pipelines'
|
||||
# Set PIPELINES_NTFY_TOKEN_FILE to the existing publishing token file.
|
||||
go run ./cmd/pipelines-server
|
||||
```
|
||||
|
||||
The URL includes one topic, without credentials, query parameters, or a fragment.
|
||||
`destination=system` uses the same connection as hooks. Other destinations use
|
||||
the named pattern: `destination=reports` reads
|
||||
`PIPELINES_NTFY_REPORTS_URL` and `PIPELINES_NTFY_REPORTS_TOKEN` (or `_TOKEN_FILE`
|
||||
pointing to a secret file). Set only one token source. Destination names
|
||||
use lowercase letters, digits, and underscores. A token is optional only when
|
||||
the configured server permits anonymous publishing; private deployments need it.
|
||||
Never put tokens in a prompt, committed file, or chat. Environment credentials
|
||||
are inherited by subprocesses: do not grant untrusted stages shell/code-execution
|
||||
access. Prefer a dedicated publishing user with write-only access to this topic.
|
||||
|
||||
## Local server
|
||||
|
||||
The root `compose.yaml` runs **both the pipeline server and ntfy** with persistent
|
||||
volumes, internal service networking, and a private topic. See the
|
||||
[Docker + Android setup](docker.md) for bootstrap, credentials, and timezone
|
||||
detection. The previous ntfy-only Compose file has been replaced. Isolated real
|
||||
Docker health and publishing checks have passed; phone reception and the user's
|
||||
remote Tailscale connectivity remain **not tested** locally.
|
||||
|
||||
Use a TLS reverse proxy or a private VPN (e.g. Tailscale). A phone cannot reach
|
||||
your computer's `127.0.0.1`; that address is only for local publishing/proxying.
|
||||
To bind the container to a particular LAN/VPN interface, explicitly set
|
||||
`NTFY_BIND_ADDRESS` to that interface IP. Do not expose an unauthenticated server,
|
||||
or send access tokens over public plain HTTP. Set `NTFY_BASE_URL` to the same
|
||||
address your phone uses so attachment URLs resolve correctly. If the pipeline
|
||||
server is another container, localhost is that container, not the ntfy host.
|
||||
|
||||
## Phone
|
||||
|
||||
### Tailscale address times out while LAN works
|
||||
|
||||
Use `http://<server-Tailscale-IP>:8090`, not port 80; enable Tailscale on both the
|
||||
server and phone. The default Compose mapping binds ntfy to `0.0.0.0:8090`.
|
||||
Binding to all interfaces does not bypass tailnet grants/ACLs, host firewalls,
|
||||
or Docker forwarding rules. A timeout alone cannot identify which is blocking.
|
||||
Do not disable firewalls or publicly forward this port as a workaround.
|
||||
|
||||
On the server, these are read-only diagnostics (the remote checks are not tested
|
||||
from this development machine):
|
||||
|
||||
```sh
|
||||
tailscale status
|
||||
docker compose port ntfy 80
|
||||
curl --connect-timeout 5 http://127.0.0.1:8090/v1/health
|
||||
curl --connect-timeout 5 "http://$(tailscale ip -4):8090/v1/health"
|
||||
```
|
||||
|
||||
If the host health checks succeed but the phone times out, check that the phone
|
||||
is in the intended tailnet and that tailnet access rules/firewalls allow this
|
||||
phone to reach server TCP 8090. Once reachable, log in as `phone-reader` for the
|
||||
Tailscale server entry, separately from the LAN entry. Set `NTFY_BASE_URL` to a
|
||||
phone-reachable address if attachment URLs currently point to a LAN-only address;
|
||||
that setting is not a substitute for fixing a TCP timeout.
|
||||
|
||||
Install the ntfy app, add your own server, authenticate with the reader account,
|
||||
and subscribe to `pipelines`. Ensure notifications and required background operation
|
||||
are allowed. Outside your home network, both topic subscriptions and attachment
|
||||
downloads need access to your server through VPN or public HTTPS.
|
||||
|
||||
For **iOS instant notifications**, ntfy's current documentation requires
|
||||
`NTFY_UPSTREAM_BASE_URL=https://ntfy.sh` (or an APNS-connected upstream with a
|
||||
custom app). The upstream sends wake-up requests; message content is fetched
|
||||
from your instance. This is not completely independent of third-party push
|
||||
infrastructure. Without upstream forwarding, delivery can be substantially
|
||||
delayed. Phone delivery/background behavior has **not been tested** here.
|
||||
|
||||
## Execution and failure behavior
|
||||
|
||||
- Publishing is bounded to 20 seconds and does not follow redirects.
|
||||
- No automatic publish retry: timeouts or malformed acknowledgments may mean the
|
||||
notification was delivered but its acknowledgment was lost. Inspect ntfy
|
||||
before retrying an ambiguous failure.
|
||||
- For the optional native `type=ntfy` stage, a confirmed response adds `delivery` metadata (destination name, message ID,
|
||||
attachment URL, filename) to the existing output. Failures take the error route
|
||||
and are recorded in normal run/step audits, without remote response bodies or
|
||||
credentials in diagnostics.
|
||||
- Repeating the same run request key does not publish again. A new run or a graph
|
||||
loop visiting delivery again can send another notification; content-level
|
||||
"only new items" deduplication is not yet implemented. For the initial digest,
|
||||
keep notification last with no feedback edge.
|
||||
- Markdown reports remain available in pipeline run history even after ntfy expires its
|
||||
attachment. Configure ntfy retention for your needs; its attachment directory
|
||||
must be dedicated to ntfy, not shared with other files.
|
||||
|
||||
File-attachment bytes are stored by ntfy, not permanently archived in SQLite;
|
||||
run metadata stores the delivered filename/URL, and workspace files may later
|
||||
change. Download attachments before your ntfy retention expires.
|
||||
|
||||
Bundled starters need no schedule setup. **Research and report** shows a
|
||||
`notify` hook on research failure; it only delivers once the system phone
|
||||
connection is configured. Add a
|
||||
`notify` block to the stages of your own workflow the same way. Adding a schedule activates it on publication,
|
||||
so review it explicitly rather than copying a scheduled niche example.
|
||||
|
||||
References: [publishing](https://docs.ntfy.sh/publish/),
|
||||
[server configuration](https://docs.ntfy.sh/config/),
|
||||
[iOS self-hosting](https://docs.ntfy.sh/config/#ios-instant-notifications).
|
||||
@@ -245,7 +245,7 @@ so a Docker-era profile is not left Docker-linked. It never installs, upgrades o
|
||||
downloads a harness. Container and host credentials and accounts remain independent and
|
||||
are reused on reinstall/reconfigure. `./install` installs natively by default
|
||||
(`--native` is equivalent); explicit `./install --docker` selects the Docker
|
||||
server + ntfy installation.
|
||||
server installation.
|
||||
Fresh setup accepts `./install --docker --harness pi` to skip OpenCode
|
||||
login. Existing setup can configure either harness independently. Pi setup does
|
||||
not run a generation check; `provider-check --harness pi --model PROVIDER/MODEL`
|
||||
|
||||
+24
-19
@@ -39,14 +39,10 @@ crafted link to a file the attacker has placed in the user's home directory.
|
||||
> issue can contain instructions that an agent follows ("prompt injection").
|
||||
> Agents with shell access can then leak your secrets or change files. Prefer
|
||||
> the "ask" permission modes, and give pipeline stages only the tools they need.
|
||||
> - **The notification server (ntfy) is on your local network.** It listens on
|
||||
> every network interface over plain HTTP on port 8090, and the phone account
|
||||
> uses your web password by default. Only subscribe over a network you trust or
|
||||
> over Tailscale.
|
||||
> - **Agents can spend money.** Runs have step and time limits but no spending
|
||||
> cap unless you set one.
|
||||
> - **Install and update pull code from the internet.** The installer builds the
|
||||
> newest ntfy and OpenCode releases. `pipelines update` pulls this repository
|
||||
> newest OpenCode releases. `pipelines update` pulls this repository
|
||||
> and reinstalls without a signature check.
|
||||
>
|
||||
> What is protected by default: the server API is on loopback only and needs a
|
||||
@@ -64,13 +60,13 @@ crafted link to a file the attacker has placed in the user's home directory.
|
||||
| H2 | High | Web password = arbitrary code execution; step-up elevation is bypassed by agent permission modes | Depends on the password; reachable only from loopback/tailnet |
|
||||
| H3 | High | Agents run unsandboxed as the user with the server's environment and can read every Pipelines secret (cookie HMAC key, server token, update-signing key) | High once prompt injection reaches a shell-capable agent |
|
||||
| H4 | High | Pipeline stages get unrestricted shell by default (no `tools` block, or `shell` without a policy) | High for any pipeline that omits a shell policy |
|
||||
| M1 | Medium | ntfy listens on all interfaces over HTTP; the phone account reuses the web password (sniffable, and guessable outside the proxy's limiter) | High that the port is LAN-reachable |
|
||||
| M2 | Medium | Supply chain floats: newest OpenCode, Pi and ntfy resolved at install time; unpinned base images; unchecked SDK zip; `pipelines update` has no signature check | Low per event, wide impact |
|
||||
| M1 | Medium | **Resolved (ntfy removed).** ntfy listened on all interfaces over HTTP; the phone account reused the web password (sniffable, and guessable outside the proxy's limiter) | None: no ntfy port is installed |
|
||||
| M2 | Medium | Supply chain floats: newest OpenCode and Pi resolved at install time (ntfy no longer installed); unpinned base images; unchecked SDK zip; `pipelines update` has no signature check | Low per event, wide impact |
|
||||
| M3 | Medium | Docker mode (opt-in) exposes the unauthenticated API on 0.0.0.0 | Only with `--docker` |
|
||||
| M4 | Medium | `show_html` previews load remote images/CSS (exfil beacons) and allow links that escape the sandbox, including to the app's own origin | Medium |
|
||||
| M5 | Medium | No spending cap by default and no global concurrency cap | Medium |
|
||||
| M6 | Medium | Chat transcripts and notifications are not redacted | Medium |
|
||||
| L* | Low | Links open without confirmation; OSC 52 clipboard writes; ntfy click-link to any URL; `ws://` peers; TOCTOU in `/files`; debug-keystore APK signing; and more | |
|
||||
| L* | Low | Links open without confirmation; OSC 52 clipboard writes; notification `link=` to any URL; `ws://` peers; TOCTOU in `/files`; debug-keystore APK signing; and more | |
|
||||
|
||||
---
|
||||
|
||||
@@ -83,7 +79,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
|
||||
|
||||
```
|
||||
127.0.0.1:8080 # Go server API
|
||||
*:8090 # ntfy
|
||||
*:8090 # ntfy (removed since; see M1)
|
||||
*:8082 # web proxy (wildcard bind, filtered per connection)
|
||||
```
|
||||
|
||||
@@ -133,7 +129,15 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
|
||||
can reach the sign-in page.
|
||||
- **Mitigation:** restrict it with Tailscale ACLs. Mention this in the README.
|
||||
|
||||
#### M1. ntfy `:8090` on every interface, phone account = web password (Medium)
|
||||
#### M1. ntfy `:8090` on every interface, phone account = web password (Medium) — resolved
|
||||
|
||||
- **Resolution (2026-12-03):** ntfy was removed from Pipelines. Notifications
|
||||
reach every client through the server's own app notification stream over the
|
||||
authenticated `/connect` connection (see `docs/notifications.md`). The
|
||||
installer no longer builds, configures or starts ntfy, and creates no phone
|
||||
account; a reinstall stops and deletes an existing ntfy and its data, and
|
||||
`./uninstall` removes any leftover. Port 8090 is no longer opened. The
|
||||
original finding is kept below for the record.
|
||||
|
||||
- **Evidence:**
|
||||
- `scripts/setup-native.py:672`
|
||||
@@ -486,11 +490,12 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
|
||||
- **Mitigation:** confirm OSC 52 writes or put them behind a setting, and show
|
||||
the link target on hover.
|
||||
|
||||
#### P3. ntfy click links to arbitrary URLs (Low)
|
||||
#### P3. Notification `link=` targets to arbitrary URLs (Low)
|
||||
|
||||
- **Evidence:** `internal/server/notify_link.go:87-103` accepts any absolute
|
||||
http(s) `link=` written by the agent into the run's `public/` directory.
|
||||
- **Risk:** a phishing link delivered as a trusted notification.
|
||||
- **Risk:** a phishing link delivered as a trusted notification. (ntfy is gone;
|
||||
the same `link=` is now the app notification's tap target.)
|
||||
- **Mitigation:** restrict to the configured web origin, or route through an
|
||||
interstitial page.
|
||||
|
||||
@@ -498,6 +503,9 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
|
||||
|
||||
#### M2a. Harness and ntfy versions resolve to "newest" at install time (Medium)
|
||||
|
||||
- **Update:** ntfy is no longer installed, so its part of this finding is
|
||||
resolved; the harness part stands.
|
||||
|
||||
- **Evidence:**
|
||||
- `scripts/resolve-releases.py:1-27` picks the newest OpenCode v2 tag (GitHub
|
||||
API), then its GHCR digest, and the newest Pi version from npm.
|
||||
@@ -595,8 +603,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
|
||||
- No secrets on command lines or in service unit files: the launchd plist
|
||||
carries only `HOME` and `PATH`.
|
||||
- Inline `PIPELINES_NTFY_TOKEN` is refused (`internal/installation/service.go:224-225`).
|
||||
- **Docker ntfy token (Low):** world-readable inside a 0700 directory
|
||||
(`scripts/save-ntfy-token.py:16`, `mode=0o444`). Docker mode only.
|
||||
- ~~**Docker ntfy token (Low)**~~: resolved; ntfy and its token were removed.
|
||||
- **M6. No redaction of transcripts or notifications (Medium):**
|
||||
- Redaction exists only for failure evidence (`internal/stage/diagnostics.go:55-70`)
|
||||
and turn-diff snapshots, which skip `.env*`, `*.pem`, `.ssh`, `.aws` and
|
||||
@@ -732,9 +739,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
|
||||
3. **Scrub the agent environment** (H3): drop `PIPELINES_*_FILE`,
|
||||
`PIPELINES_WEB_AUTH_FILE` and token variables from every harness and `!`
|
||||
child environment. *Small.*
|
||||
4. **ntfy off the LAN by default** (M1): bind loopback + tailnet (or serve it
|
||||
through `tailscale serve`), give the phone a random reader password or token,
|
||||
and make LAN ntfy an opt-in. *Small to medium.*
|
||||
4. ~~**ntfy off the LAN by default** (M1)~~: done by removing ntfy.
|
||||
5. **Docker safe defaults** (M3): bind 127.0.0.1, generate a token, and refuse a
|
||||
non-loopback bind without a token. *Small.*
|
||||
6. **Deny-list secret paths** in `/files`, `show_file` and listings (F2).
|
||||
@@ -744,7 +749,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
|
||||
8. **Block remote loads in HTML previews** (M4): inject a strict meta CSP and
|
||||
refuse same-origin links. *Small.*
|
||||
9. **Default a run budget and a global run cap** (M5). *Small to medium.*
|
||||
10. **Pin the supply chain** (M2): commit reviewed OpenCode, Pi and ntfy
|
||||
10. **Pin the supply chain** (M2): commit reviewed OpenCode and Pi
|
||||
versions and digests, pin base images by digest, verify the SDK zip's
|
||||
sha256, and verify signed tags in `pipelines update`. *Medium.*
|
||||
11. **Make elevation a real second factor** (H2): OS password via
|
||||
@@ -757,7 +762,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
|
||||
13. **Smaller items:**
|
||||
- Default "Remember me" off.
|
||||
- Disable mDNS when the LAN route is off.
|
||||
- Confirm external links, OSC 52 writes and ntfy click links.
|
||||
- Confirm external links, OSC 52 writes and notification `link=` targets.
|
||||
- Redact known secrets from transcripts.
|
||||
- Refuse `ws://` peers off the tailnet.
|
||||
- Use a real APK keystore.
|
||||
|
||||
Reference in New Issue
Block a user