feat(windows): simplify tray controls and allow installer-user config edits

This commit is contained in:
cabbage committed 2026-10-27 08:54:23 +00:00
1 parent d59b2d5463
commit ae5e979761
18 files changed
+611 -88

No files matched your search

+29 -13
View File
@@ -35,8 +35,8 @@ nor commands. Task Scheduler is not used anywhere in v1.
Use conventional machine-wide paths: `%ProgramData%\RVBox\client.toml`,
`%ProgramData%\RVBox\state`, and `%ProgramData%\RVBox\logs\rvbox.log`, with
state ACLs limited to Administrators and SYSTEM and separate read-only tray
access for config/log. The menu opens the exact config or current log via a safe
state ACLs limited to Administrators and SYSTEM, read/write config access for
the original installing user, and separate current-log access. The menu opens the exact config or current log via a safe
explicit file-opening path. SCM Automatic/Manual state is
the only service-startup source of truth and is not mirrored into TOML. Create
`%ProgramData%\RVBox\work` as a SYSTEM-owned root. For omitted CWDs, create an
@@ -2300,7 +2300,17 @@ to start the tray must explicitly report the already-installed service rather
than claiming complete success. No sign-out or reboot is required.
Run its Win32 message pump on one locked OS thread,
recreate the icon after `TaskbarCreated`, and use bounded nonblocking IPC/UI
channels. The tooltip shows connection/readiness/dirty state without payloads.
channels. Show a disabled `Status: ...` banner first in the context menu, with
no clickable Status action. `running` requires a reconciled WSS session,
`disconnected` means SCM running without confirmed connectivity, and `stopped`
comes from SCM independently of IPC. Query SCM with only CONNECT plus
QUERY_STATUS/QUERY_CONFIG permissions; poll asynchronously every two seconds
and on menu opening. Keep status work separate from user actions so a stalled
poll cannot swallow clicks. Update an open menu and tooltip on the UI thread.
Expose Start/Stop service only (no Restart item). Combine Automatic/Manual into
one checked `Auto start` item. Checked state always comes from SCM, not an
optimistic toggle; cancelled/failed UAC must leave it unchanged. Keep the CLI
restart mode for operational use. The tooltip shows bounded status without payloads.
`Exit` closes only that tray. The service continues through tray exit, user
logoff, Explorer restart, and periods with no interactive user.
@@ -2317,25 +2327,31 @@ request read can deadlock both peers. Keep a response alive until client
disconnect or the peer deadline. Create the icon independently of IPC and
post bounded status/action responses back to the UI thread.
The tray never reads the spool/database. Read-only status may be served to a
local interactive user. For a mutating service/config action, the tray launches
the narrow canonical `configure-service` mode with UAC; that helper sends one
authenticated request and exits. The service rechecks the helper token rather
than trusting a tray-supplied administrator claim.
local interactive user. For a mutating service/startup action, the tray launches
the narrow canonical service-control mode with UAC; that helper calls SCM with
its elevated token and exits. SCM enforces authorization rather than trusting
a tray-supplied administrator claim.
Resolve defaults under `%ProgramData%\RVBox`; create the config, state, and log
Resolve defaults under `%ProgramData%\RVBox`; create private state and log
directories with explicit Administrators/SYSTEM ACLs and reject insecure
existing objects. Create `%ProgramData%\RVBox\work` as a SYSTEM-owned root and
create identity-scoped child directories on demand with non-inherited ACLs for
SYSTEM plus the effective non-SYSTEM SID; no command identity receives state-
directory access. Give tray users only the documented read access to config/
current logs. On first installation, copy the annotated Windows
directory access. Grant the original installing user's SID read/write on the
TOML only, retaining SYSTEM/Administrators full access. Capture that SID in the
unelevated parent before UAC; validate/canonicalize it in the child before
SDDL construction, never use Everyone/Users as a default edit grant. Apply
the file ACL to existing configs during reinstall without changing contents;
do not widen spool ACLs. Give tray users only the documented access to current
logs. On first installation, copy the annotated Windows
TOML template and leave the service live/not-ready until routing is valid. `Open
config` and `Open log` use exact resolved regular paths—never an unquoted shell
command—and show actionable errors. Config edits are administrator-only and
take effect after explicit service restart; v1 has no hot reload or TOML rewrite.
command—and show actionable errors. Open config uses the explicit installed
path even when the service is stopped. Config edits by the installing user
take effect after explicit service stop/start; v1 has no hot reload or TOML rewrite.
Install the service with `SERVICE_AUTO_START`. `configure-service` maps the tray
Automatic/Manual control directly to SCM start type; there is no
single `Auto start` checkbox directly to SCM start type; there is no
`windows.start_on_boot` TOML key or second desired-state store. Stop/restart is a
separate administrator action and reports that stopping the service terminates
all supervised Jobs. Uninstall first stops admission, performs bounded orderly