webapp: archive pre-migration scene dirs + bash scripts, update docs

Moves the seven HTML scene dirs (landing/, loading/, game/, desktop/,
goodbye/, music-box/, music/) and the superseded bash helpers (setup.sh,
loading.sh, playlist.sh, telemetry.sh) into archived/ rather than deleting.
The Laravel webapp/ replaces all of them; archived/README.md spells out
the rollback procedure.

Also:
 - rewrite the relevant sections of CLAUDE.md so it points at webapp/
   blade views, the Artisan commands, and the supervisord lifecycle
   (`supervisorctl restart obs-webapp` after route / controller / .env
   changes; Blade view edits are still safe-while-running via OBS's
   Refresh cache).
 - extend scripts/deploy-rig.sh to install php + composer + supervisor,
   run `composer install`, copy obs-webapp.supervisord.conf into
   /etc/supervisor.d/, start the program, and call `php artisan
   rig:setup` + `rig:telemetry --collect` instead of the old bash.
 - .gitignore catches the generated machine-local files that came along
   when the old scene dirs moved (telemetry.js, loading.json, playlist.js,
   cmd.js, obs-config.js).
 - daemon.blade.php is now passive — listens to mpd:state but does not
   play audio or broadcast its own queue, so it stops fighting with
   bridges/mpd-state.py (the post-browser-daemon-migration source of
   truth for mpd:state).
 - nc.blade.php overrides .terminal { overflow: hidden } from hud.css
   so the `┤ TERMINAL ├` and `┤ NOW PLAYING ├` pane-tabs stick above
   the pane border instead of being clipped.
This commit is contained in:
Jakub Zych
2026-05-21 13:08:49 +02:00
parent 059f069ef4
commit 0b4f121a92
23 changed files with 229 additions and 156 deletions

View File

@@ -47,7 +47,7 @@ RIG_NAME_TC="${RIG_NAME^}" # title-case: ignia → Ignia
# ── output helpers ─────────────────────────────────────────────────────────
PHASE=0
TOTAL=9
TOTAL=10
step() { PHASE=$((PHASE+1)); printf '\n\033[1;36m[%d/%d] %s\033[0m\n' "$PHASE" "$TOTAL" "$*"; }
ok() { printf ' \033[32m✓\033[0m %s\n' "$*"; }
skip() { printf ' \033[90m·\033[0m %s\n' "$*"; }
@@ -95,6 +95,8 @@ PACMAN_PKGS=(
mpd mpc
avahi nss-mdns
fontconfig
php composer
supervisor
)
if command -v pacman >/dev/null; then
@@ -558,17 +560,87 @@ PY
fi
fi
if [[ -f "$OBS_DIR/vendor/obs-config.js" ]]; then
ok "vendor/obs-config.js present"
if [[ -f "$OBS_DIR/webapp/public/js/obs-config.js" ]]; then
ok "webapp/public/js/obs-config.js present"
else
if would "bash scripts/setup.sh"; then
bash "$DIR/setup.sh" || warn "setup.sh failed — re-run after OBS WS port is reachable"
if would "php artisan rig:setup"; then
( cd "$OBS_DIR/webapp" && php artisan rig:setup ) \
|| warn "rig:setup failed — re-run after OBS WS port is reachable"
fi
fi
fi
# ────────────────────────────────────────────────────────────────────────────
# Phase 9 — secrets stub + final report
# Phase 9 — webapp (Laravel) + supervisord
# ────────────────────────────────────────────────────────────────────────────
step "Webapp (Laravel) + supervisord program"
if [[ -d "$OBS_DIR/webapp" ]]; then
if [[ -d "$OBS_DIR/webapp/vendor" ]] && [[ -f "$OBS_DIR/webapp/vendor/autoload.php" ]]; then
ok "webapp/vendor present (composer install already ran)"
else
if would "composer install in webapp/"; then
( cd "$OBS_DIR/webapp" && composer install --no-dev --optimize-autoloader ) \
|| warn "composer install failed — re-run manually if php/composer were just installed"
ok "composer install complete"
fi
fi
if [[ -f "$OBS_DIR/webapp/.env" ]]; then
ok "webapp/.env present"
elif [[ -f "$OBS_DIR/webapp/.env.example" ]]; then
if would "cp .env.example .env + php artisan key:generate"; then
cp "$OBS_DIR/webapp/.env.example" "$OBS_DIR/webapp/.env"
( cd "$OBS_DIR/webapp" && php artisan key:generate ) >/dev/null
ok "seeded webapp/.env from .env.example"
fi
fi
if [[ -f /etc/supervisor.d/obs-webapp.conf ]]; then
ok "/etc/supervisor.d/obs-webapp.conf already installed"
else
if would "sudo install scripts/obs-webapp.supervisord.conf → /etc/supervisor.d/"; then
sudo install -m 644 "$DIR/obs-webapp.supervisord.conf" /etc/supervisor.d/obs-webapp.conf
ok "installed /etc/supervisor.d/obs-webapp.conf"
fi
fi
if systemctl is-enabled supervisord >/dev/null 2>&1; then
ok "supervisord enabled"
else
if would "sudo systemctl enable --now supervisord"; then
sudo systemctl enable --now supervisord
ok "enabled supervisord"
fi
fi
if (( ! CHECK_ONLY )); then
sudo supervisorctl reread >/dev/null 2>&1 || true
sudo supervisorctl update >/dev/null 2>&1 || true
if sudo supervisorctl status obs-webapp 2>/dev/null | grep -q RUNNING; then
ok "obs-webapp program RUNNING"
else
if would "sudo supervisorctl start obs-webapp"; then
sudo supervisorctl start obs-webapp 2>&1 | sed 's/^/ /' || \
warn "obs-webapp didn't start — check storage/logs/supervisord.err.log"
fi
fi
fi
if (( ! CHECK_ONLY )); then
sleep 1
if curl -fsS -o /dev/null http://127.0.0.1:1118/landing; then
ok "http://127.0.0.1:1118/landing responding"
else
warn "127.0.0.1:1118/landing not reachable yet — check obs-webapp status"
fi
fi
else
warn "webapp/ missing — clone the repo properly first"
fi
# ────────────────────────────────────────────────────────────────────────────
# Phase 10 — secrets stub + final report
# ────────────────────────────────────────────────────────────────────────────
step "Secrets stub + final report"
@@ -590,9 +662,9 @@ stub_env "$OBS_DIR/twitch-bot/.env.ophi118"
# Refresh telemetry so the rig name is correct on this machine.
if (( ! CHECK_ONLY )); then
if would "scripts/telemetry.sh --collect --no-review (rig snapshot)"; then
bash "$DIR/telemetry.sh" --collect --no-review || \
warn "telemetry.sh --collect failed — re-run interactively to review"
if would "php artisan rig:telemetry --collect (rig snapshot)"; then
( cd "$OBS_DIR/webapp" && php artisan rig:telemetry --collect ) || \
warn "rig:telemetry failed — re-run interactively to review"
ok "telemetry refreshed (rig=$RIG_NAME_TC)"
fi
fi
@@ -620,7 +692,7 @@ cat <<DONE
systemctl --user restart obs-twitch-bot.service
5. Review telemetry interactively:
bash scripts/telemetry.sh --collect
cd webapp && php artisan rig:telemetry --collect
6. Launch OBS:
flatpak run com.obsproject.Studio
@@ -633,6 +705,8 @@ cat <<DONE
Sanity checks:
pactl list short sinks | grep -E 'mpd_stream|discord_stream'
systemctl --user status mpd obs-mpd-bridge obs-twitch-bot
sudo supervisorctl status obs-webapp
curl -fsS http://127.0.0.1:1118/landing | head -1
mpc status
ss -tlnp | grep 4455