Files
loki/scripts
g-but b323e74357 fix(daemon): warn loudly when local is picked but a real remote is configured
Yesterday's session diagnosed a silent trap: cockpit-daemon.sh's
_base_url() prefers local-when-reachable, so a user running both
cockpit-app systemd on localhost:3000 AND $COCKPIT_BASE_URL pointed
at https://cockpitapp.vercel.app silently polls local, ignoring every
dispatch from the production /control page. The fix on the user's
machine was a one-line daemon.env edit (DAEMON_FORCE_REMOTE=1) — but
nothing in the script tells them they're in this state.

Added a startup-time warning in _init_base_url: when the daemon picks
LOCAL but $COCKPIT_BASE_URL is a non-localhost URL, three log lines
fire explaining the trap and the fix. Stays silent for genuine dev
setups ($COCKPIT_BASE_URL pointing at localhost or 127.0.0.1) so it
doesn't cry wolf.

Bash syntax clean. No behavior change — same routing logic, just a
diagnostic log when the trap configuration is detected.
2026-05-20 08:09:24 +02:00
..