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
+1 -1
View File
@@ -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
+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}"