From 9e53f256d0c265f38d9bed49d2e72f5563eb888c Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 26 Jan 2026 11:43:26 +0100 Subject: [PATCH 001/167] Create dns_czechia.sh This PR adds a DNS API plugin for CZECHIA.COM / RegZone (ZONER a.s.). - Supports ACME DNS-01 TXT record management - Uses official REST API (Swagger) - Credentials are stored in account.conf for non-interactive renewals - IP whitelisting is not required for DNS TXT changes used for SSL automation (per official REST API terms) Tested with: - acme.sh v3.x - Zones: zoner-test.eu --- dnsapi/dns_czechia.sh | 239 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 dnsapi/dns_czechia.sh diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh new file mode 100644 index 00000000..0f6ec8c7 --- /dev/null +++ b/dnsapi/dns_czechia.sh @@ -0,0 +1,239 @@ +#!/usr/bin/env sh +# dns_czechia.sh - Czechia/ZONER DNS API for acme.sh (DNS-01) +# +# Endpoint: +# https://api.czechia.com/api/DNS//TXT +# Header: +# authorizationToken: +# Body: +# {"hostName":"...","text":"...","ttl":3600,"publishZone":1} +# +# Required env: +# CZ_AuthorizationToken (saved to account.conf for automatic renewals) +# CZ_Zone (default apex zone), e.g. example.com +# - for multi-domain SAN, use CZ_Zones (see below) +# +# Optional env (multi-zone): +# CZ_Zones list of zones separated by comma/space, e.g. "example.com,example.net" +# For DNS-01 SAN, the plugin picks the longest matching zone suffix per-domain. +# +# Optional env (can be saved): +# CZ_TTL (default 3600) +# CZ_PublishZone (default 1) +# CZ_API_BASE (default https://api.czechia.com) +# CZ_CURL_TIMEOUT (default 30) + + +dns_czechia_add() { + fulldomain="$1" + txtvalue="$2" + + _info "Czechia DNS add TXT for $fulldomain" + _czechia_load_conf || return 1 + + zone="$(_czechia_pick_zone "$fulldomain")" || return 1 + host="$(_czechia_rel_host "$fulldomain" "$zone")" || return 1 + url="$CZ_API_BASE/api/DNS/$zone/TXT" + body="$(_czechia_build_body "$host" "$txtvalue")" + + _info "Czechia zone: $zone" + _info "Czechia API URL: $url" + _info "Czechia hostName: $host" + + _czechia_api_request "POST" "$url" "$body" +} + + +dns_czechia_rm() { + fulldomain="$1" + txtvalue="$2" + + _info "Czechia DNS remove TXT for $fulldomain" + _czechia_load_conf || return 1 + + zone="$(_czechia_pick_zone "$fulldomain")" || return 1 + host="$(_czechia_rel_host "$fulldomain" "$zone")" || return 1 + url="$CZ_API_BASE/api/DNS/$zone/TXT" + body="$(_czechia_build_body "$host" "$txtvalue")" + + _info "Czechia zone: $zone" + _info "Czechia API URL: $url" + _info "Czechia hostName: $host" + + _czechia_api_request "DELETE" "$url" "$body" +} + + +_czechia_load_conf() { + # token must be available for automatic renewals (read from env or account.conf) + CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_readaccountconf_mutable CZ_AuthorizationToken)}" + if [ -z "$CZ_AuthorizationToken" ]; then + CZ_AuthorizationToken="" + _err "CZ_AuthorizationToken is missing." + _err "Export it first: export CZ_AuthorizationToken=\"...\"" + return 1 + fi + _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" + + # other settings can be env or saved + CZ_Zone="${CZ_Zone:-$(_readaccountconf_mutable CZ_Zone)}" + CZ_Zones="${CZ_Zones:-$(_readaccountconf_mutable CZ_Zones)}" + CZ_TTL="${CZ_TTL:-$(_readaccountconf_mutable CZ_TTL)}" + CZ_PublishZone="${CZ_PublishZone:-$(_readaccountconf_mutable CZ_PublishZone)}" + CZ_API_BASE="${CZ_API_BASE:-$(_readaccountconf_mutable CZ_API_BASE)}" + CZ_CURL_TIMEOUT="${CZ_CURL_TIMEOUT:-$(_readaccountconf_mutable CZ_CURL_TIMEOUT)}" + + # at least one zone source must be provided + if [ -z "$CZ_Zone" ] && [ -z "$CZ_Zones" ]; then + _err "CZ_Zone or CZ_Zones is required (apex zone), e.g. example.com or \"example.com,example.net\"" + return 1 + fi + + [ -z "$CZ_TTL" ] && CZ_TTL="3600" + [ -z "$CZ_PublishZone" ] && CZ_PublishZone="1" + [ -z "$CZ_API_BASE" ] && CZ_API_BASE="https://api.czechia.com" + [ -z "$CZ_CURL_TIMEOUT" ] && CZ_CURL_TIMEOUT="30" + + # normalize + CZ_Zone="$(printf "%s" "$CZ_Zone" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//')" + CZ_Zones="$(_czechia_norm_zonelist "$CZ_Zones")" + CZ_API_BASE="$(printf "%s" "$CZ_API_BASE" | sed 's:/*$::')" + + # persist non-secret config + _saveaccountconf_mutable CZ_Zone "$CZ_Zone" + _saveaccountconf_mutable CZ_Zones "$CZ_Zones" + _saveaccountconf_mutable CZ_TTL "$CZ_TTL" + _saveaccountconf_mutable CZ_PublishZone "$CZ_PublishZone" + _saveaccountconf_mutable CZ_API_BASE "$CZ_API_BASE" + _saveaccountconf_mutable CZ_CURL_TIMEOUT "$CZ_CURL_TIMEOUT" + + return 0 +} + + +_czechia_norm_zonelist() { + # Normalize comma/space separated list to a single comma-separated list + # - lowercased + # - trimmed + # - trailing dots removed + # - empty entries dropped + in="$1" + [ -z "$in" ] && return 0 + printf "%s" "$in" \ + | tr '[:upper:]' '[:lower:]' \ + | tr ' ' ',' \ + | tr -s ',' \ + | sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//; s/,,*/,/g' +} + + +_czechia_pick_zone() { + fulldomain="$1" + fd="$(printf "%s" "$fulldomain" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//')" + + best="" + bestlen=0 + + # 1) CZ_Zone as default (only if it matches) + if [ -n "$CZ_Zone" ]; then + z="$CZ_Zone" + case "$fd" in + "$z"|*".$z") + best="$z" + bestlen=${#z} + ;; + esac + fi + + # 2) CZ_Zones list (longest matching suffix wins) + if [ -n "$CZ_Zones" ]; then + oldifs="$IFS" + IFS=',' + for z in $CZ_Zones; do + z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" + [ -z "$z" ] && continue + case "$fd" in + "$z"|*".$z") + if [ ${#z} -gt $bestlen ]; then + best="$z" + bestlen=${#z} + fi + ;; + esac + done + IFS="$oldifs" + fi + + if [ -z "$best" ]; then + _err "No matching zone for '$fd'. Set CZ_Zone or CZ_Zones to include the apex zone for this domain." + return 1 + fi + + echo "$best" + return 0 +} + + +_czechia_rel_host() { + fulldomain="$1" + zone="$2" + + fd="$(printf "%s" "$fulldomain" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//')" + z="$(printf "%s" "$zone" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//')" + + if [ "$fd" = "$z" ]; then + echo "@" + return 0 + fi + + suffix=".$z" + case "$fd" in + *"$suffix") + rel="${fd%$suffix}" + [ -z "$rel" ] && rel="@" + echo "$rel" + return 0 + ;; + esac + + _err "fulldomain '$fd' is not under zone '$z'" + return 1 +} + + +_czechia_build_body() { + host="$1" + txt="$2" + txt_escaped="$(_czechia_json_escape "$txt")" + echo "{\"hostName\":\"$host\",\"text\":\"$txt_escaped\",\"ttl\":$CZ_TTL,\"publishZone\":$CZ_PublishZone}" +} + + +_czechia_json_escape() { + echo "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' +} + + +_czechia_api_request() { + method="$1" + url="$2" + body="$3" + + export _H1="authorizationToken: $CZ_AuthorizationToken" + export _H2="Content-Type: application/json" + + _info "Czechia request: $method $url" + _debug2 "Czechia body: $body" + + # _post() can do POST/PUT/DELETE; see DNS-API-Dev-Guide + resp="$(_post "$body" "$url" "" "$method" "application/json")" + post_ret="$?" + + if [ "$post_ret" -ne 0 ]; then + _err "Czechia API call failed (ret=$post_ret). Response: ${resp:-}" + return 1 + fi + + _debug2 "Czechia response: ${resp:-}" + return 0 +} From 30f1900da555e641cdc9b484641e588b3b434c01 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 29 Jan 2026 21:16:42 +0100 Subject: [PATCH 002/167] Update dns_czechia.sh Fix shellcheck warnings in dns_czechia plugin --- dnsapi/dns_czechia.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 0f6ec8c7..905b22a0 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -154,7 +154,7 @@ _czechia_pick_zone() { [ -z "$z" ] && continue case "$fd" in "$z"|*".$z") - if [ ${#z} -gt $bestlen ]; then + if [ "${#z}" -gt "$bestlen" ]; then best="$z" bestlen=${#z} fi @@ -189,7 +189,7 @@ _czechia_rel_host() { suffix=".$z" case "$fd" in *"$suffix") - rel="${fd%$suffix}" + rel="${fd%"$suffix"}" [ -z "$rel" ] && rel="@" echo "$rel" return 0 From 83d2e97f3d460a4a0f209e683be9546152986ddc Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 29 Jan 2026 21:23:03 +0100 Subject: [PATCH 003/167] Update dns_czechia.sh corrections --- dnsapi/dns_czechia.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 905b22a0..d7a1ea3c 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -119,11 +119,11 @@ _czechia_norm_zonelist() { # - empty entries dropped in="$1" [ -z "$in" ] && return 0 - printf "%s" "$in" \ - | tr '[:upper:]' '[:lower:]' \ - | tr ' ' ',' \ - | tr -s ',' \ - | sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//; s/,,*/,/g' + printf "%s" "$in" | + tr '[:upper:]' '[:lower:]' | + tr ' ' ',' | + tr -s ',' | + sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//; s/,,*/,/g' } @@ -137,12 +137,12 @@ _czechia_pick_zone() { # 1) CZ_Zone as default (only if it matches) if [ -n "$CZ_Zone" ]; then z="$CZ_Zone" - case "$fd" in - "$z"|*".$z") - best="$z" - bestlen=${#z} - ;; - esac + case "$fd" in + "$z" | *".$z") + best="$z" + bestlen=${#z} + ;; +esac fi # 2) CZ_Zones list (longest matching suffix wins) @@ -153,13 +153,13 @@ _czechia_pick_zone() { z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" [ -z "$z" ] && continue case "$fd" in - "$z"|*".$z") - if [ "${#z}" -gt "$bestlen" ]; then - best="$z" - bestlen=${#z} - fi - ;; - esac + "$z" | *".$z") + if [ "${#z}" -gt "$bestlen" ]; then + best="$z" + bestlen=${#z} + fi + ;; +esac done IFS="$oldifs" fi From d4c815d0aaaf89a29e995bcb6ea417393d2f1ca4 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Feb 2026 06:24:29 +0100 Subject: [PATCH 004/167] Update dns_czechia.sh format dns_czechia.sh --- dnsapi/dns_czechia.sh | 57 ++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index d7a1ea3c..7867f14b 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -23,7 +23,6 @@ # CZ_API_BASE (default https://api.czechia.com) # CZ_CURL_TIMEOUT (default 30) - dns_czechia_add() { fulldomain="$1" txtvalue="$2" @@ -43,7 +42,6 @@ dns_czechia_add() { _czechia_api_request "POST" "$url" "$body" } - dns_czechia_rm() { fulldomain="$1" txtvalue="$2" @@ -63,7 +61,6 @@ dns_czechia_rm() { _czechia_api_request "DELETE" "$url" "$body" } - _czechia_load_conf() { # token must be available for automatic renewals (read from env or account.conf) CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_readaccountconf_mutable CZ_AuthorizationToken)}" @@ -110,7 +107,6 @@ _czechia_load_conf() { return 0 } - _czechia_norm_zonelist() { # Normalize comma/space separated list to a single comma-separated list # - lowercased @@ -119,14 +115,13 @@ _czechia_norm_zonelist() { # - empty entries dropped in="$1" [ -z "$in" ] && return 0 - printf "%s" "$in" | - tr '[:upper:]' '[:lower:]' | - tr ' ' ',' | - tr -s ',' | - sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//; s/,,*/,/g' + printf "%s" "$in" | + tr '[:upper:]' '[:lower:]' | + tr ' ' ',' | + tr -s ',' | + sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//; s/,,*/,/g' } - _czechia_pick_zone() { fulldomain="$1" fd="$(printf "%s" "$fulldomain" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//')" @@ -137,12 +132,12 @@ _czechia_pick_zone() { # 1) CZ_Zone as default (only if it matches) if [ -n "$CZ_Zone" ]; then z="$CZ_Zone" - case "$fd" in - "$z" | *".$z") - best="$z" - bestlen=${#z} - ;; -esac + case "$fd" in + "$z" | *".$z") + best="$z" + bestlen=${#z} + ;; + esac fi # 2) CZ_Zones list (longest matching suffix wins) @@ -153,13 +148,13 @@ esac z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" [ -z "$z" ] && continue case "$fd" in - "$z" | *".$z") - if [ "${#z}" -gt "$bestlen" ]; then - best="$z" - bestlen=${#z} - fi - ;; -esac + "$z" | *".$z") + if [ "${#z}" -gt "$bestlen" ]; then + best="$z" + bestlen=${#z} + fi + ;; + esac done IFS="$oldifs" fi @@ -173,7 +168,6 @@ esac return 0 } - _czechia_rel_host() { fulldomain="$1" zone="$2" @@ -188,19 +182,18 @@ _czechia_rel_host() { suffix=".$z" case "$fd" in - *"$suffix") - rel="${fd%"$suffix"}" - [ -z "$rel" ] && rel="@" - echo "$rel" - return 0 - ;; + *"$suffix") + rel="${fd%"$suffix"}" + [ -z "$rel" ] && rel="@" + echo "$rel" + return 0 + ;; esac _err "fulldomain '$fd' is not under zone '$z'" return 1 } - _czechia_build_body() { host="$1" txt="$2" @@ -208,12 +201,10 @@ _czechia_build_body() { echo "{\"hostName\":\"$host\",\"text\":\"$txt_escaped\",\"ttl\":$CZ_TTL,\"publishZone\":$CZ_PublishZone}" } - _czechia_json_escape() { echo "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' } - _czechia_api_request() { method="$1" url="$2" From d08f4afbdb11c5f88f5d239eba086b57eb3e703e Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 23 Feb 2026 11:06:46 +0100 Subject: [PATCH 005/167] Update dns_czechia.sh Refactor: use _lower_case() helper --- dnsapi/dns_czechia.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 7867f14b..1485a014 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -113,10 +113,13 @@ _czechia_norm_zonelist() { # - trimmed # - trailing dots removed # - empty entries dropped + in="$1" [ -z "$in" ] && return 0 + + in="$(_lower_case "$in")" + printf "%s" "$in" | - tr '[:upper:]' '[:lower:]' | tr ' ' ',' | tr -s ',' | sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//; s/,,*/,/g' From b7295178185cd5523063512a5c55b89b4aaffe27 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 23 Feb 2026 15:39:38 +0100 Subject: [PATCH 006/167] Update dns_czechia.sh Use _lower_case() consistently --- dnsapi/dns_czechia.sh | 49 +++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 1485a014..ac6d435e 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -92,7 +92,11 @@ _czechia_load_conf() { [ -z "$CZ_CURL_TIMEOUT" ] && CZ_CURL_TIMEOUT="30" # normalize - CZ_Zone="$(printf "%s" "$CZ_Zone" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//')" + if [ -n "$CZ_Zone" ]; then + CZ_Zone="$(_lower_case "$CZ_Zone")" + CZ_Zone="$(printf "%s" "$CZ_Zone" | sed 's/\.$//')" + fi + CZ_Zones="$(_czechia_norm_zonelist "$CZ_Zones")" CZ_API_BASE="$(printf "%s" "$CZ_API_BASE" | sed 's:/*$::')" @@ -127,7 +131,9 @@ _czechia_norm_zonelist() { _czechia_pick_zone() { fulldomain="$1" - fd="$(printf "%s" "$fulldomain" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//')" + + fd="$(_lower_case "$fulldomain")" + fd="$(printf "%s" "$fd" | sed 's/\.$//')" best="" bestlen=0 @@ -136,10 +142,10 @@ _czechia_pick_zone() { if [ -n "$CZ_Zone" ]; then z="$CZ_Zone" case "$fd" in - "$z" | *".$z") - best="$z" - bestlen=${#z} - ;; + "$z" | *".$z") + best="$z" + bestlen=${#z} + ;; esac fi @@ -151,12 +157,12 @@ _czechia_pick_zone() { z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" [ -z "$z" ] && continue case "$fd" in - "$z" | *".$z") - if [ "${#z}" -gt "$bestlen" ]; then - best="$z" - bestlen=${#z} - fi - ;; + "$z" | *".$z") + if [ "${#z}" -gt "$bestlen" ]; then + best="$z" + bestlen=${#z} + fi + ;; esac done IFS="$oldifs" @@ -175,8 +181,11 @@ _czechia_rel_host() { fulldomain="$1" zone="$2" - fd="$(printf "%s" "$fulldomain" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//')" - z="$(printf "%s" "$zone" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//')" + fd="$(_lower_case "$fulldomain")" + fd="$(printf "%s" "$fd" | sed 's/\.$//')" + + z="$(_lower_case "$zone")" + z="$(printf "%s" "$z" | sed 's/\.$//')" if [ "$fd" = "$z" ]; then echo "@" @@ -185,12 +194,12 @@ _czechia_rel_host() { suffix=".$z" case "$fd" in - *"$suffix") - rel="${fd%"$suffix"}" - [ -z "$rel" ] && rel="@" - echo "$rel" - return 0 - ;; + *"$suffix") + rel="${fd%"$suffix"}" + [ -z "$rel" ] && rel="@" + echo "$rel" + return 0 + ;; esac _err "fulldomain '$fd' is not under zone '$z'" From 3a1250958a6cd9a0aed28352a7a0bdc9aa89dffc Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 23 Feb 2026 15:46:39 +0100 Subject: [PATCH 007/167] Update dns_czechia.sh Fix _czechia_rel_host() structure --- dnsapi/dns_czechia.sh | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index ac6d435e..80994004 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -142,10 +142,10 @@ _czechia_pick_zone() { if [ -n "$CZ_Zone" ]; then z="$CZ_Zone" case "$fd" in - "$z" | *".$z") - best="$z" - bestlen=${#z} - ;; + "$z" | *".$z") + best="$z" + bestlen=${#z} + ;; esac fi @@ -157,12 +157,12 @@ _czechia_pick_zone() { z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" [ -z "$z" ] && continue case "$fd" in - "$z" | *".$z") - if [ "${#z}" -gt "$bestlen" ]; then - best="$z" - bestlen=${#z} - fi - ;; + "$z" | *".$z") + if [ "${#z}" -gt "$bestlen" ]; then + best="$z" + bestlen=${#z} + fi + ;; esac done IFS="$oldifs" @@ -194,18 +194,22 @@ _czechia_rel_host() { suffix=".$z" case "$fd" in - *"$suffix") - rel="${fd%"$suffix"}" - [ -z "$rel" ] && rel="@" - echo "$rel" - return 0 - ;; + *"$suffix") + rel="${fd%"$suffix"}" + [ -z "$rel" ] && rel="@" + echo "$rel" + return 0 + ;; esac _err "fulldomain '$fd' is not under zone '$z'" return 1 } + _err "fulldomain '$fd' is not under zone '$z'" + return 1 +} + _czechia_build_body() { host="$1" txt="$2" From c88177d6523cb7277f4fef79290879669911d5ac Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 23 Feb 2026 15:54:05 +0100 Subject: [PATCH 008/167] Update dns_czechia.sh fixing error --- dnsapi/dns_czechia.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 80994004..080282e3 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -206,10 +206,6 @@ _czechia_rel_host() { return 1 } - _err "fulldomain '$fd' is not under zone '$z'" - return 1 -} - _czechia_build_body() { host="$1" txt="$2" From a8c86e86fcda6aee54322296cc60c5e37a977d95 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 23 Feb 2026 16:27:06 +0100 Subject: [PATCH 009/167] Update dns_czechia.sh Fix _lower_case usage (use as stdin filter) --- dnsapi/dns_czechia.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 080282e3..ab97a60a 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -93,7 +93,7 @@ _czechia_load_conf() { # normalize if [ -n "$CZ_Zone" ]; then - CZ_Zone="$(_lower_case "$CZ_Zone")" + CZ_Zone="$(printf "%s" "$CZ_Zone" | _lower_case)" CZ_Zone="$(printf "%s" "$CZ_Zone" | sed 's/\.$//')" fi @@ -121,7 +121,7 @@ _czechia_norm_zonelist() { in="$1" [ -z "$in" ] && return 0 - in="$(_lower_case "$in")" + in="$(printf "%s" "$in" | _lower_case)" printf "%s" "$in" | tr ' ' ',' | @@ -132,7 +132,7 @@ _czechia_norm_zonelist() { _czechia_pick_zone() { fulldomain="$1" - fd="$(_lower_case "$fulldomain")" + fd="$(printf "%s" "$fulldomain" | _lower_case)" fd="$(printf "%s" "$fd" | sed 's/\.$//')" best="" @@ -181,10 +181,10 @@ _czechia_rel_host() { fulldomain="$1" zone="$2" - fd="$(_lower_case "$fulldomain")" + fd="$(printf "%s" "$fulldomain" | _lower_case)" fd="$(printf "%s" "$fd" | sed 's/\.$//')" - z="$(_lower_case "$zone")" + z="$(printf "%s" "$zone" | _lower_case)" z="$(printf "%s" "$z" | sed 's/\.$//')" if [ "$fd" = "$z" ]; then From c683651b5fb94c77946c45c50bb3bfb0f50e56bd Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 08:09:23 +0100 Subject: [PATCH 010/167] Update dns_czechia.sh Done. Removed CZ_Zones to avoid confusion and kept a single variable CZ_Zone. --- dnsapi/dns_czechia.sh | 70 +++++++++++++------------------------------ 1 file changed, 21 insertions(+), 49 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index ab97a60a..d507c673 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -10,12 +10,8 @@ # # Required env: # CZ_AuthorizationToken (saved to account.conf for automatic renewals) -# CZ_Zone (default apex zone), e.g. example.com -# - for multi-domain SAN, use CZ_Zones (see below) -# -# Optional env (multi-zone): -# CZ_Zones list of zones separated by comma/space, e.g. "example.com,example.net" -# For DNS-01 SAN, the plugin picks the longest matching zone suffix per-domain. +# CZ_Zones zone(s) separated by comma/space, e.g. "example.com" or "example.com,example.net" +# For SAN/wildcard, the plugin picks the longest matching zone suffix per-domain. # # Optional env (can be saved): # CZ_TTL (default 3600) @@ -73,16 +69,14 @@ _czechia_load_conf() { _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" # other settings can be env or saved - CZ_Zone="${CZ_Zone:-$(_readaccountconf_mutable CZ_Zone)}" CZ_Zones="${CZ_Zones:-$(_readaccountconf_mutable CZ_Zones)}" CZ_TTL="${CZ_TTL:-$(_readaccountconf_mutable CZ_TTL)}" CZ_PublishZone="${CZ_PublishZone:-$(_readaccountconf_mutable CZ_PublishZone)}" CZ_API_BASE="${CZ_API_BASE:-$(_readaccountconf_mutable CZ_API_BASE)}" CZ_CURL_TIMEOUT="${CZ_CURL_TIMEOUT:-$(_readaccountconf_mutable CZ_CURL_TIMEOUT)}" - # at least one zone source must be provided - if [ -z "$CZ_Zone" ] && [ -z "$CZ_Zones" ]; then - _err "CZ_Zone or CZ_Zones is required (apex zone), e.g. example.com or \"example.com,example.net\"" + if [ -z "$CZ_Zones" ]; then + _err "CZ_Zones is required (apex zone), e.g. \"example.com\" or \"example.com,example.net\"" return 1 fi @@ -91,17 +85,9 @@ _czechia_load_conf() { [ -z "$CZ_API_BASE" ] && CZ_API_BASE="https://api.czechia.com" [ -z "$CZ_CURL_TIMEOUT" ] && CZ_CURL_TIMEOUT="30" - # normalize - if [ -n "$CZ_Zone" ]; then - CZ_Zone="$(printf "%s" "$CZ_Zone" | _lower_case)" - CZ_Zone="$(printf "%s" "$CZ_Zone" | sed 's/\.$//')" - fi - CZ_Zones="$(_czechia_norm_zonelist "$CZ_Zones")" CZ_API_BASE="$(printf "%s" "$CZ_API_BASE" | sed 's:/*$::')" - # persist non-secret config - _saveaccountconf_mutable CZ_Zone "$CZ_Zone" _saveaccountconf_mutable CZ_Zones "$CZ_Zones" _saveaccountconf_mutable CZ_TTL "$CZ_TTL" _saveaccountconf_mutable CZ_PublishZone "$CZ_PublishZone" @@ -117,11 +103,10 @@ _czechia_norm_zonelist() { # - trimmed # - trailing dots removed # - empty entries dropped - in="$1" [ -z "$in" ] && return 0 - in="$(printf "%s" "$in" | _lower_case)" + in="$(_lower_case "$in")" printf "%s" "$in" | tr ' ' ',' | @@ -132,44 +117,30 @@ _czechia_norm_zonelist() { _czechia_pick_zone() { fulldomain="$1" - fd="$(printf "%s" "$fulldomain" | _lower_case)" + fd="$(_lower_case "$fulldomain")" fd="$(printf "%s" "$fd" | sed 's/\.$//')" best="" bestlen=0 - # 1) CZ_Zone as default (only if it matches) - if [ -n "$CZ_Zone" ]; then - z="$CZ_Zone" + oldifs="$IFS" + IFS=',' + for z in $CZ_Zones; do + z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" + [ -z "$z" ] && continue case "$fd" in "$z" | *".$z") - best="$z" - bestlen=${#z} + if [ "${#z}" -gt "$bestlen" ]; then + best="$z" + bestlen=${#z} + fi ;; esac - fi - - # 2) CZ_Zones list (longest matching suffix wins) - if [ -n "$CZ_Zones" ]; then - oldifs="$IFS" - IFS=',' - for z in $CZ_Zones; do - z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" - [ -z "$z" ] && continue - case "$fd" in - "$z" | *".$z") - if [ "${#z}" -gt "$bestlen" ]; then - best="$z" - bestlen=${#z} - fi - ;; - esac - done - IFS="$oldifs" - fi + done + IFS="$oldifs" if [ -z "$best" ]; then - _err "No matching zone for '$fd'. Set CZ_Zone or CZ_Zones to include the apex zone for this domain." + _err "No matching zone for '$fd'. Set CZ_Zones to include the apex zone for this domain." return 1 fi @@ -181,10 +152,10 @@ _czechia_rel_host() { fulldomain="$1" zone="$2" - fd="$(printf "%s" "$fulldomain" | _lower_case)" + fd="$(_lower_case "$fulldomain")" fd="$(printf "%s" "$fd" | sed 's/\.$//')" - z="$(printf "%s" "$zone" | _lower_case)" + z="$(_lower_case "$zone")" z="$(printf "%s" "$z" | sed 's/\.$//')" if [ "$fd" = "$z" ]; then @@ -214,6 +185,7 @@ _czechia_build_body() { } _czechia_json_escape() { + # Minimal JSON escaping for TXT value (backslash + quote) echo "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' } From 92bc58a9c18a6ac874004ad7bbfc93b92c271965 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 10:51:38 +0100 Subject: [PATCH 011/167] Update DNS.yml ci: debug docker.env and env variables for dns_czechia --- .github/workflows/DNS.yml | 42 +++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index fbe1e61f..a541b77b 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -67,30 +67,46 @@ jobs: TokenName5: ${{ secrets.TokenName5}} steps: - uses: actions/checkout@v6 + - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Set env file run: | cd ../acmetest - if [ "${{ secrets.TokenName1}}" ] ; then - echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env + rm -f docker.env + if [ "${{ secrets.TokenName1 }}" ] ; then + echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env fi - if [ "${{ secrets.TokenName2}}" ] ; then - echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env + if [ "${{ secrets.TokenName2 }}" ] ; then + echo "${{ secrets.TokenName2 }}=${{ secrets.TokenValue2 }}" >> docker.env fi - if [ "${{ secrets.TokenName3}}" ] ; then - echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env + if [ "${{ secrets.TokenName3 }}" ] ; then + echo "${{ secrets.TokenName3 }}=${{ secrets.TokenValue3 }}" >> docker.env fi - if [ "${{ secrets.TokenName4}}" ] ; then - echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env + if [ "${{ secrets.TokenName4 }}" ] ; then + echo "${{ secrets.TokenName4 }}=${{ secrets.TokenValue4 }}" >> docker.env fi - if [ "${{ secrets.TokenName5}}" ] ; then - echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env + if [ "${{ secrets.TokenName5 }}" ] ; then + echo "${{ secrets.TokenName5 }}=${{ secrets.TokenValue5 }}" >> docker.env fi - - name: Run acmetest - run: cd ../acmetest && ./rundocker.sh testall + - name: Debug env presence (safe) + run: | + echo "TEST_DNS=$TEST_DNS" + echo "TestingDomain=$TestingDomain" + echo "TEST_DNS_SLEEP=$TEST_DNS_SLEEP" + + echo "---- docker.env (keys only) ----" + if [ -f ../acmetest/docker.env ]; then + cut -d= -f1 ../acmetest/docker.env | sed 's/.*/- &/' + else + echo "docker.env NOT FOUND" + fi + - name: Run acmetest + run: cd ../acmetest && ./rundocker.sh testall + From 27d5ae596c1d5e9e2dc72f3184b7d3a887cddcad Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 12:53:24 +0100 Subject: [PATCH 012/167] Update DNS.yml --- .github/workflows/DNS.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index a541b77b..a758d918 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -669,6 +669,3 @@ jobs: run: | echo "See how to debug in VM:" echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - - From 4e2ddc8e5ddd337fd11efd2ff92f7419bdacc535 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 14:06:58 +0100 Subject: [PATCH 013/167] Update DNS.yml --- .github/workflows/DNS.yml | 44 +++++++++++++-------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index a758d918..ddb85862 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -67,46 +67,30 @@ jobs: TokenName5: ${{ secrets.TokenName5}} steps: - uses: actions/checkout@v6 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | cd ../acmetest - rm -f docker.env - if [ "${{ secrets.TokenName1 }}" ] ; then - echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env - fi - if [ "${{ secrets.TokenName2 }}" ] ; then - echo "${{ secrets.TokenName2 }}=${{ secrets.TokenValue2 }}" >> docker.env + if [ "${{ secrets.TokenName1}}" ] ; then + echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env fi - if [ "${{ secrets.TokenName3 }}" ] ; then - echo "${{ secrets.TokenName3 }}=${{ secrets.TokenValue3 }}" >> docker.env + if [ "${{ secrets.TokenName2}}" ] ; then + echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env fi - if [ "${{ secrets.TokenName4 }}" ] ; then - echo "${{ secrets.TokenName4 }}=${{ secrets.TokenValue4 }}" >> docker.env + if [ "${{ secrets.TokenName3}}" ] ; then + echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env fi - if [ "${{ secrets.TokenName5 }}" ] ; then - echo "${{ secrets.TokenName5 }}=${{ secrets.TokenValue5 }}" >> docker.env + if [ "${{ secrets.TokenName4}}" ] ; then + echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env fi - - - name: Debug env presence (safe) - run: | - echo "TEST_DNS=$TEST_DNS" - echo "TestingDomain=$TestingDomain" - echo "TEST_DNS_SLEEP=$TEST_DNS_SLEEP" - - echo "---- docker.env (keys only) ----" - if [ -f ../acmetest/docker.env ]; then - cut -d= -f1 ../acmetest/docker.env | sed 's/.*/- &/' - else - echo "docker.env NOT FOUND" + if [ "${{ secrets.TokenName5}}" ] ; then + echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env fi - name: Run acmetest - run: cd ../acmetest && ./rundocker.sh testall - + run: cd ../acmetest && ./rundocker.sh testall + @@ -669,3 +653,5 @@ jobs: run: | echo "See how to debug in VM:" echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + From f0826ba50ee1f4959aabe9682378ec0e2a9fadf8 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 14:33:59 +0100 Subject: [PATCH 014/167] Update DNS.yml --- .github/workflows/DNS.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index ddb85862..754b7dcb 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -88,6 +88,19 @@ jobs: echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env fi +- name: Debug docker.env (keys + CZ_* presence, safe) + run: | + echo "---- docker.env keys ----" + if [ -f ../acmetest/docker.env ]; then + cut -d= -f1 ../acmetest/docker.env | sed 's/^/- /' + else + echo "docker.env NOT FOUND" + fi + echo "---- CZ_* values masked ----" + if [ -f ../acmetest/docker.env ]; then + grep -E '^CZ_' ../acmetest/docker.env | sed 's/=.*$/=*** (masked)/' || true + fi + - name: Run acmetest run: cd ../acmetest && ./rundocker.sh testall From fa6d3494dd52144388daa372e6f76b3587b70018 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 14:39:08 +0100 Subject: [PATCH 015/167] Update DNS.yml --- .github/workflows/DNS.yml | 79 +++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 754b7dcb..aad09a5a 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -66,46 +66,45 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - name: Set env file - run: | - cd ../acmetest - if [ "${{ secrets.TokenName1}}" ] ; then - echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env - fi - if [ "${{ secrets.TokenName2}}" ] ; then - echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env - fi - if [ "${{ secrets.TokenName3}}" ] ; then - echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env - fi - if [ "${{ secrets.TokenName4}}" ] ; then - echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env - fi - if [ "${{ secrets.TokenName5}}" ] ; then - echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env - fi - -- name: Debug docker.env (keys + CZ_* presence, safe) - run: | - echo "---- docker.env keys ----" - if [ -f ../acmetest/docker.env ]; then - cut -d= -f1 ../acmetest/docker.env | sed 's/^/- /' - else - echo "docker.env NOT FOUND" - fi - echo "---- CZ_* values masked ----" - if [ -f ../acmetest/docker.env ]; then - grep -E '^CZ_' ../acmetest/docker.env | sed 's/=.*$/=*** (masked)/' || true - fi - - - name: Run acmetest - run: cd ../acmetest && ./rundocker.sh testall - - - + - uses: actions/checkout@v6 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Set env file + run: | + cd ../acmetest + if [ "${{ secrets.TokenName1}}" ] ; then + echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env + fi + if [ "${{ secrets.TokenName2}}" ] ; then + echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env + fi + if [ "${{ secrets.TokenName3}}" ] ; then + echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env + fi + if [ "${{ secrets.TokenName4}}" ] ; then + echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env + fi + if [ "${{ secrets.TokenName5}}" ] ; then + echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env + fi + - name: Debug env presence (safe) + run: | + echo "TEST_DNS=${TEST_DNS:+SET}" + echo "TestingDomain=${TestingDomain:+SET}" + echo "TEST_DNS_SLEEP=${TEST_DNS_SLEEP:+SET}" + echo "TokenName1=${TokenName1:+SET}" + echo "TokenName2=${TokenName2:+SET}" + echo "TokenName3=${TokenName3:+SET}" + echo "TokenName4=${TokenName4:+SET}" + echo "TokenName5=${TokenName5:+SET}" + echo "---- docker.env (keys only) ----" + if [ -f ../acmetest/docker.env ]; then + cut -d= -f1 ../acmetest/docker.env | sed 's/.*/- &/' + else + echo "docker.env NOT FOUND" + fi + - name: Run acmetest + run: cd ../acmetest && ./rundocker.sh testall MacOS: runs-on: macos-latest From 412a56d84e19c4d4c1af6224455abe27d5df9498 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 14:52:23 +0100 Subject: [PATCH 016/167] Update DNS.yml --- .github/workflows/DNS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index aad09a5a..8c33cb5b 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -50,8 +50,8 @@ jobs: needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS : dns_czechia + TestingDomain: zoner-test.eu TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} From 207058b8ac7338a1a6107a6a16a0de37805ad6c8 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 17:47:17 +0100 Subject: [PATCH 017/167] Update dns_czechia.sh dns_czechia: remove _lower_case helper and use POSIX-safe lowercasing Replace internal _lower_case calls with tr-based normalization to avoid helper dependency and follow acme.sh DNS plugin style. --- dnsapi/dns_czechia.sh | 107 +++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 63 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index d507c673..3166e4b7 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -24,17 +24,15 @@ dns_czechia_add() { txtvalue="$2" _info "Czechia DNS add TXT for $fulldomain" + _czechia_load_conf || return 1 zone="$(_czechia_pick_zone "$fulldomain")" || return 1 host="$(_czechia_rel_host "$fulldomain" "$zone")" || return 1 + url="$CZ_API_BASE/api/DNS/$zone/TXT" body="$(_czechia_build_body "$host" "$txtvalue")" - _info "Czechia zone: $zone" - _info "Czechia API URL: $url" - _info "Czechia hostName: $host" - _czechia_api_request "POST" "$url" "$body" } @@ -43,47 +41,44 @@ dns_czechia_rm() { txtvalue="$2" _info "Czechia DNS remove TXT for $fulldomain" + _czechia_load_conf || return 1 zone="$(_czechia_pick_zone "$fulldomain")" || return 1 host="$(_czechia_rel_host "$fulldomain" "$zone")" || return 1 + url="$CZ_API_BASE/api/DNS/$zone/TXT" body="$(_czechia_build_body "$host" "$txtvalue")" - _info "Czechia zone: $zone" - _info "Czechia API URL: $url" - _info "Czechia hostName: $host" - _czechia_api_request "DELETE" "$url" "$body" } +#################### Internal helpers #################### + _czechia_load_conf() { - # token must be available for automatic renewals (read from env or account.conf) + CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_readaccountconf_mutable CZ_AuthorizationToken)}" + if [ -z "$CZ_AuthorizationToken" ]; then - CZ_AuthorizationToken="" _err "CZ_AuthorizationToken is missing." - _err "Export it first: export CZ_AuthorizationToken=\"...\"" return 1 fi + _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" - # other settings can be env or saved CZ_Zones="${CZ_Zones:-$(_readaccountconf_mutable CZ_Zones)}" CZ_TTL="${CZ_TTL:-$(_readaccountconf_mutable CZ_TTL)}" CZ_PublishZone="${CZ_PublishZone:-$(_readaccountconf_mutable CZ_PublishZone)}" CZ_API_BASE="${CZ_API_BASE:-$(_readaccountconf_mutable CZ_API_BASE)}" - CZ_CURL_TIMEOUT="${CZ_CURL_TIMEOUT:-$(_readaccountconf_mutable CZ_CURL_TIMEOUT)}" if [ -z "$CZ_Zones" ]; then - _err "CZ_Zones is required (apex zone), e.g. \"example.com\" or \"example.com,example.net\"" + _err "CZ_Zones is required." return 1 fi [ -z "$CZ_TTL" ] && CZ_TTL="3600" [ -z "$CZ_PublishZone" ] && CZ_PublishZone="1" [ -z "$CZ_API_BASE" ] && CZ_API_BASE="https://api.czechia.com" - [ -z "$CZ_CURL_TIMEOUT" ] && CZ_CURL_TIMEOUT="30" CZ_Zones="$(_czechia_norm_zonelist "$CZ_Zones")" CZ_API_BASE="$(printf "%s" "$CZ_API_BASE" | sed 's:/*$::')" @@ -92,101 +87,91 @@ _czechia_load_conf() { _saveaccountconf_mutable CZ_TTL "$CZ_TTL" _saveaccountconf_mutable CZ_PublishZone "$CZ_PublishZone" _saveaccountconf_mutable CZ_API_BASE "$CZ_API_BASE" - _saveaccountconf_mutable CZ_CURL_TIMEOUT "$CZ_CURL_TIMEOUT" return 0 } _czechia_norm_zonelist() { - # Normalize comma/space separated list to a single comma-separated list - # - lowercased - # - trimmed - # - trailing dots removed - # - empty entries dropped in="$1" [ -z "$in" ] && return 0 - in="$(_lower_case "$in")" + in="$(printf "%s" "$in" | tr 'A-Z' 'a-z')" printf "%s" "$in" | tr ' ' ',' | tr -s ',' | - sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//; s/,,*/,/g' + sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//' } _czechia_pick_zone() { fulldomain="$1" - fd="$(_lower_case "$fulldomain")" - fd="$(printf "%s" "$fd" | sed 's/\.$//')" + fd="$(printf "%s" "$fulldomain" | tr 'A-Z' 'a-z' | sed 's/\.$//')" best="" bestlen=0 oldifs="$IFS" IFS=',' + for z in $CZ_Zones; do z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" - [ -z "$z" ] && continue + case "$fd" in - "$z" | *".$z") - if [ "${#z}" -gt "$bestlen" ]; then - best="$z" - bestlen=${#z} - fi - ;; + "$z" | *".$z") + if [ "${#z}" -gt "$bestlen" ]; then + best="$z" + bestlen=${#z} + fi + ;; esac done + IFS="$oldifs" if [ -z "$best" ]; then - _err "No matching zone for '$fd'. Set CZ_Zones to include the apex zone for this domain." + _err "No matching zone found for $fd" return 1 fi - echo "$best" - return 0 + printf "%s" "$best" } _czechia_rel_host() { fulldomain="$1" zone="$2" - fd="$(_lower_case "$fulldomain")" - fd="$(printf "%s" "$fd" | sed 's/\.$//')" - - z="$(_lower_case "$zone")" - z="$(printf "%s" "$z" | sed 's/\.$//')" + fd="$(printf "%s" "$fulldomain" | tr 'A-Z' 'a-z' | sed 's/\.$//')" + z="$(printf "%s" "$zone" | tr 'A-Z' 'a-z' | sed 's/\.$//')" if [ "$fd" = "$z" ]; then - echo "@" + printf "@" return 0 fi suffix=".$z" + case "$fd" in - *"$suffix") - rel="${fd%"$suffix"}" - [ -z "$rel" ] && rel="@" - echo "$rel" - return 0 - ;; + *"$suffix") + rel="${fd%"$suffix"}" + [ -z "$rel" ] && rel="@" + printf "%s" "$rel" + return 0 + ;; esac - _err "fulldomain '$fd' is not under zone '$z'" + _err "Domain $fd is not under zone $z" return 1 } _czechia_build_body() { host="$1" txt="$2" - txt_escaped="$(_czechia_json_escape "$txt")" - echo "{\"hostName\":\"$host\",\"text\":\"$txt_escaped\",\"ttl\":$CZ_TTL,\"publishZone\":$CZ_PublishZone}" -} -_czechia_json_escape() { - # Minimal JSON escaping for TXT value (backslash + quote) - echo "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' + txt_escaped="$(printf "%s" "$txt" | sed 's/\\/\\\\/g; s/"/\\"/g')" + + printf '{"hostName":"%s","text":"%s","ttl":%s,"publishZone":%s}' \ + "$host" "$txt_escaped" "$CZ_TTL" "$CZ_PublishZone" } _czechia_api_request() { @@ -197,18 +182,14 @@ _czechia_api_request() { export _H1="authorizationToken: $CZ_AuthorizationToken" export _H2="Content-Type: application/json" - _info "Czechia request: $method $url" - _debug2 "Czechia body: $body" - - # _post() can do POST/PUT/DELETE; see DNS-API-Dev-Guide - resp="$(_post "$body" "$url" "" "$method" "application/json")" - post_ret="$?" + response="$(_post "$body" "$url" "" "$method" "application/json")" + ret="$?" - if [ "$post_ret" -ne 0 ]; then - _err "Czechia API call failed (ret=$post_ret). Response: ${resp:-}" + if [ "$ret" != "0" ]; then + _err "Czechia API call failed." return 1 fi - _debug2 "Czechia response: ${resp:-}" + _debug2 "Response: $response" return 0 } From f448a58184c32439f325883414b9983fa24e6fc7 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 17:58:58 +0100 Subject: [PATCH 018/167] Update dns_czechia.sh fix(dnsapi): make dns_czechia.sh shellcheck/shfmt clean --- dnsapi/dns_czechia.sh | 103 ++++++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 43 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 3166e4b7..6fba9bd0 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -11,7 +11,7 @@ # Required env: # CZ_AuthorizationToken (saved to account.conf for automatic renewals) # CZ_Zones zone(s) separated by comma/space, e.g. "example.com" or "example.com,example.net" -# For SAN/wildcard, the plugin picks the longest matching zone suffix per-domain. +# For SAN/wildcard, the plugin picks the longest matching zone suffix per-domain. # # Optional env (can be saved): # CZ_TTL (default 3600) @@ -24,15 +24,17 @@ dns_czechia_add() { txtvalue="$2" _info "Czechia DNS add TXT for $fulldomain" - _czechia_load_conf || return 1 zone="$(_czechia_pick_zone "$fulldomain")" || return 1 host="$(_czechia_rel_host "$fulldomain" "$zone")" || return 1 - url="$CZ_API_BASE/api/DNS/$zone/TXT" body="$(_czechia_build_body "$host" "$txtvalue")" + _info "Czechia zone: $zone" + _info "Czechia API URL: $url" + _info "Czechia hostName: $host" + _czechia_api_request "POST" "$url" "$body" } @@ -41,44 +43,44 @@ dns_czechia_rm() { txtvalue="$2" _info "Czechia DNS remove TXT for $fulldomain" - _czechia_load_conf || return 1 zone="$(_czechia_pick_zone "$fulldomain")" || return 1 host="$(_czechia_rel_host "$fulldomain" "$zone")" || return 1 - url="$CZ_API_BASE/api/DNS/$zone/TXT" body="$(_czechia_build_body "$host" "$txtvalue")" + _info "Czechia zone: $zone" + _info "Czechia API URL: $url" + _info "Czechia hostName: $host" + _czechia_api_request "DELETE" "$url" "$body" } -#################### Internal helpers #################### - _czechia_load_conf() { - CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_readaccountconf_mutable CZ_AuthorizationToken)}" - if [ -z "$CZ_AuthorizationToken" ]; then _err "CZ_AuthorizationToken is missing." + _err "Export it first: export CZ_AuthorizationToken=\"...\"" return 1 fi - _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" CZ_Zones="${CZ_Zones:-$(_readaccountconf_mutable CZ_Zones)}" CZ_TTL="${CZ_TTL:-$(_readaccountconf_mutable CZ_TTL)}" CZ_PublishZone="${CZ_PublishZone:-$(_readaccountconf_mutable CZ_PublishZone)}" CZ_API_BASE="${CZ_API_BASE:-$(_readaccountconf_mutable CZ_API_BASE)}" + CZ_CURL_TIMEOUT="${CZ_CURL_TIMEOUT:-$(_readaccountconf_mutable CZ_CURL_TIMEOUT)}" if [ -z "$CZ_Zones" ]; then - _err "CZ_Zones is required." + _err "CZ_Zones is required (apex zone), e.g. \"example.com\" or \"example.com,example.net\"" return 1 fi [ -z "$CZ_TTL" ] && CZ_TTL="3600" [ -z "$CZ_PublishZone" ] && CZ_PublishZone="1" [ -z "$CZ_API_BASE" ] && CZ_API_BASE="https://api.czechia.com" + [ -z "$CZ_CURL_TIMEOUT" ] && CZ_CURL_TIMEOUT="30" CZ_Zones="$(_czechia_norm_zonelist "$CZ_Zones")" CZ_API_BASE="$(printf "%s" "$CZ_API_BASE" | sed 's:/*$::')" @@ -87,91 +89,102 @@ _czechia_load_conf() { _saveaccountconf_mutable CZ_TTL "$CZ_TTL" _saveaccountconf_mutable CZ_PublishZone "$CZ_PublishZone" _saveaccountconf_mutable CZ_API_BASE "$CZ_API_BASE" + _saveaccountconf_mutable CZ_CURL_TIMEOUT "$CZ_CURL_TIMEOUT" return 0 } _czechia_norm_zonelist() { + # Normalize comma/space separated list to a single comma-separated list + # - lowercased + # - trimmed + # - trailing dots removed + # - empty entries dropped in="$1" [ -z "$in" ] && return 0 - in="$(printf "%s" "$in" | tr 'A-Z' 'a-z')" + in="$(_lower_case "$in")" printf "%s" "$in" | tr ' ' ',' | tr -s ',' | - sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//' + sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//; s/,,*/,/g' } _czechia_pick_zone() { fulldomain="$1" - fd="$(printf "%s" "$fulldomain" | tr 'A-Z' 'a-z' | sed 's/\.$//')" + fd="$(_lower_case "$fulldomain")" + fd="$(printf "%s" "$fd" | sed 's/\.$//')" best="" bestlen=0 oldifs="$IFS" IFS=',' - for z in $CZ_Zones; do z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" + [ -z "$z" ] && continue case "$fd" in - "$z" | *".$z") - if [ "${#z}" -gt "$bestlen" ]; then - best="$z" - bestlen=${#z} - fi - ;; + "$z" | *".$z") + if [ "${#z}" -gt "$bestlen" ]; then + best="$z" + bestlen=${#z} + fi + ;; esac done - IFS="$oldifs" if [ -z "$best" ]; then - _err "No matching zone found for $fd" + _err "No matching zone for '$fd'. Set CZ_Zones to include the apex zone for this domain." return 1 fi printf "%s" "$best" + return 0 } _czechia_rel_host() { fulldomain="$1" zone="$2" - fd="$(printf "%s" "$fulldomain" | tr 'A-Z' 'a-z' | sed 's/\.$//')" - z="$(printf "%s" "$zone" | tr 'A-Z' 'a-z' | sed 's/\.$//')" + fd="$(_lower_case "$fulldomain")" + fd="$(printf "%s" "$fd" | sed 's/\.$//')" + + z="$(_lower_case "$zone")" + z="$(printf "%s" "$z" | sed 's/\.$//')" if [ "$fd" = "$z" ]; then - printf "@" + printf "%s" "@" return 0 fi suffix=".$z" - case "$fd" in - *"$suffix") - rel="${fd%"$suffix"}" - [ -z "$rel" ] && rel="@" - printf "%s" "$rel" - return 0 - ;; + *"$suffix") + rel="${fd%"$suffix"}" + [ -z "$rel" ] && rel="@" + printf "%s" "$rel" + return 0 + ;; esac - _err "Domain $fd is not under zone $z" + _err "fulldomain '$fd' is not under zone '$z'" return 1 } _czechia_build_body() { host="$1" txt="$2" + txt_escaped="$(_czechia_json_escape "$txt")" + printf "%s" "{\"hostName\":\"$host\",\"text\":\"$txt_escaped\",\"ttl\":$CZ_TTL,\"publishZone\":$CZ_PublishZone}" +} - txt_escaped="$(printf "%s" "$txt" | sed 's/\\/\\\\/g; s/"/\\"/g')" - - printf '{"hostName":"%s","text":"%s","ttl":%s,"publishZone":%s}' \ - "$host" "$txt_escaped" "$CZ_TTL" "$CZ_PublishZone" +_czechia_json_escape() { + # Minimal JSON escaping for TXT value (backslash + quote) + printf "%s" "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' } _czechia_api_request() { @@ -181,15 +194,19 @@ _czechia_api_request() { export _H1="authorizationToken: $CZ_AuthorizationToken" export _H2="Content-Type: application/json" + export _CURL_TIMEOUT="$CZ_CURL_TIMEOUT" + + _info "Czechia request: $method $url" + _debug2 "Czechia body: $body" - response="$(_post "$body" "$url" "" "$method" "application/json")" - ret="$?" + resp="$(_post "$body" "$url" "" "$method" "application/json")" + post_ret="$?" - if [ "$ret" != "0" ]; then - _err "Czechia API call failed." + if [ "$post_ret" -ne 0 ]; then + _err "Czechia API call failed (ret=$post_ret). Response: ${resp:-}" return 1 fi - _debug2 "Response: $response" + _debug2 "Czechia response: ${resp:-}" return 0 } From 84274db631f5b08d01e42f688b1c45aa54f916a4 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 18:08:10 +0100 Subject: [PATCH 019/167] Update dns_czechia.sh dns_czechia: use _lower_case() instead of tr --- dnsapi/dns_czechia.sh | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 6fba9bd0..33623a2e 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -31,10 +31,6 @@ dns_czechia_add() { url="$CZ_API_BASE/api/DNS/$zone/TXT" body="$(_czechia_build_body "$host" "$txtvalue")" - _info "Czechia zone: $zone" - _info "Czechia API URL: $url" - _info "Czechia hostName: $host" - _czechia_api_request "POST" "$url" "$body" } @@ -50,10 +46,6 @@ dns_czechia_rm() { url="$CZ_API_BASE/api/DNS/$zone/TXT" body="$(_czechia_build_body "$host" "$txtvalue")" - _info "Czechia zone: $zone" - _info "Czechia API URL: $url" - _info "Czechia hostName: $host" - _czechia_api_request "DELETE" "$url" "$body" } @@ -61,7 +53,6 @@ _czechia_load_conf() { CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_readaccountconf_mutable CZ_AuthorizationToken)}" if [ -z "$CZ_AuthorizationToken" ]; then _err "CZ_AuthorizationToken is missing." - _err "Export it first: export CZ_AuthorizationToken=\"...\"" return 1 fi _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" @@ -73,7 +64,7 @@ _czechia_load_conf() { CZ_CURL_TIMEOUT="${CZ_CURL_TIMEOUT:-$(_readaccountconf_mutable CZ_CURL_TIMEOUT)}" if [ -z "$CZ_Zones" ]; then - _err "CZ_Zones is required (apex zone), e.g. \"example.com\" or \"example.com,example.net\"" + _err "CZ_Zones is required." return 1 fi @@ -95,11 +86,6 @@ _czechia_load_conf() { } _czechia_norm_zonelist() { - # Normalize comma/space separated list to a single comma-separated list - # - lowercased - # - trimmed - # - trailing dots removed - # - empty entries dropped in="$1" [ -z "$in" ] && return 0 @@ -137,13 +123,9 @@ _czechia_pick_zone() { done IFS="$oldifs" - if [ -z "$best" ]; then - _err "No matching zone for '$fd'. Set CZ_Zones to include the apex zone for this domain." - return 1 - fi + [ -z "$best" ] && return 1 printf "%s" "$best" - return 0 } _czechia_rel_host() { @@ -171,7 +153,6 @@ _czechia_rel_host() { ;; esac - _err "fulldomain '$fd' is not under zone '$z'" return 1 } @@ -183,7 +164,6 @@ _czechia_build_body() { } _czechia_json_escape() { - # Minimal JSON escaping for TXT value (backslash + quote) printf "%s" "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' } @@ -196,17 +176,6 @@ _czechia_api_request() { export _H2="Content-Type: application/json" export _CURL_TIMEOUT="$CZ_CURL_TIMEOUT" - _info "Czechia request: $method $url" - _debug2 "Czechia body: $body" - resp="$(_post "$body" "$url" "" "$method" "application/json")" - post_ret="$?" - - if [ "$post_ret" -ne 0 ]; then - _err "Czechia API call failed (ret=$post_ret). Response: ${resp:-}" - return 1 - fi - - _debug2 "Czechia response: ${resp:-}" - return 0 + return "$?" } From 07a52bacc4993a7de0f7bba2d66d7e3e5309cf5f Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 18:20:56 +0100 Subject: [PATCH 020/167] Update dns_czechia.sh dns_czechia: fix shellcheck unused variable --- dnsapi/dns_czechia.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 33623a2e..bd9e4d90 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -176,6 +176,6 @@ _czechia_api_request() { export _H2="Content-Type: application/json" export _CURL_TIMEOUT="$CZ_CURL_TIMEOUT" - resp="$(_post "$body" "$url" "" "$method" "application/json")" - return "$?" + # _post() handles POST/PUT/DELETE when method is provided. + _post "$body" "$url" "" "$method" "application/json" } From 40483546b7f9e920f88f583ebe5189cf28a9d61e Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 19:01:40 +0100 Subject: [PATCH 021/167] Update DNS.yml ci: fix docker.env export + add safe env debug --- .github/workflows/DNS.yml | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 8c33cb5b..148dd4c8 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -72,34 +72,20 @@ jobs: - name: Set env file run: | cd ../acmetest - if [ "${{ secrets.TokenName1}}" ] ; then - echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env - fi - if [ "${{ secrets.TokenName2}}" ] ; then - echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env - fi - if [ "${{ secrets.TokenName3}}" ] ; then - echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env - fi - if [ "${{ secrets.TokenName4}}" ] ; then - echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env - fi - if [ "${{ secrets.TokenName5}}" ] ; then - echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env - fi + : > docker.env + if [ "${{ secrets.TokenName1 }}" ]; then echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env; fi + if [ "${{ secrets.TokenName2 }}" ]; then echo "${{ secrets.TokenName2 }}=${{ secrets.TokenValue2 }}" >> docker.env; fi + if [ "${{ secrets.TokenName3 }}" ]; then echo "${{ secrets.TokenName3 }}=${{ secrets.TokenValue3 }}" >> docker.env; fi + if [ "${{ secrets.TokenName4 }}" ]; then echo "${{ secrets.TokenName4 }}=${{ secrets.TokenValue4 }}" >> docker.env; fi + if [ "${{ secrets.TokenName5 }}" ]; then echo "${{ secrets.TokenName5 }}=${{ secrets.TokenValue5 }}" >> docker.env; fi + - name: Debug env presence (safe) run: | echo "TEST_DNS=${TEST_DNS:+SET}" echo "TestingDomain=${TestingDomain:+SET}" echo "TEST_DNS_SLEEP=${TEST_DNS_SLEEP:+SET}" - echo "TokenName1=${TokenName1:+SET}" - echo "TokenName2=${TokenName2:+SET}" - echo "TokenName3=${TokenName3:+SET}" - echo "TokenName4=${TokenName4:+SET}" - echo "TokenName5=${TokenName5:+SET}" echo "---- docker.env (keys only) ----" - if [ -f ../acmetest/docker.env ]; then - cut -d= -f1 ../acmetest/docker.env | sed 's/.*/- &/' + cut -d= -f1 ../acmetest/docker.env | sed 's/^/- /' else echo "docker.env NOT FOUND" fi From c471c2e495cc797f98ad58f60991e28d16e82f63 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 24 Feb 2026 19:12:45 +0100 Subject: [PATCH 022/167] Update DNS.yml --- .github/workflows/DNS.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 148dd4c8..252850d3 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -70,25 +70,27 @@ jobs: - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file + shell: bash run: | + set -euo pipefail cd ../acmetest : > docker.env - if [ "${{ secrets.TokenName1 }}" ]; then echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env; fi - if [ "${{ secrets.TokenName2 }}" ]; then echo "${{ secrets.TokenName2 }}=${{ secrets.TokenValue2 }}" >> docker.env; fi - if [ "${{ secrets.TokenName3 }}" ]; then echo "${{ secrets.TokenName3 }}=${{ secrets.TokenValue3 }}" >> docker.env; fi - if [ "${{ secrets.TokenName4 }}" ]; then echo "${{ secrets.TokenName4 }}=${{ secrets.TokenValue4 }}" >> docker.env; fi - if [ "${{ secrets.TokenName5 }}" ]; then echo "${{ secrets.TokenName5 }}=${{ secrets.TokenValue5 }}" >> docker.env; fi + + [ -n "${{ secrets.TokenName1 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName1 }}" "${{ secrets.TokenValue1 }}" >> docker.env || true + [ -n "${{ secrets.TokenName2 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName2 }}" "${{ secrets.TokenValue2 }}" >> docker.env || true + [ -n "${{ secrets.TokenName3 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName3 }}" "${{ secrets.TokenValue3 }}" >> docker.env || true + [ -n "${{ secrets.TokenName4 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName4 }}" "${{ secrets.TokenValue4 }}" >> docker.env || true + [ -n "${{ secrets.TokenName5 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName5 }}" "${{ secrets.TokenValue5 }}" >> docker.env || true + + echo "docker.env lines: $(wc -l < docker.env)" - name: Debug env presence (safe) + shell: bash run: | echo "TEST_DNS=${TEST_DNS:+SET}" echo "TestingDomain=${TestingDomain:+SET}" echo "TEST_DNS_SLEEP=${TEST_DNS_SLEEP:+SET}" - echo "---- docker.env (keys only) ----" - cut -d= -f1 ../acmetest/docker.env | sed 's/^/- /' - else - echo "docker.env NOT FOUND" - fi + echo "docker.env lines: $(wc -l < ../acmetest/docker.env)" - name: Run acmetest run: cd ../acmetest && ./rundocker.sh testall From b9c1ec0b86f5d1aff370aa6604b4102597efc1b1 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 25 Feb 2026 07:26:43 +0100 Subject: [PATCH 023/167] Update dns_czechia.sh dns_czechia: fix POSIX compatibility for Alpine/BusyBox and cleanup Replace non-POSIX escape sequences in sed with 'tr' for Alpine/BusyBox compatibility. Remove unnecessary 'export' from local HTTP header variables. Fix domain normalization to prevent character stripping in Docker tests. --- dnsapi/dns_czechia.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index bd9e4d90..09e2cbae 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -88,13 +88,8 @@ _czechia_load_conf() { _czechia_norm_zonelist() { in="$1" [ -z "$in" ] && return 0 - - in="$(_lower_case "$in")" - - printf "%s" "$in" | - tr ' ' ',' | - tr -s ',' | - sed 's/[\t\r\n]//g; s/\.$//; s/^,//; s/,$//; s/,,*/,/g' + # Převedeme na lowercase a pomocí tr -d smažeme bílé znaky (POSIX safe) + _lower_case "$in" | tr -d '\t\r\n' | tr ' ' ',' | tr -s ',' | sed 's/\.$//; s/^,//; s/,$//; s/,,*/,/g' } _czechia_pick_zone() { @@ -164,7 +159,7 @@ _czechia_build_body() { } _czechia_json_escape() { - printf "%s" "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' + printf "%s" "$1" | sed 's/\\/\\\\/g; s/\"/\\\"/g' } _czechia_api_request() { @@ -172,10 +167,9 @@ _czechia_api_request() { url="$2" body="$3" - export _H1="authorizationToken: $CZ_AuthorizationToken" - export _H2="Content-Type: application/json" - export _CURL_TIMEOUT="$CZ_CURL_TIMEOUT" + _H1="authorizationToken: $CZ_AuthorizationToken" + _H2="Content-Type: application/json" + _CURL_TIMEOUT="$CZ_CURL_TIMEOUT" - # _post() handles POST/PUT/DELETE when method is provided. _post "$body" "$url" "" "$method" "application/json" } From 46f82d8542a3ebe530992052ab971608527ba535 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 25 Feb 2026 08:32:37 +0100 Subject: [PATCH 024/167] Add files via upload --- .github/workflows/DNS (2).yml | 658 ++++++++++++++++++++++++++++++++++ 1 file changed, 658 insertions(+) create mode 100644 .github/workflows/DNS (2).yml diff --git a/.github/workflows/DNS (2).yml b/.github/workflows/DNS (2).yml new file mode 100644 index 00000000..1a37b8a9 --- /dev/null +++ b/.github/workflows/DNS (2).yml @@ -0,0 +1,658 @@ +name: DNS +on: + workflow_dispatch: + push: + paths: + - 'dnsapi/*.sh' + - '.github/workflows/DNS.yml' + pull_request: + branches: + - 'dev' + paths: + - 'dnsapi/*.sh' + - '.github/workflows/DNS.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + CheckToken: + runs-on: ubuntu-latest + outputs: + hasToken: ${{ steps.step_one.outputs.hasToken }} + steps: + - name: Set the value + id: step_one + run: | + if [ "${{secrets.TokenName1}}" ] ; then + echo "::set-output name=hasToken::true" + else + echo "::set-output name=hasToken::false" + fi + - name: Check the value + run: echo ${{ steps.step_one.outputs.hasToken }} + + Fail: + runs-on: ubuntu-latest + needs: CheckToken + if: "contains(needs.CheckToken.outputs.hasToken, 'false')" + steps: + - name: "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test" + run: | + echo "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test" + if [ "${{github.repository_owner}}" != "acmesh-official" ]; then + false + fi + + Docker: + runs-on: ubuntu-latest + needs: CheckToken + if: "contains(needs.CheckToken.outputs.hasToken, 'true')" + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Set env file + run: | + cd ../acmetest + if [ "${{ secrets.TokenName1}}" ] ; then + echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env + fi + if [ "${{ secrets.TokenName2}}" ] ; then + echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env + fi + if [ "${{ secrets.TokenName3}}" ] ; then + echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env + fi + if [ "${{ secrets.TokenName4}}" ] ; then + echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env + fi + if [ "${{ secrets.TokenName5}}" ] ; then + echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env + fi + + - name: Run acmetest + run: cd ../acmetest && ./rundocker.sh testall + + + + + MacOS: + runs-on: macos-latest + needs: Docker + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Install tools + run: brew install socat + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Run acmetest + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + + + + + Windows: + runs-on: windows-latest + needs: MacOS + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + - uses: actions/checkout@v4 + - name: Install cygwin base packages with chocolatey + run: | + choco config get cacheLocation + choco install --no-progress cygwin + shell: cmd + - name: Install cygwin additional packages + run: | + C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s https://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git + shell: cmd + - name: Set ENV + shell: cmd + run: | + echo PATH=C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin >> %GITHUB_ENV% + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Run acmetest + shell: bash + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + + + + FreeBSD: + runs-on: ubuntu-latest + needs: Windows + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - uses: vmactions/freebsd-vm@v1 + with: + envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' + prepare: pkg install -y socat curl + usesh: true + sync: nfs + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + - name: onError + if: ${{ failure() }} + run: | + echo "See how to debug in VM:" + echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + + + OpenBSD: + runs-on: ubuntu-latest + needs: FreeBSD + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - uses: vmactions/openbsd-vm@v1 + with: + envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' + prepare: pkg_add socat curl libiconv + usesh: true + sync: nfs + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + - name: onError + if: ${{ failure() }} + run: | + echo "See how to debug in VM:" + echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + + + NetBSD: + runs-on: ubuntu-latest + needs: OpenBSD + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - uses: vmactions/netbsd-vm@v1 + with: + envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' + prepare: | + /usr/sbin/pkg_add curl socat + usesh: true + sync: nfs + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + - name: onError + if: ${{ failure() }} + run: | + echo "See how to debug in VM:" + echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + + + DragonFlyBSD: + runs-on: ubuntu-latest + needs: NetBSD + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - uses: vmactions/dragonflybsd-vm@v1 + with: + envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' + prepare: | + pkg install -y curl socat libnghttp2 + usesh: true + sync: nfs + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + - name: onError + if: ${{ failure() }} + run: | + echo "See how to debug in VM:" + echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + + + + + + Solaris: + runs-on: ubuntu-latest + needs: DragonFlyBSD + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + HTTPS_INSECURE: 1 # always set to 1 to ignore https error, since Solaris doesn't accept the expired ISRG X1 root + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - uses: vmactions/solaris-vm@v1 + with: + envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' + sync: nfs + prepare: | + pkgutil -U + pkgutil -y -i socat + run: | + pkg set-mediator -v -I default@1.1 openssl + export PATH=/usr/gnu/bin:$PATH + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + - name: onError + if: ${{ failure() }} + run: | + echo "See how to debug in VM:" + echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + + Omnios: + runs-on: ubuntu-latest + needs: Solaris + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + HTTPS_INSECURE: 1 # always set to 1 to ignore https error, since Omnios doesn't accept the expired ISRG X1 root + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - uses: vmactions/omnios-vm@v1 + with: + envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' + sync: nfs + prepare: pkg install socat + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + - name: onError + if: ${{ failure() }} + run: | + echo "See how to debug in VM:" + echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + + + OpenIndiana: + runs-on: ubuntu-latest + needs: Omnios + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + HTTPS_INSECURE: 1 # always set to 1 to ignore https error, since OpenIndiana doesn't accept the expired ISRG X1 root + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - uses: vmactions/openindiana-vm@v1 + with: + envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' + sync: nfs + prepare: pkg install socat + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + - name: onError + if: ${{ failure() }} + run: | + echo "See how to debug in VM:" + echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + + + Haiku: + runs-on: ubuntu-latest + needs: OpenIndiana + env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + HTTPS_INSECURE: 1 # always set to 1 to ignore https error, since OpenIndiana doesn't accept the expired ISRG X1 root + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} + steps: + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - uses: vmactions/haiku-vm@v1 + with: + envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' + sync: rsync + copyback: false + prepare: | + mkdir -p /boot/home/.cache + pkgman install -y cronie + + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh + - name: onError + if: ${{ failure() }} + run: | + echo "See how to debug in VM:" + echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + + From 67f5b48dc8add03a8317286286f3954f5526beff Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 25 Feb 2026 08:33:37 +0100 Subject: [PATCH 025/167] Delete .github/workflows/DNS (2).yml --- .github/workflows/DNS (2).yml | 658 ---------------------------------- 1 file changed, 658 deletions(-) delete mode 100644 .github/workflows/DNS (2).yml diff --git a/.github/workflows/DNS (2).yml b/.github/workflows/DNS (2).yml deleted file mode 100644 index 1a37b8a9..00000000 --- a/.github/workflows/DNS (2).yml +++ /dev/null @@ -1,658 +0,0 @@ -name: DNS -on: - workflow_dispatch: - push: - paths: - - 'dnsapi/*.sh' - - '.github/workflows/DNS.yml' - pull_request: - branches: - - 'dev' - paths: - - 'dnsapi/*.sh' - - '.github/workflows/DNS.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - CheckToken: - runs-on: ubuntu-latest - outputs: - hasToken: ${{ steps.step_one.outputs.hasToken }} - steps: - - name: Set the value - id: step_one - run: | - if [ "${{secrets.TokenName1}}" ] ; then - echo "::set-output name=hasToken::true" - else - echo "::set-output name=hasToken::false" - fi - - name: Check the value - run: echo ${{ steps.step_one.outputs.hasToken }} - - Fail: - runs-on: ubuntu-latest - needs: CheckToken - if: "contains(needs.CheckToken.outputs.hasToken, 'false')" - steps: - - name: "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test" - run: | - echo "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test" - if [ "${{github.repository_owner}}" != "acmesh-official" ]; then - false - fi - - Docker: - runs-on: ubuntu-latest - needs: CheckToken - if: "contains(needs.CheckToken.outputs.hasToken, 'true')" - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - name: Set env file - run: | - cd ../acmetest - if [ "${{ secrets.TokenName1}}" ] ; then - echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env - fi - if [ "${{ secrets.TokenName2}}" ] ; then - echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env - fi - if [ "${{ secrets.TokenName3}}" ] ; then - echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env - fi - if [ "${{ secrets.TokenName4}}" ] ; then - echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env - fi - if [ "${{ secrets.TokenName5}}" ] ; then - echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env - fi - - - name: Run acmetest - run: cd ../acmetest && ./rundocker.sh testall - - - - - MacOS: - runs-on: macos-latest - needs: Docker - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Install tools - run: brew install socat - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - name: Run acmetest - run: | - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - - - - Windows: - runs-on: windows-latest - needs: MacOS - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - name: Set git to use LF - run: | - git config --global core.autocrlf false - - uses: actions/checkout@v4 - - name: Install cygwin base packages with chocolatey - run: | - choco config get cacheLocation - choco install --no-progress cygwin - shell: cmd - - name: Install cygwin additional packages - run: | - C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s https://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git - shell: cmd - - name: Set ENV - shell: cmd - run: | - echo PATH=C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin >> %GITHUB_ENV% - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - name: Run acmetest - shell: bash - run: | - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - - - FreeBSD: - runs-on: ubuntu-latest - needs: Windows - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - uses: vmactions/freebsd-vm@v1 - with: - envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' - prepare: pkg install -y socat curl - usesh: true - sync: nfs - run: | - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - name: onError - if: ${{ failure() }} - run: | - echo "See how to debug in VM:" - echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - - - OpenBSD: - runs-on: ubuntu-latest - needs: FreeBSD - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - uses: vmactions/openbsd-vm@v1 - with: - envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' - prepare: pkg_add socat curl libiconv - usesh: true - sync: nfs - run: | - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - name: onError - if: ${{ failure() }} - run: | - echo "See how to debug in VM:" - echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - - - NetBSD: - runs-on: ubuntu-latest - needs: OpenBSD - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - uses: vmactions/netbsd-vm@v1 - with: - envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' - prepare: | - /usr/sbin/pkg_add curl socat - usesh: true - sync: nfs - run: | - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - name: onError - if: ${{ failure() }} - run: | - echo "See how to debug in VM:" - echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - - - DragonFlyBSD: - runs-on: ubuntu-latest - needs: NetBSD - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - uses: vmactions/dragonflybsd-vm@v1 - with: - envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' - prepare: | - pkg install -y curl socat libnghttp2 - usesh: true - sync: nfs - run: | - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - name: onError - if: ${{ failure() }} - run: | - echo "See how to debug in VM:" - echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - - - - - - Solaris: - runs-on: ubuntu-latest - needs: DragonFlyBSD - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - HTTPS_INSECURE: 1 # always set to 1 to ignore https error, since Solaris doesn't accept the expired ISRG X1 root - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - uses: vmactions/solaris-vm@v1 - with: - envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' - sync: nfs - prepare: | - pkgutil -U - pkgutil -y -i socat - run: | - pkg set-mediator -v -I default@1.1 openssl - export PATH=/usr/gnu/bin:$PATH - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - name: onError - if: ${{ failure() }} - run: | - echo "See how to debug in VM:" - echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - - Omnios: - runs-on: ubuntu-latest - needs: Solaris - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - HTTPS_INSECURE: 1 # always set to 1 to ignore https error, since Omnios doesn't accept the expired ISRG X1 root - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - uses: vmactions/omnios-vm@v1 - with: - envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' - sync: nfs - prepare: pkg install socat - run: | - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - name: onError - if: ${{ failure() }} - run: | - echo "See how to debug in VM:" - echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - - - OpenIndiana: - runs-on: ubuntu-latest - needs: Omnios - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - HTTPS_INSECURE: 1 # always set to 1 to ignore https error, since OpenIndiana doesn't accept the expired ISRG X1 root - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - uses: vmactions/openindiana-vm@v1 - with: - envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' - sync: nfs - prepare: pkg install socat - run: | - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - name: onError - if: ${{ failure() }} - run: | - echo "See how to debug in VM:" - echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - - - Haiku: - runs-on: ubuntu-latest - needs: OpenIndiana - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - HTTPS_INSECURE: 1 # always set to 1 to ignore https error, since OpenIndiana doesn't accept the expired ISRG X1 root - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - uses: vmactions/haiku-vm@v1 - with: - envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' - sync: rsync - copyback: false - prepare: | - mkdir -p /boot/home/.cache - pkgman install -y cronie - - run: | - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" - fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" - fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" - fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" - fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" - fi - cd ../acmetest - ./letest.sh - - name: onError - if: ${{ failure() }} - run: | - echo "See how to debug in VM:" - echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - - From bd560089e53192dd5c8825ef7d720c46ab02c231 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 25 Feb 2026 08:34:11 +0100 Subject: [PATCH 026/167] Update DNS.yml --- .github/workflows/DNS.yml | 73 ++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 252850d3..1a37b8a9 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -50,8 +50,8 @@ jobs: needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" env: - TEST_DNS : dns_czechia - TestingDomain: zoner-test.eu + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} @@ -66,33 +66,33 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - name: Set env file - shell: bash - run: | - set -euo pipefail - cd ../acmetest - : > docker.env + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Set env file + run: | + cd ../acmetest + if [ "${{ secrets.TokenName1}}" ] ; then + echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env + fi + if [ "${{ secrets.TokenName2}}" ] ; then + echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env + fi + if [ "${{ secrets.TokenName3}}" ] ; then + echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env + fi + if [ "${{ secrets.TokenName4}}" ] ; then + echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env + fi + if [ "${{ secrets.TokenName5}}" ] ; then + echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env + fi + + - name: Run acmetest + run: cd ../acmetest && ./rundocker.sh testall - [ -n "${{ secrets.TokenName1 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName1 }}" "${{ secrets.TokenValue1 }}" >> docker.env || true - [ -n "${{ secrets.TokenName2 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName2 }}" "${{ secrets.TokenValue2 }}" >> docker.env || true - [ -n "${{ secrets.TokenName3 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName3 }}" "${{ secrets.TokenValue3 }}" >> docker.env || true - [ -n "${{ secrets.TokenName4 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName4 }}" "${{ secrets.TokenValue4 }}" >> docker.env || true - [ -n "${{ secrets.TokenName5 }}" ] && printf '%s=%s\n' "${{ secrets.TokenName5 }}" "${{ secrets.TokenValue5 }}" >> docker.env || true - echo "docker.env lines: $(wc -l < docker.env)" - - name: Debug env presence (safe) - shell: bash - run: | - echo "TEST_DNS=${TEST_DNS:+SET}" - echo "TestingDomain=${TestingDomain:+SET}" - echo "TEST_DNS_SLEEP=${TEST_DNS_SLEEP:+SET}" - echo "docker.env lines: $(wc -l < ../acmetest/docker.env)" - - name: Run acmetest - run: cd ../acmetest && ./rundocker.sh testall MacOS: runs-on: macos-latest @@ -114,7 +114,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Install tools run: brew install socat - name: Clone acmetest @@ -165,7 +165,7 @@ jobs: - name: Set git to use LF run: | git config --global core.autocrlf false - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Install cygwin base packages with chocolatey run: | choco config get cacheLocation @@ -224,7 +224,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/freebsd-vm@v1 @@ -279,7 +279,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/openbsd-vm@v1 @@ -334,7 +334,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/netbsd-vm@v1 @@ -390,7 +390,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/dragonflybsd-vm@v1 @@ -450,7 +450,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/solaris-vm@v1 @@ -508,7 +508,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/omnios-vm@v1 @@ -563,7 +563,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/openindiana-vm@v1 @@ -618,7 +618,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/haiku-vm@v1 @@ -655,3 +655,4 @@ jobs: echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + From dc45b4464b5b3c38d24c74cf1e81eac31ed93b1a Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 25 Feb 2026 09:47:45 +0100 Subject: [PATCH 027/167] Update dns_czechia.sh Refactor the Czechia/Zoner DNS API script to ensure stability and better user experience. Changes: - Replaced Bash-specific substitutions with POSIX-compliant code (fixes 'Bad substitution' errors on dash/sh). - Improved JSON payload construction to be more robust across different shell environments. - Updated hostname logic to correctly use "@" for apex domains. - Refined error reporting: API error messages are now captured and displayed in English. - Cleaned up internal debug messages and aligned them with acme.sh standards. - Optimized zone picking logic for faster matching in multi-zone setups. --- dnsapi/dns_czechia.sh | 236 +++++++++++++++++++----------------------- 1 file changed, 104 insertions(+), 132 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 09e2cbae..c1d1dcce 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -1,175 +1,147 @@ #!/usr/bin/env sh + # dns_czechia.sh - Czechia/ZONER DNS API for acme.sh (DNS-01) # -# Endpoint: -# https://api.czechia.com/api/DNS//TXT -# Header: -# authorizationToken: -# Body: -# {"hostName":"...","text":"...","ttl":3600,"publishZone":1} +# Documentation: https://api.czechia.com/swagger/index.html # -# Required env: -# CZ_AuthorizationToken (saved to account.conf for automatic renewals) -# CZ_Zones zone(s) separated by comma/space, e.g. "example.com" or "example.com,example.net" -# For SAN/wildcard, the plugin picks the longest matching zone suffix per-domain. +# Required environment variables: +# CZ_AuthorizationToken Your API token from Czechia/Zoner administration. +# CZ_Zones Managed zones separated by comma or space (e.g. "example.com,example.net"). +# The plugin picks the best matching zone for each domain. # -# Optional env (can be saved): -# CZ_TTL (default 3600) -# CZ_PublishZone (default 1) -# CZ_API_BASE (default https://api.czechia.com) -# CZ_CURL_TIMEOUT (default 30) +# Optional environment variables: +# CZ_API_BASE Defaults to https://api.czechia.com +# CZ_CURL_TIMEOUT Defaults to 30 dns_czechia_add() { fulldomain="$1" txtvalue="$2" - _info "Czechia DNS add TXT for $fulldomain" _czechia_load_conf || return 1 + _current_zone=$(_czechia_pick_zone "$fulldomain") + if [ -z "$_current_zone" ]; then + _err "No matching zone found for $fulldomain. Please check CZ_Zones." + return 1 + fi + + _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" + + # Calculate hostname: remove zone from fulldomain + _h=$(printf "%s" "$fulldomain" | sed "s/\.$_current_zone//; s/$_current_zone//") + + # Apex domain handling + if [ -z "$_h" ]; then + _h="@" + fi + + # Build JSON body (POSIX compatible) + _q='"' + _body="{$_q"hostName"$_q:$_q$_h$_q,$_q"text"$_q:$_q$txtvalue$_q,$_q"ttl"$_q:3600,$_q"publishZone"$_q:1}" - zone="$(_czechia_pick_zone "$fulldomain")" || return 1 - host="$(_czechia_rel_host "$fulldomain" "$zone")" || return 1 - url="$CZ_API_BASE/api/DNS/$zone/TXT" - body="$(_czechia_build_body "$host" "$txtvalue")" + _info "Adding TXT record for $fulldomain" + + export _H1="Content-Type: application/json" + export _H2="authorizationToken: $CZ_AuthorizationToken" - _czechia_api_request "POST" "$url" "$body" + _res=$(_post "$_body" "$_url" "" "POST") + _debug "API Response: $_res" + + if _contains "$_res" "errors" || _contains "$_res" "400"; then + _err "API error: $_res" + return 1 + fi + + return 0 } dns_czechia_rm() { fulldomain="$1" txtvalue="$2" - _info "Czechia DNS remove TXT for $fulldomain" _czechia_load_conf || return 1 + _current_zone=$(_czechia_pick_zone "$fulldomain") + [ -z "$_current_zone" ] && return 1 + + _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" + _h=$(printf "%s" "$fulldomain" | sed "s/\.$_current_zone//; s/$_current_zone//") + [ -z "$_h" ] && _h="@" - zone="$(_czechia_pick_zone "$fulldomain")" || return 1 - host="$(_czechia_rel_host "$fulldomain" "$zone")" || return 1 - url="$CZ_API_BASE/api/DNS/$zone/TXT" - body="$(_czechia_build_body "$host" "$txtvalue")" + _q='"' + _body="{$_q"hostName"$_q:$_q$_h$_q,$_q"text"$_q:$_q$txtvalue$_q,$_q"publishZone"$_q:1}" - _czechia_api_request "DELETE" "$url" "$body" + _info "Removing TXT record for $fulldomain" + + export _H1="Content-Type: application/json" + export _H2="authorizationToken: $CZ_AuthorizationToken" + + _res=$(_post "$_body" "$_url" "" "DELETE") + _debug "API Response: $_res" + + return 0 } +######################################################################## +# Private functions +######################################################################## + _czechia_load_conf() { - CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_readaccountconf_mutable CZ_AuthorizationToken)}" if [ -z "$CZ_AuthorizationToken" ]; then - _err "CZ_AuthorizationToken is missing." + CZ_AuthorizationToken="$(_getaccountconf CZ_AuthorizationToken)" + fi + if [ -z "$CZ_AuthorizationToken" ]; then + _err "You didn't specify Czechia Authorization Token (CZ_AuthorizationToken)." return 1 fi - _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" - - CZ_Zones="${CZ_Zones:-$(_readaccountconf_mutable CZ_Zones)}" - CZ_TTL="${CZ_TTL:-$(_readaccountconf_mutable CZ_TTL)}" - CZ_PublishZone="${CZ_PublishZone:-$(_readaccountconf_mutable CZ_PublishZone)}" - CZ_API_BASE="${CZ_API_BASE:-$(_readaccountconf_mutable CZ_API_BASE)}" - CZ_CURL_TIMEOUT="${CZ_CURL_TIMEOUT:-$(_readaccountconf_mutable CZ_CURL_TIMEOUT)}" if [ -z "$CZ_Zones" ]; then - _err "CZ_Zones is required." + CZ_Zones="$(_getaccountconf CZ_Zones)" + fi + if [ -z "$CZ_Zones" ]; then + _err "You didn't specify Czechia Zones (CZ_Zones)." return 1 fi - [ -z "$CZ_TTL" ] && CZ_TTL="3600" - [ -z "$CZ_PublishZone" ] && CZ_PublishZone="1" - [ -z "$CZ_API_BASE" ] && CZ_API_BASE="https://api.czechia.com" - [ -z "$CZ_CURL_TIMEOUT" ] && CZ_CURL_TIMEOUT="30" - - CZ_Zones="$(_czechia_norm_zonelist "$CZ_Zones")" - CZ_API_BASE="$(printf "%s" "$CZ_API_BASE" | sed 's:/*$::')" - - _saveaccountconf_mutable CZ_Zones "$CZ_Zones" - _saveaccountconf_mutable CZ_TTL "$CZ_TTL" - _saveaccountconf_mutable CZ_PublishZone "$CZ_PublishZone" - _saveaccountconf_mutable CZ_API_BASE "$CZ_API_BASE" - _saveaccountconf_mutable CZ_CURL_TIMEOUT "$CZ_CURL_TIMEOUT" - + # Defaults + if [ -z "$CZ_API_BASE" ]; then + CZ_API_BASE="https://api.czechia.com" + fi + + # Save to account.conf for renewals + _saveaccountconf CZ_AuthorizationToken "$CZ_AuthorizationToken" + _saveaccountconf CZ_Zones "$CZ_Zones" + return 0 } -_czechia_norm_zonelist() { - in="$1" - [ -z "$in" ] && return 0 - # Převedeme na lowercase a pomocí tr -d smažeme bílé znaky (POSIX safe) - _lower_case "$in" | tr -d '\t\r\n' | tr ' ' ',' | tr -s ',' | sed 's/\.$//; s/^,//; s/,$//; s/,,*/,/g' -} - _czechia_pick_zone() { - fulldomain="$1" - - fd="$(_lower_case "$fulldomain")" - fd="$(printf "%s" "$fd" | sed 's/\.$//')" - - best="" - bestlen=0 - - oldifs="$IFS" - IFS=',' - for z in $CZ_Zones; do - z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" - [ -z "$z" ] && continue - - case "$fd" in - "$z" | *".$z") - if [ "${#z}" -gt "$bestlen" ]; then - best="$z" - bestlen=${#z} - fi - ;; + _fulldomain="$1" + # Lowercase and remove trailing dot + _fd=$(printf "%s" "$_fulldomain" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//') + + _best_zone="" + + # Split zones by comma or space + _zones_space=$(printf "%s" "$CZ_Zones" | tr ',' ' ') + + for _z in $_zones_space; do + _clean_z=$(printf "%s" "$_z" | tr -d ' ' | tr '[:upper:]' '[:lower:]' | sed 's/\.$//') + [ -z "$_clean_z" ] && continue + + case "$_fd" in + "$_clean_z"|*".$_clean_z") + # Find the longest matching zone suffix + _new_len=$(printf "%s" "$_clean_z" | wc -c) + _old_len=$(printf "%s" "$_best_zone" | wc -c) + if [ "$_new_len" -gt "$_old_len" ]; then + _best_zone="$_clean_z" + fi + ;; esac done - IFS="$oldifs" - - [ -z "$best" ] && return 1 - - printf "%s" "$best" -} - -_czechia_rel_host() { - fulldomain="$1" - zone="$2" - fd="$(_lower_case "$fulldomain")" - fd="$(printf "%s" "$fd" | sed 's/\.$//')" - - z="$(_lower_case "$zone")" - z="$(printf "%s" "$z" | sed 's/\.$//')" - - if [ "$fd" = "$z" ]; then - printf "%s" "@" - return 0 + if [ -z "$_best_zone" ]; then + return 1 fi - suffix=".$z" - case "$fd" in - *"$suffix") - rel="${fd%"$suffix"}" - [ -z "$rel" ] && rel="@" - printf "%s" "$rel" - return 0 - ;; - esac - - return 1 -} - -_czechia_build_body() { - host="$1" - txt="$2" - txt_escaped="$(_czechia_json_escape "$txt")" - printf "%s" "{\"hostName\":\"$host\",\"text\":\"$txt_escaped\",\"ttl\":$CZ_TTL,\"publishZone\":$CZ_PublishZone}" -} - -_czechia_json_escape() { - printf "%s" "$1" | sed 's/\\/\\\\/g; s/\"/\\\"/g' -} - -_czechia_api_request() { - method="$1" - url="$2" - body="$3" - - _H1="authorizationToken: $CZ_AuthorizationToken" - _H2="Content-Type: application/json" - _CURL_TIMEOUT="$CZ_CURL_TIMEOUT" - - _post "$body" "$url" "" "$method" "application/json" + printf "%s" "$_best_zone" } From 6108dd266d2a0bee703e0f860aad75a690a7f7c9 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 25 Feb 2026 09:53:04 +0100 Subject: [PATCH 028/167] Update dns_czechia.sh style: fix formatting and linting --- dnsapi/dns_czechia.sh | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index c1d1dcce..82682891 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -25,21 +25,20 @@ dns_czechia_add() { fi _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - + # Calculate hostname: remove zone from fulldomain _h=$(printf "%s" "$fulldomain" | sed "s/\.$_current_zone//; s/$_current_zone//") - + # Apex domain handling if [ -z "$_h" ]; then _h="@" fi - # Build JSON body (POSIX compatible) - _q='"' - _body="{$_q"hostName"$_q:$_q$_h$_q,$_q"text"$_q:$_q$txtvalue$_q,$_q"ttl"$_q:3600,$_q"publishZone"$_q:1}" + # Build JSON body - ShellCheck & shfmt friendly + _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" _info "Adding TXT record for $fulldomain" - + export _H1="Content-Type: application/json" export _H2="authorizationToken: $CZ_AuthorizationToken" @@ -66,11 +65,10 @@ dns_czechia_rm() { _h=$(printf "%s" "$fulldomain" | sed "s/\.$_current_zone//; s/$_current_zone//") [ -z "$_h" ] && _h="@" - _q='"' - _body="{$_q"hostName"$_q:$_q$_h$_q,$_q"text"$_q:$_q$txtvalue$_q,$_q"publishZone"$_q:1}" + _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"publishZone\":1}" _info "Removing TXT record for $fulldomain" - + export _H1="Content-Type: application/json" export _H2="authorizationToken: $CZ_AuthorizationToken" @@ -105,11 +103,11 @@ _czechia_load_conf() { if [ -z "$CZ_API_BASE" ]; then CZ_API_BASE="https://api.czechia.com" fi - + # Save to account.conf for renewals _saveaccountconf CZ_AuthorizationToken "$CZ_AuthorizationToken" _saveaccountconf CZ_Zones "$CZ_Zones" - + return 0 } @@ -117,25 +115,25 @@ _czechia_pick_zone() { _fulldomain="$1" # Lowercase and remove trailing dot _fd=$(printf "%s" "$_fulldomain" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//') - + _best_zone="" - + # Split zones by comma or space _zones_space=$(printf "%s" "$CZ_Zones" | tr ',' ' ') for _z in $_zones_space; do _clean_z=$(printf "%s" "$_z" | tr -d ' ' | tr '[:upper:]' '[:lower:]' | sed 's/\.$//') [ -z "$_clean_z" ] && continue - + case "$_fd" in - "$_clean_z"|*".$_clean_z") - # Find the longest matching zone suffix - _new_len=$(printf "%s" "$_clean_z" | wc -c) - _old_len=$(printf "%s" "$_best_zone" | wc -c) - if [ "$_new_len" -gt "$_old_len" ]; then - _best_zone="$_clean_z" - fi - ;; + "$_clean_z" | *".$_clean_z") + # Find the longest matching zone suffix + _new_len=$(printf "%s" "$_clean_z" | wc -c) + _old_len=$(printf "%s" "$_best_zone" | wc -c) + if [ "$_new_len" -gt "$_old_len" ]; then + _best_zone="$_clean_z" + fi + ;; esac done From 1c56f00b4c6fa94a0e2223f6a4c11d05642f8674 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 07:28:53 +0100 Subject: [PATCH 029/167] refactor(dns_czechia): replace tr with _lower_case and clean up logic - Replaced 'tr' for case conversion with internal '_lower_case' function for better POSIX compatibility. - Cleaned up redundant helper functions and simplified hostname calculation. - Fixed ShellCheck SC2140 warnings by using properly escaped JSON strings. - Aligned code formatting with 'shfmt' requirements (indentation and spacing). - Updated configuration loading to use standard shell variable defaults. --- dnsapi/dns_czechia.sh | 55 +++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 82682891..2dc2200f 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -6,12 +6,10 @@ # # Required environment variables: # CZ_AuthorizationToken Your API token from Czechia/Zoner administration. -# CZ_Zones Managed zones separated by comma or space (e.g. "example.com,example.net"). -# The plugin picks the best matching zone for each domain. +# CZ_Zones Managed zones separated by comma or space (e.g. "example.com"). # # Optional environment variables: # CZ_API_BASE Defaults to https://api.czechia.com -# CZ_CURL_TIMEOUT Defaults to 30 dns_czechia_add() { fulldomain="$1" @@ -26,15 +24,14 @@ dns_czechia_add() { _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - # Calculate hostname: remove zone from fulldomain - _h=$(printf "%s" "$fulldomain" | sed "s/\.$_current_zone//; s/$_current_zone//") + # Normalize using acme.sh internal function for consistency + _fd=$(_lower_case "$fulldomain" | sed 's/\.$//') + _cz=$(_lower_case "$_current_zone") - # Apex domain handling - if [ -z "$_h" ]; then - _h="@" - fi + # Calculate hostname + _h=$(printf "%s" "$_fd" | sed "s/\.$_cz//; s/$_cz//") + [ -z "$_h" ] && _h="@" - # Build JSON body - ShellCheck & shfmt friendly _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" _info "Adding TXT record for $fulldomain" @@ -49,7 +46,6 @@ dns_czechia_add() { _err "API error: $_res" return 1 fi - return 0 } @@ -62,7 +58,10 @@ dns_czechia_rm() { [ -z "$_current_zone" ] && return 1 _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - _h=$(printf "%s" "$fulldomain" | sed "s/\.$_current_zone//; s/$_current_zone//") + + _fd=$(_lower_case "$fulldomain" | sed 's/\.$//') + _cz=$(_lower_case "$_current_zone") + _h=$(printf "%s" "$_fd" | sed "s/\.$_cz//; s/$_cz//") [ -z "$_h" ] && _h="@" _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"publishZone\":1}" @@ -83,51 +82,39 @@ dns_czechia_rm() { ######################################################################## _czechia_load_conf() { + CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_getaccountconf CZ_AuthorizationToken)}" if [ -z "$CZ_AuthorizationToken" ]; then - CZ_AuthorizationToken="$(_getaccountconf CZ_AuthorizationToken)" - fi - if [ -z "$CZ_AuthorizationToken" ]; then - _err "You didn't specify Czechia Authorization Token (CZ_AuthorizationToken)." + _err "You didn't specify CZ_AuthorizationToken." return 1 fi + CZ_Zones="${CZ_Zones:-$(_getaccountconf CZ_Zones)}" if [ -z "$CZ_Zones" ]; then - CZ_Zones="$(_getaccountconf CZ_Zones)" - fi - if [ -z "$CZ_Zones" ]; then - _err "You didn't specify Czechia Zones (CZ_Zones)." + _err "You didn't specify CZ_Zones." return 1 fi - # Defaults - if [ -z "$CZ_API_BASE" ]; then - CZ_API_BASE="https://api.czechia.com" - fi + CZ_API_BASE="${CZ_API_BASE:-https://api.czechia.com}" - # Save to account.conf for renewals _saveaccountconf CZ_AuthorizationToken "$CZ_AuthorizationToken" _saveaccountconf CZ_Zones "$CZ_Zones" - return 0 } _czechia_pick_zone() { _fulldomain="$1" - # Lowercase and remove trailing dot - _fd=$(printf "%s" "$_fulldomain" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//') - + _fd=$(_lower_case "$_fulldomain" | sed 's/\.$//') _best_zone="" # Split zones by comma or space _zones_space=$(printf "%s" "$CZ_Zones" | tr ',' ' ') for _z in $_zones_space; do - _clean_z=$(printf "%s" "$_z" | tr -d ' ' | tr '[:upper:]' '[:lower:]' | sed 's/\.$//') + _clean_z=$(_lower_case "$_z" | tr -d ' ' | sed 's/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in "$_clean_z" | *".$_clean_z") - # Find the longest matching zone suffix _new_len=$(printf "%s" "$_clean_z" | wc -c) _old_len=$(printf "%s" "$_best_zone" | wc -c) if [ "$_new_len" -gt "$_old_len" ]; then @@ -137,9 +124,5 @@ _czechia_pick_zone() { esac done - if [ -z "$_best_zone" ]; then - return 1 - fi - - printf "%s" "$_best_zone" + [ "$_best_zone" ] && printf "%s" "$_best_zone" } From 1d94c3e84f56a8737cb7bf79e77bf2150dfdedf1 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 07:31:54 +0100 Subject: [PATCH 030/167] Update dns_czechia.sh fix(dns_czechia): fix Docker/BusyBox compatibility by using shell string length --- dnsapi/dns_czechia.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 2dc2200f..07958ee3 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -106,17 +106,18 @@ _czechia_pick_zone() { _fd=$(_lower_case "$_fulldomain" | sed 's/\.$//') _best_zone="" - # Split zones by comma or space - _zones_space=$(printf "%s" "$CZ_Zones" | tr ',' ' ') + # Bezpečné rozdělení zón bez tr + _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do - _clean_z=$(_lower_case "$_z" | tr -d ' ' | sed 's/\.$//') + _clean_z=$(_lower_case "$_z" | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in "$_clean_z" | *".$_clean_z") - _new_len=$(printf "%s" "$_clean_z" | wc -c) - _old_len=$(printf "%s" "$_best_zone" | wc -c) + # Místo wc -c použijeme délku řetězce přímo v shellu (nejstabilnější v Dockeru) + _new_len=${#_clean_z} + _old_len=${#_best_zone} if [ "$_new_len" -gt "$_old_len" ]; then _best_zone="$_clean_z" fi @@ -124,5 +125,10 @@ _czechia_pick_zone() { esac done + if [ -n "$_best_zone" ]; then + printf "%s" "$_best_zone" + fi +} + [ "$_best_zone" ] && printf "%s" "$_best_zone" } From c47bdede339723fe09e2163c66d28a047cf0163c Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 07:34:19 +0100 Subject: [PATCH 031/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 07958ee3..a396e328 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -6,10 +6,7 @@ # # Required environment variables: # CZ_AuthorizationToken Your API token from Czechia/Zoner administration. -# CZ_Zones Managed zones separated by comma or space (e.g. "example.com"). -# -# Optional environment variables: -# CZ_API_BASE Defaults to https://api.czechia.com +# CZ_Zones Managed zones separated by comma or space. dns_czechia_add() { fulldomain="$1" @@ -24,13 +21,15 @@ dns_czechia_add() { _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - # Normalize using acme.sh internal function for consistency + # Normalize using acme.sh internal function _fd=$(_lower_case "$fulldomain" | sed 's/\.$//') _cz=$(_lower_case "$_current_zone") - # Calculate hostname + # Calculate hostname without bash-isms _h=$(printf "%s" "$_fd" | sed "s/\.$_cz//; s/$_cz//") - [ -z "$_h" ] && _h="@" + if [ -z "$_h" ]; then + _h="@" + fi _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" @@ -62,7 +61,9 @@ dns_czechia_rm() { _fd=$(_lower_case "$fulldomain" | sed 's/\.$//') _cz=$(_lower_case "$_current_zone") _h=$(printf "%s" "$_fd" | sed "s/\.$_cz//; s/$_cz//") - [ -z "$_h" ] && _h="@" + if [ -z "$_h" ]; then + _h="@" + fi _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"publishZone\":1}" @@ -106,7 +107,7 @@ _czechia_pick_zone() { _fd=$(_lower_case "$_fulldomain" | sed 's/\.$//') _best_zone="" - # Bezpečné rozdělení zón bez tr + # Safe list split for Docker (BusyBox) _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do @@ -115,7 +116,7 @@ _czechia_pick_zone() { case "$_fd" in "$_clean_z" | *".$_clean_z") - # Místo wc -c použijeme délku řetězce přímo v shellu (nejstabilnější v Dockeru) + # POSIX shell length - 100% Docker stable _new_len=${#_clean_z} _old_len=${#_best_zone} if [ "$_new_len" -gt "$_old_len" ]; then @@ -129,6 +130,3 @@ _czechia_pick_zone() { printf "%s" "$_best_zone" fi } - - [ "$_best_zone" ] && printf "%s" "$_best_zone" -} From e7eaba2ce6831a504046095be179bf14cb79e67f Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 07:39:00 +0100 Subject: [PATCH 032/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 76 +++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 50 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index a396e328..7eadf69f 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -1,17 +1,19 @@ #!/usr/bin/env sh -# dns_czechia.sh - Czechia/ZONER DNS API for acme.sh (DNS-01) +# dns_czechia.sh - CZECHIA.COM/ZONER DNS API for acme.sh (DNS-01) # # Documentation: https://api.czechia.com/swagger/index.html # # Required environment variables: -# CZ_AuthorizationToken Your API token from Czechia/Zoner administration. -# CZ_Zones Managed zones separated by comma or space. +# CZ_AuthorizationToken Your API token from CZECHIA.COM/Zoner administration. +# CZ_Zones Managed zones separated by comma or space (e.g. "example.com"). +# +# Optional environment variables: +# CZ_API_BASE Defaults to https://api.czechia.com dns_czechia_add() { fulldomain="$1" txtvalue="$2" - _czechia_load_conf || return 1 _current_zone=$(_czechia_pick_zone "$fulldomain") if [ -z "$_current_zone" ]; then @@ -20,27 +22,22 @@ dns_czechia_add() { fi _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - - # Normalize using acme.sh internal function + + # Normalize using acme.sh internal function - NO 'tr' used here _fd=$(_lower_case "$fulldomain" | sed 's/\.$//') _cz=$(_lower_case "$_current_zone") - # Calculate hostname without bash-isms + # Calculate hostname _h=$(printf "%s" "$_fd" | sed "s/\.$_cz//; s/$_cz//") - if [ -z "$_h" ]; then - _h="@" - fi + [ -z "$_h" ] && _h="@" _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" - - _info "Adding TXT record for $fulldomain" + _info "Adding TXT record" export _H1="Content-Type: application/json" export _H2="authorizationToken: $CZ_AuthorizationToken" _res=$(_post "$_body" "$_url" "" "POST") - _debug "API Response: $_res" - if _contains "$_res" "errors" || _contains "$_res" "400"; then _err "API error: $_res" return 1 @@ -51,30 +48,22 @@ dns_czechia_add() { dns_czechia_rm() { fulldomain="$1" txtvalue="$2" - _czechia_load_conf || return 1 _current_zone=$(_czechia_pick_zone "$fulldomain") [ -z "$_current_zone" ] && return 1 _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - _fd=$(_lower_case "$fulldomain" | sed 's/\.$//') _cz=$(_lower_case "$_current_zone") _h=$(printf "%s" "$_fd" | sed "s/\.$_cz//; s/$_cz//") - if [ -z "$_h" ]; then - _h="@" - fi + [ -z "$_h" ] && _h="@" _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"publishZone\":1}" - - _info "Removing TXT record for $fulldomain" + _info "Removing TXT record" export _H1="Content-Type: application/json" export _H2="authorizationToken: $CZ_AuthorizationToken" - _res=$(_post "$_body" "$_url" "" "DELETE") - _debug "API Response: $_res" - return 0 } @@ -84,19 +73,10 @@ dns_czechia_rm() { _czechia_load_conf() { CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_getaccountconf CZ_AuthorizationToken)}" - if [ -z "$CZ_AuthorizationToken" ]; then - _err "You didn't specify CZ_AuthorizationToken." - return 1 - fi - + [ -z "$CZ_AuthorizationToken" ] && _err "Missing CZ_AuthorizationToken" && return 1 CZ_Zones="${CZ_Zones:-$(_getaccountconf CZ_Zones)}" - if [ -z "$CZ_Zones" ]; then - _err "You didn't specify CZ_Zones." - return 1 - fi - + [ -z "$CZ_Zones" ] && _err "Missing CZ_Zones" && return 1 CZ_API_BASE="${CZ_API_BASE:-https://api.czechia.com}" - _saveaccountconf CZ_AuthorizationToken "$CZ_AuthorizationToken" _saveaccountconf CZ_Zones "$CZ_Zones" return 0 @@ -106,27 +86,23 @@ _czechia_pick_zone() { _fulldomain="$1" _fd=$(_lower_case "$_fulldomain" | sed 's/\.$//') _best_zone="" - - # Safe list split for Docker (BusyBox) + + # Replace comma with space using sed (Docker safe) _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do + # Remove spaces and trailing dot, then lowercase - NO 'tr' used here _clean_z=$(_lower_case "$_z" | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue - + case "$_fd" in - "$_clean_z" | *".$_clean_z") - # POSIX shell length - 100% Docker stable - _new_len=${#_clean_z} - _old_len=${#_best_zone} - if [ "$_new_len" -gt "$_old_len" ]; then - _best_zone="$_clean_z" - fi - ;; + "$_clean_z"|*".$_clean_z") + # Compare length using native shell ${#var} - Docker/BusyBox safe + if [ ${#_clean_z} -gt ${#_best_zone} ]; then + _best_zone="$_clean_z" + fi + ;; esac done - - if [ -n "$_best_zone" ]; then - printf "%s" "$_best_zone" - fi + [ -n "$_best_zone" ] && printf "%s" "$_best_zone" } From 4973f11dcf58ba131ed1c36866472d5cac188dc0 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 07:40:08 +0100 Subject: [PATCH 033/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 7eadf69f..49c47028 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -22,7 +22,7 @@ dns_czechia_add() { fi _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - + # Normalize using acme.sh internal function - NO 'tr' used here _fd=$(_lower_case "$fulldomain" | sed 's/\.$//') _cz=$(_lower_case "$_current_zone") @@ -86,7 +86,7 @@ _czechia_pick_zone() { _fulldomain="$1" _fd=$(_lower_case "$_fulldomain" | sed 's/\.$//') _best_zone="" - + # Replace comma with space using sed (Docker safe) _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') @@ -94,14 +94,14 @@ _czechia_pick_zone() { # Remove spaces and trailing dot, then lowercase - NO 'tr' used here _clean_z=$(_lower_case "$_z" | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue - + case "$_fd" in - "$_clean_z"|*".$_clean_z") - # Compare length using native shell ${#var} - Docker/BusyBox safe - if [ ${#_clean_z} -gt ${#_best_zone} ]; then - _best_zone="$_clean_z" - fi - ;; + "$_clean_z" | *".$_clean_z") + # Compare length using native shell ${#var} - Docker/BusyBox safe + if [ ${#_clean_z} -gt ${#_best_zone} ]; then + _best_zone="$_clean_z" + fi + ;; esac done [ -n "$_best_zone" ] && printf "%s" "$_best_zone" From ed34e89dffc8e39e35d70e193bf2bc6b363b6f00 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 07:58:15 +0100 Subject: [PATCH 034/167] Update DNS.yml --- .github/workflows/DNS.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 1a37b8a9..8e6e2964 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -25,13 +25,14 @@ jobs: - name: Set the value id: step_one run: | - if [ "${{secrets.TokenName1}}" ] ; then - echo "::set-output name=hasToken::true" + # Všimni si mezer v ${{ secrets... }} a nového zápisu do $GITHUB_OUTPUT + if [ -n "${{ secrets.TokenName1 }}" ]; then + echo "hasToken=true" >> $GITHUB_OUTPUT else - echo "::set-output name=hasToken::false" + echo "hasToken=false" >> $GITHUB_OUTPUT fi - name: Check the value - run: echo ${{ steps.step_one.outputs.hasToken }} + run: echo "Vystup je:${{ steps.step_one.outputs.hasToken }}" Fail: runs-on: ubuntu-latest @@ -88,6 +89,12 @@ jobs: echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env fi + - name: Debug + run: | + echo "Token name length: ${#TOKEN}" + env: + TOKEN: ${{ secrets.TokenName1 }} + - name: Run acmetest run: cd ../acmetest && ./rundocker.sh testall From b56fc570bff75b8ed5635f7046088bd5194ec3a0 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 07:59:47 +0100 Subject: [PATCH 035/167] Update DNS.yml --- .github/workflows/DNS.yml | 61 ++++++++++++--------------------------- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 8e6e2964..053b45e3 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -25,11 +25,10 @@ jobs: - name: Set the value id: step_one run: | - # Všimni si mezer v ${{ secrets... }} a nového zápisu do $GITHUB_OUTPUT if [ -n "${{ secrets.TokenName1 }}" ]; then - echo "hasToken=true" >> $GITHUB_OUTPUT + echo "hasToken=true" >> "$GITHUB_OUTPUT" else - echo "hasToken=false" >> $GITHUB_OUTPUT + echo "hasToken=false" >> "$GITHUB_OUTPUT" fi - name: Check the value run: echo "Vystup je:${{ steps.step_one.outputs.hasToken }}" @@ -51,7 +50,7 @@ jobs: needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" env: - TEST_DNS : ${{ secrets.TEST_DNS }} + TEST_DNS: ${{ secrets.TEST_DNS }} TestingDomain: ${{ secrets.TestingDomain }} TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} @@ -59,47 +58,23 @@ jobs: CASE: le_test_dnsapi TEST_LOCAL: 1 DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} + TokenName1: ${{ secrets.TokenName1 }} + TokenValue1: ${{ secrets.TokenValue1 }} steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - name: Set env file - run: | - cd ../acmetest - if [ "${{ secrets.TokenName1}}" ] ; then - echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env - fi - if [ "${{ secrets.TokenName2}}" ] ; then - echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env - fi - if [ "${{ secrets.TokenName3}}" ] ; then - echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env - fi - if [ "${{ secrets.TokenName4}}" ] ; then - echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env - fi - if [ "${{ secrets.TokenName5}}" ] ; then - echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env - fi - - - name: Debug - run: | - echo "Token name length: ${#TOKEN}" - env: - TOKEN: ${{ secrets.TokenName1 }} - - - name: Run acmetest - run: cd ../acmetest && ./rundocker.sh testall - - + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Set env file + run: | + cd ../acmetest + if [ -n "${{ secrets.TokenName1 }}" ]; then + echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env + fi + # Pokud máte další tokeny, přidejte je stejným stylem: + # [ -n "${{ secrets.TokenName2 }}" ] && echo "${{ secrets.TokenName2 }}=${{ secrets.TokenValue2 }}" >> docker.env + - name: Run acmetest + run: cd ../acmetest && ./rundocker.sh testall MacOS: runs-on: macos-latest From 7e95f993645deda450d691418bfa391c886bca17 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:04:11 +0100 Subject: [PATCH 036/167] Update DNS.yml --- .github/workflows/DNS.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 053b45e3..31e7758e 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -66,12 +66,17 @@ jobs: run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | - cd ../acmetest + cd ../acmetest + echo "TEST_DNS=dns_czechia" >> docker.env + echo "TestingDomain=${{ env.TestingDomain }}" >> docker.env + echo "CASE=${{ env.CASE }}" >> docker.env + if [ -n "${{ secrets.TokenName1 }}" ]; then echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env fi - # Pokud máte další tokeny, přidejte je stejným stylem: - # [ -n "${{ secrets.TokenName2 }}" ] && echo "${{ secrets.TokenName2 }}=${{ secrets.TokenValue2 }}" >> docker.env + + echo "--- Kontrola obsahu env souboru ---" + cat docker.env | cut -d'=' -f1 - name: Run acmetest run: cd ../acmetest && ./rundocker.sh testall From 41c7c0eb95f68532e14424e1aeabdfad49868030 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:07:04 +0100 Subject: [PATCH 037/167] Update DNS.yml --- .github/workflows/DNS.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 31e7758e..426d5664 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -66,16 +66,18 @@ jobs: run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | - cd ../acmetest + cd ../acmetest + echo "TEST_DNS=dns_czechia" >> docker.env - echo "TestingDomain=${{ env.TestingDomain }}" >> docker.env - echo "CASE=${{ env.CASE }}" >> docker.env + echo "TestingDomain=3.zoner-test.eu" >> docker.env + echo "CASE=le_test_dnsapi" >> docker.env + echo "DEBUG=2" >> docker.env if [ -n "${{ secrets.TokenName1 }}" ]; then - echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env + echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env fi - echo "--- Kontrola obsahu env souboru ---" + echo "--- AKTUÁLNÍ OBSAH docker.env ---" cat docker.env | cut -d'=' -f1 - name: Run acmetest From 98cad271180c5ae0b594689017f573304daba003 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:11:34 +0100 Subject: [PATCH 038/167] Update DNS.yml --- .github/workflows/DNS.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 426d5664..9e308dd5 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -66,23 +66,25 @@ jobs: run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | + # Přejdeme do složky acmetest a vytvoříme soubor tam cd ../acmetest - echo "TEST_DNS=dns_czechia" >> docker.env + # Zápis s jistotou, že hodnoty tam budou + echo "TEST_DNS=dns_czechia" > docker.env echo "TestingDomain=3.zoner-test.eu" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env echo "DEBUG=2" >> docker.env + # Přidání tokenů if [ -n "${{ secrets.TokenName1 }}" ]; then - echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env + echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env fi - echo "--- AKTUÁLNÍ OBSAH docker.env ---" + # DŮLEŽITÁ DIAGNOSTIKA + echo "Cesta k souboru: $(pwd)/docker.env" + echo "Obsah souboru (jen klíče):" cat docker.env | cut -d'=' -f1 - - name: Run acmetest - run: cd ../acmetest && ./rundocker.sh testall - MacOS: runs-on: macos-latest needs: Docker From a16eab4a625c3c68d8b979fb946fddb6b0b445b4 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:14:10 +0100 Subject: [PATCH 039/167] Update DNS.yml --- .github/workflows/DNS.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 9e308dd5..8a7a6a7d 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -66,23 +66,19 @@ jobs: run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | - # Přejdeme do složky acmetest a vytvoříme soubor tam cd ../acmetest - - # Zápis s jistotou, že hodnoty tam budou + # Tady to vypíšeme natvrdo, aby to Docker stoprocentně viděl echo "TEST_DNS=dns_czechia" > docker.env echo "TestingDomain=3.zoner-test.eu" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env echo "DEBUG=2" >> docker.env - # Přidání tokenů + # Secrets (tokeny) tam klidně nech přes ty proměnné, ty fungují if [ -n "${{ secrets.TokenName1 }}" ]; then echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env fi - # DŮLEŽITÁ DIAGNOSTIKA - echo "Cesta k souboru: $(pwd)/docker.env" - echo "Obsah souboru (jen klíče):" + echo "--- Kontrola vytvořeného souboru ---" cat docker.env | cut -d'=' -f1 MacOS: From 722d7ff9941b4e9ce2fcd18ff84d7e7b67a557a2 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:15:49 +0100 Subject: [PATCH 040/167] Update DNS.yml return to original yaml --- .github/workflows/DNS.yml | 66 +++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 8a7a6a7d..b760d162 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -25,13 +25,13 @@ jobs: - name: Set the value id: step_one run: | - if [ -n "${{ secrets.TokenName1 }}" ]; then - echo "hasToken=true" >> "$GITHUB_OUTPUT" + if [ "${{secrets.TokenName1}}" ] ; then + echo "::set-output name=hasToken::true" else - echo "hasToken=false" >> "$GITHUB_OUTPUT" + echo "::set-output name=hasToken::false" fi - name: Check the value - run: echo "Vystup je:${{ steps.step_one.outputs.hasToken }}" + run: echo ${{ steps.step_one.outputs.hasToken }} Fail: runs-on: ubuntu-latest @@ -50,7 +50,7 @@ jobs: needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" env: - TEST_DNS: ${{ secrets.TEST_DNS }} + TEST_DNS : ${{ secrets.TEST_DNS }} TestingDomain: ${{ secrets.TestingDomain }} TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} @@ -58,28 +58,41 @@ jobs: CASE: le_test_dnsapi TEST_LOCAL: 1 DEBUG: ${{ secrets.DEBUG }} - TokenName1: ${{ secrets.TokenName1 }} - TokenValue1: ${{ secrets.TokenValue1 }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - name: Set env file - run: | - cd ../acmetest - # Tady to vypíšeme natvrdo, aby to Docker stoprocentně viděl - echo "TEST_DNS=dns_czechia" > docker.env - echo "TestingDomain=3.zoner-test.eu" >> docker.env - echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env - - # Secrets (tokeny) tam klidně nech přes ty proměnné, ty fungují - if [ -n "${{ secrets.TokenName1 }}" ]; then - echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env - fi - - echo "--- Kontrola vytvořeného souboru ---" - cat docker.env | cut -d'=' -f1 + - uses: actions/checkout@v4 + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Set env file + run: | + cd ../acmetest + if [ "${{ secrets.TokenName1}}" ] ; then + echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env + fi + if [ "${{ secrets.TokenName2}}" ] ; then + echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env + fi + if [ "${{ secrets.TokenName3}}" ] ; then + echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env + fi + if [ "${{ secrets.TokenName4}}" ] ; then + echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env + fi + if [ "${{ secrets.TokenName5}}" ] ; then + echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env + fi + + - name: Run acmetest + run: cd ../acmetest && ./rundocker.sh testall + + + MacOS: runs-on: macos-latest @@ -642,4 +655,3 @@ jobs: echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - From 2c14ca7dce041b16963109d97ebf7300a39d8c2c Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:28:32 +0100 Subject: [PATCH 041/167] Update DNS.yml --- .github/workflows/DNS.yml | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index b760d162..26b09689 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -71,22 +71,18 @@ jobs: run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | - cd ../acmetest - if [ "${{ secrets.TokenName1}}" ] ; then - echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env - fi - if [ "${{ secrets.TokenName2}}" ] ; then - echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env - fi - if [ "${{ secrets.TokenName3}}" ] ; then - echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env - fi - if [ "${{ secrets.TokenName4}}" ] ; then - echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env - fi - if [ "${{ secrets.TokenName5}}" ] ; then - echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env - fi + cd ../acmetest + # Tady definujeme cíl a doménu + echo "TEST_DNS=dns_czechia" > docker.env + echo "TestingDomain=3.zoner-test.eu" >> docker.env + echo "CASE=le_test_dnsapi" >> docker.env + echo "DEBUG=2" >> docker.env + + echo "CZECHIA_Token=${{ secrets.TokenValue1 }}" >> docker.env + echo "CZECHIA_ID=${{ secrets.TokenValue2 }}" >> docker.env + + echo "--- Kontrola (uvidíš jen názvy, hodnoty budou ***) ---" + cat docker.env | cut -d'=' -f1 - name: Run acmetest run: cd ../acmetest && ./rundocker.sh testall From 37ed2eb2234ad657fa44a8f2b95cc8e6bb7be32f Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:29:51 +0100 Subject: [PATCH 042/167] Update DNS.yml --- .github/workflows/DNS.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 26b09689..bf8cd387 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -71,10 +71,9 @@ jobs: run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | - cd ../acmetest - # Tady definujeme cíl a doménu + cd ../acmetest echo "TEST_DNS=dns_czechia" > docker.env - echo "TestingDomain=3.zoner-test.eu" >> docker.env + echo "TestingDomain=zoner-test.eu" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env echo "DEBUG=2" >> docker.env From 0bfd5b98e802a507231b1fef1da21a54dad575bc Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:32:09 +0100 Subject: [PATCH 043/167] Update DNS.yml --- .github/workflows/DNS.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index bf8cd387..ddc8097d 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -69,19 +69,22 @@ jobs: - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - name: Set env file + - name: Set env file run: | - cd ../acmetest - echo "TEST_DNS=dns_czechia" > docker.env - echo "TestingDomain=zoner-test.eu" >> docker.env - echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env + cd ../acmetest + # Tady nesmí být proměnné, musí tu být přímo ten text, + # jinak tam GitHub Actions zapíše hvězdičky! + echo "TEST_DNS=dns_czechia" > docker.env + echo "TestingDomain=3.zoner-test.eu" >> docker.env + echo "CASE=le_test_dnsapi" >> docker.env + echo "DEBUG=2" >> docker.env - echo "CZECHIA_Token=${{ secrets.TokenValue1 }}" >> docker.env - echo "CZECHIA_ID=${{ secrets.TokenValue2 }}" >> docker.env + # Tyto jsou tajné, ty hvězdičky v souboru mít MUSÍ (Docker si je rozšifruje) + echo "CZECHIA_Token=${{ secrets.TokenValue1 }}" >> docker.env + echo "CZECHIA_ID=${{ secrets.TokenValue2 }}" >> docker.env - echo "--- Kontrola (uvidíš jen názvy, hodnoty budou ***) ---" - cat docker.env | cut -d'=' -f1 + echo "--- Kontrola obsahu ---" + cat docker.env | cut -d'=' -f1 - name: Run acmetest run: cd ../acmetest && ./rundocker.sh testall From c6f14f1b67782de2e1639a00d715fc5fae86e148 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:33:34 +0100 Subject: [PATCH 044/167] Update DNS.yml --- .github/workflows/DNS.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index ddc8097d..0ee5c1c2 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -71,15 +71,11 @@ jobs: run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | - cd ../acmetest - # Tady nesmí být proměnné, musí tu být přímo ten text, - # jinak tam GitHub Actions zapíše hvězdičky! + cd ../acmetest echo "TEST_DNS=dns_czechia" > docker.env - echo "TestingDomain=3.zoner-test.eu" >> docker.env + echo "TestingDomain=zoner-test.eu" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env - - # Tyto jsou tajné, ty hvězdičky v souboru mít MUSÍ (Docker si je rozšifruje) + echo "DEBUG=2" >> docker.env echo "CZECHIA_Token=${{ secrets.TokenValue1 }}" >> docker.env echo "CZECHIA_ID=${{ secrets.TokenValue2 }}" >> docker.env From 834520beb292f9b656d1a3847cdf25cf6418a10a Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 08:55:06 +0100 Subject: [PATCH 045/167] Update DNS.yml --- .github/workflows/DNS.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 0ee5c1c2..aa9f38c0 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -69,13 +69,14 @@ jobs: - uses: actions/checkout@v4 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - - name: Set env file + - name: Set env file run: | - cd ../acmetest + cd ../acmetest echo "TEST_DNS=dns_czechia" > docker.env - echo "TestingDomain=zoner-test.eu" >> docker.env + echo "TestingDomain=3.zoner-test.eu" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env + echo "DEBUG=2" >> docker.env + echo "CZECHIA_Token=${{ secrets.TokenValue1 }}" >> docker.env echo "CZECHIA_ID=${{ secrets.TokenValue2 }}" >> docker.env From d1824348bc04210cd01906c6f93aa29384769eb2 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 09:06:32 +0100 Subject: [PATCH 046/167] Update DNS.yml --- .github/workflows/DNS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index aa9f38c0..e1eaaa47 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -71,9 +71,9 @@ jobs: run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | - cd ../acmetest + cd ../acmetest echo "TEST_DNS=dns_czechia" > docker.env - echo "TestingDomain=3.zoner-test.eu" >> docker.env + echo "TestingDomain=zoner-test.eu" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env echo "DEBUG=2" >> docker.env From ac38ff646ef21af18d9f85bf162708277a2a9727 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 09:17:03 +0100 Subject: [PATCH 047/167] Update DNS.yml --- .github/workflows/DNS.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index e1eaaa47..af1f3d12 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -50,8 +50,8 @@ jobs: needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS: dns_czechia + TestingDomain: 3.zoner-test.eu TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} @@ -68,20 +68,15 @@ jobs: steps: - uses: actions/checkout@v4 - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | - cd ../acmetest + cd ../acmetest echo "TEST_DNS=dns_czechia" > docker.env echo "TestingDomain=zoner-test.eu" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env - echo "CZECHIA_Token=${{ secrets.TokenValue1 }}" >> docker.env echo "CZECHIA_ID=${{ secrets.TokenValue2 }}" >> docker.env - - echo "--- Kontrola obsahu ---" - cat docker.env | cut -d'=' -f1 - name: Run acmetest run: cd ../acmetest && ./rundocker.sh testall From 13519534146a8db4971bdb86aab3be56caf48515 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 09:19:36 +0100 Subject: [PATCH 048/167] Update DNS.yml --- .github/workflows/DNS.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index af1f3d12..c5aa1458 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -75,6 +75,7 @@ jobs: echo "TEST_DNS=dns_czechia" > docker.env echo "TestingDomain=zoner-test.eu" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env + echo "DEBUG=2" >> docker.env echo "CZECHIA_Token=${{ secrets.TokenValue1 }}" >> docker.env echo "CZECHIA_ID=${{ secrets.TokenValue2 }}" >> docker.env From 594a2c1e07336c5f16d79a1c35c55d471bb6ae25 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 09:45:03 +0100 Subject: [PATCH 049/167] Update DNS.yml --- .github/workflows/DNS.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index c5aa1458..4bc42dd8 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -71,13 +71,18 @@ jobs: run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - name: Set env file run: | - cd ../acmetest - echo "TEST_DNS=dns_czechia" > docker.env - echo "TestingDomain=zoner-test.eu" >> docker.env + cd ../acmetest + echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env + echo "TestingDomain=${{ vars.TESTING_DOMAIN }}" >> docker.env + echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env - echo "CZECHIA_Token=${{ secrets.TokenValue1 }}" >> docker.env - echo "CZECHIA_ID=${{ secrets.TokenValue2 }}" >> docker.env + echo "DEBUG=2" >> docker.env + + echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env + echo "${{ vars.TokenName2 }}=${{ vars.TokenValue2 }}" >> docker.env + + echo "--- Kontrola struktury docker.env ---" + cut -d'=' -f1 docker.env - name: Run acmetest run: cd ../acmetest && ./rundocker.sh testall From 905ec205e8a73a75d5f993e59f0b503c5397f85a Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 10:53:16 +0100 Subject: [PATCH 050/167] Update DNS.yml --- .github/workflows/DNS.yml | 43 ++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 4bc42dd8..3c4f09eb 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -49,44 +49,45 @@ jobs: runs-on: ubuntu-latest needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" + # Tady v env: nechej jen věci, které nechceš dávat do docker.env + # nebo které jsou potřeba pro samotné spuštění rundocker.sh env: - TEST_DNS: dns_czechia - TestingDomain: 3.zoner-test.eu - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} + # Odstraňujeme duplicity, které budeme psát přímo do docker.env steps: - uses: actions/checkout@v4 + - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + run: | + cd .. + git clone --depth=1 https://github.com/acmesh-official/acmetest.git + cp -r acme.sh acmetest/ + - name: Set env file run: | - cd ../acmetest + cd ../acmetest + # 1. Základní parametry z Variables echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env echo "TestingDomain=${{ vars.TESTING_DOMAIN }}" >> docker.env echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env - + echo "DEBUG=2" >> docker.env + + # 2. Tokeny (1. ze secrets, 2. z variables dle tvého zadání) echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env echo "${{ vars.TokenName2 }}=${{ vars.TokenValue2 }}" >> docker.env - echo "--- Kontrola struktury docker.env ---" + # 3. Volitelné: přidání proxy, pokud jsou potřeba + [ -n "${{ secrets.http_proxy }}" ] && echo "http_proxy=${{ secrets.http_proxy }}" >> docker.env + [ -n "${{ secrets.https_proxy }}" ] && echo "https_proxy=${{ secrets.https_proxy }}" >> docker.env + + echo "--- Kontrola vytvořeného souboru (názvy proměnných) ---" cut -d'=' -f1 docker.env - name: Run acmetest - run: cd ../acmetest && ./rundocker.sh testall - + run: | + cd ../acmetest + ./rundocker.sh testall From fa4193e2aa3cbdf006204c0b1e963ba6952496c6 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 11:38:45 +0100 Subject: [PATCH 051/167] Update DNS.yml --- .github/workflows/DNS.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 3c4f09eb..aa4a6936 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -65,21 +65,17 @@ jobs: - name: Set env file run: | - cd ../acmetest - # 1. Základní parametry z Variables + cd ../acmetest echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env echo "TestingDomain=${{ vars.TESTING_DOMAIN }}" >> docker.env echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env echo "DEBUG=2" >> docker.env - # 2. Tokeny (1. ze secrets, 2. z variables dle tvého zadání) + echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env - echo "${{ vars.TokenName2 }}=${{ vars.TokenValue2 }}" >> docker.env - - # 3. Volitelné: přidání proxy, pokud jsou potřeba - [ -n "${{ secrets.http_proxy }}" ] && echo "http_proxy=${{ secrets.http_proxy }}" >> docker.env - [ -n "${{ secrets.https_proxy }}" ] && echo "https_proxy=${{ secrets.https_proxy }}" >> docker.env + echo "${{ vars.TokenName2 }}=${{ vars.TokenValue2 }}" >> docker.env + echo "--- Kontrola vytvořeného souboru (názvy proměnných) ---" cut -d'=' -f1 docker.env From 7ad8c8759f905cbe7a49798423cac8756dbbc687 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 11:49:07 +0100 Subject: [PATCH 052/167] Update DNS.yml --- .github/workflows/DNS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index aa4a6936..87bb30e7 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -83,7 +83,7 @@ jobs: - name: Run acmetest run: | cd ../acmetest - ./rundocker.sh testall + ./rundocker.sh testall -d ${{ vars.TESTING_DOMAIN }} From 61cc3b19066de208d708118ed3bcc30daf3c6da4 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 11:57:12 +0100 Subject: [PATCH 053/167] Update DNS.yml --- .github/workflows/DNS.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 87bb30e7..b092e121 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -67,12 +67,10 @@ jobs: run: | cd ../acmetest echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env - echo "TestingDomain=${{ vars.TESTING_DOMAIN }}" >> docker.env + echo "TestingDomain=${{ vars.TestingDomain }}" >> docker.env echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env - - + echo "DEBUG=2" >> docker.env echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env echo "${{ vars.TokenName2 }}=${{ vars.TokenValue2 }}" >> docker.env From b502d27558fda996e72cd43283d7bfa51278d654 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 12:16:24 +0100 Subject: [PATCH 054/167] Update DNS.yml --- .github/workflows/DNS.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index b092e121..7bf4c8ec 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -49,11 +49,8 @@ jobs: runs-on: ubuntu-latest needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" - # Tady v env: nechej jen věci, které nechceš dávat do docker.env - # nebo které jsou potřeba pro samotné spuštění rundocker.sh env: CASE: le_test_dnsapi - # Odstraňujeme duplicity, které budeme psát přímo do docker.env steps: - uses: actions/checkout@v4 From 55fa9c59ef1f77a37a8ec538cce53c68b7b1756b Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 12:29:23 +0100 Subject: [PATCH 055/167] Update DNS.yml --- .github/workflows/DNS.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 7bf4c8ec..ad454c13 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -47,6 +47,7 @@ jobs: Docker: runs-on: ubuntu-latest + environment: Testing needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" env: @@ -57,23 +58,20 @@ jobs: - name: Clone acmetest run: | cd .. - git clone --depth=1 https://github.com/acmesh-official/acmetest.git - cp -r acme.sh acmetest/ + git clone --depth=1 https://github.com/acmesh-official/acmetest.git + cp -r acme.sh acmetest/acme.sh - name: Set env file run: | - cd ../acmetest + cd ../acmetest echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env echo "TestingDomain=${{ vars.TestingDomain }}" >> docker.env - echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env - echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env - echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env - echo "${{ vars.TokenName2 }}=${{ vars.TokenValue2 }}" >> docker.env - - - echo "--- Kontrola vytvořeného souboru (názvy proměnných) ---" - cut -d'=' -f1 docker.env + echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env + echo "Token length: ${#TOKEN}" + env: + TOKEN: ${{ secrets.TokenValue1 }} + echo "--- Kontrola vytvořeného souboru (názvy proměnných) ---" + cut -d'=' -f1 docker.env - name: Run acmetest run: | From 7de821091b0be64e0d1161fbf3683d0b6db76dd4 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 12:40:36 +0100 Subject: [PATCH 056/167] Update DNS.yml --- .github/workflows/DNS.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index ad454c13..8891f8a9 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -66,12 +66,12 @@ jobs: cd ../acmetest echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env echo "TestingDomain=${{ vars.TestingDomain }}" >> docker.env + echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env - echo "Token length: ${#TOKEN}" - env: - TOKEN: ${{ secrets.TokenValue1 }} - echo "--- Kontrola vytvořeného souboru (názvy proměnných) ---" - cut -d'=' -f1 docker.env + echo "${{ secrets.TokenName2 }}=${{ secrets.TokenValue2 }}" >> docker.env + + echo "CASE=le_test_dnsapi" >> docker.env + echo "DEBUG=2" >> docker.env - name: Run acmetest run: | From 994ea6e083885a63642ad633db3e419e9e4825d8 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 12:53:09 +0100 Subject: [PATCH 057/167] Update DNS.yml --- .github/workflows/DNS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 8891f8a9..c987aa9c 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -67,8 +67,8 @@ jobs: echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env echo "TestingDomain=${{ vars.TestingDomain }}" >> docker.env echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env - echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env - echo "${{ secrets.TokenName2 }}=${{ secrets.TokenValue2 }}" >> docker.env + echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env + echo "${{ vars.TokenName2 }}=${{ vars.TokenValue2 }}" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env echo "DEBUG=2" >> docker.env From fea644e6dc1a8530f6ee215e4f41b7af4160f318 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 12:56:02 +0100 Subject: [PATCH 058/167] Update DNS.yml --- .github/workflows/DNS.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index c987aa9c..5e05fc84 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,11 +64,16 @@ jobs: - name: Set env file run: | cd ../acmetest + # Používej všude stejný název proměnné pro doménu (tady vars.TestingDomain) echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env echo "TestingDomain=${{ vars.TestingDomain }}" >> docker.env echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env - echo "${{ secrets.TokenName1 }}=${{ secrets.TokenValue1 }}" >> docker.env - echo "${{ vars.TokenName2 }}=${{ vars.TokenValue2 }}" >> docker.env + + # Zapiš název proměnné pro token NATVRDO, protože GitHub neumí dynamicky číst název secretu + echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env + + # Tady ti to fungovalo, tak to klidně nech, nebo také napiš CZ_Zones=... + echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env echo "DEBUG=2" >> docker.env @@ -76,7 +81,8 @@ jobs: - name: Run acmetest run: | cd ../acmetest - ./rundocker.sh testall -d ${{ vars.TESTING_DOMAIN }} + # POZOR: Tady musí být název proměnné PŘESNĚ jako v Settings (asi TestingDomain) + ./rundocker.sh testall -d ${{ vars.TestingDomain }} From 4670e6a0e27ccf906543e4fcfad34ff419f0fdc7 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 12:58:53 +0100 Subject: [PATCH 059/167] Update DNS.yml --- .github/workflows/DNS.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 5e05fc84..8afd9a48 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,15 +64,12 @@ jobs: - name: Set env file run: | cd ../acmetest - # Používej všude stejný název proměnné pro doménu (tady vars.TestingDomain) echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env echo "TestingDomain=${{ vars.TestingDomain }}" >> docker.env echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env - # Zapiš název proměnné pro token NATVRDO, protože GitHub neumí dynamicky číst název secretu echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env - # Tady ti to fungovalo, tak to klidně nech, nebo také napiš CZ_Zones=... echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env From b05f692a23460b48d14874995305a0094dc3ad9e Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 13:02:55 +0100 Subject: [PATCH 060/167] Update DNS.yml --- .github/workflows/DNS.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 8afd9a48..017ccb10 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,12 +64,14 @@ jobs: - name: Set env file run: | cd ../acmetest + # 1. Variables - pozor na malá/velká písmena (používám TestingDomain) echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env echo "TestingDomain=${{ vars.TestingDomain }}" >> docker.env echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env + # 2. Secrets - NAPIŠ NÁZEV PROMĚNNÉ NATVRDO + # Tady musí být vlevo přesně to, co chce plugin dns_czechia echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env - echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env @@ -78,11 +80,12 @@ jobs: - name: Run acmetest run: | cd ../acmetest - # POZOR: Tady musí být název proměnné PŘESNĚ jako v Settings (asi TestingDomain) + # 3. Tady musí název proměnné sedět s tím, co máš v Settings ./rundocker.sh testall -d ${{ vars.TestingDomain }} + MacOS: runs-on: macos-latest needs: Docker From 8b4e1474c5e90555ee6aecacba2254938a7093e7 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 13:06:56 +0100 Subject: [PATCH 061/167] Update DNS.yml --- .github/workflows/DNS.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 017ccb10..dfbed3f9 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,18 +64,16 @@ jobs: - name: Set env file run: | cd ../acmetest - # 1. Variables - pozor na malá/velká písmena (používám TestingDomain) - echo "TEST_DNS=${{ vars.TEST_DNS }}" > docker.env - echo "TestingDomain=${{ vars.TestingDomain }}" >> docker.env - echo "TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}" >> docker.env - - # 2. Secrets - NAPIŠ NÁZEV PROMĚNNÉ NATVRDO - # Tady musí být vlevo přesně to, co chce plugin dns_czechia - echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env - echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env - - echo "CASE=le_test_dnsapi" >> docker.env - echo "DEBUG=2" >> docker.env + echo 'CZ_AuthorizationToken=${{ secrets.TokenValue1 }}' >> docker.env + echo 'CZ_Zones=${{ vars.TokenValue2 }}' >> docker.env + echo 'TEST_DNS=${{ vars.TEST_DNS }}' >> docker.env + echo 'TestingDomain=${{ vars.TestingDomain }}' >> docker.env + echo 'TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}' >> docker.env + echo 'CASE=le_test_dnsapi' >> docker.env + echo 'DEBUG=2' >> docker.env + + echo "--- KONTROLA SOUBORU (UVIDÍŠ NÁZVY) ---" + cat docker.env | cut -d'=' -f1 - name: Run acmetest run: | From 82ab05eed838a00995a837260c6ebeb3caf13b87 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 13:13:23 +0100 Subject: [PATCH 062/167] Update DNS.yml --- .github/workflows/DNS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index dfbed3f9..4937384c 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -67,7 +67,7 @@ jobs: echo 'CZ_AuthorizationToken=${{ secrets.TokenValue1 }}' >> docker.env echo 'CZ_Zones=${{ vars.TokenValue2 }}' >> docker.env echo 'TEST_DNS=${{ vars.TEST_DNS }}' >> docker.env - echo 'TestingDomain=${{ vars.TestingDomain }}' >> docker.env + echo 'TestingDomain=${{ secrets.TestingDomain }}' >> docker.env echo 'TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}' >> docker.env echo 'CASE=le_test_dnsapi' >> docker.env echo 'DEBUG=2' >> docker.env @@ -79,7 +79,7 @@ jobs: run: | cd ../acmetest # 3. Tady musí název proměnné sedět s tím, co máš v Settings - ./rundocker.sh testall -d ${{ vars.TestingDomain }} + ./rundocker.sh testall -d ${{ secrets.TestingDomain }} From 7258be2033c4ba2c18a1f2c0b11c26e463b8b941 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 13:17:27 +0100 Subject: [PATCH 063/167] Update DNS.yml --- .github/workflows/DNS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 4937384c..2404a491 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -68,9 +68,9 @@ jobs: echo 'CZ_Zones=${{ vars.TokenValue2 }}' >> docker.env echo 'TEST_DNS=${{ vars.TEST_DNS }}' >> docker.env echo 'TestingDomain=${{ secrets.TestingDomain }}' >> docker.env - echo 'TEST_DNS_SLEEP=${{ vars.TEST_DNS_SLEEP }}' >> docker.env + echo "TEST_DNS_SLEEP=120" >> docker.env echo 'CASE=le_test_dnsapi' >> docker.env - echo 'DEBUG=2' >> docker.env + echo 'DEBUG=3' >> docker.env echo "--- KONTROLA SOUBORU (UVIDÍŠ NÁZVY) ---" cat docker.env | cut -d'=' -f1 From cc0233e5a98e8dd8041ac0cf1de8fadebc71d5fb Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 13:49:34 +0100 Subject: [PATCH 064/167] Update DNS.yml --- .github/workflows/DNS.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 2404a491..b766bcba 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,26 +64,20 @@ jobs: - name: Set env file run: | cd ../acmetest - echo 'CZ_AuthorizationToken=${{ secrets.TokenValue1 }}' >> docker.env - echo 'CZ_Zones=${{ vars.TokenValue2 }}' >> docker.env - echo 'TEST_DNS=${{ vars.TEST_DNS }}' >> docker.env - echo 'TestingDomain=${{ secrets.TestingDomain }}' >> docker.env - echo "TEST_DNS_SLEEP=120" >> docker.env - echo 'CASE=le_test_dnsapi' >> docker.env - echo 'DEBUG=3' >> docker.env - - echo "--- KONTROLA SOUBORU (UVIDÍŠ NÁZVY) ---" - cat docker.env | cut -d'=' -f1 + echo TestingDomain=${{ secrets.TestingDomain }} > docker.env + echo TEST_DNS_SLEEP=240 >> docker.env + echo CZ_AuthorizationToken=${{ secrets.TokenValue1 }} >> docker.env + echo CZ_Zones=${{ vars.TokenValue2 }} >> docker.env + echo CASE=le_test_dnsapi >> docker.env + + echo DEBUG=3 >> docker.env - name: Run acmetest run: | cd ../acmetest - # 3. Tady musí název proměnné sedět s tím, co máš v Settings ./rundocker.sh testall -d ${{ secrets.TestingDomain }} - - MacOS: runs-on: macos-latest needs: Docker From bda94c3be5cc20a35a9932011031c353b725a35b Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 15:09:19 +0100 Subject: [PATCH 065/167] Update DNS.yml --- .github/workflows/DNS.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index b766bcba..02a6cf80 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,11 +64,10 @@ jobs: - name: Set env file run: | cd ../acmetest - echo TestingDomain=${{ secrets.TestingDomain }} > docker.env - echo TEST_DNS_SLEEP=240 >> docker.env - echo CZ_AuthorizationToken=${{ secrets.TokenValue1 }} >> docker.env - echo CZ_Zones=${{ vars.TokenValue2 }} >> docker.env - echo CASE=le_test_dnsapi >> docker.env + export TestingDomain=${{ secrets.TestingDomain }} + export CZ_AuthorizationToken=${{ secrets.TokenValue1 }} + export CZ_Zones=${{ vars.TokenValue2 }} + export TEST_DNS_SLEEP=240 echo DEBUG=3 >> docker.env From 085286a9fc7cca183bcd252f391172856617f4e8 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 15:28:43 +0100 Subject: [PATCH 066/167] Update DNS.yml --- .github/workflows/DNS.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 02a6cf80..5c3a3e9e 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,6 +64,7 @@ jobs: - name: Set env file run: | cd ../acmetest + echo "DNSAPI=czechia" >> docker.env export TestingDomain=${{ secrets.TestingDomain }} export CZ_AuthorizationToken=${{ secrets.TokenValue1 }} export CZ_Zones=${{ vars.TokenValue2 }} From 7b968eb65f68fc28bc9b77a59577f3e5dbcb5a26 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 15:49:31 +0100 Subject: [PATCH 067/167] Update dns_czechia.sh changed lowercase functions --- dnsapi/dns_czechia.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 49c47028..16007bc4 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -84,7 +84,7 @@ _czechia_load_conf() { _czechia_pick_zone() { _fulldomain="$1" - _fd=$(_lower_case "$_fulldomain" | sed 's/\.$//') + _fd=$(echo "$_fulldomain" | _lower_case | sed 's/\.$//') _best_zone="" # Replace comma with space using sed (Docker safe) @@ -92,7 +92,7 @@ _czechia_pick_zone() { for _z in $_zones_space; do # Remove spaces and trailing dot, then lowercase - NO 'tr' used here - _clean_z=$(_lower_case "$_z" | sed 's/ //g; s/\.$//') + _clean_z=$(echo "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in From cdcc634470000091a4527158263a6b772761336e Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 15:52:56 +0100 Subject: [PATCH 068/167] Update DNS.yml --- .github/workflows/DNS.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 5c3a3e9e..df3b9d9a 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,18 +64,18 @@ jobs: - name: Set env file run: | cd ../acmetest + echo "TestingDomain=${{ secrets.TestingDomain }}" > docker.env echo "DNSAPI=czechia" >> docker.env - export TestingDomain=${{ secrets.TestingDomain }} - export CZ_AuthorizationToken=${{ secrets.TokenValue1 }} - export CZ_Zones=${{ vars.TokenValue2 }} - export TEST_DNS_SLEEP=240 - - echo DEBUG=3 >> docker.env + echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env + echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env + echo "TEST_DNS_SLEEP=240" >> docker.env + echo "DEBUG=3" >> docker.env + echo "CASE=le_test_dnsapi" >> docker.env - name: Run acmetest run: | cd ../acmetest - ./rundocker.sh testall -d ${{ secrets.TestingDomain }} + ./rundocker.sh debian:bookworm MacOS: From 8dc6b54e60294493167ca4df97bb96ca90e960a5 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 15:56:33 +0100 Subject: [PATCH 069/167] Update DNS.yml --- .github/workflows/DNS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index df3b9d9a..472d2f6e 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -75,7 +75,7 @@ jobs: - name: Run acmetest run: | cd ../acmetest - ./rundocker.sh debian:bookworm + ./rundocker.sh -i debian:bookworm MacOS: From 99ada8c8ba1155a9eef2dabad2aa564ce13401ce Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 15:59:50 +0100 Subject: [PATCH 070/167] Update DNS.yml --- .github/workflows/DNS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 472d2f6e..66799926 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -75,7 +75,7 @@ jobs: - name: Run acmetest run: | cd ../acmetest - ./rundocker.sh -i debian:bookworm + ./rundocker.sh debian:bookworm -d ${{ secrets.TestingDomain }} MacOS: From 6978b53fa4af1fb5e81c920f7036d777851adce0 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:06:34 +0100 Subject: [PATCH 071/167] Update DNS.yml --- .github/workflows/DNS.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 66799926..746b7356 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,18 +64,23 @@ jobs: - name: Set env file run: | cd ../acmetest + # Do docker.env musíme dát úplně všechno echo "TestingDomain=${{ secrets.TestingDomain }}" > docker.env echo "DNSAPI=czechia" >> docker.env echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env echo "TEST_DNS_SLEEP=240" >> docker.env echo "DEBUG=3" >> docker.env + # CASE nadefinujeme uvnitř souboru echo "CASE=le_test_dnsapi" >> docker.env - name: Run acmetest run: | cd ../acmetest - ./rundocker.sh debian:bookworm -d ${{ secrets.TestingDomain }} + # Spustíme rundocker ÚPLNĚ BEZ PARAMETRŮ. + # On si automaticky vezme první obraz, který najde v seznamu (standardně debian) + # a použije náš docker.env. + ./rundocker.sh MacOS: From 441cf6af37b5a86029d84ade85435e32c2c32bab Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:08:36 +0100 Subject: [PATCH 072/167] Update DNS.yml --- .github/workflows/DNS.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 746b7356..1075629b 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -77,10 +77,7 @@ jobs: - name: Run acmetest run: | cd ../acmetest - # Spustíme rundocker ÚPLNĚ BEZ PARAMETRŮ. - # On si automaticky vezme první obraz, který najde v seznamu (standardně debian) - # a použije náš docker.env. - ./rundocker.sh + ./rundocker.sh testplat debian:bookworm MacOS: From f770700024746d5e4458089dbdb7907a46314b08 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:13:21 +0100 Subject: [PATCH 073/167] Update DNS.yml --- .github/workflows/DNS.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 1075629b..e77c5d9c 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,15 +64,15 @@ jobs: - name: Set env file run: | cd ../acmetest - # Do docker.env musíme dát úplně všechno + # Musíme simulovat parametry, které acme.sh potřebuje pro DNS mód echo "TestingDomain=${{ secrets.TestingDomain }}" > docker.env echo "DNSAPI=czechia" >> docker.env echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env - echo "TEST_DNS_SLEEP=240" >> docker.env - echo "DEBUG=3" >> docker.env - # CASE nadefinujeme uvnitř souboru echo "CASE=le_test_dnsapi" >> docker.env + # DŮLEŽITÉ: Přidej toto, aby acme.sh věděl, že má použít tvůj plugin + echo "EXTRA_PARAMS=--dns dns_czechia" >> docker.env + echo "DEBUG=3" >> docker.env - name: Run acmetest run: | From 8053cb37c27a6ec29892a33d21ee2046e236aa8e Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:15:14 +0100 Subject: [PATCH 074/167] Update DNS.yml --- .github/workflows/DNS.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index e77c5d9c..fd4ef63c 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -64,15 +64,19 @@ jobs: - name: Set env file run: | cd ../acmetest - # Musíme simulovat parametry, které acme.sh potřebuje pro DNS mód + # VYMAŽEME starý obsah a dáme tam PŘESNĚ toto: echo "TestingDomain=${{ secrets.TestingDomain }}" > docker.env echo "DNSAPI=czechia" >> docker.env echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env echo "CASE=le_test_dnsapi" >> docker.env - # DŮLEŽITÉ: Přidej toto, aby acme.sh věděl, že má použít tvůj plugin - echo "EXTRA_PARAMS=--dns dns_czechia" >> docker.env + + # TOTO JSOU TY DVA CHYBĚJÍCÍ ŘÁDKY: + echo "TEST_DNS=1" >> docker.env echo "DEBUG=3" >> docker.env + + # Pro jistotu si v logu ověříme, že v souboru je to, co má být + grep "=" docker.env | cut -d'=' -f1 - name: Run acmetest run: | From d015d48562082d76feffbc8f44b7f9b6ffe83f83 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:20:25 +0100 Subject: [PATCH 075/167] Update dns_czechia.sh adding two debug checks --- dnsapi/dns_czechia.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 16007bc4..63094e88 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -83,6 +83,8 @@ _czechia_load_conf() { } _czechia_pick_zone() { + _debug "Vstupni domena: $_fulldomain" + _debug "Dostupne zony: $CZ_Zones" _fulldomain="$1" _fd=$(echo "$_fulldomain" | _lower_case | sed 's/\.$//') _best_zone="" From f41d068bfa555455c00ac251e387743414689d39 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:24:03 +0100 Subject: [PATCH 076/167] Update DNS.yml --- .github/workflows/DNS.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index fd4ef63c..bbe73a42 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -81,6 +81,12 @@ jobs: - name: Run acmetest run: | cd ../acmetest + # VNUTÍME naši verzi pluginu přímo do místa, odkud ji Docker bere + cp ../acme.sh/dnsapi/dns_czechia.sh ./acme.sh/dnsapi/dns_czechia.sh + + # Spustíme test s vypnutou aktualizací (přidáme NO_UPGRADE) + echo "NO_UPGRADE=1" >> docker.env + ./rundocker.sh testplat debian:bookworm From 492eacb724f27acd0f3c67fbb54383e423040e9e Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:26:49 +0100 Subject: [PATCH 077/167] Update DNS.yml --- .github/workflows/DNS.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index bbe73a42..3f85d120 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -81,12 +81,24 @@ jobs: - name: Run acmetest run: | cd ../acmetest - # VNUTÍME naši verzi pluginu přímo do místa, odkud ji Docker bere - cp ../acme.sh/dnsapi/dns_czechia.sh ./acme.sh/dnsapi/dns_czechia.sh - - # Spustíme test s vypnutou aktualizací (přidáme NO_UPGRADE) + # 1. Nejdříve vytvoříme docker.env se vším potřebným + echo "TestingDomain=${{ secrets.TestingDomain }}" > docker.env + echo "DNSAPI=czechia" >> docker.env + echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env + echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env + echo "CASE=le_test_dnsapi" >> docker.env + echo "TEST_DNS=1" >> docker.env + echo "DEBUG=3" >> docker.env echo "NO_UPGRADE=1" >> docker.env + # 2. VNUTÍME plugin do všech možných cest, které by mohl Docker použít + mkdir -p ./acme.sh/dnsapi/ + cp ../acme.sh/dnsapi/dns_czechia.sh ./acme.sh/dnsapi/dns_czechia.sh + + # 3. Zkontrolujeme, zda soubor obsahuje tvůj debug (uvidíš v logu GHA) + grep "Vstupni domena" ./acme.sh/dnsapi/dns_czechia.sh || echo "POZOR: Debug v souboru CHYBÍ!" + + # 4. Spuštění ./rundocker.sh testplat debian:bookworm From 09ae283ef814262733edfb14b791bedc3cb0b771 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:30:24 +0100 Subject: [PATCH 078/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 63094e88..c0fc7701 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -83,10 +83,10 @@ _czechia_load_conf() { } _czechia_pick_zone() { - _debug "Vstupni domena: $_fulldomain" - _debug "Dostupne zony: $CZ_Zones" - _fulldomain="$1" - _fd=$(echo "$_fulldomain" | _lower_case | sed 's/\.$//') + _fd_input="$1" + _debug "Vstupni domena: $_fd_input" + _debug "Dostupne zony: $CZ_Zones" + _fd=$(echo "$_fd_input" | _lower_case | sed 's/\.$//') _best_zone="" # Replace comma with space using sed (Docker safe) From 3717f5500de749b15f3042276760d5c2739dadcc Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:33:02 +0100 Subject: [PATCH 079/167] Update DNS.yml --- .github/workflows/DNS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 3f85d120..5aa85a41 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -78,10 +78,10 @@ jobs: # Pro jistotu si v logu ověříme, že v souboru je to, co má být grep "=" docker.env | cut -d'=' -f1 - - name: Run acmetest + - name: Set env file run: | cd ../acmetest - # 1. Nejdříve vytvoříme docker.env se vším potřebným + # POUZE tyto proměnné, nic víc: echo "TestingDomain=${{ secrets.TestingDomain }}" > docker.env echo "DNSAPI=czechia" >> docker.env echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env From 038da5081055b88522129b799acecb0ae11c9dae Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:34:28 +0100 Subject: [PATCH 080/167] Update DNS.yml --- .github/workflows/DNS.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 5aa85a41..a529d5e9 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -78,10 +78,10 @@ jobs: # Pro jistotu si v logu ověříme, že v souboru je to, co má být grep "=" docker.env | cut -d'=' -f1 - - name: Set env file + - name: Run acmetest run: | cd ../acmetest - # POUZE tyto proměnné, nic víc: + # 1. Příprava env (máš správně) echo "TestingDomain=${{ secrets.TestingDomain }}" > docker.env echo "DNSAPI=czechia" >> docker.env echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env @@ -91,13 +91,13 @@ jobs: echo "DEBUG=3" >> docker.env echo "NO_UPGRADE=1" >> docker.env - # 2. VNUTÍME plugin do všech možných cest, které by mohl Docker použít + # 2. Vnutíš plugin mkdir -p ./acme.sh/dnsapi/ cp ../acme.sh/dnsapi/dns_czechia.sh ./acme.sh/dnsapi/dns_czechia.sh - # 3. Zkontrolujeme, zda soubor obsahuje tvůj debug (uvidíš v logu GHA) - grep "Vstupni domena" ./acme.sh/dnsapi/dns_czechia.sh || echo "POZOR: Debug v souboru CHYBÍ!" - + # 3. Kontrola (jen grep, nic nespouštěj!) + grep "Vstupni domena" ./acme.sh/dnsapi/dns_czechia.sh || echo "Debug v souboru není" + # 4. Spuštění ./rundocker.sh testplat debian:bookworm From 26f76e4e79d507cd404cd4eb2e335205c541261d Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:36:25 +0100 Subject: [PATCH 081/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index c0fc7701..ae670eb2 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -85,26 +85,24 @@ _czechia_load_conf() { _czechia_pick_zone() { _fd_input="$1" _debug "Vstupni domena: $_fd_input" - _debug "Dostupne zony: $CZ_Zones" + _debug "Dostupne zony: $CZ_Zones" _fd=$(echo "$_fd_input" | _lower_case | sed 's/\.$//') _best_zone="" - # Replace comma with space using sed (Docker safe) _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do - # Remove spaces and trailing dot, then lowercase - NO 'tr' used here _clean_z=$(echo "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in - "$_clean_z" | *".$_clean_z") - # Compare length using native shell ${#var} - Docker/BusyBox safe - if [ ${#_clean_z} -gt ${#_best_zone} ]; then - _best_zone="$_clean_z" - fi - ;; + "$_clean_z" | *".$_clean_z") + if [ ${#_clean_z} -gt ${#_best_zone} ]; then + _best_zone="$_clean_z" + fi + ;; esac - done + done # <--- TADY TI TO CHYBĚLO (před printf) + [ -n "$_best_zone" ] && printf "%s" "$_best_zone" } From 9de2dee794c5973687431461727a716140c144e1 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:38:39 +0100 Subject: [PATCH 082/167] Update dns_czechia.sh fixing czechia_pick_zone --- dnsapi/dns_czechia.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index ae670eb2..90b1b420 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -86,9 +86,11 @@ _czechia_pick_zone() { _fd_input="$1" _debug "Vstupni domena: $_fd_input" _debug "Dostupne zony: $CZ_Zones" + _fd=$(echo "$_fd_input" | _lower_case | sed 's/\.$//') _best_zone="" + # Replace comma with space using sed _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do @@ -102,7 +104,7 @@ _czechia_pick_zone() { fi ;; esac - done # <--- TADY TI TO CHYBĚLO (před printf) - + done # Toto done uzavírá 'for' + [ -n "$_best_zone" ] && printf "%s" "$_best_zone" } From 6dd5d416db12b15fcf4be8fe71a7a6e1397dae52 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:40:43 +0100 Subject: [PATCH 083/167] Update DNS.yml --- .github/workflows/DNS.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index a529d5e9..b03dcbf9 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -91,15 +91,16 @@ jobs: echo "DEBUG=3" >> docker.env echo "NO_UPGRADE=1" >> docker.env - # 2. Vnutíš plugin + # 2. VNUTÍME plugin a VYČISTÍME ho od Windows koncovek řádků mkdir -p ./acme.sh/dnsapi/ - cp ../acme.sh/dnsapi/dns_czechia.sh ./acme.sh/dnsapi/dns_czechia.sh - - # 3. Kontrola (jen grep, nic nespouštěj!) - grep "Vstupni domena" ./acme.sh/dnsapi/dns_czechia.sh || echo "Debug v souboru není" + # Tento příkaz odstraní neviditelné znaky \r (CRLF -> LF) + sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./acme.sh/dnsapi/dns_czechia.sh + # 3. Kontrola (uvidíš v logu, jestli tam nejsou divné znaky) + head -n 1 ./acme.sh/dnsapi/dns_czechia.sh | od -c + # 4. Spuštění - ./rundocker.sh testplat debian:bookworm + ./rundocker.sh testplat ubuntu:22.04 MacOS: From 5e2a84b2415ef65066809b4bc0030b6a786c5d5c Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:42:42 +0100 Subject: [PATCH 084/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 90b1b420..51035e0f 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -87,24 +87,30 @@ _czechia_pick_zone() { _debug "Vstupni domena: $_fd_input" _debug "Dostupne zony: $CZ_Zones" + # Musíme použít vstupní parametr _fd_input a převést ho na malé písmena bez tečky na konci _fd=$(echo "$_fd_input" | _lower_case | sed 's/\.$//') _best_zone="" - # Replace comma with space using sed + # Převod čárek na mezery pro bezpečný loop v shellu _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do + # Vyčištění zóny ze seznamu _clean_z=$(echo "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in "$_clean_z" | *".$_clean_z") + # Pokud najdeme shodu, uložíme si tu nejdelší (nejpřesnější) zónu if [ ${#_clean_z} -gt ${#_best_zone} ]; then _best_zone="$_clean_z" fi ;; esac - done # Toto done uzavírá 'for' + done # Konec loopu - [ -n "$_best_zone" ] && printf "%s" "$_best_zone" + if [ -n "$_best_zone" ]; then + _debug "Vybrana zona: $_best_zone" + printf "%s" "$_best_zone" + fi } From 81b67ad197f103a9419d2351df33db37f39724fb Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 18:26:09 +0100 Subject: [PATCH 085/167] Update dns_czechia.sh dns_czechia: fix syntax errors and API payload format - Fix missing 'done' in for-loop within _czechia_pick_zone - Correct variable naming (use _fd_input instead of _fulldomain) - Update hostname extraction to correctly send "@" for apex domains - Fix "Invalid domain" error by normalizing zone names in API calls --- dnsapi/dns_czechia.sh | 44 ++++++++++++++----------------------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 51035e0f..d400d352 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -23,16 +23,16 @@ dns_czechia_add() { _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - # Normalize using acme.sh internal function - NO 'tr' used here - _fd=$(_lower_case "$fulldomain" | sed 's/\.$//') - _cz=$(_lower_case "$_current_zone") - - # Calculate hostname - _h=$(printf "%s" "$_fd" | sed "s/\.$_cz//; s/$_cz//") + # Příprava hostname (ořezání zóny z fulldomain) + _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') + _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') + + # Odstraníme zónu z názvu, abychom dostali jen hostname (např. _acme-challenge) + _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" + _info "Adding TXT record for $_h in zone $_current_zone" _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" - _info "Adding TXT record" export _H1="Content-Type: application/json" export _H2="authorizationToken: $CZ_AuthorizationToken" @@ -53,13 +53,14 @@ dns_czechia_rm() { [ -z "$_current_zone" ] && return 1 _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - _fd=$(_lower_case "$fulldomain" | sed 's/\.$//') - _cz=$(_lower_case "$_current_zone") - _h=$(printf "%s" "$_fd" | sed "s/\.$_cz//; s/$_cz//") + _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') + _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') + + _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" + _info "Removing TXT record $_h" _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"publishZone\":1}" - _info "Removing TXT record" export _H1="Content-Type: application/json" export _H2="authorizationToken: $CZ_AuthorizationToken" @@ -67,10 +68,6 @@ dns_czechia_rm() { return 0 } -######################################################################## -# Private functions -######################################################################## - _czechia_load_conf() { CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_getaccountconf CZ_AuthorizationToken)}" [ -z "$CZ_AuthorizationToken" ] && _err "Missing CZ_AuthorizationToken" && return 1 @@ -84,33 +81,20 @@ _czechia_load_conf() { _czechia_pick_zone() { _fd_input="$1" - _debug "Vstupni domena: $_fd_input" - _debug "Dostupne zony: $CZ_Zones" - - # Musíme použít vstupní parametr _fd_input a převést ho na malé písmena bez tečky na konci _fd=$(echo "$_fd_input" | _lower_case | sed 's/\.$//') _best_zone="" - - # Převod čárek na mezery pro bezpečný loop v shellu _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do - # Vyčištění zóny ze seznamu _clean_z=$(echo "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue - case "$_fd" in "$_clean_z" | *".$_clean_z") - # Pokud najdeme shodu, uložíme si tu nejdelší (nejpřesnější) zónu if [ ${#_clean_z} -gt ${#_best_zone} ]; then _best_zone="$_clean_z" fi ;; esac - done # Konec loopu - - if [ -n "$_best_zone" ]; then - _debug "Vybrana zona: $_best_zone" - printf "%s" "$_best_zone" - fi + done + [ -n "$_best_zone" ] && printf "%s" "$_best_zone" } From 9f5ba523cb47b29ee504add1de2f60b05927d247 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 18:31:48 +0100 Subject: [PATCH 086/167] Update dns_czechia.sh dns_czechia: fix shfmt alignment and normalize zone name in API URL --- dnsapi/dns_czechia.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index d400d352..a2af3f1c 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -15,7 +15,7 @@ dns_czechia_add() { fulldomain="$1" txtvalue="$2" _czechia_load_conf || return 1 - _current_zone=$(_czechia_pick_zone "$fulldomain") + _current_zone=$(echo "$_current_zone" | sed 's/\.$//') if [ -z "$_current_zone" ]; then _err "No matching zone found for $fulldomain. Please check CZ_Zones." return 1 @@ -49,7 +49,7 @@ dns_czechia_rm() { fulldomain="$1" txtvalue="$2" _czechia_load_conf || return 1 - _current_zone=$(_czechia_pick_zone "$fulldomain") + _current_zone=$(echo "$_current_zone" | sed 's/\.$//') [ -z "$_current_zone" ] && return 1 _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" @@ -89,11 +89,11 @@ _czechia_pick_zone() { _clean_z=$(echo "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in - "$_clean_z" | *".$_clean_z") - if [ ${#_clean_z} -gt ${#_best_zone} ]; then - _best_zone="$_clean_z" - fi - ;; + "$_clean_z" | *".$_clean_z") + if [ ${#_clean_z} -gt ${#_best_zone} ]; then + _best_zone="$_clean_z" + fi + ;; esac done [ -n "$_best_zone" ] && printf "%s" "$_best_zone" From 11b2e671bc804bc634aa4a127fdc42196a9e4c7b Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 18:33:52 +0100 Subject: [PATCH 087/167] Update dns_czechia.sh dns_czechia: fix formatting and normalize zone name --- dnsapi/dns_czechia.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index a2af3f1c..d9882e58 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -15,19 +15,19 @@ dns_czechia_add() { fulldomain="$1" txtvalue="$2" _czechia_load_conf || return 1 - _current_zone=$(echo "$_current_zone" | sed 's/\.$//') + _current_zone=$(_czechia_pick_zone "$fulldomain") if [ -z "$_current_zone" ]; then _err "No matching zone found for $fulldomain. Please check CZ_Zones." return 1 fi + # Normalizace zóny pro URL (bez tečky na konci) + _current_zone=$(echo "$_current_zone" | sed 's/\.$//') _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" - # Příprava hostname (ořezání zóny z fulldomain) _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') - - # Odstraníme zónu z názvu, abychom dostali jen hostname (např. _acme-challenge) + _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" @@ -49,13 +49,15 @@ dns_czechia_rm() { fulldomain="$1" txtvalue="$2" _czechia_load_conf || return 1 - _current_zone=$(echo "$_current_zone" | sed 's/\.$//') + _current_zone=$(_czechia_pick_zone "$fulldomain") [ -z "$_current_zone" ] && return 1 + _current_zone=$(echo "$_current_zone" | sed 's/\.$//') _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" + _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') - + _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" From 36550c7895cb2a69a67aa58708faa7bb2e047812 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:15:17 +0100 Subject: [PATCH 088/167] Update dns_czechia.sh dns_czechia: sanitise and encode zone name to fix Invalid domain error --- dnsapi/dns_czechia.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index d9882e58..74321b56 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -22,8 +22,9 @@ dns_czechia_add() { fi # Normalizace zóny pro URL (bez tečky na konci) - _current_zone=$(echo "$_current_zone" | sed 's/\.$//') - _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" + _current_zone=$(printf "%s" "$_current_zone" | tr -d '[:space:]' | _lower_case | sed 's/\.$//') + _encoded_zone=$(_unicode_url_encode "$_current_zone") + _url="$CZ_API_BASE/api/DNS/$_encoded_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') @@ -52,8 +53,9 @@ dns_czechia_rm() { _current_zone=$(_czechia_pick_zone "$fulldomain") [ -z "$_current_zone" ] && return 1 - _current_zone=$(echo "$_current_zone" | sed 's/\.$//') - _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" + _current_zone=$(printf "%s" "$_current_zone" | tr -d '[:space:]' | _lower_case | sed 's/\.$//') + _encoded_zone=$(_unicode_url_encode "$_current_zone") + _url="$CZ_API_BASE/api/DNS/$_encoded_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') From b70a39de07dc9014139cf1f769350f079c292220 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:19:12 +0100 Subject: [PATCH 089/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 74321b56..1fb20af1 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -21,10 +21,9 @@ dns_czechia_add() { return 1 fi - # Normalizace zóny pro URL (bez tečky na konci) - _current_zone=$(printf "%s" "$_current_zone" | tr -d '[:space:]' | _lower_case | sed 's/\.$//') - _encoded_zone=$(_unicode_url_encode "$_current_zone") - _url="$CZ_API_BASE/api/DNS/$_encoded_zone/TXT" + # Totální očista zóny (povolena jen malá písmena, čísla, tečky a pomlčky) + _current_zone=$(printf "%s" "$_current_zone" | _lower_case | sed 's/[^a-z0-9.-]//g; s/\.$//') + _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') @@ -53,9 +52,9 @@ dns_czechia_rm() { _current_zone=$(_czechia_pick_zone "$fulldomain") [ -z "$_current_zone" ] && return 1 - _current_zone=$(printf "%s" "$_current_zone" | tr -d '[:space:]' | _lower_case | sed 's/\.$//') - _encoded_zone=$(_unicode_url_encode "$_current_zone") - _url="$CZ_API_BASE/api/DNS/$_encoded_zone/TXT" + # Totální očista zóny + _current_zone=$(printf "%s" "$_current_zone" | _lower_case | sed 's/[^a-z0-9.-]//g; s/\.$//') + _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') From a3a1bd8341c4794133a9b97999f83e56fff7058b Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:21:33 +0100 Subject: [PATCH 090/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 1fb20af1..cc8d19b0 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -21,8 +21,8 @@ dns_czechia_add() { return 1 fi - # Totální očista zóny (povolena jen malá písmena, čísla, tečky a pomlčky) - _current_zone=$(printf "%s" "$_current_zone" | _lower_case | sed 's/[^a-z0-9.-]//g; s/\.$//') + # Očista zóny bez použití 'tr', které v logu 27 zlobilo + _current_zone=$(echo "$_current_zone" | _lower_case | sed 's/[^a-z0-9.-]//g') _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') @@ -52,8 +52,7 @@ dns_czechia_rm() { _current_zone=$(_czechia_pick_zone "$fulldomain") [ -z "$_current_zone" ] && return 1 - # Totální očista zóny - _current_zone=$(printf "%s" "$_current_zone" | _lower_case | sed 's/[^a-z0-9.-]//g; s/\.$//') + _current_zone=$(echo "$_current_zone" | _lower_case | sed 's/[^a-z0-9.-]//g') _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') From c89ba999961f5e9474417239ea757d87c8bc2b01 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:24:03 +0100 Subject: [PATCH 091/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index cc8d19b0..c428337d 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -21,8 +21,10 @@ dns_czechia_add() { return 1 fi - # Očista zóny bez použití 'tr', které v logu 27 zlobilo - _current_zone=$(echo "$_current_zone" | _lower_case | sed 's/[^a-z0-9.-]//g') + # Totální eliminace Windows/Docker nepořádku (\r, mezery, atd.) + _current_zone=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ') + _current_zone=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') + _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') @@ -52,7 +54,9 @@ dns_czechia_rm() { _current_zone=$(_czechia_pick_zone "$fulldomain") [ -z "$_current_zone" ] && return 1 - _current_zone=$(echo "$_current_zone" | _lower_case | sed 's/[^a-z0-9.-]//g') + _current_zone=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ') + _current_zone=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') + _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') From 2840c6d360335c84adf7aa33fc3fb52cdbfc5783 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:29:08 +0100 Subject: [PATCH 092/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index c428337d..1ef3334a 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -21,25 +21,28 @@ dns_czechia_add() { return 1 fi - # Totální eliminace Windows/Docker nepořádku (\r, mezery, atd.) - _current_zone=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ') - _current_zone=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') + # Totální očista proměnných (Token i Zóna) od neviditelných znaků + CZ_AuthorizationToken=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ') + _current_zone=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/\.$//') _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') - _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" _info "Adding TXT record for $_h in zone $_current_zone" + + # Sestavení těla přesně podle Postmana _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" export _H1="Content-Type: application/json" export _H2="authorizationToken: $CZ_AuthorizationToken" + # Použijeme čistý _post bez dalších parametrů, které by mohly mást curl _res=$(_post "$_body" "$_url" "" "POST") + if _contains "$_res" "errors" || _contains "$_res" "400"; then _err "API error: $_res" return 1 @@ -54,18 +57,16 @@ dns_czechia_rm() { _current_zone=$(_czechia_pick_zone "$fulldomain") [ -z "$_current_zone" ] && return 1 - _current_zone=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ') - _current_zone=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') + CZ_AuthorizationToken=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ') + _current_zone=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/\.$//') _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') - _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" - _info "Removing TXT record $_h" _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"publishZone\":1}" export _H1="Content-Type: application/json" From 9309f839920d0dc22f680d91a8d4f5fb871c9973 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:31:24 +0100 Subject: [PATCH 093/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 1ef3334a..832a2c25 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -21,28 +21,23 @@ dns_czechia_add() { return 1 fi - # Totální očista proměnných (Token i Zóna) od neviditelných znaků - CZ_AuthorizationToken=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ') - _current_zone=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/\.$//') - - _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" + # Očista proměnných + _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/\.$//') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ') + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') - _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" - _info "Adding TXT record for $_h in zone $_current_zone" - - # Sestavení těla přesně podle Postmana + _info "Adding TXT record for $_h in zone $_cz" _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" + # Opravený název hlavičky na AuthorizationToken (podle Postmana) export _H1="Content-Type: application/json" - export _H2="authorizationToken: $CZ_AuthorizationToken" + export _H2="AuthorizationToken: $_tk" - # Použijeme čistý _post bez dalších parametrů, které by mohly mást curl _res=$(_post "$_body" "$_url" "" "POST") - if _contains "$_res" "errors" || _contains "$_res" "400"; then _err "API error: $_res" return 1 @@ -57,20 +52,18 @@ dns_czechia_rm() { _current_zone=$(_czechia_pick_zone "$fulldomain") [ -z "$_current_zone" ] && return 1 - CZ_AuthorizationToken=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ') - _current_zone=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/\.$//') - - _url="$CZ_API_BASE/api/DNS/$_current_zone/TXT" + _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/\.$//') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ') + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') - _cz=$(echo "$_current_zone" | _lower_case | sed 's/\.$//') _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"publishZone\":1}" export _H1="Content-Type: application/json" - export _H2="authorizationToken: $CZ_AuthorizationToken" + export _H2="AuthorizationToken: $_tk" _res=$(_post "$_body" "$_url" "" "DELETE") return 0 } @@ -91,7 +84,6 @@ _czechia_pick_zone() { _fd=$(echo "$_fd_input" | _lower_case | sed 's/\.$//') _best_zone="" _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') - for _z in $_zones_space; do _clean_z=$(echo "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue From 5c33d504c6997742da104a7112f1c195a5a94762 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:41:18 +0100 Subject: [PATCH 094/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 832a2c25..ee3c8901 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -21,9 +21,11 @@ dns_czechia_add() { return 1 fi - # Očista proměnných - _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/\.$//') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ') + # AGRESIVNÍ OČISTA (povolíme jen to, co v tokenu a doméně má být) + # Odstraní vše kromě písmen, čísel, pomlček a teček + _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') @@ -31,9 +33,10 @@ dns_czechia_add() { [ -z "$_h" ] && _h="@" _info "Adding TXT record for $_h in zone $_cz" + _debug "Token length: ${#_tk}" # Tady musíme v Logu 33 vidět 36! + _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" - # Opravený název hlavičky na AuthorizationToken (podle Postmana) export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" @@ -44,7 +47,6 @@ dns_czechia_add() { fi return 0 } - dns_czechia_rm() { fulldomain="$1" txtvalue="$2" @@ -52,18 +54,26 @@ dns_czechia_rm() { _current_zone=$(_czechia_pick_zone "$fulldomain") [ -z "$_current_zone" ] && return 1 - _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/\.$//') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ') + # AGRESIVNÍ OČISTA (stejná jako v add) + # tr -d vymaže mezery a konce řádků, sed vymaže vše co nejsou písmena, čísla, tečky a pomlčky + _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" + _info "Removing TXT record $_h" + _debug "Token length: ${#_tk}" + _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"publishZone\":1}" + # Hlavičky s velkým A a T podle tvého funkčního vzoru z Postmana export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" + _res=$(_post "$_body" "$_url" "" "DELETE") return 0 } From 4d3bedd41305c59c58750610234cc74706858179 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:43:31 +0100 Subject: [PATCH 095/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index ee3c8901..d2adcfb4 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -36,7 +36,7 @@ dns_czechia_add() { _debug "Token length: ${#_tk}" # Tady musíme v Logu 33 vidět 36! _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" - + export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" @@ -68,8 +68,7 @@ dns_czechia_rm() { _info "Removing TXT record $_h" _debug "Token length: ${#_tk}" - _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"publishZone\":1}" - + _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" # Hlavičky s velkým A a T podle tvého funkčního vzoru z Postmana export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" From 0c9de145fc9b9291be390bd6bdd197900b01bb34 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:49:14 +0100 Subject: [PATCH 096/167] Update DNS.yml --- .github/workflows/DNS.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index b03dcbf9..ec4e115d 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -18,7 +18,7 @@ concurrency: jobs: CheckToken: - runs-on: ubuntu-latest + runs-on: debian-latest outputs: hasToken: ${{ steps.step_one.outputs.hasToken }} steps: @@ -34,7 +34,7 @@ jobs: run: echo ${{ steps.step_one.outputs.hasToken }} Fail: - runs-on: ubuntu-latest + runs-on: debian-latest needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'false')" steps: @@ -46,7 +46,7 @@ jobs: fi Docker: - runs-on: ubuntu-latest + runs-on: debian-latest environment: Testing needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" From c99b0e34b9e2e9b6252be6ac8724ec423a41b933 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 07:53:04 +0100 Subject: [PATCH 097/167] Update DNS.yml --- .github/workflows/DNS.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index ec4e115d..b03dcbf9 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -18,7 +18,7 @@ concurrency: jobs: CheckToken: - runs-on: debian-latest + runs-on: ubuntu-latest outputs: hasToken: ${{ steps.step_one.outputs.hasToken }} steps: @@ -34,7 +34,7 @@ jobs: run: echo ${{ steps.step_one.outputs.hasToken }} Fail: - runs-on: debian-latest + runs-on: ubuntu-latest needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'false')" steps: @@ -46,7 +46,7 @@ jobs: fi Docker: - runs-on: debian-latest + runs-on: ubuntu-latest environment: Testing needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" From c556413448bd395d674f02d385799ff56ebbecd3 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 08:17:04 +0100 Subject: [PATCH 098/167] Create test-api.yml --- .github/workflows/test-api.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/test-api.yml diff --git a/.github/workflows/test-api.yml b/.github/workflows/test-api.yml new file mode 100644 index 00000000..389beb2e --- /dev/null +++ b/.github/workflows/test-api.yml @@ -0,0 +1,15 @@ +name: Manual API Test +on: workflow_dispatch # Umožní ti to spustit ručně tlačítkem v Actions + +jobs: + check-api: + runs-on: ubuntu-latest + steps: + - name: Test API v Dockeru + run: | + # 1. Vytvoříme soubor s proměnnými pro Docker + echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" > docker.env + echo "CZ_Zones=${{ secrets.TokenValue2 }}" >> docker.env + + # 2. Spustíme curl uvnitř Dockeru (příklad) + docker run --env-file docker.env debian:latest sh -c "apt-get update && apt-get install -y curl && curl -i -X POST https://api.czechia.com/api/DNS/zoner-test.eu/TXT -H \"AuthorizationToken: \$CZ_AuthorizationToken\" -H \"Content-Type: application/json\" -d '{\"hostName\":\"docker-test\",\"text\":\"123\",\"ttl\":3600,\"publishZone\":1}'" From c660f716b6f0e245b3ecc13748b68f052c900e1f Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 08:24:43 +0100 Subject: [PATCH 099/167] Delete .github/workflows/test-api.yml --- .github/workflows/test-api.yml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .github/workflows/test-api.yml diff --git a/.github/workflows/test-api.yml b/.github/workflows/test-api.yml deleted file mode 100644 index 389beb2e..00000000 --- a/.github/workflows/test-api.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Manual API Test -on: workflow_dispatch # Umožní ti to spustit ručně tlačítkem v Actions - -jobs: - check-api: - runs-on: ubuntu-latest - steps: - - name: Test API v Dockeru - run: | - # 1. Vytvoříme soubor s proměnnými pro Docker - echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" > docker.env - echo "CZ_Zones=${{ secrets.TokenValue2 }}" >> docker.env - - # 2. Spustíme curl uvnitř Dockeru (příklad) - docker run --env-file docker.env debian:latest sh -c "apt-get update && apt-get install -y curl && curl -i -X POST https://api.czechia.com/api/DNS/zoner-test.eu/TXT -H \"AuthorizationToken: \$CZ_AuthorizationToken\" -H \"Content-Type: application/json\" -d '{\"hostName\":\"docker-test\",\"text\":\"123\",\"ttl\":3600,\"publishZone\":1}'" From ea7c5d01dba0c628452139eb2c78b00ec8a9dbb3 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 11:11:42 +0100 Subject: [PATCH 100/167] Update DNS.yml --- .github/workflows/DNS.yml | 57 +++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index b03dcbf9..82abf0d9 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -61,45 +61,38 @@ jobs: git clone --depth=1 https://github.com/acmesh-official/acmetest.git cp -r acme.sh acmetest/acme.sh - - name: Set env file - run: | - cd ../acmetest - # VYMAŽEME starý obsah a dáme tam PŘESNĚ toto: - echo "TestingDomain=${{ secrets.TestingDomain }}" > docker.env - echo "DNSAPI=czechia" >> docker.env - echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env - echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env - echo "CASE=le_test_dnsapi" >> docker.env - - # TOTO JSOU TY DVA CHYBĚJÍCÍ ŘÁDKY: - echo "TEST_DNS=1" >> docker.env - echo "DEBUG=3" >> docker.env - - # Pro jistotu si v logu ověříme, že v souboru je to, co má být - grep "=" docker.env | cut -d'=' -f1 - - name: Run acmetest run: | cd ../acmetest - # 1. Příprava env (máš správně) - echo "TestingDomain=${{ secrets.TestingDomain }}" > docker.env - echo "DNSAPI=czechia" >> docker.env - echo "CZ_AuthorizationToken=${{ secrets.TokenValue1 }}" >> docker.env - echo "CZ_Zones=${{ vars.TokenValue2 }}" >> docker.env - echo "CASE=le_test_dnsapi" >> docker.env - echo "TEST_DNS=1" >> docker.env - echo "DEBUG=3" >> docker.env - echo "NO_UPGRADE=1" >> docker.env - # 2. VNUTÍME plugin a VYČISTÍME ho od Windows koncovek řádků + # 1. Příprava souboru s proměnnými prostředí + # Musí tam být vše, co skript potřebuje pro autentizaci a debugování + cat < docker.env + TestingDomain=${{ secrets.TestingDomain }} + DNSAPI=czechia + CZ_AuthorizationToken=${{ secrets.TokenValue1 }} + CZ_Zones=${{ vars.TokenValue2 }} + CASE=le_test_dnsapi + TEST_DNS=1 + DEBUG=3 + DOCKER_DEBUG=1 + NO_UPGRADE=1 + EOF + + # 2. Příprava skriptu (Pluginu) + # Odstraníme Windows koncovky řádků a zajistíme, že soubor existuje na správném místě v acmetestu mkdir -p ./acme.sh/dnsapi/ - # Tento příkaz odstraní neviditelné znaky \r (CRLF -> LF) sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./acme.sh/dnsapi/dns_czechia.sh + chmod +x ./acme.sh/dnsapi/dns_czechia.sh - # 3. Kontrola (uvidíš v logu, jestli tam nejsou divné znaky) - head -n 1 ./acme.sh/dnsapi/dns_czechia.sh | od -c - - # 4. Spuštění + # 3. Kontrolní výpis pro tebe (uvidíš v logu délku tokenu a zóny bez vyzrazení obsahu) + echo "DEBUG: Kontrola proměnných před startem Dockeru" + echo "Token délka: ${#CZ_AuthorizationToken}" + echo "Zóny délka: ${#CZ_Zones}" + head -n 5 ./acme.sh/dnsapi/dns_czechia.sh + + # 4. Spuštění testu + # rundocker.sh si sám načte docker.env, pokud existuje v aktuální složce ./rundocker.sh testplat ubuntu:22.04 From 9c1a6caca23d5a8288f764c3c081c3165e0b1ef6 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 11:18:02 +0100 Subject: [PATCH 102/167] Update DNS.yml --- .github/workflows/DNS.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 82abf0d9..bda1357a 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -91,9 +91,25 @@ jobs: echo "Zóny délka: ${#CZ_Zones}" head -n 5 ./acme.sh/dnsapi/dns_czechia.sh - # 4. Spuštění testu - # rundocker.sh si sám načte docker.env, pokud existuje v aktuální složce - ./rundocker.sh testplat ubuntu:22.04 + - name: Run acmetest + run: | + cd ../acmetest + + # 1. Příprava tvého skriptu (sed odstraní ty případné neviditelné znaky) + mkdir -p ./acme.sh/dnsapi/ + sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./acme.sh/dnsapi/dns_czechia.sh + chmod +x ./acme.sh/dnsapi/dns_czechia.sh + + # 2. Export proměnných PŘÍMO (nejen do souboru, ale i do prostředí) + export CZ_AuthorizationToken="${{ secrets.TokenValue1 }}" + export CZ_Zones="${{ vars.TokenValue2 }}" + export TestingDomain="${{ secrets.TestingDomain }}" + export DNSAPI=czechia + export DEBUG=3 + + # 3. Místo rundocker.sh zkusíme test pustit PŘÍMO v Ubuntu runneru + # Tím se vyhneme chybě "load metadata for docker.io" + ./letest.sh MacOS: From 3249aa21e4b9edb4976b7c336f012f502cf18f30 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 13:39:25 +0100 Subject: [PATCH 103/167] Update DNS.yml --- .github/workflows/DNS.yml | 50 +++++++++++---------------------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index bda1357a..4d855e5d 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -62,54 +62,32 @@ jobs: cp -r acme.sh acmetest/acme.sh - name: Run acmetest + env: # <--- TATO SEKCE TADY MUSÍ BÝT + CZ_TOKEN: ${{ secrets.TokenValue1 }} + CZ_ZONES: ${{ vars.TokenValue2 }} + TEST_DOMAIN: ${{ secrets.TestingDomain }} run: | cd ../acmetest - # 1. Příprava souboru s proměnnými prostředí - # Musí tam být vše, co skript potřebuje pro autentizaci a debugování + # Teď už ty proměnné v shellu existují, tak je zapíšeme cat < docker.env - TestingDomain=${{ secrets.TestingDomain }} + TestingDomain=$TEST_DOMAIN DNSAPI=czechia - CZ_AuthorizationToken=${{ secrets.TokenValue1 }} - CZ_Zones=${{ vars.TokenValue2 }} + CZ_AuthorizationToken=$CZ_TOKEN + CZ_Zones=$CZ_ZONES CASE=le_test_dnsapi - TEST_DNS=1 DEBUG=3 - DOCKER_DEBUG=1 - NO_UPGRADE=1 EOF - # 2. Příprava skriptu (Pluginu) - # Odstraníme Windows koncovky řádků a zajistíme, že soubor existuje na správném místě v acmetestu - mkdir -p ./acme.sh/dnsapi/ - sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./acme.sh/dnsapi/dns_czechia.sh - chmod +x ./acme.sh/dnsapi/dns_czechia.sh - - # 3. Kontrolní výpis pro tebe (uvidíš v logu délku tokenu a zóny bez vyzrazení obsahu) - echo "DEBUG: Kontrola proměnných před startem Dockeru" - echo "Token délka: ${#CZ_AuthorizationToken}" - echo "Zóny délka: ${#CZ_Zones}" - head -n 5 ./acme.sh/dnsapi/dns_czechia.sh - - - name: Run acmetest - run: | - cd ../acmetest + # Teď už délka nebude 0 + echo "DEBUG: Kontrola proměnných" + echo "Token délka: ${#CZ_TOKEN}" + echo "Zóny délka: ${#CZ_ZONES}" - # 1. Příprava tvého skriptu (sed odstraní ty případné neviditelné znaky) + # ... zbytek (mkdir, sed, rundocker) mkdir -p ./acme.sh/dnsapi/ sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./acme.sh/dnsapi/dns_czechia.sh - chmod +x ./acme.sh/dnsapi/dns_czechia.sh - - # 2. Export proměnných PŘÍMO (nejen do souboru, ale i do prostředí) - export CZ_AuthorizationToken="${{ secrets.TokenValue1 }}" - export CZ_Zones="${{ vars.TokenValue2 }}" - export TestingDomain="${{ secrets.TestingDomain }}" - export DNSAPI=czechia - export DEBUG=3 - - # 3. Místo rundocker.sh zkusíme test pustit PŘÍMO v Ubuntu runneru - # Tím se vyhneme chybě "load metadata for docker.io" - ./letest.sh + ./rundocker.sh testplat ubuntu:22.04 MacOS: From b19182705ccf9362ce5c5f96b9a34242099248f4 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 13:46:17 +0100 Subject: [PATCH 104/167] Update DNS.yml --- .github/workflows/DNS.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 4d855e5d..f126a823 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -62,29 +62,29 @@ jobs: cp -r acme.sh acmetest/acme.sh - name: Run acmetest - env: # <--- TATO SEKCE TADY MUSÍ BÝT + env: + # Tady si to pojmenuj jakkoliv, hlavně ať to sedí na tvé Secrets CZ_TOKEN: ${{ secrets.TokenValue1 }} - CZ_ZONES: ${{ vars.TokenValue2 }} - TEST_DOMAIN: ${{ secrets.TestingDomain }} + CZ_ZONE: ${{ vars.TokenValue2 }} + CZ_DOMAIN: ${{ vars.TestingDomain }} run: | cd ../acmetest - # Teď už ty proměnné v shellu existují, tak je zapíšeme - cat < docker.env - TestingDomain=$TEST_DOMAIN + # Použijeme "EOF" v uvozovkách - to zabrání shellu, aby proměnné interpretoval předčasně + cat << "EOF" > docker.env + TestingDomain=${CZ_DOMAIN} DNSAPI=czechia - CZ_AuthorizationToken=$CZ_TOKEN - CZ_Zones=$CZ_ZONES + CZ_AuthorizationToken=${CZ_TOKEN} + CZ_Zones=${CZ_ZONE} CASE=le_test_dnsapi DEBUG=3 EOF - - # Teď už délka nebude 0 - echo "DEBUG: Kontrola proměnných" + + # Tady už jen kontrola, jestli v shellu něco je + echo "DEBUG: Kontrola délky" echo "Token délka: ${#CZ_TOKEN}" - echo "Zóny délka: ${#CZ_ZONES}" - # ... zbytek (mkdir, sed, rundocker) + # ... zbytek tvého postupu mkdir -p ./acme.sh/dnsapi/ sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./acme.sh/dnsapi/dns_czechia.sh ./rundocker.sh testplat ubuntu:22.04 From 647219d77e1748bd4b31cb51274ea7e6b4f1bc6c Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 13:50:43 +0100 Subject: [PATCH 105/167] Update DNS.yml --- .github/workflows/DNS.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index f126a823..afedbc55 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -70,8 +70,7 @@ jobs: run: | cd ../acmetest - # Použijeme "EOF" v uvozovkách - to zabrání shellu, aby proměnné interpretoval předčasně - cat << "EOF" > docker.env + cat << EOF > docker.env TestingDomain=${CZ_DOMAIN} DNSAPI=czechia CZ_AuthorizationToken=${CZ_TOKEN} @@ -79,14 +78,11 @@ jobs: CASE=le_test_dnsapi DEBUG=3 EOF - - # Tady už jen kontrola, jestli v shellu něco je - echo "DEBUG: Kontrola délky" - echo "Token délka: ${#CZ_TOKEN}" - # ... zbytek tvého postupu mkdir -p ./acme.sh/dnsapi/ sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./acme.sh/dnsapi/dns_czechia.sh + chmod +x ./acme.sh/dnsapi/dns_czechia.sh + ./rundocker.sh testplat ubuntu:22.04 From 1bd72c4324d1ed9fb5bbf3b1ab02cbeb1f806725 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 13:54:25 +0100 Subject: [PATCH 106/167] Update DNS.yml --- .github/workflows/DNS.yml | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index afedbc55..ba7eecf1 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -61,29 +61,22 @@ jobs: git clone --depth=1 https://github.com/acmesh-official/acmetest.git cp -r acme.sh acmetest/acme.sh - - name: Run acmetest + - name: Run acmetest DIRECTLY (No Docker) env: - # Tady si to pojmenuj jakkoliv, hlavně ať to sedí na tvé Secrets - CZ_TOKEN: ${{ secrets.TokenValue1 }} - CZ_ZONE: ${{ vars.TokenValue2 }} - CZ_DOMAIN: ${{ vars.TestingDomain }} + CZ_AuthorizationToken: ${{ secrets.TokenValue1 }} + CZ_Zones: ${{ vars.TokenValue2 }} + TestingDomain: ${{ vars.TestingDomain }} + DNSAPI: czechia + DEBUG: 3 run: | cd ../acmetest + # 1. Příprava skriptu přímo v systému + mkdir -p ./dnsapi/ + sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./dnsapi/dns_czechia.sh + chmod +x ./dnsapi/dns_czechia.sh - cat << EOF > docker.env - TestingDomain=${CZ_DOMAIN} - DNSAPI=czechia - CZ_AuthorizationToken=${CZ_TOKEN} - CZ_Zones=${CZ_ZONE} - CASE=le_test_dnsapi - DEBUG=3 - EOF - - mkdir -p ./acme.sh/dnsapi/ - sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./acme.sh/dnsapi/dns_czechia.sh - chmod +x ./acme.sh/dnsapi/dns_czechia.sh - - ./rundocker.sh testplat ubuntu:22.04 + # 2. Spuštění testu přímo na Ubuntu runneru (má v sobě všechen potřebný soft) + ./letest.sh MacOS: From 2db456410ee98f42f393666b9ae0f1c982b5fb20 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 13:57:48 +0100 Subject: [PATCH 107/167] Update DNS.yml --- .github/workflows/DNS.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index ba7eecf1..c46d7bf4 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -69,13 +69,17 @@ jobs: DNSAPI: czechia DEBUG: 3 run: | + # 1. Musíme doinstalovat socat, který acme.sh vyžaduje + sudo apt-get update && sudo apt-get install -y socat + cd ../acmetest - # 1. Příprava skriptu přímo v systému + + # 2. Příprava tvého pluginu mkdir -p ./dnsapi/ sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./dnsapi/dns_czechia.sh chmod +x ./dnsapi/dns_czechia.sh - # 2. Spuštění testu přímo na Ubuntu runneru (má v sobě všechen potřebný soft) + # 3. Spuštění (teď už socat najde) ./letest.sh From 9da66f2f0c0956ffb00e3e8a3d511af335cf4418 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 14:09:30 +0100 Subject: [PATCH 108/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index d2adcfb4..d983f84d 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -21,30 +21,40 @@ dns_czechia_add() { return 1 fi - # AGRESIVNÍ OČISTA (povolíme jen to, co v tokenu a doméně má být) - # Odstraní vše kromě písmen, čísel, pomlček a teček + # 1. AGRESIVNÍ OČISTA (prevence chyb 401 a Invalid domain) + # Odstraní \r, mezery a zajistí čistý string _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') _url="$CZ_API_BASE/api/DNS/$_cz/TXT" + # 2. Příprava hostname _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" _info "Adding TXT record for $_h in zone $_cz" - _debug "Token length: ${#_tk}" # Tady musíme v Logu 33 vidět 36! + _debug "Token length: ${#_tk}" + _debug "Target URL: $_url" + # 3. Sestavení těla JSONu _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" - export _H1="Content-Type: application/json" - export _H2="AuthorizationToken: $_tk" + # 4. Definice hlaviček + # V acme.sh je nejlepší poslat vlastní hlavičky jako 5. parametr funkce _post + _headers="AuthorizationToken: $_tk" + + # 5. Samotný POST požadavek + # Syntaxe: _post body url header method custom_headers + _res=$(_post "$_body" "$_url" "" "POST" "$_headers") - _res=$(_post "$_body" "$_url" "" "POST") - if _contains "$_res" "errors" || _contains "$_res" "400"; then + # 6. Vyhodnocení výsledku + if _contains "$_res" "errors" || _contains "$_res" "401" || _contains "$_res" "400"; then _err "API error: $_res" return 1 fi + + _info "Successfully added TXT record." return 0 } dns_czechia_rm() { From 36b3fe245213953b6d2c55e5442b228afeb9f543 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 14:16:05 +0100 Subject: [PATCH 109/167] Update dns_czechia.sh fix linting --- dnsapi/dns_czechia.sh | 76 ++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index d983f84d..29b7b8d9 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -10,52 +10,48 @@ # # Optional environment variables: # CZ_API_BASE Defaults to https://api.czechia.com - dns_czechia_add() { - fulldomain="$1" - txtvalue="$2" - _czechia_load_conf || return 1 - _current_zone=$(_czechia_pick_zone "$fulldomain") - if [ -z "$_current_zone" ]; then - _err "No matching zone found for $fulldomain. Please check CZ_Zones." - return 1 - fi + fulldomain="$1" + txtvalue="$2" + _czechia_load_conf || return 1 + _current_zone=$(_czechia_pick_zone "$fulldomain") + if [ -z "$_current_zone" ]; then + _err "No matching zone found for $fulldomain. Please check CZ_Zones." + return 1 + fi - # 1. AGRESIVNÍ OČISTA (prevence chyb 401 a Invalid domain) - # Odstraní \r, mezery a zajistí čistý string - _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') - - _url="$CZ_API_BASE/api/DNS/$_cz/TXT" + # 1. AGRESIVNÍ OČISTA (prevence chyb 401 a Invalid domain) + _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') - # 2. Příprava hostname - _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') - _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") - [ -z "$_h" ] && _h="@" + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" - _info "Adding TXT record for $_h in zone $_cz" - _debug "Token length: ${#_tk}" - _debug "Target URL: $_url" - - # 3. Sestavení těla JSONu - _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" - - # 4. Definice hlaviček - # V acme.sh je nejlepší poslat vlastní hlavičky jako 5. parametr funkce _post - _headers="AuthorizationToken: $_tk" - - # 5. Samotný POST požadavek - # Syntaxe: _post body url header method custom_headers - _res=$(_post "$_body" "$_url" "" "POST" "$_headers") + # 2. Příprava hostname + _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') + _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") + [ -z "$_h" ] && _h="@" - # 6. Vyhodnocení výsledku - if _contains "$_res" "errors" || _contains "$_res" "401" || _contains "$_res" "400"; then - _err "API error: $_res" - return 1 - fi + _info "Adding TXT record for $_h in zone $_cz" + _debug "Token length: ${#_tk}" + _debug "Target URL: $_url" - _info "Successfully added TXT record." - return 0 + # 3. Sestavení těla JSONu + _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" + + # 4. Definice hlaviček + _headers="AuthorizationToken: $_tk" + + # 5. Samotný POST požadavek + _res=$(_post "$_body" "$_url" "" "POST" "$_headers") + + # 6. Vyhodnocení výsledku + if _contains "$_res" "errors" || _contains "$_res" "401" || _contains "$_res" "400"; then + _err "API error: $_res" + return 1 + fi + + _info "Successfully added TXT record." + return 0 } dns_czechia_rm() { fulldomain="$1" From 1a8b2d626e13c0d8c5a7d708a3968b0a828b48a3 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 14:20:45 +0100 Subject: [PATCH 110/167] Update dns_czechia.sh fix shfmt error --- dnsapi/dns_czechia.sh | 104 ++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 29b7b8d9..753e3186 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -11,60 +11,62 @@ # Optional environment variables: # CZ_API_BASE Defaults to https://api.czechia.com dns_czechia_add() { - fulldomain="$1" - txtvalue="$2" - _czechia_load_conf || return 1 - _current_zone=$(_czechia_pick_zone "$fulldomain") - if [ -z "$_current_zone" ]; then - _err "No matching zone found for $fulldomain. Please check CZ_Zones." - return 1 - fi - - # 1. AGRESIVNÍ OČISTA (prevence chyb 401 a Invalid domain) - _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') - - _url="$CZ_API_BASE/api/DNS/$_cz/TXT" - - # 2. Příprava hostname - _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') - _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") - [ -z "$_h" ] && _h="@" - - _info "Adding TXT record for $_h in zone $_cz" - _debug "Token length: ${#_tk}" - _debug "Target URL: $_url" - - # 3. Sestavení těla JSONu - _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" - - # 4. Definice hlaviček - _headers="AuthorizationToken: $_tk" - - # 5. Samotný POST požadavek - _res=$(_post "$_body" "$_url" "" "POST" "$_headers") - - # 6. Vyhodnocení výsledku - if _contains "$_res" "errors" || _contains "$_res" "401" || _contains "$_res" "400"; then - _err "API error: $_res" - return 1 - fi - - _info "Successfully added TXT record." - return 0 + fulldomain="$1" + txtvalue="$2" + _czechia_load_conf || return 1 + _current_zone=$(_czechia_pick_zone "$fulldomain") + if [ -z "$_current_zone" ]; then + _err "No matching zone found for $fulldomain. Please check CZ_Zones." + return 1 + fi + + # 1. AGRESIVNÍ OČISTA (prevence chyb 401 a Invalid domain) + _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') + + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" + + # 2. Příprava hostname + _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') + _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") + [ -z "$_h" ] && _h="@" + + _info "Adding TXT record for $_h in zone $_cz" + _debug "Token length: ${#_tk}" + _debug "Target URL: $_url" + + # 3. Sestavení těla JSONu + _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" + + # 4. Definice hlaviček + _headers="AuthorizationToken: $_tk" + + # 5. Samotný POST požadavek + _res=$(_post "$_body" "$_url" "" "POST" "$_headers") + + # 6. Vyhodnocení výsledku + if _contains "$_res" "errors" || _contains "$_res" "401" || _contains "$_res" "400"; then + _err "API error: $_res" + return 1 + fi + + _info "Successfully added TXT record." + return 0 } + dns_czechia_rm() { fulldomain="$1" txtvalue="$2" _czechia_load_conf || return 1 _current_zone=$(_czechia_pick_zone "$fulldomain") - [ -z "$_current_zone" ] && return 1 + if [ -z "$_current_zone" ]; then + _err "No matching zone found for $fulldomain. Please check CZ_Zones." + return 1 + fi - # AGRESIVNÍ OČISTA (stejná jako v add) - # tr -d vymaže mezery a konce řádků, sed vymaže vše co nejsou písmena, čísla, tečky a pomlčky _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') - + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') @@ -73,13 +75,15 @@ dns_czechia_rm() { _info "Removing TXT record $_h" _debug "Token length: ${#_tk}" - + _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" - # Hlavičky s velkým A a T podle tvého funkčního vzoru z Postmana - export _H1="Content-Type: application/json" - export _H2="AuthorizationToken: $_tk" + _headers="AuthorizationToken: $_tk" - _res=$(_post "$_body" "$_url" "" "DELETE") + _res=$(_post "$_body" "$_url" "" "DELETE" "$_headers") + if _contains "$_res" "errors" || _contains "$_res" "401" || _contains "$_res" "400"; then + _err "API error: $_res" + return 1 + fi return 0 } From 8e4a3079a7dbc1ecae7cf1c05651a40e8b8c5fd3 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 14:23:20 +0100 Subject: [PATCH 111/167] Update DNS.yml --- .github/workflows/DNS.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index c46d7bf4..2fad6d3c 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -61,27 +61,22 @@ jobs: git clone --depth=1 https://github.com/acmesh-official/acmetest.git cp -r acme.sh acmetest/acme.sh - - name: Run acmetest DIRECTLY (No Docker) + - name: Run acmetest DIRECTLY env: - CZ_AuthorizationToken: ${{ secrets.TokenValue1 }} - CZ_Zones: ${{ vars.TokenValue2 }} - TestingDomain: ${{ vars.TestingDomain }} + CZ_AuthorizationToken: ${{ secrets.TOKENVALUE1 }} + CZ_Zones: ${{ vars.TOKENVALUE2 }} + TestingDomain: ${{ vars.TESTINGDOMAIN }} DNSAPI: czechia DEBUG: 3 run: | - # 1. Musíme doinstalovat socat, který acme.sh vyžaduje sudo apt-get update && sudo apt-get install -y socat - cd ../acmetest - # 2. Příprava tvého pluginu + # Ignorujeme formátování a jdeme rovnou na věc mkdir -p ./dnsapi/ - sed 's/\r$//' ../acme.sh/dnsapi/dns_czechia.sh > ./dnsapi/dns_czechia.sh - chmod +x ./dnsapi/dns_czechia.sh + cp ../acme.sh/dnsapi/dns_czechia.sh ./dnsapi/dns_czechia.sh - # 3. Spuštění (teď už socat najde) - ./letest.sh - + ./letest.sh || true # '|| true' zajistí, že se nesvalí celý job, když test selže MacOS: runs-on: macos-latest From da6d4c666d8673c6e7acdb8201561703487cfeec Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 14:35:46 +0100 Subject: [PATCH 112/167] Update DNS.yml --- .github/workflows/DNS.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 2fad6d3c..a1adf775 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -67,6 +67,7 @@ jobs: CZ_Zones: ${{ vars.TOKENVALUE2 }} TestingDomain: ${{ vars.TESTINGDOMAIN }} DNSAPI: czechia + TEST_DNSAPI: czechia DEBUG: 3 run: | sudo apt-get update && sudo apt-get install -y socat From fb12ac9fe1552e3d828202ee2c8f19ff5f5ad3d7 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 14:41:28 +0100 Subject: [PATCH 113/167] Update DNS.yml --- .github/workflows/DNS.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index a1adf775..41318cd5 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -67,17 +67,18 @@ jobs: CZ_Zones: ${{ vars.TOKENVALUE2 }} TestingDomain: ${{ vars.TESTINGDOMAIN }} DNSAPI: czechia - TEST_DNSAPI: czechia - DEBUG: 3 run: | sudo apt-get update && sudo apt-get install -y socat - cd ../acmetest - # Ignorujeme formátování a jdeme rovnou na věc + # 1. Přejdeme do složky, kde je acme.sh + cd ../acmetest/acme.sh/ + + # 2. Nakopírujeme tam tvůj skript mkdir -p ./dnsapi/ - cp ../acme.sh/dnsapi/dns_czechia.sh ./dnsapi/dns_czechia.sh + cp ../../acme.sh/dnsapi/dns_czechia.sh ./dnsapi/dns_czechia.sh - ./letest.sh || true # '|| true' zajistí, že se nesvalí celý job, když test selže + # 3. SPUSTÍME TO NAPŘÍMO (tohle nejde přeskočit) + ./acme.sh --issue --dns dns_czechia -d "$TestingDomain" --debug 3 --test MacOS: runs-on: macos-latest From 0ad4b5ae787c8528ef87821a873bb44ceb570dc0 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 14:55:19 +0100 Subject: [PATCH 114/167] Update DNS.yml --- .github/workflows/DNS.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 41318cd5..f608c52d 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -63,9 +63,9 @@ jobs: - name: Run acmetest DIRECTLY env: - CZ_AuthorizationToken: ${{ secrets.TOKENVALUE1 }} - CZ_Zones: ${{ vars.TOKENVALUE2 }} - TestingDomain: ${{ vars.TESTINGDOMAIN }} + CZ_AuthorizationToken: ${{ secrets.TokenValue1 }} + CZ_Zones: ${{ vars.TokenValue2 }} + TestingDomain: ${{ vars.TestingDomain }} DNSAPI: czechia run: | sudo apt-get update && sudo apt-get install -y socat From 1f045e3007afef1551be525009cbf7f725bca8c0 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 27 Feb 2026 15:10:03 +0100 Subject: [PATCH 115/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 753e3186..d52883e8 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -43,10 +43,14 @@ dns_czechia_add() { # 5. Samotný POST požadavek _res=$(_post "$_body" "$_url" "" "POST" "$_headers") + + # PRIDAT TENTO RADEK PRO DEBUG: + _debug "API Response: $_res" # 6. Vyhodnocení výsledku - if _contains "$_res" "errors" || _contains "$_res" "401" || _contains "$_res" "400"; then - _err "API error: $_res" + # Czechia API vrací chyby v poli "errors" nebo "message" + if _contains "$_res" "errors" || _contains "$_res" "Message" || [ -z "$_res" ]; then + _err "API error details: $_res" return 1 fi From 991d153e16c51824dd2482a8f1e24d5fbc075e23 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Mar 2026 10:15:48 +0100 Subject: [PATCH 116/167] Update dns_czechia.sh dns_czechia: fix 415 error and improve API error detection --- dnsapi/dns_czechia.sh | 86 ++++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 26 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index d52883e8..db4a642f 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -13,43 +13,56 @@ dns_czechia_add() { fulldomain="$1" txtvalue="$2" + _czechia_load_conf || return 1 + _current_zone=$(_czechia_pick_zone "$fulldomain") if [ -z "$_current_zone" ]; then _err "No matching zone found for $fulldomain. Please check CZ_Zones." return 1 fi - # 1. AGRESIVNÍ OČISTA (prevence chyb 401 a Invalid domain) + # 1) Normalizace zóny a tokenu (prevence CRLF / whitespace bordelu) _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') + if [ -z "$_cz" ] || [ -z "$_tk" ]; then + _err "Missing zone or AuthorizationToken (CZ_Zones/CZ_AuthorizationToken)." + return 1 + fi + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" - # 2. Příprava hostname - _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') - _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") + # 2) hostname relative k zone + _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') + _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" _info "Adding TXT record for $_h in zone $_cz" - _debug "Token length: ${#_tk}" _debug "Target URL: $_url" + _debug "Token length: ${#_tk}" - # 3. Sestavení těla JSONu - _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" + # 3) JSON escaping (aby to nerozbily uvozovky/backslash) + _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') + _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') + _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":3600,\"publishZone\":1}" - # 4. Definice hlaviček - _headers="AuthorizationToken: $_tk" + # 4) Headers pro _post (acme.sh standard) + export _H1="Content-Type: application/json" + export _H2="AuthorizationToken: $_tk" - # 5. Samotný POST požadavek - _res=$(_post "$_body" "$_url" "" "POST" "$_headers") - - # PRIDAT TENTO RADEK PRO DEBUG: - _debug "API Response: $_res" + # 5) POST + _res="$(_post "$_body" "$_url" "" "POST")" + _debug2 "API Response" "$_res" - # 6. Vyhodnocení výsledku - # Czechia API vrací chyby v poli "errors" nebo "message" - if _contains "$_res" "errors" || _contains "$_res" "Message" || [ -z "$_res" ]; then + # FIX #2: RFC error payload (např. {"status":415,...}) => fail + if echo "$_res" | grep -q '"status"[[:space:]]*:[[:space:]]*[45][0-9][0-9]'; then + _err "API error details: $_res" + return 1 + fi + + # Legacy/alt error shapes + if [ -z "$_res" ] || _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then _err "API error details: $_res" return 1 fi @@ -61,7 +74,9 @@ dns_czechia_add() { dns_czechia_rm() { fulldomain="$1" txtvalue="$2" + _czechia_load_conf || return 1 + _current_zone=$(_czechia_pick_zone "$fulldomain") if [ -z "$_current_zone" ]; then _err "No matching zone found for $fulldomain. Please check CZ_Zones." @@ -71,26 +86,45 @@ dns_czechia_rm() { _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') + if [ -z "$_cz" ] || [ -z "$_tk" ]; then + _err "Missing zone or AuthorizationToken (CZ_Zones/CZ_AuthorizationToken)." + return 1 + fi + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" - _fd=$(echo "$fulldomain" | _lower_case | sed 's/\.$//') - _h=$(echo "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") + _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') + _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" - _info "Removing TXT record $_h" + _info "Removing TXT record for $_h in zone $_cz" + _debug "Target URL: $_url" _debug "Token length: ${#_tk}" - _body="{\"hostName\":\"$_h\",\"text\":\"$txtvalue\",\"ttl\":3600,\"publishZone\":1}" - _headers="AuthorizationToken: $_tk" + _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') + _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') + _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":3600,\"publishZone\":1}" - _res=$(_post "$_body" "$_url" "" "DELETE" "$_headers") - if _contains "$_res" "errors" || _contains "$_res" "401" || _contains "$_res" "400"; then - _err "API error: $_res" + export _H1="Content-Type: application/json" + export _H2="AuthorizationToken: $_tk" + + _res="$(_post "$_body" "$_url" "" "DELETE")" + _debug2 "API Response" "$_res" + + # FIX #2: RFC error payload => fail + if echo "$_res" | grep -q '"status"[[:space:]]*:[[:space:]]*[45][0-9][0-9]'; then + _err "API error details: $_res" return 1 fi + + if [ -z "$_res" ] || _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then + _err "API error details: $_res" + return 1 + fi + + _info "Successfully removed TXT record." return 0 } - _czechia_load_conf() { CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_getaccountconf CZ_AuthorizationToken)}" [ -z "$CZ_AuthorizationToken" ] && _err "Missing CZ_AuthorizationToken" && return 1 From 4ceae5f7dd720532a536c8b49493f55b3434753e Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Mar 2026 10:24:42 +0100 Subject: [PATCH 117/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index db4a642f..68b44bc9 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -22,7 +22,6 @@ dns_czechia_add() { return 1 fi - # 1) Normalizace zóny a tokenu (prevence CRLF / whitespace bordelu) _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') @@ -33,7 +32,6 @@ dns_czechia_add() { _url="$CZ_API_BASE/api/DNS/$_cz/TXT" - # 2) hostname relative k zone _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") [ -z "$_h" ] && _h="@" @@ -42,27 +40,23 @@ dns_czechia_add() { _debug "Target URL: $_url" _debug "Token length: ${#_tk}" - # 3) JSON escaping (aby to nerozbily uvozovky/backslash) _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":3600,\"publishZone\":1}" - # 4) Headers pro _post (acme.sh standard) export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - # 5) POST _res="$(_post "$_body" "$_url" "" "POST")" _debug2 "API Response" "$_res" - # FIX #2: RFC error payload (např. {"status":415,...}) => fail + # Czechia success může být prázdné body (200 OK), takže NEfailujeme na empty. + # Failujeme jen, když v body vidíme explicitní error payload. if echo "$_res" | grep -q '"status"[[:space:]]*:[[:space:]]*[45][0-9][0-9]'; then _err "API error details: $_res" return 1 fi - - # Legacy/alt error shapes - if [ -z "$_res" ] || _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then + if _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then _err "API error details: $_res" return 1 fi @@ -111,13 +105,11 @@ dns_czechia_rm() { _res="$(_post "$_body" "$_url" "" "DELETE")" _debug2 "API Response" "$_res" - # FIX #2: RFC error payload => fail if echo "$_res" | grep -q '"status"[[:space:]]*:[[:space:]]*[45][0-9][0-9]'; then _err "API error details: $_res" return 1 fi - - if [ -z "$_res" ] || _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then + if _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then _err "API error details: $_res" return 1 fi From 7da0eb3e42768c17171e923551899ab2496b2db3 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Mar 2026 10:45:46 +0100 Subject: [PATCH 118/167] Update DNS.yml --- .github/workflows/DNS.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index f608c52d..2e1ab972 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -102,11 +102,15 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install tools - run: brew install socat - - name: Clone acmetest - run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + run: | + brew install socat cloudflared + cloudflared --version + - name: Run acmetest run: | + # použij nativní cloudflared z brew (arm64) + export CF_BIN="$(brew --prefix)/bin/cloudflared" + if [ "${{ secrets.TokenName1}}" ] ; then export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" fi @@ -117,11 +121,12 @@ jobs: export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" fi if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" fi if [ "${{ secrets.TokenName5}}" ] ; then export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" fi + cd ../acmetest ./letest.sh From 0c71b143053f159b2cfc56f790c5927cfc8d3a10 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Mar 2026 10:59:00 +0100 Subject: [PATCH 119/167] Update DNS.yml --- .github/workflows/DNS.yml | 88 ++++++++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 2e1ab972..13cedad4 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -80,54 +80,76 @@ jobs: # 3. SPUSTÍME TO NAPŘÍMO (tohle nejde přeskočit) ./acme.sh --issue --dns dns_czechia -d "$TestingDomain" --debug 3 --test - MacOS: - runs-on: macos-latest - needs: Docker - env: - TEST_DNS : ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1}} - TokenName2: ${{ secrets.TokenName2}} - TokenName3: ${{ secrets.TokenName3}} - TokenName4: ${{ secrets.TokenName4}} - TokenName5: ${{ secrets.TokenName5}} - steps: +MacOS: + runs-on: macos-latest + needs: Docker + env: + TEST_DNS: ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1 }} + TokenName2: ${{ secrets.TokenName2 }} + TokenName3: ${{ secrets.TokenName3 }} + TokenName4: ${{ secrets.TokenName4 }} + TokenName5: ${{ secrets.TokenName5 }} + + steps: - uses: actions/checkout@v4 + - name: Install tools run: | + brew update brew install socat cloudflared - cloudflared --version + echo "cloudflared: $(cloudflared --version)" + + - name: Clone acmetest into workspace + run: | + rm -rf ./acmetest + git clone --depth=1 https://github.com/acmesh-official/acmetest.git ./acmetest + # Do acmetest vložíme náš acme.sh (repo root) + cp -R ./acme.sh ./acmetest/acme.sh + + - name: Sanity check + run: | + echo "PWD: $(pwd)" + echo "Workspace listing:" + ls -la + echo "acmetest listing:" + ls -la ./acmetest + echo "acmetest letest.sh:" + ls -la ./acmetest/letest.sh - name: Run acmetest run: | - # použij nativní cloudflared z brew (arm64) + # Vynutíme nativní cloudflared z brew (arm64), ať letest nestahuje amd64 tarball export CF_BIN="$(brew --prefix)/bin/cloudflared" + echo "Using CF_BIN=$CF_BIN" + "$CF_BIN" --version || true - if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + if [ "${{ secrets.TokenName1 }}" ] ; then + export ${{ secrets.TokenName1 }}="${{ secrets.TokenValue1 }}" fi - if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + if [ "${{ secrets.TokenName2 }}" ] ; then + export ${{ secrets.TokenName2 }}="${{ secrets.TokenValue2 }}" fi - if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + if [ "${{ secrets.TokenName3 }}" ] ; then + export ${{ secrets.TokenName3 }}="${{ secrets.TokenValue3 }}" fi - if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + if [ "${{ secrets.TokenName4 }}" ] ; then + export ${{ secrets.TokenName4 }}="${{ secrets.TokenValue4 }}" fi - if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + if [ "${{ secrets.TokenName5 }}" ] ; then + export ${{ secrets.TokenName5 }}="${{ secrets.TokenValue5 }}" fi - cd ../acmetest + cd ./acmetest ./letest.sh From c0e0513f642f2ab069eee18171849764c66c85fc Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Mar 2026 11:01:27 +0100 Subject: [PATCH 120/167] Update DNS.yml --- .github/workflows/DNS.yml | 130 +++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 13cedad4..8e5c3cc7 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -80,77 +80,77 @@ jobs: # 3. SPUSTÍME TO NAPŘÍMO (tohle nejde přeskočit) ./acme.sh --issue --dns dns_czechia -d "$TestingDomain" --debug 3 --test -MacOS: - runs-on: macos-latest - needs: Docker - env: - TEST_DNS: ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} - TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} - TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} - CASE: le_test_dnsapi - TEST_LOCAL: 1 - DEBUG: ${{ secrets.DEBUG }} - http_proxy: ${{ secrets.http_proxy }} - https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1 }} - TokenName2: ${{ secrets.TokenName2 }} - TokenName3: ${{ secrets.TokenName3 }} - TokenName4: ${{ secrets.TokenName4 }} - TokenName5: ${{ secrets.TokenName5 }} - - steps: - - uses: actions/checkout@v4 + MacOS: + runs-on: macos-latest + needs: Docker + env: + TEST_DNS: ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} + CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1 }} + TokenName2: ${{ secrets.TokenName2 }} + TokenName3: ${{ secrets.TokenName3 }} + TokenName4: ${{ secrets.TokenName4 }} + TokenName5: ${{ secrets.TokenName5 }} - - name: Install tools - run: | - brew update - brew install socat cloudflared - echo "cloudflared: $(cloudflared --version)" + steps: + - uses: actions/checkout@v4 - - name: Clone acmetest into workspace - run: | - rm -rf ./acmetest - git clone --depth=1 https://github.com/acmesh-official/acmetest.git ./acmetest - # Do acmetest vložíme náš acme.sh (repo root) - cp -R ./acme.sh ./acmetest/acme.sh + - name: Install tools + run: | + brew update + brew install socat cloudflared + echo "cloudflared: $(cloudflared --version)" - - name: Sanity check - run: | - echo "PWD: $(pwd)" - echo "Workspace listing:" - ls -la - echo "acmetest listing:" - ls -la ./acmetest - echo "acmetest letest.sh:" - ls -la ./acmetest/letest.sh + - name: Clone acmetest into workspace + run: | + rm -rf ./acmetest + git clone --depth=1 https://github.com/acmesh-official/acmetest.git ./acmetest + # Do acmetest vložíme náš acme.sh (repo root) + cp -R ./acme.sh ./acmetest/acme.sh - - name: Run acmetest - run: | - # Vynutíme nativní cloudflared z brew (arm64), ať letest nestahuje amd64 tarball - export CF_BIN="$(brew --prefix)/bin/cloudflared" - echo "Using CF_BIN=$CF_BIN" - "$CF_BIN" --version || true + - name: Sanity check + run: | + echo "PWD: $(pwd)" + echo "Workspace listing:" + ls -la + echo "acmetest listing:" + ls -la ./acmetest + echo "acmetest letest.sh:" + ls -la ./acmetest/letest.sh + + - name: Run acmetest + run: | + # Vynutíme nativní cloudflared z brew (arm64), ať letest nestahuje amd64 tarball + export CF_BIN="$(brew --prefix)/bin/cloudflared" + echo "Using CF_BIN=$CF_BIN" + "$CF_BIN" --version || true - if [ "${{ secrets.TokenName1 }}" ] ; then - export ${{ secrets.TokenName1 }}="${{ secrets.TokenValue1 }}" - fi - if [ "${{ secrets.TokenName2 }}" ] ; then - export ${{ secrets.TokenName2 }}="${{ secrets.TokenValue2 }}" - fi - if [ "${{ secrets.TokenName3 }}" ] ; then - export ${{ secrets.TokenName3 }}="${{ secrets.TokenValue3 }}" - fi - if [ "${{ secrets.TokenName4 }}" ] ; then - export ${{ secrets.TokenName4 }}="${{ secrets.TokenValue4 }}" - fi - if [ "${{ secrets.TokenName5 }}" ] ; then - export ${{ secrets.TokenName5 }}="${{ secrets.TokenValue5 }}" - fi + if [ "${{ secrets.TokenName1 }}" ] ; then + export ${{ secrets.TokenName1 }}="${{ secrets.TokenValue1 }}" + fi + if [ "${{ secrets.TokenName2 }}" ] ; then + export ${{ secrets.TokenName2 }}="${{ secrets.TokenValue2 }}" + fi + if [ "${{ secrets.TokenName3 }}" ] ; then + export ${{ secrets.TokenName3 }}="${{ secrets.TokenValue3 }}" + fi + if [ "${{ secrets.TokenName4 }}" ] ; then + export ${{ secrets.TokenName4 }}="${{ secrets.TokenValue4 }}" + fi + if [ "${{ secrets.TokenName5 }}" ] ; then + export ${{ secrets.TokenName5 }}="${{ secrets.TokenValue5 }}" + fi - cd ./acmetest - ./letest.sh + cd ./acmetest + ./letest.sh From 1080b3ee2c6b4427bc3893bd3d7e38e28d98f61a Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Mar 2026 11:09:21 +0100 Subject: [PATCH 121/167] Update DNS.yml --- .github/workflows/DNS.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 8e5c3cc7..4b17cbe6 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -109,26 +109,17 @@ jobs: brew install socat cloudflared echo "cloudflared: $(cloudflared --version)" - - name: Clone acmetest into workspace + - name: Clone acmetest run: | rm -rf ./acmetest git clone --depth=1 https://github.com/acmesh-official/acmetest.git ./acmetest - # Do acmetest vložíme náš acme.sh (repo root) - cp -R ./acme.sh ./acmetest/acme.sh - - name: Sanity check - run: | - echo "PWD: $(pwd)" - echo "Workspace listing:" - ls -la - echo "acmetest listing:" - ls -la ./acmetest - echo "acmetest letest.sh:" - ls -la ./acmetest/letest.sh + mkdir ./acmetest/acme.sh + cp -R . ./acmetest/acme.sh + rm -rf ./acmetest/acme.sh/acmetest - name: Run acmetest run: | - # Vynutíme nativní cloudflared z brew (arm64), ať letest nestahuje amd64 tarball export CF_BIN="$(brew --prefix)/bin/cloudflared" echo "Using CF_BIN=$CF_BIN" "$CF_BIN" --version || true @@ -154,7 +145,6 @@ jobs: - Windows: runs-on: windows-latest needs: MacOS From 3c682d33b0fa4d738e757dd63c4185888d17ff39 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Mar 2026 11:20:13 +0100 Subject: [PATCH 122/167] Update DNS.yml --- .github/workflows/DNS.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 4b17cbe6..67a6252c 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -109,14 +109,18 @@ jobs: brew install socat cloudflared echo "cloudflared: $(cloudflared --version)" - - name: Clone acmetest + - name: Clone acmetest and stage repo as ./acmetest/acme.sh (directory) run: | rm -rf ./acmetest git clone --depth=1 https://github.com/acmesh-official/acmetest.git ./acmetest - mkdir ./acmetest/acme.sh - cp -R . ./acmetest/acme.sh - rm -rf ./acmetest/acme.sh/acmetest + rm -rf ./acmetest/acme.sh + mkdir -p ./acmetest/acme.sh + + rsync -a \ + --exclude 'acmetest/' \ + --exclude '.git/' \ + ./ ./acmetest/acme.sh/ - name: Run acmetest run: | From 548eb4ec1a5b22349132f74e0a60e4863ae86fd2 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Mar 2026 11:28:53 +0100 Subject: [PATCH 123/167] Update DNS.yml --- .github/workflows/DNS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 67a6252c..755b701d 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -85,7 +85,7 @@ jobs: needs: Docker env: TEST_DNS: ${{ secrets.TEST_DNS }} - TestingDomain: ${{ secrets.TestingDomain }} + TestingDomain: ${{ vars.TestingDomain }} TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} From 576dd37bb9efd5838be1734e29c84c1b50125c59 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 2 Mar 2026 12:27:07 +0100 Subject: [PATCH 124/167] Update DNS.yml --- .github/workflows/DNS.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 755b701d..097fb9b6 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -70,14 +70,11 @@ jobs: run: | sudo apt-get update && sudo apt-get install -y socat - # 1. Přejdeme do složky, kde je acme.sh cd ../acmetest/acme.sh/ - # 2. Nakopírujeme tam tvůj skript mkdir -p ./dnsapi/ cp ../../acme.sh/dnsapi/dns_czechia.sh ./dnsapi/dns_czechia.sh - # 3. SPUSTÍME TO NAPŘÍMO (tohle nejde přeskočit) ./acme.sh --issue --dns dns_czechia -d "$TestingDomain" --debug 3 --test MacOS: From 8bb68362b9deeb7b0e4fcf7d823d1149bc9ce1c7 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 9 Mar 2026 08:08:19 +0100 Subject: [PATCH 125/167] dns_czechia: fix shfmt formatting --- .github/workflows/DNS.yml | 145 +++++++++++++++++++------------------- dnsapi/dns_czechia.sh | 26 +++---- 2 files changed, 83 insertions(+), 88 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 097fb9b6..95edf0f9 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -51,38 +51,62 @@ jobs: needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" env: + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} + TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} + TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} + TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} CASE: le_test_dnsapi + TEST_LOCAL: 1 + DEBUG: ${{ secrets.DEBUG }} + http_proxy: ${{ secrets.http_proxy }} + https_proxy: ${{ secrets.https_proxy }} + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} steps: - uses: actions/checkout@v4 - - name: Clone acmetest run: | - cd .. - git clone --depth=1 https://github.com/acmesh-official/acmetest.git - cp -r acme.sh acmetest/acme.sh - - - name: Run acmetest DIRECTLY - env: - CZ_AuthorizationToken: ${{ secrets.TokenValue1 }} - CZ_Zones: ${{ vars.TokenValue2 }} - TestingDomain: ${{ vars.TestingDomain }} - DNSAPI: czechia + rm -rf ./acmetest + git clone --depth=1 https://github.com/acmesh-official/acmetest.git ./acmetest + cp -r ./acme.sh ./acmetest/acme.sh + + - name: Run acmetest run: | - sudo apt-get update && sudo apt-get install -y socat - - cd ../acmetest/acme.sh/ - - mkdir -p ./dnsapi/ - cp ../../acme.sh/dnsapi/dns_czechia.sh ./dnsapi/dns_czechia.sh - - ./acme.sh --issue --dns dns_czechia -d "$TestingDomain" --debug 3 --test + brew install socat cloudflared + export CF_BIN="$(brew --prefix)/bin/cloudflared" + + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + + cd ./acmetest + ./letest.sh + + + MacOS: runs-on: macos-latest needs: Docker env: - TEST_DNS: ${{ secrets.TEST_DNS }} - TestingDomain: ${{ vars.TestingDomain }} + TEST_DNS : ${{ secrets.TEST_DNS }} + TestingDomain: ${{ secrets.TestingDomain }} TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} @@ -91,58 +115,37 @@ jobs: DEBUG: ${{ secrets.DEBUG }} http_proxy: ${{ secrets.http_proxy }} https_proxy: ${{ secrets.https_proxy }} - TokenName1: ${{ secrets.TokenName1 }} - TokenName2: ${{ secrets.TokenName2 }} - TokenName3: ${{ secrets.TokenName3 }} - TokenName4: ${{ secrets.TokenName4 }} - TokenName5: ${{ secrets.TokenName5 }} - + TokenName1: ${{ secrets.TokenName1}} + TokenName2: ${{ secrets.TokenName2}} + TokenName3: ${{ secrets.TokenName3}} + TokenName4: ${{ secrets.TokenName4}} + TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 - - - name: Install tools - run: | - brew update - brew install socat cloudflared - echo "cloudflared: $(cloudflared --version)" - - - name: Clone acmetest and stage repo as ./acmetest/acme.sh (directory) - run: | - rm -rf ./acmetest - git clone --depth=1 https://github.com/acmesh-official/acmetest.git ./acmetest - - rm -rf ./acmetest/acme.sh - mkdir -p ./acmetest/acme.sh - - rsync -a \ - --exclude 'acmetest/' \ - --exclude '.git/' \ - ./ ./acmetest/acme.sh/ - - - name: Run acmetest - run: | - export CF_BIN="$(brew --prefix)/bin/cloudflared" - echo "Using CF_BIN=$CF_BIN" - "$CF_BIN" --version || true - - if [ "${{ secrets.TokenName1 }}" ] ; then - export ${{ secrets.TokenName1 }}="${{ secrets.TokenValue1 }}" - fi - if [ "${{ secrets.TokenName2 }}" ] ; then - export ${{ secrets.TokenName2 }}="${{ secrets.TokenValue2 }}" - fi - if [ "${{ secrets.TokenName3 }}" ] ; then - export ${{ secrets.TokenName3 }}="${{ secrets.TokenValue3 }}" - fi - if [ "${{ secrets.TokenName4 }}" ] ; then - export ${{ secrets.TokenName4 }}="${{ secrets.TokenValue4 }}" - fi - if [ "${{ secrets.TokenName5 }}" ] ; then - export ${{ secrets.TokenName5 }}="${{ secrets.TokenValue5 }}" - fi + - uses: actions/checkout@v4 + - name: Install tools + run: brew install socat + - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Run acmetest + run: | + if [ "${{ secrets.TokenName1}}" ] ; then + export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + fi + if [ "${{ secrets.TokenName2}}" ] ; then + export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + fi + if [ "${{ secrets.TokenName3}}" ] ; then + export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + fi + if [ "${{ secrets.TokenName4}}" ] ; then + export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + fi + if [ "${{ secrets.TokenName5}}" ] ; then + export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + fi + cd ../acmetest + ./letest.sh - cd ./acmetest - ./letest.sh diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 68b44bc9..7f1d7253 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -10,6 +10,7 @@ # # Optional environment variables: # CZ_API_BASE Defaults to https://api.czechia.com + dns_czechia_add() { fulldomain="$1" txtvalue="$2" @@ -38,7 +39,6 @@ dns_czechia_add() { _info "Adding TXT record for $_h in zone $_cz" _debug "Target URL: $_url" - _debug "Token length: ${#_tk}" _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') @@ -50,13 +50,9 @@ dns_czechia_add() { _res="$(_post "$_body" "$_url" "" "POST")" _debug2 "API Response" "$_res" - # Czechia success může být prázdné body (200 OK), takže NEfailujeme na empty. - # Failujeme jen, když v body vidíme explicitní error payload. - if echo "$_res" | grep -q '"status"[[:space:]]*:[[:space:]]*[45][0-9][0-9]'; then - _err "API error details: $_res" - return 1 - fi - if _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then + # Kontrola chyb (shfmt vyžaduje zarovnání bez \ pokud je to možné) + if _contains "$_res" "\"status\":4" || _contains "$_res" "\"status\":5" || + _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then _err "API error details: $_res" return 1 fi @@ -92,8 +88,6 @@ dns_czechia_rm() { [ -z "$_h" ] && _h="@" _info "Removing TXT record for $_h in zone $_cz" - _debug "Target URL: $_url" - _debug "Token length: ${#_tk}" _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') @@ -105,11 +99,8 @@ dns_czechia_rm() { _res="$(_post "$_body" "$_url" "" "DELETE")" _debug2 "API Response" "$_res" - if echo "$_res" | grep -q '"status"[[:space:]]*:[[:space:]]*[45][0-9][0-9]'; then - _err "API error details: $_res" - return 1 - fi - if _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then + if _contains "$_res" "\"status\":4" || _contains "$_res" "\"status\":5" || + _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then _err "API error details: $_res" return 1 fi @@ -117,6 +108,7 @@ dns_czechia_rm() { _info "Successfully removed TXT record." return 0 } + _czechia_load_conf() { CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_getaccountconf CZ_AuthorizationToken)}" [ -z "$CZ_AuthorizationToken" ] && _err "Missing CZ_AuthorizationToken" && return 1 @@ -130,11 +122,11 @@ _czechia_load_conf() { _czechia_pick_zone() { _fd_input="$1" - _fd=$(echo "$_fd_input" | _lower_case | sed 's/\.$//') + _fd=$(printf "%s" "$_fd_input" | _lower_case | sed 's/\.$//') _best_zone="" _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do - _clean_z=$(echo "$_z" | _lower_case | sed 's/ //g; s/\.$//') + _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in "$_clean_z" | *".$_clean_z") From 9ebb4a4821521500213ef24f2079bc5a6dc85a0a Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 9 Mar 2026 08:17:12 +0100 Subject: [PATCH 126/167] Update DNS.yml --- .github/workflows/DNS.yml | 67 +++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 38 deletions(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 95edf0f9..750a0ace 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -47,7 +47,6 @@ jobs: Docker: runs-on: ubuntu-latest - environment: Testing needs: CheckToken if: "contains(needs.CheckToken.outputs.hasToken, 'true')" env: @@ -67,36 +66,30 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clone acmetest + run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ + - name: Set env file run: | - rm -rf ./acmetest - git clone --depth=1 https://github.com/acmesh-official/acmetest.git ./acmetest - cp -r ./acme.sh ./acmetest/acme.sh - - - name: Run acmetest - run: | - brew install socat cloudflared - export CF_BIN="$(brew --prefix)/bin/cloudflared" - + cd ../acmetest if [ "${{ secrets.TokenName1}}" ] ; then - export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}" + echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env fi if [ "${{ secrets.TokenName2}}" ] ; then - export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}" + echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env fi if [ "${{ secrets.TokenName3}}" ] ; then - export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}" + echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env fi if [ "${{ secrets.TokenName4}}" ] ; then - export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}" + echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env fi if [ "${{ secrets.TokenName5}}" ] ; then - export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}" + echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env fi - cd ./acmetest - ./letest.sh + - name: Run acmetest + run: cd ../acmetest && ./rundocker.sh testall @@ -121,7 +114,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: brew install socat - name: Clone acmetest @@ -172,7 +165,7 @@ jobs: - name: Set git to use LF run: | git config --global core.autocrlf false - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install cygwin base packages with chocolatey run: | choco config get cacheLocation @@ -231,7 +224,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/freebsd-vm@v1 @@ -258,7 +251,7 @@ jobs: fi cd ../acmetest ./letest.sh - - name: onError + - name: DebugOnError if: ${{ failure() }} run: | echo "See how to debug in VM:" @@ -286,7 +279,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/openbsd-vm@v1 @@ -313,7 +306,7 @@ jobs: fi cd ../acmetest ./letest.sh - - name: onError + - name: DebugOnError if: ${{ failure() }} run: | echo "See how to debug in VM:" @@ -341,7 +334,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/netbsd-vm@v1 @@ -369,7 +362,7 @@ jobs: fi cd ../acmetest ./letest.sh - - name: onError + - name: DebugOnError if: ${{ failure() }} run: | echo "See how to debug in VM:" @@ -397,7 +390,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/dragonflybsd-vm@v1 @@ -425,7 +418,7 @@ jobs: fi cd ../acmetest ./letest.sh - - name: onError + - name: DebugOnError if: ${{ failure() }} run: | echo "See how to debug in VM:" @@ -457,7 +450,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/solaris-vm@v1 @@ -487,7 +480,7 @@ jobs: fi cd ../acmetest ./letest.sh - - name: onError + - name: DebugOnError if: ${{ failure() }} run: | echo "See how to debug in VM:" @@ -515,7 +508,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/omnios-vm@v1 @@ -541,7 +534,7 @@ jobs: fi cd ../acmetest ./letest.sh - - name: onError + - name: DebugOnError if: ${{ failure() }} run: | echo "See how to debug in VM:" @@ -570,7 +563,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/openindiana-vm@v1 @@ -596,7 +589,7 @@ jobs: fi cd ../acmetest ./letest.sh - - name: onError + - name: DebugOnError if: ${{ failure() }} run: | echo "See how to debug in VM:" @@ -625,7 +618,7 @@ jobs: TokenName4: ${{ secrets.TokenName4}} TokenName5: ${{ secrets.TokenName5}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clone acmetest run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ - uses: vmactions/haiku-vm@v1 @@ -655,10 +648,8 @@ jobs: fi cd ../acmetest ./letest.sh - - name: onError + - name: DebugOnError if: ${{ failure() }} run: | echo "See how to debug in VM:" echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - - From ba857fd5ed270107c07635c64e727fc9eeedaae1 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 9 Mar 2026 08:23:25 +0100 Subject: [PATCH 128/167] Update DNS.yml --- .github/workflows/DNS.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index 750a0ace..fd30a7f9 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -653,3 +653,5 @@ jobs: run: | echo "See how to debug in VM:" echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + From 49b4a980b10226ab70c3b67448e04572434fe685 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 9 Mar 2026 08:25:57 +0100 Subject: [PATCH 129/167] Update DNS.yml --- .github/workflows/DNS.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index fd30a7f9..c1f28935 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -654,4 +654,3 @@ jobs: echo "See how to debug in VM:" echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" - From 4735fea703caceb03e95d3d631762870b6532428 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 9 Mar 2026 08:27:15 +0100 Subject: [PATCH 130/167] Update DNS.yml --- .github/workflows/DNS.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/DNS.yml b/.github/workflows/DNS.yml index c1f28935..61e025e4 100644 --- a/.github/workflows/DNS.yml +++ b/.github/workflows/DNS.yml @@ -654,3 +654,5 @@ jobs: echo "See how to debug in VM:" echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM" + + From 06fd974ecc75e9ffb123a0fb5b24dede2f055647 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 9 Mar 2026 08:47:56 +0100 Subject: [PATCH 131/167] Update dns_czechia.sh Removed tr and [[:space:]] to improve compatibility with minimal environments (Debian). --- dnsapi/dns_czechia.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 7f1d7253..787acecc 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -23,8 +23,8 @@ dns_czechia_add() { return 1 fi - _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') + _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g' | sed 's/[^a-z0-9.-]//g') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g' | sed 's/[^a-zA-Z0-9-]//g') if [ -z "$_cz" ] || [ -z "$_tk" ]; then _err "Missing zone or AuthorizationToken (CZ_Zones/CZ_AuthorizationToken)." @@ -50,7 +50,6 @@ dns_czechia_add() { _res="$(_post "$_body" "$_url" "" "POST")" _debug2 "API Response" "$_res" - # Kontrola chyb (shfmt vyžaduje zarovnání bez \ pokud je to možné) if _contains "$_res" "\"status\":4" || _contains "$_res" "\"status\":5" || _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then _err "API error details: $_res" @@ -73,8 +72,8 @@ dns_czechia_rm() { return 1 fi - _cz=$(printf "%s" "$_current_zone" | tr -d '\r\n\t ' | _lower_case | sed 's/[^a-z0-9.-]//g') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | tr -d '\r\n\t ' | sed 's/[^a-zA-Z0-9-]//g') + _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g' | sed 's/[^a-z0-9.-]//g') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g' | sed 's/[^a-zA-Z0-9-]//g') if [ -z "$_cz" ] || [ -z "$_tk" ]; then _err "Missing zone or AuthorizationToken (CZ_Zones/CZ_AuthorizationToken)." @@ -126,7 +125,7 @@ _czechia_pick_zone() { _best_zone="" _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do - _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/ //g; s/\.$//') + _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/ //g' | sed 's/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in "$_clean_z" | *".$_clean_z") From 75d33a25384ca45a008171a40fe269063557c4c8 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Mon, 9 Mar 2026 11:45:19 +0100 Subject: [PATCH 132/167] Update dns_czechia.sh fix: use CZ_AuthorizationToken consistently and fix API error handling --- dnsapi/dns_czechia.sh | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 787acecc..5fb8f678 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -3,13 +3,13 @@ # dns_czechia.sh - CZECHIA.COM/ZONER DNS API for acme.sh (DNS-01) # # Documentation: https://api.czechia.com/swagger/index.html -# -# Required environment variables: -# CZ_AuthorizationToken Your API token from CZECHIA.COM/Zoner administration. -# CZ_Zones Managed zones separated by comma or space (e.g. "example.com"). -# -# Optional environment variables: -# CZ_API_BASE Defaults to https://api.czechia.com + +#shellcheck disable=SC2034 +dns_czechia_info='[ + {"name":"CZ_AuthorizationToken","usage":"Your API token from CZECHIA.COM/Zoner administration.","required":"1"}, + {"name":"CZ_Zones","usage":"Managed zones separated by comma or space (e.g. \"example.com\").","required":"1"}, + {"name":"CZ_API_BASE","usage":"Defaults to https://api.czechia.com","required":"0"} +]' dns_czechia_add() { fulldomain="$1" @@ -47,7 +47,10 @@ dns_czechia_add() { export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - _res="$(_post "$_body" "$_url" "" "POST")" + if ! _res="$(_post "$_body" "$_url" "" "POST")"; then + _err "API request failed (network or HTTP error)." + return 1 + fi _debug2 "API Response" "$_res" if _contains "$_res" "\"status\":4" || _contains "$_res" "\"status\":5" || @@ -95,7 +98,10 @@ dns_czechia_rm() { export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - _res="$(_post "$_body" "$_url" "" "DELETE")" + if ! _res="$(_post "$_body" "$_url" "" "DELETE")"; then + _err "API request failed (network or HTTP error)." + return 1 + fi _debug2 "API Response" "$_res" if _contains "$_res" "\"status\":4" || _contains "$_res" "\"status\":5" || @@ -109,11 +115,12 @@ dns_czechia_rm() { } _czechia_load_conf() { - CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_getaccountconf CZ_AuthorizationToken)}" + CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_readaccountconf_mutable CZ_AuthorizationToken)}" [ -z "$CZ_AuthorizationToken" ] && _err "Missing CZ_AuthorizationToken" && return 1 - CZ_Zones="${CZ_Zones:-$(_getaccountconf CZ_Zones)}" + CZ_Zones="${CZ_Zones:-$(_readaccountconf_mutable CZ_Zones)}" [ -z "$CZ_Zones" ] && _err "Missing CZ_Zones" && return 1 CZ_API_BASE="${CZ_API_BASE:-https://api.czechia.com}" + _saveaccountconf CZ_AuthorizationToken "$CZ_AuthorizationToken" _saveaccountconf CZ_Zones "$CZ_Zones" return 0 From 1b8456f30e6daa96e6fa3ba6be9ec39ddfc1b14c Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 07:40:31 +0100 Subject: [PATCH 133/167] Update dns_czechia.sh dns_czechia: technical fixes for acme.sh standards and POSIX compatibility --- dnsapi/dns_czechia.sh | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 5fb8f678..64a9c5bc 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -23,8 +23,9 @@ dns_czechia_add() { return 1 fi - _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g' | sed 's/[^a-z0-9.-]//g') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g' | sed 's/[^a-zA-Z0-9-]//g') + # Čistíme jen mezery, zbytek necháme na API + _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g') if [ -z "$_cz" ] || [ -z "$_tk" ]; then _err "Missing zone or AuthorizationToken (CZ_Zones/CZ_AuthorizationToken)." @@ -34,8 +35,13 @@ dns_czechia_add() { _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') - _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") - [ -z "$_h" ] && _h="@" + + # Bezpečnější ořezávání hostname bez sed regexu + if [ "$_fd" = "$_cz" ]; then + _h="@" + else + _h="${_fd%."$_cz"}" + fi _info "Adding TXT record for $_h in zone $_cz" _debug "Target URL: $_url" @@ -75,19 +81,18 @@ dns_czechia_rm() { return 1 fi - _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g' | sed 's/[^a-z0-9.-]//g') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g' | sed 's/[^a-zA-Z0-9-]//g') - - if [ -z "$_cz" ] || [ -z "$_tk" ]; then - _err "Missing zone or AuthorizationToken (CZ_Zones/CZ_AuthorizationToken)." - return 1 - fi + _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g') _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') - _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//; s/^$_cz$//") - [ -z "$_h" ] && _h="@" + + if [ "$_fd" = "$_cz" ]; then + _h="@" + else + _h="${_fd%."$_cz"}" + fi _info "Removing TXT record for $_h in zone $_cz" @@ -121,8 +126,9 @@ _czechia_load_conf() { [ -z "$CZ_Zones" ] && _err "Missing CZ_Zones" && return 1 CZ_API_BASE="${CZ_API_BASE:-https://api.czechia.com}" - _saveaccountconf CZ_AuthorizationToken "$CZ_AuthorizationToken" - _saveaccountconf CZ_Zones "$CZ_Zones" + # Ukládáme přes mutable variantu, aby to sedělo s načítáním + _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" + _saveaccountconf_mutable CZ_Zones "$CZ_Zones" return 0 } @@ -132,7 +138,7 @@ _czechia_pick_zone() { _best_zone="" _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do - _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/ //g' | sed 's/\.$//') + _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in "$_clean_z" | *".$_clean_z") From 3d2c84f4dc521785f82276d4ba0fa061076756df Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 07:43:02 +0100 Subject: [PATCH 134/167] Update dns_czechia.sh style: remove trailing whitespace to pass shfmt --- dnsapi/dns_czechia.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 64a9c5bc..4da4d3e8 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -35,7 +35,7 @@ dns_czechia_add() { _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') - + # Bezpečnější ořezávání hostname bez sed regexu if [ "$_fd" = "$_cz" ]; then _h="@" @@ -87,7 +87,7 @@ dns_czechia_rm() { _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') - + if [ "$_fd" = "$_cz" ]; then _h="@" else @@ -126,7 +126,6 @@ _czechia_load_conf() { [ -z "$CZ_Zones" ] && _err "Missing CZ_Zones" && return 1 CZ_API_BASE="${CZ_API_BASE:-https://api.czechia.com}" - # Ukládáme přes mutable variantu, aby to sedělo s načítáním _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" _saveaccountconf_mutable CZ_Zones "$CZ_Zones" return 0 From 1fde840042f3508a04afb15b7680744a8d71d969 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 07:56:27 +0100 Subject: [PATCH 135/167] dns_czechia: improve compatibility and fix persistence - Switched to _saveaccountconf_mutable to ensure credentials persist correctly for renewals. - Replaced shell suffix removal with sed for hostname derivation to ensure compatibility with older POSIX shells (fixes Debian test environment failure). - Added dns_czechia_info for better discoverability and help documentation. - Relaxed token sanitization to prevent corruption of valid credentials. - Fixed indentation and removed trailing whitespace to pass shfmt checks. --- dnsapi/dns_czechia.sh | 71 +++++++------------------------------------ 1 file changed, 11 insertions(+), 60 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 4da4d3e8..16cc25e9 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -14,108 +14,63 @@ dns_czechia_info='[ dns_czechia_add() { fulldomain="$1" txtvalue="$2" - _czechia_load_conf || return 1 - _current_zone=$(_czechia_pick_zone "$fulldomain") if [ -z "$_current_zone" ]; then _err "No matching zone found for $fulldomain. Please check CZ_Zones." return 1 fi - - # Čistíme jen mezery, zbytek necháme na API _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g') _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g') - if [ -z "$_cz" ] || [ -z "$_tk" ]; then _err "Missing zone or AuthorizationToken (CZ_Zones/CZ_AuthorizationToken)." return 1 fi - _url="$CZ_API_BASE/api/DNS/$_cz/TXT" - _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') - - # Bezpečnější ořezávání hostname bez sed regexu if [ "$_fd" = "$_cz" ]; then _h="@" else - _h="${_fd%."$_cz"}" + _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//") fi - _info "Adding TXT record for $_h in zone $_cz" - _debug "Target URL: $_url" - _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":3600,\"publishZone\":1}" - export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - if ! _res="$(_post "$_body" "$_url" "" "POST")"; then - _err "API request failed (network or HTTP error)." + _err "API request failed." return 1 fi - _debug2 "API Response" "$_res" - - if _contains "$_res" "\"status\":4" || _contains "$_res" "\"status\":5" || - _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then + if _contains "$_res" "\"status\":4" || _contains "$_res" "\"status\":5" || _contains "$_res" "\"errors\""; then _err "API error details: $_res" return 1 fi - - _info "Successfully added TXT record." return 0 } dns_czechia_rm() { fulldomain="$1" txtvalue="$2" - _czechia_load_conf || return 1 - _current_zone=$(_czechia_pick_zone "$fulldomain") - if [ -z "$_current_zone" ]; then - _err "No matching zone found for $fulldomain. Please check CZ_Zones." - return 1 - fi - + [ -z "$_current_zone" ] && return 1 _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g') _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g') - _url="$CZ_API_BASE/api/DNS/$_cz/TXT" - _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') - if [ "$_fd" = "$_cz" ]; then _h="@" else - _h="${_fd%."$_cz"}" + _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//") fi - - _info "Removing TXT record for $_h in zone $_cz" - _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":3600,\"publishZone\":1}" - export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - - if ! _res="$(_post "$_body" "$_url" "" "DELETE")"; then - _err "API request failed (network or HTTP error)." - return 1 - fi - _debug2 "API Response" "$_res" - - if _contains "$_res" "\"status\":4" || _contains "$_res" "\"status\":5" || - _contains "$_res" "\"errors\"" || _contains "$_res" "\"Message\"" || _contains "$_res" "\"message\""; then - _err "API error details: $_res" - return 1 - fi - - _info "Successfully removed TXT record." + _post "$_body" "$_url" "" "DELETE" >/dev/null return 0 } @@ -125,27 +80,23 @@ _czechia_load_conf() { CZ_Zones="${CZ_Zones:-$(_readaccountconf_mutable CZ_Zones)}" [ -z "$CZ_Zones" ] && _err "Missing CZ_Zones" && return 1 CZ_API_BASE="${CZ_API_BASE:-https://api.czechia.com}" - _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" _saveaccountconf_mutable CZ_Zones "$CZ_Zones" return 0 } _czechia_pick_zone() { - _fd_input="$1" - _fd=$(printf "%s" "$_fd_input" | _lower_case | sed 's/\.$//') + _fd=$(printf "%s" "$1" | _lower_case | sed 's/\.$//') _best_zone="" _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in - "$_clean_z" | *".$_clean_z") - if [ ${#_clean_z} -gt ${#_best_zone} ]; then - _best_zone="$_clean_z" - fi - ;; + "$_clean_z"|*".$_clean_z") + if [ ${#_clean_z} -gt ${#_best_zone} ]; then _best_zone="$_clean_z"; fi + ;; esac done - [ -n "$_best_zone" ] && printf "%s" "$_best_zone" + printf "%s" "$_best_zone" } From f7415440723c2356845b40b4bf10aaea680bf8c8 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 07:59:03 +0100 Subject: [PATCH 136/167] Update dns_czechia.sh fix shfmt error --- dnsapi/dns_czechia.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 16cc25e9..32a6dfa6 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -93,7 +93,7 @@ _czechia_pick_zone() { _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in - "$_clean_z"|*".$_clean_z") + "$_clean_z"|*".$_clean_z") if [ ${#_clean_z} -gt ${#_best_zone} ]; then _best_zone="$_clean_z"; fi ;; esac From b434e736f4d024579688c2864e6bcac7e2c92f2a Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 08:00:22 +0100 Subject: [PATCH 137/167] Update dns_czechia.sh fix shfmt error --- dnsapi/dns_czechia.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 32a6dfa6..6938fd47 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -93,9 +93,9 @@ _czechia_pick_zone() { _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in - "$_clean_z"|*".$_clean_z") - if [ ${#_clean_z} -gt ${#_best_zone} ]; then _best_zone="$_clean_z"; fi - ;; + "$_clean_z" | *".$_clean_z") + if [ ${#_clean_z} -gt ${#_best_zone} ]; then _best_zone="$_clean_z"; fi + ;; esac done printf "%s" "$_best_zone" From 4c479887e6439f802756bbf58c9d2cede3400fbb Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 08:39:23 +0100 Subject: [PATCH 138/167] Update dns_czechia.sh fix(dns_czechia): reduce TTL to 60s to improve DNS propagation stability --- dnsapi/dns_czechia.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 6938fd47..bd8069df 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -36,7 +36,7 @@ dns_czechia_add() { _info "Adding TXT record for $_h in zone $_cz" _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') - _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":3600,\"publishZone\":1}" + _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" if ! _res="$(_post "$_body" "$_url" "" "POST")"; then @@ -67,7 +67,7 @@ dns_czechia_rm() { fi _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') - _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":3600,\"publishZone\":1}" + _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" _post "$_body" "$_url" "" "DELETE" >/dev/null From 02fb0de52fef3c75efee1a70c80c2fb5b4eb150c Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 11:52:26 +0100 Subject: [PATCH 139/167] Update dns_czechia.sh fix: handle root hostName and already existing records for better stability --- dnsapi/dns_czechia.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index bd8069df..6b2af086 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -23,28 +23,42 @@ dns_czechia_add() { _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g') _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g') if [ -z "$_cz" ] || [ -z "$_tk" ]; then - _err "Missing zone or AuthorizationToken (CZ_Zones/CZ_AuthorizationToken)." + _err "Missing zone or Token." return 1 fi _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') + + # Robustní určení hostname - pokud se shoduje se zónou, použije @ if [ "$_fd" = "$_cz" ]; then _h="@" else _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//") + [ "$_h" = "$_fd" ] && _h="@" fi + # Pojistka: hostName nesmí být nikdy prázdný řetězec + [ -z "$_h" ] && _h="@" + _info "Adding TXT record for $_h in zone $_cz" _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" + if ! _res="$(_post "$_body" "$_url" "" "POST")"; then _err "API request failed." return 1 fi + + # Ignorujeme chybu, pokud záznam již existuje (časté při testech) + if _contains "$_res" "already exists"; then + _info "Record already exists, skipping." + return 0 + fi + if _contains "$_res" "\"status\":4" || _contains "$_res" "\"status\":5" || _contains "$_res" "\"errors\""; then - _err "API error details: $_res" + _err "API error: $_res" return 1 fi return 0 @@ -64,12 +78,16 @@ dns_czechia_rm() { _h="@" else _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//") + [ "$_h" = "$_fd" ] && _h="@" fi + [ -z "$_h" ] && _h="@" + _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" + # Při mazání ignorujeme výsledek (pokud neexistuje, je to v pořádku) _post "$_body" "$_url" "" "DELETE" >/dev/null return 0 } From 282fd48b202124724de88529fec8a8bce6251019 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 14:20:04 +0100 Subject: [PATCH 140/167] Update dns_czechia.sh feat(dns): add debug logging to dns_czechia plugin Log request URL, body, token and API response for both add and rm operations to help diagnose propagation issues during CI testing. --- dnsapi/dns_czechia.sh | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 6b2af086..2069a298 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -29,29 +29,35 @@ dns_czechia_add() { _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') - # Robustní určení hostname - pokud se shoduje se zónou, použije @ if [ "$_fd" = "$_cz" ]; then _h="@" else _h=$(printf "%s" "$_fd" | sed "s/\.$_cz$//") [ "$_h" = "$_fd" ] && _h="@" fi - # Pojistka: hostName nesmí být nikdy prázdný řetězec [ -z "$_h" ] && _h="@" _info "Adding TXT record for $_h in zone $_cz" _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" + export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - if ! _res="$(_post "$_body" "$_url" "" "POST")"; then - _err "API request failed." + _debug "czechia_add_url" "$_url" + _debug "czechia_add_body" "$_body" + _debug "czechia_add_token" "$_tk" + + _res="$(_post "$_body" "$_url" "" "POST")" + _ret="$?" + _debug "czechia_add_response" "$_res" + + if [ "$_ret" != "0" ]; then + _err "API request failed (curl error $_ret)." return 1 fi - # Ignorujeme chybu, pokud záznam již existuje (časté při testech) if _contains "$_res" "already exists"; then _info "Record already exists, skipping." return 0 @@ -61,6 +67,7 @@ dns_czechia_add() { _err "API error: $_res" return 1 fi + return 0 } @@ -85,10 +92,22 @@ dns_czechia_rm() { _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" + export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - # Při mazání ignorujeme výsledek (pokud neexistuje, je to v pořádku) - _post "$_body" "$_url" "" "DELETE" >/dev/null + + _debug "czechia_rm_url" "$_url" + _debug "czechia_rm_body" "$_body" + _debug "czechia_rm_token" "$_tk" + + _res="$(_post "$_body" "$_url" "" "DELETE")" + _ret="$?" + _debug "czechia_rm_response" "$_res" + + if [ "$_ret" != "0" ]; then + _debug "czechia_rm" "DELETE request failed (curl error $_ret), ignoring." + fi + return 0 } From 317fdf9690d0f20e072d85f5b29453da02f2693e Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 14:59:39 +0100 Subject: [PATCH 141/167] Update dns_czechia.sh debug: add API request and response logging for easier troubleshooting --- dnsapi/dns_czechia.sh | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 2069a298..078ae9e7 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -42,21 +42,17 @@ dns_czechia_add() { _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" + _debug "URL: $_url" + _debug "Body: $_body" + export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - _debug "czechia_add_url" "$_url" - _debug "czechia_add_body" "$_body" - _debug "czechia_add_token" "$_tk" - - _res="$(_post "$_body" "$_url" "" "POST")" - _ret="$?" - _debug "czechia_add_response" "$_res" - - if [ "$_ret" != "0" ]; then - _err "API request failed (curl error $_ret)." + if ! _res="$(_post "$_body" "$_url" "" "POST")"; then + _err "API request failed." return 1 fi + _debug2 "Response: $_res" if _contains "$_res" "already exists"; then _info "Record already exists, skipping." @@ -67,7 +63,6 @@ dns_czechia_add() { _err "API error: $_res" return 1 fi - return 0 } @@ -93,21 +88,14 @@ dns_czechia_rm() { _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" + _debug "URL: $_url" + _debug "Body: $_body" + export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - - _debug "czechia_rm_url" "$_url" - _debug "czechia_rm_body" "$_body" - _debug "czechia_rm_token" "$_tk" - + _res="$(_post "$_body" "$_url" "" "DELETE")" - _ret="$?" - _debug "czechia_rm_response" "$_res" - - if [ "$_ret" != "0" ]; then - _debug "czechia_rm" "DELETE request failed (curl error $_ret), ignoring." - fi - + _debug2 "Response: $_res" return 0 } From a28ac23720aff819d3c100057edfb1c7ffab9d3d Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 15:36:47 +0100 Subject: [PATCH 142/167] Update dns_czechia.sh adding debug function --- dnsapi/dns_czechia.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 078ae9e7..bddfd281 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -12,6 +12,7 @@ dns_czechia_info='[ ]' dns_czechia_add() { + _info "DEBUG: Entering dns_czechia_add for $1" fulldomain="$1" txtvalue="$2" _czechia_load_conf || return 1 From e413b49aa879eb9b782cceac3caa41f1baa30d3c Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:02:54 +0100 Subject: [PATCH 143/167] Create docker-test.yml --- .github/workflows/docker-test.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/docker-test.yml diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml new file mode 100644 index 00000000..fb2dda44 --- /dev/null +++ b/.github/workflows/docker-test.yml @@ -0,0 +1,19 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + bash -n dns_czechia.sh From b6b091c638c289a4120d6b67a70c6959bed2b092 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:06:36 +0100 Subject: [PATCH 144/167] Update docker-test.yml --- .github/workflows/docker-test.yml | 39 ++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index fb2dda44..555292ec 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -1,19 +1,40 @@ -name: Docker Image CI +name: DNS Czechia Test CI on: push: - branches: [ "master" ] + branches: [ "master", "dev" ] # Spustí se při pushi do těchto větví pull_request: branches: [ "master" ] + workflow_dispatch: # <--- TOTO povolí to tlačítko "Run workflow" v Actions jobs: - - build: - + test-plugin: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) - bash -n dns_czechia.sh + - name: Checkout code + uses: actions/checkout@v4 + + - name: Syntax check (bash -n) + run: bash -n dnsapi/dns_czechia.sh + + - name: Shellcheck (lint) + run: | + sudo apt-get update && sudo apt-get install -y shellcheck + shellcheck -e SC2034 dnsapi/dns_czechia.sh + + - name: Run Acme Test Suite + env: + # Tady mapujeme GitHub Secrets na proměnné, které test očekává + # Musíš si je nastavit v Settings -> Secrets and variables -> Actions + TokenName1: ${{ secrets.CZ_TOKEN }} + TokenName2: ${{ secrets.CZ_ZONES }} + TEST_DNS: dns_czechia + TEST_DNS_SLEEP: 120 + run: | + # Klonování testovacího frameworku acmetest + git clone --depth 1 https://github.com/acmesh-official/acmetest.git ../acmetest + + # Spuštění testu v Dockeru (podobně jako v tvých lozích) + # Tento příkaz spustí testy pro různé distribuce (Ubuntu, Debian, atd.) + cd ../acmetest && ./rundocker.sh testall From fd25ba9e386cfdaefe3704262b1d42edb00ab087 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:15:00 +0100 Subject: [PATCH 145/167] Update docker-test.yml --- .github/workflows/docker-test.yml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 555292ec..638ca4cc 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -2,10 +2,8 @@ name: DNS Czechia Test CI on: push: - branches: [ "master", "dev" ] # Spustí se při pushi do těchto větví - pull_request: - branches: [ "master" ] - workflow_dispatch: # <--- TOTO povolí to tlačítko "Run workflow" v Actions + branches: [ "master", "dev" ] + workflow_dispatch: jobs: test-plugin: @@ -15,26 +13,20 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Syntax check (bash -n) + - name: Syntax check run: bash -n dnsapi/dns_czechia.sh - - name: Shellcheck (lint) - run: | - sudo apt-get update && sudo apt-get install -y shellcheck - shellcheck -e SC2034 dnsapi/dns_czechia.sh - - - name: Run Acme Test Suite + - name: Run ONLY Czechia DNS Test env: - # Tady mapujeme GitHub Secrets na proměnné, které test očekává - # Musíš si je nastavit v Settings -> Secrets and variables -> Actions TokenName1: ${{ secrets.CZ_TOKEN }} TokenName2: ${{ secrets.CZ_ZONES }} TEST_DNS: dns_czechia + # Důležité: Nastavíme delší sleep, aby Zoner stihl propsat změnu TEST_DNS_SLEEP: 120 run: | - # Klonování testovacího frameworku acmetest git clone --depth 1 https://github.com/acmesh-official/acmetest.git ../acmetest - # Spuštění testu v Dockeru (podobně jako v tvých lozích) - # Tento příkaz spustí testy pro různé distribuce (Ubuntu, Debian, atd.) - cd ../acmetest && ./rundocker.sh testall + # TADY JE TA ZMĚNA: + # Použijeme rundocker.sh, ale řekneme mu, ať spustí jen 'le_test_dnsapi' + # To přeskočí instalaci, Cloudflare tunely a všechno ostatní. + cd ../acmetest && ./rundocker.sh le_test_dnsapi From a3a350600f6a34822735d08e9f32fd4a54fcb775 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:16:52 +0100 Subject: [PATCH 146/167] Update docker-test.yml --- .github/workflows/docker-test.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 638ca4cc..a60229c5 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -21,12 +21,10 @@ jobs: TokenName1: ${{ secrets.CZ_TOKEN }} TokenName2: ${{ secrets.CZ_ZONES }} TEST_DNS: dns_czechia - # Důležité: Nastavíme delší sleep, aby Zoner stihl propsat změnu TEST_DNS_SLEEP: 120 + # TADY JE TA OPRAVA: Řekneme frameworku, který testovací soubor má spustit + CASE: le_test_dnsapi run: | git clone --depth 1 https://github.com/acmesh-official/acmetest.git ../acmetest - - # TADY JE TA ZMĚNA: - # Použijeme rundocker.sh, ale řekneme mu, ať spustí jen 'le_test_dnsapi' - # To přeskočí instalaci, Cloudflare tunely a všechno ostatní. - cd ../acmetest && ./rundocker.sh le_test_dnsapi + # Spustíme rundocker.sh bez argumentu, on si CASE vytáhne z ENV + cd ../acmetest && ./rundocker.sh From 91477c73658c35d7585eb73925c9ee1dada993f8 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:18:28 +0100 Subject: [PATCH 147/167] Update docker-test.yml --- .github/workflows/docker-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index a60229c5..5ae0a471 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -22,9 +22,9 @@ jobs: TokenName2: ${{ secrets.CZ_ZONES }} TEST_DNS: dns_czechia TEST_DNS_SLEEP: 120 - # TADY JE TA OPRAVA: Řekneme frameworku, který testovací soubor má spustit - CASE: le_test_dnsapi run: | git clone --depth 1 https://github.com/acmesh-official/acmetest.git ../acmetest - # Spustíme rundocker.sh bez argumentu, on si CASE vytáhne z ENV - cd ../acmetest && ./rundocker.sh + cd ../acmetest + + # Spustíme test pro platformu Ubuntu, ale vnutíme mu CASE přímo do příkazu + ./rundocker.sh testplat ubuntu:latest le_test_dnsapi From 451dc727cdf975de543582acf4ae947dbc5788d8 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:20:59 +0100 Subject: [PATCH 148/167] Update docker-test.yml --- .github/workflows/docker-test.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 5ae0a471..44b2afaf 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -18,13 +18,23 @@ jobs: - name: Run ONLY Czechia DNS Test env: + # Tvoje credentials TokenName1: ${{ secrets.CZ_TOKEN }} TokenName2: ${{ secrets.CZ_ZONES }} + # Nastavení pro acme.sh TEST_DNS: dns_czechia TEST_DNS_SLEEP: 120 run: | - git clone --depth 1 https://github.com/acmesh-official/acmetest.git ../acmetest - cd ../acmetest + # 1. Nainstalujeme acme.sh přímo sem do runneru + curl https://get.acme.sh | sh -s email=test@example.com - # Spustíme test pro platformu Ubuntu, ale vnutíme mu CASE přímo do příkazu - ./rundocker.sh testplat ubuntu:latest le_test_dnsapi + # 2. Zkopírujeme tvůj nový DNS plugin tam, kam patří + cp dnsapi/dns_czechia.sh ~/.acme.sh/dnsapi/ + chmod +x ~/.acme.sh/dnsapi/dns_czechia.sh + + # 3. Pustíme ostrý test proti Let's Encrypt staging serveru (ať nespálíme limity) + # Použijeme tvou doménu z CZ_ZONES + ~/.acme.sh/acme.sh --issue --dns dns_czechia \ + -d "$TokenName2" \ + --server letsencrypt --staging \ + --debug 2 From 598fc42d705462741e9cb543555272baf2211a45 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:22:36 +0100 Subject: [PATCH 149/167] Update docker-test.yml --- .github/workflows/docker-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 44b2afaf..a2c9523d 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -26,7 +26,7 @@ jobs: TEST_DNS_SLEEP: 120 run: | # 1. Nainstalujeme acme.sh přímo sem do runneru - curl https://get.acme.sh | sh -s email=test@example.com + curl https://get.acme.sh | sh -s email=jindra@zoner.com # 2. Zkopírujeme tvůj nový DNS plugin tam, kam patří cp dnsapi/dns_czechia.sh ~/.acme.sh/dnsapi/ From 1a3a9b27ee926687dfe3fae40c34774223efd304 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:28:37 +0100 Subject: [PATCH 150/167] Update docker-test.yml --- .github/workflows/docker-test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index a2c9523d..c46610eb 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -38,3 +38,12 @@ jobs: -d "$TokenName2" \ --server letsencrypt --staging \ --debug 2 + - name: Vystavit certifikát přes dns_czechia + shell: bash + env: + # Použití přesně těch názvů, které skript vyžaduje + CZ_AuthorizationToken: ${{ secrets.CZ_AuthorizationToken }} + CZ_Zones: "vasedomena.cz" # doplňte vaši doménu + run: | + # Spuštění acme.sh s využitím těchto proměnných + ~/.acme.sh/acme.sh --issue --dns dns_czechia -d vasedomena.cz --debug From 04674471acdaa18d44b40af6a84389fc20f9f038 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:30:40 +0100 Subject: [PATCH 151/167] Update docker-test.yml --- .github/workflows/docker-test.yml | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index c46610eb..79b8657b 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -16,34 +16,24 @@ jobs: - name: Syntax check run: bash -n dnsapi/dns_czechia.sh - - name: Run ONLY Czechia DNS Test + - name: Run Czechia DNS Test env: - # Tvoje credentials - TokenName1: ${{ secrets.CZ_TOKEN }} - TokenName2: ${{ secrets.CZ_ZONES }} + # TADY BYLA CHYBA - musí se to jmenovat přesně takto: + CZ_AuthorizationToken: ${{ secrets.CZ_TOKEN }} + CZ_Zones: "zoner-test.eu" # Sem dejte vaši testovací doménu # Nastavení pro acme.sh - TEST_DNS: dns_czechia TEST_DNS_SLEEP: 120 run: | - # 1. Nainstalujeme acme.sh přímo sem do runneru + # 1. Instalace acme.sh curl https://get.acme.sh | sh -s email=jindra@zoner.com - # 2. Zkopírujeme tvůj nový DNS plugin tam, kam patří + # 2. Zkopírování vašeho vyvíjeného pluginu do složky acme.sh cp dnsapi/dns_czechia.sh ~/.acme.sh/dnsapi/ chmod +x ~/.acme.sh/dnsapi/dns_czechia.sh - # 3. Pustíme ostrý test proti Let's Encrypt staging serveru (ať nespálíme limity) - # Použijeme tvou doménu z CZ_ZONES + # 3. Spuštění testu proti staging serveru (v CZ_Zones musí být doména) + # Použijeme proměnnou $CZ_Zones, kterou jsme definovali v env: ~/.acme.sh/acme.sh --issue --dns dns_czechia \ - -d "$TokenName2" \ + -d "$CZ_Zones" \ --server letsencrypt --staging \ --debug 2 - - name: Vystavit certifikát přes dns_czechia - shell: bash - env: - # Použití přesně těch názvů, které skript vyžaduje - CZ_AuthorizationToken: ${{ secrets.CZ_AuthorizationToken }} - CZ_Zones: "vasedomena.cz" # doplňte vaši doménu - run: | - # Spuštění acme.sh s využitím těchto proměnných - ~/.acme.sh/acme.sh --issue --dns dns_czechia -d vasedomena.cz --debug From e9441d99089984d78697d04838660f213b03022f Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:33:51 +0100 Subject: [PATCH 152/167] Update docker-test.yml --- .github/workflows/docker-test.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 79b8657b..c63bf9eb 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -18,22 +18,22 @@ jobs: - name: Run Czechia DNS Test env: - # TADY BYLA CHYBA - musí se to jmenovat přesně takto: CZ_AuthorizationToken: ${{ secrets.CZ_TOKEN }} - CZ_Zones: "zoner-test.eu" # Sem dejte vaši testovací doménu - # Nastavení pro acme.sh + CZ_Zones: "zoner-test.eu" TEST_DNS_SLEEP: 120 run: | # 1. Instalace acme.sh curl https://get.acme.sh | sh -s email=jindra@zoner.com - # 2. Zkopírování vašeho vyvíjeného pluginu do složky acme.sh - cp dnsapi/dns_czechia.sh ~/.acme.sh/dnsapi/ - chmod +x ~/.acme.sh/dnsapi/dns_czechia.sh + # 2. Zkopírování pluginu (všimněte si fixní cesty k home) + # Ujistíme se, že cílová složka existuje + mkdir -p /home/runner/.acme.sh/dnsapi + cp dnsapi/dns_czechia.sh /home/runner/.acme.sh/dnsapi/dns_czechia.sh + chmod +x /home/runner/.acme.sh/dnsapi/dns_czechia.sh - # 3. Spuštění testu proti staging serveru (v CZ_Zones musí být doména) - # Použijeme proměnnou $CZ_Zones, kterou jsme definovali v env: - ~/.acme.sh/acme.sh --issue --dns dns_czechia \ + # 3. Spuštění s VYNUCENÝM staging serverem a správným názvem + /home/runner/.acme.sh/acme.sh --issue \ + --dns dns_czechia \ -d "$CZ_Zones" \ - --server letsencrypt --staging \ + --server https://acme-staging-v02.api.letsencrypt.org/directory \ --debug 2 From 0e6539de019ef6367a79081d199617e07bb47699 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:36:20 +0100 Subject: [PATCH 153/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index bddfd281..10ad1b35 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -41,7 +41,7 @@ dns_czechia_add() { _info "Adding TXT record for $_h in zone $_cz" _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') - _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" + _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":300,\"publishZone\":1}" _debug "URL: $_url" _debug "Body: $_body" @@ -87,7 +87,7 @@ dns_czechia_rm() { _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') - _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":60,\"publishZone\":1}" + _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":300,\"publishZone\":1}" _debug "URL: $_url" _debug "Body: $_body" From 962a0664e58dd1d5a79914c35d2e231e18db8508 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:42:32 +0100 Subject: [PATCH 154/167] Update dns_czechia.sh spellcheck fix --- dnsapi/dns_czechia.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 10ad1b35..dc192930 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -48,7 +48,6 @@ dns_czechia_add() { export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - if ! _res="$(_post "$_body" "$_url" "" "POST")"; then _err "API request failed." return 1 From 96a8a2a070445e5255f72e79ab642c41d5ef13cb Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:45:16 +0100 Subject: [PATCH 155/167] Update dns_czechia.sh shfmt fix --- dnsapi/dns_czechia.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index dc192930..3175608b 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -93,7 +93,6 @@ dns_czechia_rm() { export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - _res="$(_post "$_body" "$_url" "" "DELETE")" _debug2 "Response: $_res" return 0 From 3528fe885f5b8e9744b4e085b7d5b0274d13be24 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Tue, 10 Mar 2026 17:56:26 +0100 Subject: [PATCH 156/167] Delete .github/workflows/docker-test.yml --- .github/workflows/docker-test.yml | 39 ------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/docker-test.yml diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml deleted file mode 100644 index c63bf9eb..00000000 --- a/.github/workflows/docker-test.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: DNS Czechia Test CI - -on: - push: - branches: [ "master", "dev" ] - workflow_dispatch: - -jobs: - test-plugin: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Syntax check - run: bash -n dnsapi/dns_czechia.sh - - - name: Run Czechia DNS Test - env: - CZ_AuthorizationToken: ${{ secrets.CZ_TOKEN }} - CZ_Zones: "zoner-test.eu" - TEST_DNS_SLEEP: 120 - run: | - # 1. Instalace acme.sh - curl https://get.acme.sh | sh -s email=jindra@zoner.com - - # 2. Zkopírování pluginu (všimněte si fixní cesty k home) - # Ujistíme se, že cílová složka existuje - mkdir -p /home/runner/.acme.sh/dnsapi - cp dnsapi/dns_czechia.sh /home/runner/.acme.sh/dnsapi/dns_czechia.sh - chmod +x /home/runner/.acme.sh/dnsapi/dns_czechia.sh - - # 3. Spuštění s VYNUCENÝM staging serverem a správným názvem - /home/runner/.acme.sh/acme.sh --issue \ - --dns dns_czechia \ - -d "$CZ_Zones" \ - --server https://acme-staging-v02.api.letsencrypt.org/directory \ - --debug 2 From 7915265b3b7a66ab9c85ad65dc1b4db3ab8bb5dc Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 11 Mar 2026 07:50:48 +0100 Subject: [PATCH 157/167] Update dnsapi/dns_czechia.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dnsapi/dns_czechia.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 3175608b..65a17ca6 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -12,7 +12,7 @@ dns_czechia_info='[ ]' dns_czechia_add() { - _info "DEBUG: Entering dns_czechia_add for $1" + _debug "Entering dns_czechia_add for $1" fulldomain="$1" txtvalue="$2" _czechia_load_conf || return 1 From 694895e71ac9c0dffd1dbc8bca3ec8c332ad3d01 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 11 Mar 2026 07:51:10 +0100 Subject: [PATCH 158/167] Update dnsapi/dns_czechia.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dnsapi/dns_czechia.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 65a17ca6..67550946 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -71,7 +71,10 @@ dns_czechia_rm() { txtvalue="$2" _czechia_load_conf || return 1 _current_zone=$(_czechia_pick_zone "$fulldomain") - [ -z "$_current_zone" ] && return 1 + if [ -z "$_current_zone" ]; then + _err "No matching zone found for $fulldomain. Please check CZ_Zones configuration." + return 1 + fi _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g') _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g') _url="$CZ_API_BASE/api/DNS/$_cz/TXT" From 3c335994ef7dd4369b9c9f33708b5981e6be2af9 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 11 Mar 2026 07:51:28 +0100 Subject: [PATCH 159/167] Update dnsapi/dns_czechia.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dnsapi/dns_czechia.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 67550946..1d037521 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -97,7 +97,16 @@ dns_czechia_rm() { export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" _res="$(_post "$_body" "$_url" "" "DELETE")" + _post_exit="$?" _debug2 "Response: $_res" + if [ "$_post_exit" -ne 0 ]; then + _err "CZECHIA DNS API DELETE request failed for $_fd: exit code $_post_exit, response: $_res" + return 1 + fi + if _contains "$_res" '"isError":true'; then + _err "CZECHIA DNS API reported an error while deleting TXT for $_fd: $_res" + return 1 + fi return 0 } From 7211843b00fe816d606a06a66e1cb0c00ffb0b0c Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 11 Mar 2026 07:51:37 +0100 Subject: [PATCH 160/167] Update dnsapi/dns_czechia.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dnsapi/dns_czechia.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 1d037521..40c281db 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -22,7 +22,7 @@ dns_czechia_add() { return 1 fi _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/^ *//; s/ *$//') if [ -z "$_cz" ] || [ -z "$_tk" ]; then _err "Missing zone or Token." return 1 From 7b0bf24a12d29408e8ef29ff163f2688d6b4cb59 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 11 Mar 2026 07:52:00 +0100 Subject: [PATCH 161/167] Update dnsapi/dns_czechia.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dnsapi/dns_czechia.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 40c281db..6a728d33 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -39,13 +39,12 @@ dns_czechia_add() { [ -z "$_h" ] && _h="@" _info "Adding TXT record for $_h in zone $_cz" - _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') - _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') - _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":300,\"publishZone\":1}" + _body="{\"hostName\":$(_json_encode "$_h"),\"text\":$(_json_encode "$txtvalue"),\"ttl\":300,\"publishZone\":1}" _debug "URL: $_url" _debug "Body: $_body" + _debug "Body: $_body" export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" if ! _res="$(_post "$_body" "$_url" "" "POST")"; then From 480812a7f25aa7ad82642da0360c38278e2d88a4 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 11 Mar 2026 07:52:20 +0100 Subject: [PATCH 162/167] Update dnsapi/dns_czechia.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dnsapi/dns_czechia.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 6a728d33..dc6e9211 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -114,9 +114,11 @@ _czechia_load_conf() { [ -z "$CZ_AuthorizationToken" ] && _err "Missing CZ_AuthorizationToken" && return 1 CZ_Zones="${CZ_Zones:-$(_readaccountconf_mutable CZ_Zones)}" [ -z "$CZ_Zones" ] && _err "Missing CZ_Zones" && return 1 - CZ_API_BASE="${CZ_API_BASE:-https://api.czechia.com}" + CZ_API_BASE="${CZ_API_BASE:-$(_readaccountconf_mutable CZ_API_BASE)}" + [ -z "$CZ_API_BASE" ] && CZ_API_BASE="https://api.czechia.com" _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" _saveaccountconf_mutable CZ_Zones "$CZ_Zones" + _saveaccountconf_mutable CZ_API_BASE "$CZ_API_BASE" return 0 } From 3cbfe6b00334e341dba833f01f7f932c9a437db6 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Wed, 11 Mar 2026 11:22:10 +0100 Subject: [PATCH 163/167] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index dc6e9211..66bca872 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -14,7 +14,7 @@ dns_czechia_info='[ dns_czechia_add() { _debug "Entering dns_czechia_add for $1" fulldomain="$1" - txtvalue="$2" + txtvalue="$3" _czechia_load_conf || return 1 _current_zone=$(_czechia_pick_zone "$fulldomain") if [ -z "$_current_zone" ]; then @@ -39,11 +39,11 @@ dns_czechia_add() { [ -z "$_h" ] && _h="@" _info "Adding TXT record for $_h in zone $_cz" - _body="{\"hostName\":$(_json_encode "$_h"),\"text\":$(_json_encode "$txtvalue"),\"ttl\":300,\"publishZone\":1}" + _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') + _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') + _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":300,\"publishZone\":1}" _debug "URL: $_url" - _debug "Body: $_body" - _debug "Body: $_body" export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" @@ -67,7 +67,7 @@ dns_czechia_add() { dns_czechia_rm() { fulldomain="$1" - txtvalue="$2" + txtvalue="$3" _czechia_load_conf || return 1 _current_zone=$(_czechia_pick_zone "$fulldomain") if [ -z "$_current_zone" ]; then From a0e6b975ff94ffa7ca3ec1d1df7f74c1a20543b3 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 12 Mar 2026 15:45:00 +0100 Subject: [PATCH 164/167] Update dns_czechia.sh fix(dnsapi): czechia plugin pass txtvalue correctly and validate inputs --- dnsapi/dns_czechia.sh | 88 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 71 insertions(+), 17 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 66bca872..97b24a79 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -12,21 +12,32 @@ dns_czechia_info='[ ]' dns_czechia_add() { - _debug "Entering dns_czechia_add for $1" fulldomain="$1" - txtvalue="$3" + txtvalue="$2" + + _debug "dns_czechia_add fulldomain='$fulldomain'" + + if [ -z "$fulldomain" ] || [ -z "$txtvalue" ]; then + _err "dns_czechia_add: missing fulldomain or txtvalue" + return 1 + fi + _czechia_load_conf || return 1 + _current_zone=$(_czechia_pick_zone "$fulldomain") if [ -z "$_current_zone" ]; then _err "No matching zone found for $fulldomain. Please check CZ_Zones." return 1 fi - _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/^ *//; s/ *$//') + + _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/[[:space:]]//g; s/\.$//') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//') + if [ -z "$_cz" ] || [ -z "$_tk" ]; then - _err "Missing zone or Token." + _err "Missing zone or CZ_AuthorizationToken." return 1 fi + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') @@ -39,19 +50,25 @@ dns_czechia_add() { [ -z "$_h" ] && _h="@" _info "Adding TXT record for $_h in zone $_cz" + _h_esc=$(printf "%s" "$_h" | sed 's/\\/\\\\/g; s/"/\\"/g') _txt_esc=$(printf "%s" "$txtvalue" | sed 's/\\/\\\\/g; s/"/\\"/g') _body="{\"hostName\":\"$_h_esc\",\"text\":\"$_txt_esc\",\"ttl\":300,\"publishZone\":1}" _debug "URL: $_url" _debug "Body: $_body" + export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" - if ! _res="$(_post "$_body" "$_url" "" "POST")"; then - _err "API request failed." + + _res="$(_post "$_body" "$_url" "" "POST")" + _post_exit="$?" + _debug2 "Response: $_res" + + if [ "$_post_exit" -ne 0 ]; then + _err "API request failed. exit code $_post_exit" return 1 fi - _debug2 "Response: $_res" if _contains "$_res" "already exists"; then _info "Record already exists, skipping." @@ -62,22 +79,40 @@ dns_czechia_add() { _err "API error: $_res" return 1 fi + return 0 } dns_czechia_rm() { fulldomain="$1" - txtvalue="$3" + txtvalue="$2" + + _debug "dns_czechia_rm fulldomain='$fulldomain'" + + if [ -z "$fulldomain" ] || [ -z "$txtvalue" ]; then + _err "dns_czechia_rm: missing fulldomain or txtvalue" + return 1 + fi + _czechia_load_conf || return 1 + _current_zone=$(_czechia_pick_zone "$fulldomain") if [ -z "$_current_zone" ]; then _err "No matching zone found for $fulldomain. Please check CZ_Zones configuration." return 1 fi - _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/ //g') - _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/ //g') + + _cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/[[:space:]]//g; s/\.$//') + _tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//') + + if [ -z "$_cz" ] || [ -z "$_tk" ]; then + _err "Missing zone or CZ_AuthorizationToken." + return 1 + fi + _url="$CZ_API_BASE/api/DNS/$_cz/TXT" _fd=$(printf "%s" "$fulldomain" | _lower_case | sed 's/\.$//') + if [ "$_fd" = "$_cz" ]; then _h="@" else @@ -95,45 +130,64 @@ dns_czechia_rm() { export _H1="Content-Type: application/json" export _H2="AuthorizationToken: $_tk" + _res="$(_post "$_body" "$_url" "" "DELETE")" _post_exit="$?" _debug2 "Response: $_res" + if [ "$_post_exit" -ne 0 ]; then _err "CZECHIA DNS API DELETE request failed for $_fd: exit code $_post_exit, response: $_res" return 1 fi + if _contains "$_res" '"isError":true'; then _err "CZECHIA DNS API reported an error while deleting TXT for $_fd: $_res" return 1 fi + return 0 } _czechia_load_conf() { CZ_AuthorizationToken="${CZ_AuthorizationToken:-$(_readaccountconf_mutable CZ_AuthorizationToken)}" - [ -z "$CZ_AuthorizationToken" ] && _err "Missing CZ_AuthorizationToken" && return 1 + if [ -z "$CZ_AuthorizationToken" ]; then + _err "Missing CZ_AuthorizationToken" + return 1 + fi + CZ_Zones="${CZ_Zones:-$(_readaccountconf_mutable CZ_Zones)}" - [ -z "$CZ_Zones" ] && _err "Missing CZ_Zones" && return 1 + if [ -z "$CZ_Zones" ]; then + _err "Missing CZ_Zones" + return 1 + fi + CZ_API_BASE="${CZ_API_BASE:-$(_readaccountconf_mutable CZ_API_BASE)}" [ -z "$CZ_API_BASE" ] && CZ_API_BASE="https://api.czechia.com" + _saveaccountconf_mutable CZ_AuthorizationToken "$CZ_AuthorizationToken" _saveaccountconf_mutable CZ_Zones "$CZ_Zones" _saveaccountconf_mutable CZ_API_BASE "$CZ_API_BASE" + return 0 } _czechia_pick_zone() { _fd=$(printf "%s" "$1" | _lower_case | sed 's/\.$//') _best_zone="" + _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do - _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/ //g; s/\.$//') + _clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/[[:space:]]//g; s/\.$//') [ -z "$_clean_z" ] && continue + case "$_fd" in - "$_clean_z" | *".$_clean_z") - if [ ${#_clean_z} -gt ${#_best_zone} ]; then _best_zone="$_clean_z"; fi - ;; + "$_clean_z" | *."$_clean_z") + if [ ${#_clean_z} -gt ${#_best_zone} ]; then + _best_zone="$_clean_z" + fi + ;; esac done + printf "%s" "$_best_zone" } From eebd973f15eba03137e2ac0de6e3e022d0827e0f Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 12 Mar 2026 15:47:36 +0100 Subject: [PATCH 165/167] Fix case statement formatting in dns_czechia.sh --- dnsapi/dns_czechia.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 97b24a79..e008ceaf 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -181,11 +181,11 @@ _czechia_pick_zone() { [ -z "$_clean_z" ] && continue case "$_fd" in - "$_clean_z" | *."$_clean_z") - if [ ${#_clean_z} -gt ${#_best_zone} ]; then - _best_zone="$_clean_z" - fi - ;; + "$_clean_z" | *."$_clean_z") + if [ ${#_clean_z} -gt ${#_best_zone} ]; then + _best_zone="$_clean_z" + fi + ;; esac done From 8932df57ef6ae350b77c5d5abeaba21a4c991ad1 Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Fri, 13 Mar 2026 07:17:50 +0100 Subject: [PATCH 166/167] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- dnsapi/dns_czechia.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index e008ceaf..65b9603a 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -140,7 +140,9 @@ dns_czechia_rm() { return 1 fi - if _contains "$_res" '"isError":true'; then + _res_normalized=$(_normalizeJson "$_res") + + if _contains "$_res_normalized" '"isError":true'; then _err "CZECHIA DNS API reported an error while deleting TXT for $_fd: $_res" return 1 fi From c200e654dbca3e36153602d812bff899464fdaee Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Sat, 14 Mar 2026 16:36:22 +0100 Subject: [PATCH 167/167] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- dnsapi/dns_czechia.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index 65b9603a..4a7967ec 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -140,7 +140,7 @@ dns_czechia_rm() { return 1 fi - _res_normalized=$(_normalizeJson "$_res") + _res_normalized=$(printf '%s' "$_res" | _normalizeJson) if _contains "$_res_normalized" '"isError":true'; then _err "CZECHIA DNS API reported an error while deleting TXT for $_fd: $_res"