Self-heal outdated port forwarding daemon on magebox start - #138
Open
Aquive wants to merge 2 commits into
Open
Conversation
A binary upgrade only replaces the magebox binary; the installed LaunchDaemon is upgraded exclusively by 'magebox bootstrap'. Users who upgrade via Homebrew or selfupdate silently keep running an old daemon generation — including the removed pf-based approach — until they happen to run bootstrap again. EnsureRulesActive now reconciles the daemon state on every start: an outdated daemon (missing the current plist version marker) is reinstalled via Setup(), an inactive one is kickstarted, and only an installed, current, responding daemon is left alone. The decision logic lives in a pure nextAction() function with table-driven tests. Also replace the misleading 'sudo launchctl list' hint — which shows the job even when it does nothing useful — with the kickstart command that actually restarts it, and update the FAQ entries that still described the removed pf anchor mechanism. Claude-Session: https://claude.ai/code/session_011EJ9p83uoE4YLhrnuMqcmb
Codify the pattern established by qoliber#128 (auto-starting stopped web-UI containers) and the port forwarding self-healing as a product-wide philosophy: every part of the environment MageBox manages is expected to detect and repair its own broken or outdated state at the next natural moment, without the user having to know a fix exists. Reorder the principles so related ones sit together: architecture, developer experience, team, scope, positioning. Claude-Session: https://claude.ai/code/session_011EJ9p83uoE4YLhrnuMqcmb
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.
Problem
A binary upgrade (Homebrew or
selfupdate) only replaces the binary — the installed LaunchDaemon is only upgraded bymagebox bootstrap. Users who never re-run bootstrap silently keep running an old daemon generation, including the removed pf-based approach.Changes
EnsureRulesActive()now reconciles the daemon state on everymagebox start: outdated daemon → reinstall viaSetup(), inactive → kickstart, missing → bootstrap hint. Decision logic extracted into a purenextAction()with table-driven tests.sudo launchctl listhint (shows the job even when it does nothing) with thelaunchctl kickstartcommand that actually restarts it.Follows the same approach as #128.
https://claude.ai/code/session_011EJ9p83uoE4YLhrnuMqcmb