From ed3970b5fdca40d547003f155fc875a0603c28f1 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Sun, 22 Feb 2026 10:35:44 +0100 Subject: [PATCH] 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 --- scripts/README.md | 2 +- scripts/felhom-wipe.sh | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index 693a240..f45e066 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -221,7 +221,7 @@ sudo ./felhom-wipe.sh --level full --yes | `soft` | Controller state files only: `settings.json`, `metrics.db`, `setup-state.json`, `update-state.json`, `session-data.json`, `snapshot-history.json` | | `controller` | Soft + all non-infra Docker containers, all Docker volumes (except `portainer_data`), all stack directories (skips protected stacks by default) | | `full` | `controller`-level cleanup + `felhom-data/` on all storage drives (appdata, backups). Also removes old-style `appdata/` and `backups/` directories for pre-v0.26.0 compatibility. Infra containers (including felhom-controller) are **preserved**; controller is restarted after cleanup. | -| `nuclear` | Full + `controller.yaml`, all infra containers (controller, traefik, cloudflared, portainer), DR markers (`.felhom-infra-backup/` on all drives), `docker system prune -af --volumes` | +| `nuclear` | Full + all infra containers (controller, traefik, cloudflared, portainer), DR markers (`.felhom-infra-backup/` on all drives), `docker system prune -af --volumes`, and all infra config directories (`/opt/docker/felhom-controller/`, `/opt/docker/traefik/`, `/opt/docker/cloudflared/`, `/opt/docker/stacks/`) | ### CLI options diff --git a/scripts/felhom-wipe.sh b/scripts/felhom-wipe.sh index a739cb1..9238f46 100644 --- a/scripts/felhom-wipe.sh +++ b/scripts/felhom-wipe.sh @@ -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}"