Skip to content

fix(install): make airc reachable inbound on Windows — no signing, clean + idempotent - #1255

Merged
joelteply merged 1 commit into
canaryfrom
fix/install-windows-firewall
Jun 18, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/install-windows-firewall

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

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 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, 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, exit 0=ok / 1=needs-fix.
    • apply (default) — asserts admin, does the cleanup + add. 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 after 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.sh clean.
  • -CheckOnly correctly 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

…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]>
@joelteply
joelteply merged commit bcd96ad into canary Jun 18, 2026
11 of 12 checks passed
@joelteply
joelteply deleted the fix/install-windows-firewall branch June 18, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant