#!/bin/bash # Tear down the full dev stack and wipe the support-relay data (DB + # master key). Hyprcrd and the main relay keep their data — this is # meant for iterating on support-relay setup / API-key rotation. # # Usage: ./dev-down.sh set -e cd "$(dirname "$0")" # If the stand-alone support-relay/docker-compose.yml was used earlier # (before we folded it into the main compose), stop that too. if [ -f support-relay/docker-compose.yml ]; then ( cd support-relay && docker compose down --remove-orphans ) 2>/dev/null || true fi # Stop main dev stack across all profiles. `down` without -v preserves # the named volumes (hyprcrd + relay data). docker compose --profile relay --profile support down --remove-orphans # Wipe support-relay storage — both the compose-managed named volume # and the stand-alone bind-mount location. Match volumes by suffix so # whatever compose-project-name was in effect (hyprcrd / something else) # we find it. for vol in $(docker volume ls -q | grep -E '(^|_)support-relay-data$' || true); do docker volume rm -f "$vol" >/dev/null echo " wiped volume: $vol" done if [ -d support-relay/data ]; then rm -f support-relay/data/*.db support-relay/data/*.db-* support-relay/data/master.key 2>/dev/null || true echo " wiped bind-mount: support-relay/data/" fi echo "" echo " all containers stopped." echo " support-relay data gone — next boot runs the setup wizard again" echo " and mints a fresh API key." echo " hyprcrd + relay data preserved."