fix(felhom-wipe): nuclear level now removes infra config directories

After docker system prune, the nuclear wipe now also removes:
- /opt/docker/felhom-controller/ (compose + .env)
- /opt/docker/traefik/ (configs + acme.json)
- /opt/docker/cloudflared/ (configs)
- /opt/docker/stacks/ (empty dir)

These were left behind previously, preventing a clean redeploy since
docker-setup.sh checks for existing installations and skips steps
if directories already exist.

Also updated print_plan to show these deletions in the dry-run output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 10:35:44 +01:00
parent 4a9ed71b7a
commit ed3970b5fd
2 changed files with 14 additions and 4 deletions
+13 -3
View File
@@ -240,6 +240,11 @@ print_plan() {
echo -e " ${RED}DELETE${NC} Portainer container + volume"
echo -e " ${RED}DELETE${NC} .felhom-infra-backup/ (DR markers on all drives)"
echo -e " ${RED}DELETE${NC} All Docker data (docker system prune -af --volumes)"
echo -e " ${RED}DELETE${NC} $COMPOSE_DIR/ (controller compose + .env)"
local infra_root; infra_root=$(dirname "$COMPOSE_DIR")
echo -e " ${RED}DELETE${NC} $infra_root/traefik/ (configs + acme.json)"
echo -e " ${RED}DELETE${NC} $infra_root/cloudflared/ (configs)"
echo -e " ${RED}DELETE${NC} $STACKS_DIR/ (empty stacks dir)"
fi
echo ""
@@ -346,9 +351,6 @@ do_nuclear_wipe() {
docker rm -f "$c" 2>/dev/null && info " Removed: $c" || true
done
# Remove controller.yaml
[ -f "$CONTROLLER_YAML" ] && rm -f "$CONTROLLER_YAML" && info " Removed: controller.yaml"
# Remove DR markers (nuclear = brand-new machine simulation)
for sp in "${STORAGE_PATHS[@]}"; do
if [ -d "$sp/.felhom-infra-backup" ]; then
@@ -360,6 +362,14 @@ do_nuclear_wipe() {
warn "Pruning all Docker data..."
docker system prune -af --volumes 2>/dev/null || warn "Docker prune failed"
# Remove infra config directories (after prune so containers are gone)
local infra_root
infra_root=$(dirname "$COMPOSE_DIR")
rm -rf "$COMPOSE_DIR" && info " Removed: $COMPOSE_DIR/"
rm -rf "$infra_root/traefik" && info " Removed: $infra_root/traefik/"
rm -rf "$infra_root/cloudflared" && info " Removed: $infra_root/cloudflared/"
rm -rf "$STACKS_DIR" && info " Removed: $STACKS_DIR/"
echo ""
info "Nuclear wipe complete."
echo -e "${CYAN}To redeploy, run:${NC}"