From 38035dc5af9ca088879d66c018492083d67a0741 Mon Sep 17 00:00:00 2001 From: wy580477 <98247050+wy580477@users.noreply.github.com> Date: Sat, 10 Aug 2024 15:49:27 +0800 Subject: [PATCH] disable tls when no domain name --- content/service/caddy/run | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/service/caddy/run b/content/service/caddy/run index 94d746b..fce878a 100644 --- a/content/service/caddy/run +++ b/content/service/caddy/run @@ -42,6 +42,10 @@ if [[ ! -f "/mnt/data/config/caddy/Caddyfile" ]]; then cp /workdir/Caddyfile /mnt/data/config/caddy/ fi +if [ "${CADDY_DOMAIN}" = "" ]; then + sed -i 's|tls '{'$CADDY_EMAIL'}'||' /mnt/data/config/caddy/Caddyfile +fi + cp -f /mnt/data/config/caddy/Caddyfile /tmp/Caddyfile HASH="$(caddy hash-password --plaintext ${GLOBAL_PASSWORD})" sed -i "s|HASH|${HASH}|g" /tmp/Caddyfile