Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
0481f20c
Unverified
Commit
0481f20c
authored
Feb 01, 2021
by
Alexander Kulumbeg
Committed by
GitHub
Feb 01, 2021
Browse files
"datez" var and comments
parent
76309601
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_websupport.sh
View file @
0481f20c
#!/usr/bin/env sh
#!/usr/bin/env sh
#This is the websupport.sk api wrapper for acme.sh
#
This is the websupport.sk api wrapper for acme.sh
#
#
#Author: trgo.sk
# Original author: trgo.sk (https://github.com/trgosk)
#Report Bugs here: https://github.com/trgosk/acme.sh
# Tweaks by: akulumbeg (https://github.com/akulumbeg)
#
#WS_ApiKey="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# Report Bugs here: https://github.com/akulumbeg/acme.sh
#WS_ApiSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
#
# Requirements: API Key and Secret from https://admin.websupport.sk/en/auth/apiKey
#
# WS_ApiKey="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# (called "Identifier" in the WS Admin)
#
# WS_ApiSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# (called "Secret key" in the WS Admin)
WS_Api
=
"https://rest.websupport.sk"
WS_Api
=
"https://rest.websupport.sk"
######## Public functions #####################
######## Public functions #####################
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns_websupport_add
()
{
dns_websupport_add
()
{
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
...
@@ -26,7 +32,7 @@ dns_websupport_add() {
...
@@ -26,7 +32,7 @@ dns_websupport_add() {
else
else
WS_ApiKey
=
""
WS_ApiKey
=
""
WS_ApiSecret
=
""
WS_ApiSecret
=
""
_err
"You did
n'
t specify
a api k
ey and/or
api secret yet.
"
_err
"You did
no
t specify
the API K
ey and/or
API Secret
"
_err
"You can get yours from here https://admin.websupport.sk/en/auth/apiKey"
_err
"You can get yours from here https://admin.websupport.sk/en/auth/apiKey"
return
1
return
1
fi
fi
...
@@ -62,7 +68,6 @@ dns_websupport_add() {
...
@@ -62,7 +68,6 @@ dns_websupport_add() {
}
}
#fulldomain txtvalue
dns_websupport_rm
()
{
dns_websupport_rm
()
{
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
...
@@ -111,11 +116,8 @@ dns_websupport_rm() {
...
@@ -111,11 +116,8 @@ dns_websupport_rm() {
}
}
#################### Private functions below ##################################
#################### Private Functions ##################################
#_acme-challenge.www.domain.com
#returns
# _sub_domain=_acme-challenge.www
# _domain=domain.com
_get_root
()
{
_get_root
()
{
domain
=
$1
domain
=
$1
i
=
1
i
=
1
...
@@ -157,9 +159,8 @@ _ws_rest() {
...
@@ -157,9 +159,8 @@ _ws_rest() {
_debug2 api_secret
"
$WS_ApiSecret
"
_debug2 api_secret
"
$WS_ApiSecret
"
timestamp
=
$(
_time
)
timestamp
=
$(
_time
)
datez
=
$(
date
-u
-r
"
$timestamp
"
+%Y-%m-%dT%H:%M:%S%z 2>/dev/null
||
date
-u
-d
@
"
$timestamp
"
+%Y-%m-%dT%H:%M:%S%z
)
datez
=
$(
printf
"%s"
"
$(
date
-u
-r
"
$timestamp
"
+%Y-%m-%dT%H:%M:%S%z 2>/dev/null
||
date
-u
-d
@
"
$timestamp
"
+%Y-%m-%dT%H:%M:%S%z
)
"
)
canonical_request
=
"
${
me
}
${
pa
}
${
timestamp
}
"
canonical_request
=
"
${
me
}
${
pa
}
${
timestamp
}
"
alg
=
"sha1"
signature_hash
=
$(
printf
"%s"
"
$canonical_request
"
| _hmac sha1
"
$(
printf
"%s"
"
$WS_ApiSecret
"
| _hex_dump |
tr
-d
" "
)
"
hex
)
signature_hash
=
$(
printf
"%s"
"
$canonical_request
"
| _hmac sha1
"
$(
printf
"%s"
"
$WS_ApiSecret
"
| _hex_dump |
tr
-d
" "
)
"
hex
)
basicauth
=
"
$(
printf
"%s:%s"
"
$WS_ApiKey
"
"
$signature_hash
"
| _base64
)
"
basicauth
=
"
$(
printf
"%s:%s"
"
$WS_ApiKey
"
"
$signature_hash
"
| _base64
)
"
...
@@ -169,7 +170,6 @@ _ws_rest() {
...
@@ -169,7 +170,6 @@ _ws_rest() {
_debug2 timestamp
"
$timestamp
"
_debug2 timestamp
"
$timestamp
"
_debug2 datez
"
$datez
"
_debug2 datez
"
$datez
"
_debug2 canonical_request
"
$canonical_request
"
_debug2 canonical_request
"
$canonical_request
"
_debug2 alg
"
$alg
"
_debug2 signature_hash
"
$signature_hash
"
_debug2 signature_hash
"
$signature_hash
"
_debug2 basicauth
"
$basicauth
"
_debug2 basicauth
"
$basicauth
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment