Route native service commands and configure fresh authoring role

Select native installs only via explicit PIPELINES_PREFIX or the matching owned prefix/bin/pipelines executable. Route enable/status/disable to the existing native supervisor; validate registration ownership, label and command, keep preview read-only, and disable login registration before stopping. Never fall back to a standalone service for an invalid explicit prefix.

Fresh native installs explicitly enable authoring, while reinstalls preserve false or missing legacy role settings. Add explicit --allow-authoring/--no-authoring overrides and pass the server flag only for manifest true. Print a copyable native enable command and update installation help/docs. No Docker configuration changes.

Checks: 54 mocked native installer/lifecycle tests; 8 entrypoint tests; offline Go installation/CLI tests and vet; gofmt clean; shell syntax and diff checks. No live install, restart, deployment, permission/config changes, or native Linux verification.
This commit is contained in:
2026-10-20 21:41:05 +01:00
parent d58b3f49fc
commit bb32383bbe
11 changed files with 508 additions and 18 deletions
+31 -10
View File
@@ -49,6 +49,19 @@ a private 0600 file there with `password` and a cookie-signing `secret`; read it
non-private existing file stops setup instead of resetting credentials. The
service never inherits the test-only `PIPELINES_WEB_AUTH=disabled` bypass.
A **fresh** native installation records `allow_authoring: true` in its manifest
and explicitly starts Go with `-allow-authoring`, so the single-user web workflow
can create and publish pipelines. `./install --no-authoring` instead selects an
execution-only role. Reinstalls preserve the recorded role; an older manifest
without this field stays execution-only. To deliberately enable authoring for
such an installation, use `./install --allow-authoring`. The installer prints the
selected role. This is a server permission, not a browser authentication bypass;
the authenticated proxy and loopback API defaults still apply. Docker's role and
startup flags are unchanged.
Role changes apply on the supervisor's next start. A reinstall does not forcibly
restart an already-running supervisor; if reconfiguring an active installation,
use its `pipelines restart` only when no work is active.
Setup resolves `PIPELINES_PREFIX` or defaults to `~/.local/share/pipelines`,
creates `bin/`, `lib/`, `data/`, `logs/` and `secrets/` (`secrets` and `data` at
0700), copies `scripts/manage.py` to `<prefix>/lib/manage.py`, builds exactly
@@ -107,12 +120,17 @@ present but its volumes cannot be inspected (for example a stopped daemon), setu
fails clearly instead of silently skipping migration, so an existing Docker
database is never shadowed by an empty native start.
Setup already starts it and enables login autostart. Optional CLI management
requires the prefix selector (the executable path alone does not select it):
Setup already starts it and enables login autostart, and prints a copyable
`<prefix>/bin/pipelines service enable` command. That installed executable safely
selects its own native manifest; an unrelated CLI never guesses a default prefix.
Optional terminal use needs only the installed binary on PATH:
```sh
export PIPELINES_PREFIX="$HOME/.local/share/pipelines"
export PATH="$PIPELINES_PREFIX/bin:$PATH"
export PATH="$HOME/.local/share/pipelines/bin:$PATH"
pipelines service enable # idempotently enable/start this native install
pipelines service enable --print # read-only existing definition preview
pipelines service status # login registration state; no credentials
pipelines service disable # disable login autostart AND stop its supervisor
pipelines doctor
# pipelines stop / start / restart / logs
```
@@ -130,9 +148,12 @@ first; the migration still needs its volumes and image). ntfy runs from
`$XDG_CONFIG_HOME/systemd/user/net.a-wan.pipelines.service` (default `~/.config`)
and runs `systemctl --user daemon-reload` then `enable --now
net.a-wan.pipelines.service`. This is login autostart, not boot-without-login;
Linux lingering is an explicit administrator decision. Do **not** run the separate
`pipelines service enable` for this installation: it configures a standalone
developer server, not the manifest database/ntfy/web supervisor. Logs are in
Linux lingering is an explicit administrator decision. `pipelines service` uses
this existing supervisor and database, never a second developer server. An
explicit `PIPELINES_PREFIX` can also select it from another CLI. Native service
commands reject standalone `--db`/`--addr` options; use installer flags to change
the manifest. Definitions belonging to a developer service or another native
prefix are never overwritten by these commands. Logs are in
`<prefix>/logs/{server,ntfy,web,supervisor}.log` (Linux supervisor output also goes
to `journalctl --user -u net.a-wan.pipelines.service`).
@@ -370,8 +391,8 @@ Drafts use the OS user cache; `PIPELINES_DRAFT_DIR` overrides that location.
## Developer/legacy autostart (unsupported)
Stop any existing foreground or legacy server first, then explicitly configure
the OS user service:
For a standalone developer binary (not the CLI inside a native install), stop any
existing foreground or legacy server first, then explicitly configure the OS user service:
```sh
pipelines service enable
@@ -482,7 +503,7 @@ does not purge data.
The previous Python-supervised setup is retained only for explicit legacy use.
Set `PIPELINES_PREFIX` to its existing directory for its lifecycle commands;
no command infers that directory from an executable location. The old
legacy manifests are never inferred from an executable location. The old
`--system-command`, provisioning, and autostart installer flags have been removed.
To migrate, stop the old server first, install normal Go binaries, and start with