gabriel / musehub public
fix BREAKING deploy dev
AI Agent gabriel · 148 days ago · Apr 28, 2026 · Diff

fix(deploy): replace direct nginx port-file writes with musehub-set-slot script

Any agent writing to /etc/nginx/musehub-active-port directly must produce valid nginx syntax — a trap that broke staging repeatedly. Fix structurally:

- deploy/set-active-slot.sh: installed as /usr/local/bin/musehub-set-slot on the instance. Accepts only 'blue' or 'green', constructs the correct 'server 127.0.0.1:{port};' directive internally, runs nginx -t before reload. Impossible to produce a bad nginx config via this interface.

- deploy.sh: nginx_point_to now calls musehub-set-slot <slot> instead of writing the port file directly. --init installs the script. sanitize also delegates to musehub-set-slot so recovery is always correct.

- push.sh: syncs set-active-slot.sh to the instance on every deploy, so the script stays current without a separate provisioning step.

Recovery command for any future agent: sudo musehub-set-slot blue (or green)

sha256:ef5614c0cfb6a312635cbf4ca2e4439d1ad7ce211e63761b3b883e527bcab84e sha
+5 ~5 −2 symbols
sha256:b9912373469448ad826d7023f651212ca2834f2dad197a0c307e5712a1e45705 snapshot
+5
symbols added
~5
symbols modified
−2
symbols removed
0
dead code introduced
Semantic Changes 12 symbols
~ deploy/set-active-slot.sh .sh 4 symbols added
+ NGINX_PORT_FILE variable variable NGINX_PORT_FILE L17–17
+ SLOT_FILE variable variable SLOT_FILE L18–18
+ port variable variable port L24–24
+ slot variable variable slot L20–20
~ deploy/deploy.sh .sh 2 symbols removed, 3 symbols modified
bare_port variable variable bare_port L81–81
port variable variable port L60–60
~ slot
~ deploy/push.sh .sh 1 symbol added, 2 symbols modified
+ set_slot_b64 variable variable set_slot_b64 L136–136
~ cmd_id
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:ef5614c0cfb6a312635cbf4ca2e4439d1ad7ce211e63761b3b883e527bcab84e --body "your comment"