-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request - can we add portunity here #5099
Comments
Please upgrade to the latest code and try again first. Maybe it's already fixed. |
send pr please |
Dear Neil, I'm not so expedience, please what is the meaning of "send pr pleas"? Should I send you the script? |
Check: |
@scruel, thanks for the reply. I don't know about the way to work with git-hub. I found the code from Daniel Harb and I changed one statement. So I'm able to use the vi. I'm looking for somebody who is able to bring the script (sorry for the bad formatting) to git and to the official package. |
There Team,
please can we add portunity to the next release please.
The working script:
`
#!/usr/bin/env sh
Author: Daniel Harp
Required Variables:
export PORTUNITY_USER="ASDF1234ASDF1234"
export PORTUNITY_API_KEY="CFCFCFCFCFCFCF"
PORTUNITY_API="https://wr.ispsuite.portunity.de/api/"
######## Public functions #####################
#Usage: dns_portunity_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns_portunity_add() {
fulldomain=$1
txtvalue=$2
_info "Adding Portunity DNS Record"
_debug fulldomain "$fulldomain"
_debug txtvalue "$txtvalue"
PORTUNITY_USER="${PORTUNITY_USER:-$(_readaccountconf_mutable PORTUNITY_USER)}"
if [ -z "$PORTUNITY_USER" ]; then
PORTUNITY_USER=""
_err "You must specify PORTUNITY_USER"
return 1
fi
PORTUNITY_API_KEY="${PORTUNITY_API_KEY:-$(_readaccountconf_mutable PORTUNITY_API_KEY)}"
if [ -z "$PORTUNITY_API_KEY" ]; then
PORTUNITY_API_KEY=""
_err "You must specify PORTUNITY_API_KEY"
return 1
fi
_saveaccountconf_mutable PORTUNITY_USER "$PORTUNITY_USER"
_saveaccountconf_mutable PORTUNITY_API_KEY "$PORTUNITY_API_KEY"
if ! _portunity_rest "add" "$fulldomain" "$txtvalue"; then
_err "Portunity add record failed"
return 1
fi
_info "Add successful"
return 0
}
#Usage: fulldomain txtvalue
#Remove the txt record after validation.
dns_portunity_rm() {
fulldomain=$1
txtvalue=$2
_info "Removing Portunity DNS Record"
_debug fulldomain "$fulldomain"
_debug txtvalue "$txtvalue"
if ! _portunity_rest "delete" "$fulldomain" "$txtvalue"; then
_err "Portunity delete record failed"
return 1
fi
_info "Delete successful"
return 0
}
#################### Private functions below ##################################
_portunity_rest() {
action="$1"
fulldomain="$2"
txtvalue="$3"
user_trimmed=$(printf "%s" "$PORTUNITY_USER" | tr -d '"')
key_trimmed=$(printf "%s" "$PORTUNITY_API_KEY" | tr -d '"')
authorization=$(printf "%s" "$user_trimmed:$key_trimmed" | _base64)
data=$(printf 'data={"api":"product-dns","action": "%s","rrset": {"type": "TXT","name":"%s","ttl":30,"records":[{"content": "%s"}]}}' "$action" "$fulldomain" "$txtvalue")
_debug data "$data"
response="$(_post "$data" "$PORTUNITY_API")"
ret_cd="$?"
if [ "$ret_cd" != "0" ]; then
_err "Post to portunity failed. Return code: $ret_cd"
return 1
fi
if ! _contains "$response" '"ok"'; then
_err 'Response from Portunity did not include "ok". Check error message in response.'
_err "$response"
return 1
fi
_debug2 "Response from Portunity: $response"
return 0
}
`
The text was updated successfully, but these errors were encountered: