Skip to content

Instantly share code, notes, and snippets.

@KalleDK
Last active December 16, 2020 14:15
Show Gist options
  • Save KalleDK/8ea5adbdf0f885495a04f2cb1c188292 to your computer and use it in GitHub Desktop.
Save KalleDK/8ea5adbdf0f885495a04f2cb1c188292 to your computer and use it in GitHub Desktop.
Acme Patches
--- /tmp/acme/acme.sh
+++ /usr/local/libexec/acme/acme.sh
@@ -2217,6 +2217,11 @@
_save_conf "$DOMAIN_CONF" "$@"
}
+#key value base64encode
+_savedomainconf_mutable() {
+ _savedomainconf "SAVED_$1" "$2" "$3"
+}
+
#_cleardomainconf key
_cleardomainconf() {
_clear_conf "$DOMAIN_CONF" "$1"
@@ -2226,6 +2231,12 @@
_readdomainconf() {
_read_conf "$DOMAIN_CONF" "$1"
}
+
+#key
+_readdomainconf_mutable() {
+ _readdomainconf "SAVED_$1"
+}
+
#key value base64encode
_savedeployconf() {
--- /tmp/acme/dnsapi/dns_cf.sh
+++ /usr/local/libexec/acme/dnsapi/dns_cf.sh
@@ -18,16 +18,16 @@
fulldomain=$1
txtvalue=$2
- CF_Token="${CF_Token:-$(_readaccountconf_mutable CF_Token)}"
- CF_Account_ID="${CF_Account_ID:-$(_readaccountconf_mutable CF_Account_ID)}"
- CF_Zone_ID="${CF_Zone_ID:-$(_readaccountconf_mutable CF_Zone_ID)}"
- CF_Key="${CF_Key:-$(_readaccountconf_mutable CF_Key)}"
- CF_Email="${CF_Email:-$(_readaccountconf_mutable CF_Email)}"
+ CF_Token="${CF_Token:-$(_readdomainconf_mutable CF_Token)}"
+ CF_Account_ID="${CF_Account_ID:-$(_readdomainconf_mutable CF_Account_ID)}"
+ CF_Zone_ID="${CF_Zone_ID:-$(_readdomainconf_mutable CF_Zone_ID)}"
+ CF_Key="${CF_Key:-$(_readdomainconf_mutable CF_Key)}"
+ CF_Email="${CF_Email:-$(_readdomainconf_mutable CF_Email)}"
if [ "$CF_Token" ]; then
- _saveaccountconf_mutable CF_Token "$CF_Token"
- _saveaccountconf_mutable CF_Account_ID "$CF_Account_ID"
- _saveaccountconf_mutable CF_Zone_ID "$CF_Zone_ID"
+ _savedomainconf_mutable CF_Token "$CF_Token"
+ _savedomainconf_mutable CF_Account_ID "$CF_Account_ID"
+ _savedomainconf_mutable CF_Zone_ID "$CF_Zone_ID"
else
if [ -z "$CF_Key" ] || [ -z "$CF_Email" ]; then
CF_Key=""
@@ -43,8 +43,8 @@
return 1
fi
#save the api key and email to the account conf file.
- _saveaccountconf_mutable CF_Key "$CF_Key"
- _saveaccountconf_mutable CF_Email "$CF_Email"
+ _savedomainconf_mutable CF_Key "$CF_Key"
+ _savedomainconf_mutable CF_Email "$CF_Email"
fi
_debug "First detect the root zone"
@@ -92,11 +92,11 @@
fulldomain=$1
txtvalue=$2
- CF_Token="${CF_Token:-$(_readaccountconf_mutable CF_Token)}"
- CF_Account_ID="${CF_Account_ID:-$(_readaccountconf_mutable CF_Account_ID)}"
- CF_Zone_ID="${CF_Zone_ID:-$(_readaccountconf_mutable CF_Zone_ID)}"
- CF_Key="${CF_Key:-$(_readaccountconf_mutable CF_Key)}"
- CF_Email="${CF_Email:-$(_readaccountconf_mutable CF_Email)}"
+ CF_Token="${CF_Token:-$(_readdomainconf_mutable CF_Token)}"
+ CF_Account_ID="${CF_Account_ID:-$(_readdomainconf_mutable CF_Account_ID)}"
+ CF_Zone_ID="${CF_Zone_ID:-$(_readdomainconf_mutable CF_Zone_ID)}"
+ CF_Key="${CF_Key:-$(_readdomainconf_mutable CF_Key)}"
+ CF_Email="${CF_Email:-$(_readdomainconf_mutable CF_Email)}"
_debug "First detect the root zone"
if ! _get_root "$fulldomain"; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment