Skip to content

Commit

Permalink
deployhook KeyHelp: Support enabling the Enforce HTTPS option
Browse files Browse the repository at this point in the history
  • Loading branch information
b1n23 committed Jun 3, 2024
1 parent bfba44f commit 7dd8753
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deploy/keyhelp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# export DEPLOY_KEYHELP_BASEURL="https://keyhelp.example.com"
# export DEPLOY_KEYHELP_USERNAME="Your KeyHelp Username"
# export DEPLOY_KEYHELP_PASSWORD="Your KeyHelp Password"
# export DEPLOY_KEYHELP_ENFORCE_HTTPS="1" # 0 or 1, input 1 to enable Enforce HTTP to HTTPS redirection.
# export DEPLOY_KEYHELP_DOMAIN_ID="Depoly certificate to this Domain ID"

# Open the 'Edit domain' page, and you will see id=xxx at the end of the URL. This is the Domain ID.
Expand Down Expand Up @@ -96,7 +97,7 @@ keyhelp_deploy() {
return 1
fi

_request_body="submit=1&id=$DOMAIN_ID&target_type=$target_type&certificate_type=custom&certificate_id=$cert_value"
_request_body="submit=1&id=$DOMAIN_ID&target_type=$target_type&certificate_type=custom&certificate_id=$cert_value&enforce_https=$DEPLOY_KEYHELP_ENFORCE_HTTPS"
_response=$(_post "$_request_body" "$DEPLOY_KEYHELP_BASEURL/index.php?page=domains&action=edit" "" "POST")
_message=$(echo "$_response" | grep -A 2 'message-body' | sed -n '/<div class="message-body ">/,/<\/div>/{//!p;}' | sed 's/<[^>]*>//g' | sed 's/^ *//;s/ *$//')
_info "_message" "$_message"
Expand Down

0 comments on commit 7dd8753

Please sign in to comment.