Installer + automatic self-signed trust + standalone layout fixes #10

Merged
gsadmin merged 6 commits from dev into main 2026-08-10 00:40:07 +00:00
Owner

Installer, self-signed trust, and standalone-layout work.

Add Device / install command

  • The command is a paste-ready one-liner shown in full (wraps, no truncation): Windows as powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "iwr … | iex" (Win+R or a prompt), unix as bash -c "curl … | sudo bash".
  • The Windows install scripts self-elevate: the work sits in an $install scriptblock; already-admin runs it in place (build pipelines), otherwise it re-launches elevated (UAC) from a temp .ps1 with -NoExit. No re-fetch, no -EncodedCommand (AV-friendly).

Self-signed trust — server-decided, automatic, not pinned

  • No operator checkbox anywhere. The agent always probes GET /api/enrollment/ca (accept-any, just that one call) at enrollment and every 6h: 200 → install the CA into the OS trust store so every later call validates normally; 404 → not self-signed, no-op.
  • The served script skips verification for its own download only when the request reached the self-signed listener directly. Removed ServerCaAutoInstall end to end (config key, --install-server-ca, ADMX, agent-MSI CAINSTALL) and SKIPTLSVERIFY from the agent MSI; TlsSkipVerify remains an escape hatch via CLI/registry/GPO.
  • All three self-signed certs (root, intermediate, leaf) now carry a serverAuth-only EKU — no client auth.

Standalone layout fixes (nothing scatters to C:\data)

  • Logs were silently dropped by a LOG_PATH vs LOG_DIRECTORY key mismatch — fixed, with LOG_PATH kept as an alias. Logs are named after the binary: ExecuteR-Server-<date>.log / ExecuteR-Agent-<date>.log.
  • New DATA_PATH pins the data root: TLS moves from data/db/tls → data/tls; NATS resolver from the absolute /data/resolver (→ C:\data) to ../data/resolver; NATS auth secrets under data/secrets.
  • NATS listeners are adaptable via setup --nats-bind, loopback by default. Docker app services (backend, webui, NATS WS) publish on 127.0.0.1 by default (BIND_EXTERNAL_ADDRESS); the bundled proxy binds publicly via its own PROXY_BIND_ADDRESS.

Installer

  • Both MSIs add their install dir to the system PATH (removed on uninstall), record InstallDir under HKLM\SOFTWARE\ExecuteR[\Server], and set ARPINSTALLLOCATION so Win32_Product.InstallLocation reports the directory.
  • Server MSI drops reverse-proxy / multi-instance wording; the TLS checkbox stays on the Network page with a plain description.
  • Clean uninstall still removes the managed self-signed chain (root/intermediate/leaf) from the Windows machine stores when PURGEDATA=1; the full wizard shows the Remove-page checkbox, and basic-UI/Settings uninstall keeps data by default (safe) with PURGEDATA=1 / ExecuteR-Server.exe purge to remove.

Wiki

  • Networking-and-TLS gained a full "how headers determine URL/scheme/port + trusted proxies" section and the automatic-trust model; Configuration/Agent-Deployment/Troubleshooting updated.

Verified locally: solution builds; Backend 103 / Agent 60 / Shared 89 tests pass; svelte-check clean; both MSIs build and their tables verify; standalone boot produces the correct on-disk layout and self-signed SANs. Dev commits used [skip ci]; this PR is where CI runs.

🤖 Generated with Claude Code

Installer, self-signed trust, and standalone-layout work. **Add Device / install command** - The command is a paste-ready one-liner shown in full (wraps, no truncation): Windows as `powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "iwr … | iex"` (Win+R or a prompt), unix as `bash -c "curl … | sudo bash"`. - The Windows install scripts **self-elevate**: the work sits in an `$install` scriptblock; already-admin runs it in place (build pipelines), otherwise it re-launches elevated (UAC) from a temp `.ps1` with `-NoExit`. No re-fetch, no `-EncodedCommand` (AV-friendly). **Self-signed trust — server-decided, automatic, not pinned** - No operator checkbox anywhere. The agent always probes `GET /api/enrollment/ca` (accept-any, just that one call) at enrollment and every 6h: **200 → install the CA** into the OS trust store so every later call validates normally; **404 → not self-signed, no-op**. - The served script skips verification for its own download only when the request reached the self-signed listener directly. Removed `ServerCaAutoInstall` end to end (config key, `--install-server-ca`, ADMX, agent-MSI `CAINSTALL`) and `SKIPTLSVERIFY` from the agent MSI; `TlsSkipVerify` remains an escape hatch via CLI/registry/GPO. - All three self-signed certs (root, intermediate, leaf) now carry a **serverAuth-only EKU** — no client auth. **Standalone layout fixes** (nothing scatters to `C:\data`) - Logs were silently dropped by a `LOG_PATH` vs `LOG_DIRECTORY` key mismatch — fixed, with `LOG_PATH` kept as an alias. Logs are named after the binary: `ExecuteR-Server-<date>.log` / `ExecuteR-Agent-<date>.log`. - New `DATA_PATH` pins the data root: TLS moves from `data/db/tls` → `data/tls`; NATS resolver from the absolute `/data/resolver` (→ `C:\data`) to `../data/resolver`; NATS auth secrets under `data/secrets`. - NATS listeners are adaptable via `setup --nats-bind`, loopback by default. Docker app services (backend, webui, NATS WS) publish on `127.0.0.1` by default (`BIND_EXTERNAL_ADDRESS`); the bundled proxy binds publicly via its own `PROXY_BIND_ADDRESS`. **Installer** - Both MSIs add their install dir to the system **PATH** (removed on uninstall), record `InstallDir` under `HKLM\SOFTWARE\ExecuteR[\Server]`, and set **`ARPINSTALLLOCATION`** so `Win32_Product.InstallLocation` reports the directory. - Server MSI drops reverse-proxy / multi-instance wording; the TLS checkbox stays on the Network page with a plain description. - Clean uninstall still removes the managed self-signed chain (root/intermediate/leaf) from the Windows machine stores when `PURGEDATA=1`; the full wizard shows the Remove-page checkbox, and basic-UI/Settings uninstall keeps data by default (safe) with `PURGEDATA=1` / `ExecuteR-Server.exe purge` to remove. **Wiki** - Networking-and-TLS gained a full "how headers determine URL/scheme/port + trusted proxies" section and the automatic-trust model; Configuration/Agent-Deployment/Troubleshooting updated. Verified locally: solution builds; Backend 103 / Agent 60 / Shared 89 tests pass; svelte-check clean; both MSIs build and their tables verify; standalone boot produces the correct on-disk layout and self-signed SANs. Dev commits used `[skip ci]`; this PR is where CI runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
gsadmin added 6 commits 2026-08-10 00:39:51 +00:00
The install command is shown in full (wraps, no truncation) and is
wrapped so it pastes anywhere: Windows as powershell.exe -NoProfile
-ExecutionPolicy Bypass -Command "..." (Win+R Run box or elevated
prompt), unix as bash -c "curl ... | sudo bash". CopyChip gains a wrap
mode. Screenshot refreshed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Windows install scripts self-elevate: the install work sits in an $install
scriptblock; already-admin runs it in place (build pipelines just install),
otherwise it is written to a temp .ps1 and re-launched elevated (UAC) with
-NoExit so the result stays visible. No re-fetch, no -EncodedCommand (which
trips AV/EDR), and #Requires -RunAsAdministrator is dropped so the check can
run. The elevated copy self-deletes via $PSCommandPath.

Self-signed chain (root, intermediate, leaf) now carries a
serverAuth-only EKU — this is not a client-auth PKI.

Standalone layout fixes so nothing scatters to the filesystem root:
- Logs never appeared: LogSettings read LOG_DIRECTORY but ServerCli wrote
  LOG_PATH. ServerCli now writes LOG_DIRECTORY, and LOG_PATH is accepted as
  an alias so a key mismatch can never silently disable file logging again.
- TLS cert dir derived from the DB directory, so it nested at data/db/tls.
  A new DATA_PATH pins the data root; TLS now lands at data/tls.
- NATS resolver dir was the absolute '/data/resolver' (C:\data on Windows).
  nats-auth init takes --resolver-dir; standalone passes ../data/resolver
  (relative to the sidecar's working dir, verified CWD-relative like
  store_dir). Container default stays /data/resolver for the volume mount.
- NATS auth secrets move under data/secrets, with the include path updated.

Logs are named after the running binary: ExecuteR-Server-<date>.log /
ExecuteR-Agent-<date>.log, tracking the executable if renamed.

Add Device modal hint kept clean (no elevation call-out).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The server MSI no longer mentions reverse proxies or running multiple
instances on one machine. The Self-Signed TLS checkbox stays on the
Network page with a plain description (HTTPS via a locally managed,
self-renewing chain that on-box browsers trust). The bind-address hint
reads "this machine only" instead of "local proxy only", and the setup
console output drops the extra-instances aside. Settings-persist note
kept.

No behavior change: the --name service option and the purge flow are
unchanged. Clean uninstall still removes the managed self-signed chain
(root, intermediate, leaf) from the Windows machine certificate stores
when PURGEDATA=1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Trust model (no operator toggle):
- The Add Device modal and Settings drop the "Trust self-signed" checkbox
  and the skipVerify plumbing; the command is a plain one-liner.
- The install endpoint decides trust from the server: it auto-installs the
  CA whenever self-signed TLS is on (the /api/enrollment/ca 200-vs-404 is the
  signal), and only skips download verification when the request arrived over
  the self-signed listener directly. Not pinned; a real edge cert validates
  on its own. Where TLS terminates follows the URL. Tests updated.

NATS bind address is adaptable, loopback by default:
- Standalone `setup --nats-bind` (default 127.0.0.1) sets the core/monitor/
  websocket listeners; open it when an edge proxy on another host must reach
  NATS directly. Docker: app services (backend, webui, NATS WS) publish on
  127.0.0.1 by default (BIND_EXTERNAL_ADDRESS); the bundled proxy binds
  publicly via its own PROXY_BIND_ADDRESS.

Installer:
- Both MSIs add their install dir to the system PATH (removed on uninstall)
  and record InstallDir under HKLM\SOFTWARE\ExecuteR[\Server] so the location
  can be found later. Both MSIs build clean and the tables verify.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Basic-UI uninstall now asks about data removal. The authored PurgeDlg only
shows in the full wizard (Programs and Features); the Settings app and /qb
run basic UI with no authored dialogs. A managed (DTF) custom action,
PromptPurgeData, shows a Yes/No message box there via MsiProcessMessage and
sets PURGEDATA=1 on Yes. It is sequenced only when UILevel < 5 (so the full
wizard never double-asks) and skipped when PURGEDATA is already set; a fully
silent uninstall (/qn) gets the default (keep) with no prompt.

Both MSIs also set ARPINSTALLLOCATION=[INSTALLFOLDER], so Win32_Product
.InstallLocation and the ARP InstallLocation registry value report the
install directory (alongside the HKLM\SOFTWARE\ExecuteR[\Server]\InstallDir
value added earlier).

New net472 DTF project src/Installer.Server.CustomActions produces the
.CA.dll, referenced by the server wixproj. Both MSIs build clean and the
CustomAction/Binary/sequence/ARP tables verify.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Remove the DTF (net472) managed custom action added for the basic-UI purge
prompt — keeping a .NET Framework targeting pack on build agents costs more
than it returns. Basic-UI/Settings uninstall now keeps data by default
(safe); the full wizard still shows the Remove-page checkbox, and
`msiexec /x ... PURGEDATA=1` or `ExecuteR-Server.exe purge` remove it.

Agent certificate trust is now automatic and server-decided, with no toggle:
- The agent always probes GET /api/enrollment/ca at enrollment (and every 6h)
  accepting any cert — it is only asking "are you self-signed?" and fetching
  public CA certs. 200 -> install the CA into the OS trust store, so every
  later call validates normally; 404 -> not self-signed, nothing to do.
- Removed ServerCaAutoInstall entirely: agent config key, `--install-server-ca`
  CLI flag, ADMX/ADML policy, the agent-MSI CAINSTALL property + registry
  component + connection-page checkbox, and the install script's CA markers.
- Also removed SKIPTLSVERIFY from the agent MSI. TlsSkipVerify stays as an
  accept-any escape hatch via `configure --skip-tls-verify`, registry or GPO.

The served install script still skips verification for its own download only
when the request reached the self-signed listener directly. Solution builds,
all tests pass (Backend 103 / Agent 60 / Shared 89), both MSIs build clean
and the tables verify.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gsadmin merged commit c87a8bf10a into main 2026-08-10 00:40:07 +00:00
Sign in to join this conversation.