fix(server): keep Windows secrets private and the service out of user folders
On Windows the data folder sits in %ProgramData%, whose ACL let every local user read the database, the password-less TLS key and the temporary admin password, and create a server.json the LocalSystem service would load (SRS-02, SRV-2). The folder now gets a protected DACL (SYSTEM, Administrators, the server's account) at every start when it names anyone else, which also replaces what the files inside inherited; server.pfx and initial-admin-password.txt are written with their own protected DACL, and with mode 0600 elsewhere. A folder whose ACL cannot be changed stops the start with a clear message. --install-service registered a LocalSystem service from any folder, so a per-user install or an unpacked zip handed SYSTEM to that user (SRS-06). It now refuses, with a localized one-line reason, unless the program folder is inside Program Files and no account besides SYSTEM, Administrators, TrustedInstaller or the registering administrator can change it or any file below it (under dotnet, the host's folder too). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
10 files changed
+398
-10
No files matched your search
@@ -108,6 +108,8 @@
|
||||
<data name="Server.Role.Uploader" xml:space="preserve"><value>Uploader</value></data>
|
||||
<data name="Server.Role.Viewer" xml:space="preserve"><value>Viewer</value></data>
|
||||
<data name="Server.Service.Description" xml:space="preserve"><value>Titano time-lapse archive, uploads, jobs and rendering server.</value><comment>long</comment></data>
|
||||
<data name="Server.Service.NotProgramFiles" xml:space="preserve"><value>Titano Server is not in Program Files ({0}), so it cannot run as a service; install it for all users and register the service from there.</value><comment>long</comment></data>
|
||||
<data name="Server.Service.Writable" xml:space="preserve"><value>Users who are not administrators can change {0}, so Titano Server cannot run as a service from there; reinstall it for all users and register the service again.</value><comment>long</comment></data>
|
||||
<data name="Server.Setting.Aspect" xml:space="preserve"><value>Aspect</value></data>
|
||||
<data name="Server.Setting.Auto" xml:space="preserve"><value>auto</value></data>
|
||||
<data name="Server.Setting.Batch" xml:space="preserve"><value>Batch list</value></data>
|
||||
|
||||
Reference in new issue
Block a user