Repository navigation
fix(install): make airc reachable inbound on Windows — no signing, clean + idempotent - #1255
Merged
Merged
Conversation
…ean + idempotent Root cause of "LAN peers can't reach this Windows node": Windows Defender Firewall blocks INBOUND for unknown programs by default, and code-signing does NOT fix it (firewall != SmartScreen — the rule is required regardless of signature, so "become a registered publisher" was never the answer). Worse, every `airc daemon` bind trips Defender's "allow access?" prompt, and one "Cancel"/Block click (or repeated launches) leaves a pile of contradictory auto-created rules — and a BLOCK rule beats an ALLOW. Observed live on BigMama: 8 Allow + 2 Block for airc.exe → inbound silently dead. Setup now owns this so no one runs firewall commands by hand: - `windows/firewall-allow.ps1` — removes every existing airc rule (by display name AND by program path, to catch the auto-created ones) and adds ONE canonical inbound-allow rule for the binary. Two modes: `-CheckOnly` (read-only, no admin, exit 0 ok / 1 needs-fix) and apply (asserts admin). Idempotent. - `install.sh::_setup_windows_firewall` runs the read-only check first (NO prompt); only when a fix is needed does it self-elevate (one UAC) to apply. So first install asks once; every `airc update` afterward is silent because the rule persists. Declined elevation warns loudly with the exact re-run, never hard-fails. Wired into the Windows binary-install path, so it covers install AND update (update runs install.sh). Validated: `bash -n install.sh` clean; `-CheckOnly` correctly returns exit 1 against the live 8-Allow/2-Block mess (detects the broken state with no prompt). Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
The problem (a typical Windows box, not a Joel-box quirk)
LAN peers can't reach a Windows airc node because Defender Firewall blocks INBOUND for unknown programs by default — and code-signing does not fix this (firewall ≠ SmartScreen; the rule is required regardless of signature). So "become a registered Microsoft publisher" was never the answer. Worse: every
airc daemonbind trips Defender's "allow access?" prompt, and one "Cancel"/Block click (or repeated launches) leaves a pile of contradictory auto-created rules — and a BLOCK rule beats an ALLOW. Observed live on BigMama: 8 Allow + 2 Block forairc.exe→ inbound silently dead, which is why peer→node dials time out.Fix — setup owns it, no hand-run commands
windows/firewall-allow.ps1— removes every existing airc rule (by display name AND by program path, to catch the auto-created ones) and adds one canonical inbound-allow rule for the binary. Two modes:-CheckOnly— read-only, no admin, exit0=ok /1=needs-fix.install.sh::_setup_windows_firewallruns the read-only check first (no prompt); only when a fix is needed does it self-elevate (one UAC) to apply. So first install asks once; everyairc updateafter is silent because the rule persists. Declined elevation → loud warning with the exact re-run, never a hard fail. Wired into the Windows binary-install path → covers install and update.Why this shape
Clean + easy (the bar): no signing, no hand-pasted commands, one UAC only when something's actually wrong, silent thereafter.
Validation
bash -n install.shclean.-CheckOnlycorrectly returns exit 1 against the live 8-Allow/2-Block mess (detects the broken state, no prompt).(Apply path needs the UAC click, so it's validated by the check logic + the script's structure; happy to run it live to fix BigMama's rules and confirm end-to-end.)
🤖 Generated with Claude Code