diff --git a/Makefile b/Makefile index 6e2fbeb..91847c7 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ COMPOSE := $(DOCKER_COMPOSE_BIN) --env-file $(ENV_FILE) -p $(COMPOSE_PROJECT) -f CONTAINER_NAME = $(COMPOSE_PROJECT)-$(SERVICE)-1 ENV_REQUIRED := TELEGRAM_API_KEY CLIENT_TELEGRAM_API_KEY POSTGRES_DB POSTGRES_USER POSTGRES_PASSWORD DATABASE_URL SANIC_PORT BACKEND_HTTP_PORT -.PHONY: help bootstrap start up down stop restart build ps status logs logs-% tail tail-% shell shell-% env-check clean clean-images destroy nuke prune data-paths +.PHONY: help bootstrap start up down stop restart build ps status logs logs-% tail tail-% shell shell-% env-check reset-config clean clean-images destroy nuke prune data-paths help: @echo "Available targets:" @@ -26,6 +26,7 @@ help: @echo " make shell SERVICE=x # open bash inside service" @echo " make clean # remove containers, keep data" @echo " make destroy CONFIRM=1# nuke containers + volumes + data" + @echo " make reset-config # remove .env/.bak and swarm key" @echo " make env-check # validate critical .env entries" bootstrap start: @@ -88,6 +89,12 @@ env-check: exit 1; \ fi + +reset-config: + rm -f $(ENV_FILE) $(ENV_FILE).bak + rm -f ipfs/swarm.key + @echo "Configuration artifacts removed. Next run make bootstrap." + clean: $(COMPOSE) down --remove-orphans diff --git a/ipfs/init/001-config.sh b/ipfs/init/001-config.sh index e9c3f8e..41a2b49 100644 --- a/ipfs/init/001-config.sh +++ b/ipfs/init/001-config.sh @@ -17,6 +17,9 @@ ipfs config --json Reprovider '{ "Interval": "22h", "Strategy": "pinned+mfs" }' # Keep connection manager within reasonable bounds ipfs config --json Swarm.ConnMgr '{ "Type": "basic", "LowWater": 50, "HighWater": 200, "GracePeriod": "20s" }' +# Disable public AutoConf when running with a private swarm key +ipfs config AutoConf.Enabled false + # CORS for RPC API (visible only in docker network) ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT","POST","GET"]'