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
cc4bce28
Commit
cc4bce28
authored
Feb 09, 2020
by
Wout
Browse files
Merge branch 'master' of
git://github.com/acmesh-official/acme.sh
parents
2cc50a2b
94eb8059
Changes
28
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_nic.sh
View file @
cc4bce28
#!/usr/bin/env sh
#
#NIC_
Token="sdfsdfsdfljlbjkljlkjsdfoiwjedfglgkdlfgkfgldfkg"
#
#NIC_
ClientID='0dc0xxxxxxxxxxxxxxxxxxxxxxxxce88'
#
NIC_ClientSecret='3LTtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxnuW8'
#NIC_Username="000000/NIC-D"
#NIC_Password="xxxxxxx"
NIC_Api
=
"https://api.nic.ru"
...
...
@@ -13,22 +12,7 @@ dns_nic_add() {
fulldomain
=
"
${
1
}
"
txtvalue
=
"
${
2
}
"
NIC_Token
=
"
${
NIC_Token
:-
$(
_readaccountconf_mutable NIC_Token
)
}
"
NIC_Username
=
"
${
NIC_Username
:-
$(
_readaccountconf_mutable NIC_Username
)
}
"
NIC_Password
=
"
${
NIC_Password
:-
$(
_readaccountconf_mutable NIC_Password
)
}
"
if
[
-z
"
$NIC_Token
"
]
||
[
-z
"
$NIC_Username
"
]
||
[
-z
"
$NIC_Password
"
]
;
then
NIC_Token
=
""
NIC_Username
=
""
NIC_Password
=
""
_err
"You must export variables: NIC_Token, NIC_Username and NIC_Password"
return
1
fi
_saveaccountconf_mutable NIC_Customer
"
$NIC_Token
"
_saveaccountconf_mutable NIC_Username
"
$NIC_Username
"
_saveaccountconf_mutable NIC_Password
"
$NIC_Password
"
if
!
_nic_get_authtoken
"
$NIC_Username
"
"
$NIC_Password
"
"
$NIC_Token
"
;
then
if
!
_nic_get_authtoken save
;
then
_err
"get NIC auth token failed"
return
1
fi
...
...
@@ -59,18 +43,7 @@ dns_nic_rm() {
fulldomain
=
"
${
1
}
"
txtvalue
=
"
${
2
}
"
NIC_Token
=
"
${
NIC_Token
:-
$(
_readaccountconf_mutable NIC_Token
)
}
"
NIC_Username
=
"
${
NIC_Username
:-
$(
_readaccountconf_mutable NIC_Username
)
}
"
NIC_Password
=
"
${
NIC_Password
:-
$(
_readaccountconf_mutable NIC_Password
)
}
"
if
[
-z
"
$NIC_Token
"
]
||
[
-z
"
$NIC_Username
"
]
||
[
-z
"
$NIC_Password
"
]
;
then
NIC_Token
=
""
NIC_Username
=
""
NIC_Password
=
""
_err
"You must export variables: NIC_Token, NIC_Username and NIC_Password"
return
1
fi
if
!
_nic_get_authtoken
"
$NIC_Username
"
"
$NIC_Password
"
"
$NIC_Token
"
;
then
if
!
_nic_get_authtoken
;
then
_err
"get NIC auth token failed"
return
1
fi
...
...
@@ -103,17 +76,64 @@ dns_nic_rm() {
#################### Private functions below ##################################
#_nic_get_auth_elements [need2save]
_nic_get_auth_elements
()
{
_need2save
=
$1
NIC_ClientID
=
"
${
NIC_ClientID
:-
$(
_readaccountconf_mutable NIC_ClientID
)
}
"
NIC_ClientSecret
=
"
${
NIC_ClientSecret
:-
$(
_readaccountconf_mutable NIC_ClientSecret
)
}
"
NIC_Username
=
"
${
NIC_Username
:-
$(
_readaccountconf_mutable NIC_Username
)
}
"
NIC_Password
=
"
${
NIC_Password
:-
$(
_readaccountconf_mutable NIC_Password
)
}
"
## for backward compatibility
if
[
-z
"
$NIC_ClientID
"
]
||
[
-z
"
$NIC_ClientSecret
"
]
;
then
NIC_Token
=
"
${
NIC_Token
:-
$(
_readaccountconf_mutable NIC_Token
)
}
"
_debug NIC_Token
"
$NIC_Token
"
if
[
-n
"
$NIC_Token
"
]
;
then
_two_values
=
"
$(
echo
"
${
NIC_Token
}
"
| _dbase64
)
"
_debug _two_values
"
$_two_values
"
NIC_ClientID
=
$(
echo
"
$_two_values
"
|
cut
-d
':'
-f1
)
NIC_ClientSecret
=
$(
echo
"
$_two_values
"
|
cut
-d
':'
-f2-
)
_debug restored_NIC_ClientID
"
$NIC_ClientID
"
_debug restored_NIC_ClientSecret
"
$NIC_ClientSecret
"
fi
fi
if
[
-z
"
$NIC_ClientID
"
]
||
[
-z
"
$NIC_ClientSecret
"
]
||
[
-z
"
$NIC_Username
"
]
||
[
-z
"
$NIC_Password
"
]
;
then
NIC_ClientID
=
""
NIC_ClientSecret
=
""
NIC_Username
=
""
NIC_Password
=
""
_err
"You must export variables: NIC_ClientID, NIC_ClientSecret, NIC_Username and NIC_Password"
return
1
fi
if
[
"
$_need2save
"
]
;
then
_saveaccountconf_mutable NIC_ClientID
"
$NIC_ClientID
"
_saveaccountconf_mutable NIC_ClientSecret
"
$NIC_ClientSecret
"
_saveaccountconf_mutable NIC_Username
"
$NIC_Username
"
_saveaccountconf_mutable NIC_Password
"
$NIC_Password
"
fi
NIC_BasicAuth
=
$(
printf
"%s:%s"
"
${
NIC_ClientID
}
"
"
${
NIC_ClientSecret
}
"
| _base64
)
_debug NIC_BasicAuth
"
$NIC_BasicAuth
"
}
#_nic_get_authtoken [need2save]
_nic_get_authtoken
()
{
username
=
"
$1
"
password
=
"
$2
"
token
=
"
$3
"
_need2save
=
$1
if
!
_nic_get_auth_elements
"
$_need2save
"
;
then
return
1
fi
_info
"Getting NIC auth token"
export
_H1
=
"Authorization: Basic
$
token
"
export
_H1
=
"Authorization: Basic
$
{
NIC_BasicAuth
}
"
export
_H2
=
"Content-Type: application/x-www-form-urlencoded"
res
=
$(
_post
"grant_type=password&username=
$
u
sername
&password=
$
p
assword
&scope=%28GET%7CPUT%7CPOST%7CDELETE%29%3A%2Fdns-master%2F.%2B"
"
$NIC_Api
/oauth/token"
""
"POST"
)
res
=
$(
_post
"grant_type=password&username=
$
{
NIC_U
sername
}
&password=
$
{
NIC_P
assword
}
&scope=%28GET%7CPUT%7CPOST%7CDELETE%29%3A%2Fdns-master%2F.%2B"
"
$NIC_Api
/oauth/token"
""
"POST"
)
if
_contains
"
$res
"
"access_token"
;
then
_auth_token
=
$(
printf
"%s"
"
$res
"
|
cut
-d
,
-f2
|
tr
-d
"
\"
"
|
sed
"s/access_token://"
)
_info
"Token received"
...
...
@@ -146,7 +166,7 @@ _get_root() {
if
_contains
"
$_all_domains
"
"^
$h
$"
;
then
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_domain
=
$h
_service
=
$(
printf
"%s"
"
$response
"
|
grep
"
$_domain
"
|
sed
-r
"s/.*service=
\"
(.*)
\"
.*
$/
\1
/"
)
_service
=
$(
printf
"%s"
"
$response
"
|
grep
"idn-name=
\
"
$_domain
\"
"
|
sed
-r
"s/.*service=
\"
(.*)
\"
.*
$/
\1
/"
)
return
0
fi
p
=
"
$i
"
...
...
dnsapi/dns_openprovider.sh
View file @
cc4bce28
...
...
@@ -3,7 +3,7 @@
# This is the OpenProvider API wrapper for acme.sh
#
# Author: Sylvia van Os
# Report Bugs here: https://github.com/
Neilpang
/acme.sh/issues/2104
# Report Bugs here: https://github.com/
acmesh-official
/acme.sh/issues/2104
#
# export OPENPROVIDER_USER="username"
# export OPENPROVIDER_PASSWORDHASH="hashed_password"
...
...
dnsapi/dns_ovh.sh
View file @
cc4bce28
...
...
@@ -32,9 +32,9 @@ SYS_CA='https://ca.api.soyoustart.com/1.0'
#'runabove-ca'
RAV_CA
=
'https://api.runabove.com/1.0'
wiki
=
"https://github.com/
Neilpang
/acme.sh/wiki/How-to-use-OVH-domain-api"
wiki
=
"https://github.com/
acmesh-official
/acme.sh/wiki/How-to-use-OVH-domain-api"
ovh_success
=
"https://github.com/
Neilpang
/acme.sh/wiki/OVH-Success"
ovh_success
=
"https://github.com/
acmesh-official
/acme.sh/wiki/OVH-Success"
_ovh_get_api
()
{
_ogaep
=
"
$1
"
...
...
dnsapi/dns_pleskxml.sh
View file @
cc4bce28
...
...
@@ -2,7 +2,7 @@
## Name: dns_pleskxml.sh
## Created by Stilez.
## Also uses some code from PR#1832 by @romanlum (https://github.com/
Neilpang
/acme.sh/pull/1832/files)
## Also uses some code from PR#1832 by @romanlum (https://github.com/
acmesh-official
/acme.sh/pull/1832/files)
## This DNS-01 method uses the Plesk XML API described at:
## https://docs.plesk.com/en-US/12.5/api-rpc/about-xml-api.28709
...
...
dnsapi/dns_rackspace.sh
View file @
cc4bce28
...
...
@@ -9,7 +9,7 @@ RACKSPACE_Endpoint="https://dns.api.rackspacecloud.com/v1.0"
# 20190213 - The name & id fields swapped in the API response; fix sed
# 20190101 - Duplicating file for new pull request to dev branch
# Original - tcocca:rackspace_dnsapi https://github.com/
Neilpang
/acme.sh/pull/1297
# Original - tcocca:rackspace_dnsapi https://github.com/
acmesh-official
/acme.sh/pull/1297
######## Public functions #####################
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
...
...
dnsapi/dns_servercow.sh
View file @
cc4bce28
#!/usr/bin/env sh
##########
# Custom servercow.de DNS API v1 for use with [acme.sh](https://github.com/
Neilpang
/acme.sh)
# Custom servercow.de DNS API v1 for use with [acme.sh](https://github.com/
acmesh-official
/acme.sh)
#
# Usage:
# export SERVERCOW_API_Username=username
...
...
dnsapi/dns_unoeuro.sh
View file @
cc4bce28
...
...
@@ -52,7 +52,7 @@ dns_unoeuro_add() {
fi
_info
"Adding record"
if
_uno_rest POST
"my/products/
$h
/dns/records"
"{
\"
name
\"
:
\"
$fulldomain
\"
,
\"
type
\"
:
\"
TXT
\"
,
\"
data
\"
:
\"
$txtvalue
\"
,
\"
ttl
\"
:120}"
;
then
if
_uno_rest POST
"my/products/
$h
/dns/records"
"{
\"
name
\"
:
\"
$fulldomain
\"
,
\"
type
\"
:
\"
TXT
\"
,
\"
data
\"
:
\"
$txtvalue
\"
,
\"
ttl
\"
:120
,
\"
priority
\"
:0
}"
;
then
if
_contains
"
$response
"
"
\"
status
\"
: 200"
>
/dev/null
;
then
_info
"Added, OK"
return
0
...
...
dnsapi/dns_zone.sh
View file @
cc4bce28
...
...
@@ -136,10 +136,10 @@ _get_root() {
if
[
-z
"
$h
"
]
;
then
return
1
fi
if
!
_zone_rest GET
"dns/
$h
/a
"
;
then
if
!
_zone_rest GET
"dns/
$h
"
;
then
return
1
fi
if
_contains
"
$response
"
"
\"
name
\"
:
\"
$h
\"
"
>
/dev/null
;
then
if
_contains
"
$response
"
"
\"
identificator
\"
:
\"
$h
\"
"
>
/dev/null
;
then
_domain
=
$h
return
0
fi
...
...
Prev
1
2
Next
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