Skip to content

Commit fb0a496

Browse files
committed
Fix Justfile tunnel_setup: generate config.yml via printf to avoid parser issues
1 parent 578ffa1 commit fb0a496

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Justfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ tunnel_setup:
2828
@bash -c 'TUNNEL_ID=$$(cloudflared tunnel list | grep "{{TUNNEL_NAME}}" | awk "{print \$$1}" | head -n1); \
2929
if [ -z "$$TUNNEL_ID" ]; then echo "ERROR: Could not find tunnel ID"; exit 1; fi; \
3030
mkdir -p {{CLOUDFLARE_CREDS_DIR}}; \
31-
cat > {{CLOUDFLARE_CREDS_DIR}}/config.yml <<"EOF"
32-
tunnel: $TUNNEL_ID
33-
credentials-file: {{CLOUDFLARE_CREDS_DIR}}/$TUNNEL_ID.json
34-
35-
36-
- hostname: hitchhiker.optgeo.org
37-
service: http://localhost:80
38-
- service: http_status:404
39-
EOF
31+
printf "%s\n" \
32+
"tunnel: $$TUNNEL_ID" \
33+
"credentials-file: {{CLOUDFLARE_CREDS_DIR}}/$$TUNNEL_ID.json" \
34+
"" \
35+
"ingress:" \
36+
" - hostname: hitchhiker.optgeo.org" \
37+
" service: http://localhost:80" \
38+
" - service: http_status:404" \
39+
> {{CLOUDFLARE_CREDS_DIR}}/config.yml; \
4040
echo "config.yml created at {{CLOUDFLARE_CREDS_DIR}}/config.yml"; \
4141
echo ""; \
4242
echo "Tunnel ID: $$TUNNEL_ID"; \

0 commit comments

Comments
 (0)