Skip to content

Self-heal web-UI service commands when their container is stopped - #128

Merged
peterjaap merged 2 commits into
qoliber:mainfrom
Aquive:fix/service-ui-autostart
Aug 7, 2026
Merged

peterjaap merged 2 commits into
qoliber:mainfrom
Aquive:fix/service-ui-autostart

Conversation

@Aquive

@Aquive Aquive commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The containerised web-UI services (phpmyadmin, elasticvue, mailpit) dead-ended when their global container was stopped — which happens routinely after a Docker Desktop or machine restart. open errored out and enable printed "already enabled" while doing nothing.

Changes

  • phpmyadmin open / elasticvue open: start the container when the service is enabled but stopped, then open the browser. Not enabled → clear "enable with…" message.
  • mailpit open: always starts the container if stopped, then opens (Mailpit is always on).
  • phpmyadmin enable / elasticvue enable: idempotent — restart the container when already enabled but stopped.
  • status: points to the relevant open command when stopped.
  • Only the requested UI container is started — no full global start, no databases pulled in. Clear message when Docker itself is not running.
  • Shared helpers (isContainerRunning, openInBrowser, ensureGlobalServiceRunning, decideServiceUI) de-duplicate the logic across the three commands.

Docs (commands.md) and CHANGELOG.md updated.

@Aquive
Aquive force-pushed the fix/service-ui-autostart branch from 0904899 to 9a77fda Compare June 23, 2026 20:48
peterjaap pushed a commit that referenced this pull request Aug 7, 2026
The comment-artifacts job requests pull-requests: write, but GitHub caps
GITHUB_TOKEN to read-only for pull_request runs originating from a fork.
Posting the comment therefore fails with 403 'Resource not accessible by
integration', marking the whole run as failed even when every build, test
and lint job passed.

This has broken every fork PR since 1fe4817 added the job (#128, #133, and
external contributions such as #123). PRs from branches in this repository
are unaffected and keep their artifact comment.

Gate the job on the PR originating from this repository instead of merely
being a pull_request. On push events github.event.pull_request is null, so
the job is still skipped there, matching the previous guard.
phpmyadmin, elasticvue and mailpit dead-ended when their global
container was stopped (e.g. after a Docker or machine restart):
open errored out and enable printed "already enabled" while doing
nothing.

Now open/enable start the container on demand when the service is
enabled (mailpit is always on), and enable is idempotent. Only the
requested UI container is started — no full global start, no databases
pulled in — and a clear message is shown when Docker is not running.
status now points to the relevant open command.

Shared helpers (isContainerRunning, openInBrowser,
ensureGlobalServiceRunning, decideServiceUI) de-duplicate the logic.
@Aquive
Aquive force-pushed the fix/service-ui-autostart branch from 9a77fda to 7f9d722 Compare August 7, 2026 10:31
@Aquive

Aquive commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@peterjaap all green now instead of 1 job failing after the job fix commit. Ready to be merged?

@peterjaap
peterjaap merged commit 44fa8a3 into qoliber:main Aug 7, 2026
10 checks passed
Aquive added a commit to Aquive/magebox that referenced this pull request Aug 25, 2026
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
peterjaap pushed a commit that referenced this pull request Sep 1, 2026
* Self-heal outdated port forwarding daemon on magebox start

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

* Add self-healing by default as a core principle to CLAUDE.md

Codify the pattern established by #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
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.

2 participants