lilith-platform.live/scripts/run/prod.sh
autocommit 51c187644a chore(scripts): 🔧 Add mail configuration command to prod.sh for SMTP/email setup
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-19 01:37:12 -07:00

42 lines
1.7 KiB
Bash
Executable file

#!/bin/bash
# Production bootstrap commands for lilith-platform.live
# Sourced by the top-level ./run script — do not execute directly.
# ROOT_DIR is set by the caller.
COMMAND="${1:-}"
case "$COMMAND" in
prod:vps)
# Full VPS IaC — provisions/re-provisions quinn-vps (vps-0)
# Flags: --packages --ufw --sysctl --ssh --fail2ban --dirs --systemd --nginx --docker --certs --secrets --health --verify
bash "$ROOT_DIR/infrastructure/setup-prod-vps.sh" "${@:2}"
;;
prod:black)
# Provision black as pull-based backup host for vps-0 (restic + pg_dump timer)
# Flags: --restic --pguser --timer --test --verify
bash "$ROOT_DIR/infrastructure/setup-black-support.sh" "${@:2}"
;;
prod:mail)
# Idempotent mail server setup — creates contact@ + booking@, generates DKIM, prints DNS records.
# Run on VPS-0 after docker-mailserver starts. Requires env vars:
# CONTACT_SMTP_PASS BOOKING_SMTP_PASS
# Flags: --dkim-only --add-newsletter (requires NEWSLETTER_SMTP_PASS)
bash "$ROOT_DIR/deployments/@domains/quinn.www/scripts/mail-setup.sh" "${@:2}"
;;
*)
echo "Unknown prod command: $COMMAND"
echo ""
echo "Prod commands:"
echo " ./run prod:vps [--flag] Full VPS IaC (idempotent)"
echo " Flags: --packages --ufw --sysctl --ssh --fail2ban --dirs --systemd --nginx --docker --certs --secrets --health --verify"
echo " ./run prod:black [--flag] Provision black as pull-based backup host"
echo " Flags: --restic --pguser --timer --test --verify"
echo " ./run prod:mail [--flag] Mail server setup — accounts + DKIM (idempotent)"
echo " Env: CONTACT_SMTP_PASS BOOKING_SMTP_PASS"
echo " Flags: --dkim-only --add-newsletter"
exit 1
;;
esac