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

+21 -3
View File
@@ -109,11 +109,22 @@ deadlines/cancellation; neither peer uses an unbounded pipe flush. The icon is
created before any IPC, with status/actions exchanged asynchronously so a
stopped or stalled service cannot hide the icon or freeze its message loop.
Read-only health/status is available to an interactive local user. Service
start/stop/restart, Automatic/Manual startup changes, config editing, incident
start/stop, startup changes, incident
resolution, and other machine-wide mutations require a locally elevated
administrator helper. `Exit` closes only that tray. Server Core and logged-out
machines simply have no tray.
The menu starts with a disabled, informational `Status: ...` banner rather
than a clickable Status command. `running` means the service has a reconciled
server connection; `disconnected` means SCM reports running but no active
connection is confirmed; `stopped` comes from SCM even when the pipe is absent.
Pending/unknown SCM states are shown explicitly. Refresh status asynchronously
every two seconds and when opening the menu. Read-only SCM queries request
only CONNECT, QUERY_STATUS, and QUERY_CONFIG rights. The menu provides Start
service and Stop service, not Restart. A single checked `Auto start` item
reflects SCM Automatic/Manual configuration; clicking it requests the opposite
mode with UAC and waits for a subsequent SCM query before changing the tick.
When no config path was installed, resolve `FOLDERID_ProgramData` with the
Windows Known Folder API and use `RVBox\client.toml`, `RVBox\state`,
`RVBox\work`, and `RVBox\logs\rvbox.log` beneath it. Do not expand
@@ -124,8 +135,15 @@ active-user context, a LocalService directory, or a SYSTEM-only directory for
each SYSTEM context. Its non-inherited ACL grants only SYSTEM and the effective
non-SYSTEM SID the required access. The service validates the existing owner,
ACL, and reparse-point state before reuse, so one user cannot pre-create or
modify another identity's work area. Config/log read access needed by the tray
is separate from edit access. First installation writes the annotated template
modify another identity's work area. The default TOML grants read/write to the
original user who launched the installer, plus full access to SYSTEM and
Administrators. The unelevated installer captures that user's SID before UAC
and passes it to its elevated child, including over-the-shoulder elevation with
another account. Reinstallation repairs the TOML ACL without rewriting its
contents. This is a deliberate v1 configuration-control grant, not access to
private state or permission to start/stop the service without UAC. Open config
uses the installed explicit config path and also works while the service is
stopped. Current-log access is separate. First installation writes the annotated template
and lets the service remain live but not ready until routing validates.
Configuration is restart-only. File opening uses exact resolved regular paths,
never a constructed shell command.