Repository navigation
Harden server setup rollback, uninstall and local TLS - #783
Merged
Merged
Conversation
- Setup health probe and first login pin the configured server certificate per request and reject redirects, instead of switching off certificate validation for the whole process (D01). - A failed reinstall that changes the service account restores the install root DACL before the old binaries come back (#735). - Uninstall stops when the service cannot be deleted, keeps the marker and deploy\ until everything else is gone, and the Inno uninstaller aborts on a failed cleanup so it can be repeated (#714, server part). - PurgeData takes ownership with takeown /A item by item, so it works on German Windows, and deletes nothing when a native step fails (#731). - The gMSA repair command reads the existing retrieval principals and adds this host; the deploy README drops the blanket RBCD recipe (#713). Closes #713 Closes #731 Closes #735 Refs #714 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 3, 2026
The old setup probe set TLS 1.2/1.3 for Windows PowerShell explicitly. Without the system-default switch, PowerShell 5.1 offers only TLS 1.0, Kestrel refuses it and the install rolls back after the 180 s probe. The helper now adds TLS 1.2 for the request and restores the previous process-wide setting afterwards. A rejected first login surfaces as a WebException wrapped in a MethodInvocationException, so the setup reported only "(400) Bad Request". It now unwraps it and reports the server's own message again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Uninstall-NodePilot.ps1 writes a transcript to %TEMP%\nodepilot-server-uninstall.log and deletes it after a clean run. The setup uninstaller runs the script hidden and now stops on any failure, so its message names that file, as the desktop uninstaller already does. - The pinned setup calls offer TLS 1.3 next to 1.2 on Windows PowerShell, as the old probe did, so hosts with TLS 1.2 disabled still pass the health probe and the first login. - The wizard loads LocalServerHttp.ps1 only in install mode. Loading it compiles C#, and the other wizard modes never use it. Refs #714 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of three setup/switcher PRs from the 2026-10-28 audit. The desktop and switcher PRs are stacked on this one, so merge this first.
What changes
LocalServerHttp.ps1helper. It accepts only the configured server certificate (by thumbprint), refuses redirects and proxies, and only talks to loopback HTTPS. The process-wideTrustAllCertspolicy is gone. Nothing changes for the operator: the certificate may still name the public host or be self-signed, TLS 1.2 and 1.3 are still offered on Windows PowerShell 5.1 as the old probe did, and a rejected first login still shows the server's own message.sc.exe deletestops the script before files are removed. The installation marker anddeploy\are removed last, only after everything else is gone. The Inno uninstaller aborts (non-zero exit, Apps & features entry kept) when the cleanup fails, cannot start, or its script is missing while the marker still exists. Because the script runs hidden, it now keeps a transcript at%TEMP%\nodepilot-server-uninstall.log(deleted after a clean run), and the abort message names that file.takeown /Aitem by item instead oftakeown /R /D Y, which German Windows rejects. If any native step fails, nothing under the data directory is deleted.PrincipalsAllowedToRetrieveManagedPasswordand adds this host instead of replacing the list. The deploy README drops the blanket RBCD recipe, in line with the guidance Remove blanket delegation grants from direct service-identity WinRM guidance #707 already put on the website.The wizard loads the new helper only in install mode, so its other steps do not compile C#. CHANGELOG and the website's uninstall section are updated. The new harness runs in both CI PowerShell steps.
Testing
Windows PowerShell 5.1, locally:
Test-LocalServerHttp.ps1(21 checks),Test-ArtifactSecurity.ps1,Test-DeploymentTemplates.ps1,server/Test-ServerWizardCompile.ps1: pass.Test-SetupAdapter.ps1stops on this machine at the unrelated "occupied port" check, the same way onmain. I ran the new gMSA remediation case on its own againstPreflight.ps1, including a quote in the account name: pass.Lab (signed
1.5.4-audit1build of the same changes, GW1 and the German host):/healthz/ready200); an update with an unchanged identity also passes.sc sdset, the uninstall exits 1 and keeps the service, the files,deploy\, the marker and the Apps & features entry; the retry removes everything.takeown /R /D Yfails on German Windows; the new helper unlocks and deletes a SYSTEM-owned folder.PowerShell 7 runs and the rest of
Test-SetupAdapter.ps1are covered by CI. The full release lab matrix runs before the next tag as usual.Closes #713
Closes #731
Closes #735
Refs #714 (closed by the desktop PR)
🤖 Generated with Claude Code