Describe the feature you'd like
I would like an cloudflared tunnel cred-file <TUNNEL_NAME> option
Additional context
Cego A/S is migrating away from legacy argo tunnels to named tunnels.
It would ease our transition if we could retrieve an already generated credential file via cloudflared tunnel cli
Here is our use case in Gitlab CI/CD YML format
---
# .gitlab-ci.yml
deploy:
variables:
TUNNEL_CERTIFICATE_FILE: # Found in our Gitlab CI/CD variables. (Cert.pem from cloudflared login)
TUNNEL_NAME: somesub.cego.dk
script:
- TUNNEL_ORIGIN_CERT="${TUNNEL_CERTIFICATE_FILE}"
- |
cloudflared tunnel cred-file "${TUNNEL_NAME}" --output .cloudflared ||
(cloudflared tunnel create "${TUNNEL_NAME}" &&
cloudflared tunnel route dns "${TUNNEL_NAME}" "${TUNNEL_NAME}")
- TUNNEL_CRED_FILE=$(find .cloudflared -name '*.json')
- TUNNEL_UUID=$(grep -oP '"TunnelID":"\K(.*)(?=")' ${TUNNEL_CRED_FILE})
- docker stack deploy
---
# docker-compose.yml
configs:
cloudflared-cred-file:
file: ${TUNNEL_CRED_FILE}
services:
cloudflared:
image: cloudflare/cloudflared:2022.3.1
command: tunnel run ${TUNNEL_UUID}
configs:
- source: cloudflared-cred-file
target: /etc/cloudflared/${TUNNEL_UUID}.json
environment:
TUNNEL_URL: http://${STACK_NAME}_web
Describe the feature you'd like
I would like an
cloudflared tunnel cred-file <TUNNEL_NAME>optionAdditional context
Cego A/S is migrating away from legacy argo tunnels to named tunnels.
It would ease our transition if we could retrieve an already generated credential file via cloudflared tunnel cli
Here is our use case in Gitlab CI/CD YML format