Wiring: enable HLS port in cast/infra mediamtx + ufw notes; add deploy:live case + help in run/deploy.sh; update live deploy script. Ties the quinn.cast relay (on-demand DO) to the VIP shows live feature (fanout to live.transquinnftw.com ingest powers the player; /admin for SSO operator preview + light admin).
166 lines
8.8 KiB
Bash
Executable file
166 lines
8.8 KiB
Bash
Executable file
#!/bin/bash
|
|
# =============================================================================
|
|
# Lilith Platform Live - Run Command
|
|
# =============================================================================
|
|
#
|
|
# Usage:
|
|
# ./run dev Start dev (docker + frontend + APIs)
|
|
# ./run build Build for production
|
|
# ./run deploy:quinn Trigger quinn.www deployment via Forgejo Actions CI
|
|
# ./run dev:infra Start infrastructure only (PostgreSQL)
|
|
# ./run dev:stop Stop all services
|
|
# ./run dev:waitlist Start waitlist API only
|
|
# ./run dev:merchant Start merchant API only
|
|
# ./run dev:status Health check all services
|
|
# ./run dev:logs [svc] View service logs
|
|
# ./run dev:mail Start Mailpit dev SMTP only (web UI: http://localhost:8025)
|
|
# ./run dev:mail:stop Stop Mailpit
|
|
#
|
|
# ./run dev:sso Start Quinn SSO API on port 3025
|
|
# ./run dev:sso:stop Stop Quinn SSO API
|
|
# ./run dev:sso:status Health check Quinn SSO
|
|
# ./run dev:my Start SSO + quinn.my dashboard (SSO starts first)
|
|
# ./run dev:my:stop Stop SSO + quinn.my dashboard API
|
|
# ./run dev:my:status Health check SSO + quinn.my dashboard
|
|
# ./run dev:m Start quinn.messenger (quinn.m) messaging stack (PG + Redis + sync + BFF + Vite)
|
|
# ./run dev:m:stop Stop quinn.messenger services (docker infra left running)
|
|
# ./run dev:m:status Health check quinn.messenger services
|
|
# ./run deploy:my Trigger quinn.my deployment via Forgejo Actions CI
|
|
# ./run deploy:admin Trigger quinn.admin deployment via Forgejo Actions CI
|
|
# ./run deploy:data Trigger quinn.data deployment via Forgejo Actions CI
|
|
# ./run deploy:m Deploy quinn.messenger (quinn.m) VPS services (--direct only)
|
|
# ./run deploy:m-orchestrator Deploy quinn.messenger autoresponder to black (--direct only)
|
|
# ./run deploy:api Deploy quinn.api data API to VPS (--direct only)
|
|
# ./run deploy:ai Deploy quinn.ai dashboard to VPS (--direct only)
|
|
# ./run deploy:ai-worker Deploy ai inference worker to black (--direct only)
|
|
# ./run deploy:cast Deploy quinn.cast (broadcast relay) to dedicated droplet via provision-stream (--from-local only)
|
|
# ./run deploy:live Deploy live.transquinnftw.com (VIP shows player + SSO /admin with OBS preview) (--from-local only)
|
|
# ./run deploy:att Deploy adulttherapytour.com + SEO bait to vps-0 (--from-local only)
|
|
# ./run deploy:cocotte Deploy cocotte.maison (+ defensive cocottehouse.com via defensive-coms) to vps-0 (--from-local only)
|
|
# ./run deploy:sansonnet Deploy sansonnet.maison (+ defensive maisonsansonnet.com via defensive-coms) to vps-0 (--from-local only)
|
|
# ./run deploy:newsletter Trigger newsletter deployment via Forgejo Actions CI
|
|
# ./run deploy:quinn-db-backup Deploy prod PG borg backups to black (--from-local only)
|
|
# All deploy commands accept --direct to bypass CI (emergencies / rollback).
|
|
# ./run prod:vps [--flag] Full VPS IaC — packages, ufw, systemd, nginx, certs, hardening
|
|
# Flags: --packages --ufw --sysctl --ssh --fail2ban --dirs --systemd --nginx --docker --certs --secrets --health --verify
|
|
# ./run prod:black [--flag] Provision black as pull-based backup host for vps-0
|
|
# ./run prod:mail [--flag] Mail server setup — contact@ + booking@, DKIM, prints DNS records (idempotent)
|
|
# Env: CONTACT_SMTP_PASS BOOKING_SMTP_PASS Flags: --dkim-only --add-newsletter
|
|
# Flags: --restic --pguser --timer --test --verify
|
|
#
|
|
# ./run admin:seed-passphrase Seed admin passphrase on VPS
|
|
# ./run admin:migrate [dev|prod] Run DB migrations (default: prod)
|
|
#
|
|
# ./run dev:analytics Start transquinnftw analytics cluster (all 4 services)
|
|
# ./run dev:analytics:stop Stop analytics cluster
|
|
# ./run dev:analytics:status Health check analytics cluster
|
|
#
|
|
# ./run dev:image-protection Start image-protection backend API (:3030) + frontend (:5130)
|
|
# ./run dev:image-protection:stop Stop image-protection services
|
|
# ./run dev:image-protection:status Health check image-protection services
|
|
#
|
|
# ./run dev:newsletter Start comm-newsletter API on port 3026
|
|
# ./run dev:newsletter:ui Start comm-newsletter frontend on port 5126
|
|
# ./run dev:newsletter:stop Stop comm-newsletter API and frontend
|
|
# ./run dev:newsletter:status Health check comm-newsletter API and frontend
|
|
#
|
|
# ./run dev:projects Serve users/transquinnftw/projects/ on http://localhost:5200
|
|
# ./run dev:projects:stop Stop the projects static server
|
|
# ./run dev:projects:scrape:install Install hotel scraper deps (bun install)
|
|
# ./run dev:projects:scrape:dry Dry-run scraper (prints rates, no HTML write)
|
|
# ./run dev:projects:scrape Run scraper — patches hotel notes in calendar HTML
|
|
# ./run dev:projects:scrape [hotelId] Scrape a single hotel (e.g. ho112914)
|
|
#
|
|
# ./run dev:api Start quinn.api on port 3040 (QUINN_API_SERVICE_TOKEN required)
|
|
# ./run dev:api:stop Stop quinn.api
|
|
# ./run dev:api:status Health check quinn.api
|
|
# ./run build:api Typecheck quinn.api (exits non-zero on failure)
|
|
# ./run test:api Run quinn.api unit + integration tests
|
|
# ./run typecheck:api Typecheck only (fast feedback loop)
|
|
# ./run lint:api Lint quinn.api with dependency-cruiser
|
|
# ./run migrate:api Apply pending entity migrations (uses DB_PATH env or dev default)
|
|
#
|
|
# ./run ci:trigger:quinn Trigger quinn.www deployment via Forgejo Actions (preferred)
|
|
# ./run ci:trigger:admin Trigger quinn.admin deployment via Forgejo Actions
|
|
# ./run ci:trigger:my Trigger quinn.my deployment via Forgejo Actions
|
|
# ./run ci:trigger:data Trigger quinn.data deployment via Forgejo Actions
|
|
# ./run ci:trigger:newsletter Trigger newsletter deployment via Forgejo Actions
|
|
# ./run ci:status Show recent workflow run statuses
|
|
# ./run ci:logs <workflow.yml> Show URL for latest run logs
|
|
# ./run ci:setup-host [flags] Provision Forgejo runner on black (IaC)
|
|
# Requires: FORGEJO_TOKEN env var (get from 134.199.243.61:3000 → user settings → applications)
|
|
#
|
|
# ./run check:prod Smoke-test live quinn.www: maintenance mode + HTTP 200s on all critical routes
|
|
# ./run check:prod-builds Prod build SHA + commits-behind-main per quinn service
|
|
# ./run check:dev Headless-browser smoke of dev (quinn.apricot.lan): registry nav/footer + route render
|
|
#
|
|
# =============================================================================
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
export ROOT_DIR
|
|
|
|
export BUN_INSTALL="${BUN_INSTALL:-$HOME/.bun}"
|
|
export PATH="$BUN_INSTALL/bin:$PATH"
|
|
|
|
COMMAND="${1:-dev}"
|
|
PREFIX="${COMMAND%%:*}"
|
|
|
|
case "$PREFIX" in
|
|
dev)
|
|
# shellcheck source=scripts/run/dev.sh
|
|
source "$ROOT_DIR/scripts/run/dev.sh" "$@"
|
|
;;
|
|
build)
|
|
# shellcheck source=scripts/run/build.sh
|
|
source "$ROOT_DIR/scripts/run/build.sh" "$@"
|
|
;;
|
|
deploy)
|
|
# shellcheck source=scripts/run/deploy.sh
|
|
source "$ROOT_DIR/scripts/run/deploy.sh" "$@"
|
|
;;
|
|
prod)
|
|
# shellcheck source=scripts/run/prod.sh
|
|
source "$ROOT_DIR/scripts/run/prod.sh" "$@"
|
|
;;
|
|
admin)
|
|
# shellcheck source=scripts/run/admin.sh
|
|
source "$ROOT_DIR/scripts/run/admin.sh" "$@"
|
|
;;
|
|
ci)
|
|
# shellcheck source=scripts/run/ci.sh
|
|
source "$ROOT_DIR/scripts/run/ci.sh" "$@"
|
|
;;
|
|
check)
|
|
# shellcheck source=scripts/run/check.sh
|
|
source "$ROOT_DIR/scripts/run/check.sh" "$@"
|
|
;;
|
|
verify)
|
|
# shellcheck source=scripts/run/verify.sh
|
|
source "$ROOT_DIR/scripts/run/verify.sh"
|
|
;;
|
|
test|typecheck|lint|migrate)
|
|
# shellcheck source=scripts/run/build.sh
|
|
source "$ROOT_DIR/scripts/run/build.sh" "$@"
|
|
;;
|
|
*)
|
|
echo "Unknown command: $COMMAND"
|
|
echo ""
|
|
echo "Usage: ./run <command>"
|
|
echo ""
|
|
echo "Prefixes:"
|
|
echo " dev:* Development commands (scripts/run/dev.sh)"
|
|
echo " build:* Build commands (scripts/run/build.sh)"
|
|
echo " test:* Test commands (scripts/run/build.sh)"
|
|
echo " typecheck:* Typecheck commands (scripts/run/build.sh)"
|
|
echo " lint:* Lint commands (scripts/run/build.sh)"
|
|
echo " migrate:* Migration commands (scripts/run/build.sh)"
|
|
echo " check:* Production checks (scripts/run/check.sh)"
|
|
echo " verify Pre-push local checks (scripts/run/verify.sh)"
|
|
echo " deploy:* Deploy commands (scripts/run/deploy.sh)"
|
|
echo " prod:* Production bootstrap (scripts/run/prod.sh)"
|
|
echo " admin:* Admin utilities (scripts/run/admin.sh)"
|
|
echo ""
|
|
echo "Run './run <prefix>' with no subcommand for a full list."
|
|
exit 1
|
|
;;
|
|
esac
|