feat(maestro): installer drops optional maestro-web systemd unit (NAP-249)
ci / rust (push) Failing after 7m18s
ci / rust (push) Failing after 7m18s
New helpers in maestro-installer::systemd: * `render_web_unit` — same shape as the daemon unit, ordered after `maestrod.service` so the proxy doesn't 502 on startup. * `user_web_unit_path` / `default_maestro_web_path` — under `~/.config/` and `~/.cargo/bin/` respectively. New wizard step (NAP-241 deferred this; phone-dogfood on 2026-05-26 surfaced it): after the daemon+systemd flow, optionally `cargo install maestro-web` and lay down `~/.config/systemd/user/maestro-web.service`. Re-runs detect the existing unit and refresh + restart silently. New flags: * `--no-web` — skip the prompt entirely (headless hosts). * `--web-exec-start <path>` — override the unit's ExecStart. Non-interactive (`--yes` / piped) skips the web step unless an existing unit is being refreshed — operators opt in by re-running once interactively, then subsequent unattended re-runs refresh automatically. docs/INSTALL.md updated with the new flow + flags. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+36
-12
@@ -51,26 +51,48 @@ Both binaries land in `~/.cargo/bin` — make sure that's on your `$PATH`.
|
||||
## Adding the browser UI (optional)
|
||||
|
||||
`maestro-web` is a separate binary that serves the SPA bundle and reverse-
|
||||
proxies API calls to a co-located `maestrod`. Install it where you want a
|
||||
browser UI:
|
||||
proxies API calls to a co-located `maestrod`.
|
||||
|
||||
**Interactive install (default path).** The wizard now offers it as an
|
||||
optional step right after the daemon flow:
|
||||
|
||||
```text
|
||||
Optional: install the browser UI (`maestro-web`)?
|
||||
Install maestro-web? [Y/n]
|
||||
```
|
||||
|
||||
Press `Y` and it `cargo install`s `maestro-web`, drops a
|
||||
`~/.config/systemd/user/maestro-web.service` unit (ordered after
|
||||
`maestrod.service`), reloads systemd, and offers to enable + start it. Re-runs
|
||||
of `./install.sh` detect the existing unit and refresh + restart silently.
|
||||
|
||||
Pass `--no-web` to skip the prompt entirely (headless hosts), or `--yes`
|
||||
with `--no-web` for non-interactive daemon-only installs. (Bare `--yes`
|
||||
without `--no-web` *skips* the web step too — opt in by re-running once
|
||||
interactively.)
|
||||
|
||||
**Frontend build prerequisite.** `maestro-web` embeds the SPA bundle at
|
||||
compile time, so before running the installer:
|
||||
|
||||
```sh
|
||||
pnpm -C web install --frozen-lockfile
|
||||
pnpm -C web build
|
||||
cargo install --git https://git.naps.pt/naps62/maestro --locked maestro-web
|
||||
```
|
||||
|
||||
…or, from a checkout, `just web` then `cargo install --path crates/maestro-web --locked`.
|
||||
Or `just web` from a workspace checkout.
|
||||
|
||||
It defaults to binding `127.0.0.1:8080` and proxying to `http://127.0.0.1:7070`
|
||||
(the daemon's default `bind_addr`). The `[web]` section of
|
||||
**Defaults.** `bind_addr = 127.0.0.1:8080`, `daemon_url =
|
||||
http://127.0.0.1:7070`. The `[web]` section of
|
||||
`~/.config/maestro/config.toml` overrides both — see
|
||||
`crates/maestro-web/README.md`. **Trust model:** anyone who can reach the bind
|
||||
address can use it; pick `127.0.0.1` for local-only, a WireGuard/LAN address
|
||||
for one-segment access, never a public IP without adding auth first.
|
||||
`crates/maestro-web/README.md`.
|
||||
|
||||
Headless hosts (servers, dev VMs) install only `maestrod`. Hosts where you
|
||||
want browser access install both.
|
||||
**Trust model.** Anyone who can reach the bind address can use it. Pick
|
||||
`127.0.0.1` for local-only, a WireGuard/LAN address for one-segment access,
|
||||
never a public IP without adding auth first.
|
||||
|
||||
Headless hosts (servers, dev VMs) skip the prompt with `--no-web`. Hosts
|
||||
where you want browser access answer yes — both binaries end up in
|
||||
`~/.cargo/bin`.
|
||||
|
||||
## Flags
|
||||
|
||||
@@ -83,7 +105,9 @@ want browser access install both.
|
||||
| `--exec-start <path>` | Override the systemd unit's `ExecStart` (default `~/.cargo/bin/maestrod`). |
|
||||
| `--no-systemd` | Skip the systemd step even if detected. |
|
||||
| `--no-configure` | Skip the `maestrod configure` step. |
|
||||
| `-y`, `--yes` | Non-interactive: install binaries + drop systemd unit + reload + enable, but **don't** auto-run `configure` or auto-start the unit (those need real config). |
|
||||
| `--no-web` | Skip the optional `maestro-web` install step. |
|
||||
| `--web-exec-start <path>` | Override the web unit's `ExecStart` (default `~/.cargo/bin/maestro-web`). |
|
||||
| `-y`, `--yes` | Non-interactive: install binaries + drop systemd unit + reload + enable, but **don't** auto-run `configure` or auto-start the unit (those need real config). Also skips the web step unless an existing `maestro-web.service` is being refreshed. |
|
||||
|
||||
## What the systemd unit looks like
|
||||
|
||||
|
||||
Reference in New Issue
Block a user