]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
Merge pull request #4406 from acmesh-official/dev v3.0.5
authorneil <github@neilpang.com>
Wed, 23 Nov 2022 13:44:53 +0000 (21:44 +0800)
committerGitHub <noreply@github.com>
Wed, 23 Nov 2022 13:44:53 +0000 (21:44 +0800)
sync

.github/workflows/shellcheck.yml
deploy/gitlab.sh
dnsapi/dns_dynv6.sh
dnsapi/dns_edgedns.sh
dnsapi/dns_infomaniak.sh
dnsapi/dns_oci.sh
dnsapi/dns_servercow.sh
dnsapi/dns_vultr.sh

index d628ea93ec7f916c9d1bac65214349ef3fae0619..a5a08bbf80cd0e7dfe5864190afddab5e2d51487 100644 (file)
@@ -22,16 +22,16 @@ jobs:
   ShellCheck:\r
     runs-on: ubuntu-latest\r
     steps:\r
-    - uses: actions/checkout@v2\r
+    - uses: actions/checkout@v3\r
     - name: Install Shellcheck\r
       run: sudo apt-get install -y shellcheck\r
     - name: DoShellcheck\r
-      run: shellcheck -V  && shellcheck -e SC2181 **/*.sh && echo "shellcheck OK"\r
+      run: shellcheck -V  && shellcheck -e SC2181 -e SC2089 **/*.sh && echo "shellcheck OK"\r
 \r
   shfmt:\r
     runs-on: ubuntu-latest\r
     steps:\r
-    - uses: actions/checkout@v2\r
+    - uses: actions/checkout@v3\r
     - name: Install shfmt\r
       run: curl -sSL https://github.com/mvdan/sh/releases/download/v3.1.2/shfmt_v3.1.2_linux_amd64 -o ~/shfmt && chmod +x ~/shfmt\r
     - name: shfmt\r
index ba2d312286f0065aa364e3508b186273f5d045b1..595b6d2048af1d50758aa91b5ec341b82b17c101 100644 (file)
@@ -67,7 +67,7 @@ gitlab_deploy() {
 
   error_response="error"
 
-  if test "${_response#*$error_response}" != "$_response"; then
+  if test "${_response#*"$error_response"}" != "$_response"; then
     _err "Error in deploying certificate:"
     _err "$_response"
     return 1
index 9efc9aeb0b4ebef787f18e88eff861fc86b4e89b..90814b1bed1e36da3be734a5a8ac25df35dbcb73 100644 (file)
@@ -94,8 +94,8 @@ _get_domain() {
   _your_hosts="$(echo "$_your_hosts" | awk '/\./ {print $1}')"
   for l in $_your_hosts; do
     #echo "host: $l"
-    if test "${_full_domain#*$l}" != "$_full_domain"; then
-      _record="${_full_domain%.$l}"
+    if test "${_full_domain#*"$l"}" != "$_full_domain"; then
+      _record=${_full_domain%."$l"}
       _host=$l
       _debug "The host is $_host and the record $_record"
       return 0
@@ -143,7 +143,7 @@ _dns_dynv6_add_http() {
     return 1
   fi
   _get_zone_name "$_zone_id"
-  record="${fulldomain%%.$_zone_name}"
+  record=${fulldomain%%."$_zone_name"}
   _set_record TXT "$record" "$txtvalue"
   if _contains "$response" "$txtvalue"; then
     _info "Successfully added record"
@@ -161,7 +161,7 @@ _dns_dynv6_rm_http() {
     return 1
   fi
   _get_zone_name "$_zone_id"
-  record="${fulldomain%%.$_zone_name}"
+  record=${fulldomain%%."$_zone_name"}
   _get_record_id "$_zone_id" "$record" "$txtvalue"
   _del_record "$_zone_id" "$_record_id"
   if [ -z "$response" ]; then
index 11c132fa4c65ad7701bc94ab0a286bfcb32410e6..27650eb186e37daba48f345c08b4bcf4173bdb17 100755 (executable)
@@ -418,7 +418,7 @@ _edgedns_make_data_to_sign() {
   _secure_debug2 "hdr" "$hdr"
   _edgedns_make_content_hash
   path="$(echo "$_request_url_path" | tr -d "\n\r" | sed 's/https\?:\/\///')"
-  path="${path#*$AKAMAI_HOST}"
+  path=${path#*"$AKAMAI_HOST"}
   _debug "hier path" "$path"
   # dont expose headers to sign so use MT string
   _mdata="$(printf "%s\thttps\t%s\t%s\t%s\t%s\t%s" "$_request_method" "$AKAMAI_HOST" "$path" "" "$_hash" "$hdr")"
index 765cf39d14661a7b18eb9157b4a1a2da3d0a8dfd..a005132c72ec739ebbc5864add201a23c12ab99c 100755 (executable)
@@ -76,7 +76,7 @@ dns_infomaniak_add() {
   domain_id=${zone_and_id#* }
 
   # extract first part of domain
-  key=${fulldomain%.$zone}
+  key=${fulldomain%."$zone"}
 
   _debug "zone:$zone id:$domain_id key:$key"
 
@@ -149,7 +149,7 @@ dns_infomaniak_rm() {
   domain_id=${zone_and_id#* }
 
   # extract first part of domain
-  key=${fulldomain%.$zone}
+  key=${fulldomain%."$zone"}
 
   _debug "zone:$zone id:$domain_id key:$key"
 
index 18d7441004d1ab52154cd64614250dcf1a1eea2e..3b81143f83af96126fc3d1b07cb8b4e323618eb0 100644 (file)
@@ -265,6 +265,7 @@ _signed_request() {
     _response="$(_get "https://${_sig_host}${_sig_target}")"
   elif [ "$_curl_method" = "PATCH" ]; then
     export _H1="$_date_header"
+    # shellcheck disable=SC2090
     export _H2="$_sig_body_sha256"
     export _H3="$_sig_body_type"
     export _H4="$_sig_body_length"
index f70a2294434fcfd9c5a59010cf4150b2a41049b0..52137905e9c4ca41ea82ae86a10bf6ec31fb4a90 100755 (executable)
@@ -53,7 +53,7 @@ dns_servercow_add() {
   if printf -- "%s" "$response" | grep "{\"name\":\"$_sub_domain\",\"ttl\":20,\"type\":\"TXT\"" >/dev/null; then
     _info "A txt record with the same name already exists."
     # trim the string on the left
-    txtvalue_old=${response#*{\"name\":\"$_sub_domain\",\"ttl\":20,\"type\":\"TXT\",\"content\":\"}
+    txtvalue_old=${response#*{\"name\":\""$_sub_domain"\",\"ttl\":20,\"type\":\"TXT\",\"content\":\"}
     # trim the string on the right
     txtvalue_old=${txtvalue_old%%\"*}
 
index bd925fdb99b67dcb53838e531f12c4765acde266..58f14be10a13e2deaa62dad905fde6cbb9f87b76 100644 (file)
@@ -139,7 +139,7 @@ _vultr_rest() {
   data="$3"
   _debug "$ep"
 
-  api_key_trimmed=$(echo $VULTR_API_KEY | tr -d '"')
+  api_key_trimmed=$(echo "$VULTR_API_KEY" | tr -d '"')
 
   export _H1="Authorization: Bearer $api_key_trimmed"
   export _H2='Content-Type: application/json'