Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
ed6649b1
Commit
ed6649b1
authored
Oct 26, 2020
by
Ed Lynes
Browse files
Merge branch 'dev' of
https://github.com/acmesh-official/acme.sh
into dev
parents
c61495df
23eccb2f
Changes
3
Show whitespace changes
Inline
Side-by-side
.github/workflows/DNS.yml
View file @
ed6649b1
...
@@ -183,7 +183,7 @@ jobs:
...
@@ -183,7 +183,7 @@ jobs:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Clone acmetest
-
name
:
Clone acmetest
run
:
cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
run
:
cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
-
uses
:
vmactions/freebsd-vm@v0.0.
5
-
uses
:
vmactions/freebsd-vm@v0.0.
7
with
:
with
:
envs
:
'
TEST_DNS
TestingDomain
TEST_DNS_NO_WILDCARD
TEST_DNS_SLEEP
CASE
TEST_LOCAL
DEBUG
${{
secrets.TokenName1}}
${{
secrets.TokenName2}}
${{
secrets.TokenName3}}
${{
secrets.TokenName4}}
${{
secrets.TokenName5}}'
envs
:
'
TEST_DNS
TestingDomain
TEST_DNS_NO_WILDCARD
TEST_DNS_SLEEP
CASE
TEST_LOCAL
DEBUG
${{
secrets.TokenName1}}
${{
secrets.TokenName2}}
${{
secrets.TokenName3}}
${{
secrets.TokenName4}}
${{
secrets.TokenName5}}'
prepare
:
pkg install -y socat curl
prepare
:
pkg install -y socat curl
...
...
.github/workflows/LetsEncrypt.yml
View file @
ed6649b1
...
@@ -58,7 +58,7 @@ jobs:
...
@@ -58,7 +58,7 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Install tools
-
name
:
Install tools
run
:
brew
update && brew
install socat
;
run
:
brew install socat
-
name
:
Clone acmetest
-
name
:
Clone acmetest
run
:
cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
run
:
cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
-
name
:
Run acmetest
-
name
:
Run acmetest
...
@@ -106,7 +106,7 @@ jobs:
...
@@ -106,7 +106,7 @@ jobs:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Clone acmetest
-
name
:
Clone acmetest
run
:
cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
run
:
cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
-
uses
:
vmactions/freebsd-vm@v0.0.
5
-
uses
:
vmactions/freebsd-vm@v0.0.
7
with
:
with
:
envs
:
'
NGROK_TOKEN
TEST_LOCAL'
envs
:
'
NGROK_TOKEN
TEST_LOCAL'
prepare
:
pkg install -y socat curl
prepare
:
pkg install -y socat curl
...
...
dnsapi/dns_1984hosting.sh
View file @
ed6649b1
...
@@ -40,8 +40,35 @@ dns_1984hosting_add() {
...
@@ -40,8 +40,35 @@ dns_1984hosting_add() {
_debug _sub_domain
"
$_sub_domain
"
_debug _sub_domain
"
$_sub_domain
"
_debug _domain
"
$_domain
"
_debug _domain
"
$_domain
"
_1984hosting_add_txt_record
"
$_domain
"
"
$_sub_domain
"
"
$txtvalue
"
_debug
"Add TXT record
$fulldomain
with value '
$txtvalue
'"
return
$?
value
=
"
$(
printf
'%s'
"
$txtvalue
"
| _url_encode
)
"
url
=
"https://management.1984hosting.com/domains/entry/"
postdata
=
"entry=new"
postdata
=
"
$postdata
&type=TXT"
postdata
=
"
$postdata
&ttl=3600"
postdata
=
"
$postdata
&zone=
$_domain
"
postdata
=
"
$postdata
&host=
$_sub_domain
"
postdata
=
"
$postdata
&rdata=%22
$value
%22"
_debug2 postdata
"
$postdata
"
_authpost
"
$postdata
"
"
$url
"
response
=
"
$(
echo
"
$_response
"
| _normalizeJson
)
"
_debug2 response
"
$response
"
if
_contains
"
$response
"
'"haserrors": true'
;
then
_err
"1984Hosting failed to add TXT record for
$_sub_domain
bad RC from _post"
return
1
elif
_contains
"
$response
"
"<html>"
;
then
_err
"1984Hosting failed to add TXT record for
$_sub_domain
. Check
$HTTP_HEADER
file"
return
1
elif
_contains
"
$response
"
'"auth": false'
;
then
_err
"1984Hosting failed to add TXT record for
$_sub_domain
. Invalid or expired cookie"
return
1
fi
_info
"Added acme challenge TXT record for
$fulldomain
at 1984Hosting"
return
0
}
}
#Usage: fulldomain txtvalue
#Usage: fulldomain txtvalue
...
@@ -67,57 +94,10 @@ dns_1984hosting_rm() {
...
@@ -67,57 +94,10 @@ dns_1984hosting_rm() {
_debug _sub_domain
"
$_sub_domain
"
_debug _sub_domain
"
$_sub_domain
"
_debug _domain
"
$_domain
"
_debug _domain
"
$_domain
"
_1984hosting_delete_txt_record
"
$_domain
"
"
$_sub_domain
"
return
$?
}
#################### Private functions below ##################################
# usage _1984hosting_add_txt_record domain subdomain value
# returns 0 success
_1984hosting_add_txt_record
()
{
_debug
"Add TXT record
$1
with value '
$3
'"
domain
=
"
$1
"
subdomain
=
"
$2
"
value
=
"
$(
printf
'%s'
"
$3
"
| _url_encode
)
"
url
=
"https://management.1984hosting.com/domains/entry/"
postdata
=
"entry=new"
postdata
=
"
$postdata
&type=TXT"
postdata
=
"
$postdata
&ttl=3600"
postdata
=
"
$postdata
&zone=
$domain
"
postdata
=
"
$postdata
&host=
$subdomain
"
postdata
=
"
$postdata
&rdata=%22
$value
%22"
_debug2 postdata
"
$postdata
"
_authpost
"
$postdata
"
"
$url
"
response
=
"
$(
echo
"
$_response
"
| _normalizeJson
)
"
_debug2 response
"
$response
"
if
_contains
"
$response
"
'"haserrors": true'
;
then
_err
"1984Hosting failed to add TXT record for
$subdomain
bad RC from _post"
return
1
elif
_contains
"
$response
"
"<html>"
;
then
_err
"1984Hosting failed to add TXT record for
$subdomain
. Check
$HTTP_HEADER
file"
return
1
elif
_contains
"
$response
"
'"auth": false'
;
then
_err
"1984Hosting failed to add TXT record for
$subdomain
. Invalid or expired cookie"
return
1
fi
_info
"Added acme challenge TXT record for
$fulldomain
at 1984Hosting"
return
0
}
# usage _1984hosting_delete_txt_record entry_id
# returns 0 success
_1984hosting_delete_txt_record
()
{
_debug
"Delete
$fulldomain
TXT record"
_debug
"Delete
$fulldomain
TXT record"
domain
=
"
$1
"
subdomain
=
"
$2
"
url
=
"https://management.1984hosting.com/domains"
url
=
"https://management.1984hosting.com/domains"
_htmlget
"
$url
"
"
$domain
"
_htmlget
"
$url
"
"
$
_
domain
"
_debug2 _response
"
$_response
"
_debug2 _response
"
$_response
"
zone_id
=
"
$(
echo
"
$_response
"
| _egrep_o
'zone\/[0-9]+'
)
"
zone_id
=
"
$(
echo
"
$_response
"
| _egrep_o
'zone\/[0-9]+'
)
"
_debug2 zone_id
"
$zone_id
"
_debug2 zone_id
"
$zone_id
"
...
@@ -126,7 +106,7 @@ _1984hosting_delete_txt_record() {
...
@@ -126,7 +106,7 @@ _1984hosting_delete_txt_record() {
return
1
return
1
fi
fi
_htmlget
"
$url
/
$zone_id
"
"
$subdomain
"
_htmlget
"
$url
/
$zone_id
"
"
$
_
sub
_
domain
"
_debug2 _response
"
$_response
"
_debug2 _response
"
$_response
"
entry_id
=
"
$(
echo
"
$_response
"
| _egrep_o
'entry_[0-9]+'
|
sed
's/entry_//'
)
"
entry_id
=
"
$(
echo
"
$_response
"
| _egrep_o
'entry_[0-9]+'
|
sed
's/entry_//'
)
"
_debug2 entry_id
"
$entry_id
"
_debug2 entry_id
"
$entry_id
"
...
@@ -148,6 +128,8 @@ _1984hosting_delete_txt_record() {
...
@@ -148,6 +128,8 @@ _1984hosting_delete_txt_record() {
return
0
return
0
}
}
#################### Private functions below ##################################
# usage: _1984hosting_login username password
# usage: _1984hosting_login username password
# returns 0 success
# returns 0 success
_1984hosting_login
()
{
_1984hosting_login
()
{
...
...
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