-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (31 loc) Β· 1.03 KB
/
Makefile
File metadata and controls
33 lines (31 loc) Β· 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
.PHONY: tunnel clean
tunnel: clean
@echo "π Starting cloudflared tunnel..."
@touch .env.local
@docker compose up -d cloudflared
@echo "β³ Waiting for tunnel URL (this may take 30-60 seconds)..."
@timeout=60; \
while [ $$timeout -gt 0 ]; do \
TUNNEL_URL=$$(docker compose logs cloudflared 2>&1 | grep -o 'https://[^[:space:]]*\.trycloudflare\.com' | tail -1); \
if [ -n "$$TUNNEL_URL" ]; then \
echo "β
Tunnel URL: $$TUNNEL_URL"; \
echo "WEBHOOK_URL=$$TUNNEL_URL/" > .env.local; \
echo "π Created .env.local with WEBHOOK_URL=$$TUNNEL_URL/"; \
echo "π Ready! Run 'docker compose up -d' to start n8n"; \
exit 0; \
fi; \
sleep 2; \
timeout=$$((timeout-2)); \
printf "."; \
done; \
echo ""; \
echo "β Timeout waiting for tunnel URL. Check logs:"; \
docker compose logs cloudflared; \
echo ""; \
echo "π‘ Try running 'make tunnel' again or check if cloudflared is working properly"
clean:
@echo "π§Ή Cleaning up..."
@touch .env.local
@docker compose down
@rm -f .env.local
@echo "β
Cleanup complete"