fix: declare cell-network external; pre-create in Makefile start/update
Unit Tests / test (push) Successful in 11m16s
Unit Tests / test (push) Successful in 11m16s
Docker Compose v5 enforces label ownership on networks it creates. On systems where cell-network was created by an older compose version (no labels), Caddy and other services fail to start with "incorrect label" error. Declaring the network external in docker-compose.yml skips label validation. The Makefile start/update targets now create the network if it doesn't exist (idempotent). The reinstall and uninstall (full) paths explicitly delete the network so fresh recreations are clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -102,6 +102,8 @@ init-peers:
|
|||||||
|
|
||||||
start:
|
start:
|
||||||
@echo "Starting Personal Internet Cell..."
|
@echo "Starting Personal Internet Cell..."
|
||||||
|
@docker network inspect cell-network >/dev/null 2>&1 || \
|
||||||
|
docker network create --driver bridge --subnet "$${CELL_NETWORK:-172.20.0.0/16}" cell-network
|
||||||
PUID=$$(id -u) PGID=$$(id -g) $(DCF) --profile core up -d --build
|
PUID=$$(id -u) PGID=$$(id -g) $(DCF) --profile core up -d --build
|
||||||
@echo "Services started. Check status with 'make status'"
|
@echo "Services started. Check status with 'make status'"
|
||||||
|
|
||||||
@@ -141,12 +143,15 @@ update:
|
|||||||
git pull
|
git pull
|
||||||
@git stash pop --quiet 2>/dev/null || true
|
@git stash pop --quiet 2>/dev/null || true
|
||||||
@echo "Rebuilding and restarting services..."
|
@echo "Rebuilding and restarting services..."
|
||||||
|
@docker network inspect cell-network >/dev/null 2>&1 || \
|
||||||
|
docker network create --driver bridge --subnet "$${CELL_NETWORK:-172.20.0.0/16}" cell-network
|
||||||
PUID=$$(id -u) PGID=$$(id -g) $(DCF) --profile core up -d --build
|
PUID=$$(id -u) PGID=$$(id -g) $(DCF) --profile core up -d --build
|
||||||
@echo "Update complete. Run 'make status' to verify."
|
@echo "Update complete. Run 'make status' to verify."
|
||||||
|
|
||||||
reinstall:
|
reinstall:
|
||||||
@echo "Reinstalling Personal Internet Cell from scratch..."
|
@echo "Reinstalling Personal Internet Cell from scratch..."
|
||||||
PUID=$$(id -u) PGID=$$(id -g) $(DCF) --profile core down -v 2>/dev/null || true
|
PUID=$$(id -u) PGID=$$(id -g) $(DCF) --profile core down 2>/dev/null || true
|
||||||
|
docker network rm cell-network 2>/dev/null || true
|
||||||
@sudo rm -rf config/ data/
|
@sudo rm -rf config/ data/
|
||||||
@$(MAKE) setup
|
@$(MAKE) setup
|
||||||
@$(MAKE) start
|
@$(MAKE) start
|
||||||
@@ -176,7 +181,8 @@ uninstall:
|
|||||||
y|Y) \
|
y|Y) \
|
||||||
echo "Stopping containers and removing images..."; \
|
echo "Stopping containers and removing images..."; \
|
||||||
for f in data/services/*/docker-compose.yml; do [ -f "$$f" ] && PUID=$$(id -u) PGID=$$(id -g) docker compose -f "$$f" down 2>/dev/null || true; done; \
|
for f in data/services/*/docker-compose.yml; do [ -f "$$f" ] && PUID=$$(id -u) PGID=$$(id -g) docker compose -f "$$f" down 2>/dev/null || true; done; \
|
||||||
PUID=$$(id -u) PGID=$$(id -g) $(DCF) --profile core down -v --rmi all 2>/dev/null || true; \
|
PUID=$$(id -u) PGID=$$(id -g) $(DCF) --profile core down --rmi all 2>/dev/null || true; \
|
||||||
|
docker network rm cell-network 2>/dev/null || true; \
|
||||||
echo "Deleting config/ and data/..."; \
|
echo "Deleting config/ and data/..."; \
|
||||||
sudo rm -rf config/ data/; \
|
sudo rm -rf config/ data/; \
|
||||||
echo "Uninstall complete. Git repo and scripts remain."; \
|
echo "Uninstall complete. Git repo and scripts remain."; \
|
||||||
|
|||||||
+1
-4
@@ -181,7 +181,4 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
cell-network:
|
cell-network:
|
||||||
name: cell-network
|
name: cell-network
|
||||||
driver: bridge
|
external: true
|
||||||
ipam:
|
|
||||||
config:
|
|
||||||
- subnet: ${CELL_NETWORK:-172.20.0.0/16}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user