Snapshot of the decentralized-web stack at the point of the resolver+Theseus rebuild deploy. Includes: - Argus (BNS engine + resolver daemon + Sia gateway) - AriadneResolver (Windows Inno installer bundle + Android APK sources + Firefox extension) - TheseusNavigator (Electron browser) - site/ (silentmode.st content, deployed to Sia at bns/silentmode/) - design docs, roadmap, protocol spec Secrets excluded via .gitignore: Argus/sia-s3.json, Argus/wallets.json, Argus/ca/*.key,*.crt. Build outputs, node_modules, and bundled runtimes also excluded. Shipped hashes on dl.silentmode.st at this commit: AriadneResolver-Setup-0.1.0.exe 5bcb216eef31ea28ed767e4134ab74bd5ac69dfbd365fd249e9e6938e55c986a TheseusNavigator-Setup-0.0.1.exe 7c735e88bad2da3347145adba3016c8f626a18b8422289c8c6ba471972e2952b TheseusNavigator-0.0.1-portable.exe 008fd84445babeabb401b2bca40ea9466b24b0e6d6c85104da7640c5c5c84521 ariadne-v0.2.apk 635c8f04d44ef855a8390b9eeddb8cd2d50622e81cc4e5004e8daffc1bb0425c
62 lines
3.3 KiB
PowerShell
62 lines
3.3 KiB
PowerShell
# Reverses install.ps1 — run from an ELEVATED PowerShell.
|
|
$ErrorActionPreference = "Stop"
|
|
$stateFile = Join-Path $PSScriptRoot "install-state.json"
|
|
|
|
Get-DnsClientNrptRule | Where-Object Comment -eq "BNS .bch resolver" | ForEach-Object {
|
|
Remove-DnsClientNrptRule -Name $_.Name -Force
|
|
Write-Host "[ok] NRPT rule removed"
|
|
}
|
|
if (Test-Path $stateFile) {
|
|
$state = Get-Content $stateFile | ConvertFrom-Json
|
|
foreach ($a in $state.adapters) {
|
|
# Never "restore" DNS to 127.0.0.1 (the daemon we're removing) — that leaves the
|
|
# machine with no working resolver. Drop loopback; if nothing real remains, or the
|
|
# install marked this adapter, hand DNS back to DHCP (automatic).
|
|
$servers = @($a.servers | Where-Object { $_ -and $_ -ne '127.0.0.1' -and $_ -ne '::1' })
|
|
if ($a.resetToDhcp -or $servers.Count -eq 0) {
|
|
Set-DnsClientServerAddress -InterfaceAlias $a.alias -ResetServerAddresses -ErrorAction SilentlyContinue
|
|
Write-Host "[ok] adapter '$($a.alias)' DNS reset to automatic (DHCP)"
|
|
} else {
|
|
Set-DnsClientServerAddress -InterfaceAlias $a.alias -ServerAddresses $servers -ErrorAction SilentlyContinue
|
|
Write-Host "[ok] adapter '$($a.alias)' DNS restored to: $($servers -join ', ')"
|
|
}
|
|
}
|
|
Remove-Item $stateFile
|
|
}
|
|
# SAFETY SWEEP — always, even with a missing/stale state file. No adapter may be
|
|
# left pointing at 127.0.0.1 (or ::1) once the daemon is gone, or the machine loses
|
|
# ALL DNS ("server not responding"). This is the guarantee that a botched or
|
|
# state-less uninstall can never take the user offline.
|
|
foreach ($if in Get-DnsClientServerAddress -AddressFamily IPv4 |
|
|
Where-Object { $_.InterfaceAlias -notmatch 'Loopback' -and ($_.ServerAddresses -contains '127.0.0.1') }) {
|
|
Set-DnsClientServerAddress -InterfaceAlias $if.InterfaceAlias -ResetServerAddresses -ErrorAction SilentlyContinue
|
|
Write-Host "[fix] adapter '$($if.InterfaceAlias)' was still pointed at the resolver — reset to automatic (DHCP)"
|
|
}
|
|
# Remove the BNS root CA robustly — by SUBJECT, not only the thumbprint recorded
|
|
# in install-state.json. A missing or stale state file (the daemon was run by
|
|
# hand, or this is an upgrade from an older build) must never leave an orphaned
|
|
# trusted root in the machine store.
|
|
$removed = 0
|
|
Get-ChildItem Cert:\LocalMachine\Root | Where-Object { $_.Subject -match "BNS Local Root CA" } | ForEach-Object {
|
|
Remove-Item $_.PSPath -Force
|
|
Write-Host "[ok] BNS Local Root CA removed ($($_.Thumbprint))"
|
|
$removed++
|
|
}
|
|
if ($removed -eq 0) { Write-Host "[ok] no BNS root CA left in the machine store" }
|
|
try {
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\Certificates" -Recurse -Force -ErrorAction Stop
|
|
Write-Host "[ok] Firefox certificate policies removed (enterprise-roots + install)"
|
|
} catch {}
|
|
try {
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\DNSOverHTTPS" -Recurse -Force -ErrorAction Stop
|
|
Write-Host "[ok] Firefox DNS-over-HTTPS policy removed (DoH restored to default)"
|
|
} catch {}
|
|
foreach ($task in "BNS Resolver Daemon", "BNS Sia Bridge") {
|
|
try { Stop-ScheduledTask -TaskName $task -ErrorAction Stop } catch {}
|
|
try {
|
|
Unregister-ScheduledTask -TaskName $task -Confirm:$false -ErrorAction Stop
|
|
Write-Host "[ok] scheduled task '$task' removed"
|
|
} catch {}
|
|
}
|
|
Clear-DnsClientCache
|
|
Write-Host "[done] system DNS configuration restored"
|