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

6 Commits

Author SHA256 Message Date
gsadmin 19509b524a Drop net472 custom action; make agent CA trust fully automatic [skip ci]
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>
2026-08-09 20:35:26 -04:00
gsadmin d768c1d684 Installer: basic-UI purge prompt + ARPINSTALLLOCATION [skip ci]
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>
2026-08-09 20:01:28 -04:00
gsadmin 51286653ec Server-decided trust, configurable NATS bind, PATH + install-dir registry [skip ci]
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>
2026-08-09 19:53:00 -04:00
gsadmin 432f7ff2b8 Installer: drop reverse-proxy and multi-instance wording, neutral bind hint [skip ci]
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>
2026-08-09 19:00:44 -04:00
gsadmin b33e4254e5 Auto-elevate Windows installer, server-auth-only certs, fix data/log paths [skip ci]
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>
2026-08-09 18:42:28 -04:00
gsadmin d01cf5b4cf Add Device: full paste-ready command wrapped for a Run box [skip ci]
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>
2026-08-09 18:00:45 -04:00