From 4d756d4cfc04ccf53fc6aa02d0eb561032ad6754 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sun, 6 Feb 2022 16:58:55 -0500 Subject: [PATCH] disable base64 line wrapping to allow long password --- README.md | 2 +- root/etc/cont-init.d/98-cloudflared-config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 93fca8b..a15b568 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Container images/mods are configured using parameters passed at runtime (such as | `CF_ACCOUNT_ID` | Cloudflare account ID | | | `CF_API_TOKEN` | Cloudflare API token | Must have the `Account.Cloudflare Tunnel:Edit` and `Zone.DNS:Edit` permissions. | | `CF_TUNNEL_NAME` | Cloudflare tunnel name | | -| `CF_TUNNEL_PASSWORD` | Cloudflare tunnel password | 32 char minimum, 64 char maximum | +| `CF_TUNNEL_PASSWORD` | Cloudflare tunnel password | 32 char minimum | | `CF_TUNNEL_CONFIG` | Cloudflare tunnel config, please refer to Cloudflare's [official tunnel docs](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/configuration/configuration-file/ingress). | Do not add `tunnel`/`credentials-file` headers, these are handled automatically. | | `FILE__`| Sources content of the file as value in case of multiline content | `FILE__CF_TUNNEL_CONFIG=/config/tunnelconfig.yml` | diff --git a/root/etc/cont-init.d/98-cloudflared-config b/root/etc/cont-init.d/98-cloudflared-config index 880f6a3..34d46a9 100644 --- a/root/etc/cont-init.d/98-cloudflared-config +++ b/root/etc/cont-init.d/98-cloudflared-config @@ -79,7 +79,7 @@ if [[ ${#CF_ACCOUNT_ID} -gt 0 ]] && [[ ${#CF_API_TOKEN} -gt 0 ]] && [[ ${#CF_TUN echo "**** Cloudflare tunnel parameters found, starting cloudflare tunnel setup... ****" echo "**** Creating cloudflare tunnel (${CF_TUNNEL_NAME}) via API... ****" - CF_TUNNEL_SECRET="$(command echo ${CF_TUNNEL_PASSWORD} | base64)" + CF_TUNNEL_SECRET="$(command echo ${CF_TUNNEL_PASSWORD} | base64 -w 0)" JSON_RESULT=$(curl -sX \ POST "https://api.cloudflare.com/client/v4/accounts/${CF_ACCOUNT_ID}/tunnels" \ -H "Authorization: Bearer ${CF_API_TOKEN}" \