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
8636a156
Commit
8636a156
authored
Dec 18, 2016
by
neil
Committed by
GitHub
Dec 18, 2016
Browse files
Merge pull request #473 from Neilpang/dev
Dev
parents
f9085fed
f81f93e9
Changes
15
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
8636a156
...
@@ -321,7 +321,7 @@ acme.sh --renew -d example.com --force --ecc
...
@@ -321,7 +321,7 @@ acme.sh --renew -d example.com --force --ecc
# 11. How to upgrade `acme.sh`
# 11. How to upgrade `acme.sh`
acme.sh is in constant develop
e
ment, so it's strongly recommended to use the latest code.
acme.sh is in constant development, so it's strongly recommended to use the latest code.
You can update acme.sh to the latest code:
You can update acme.sh to the latest code:
...
...
acme.sh
View file @
8636a156
...
@@ -406,8 +406,10 @@ _getfile() {
...
@@ -406,8 +406,10 @@ _getfile() {
#Usage: multiline
#Usage: multiline
_base64
()
{
_base64
()
{
if
[
"
$1
"
]
;
then
if
[
"
$1
"
]
;
then
_debug3
"base64 multiline:'
$1
'"
$OPENSSL_BIN
base64
-e
$OPENSSL_BIN
base64
-e
else
else
_debug3
"base64 single line."
$OPENSSL_BIN
base64
-e
|
tr
-d
'\r\n'
$OPENSSL_BIN
base64
-e
|
tr
-d
'\r\n'
fi
fi
}
}
...
@@ -932,6 +934,8 @@ _calcjwk() {
...
@@ -932,6 +934,8 @@ _calcjwk() {
modulus
=
$(
$OPENSSL_BIN
rsa
-in
"
$keyfile
"
-modulus
-noout
|
cut
-d
'='
-f
2
)
modulus
=
$(
$OPENSSL_BIN
rsa
-in
"
$keyfile
"
-modulus
-noout
|
cut
-d
'='
-f
2
)
_debug3 modulus
"
$modulus
"
_debug3 modulus
"
$modulus
"
n
=
"
$(
printf
"%s"
"
$modulus
"
| _h2b | _base64 | _urlencode
)
"
n
=
"
$(
printf
"%s"
"
$modulus
"
| _h2b | _base64 | _urlencode
)
"
_debug3 n
"
$n
"
jwk
=
'{"e": "'
$e
'", "kty": "RSA", "n": "'
$n
'"}'
jwk
=
'{"e": "'
$e
'", "kty": "RSA", "n": "'
$n
'"}'
_debug3 jwk
"
$jwk
"
_debug3 jwk
"
$jwk
"
...
@@ -1913,7 +1917,7 @@ _setApache() {
...
@@ -1913,7 +1917,7 @@ _setApache() {
fi
fi
_info
"JFYI, Config file
$httpdconf
is backuped to
$APACHE_CONF_BACKUP_DIR
/
$httpdconfname
"
_info
"JFYI, Config file
$httpdconf
is backuped to
$APACHE_CONF_BACKUP_DIR
/
$httpdconfname
"
_info
"In case there is an error that can not be restored automatically, you may try restore it yourself."
_info
"In case there is an error that can not be restored automatically, you may try restore it yourself."
_info
"The backup file will be deleted on sucess, just forget it."
_info
"The backup file will be deleted on suc
c
ess, just forget it."
#add alias
#add alias
...
@@ -3780,7 +3784,7 @@ install() {
...
@@ -3780,7 +3784,7 @@ install() {
if
[
-z
"
$NO_DETECT_SH
"
]
;
then
if
[
-z
"
$NO_DETECT_SH
"
]
;
then
#Modify shebang
#Modify shebang
if
_exists bash
;
then
if
_exists bash
;
then
_info
"Good, bash is found, so change the shebang to use bash as prefered."
_info
"Good, bash is found, so change the shebang to use bash as prefer
r
ed."
_shebang
=
'#!/usr/bin/env bash'
_shebang
=
'#!/usr/bin/env bash'
_setShebang
"
$LE_WORKING_DIR
/
$PROJECT_ENTRY
"
"
$_shebang
"
_setShebang
"
$LE_WORKING_DIR
/
$PROJECT_ENTRY
"
"
$_shebang
"
for
subf
in
$_SUB_FOLDERS
;
do
for
subf
in
$_SUB_FOLDERS
;
do
...
...
dnsapi/dns_ali.sh
View file @
8636a156
...
@@ -35,7 +35,7 @@ dns_ali_rm() {
...
@@ -35,7 +35,7 @@ dns_ali_rm() {
_clean
_clean
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
_get_root
()
{
_get_root
()
{
domain
=
$1
domain
=
$1
...
...
dnsapi/dns_aws.sh
View file @
8636a156
...
@@ -42,7 +42,7 @@ dns_aws_add() {
...
@@ -42,7 +42,7 @@ dns_aws_add() {
_aws_tmpl_xml
=
"<ChangeResourceRecordSetsRequest xmlns=
\"
https://route53.amazonaws.com/doc/2013-04-01/
\"
><ChangeBatch><Changes><Change><Action>UPSERT</Action><ResourceRecordSet><Name>
$fulldomain
</Name><Type>TXT</Type><TTL>300</TTL><ResourceRecords><ResourceRecord><Value>
\"
$txtvalue
\"
</Value></ResourceRecord></ResourceRecords></ResourceRecordSet></Change></Changes></ChangeBatch></ChangeResourceRecordSetsRequest>"
_aws_tmpl_xml
=
"<ChangeResourceRecordSetsRequest xmlns=
\"
https://route53.amazonaws.com/doc/2013-04-01/
\"
><ChangeBatch><Changes><Change><Action>UPSERT</Action><ResourceRecordSet><Name>
$fulldomain
</Name><Type>TXT</Type><TTL>300</TTL><ResourceRecords><ResourceRecord><Value>
\"
$txtvalue
\"
</Value></ResourceRecord></ResourceRecords></ResourceRecordSet></Change></Changes></ChangeBatch></ChangeResourceRecordSetsRequest>"
if
aws_rest POST
"2013-04-01
$_domain_id
/rrset/"
""
"
$_aws_tmpl_xml
"
&&
_contains
"
$response
"
"ChangeResourceRecordSetsResponse"
;
then
if
aws_rest POST
"2013-04-01
$_domain_id
/rrset/"
""
"
$_aws_tmpl_xml
"
&&
_contains
"
$response
"
"ChangeResourceRecordSetsResponse"
;
then
_info
"txt record updated sucess."
_info
"txt record updated suc
c
ess."
return
0
return
0
fi
fi
...
@@ -66,7 +66,7 @@ dns_aws_rm() {
...
@@ -66,7 +66,7 @@ dns_aws_rm() {
_aws_tmpl_xml
=
"<ChangeResourceRecordSetsRequest xmlns=
\"
https://route53.amazonaws.com/doc/2013-04-01/
\"
><ChangeBatch><Changes><Change><Action>DELETE</Action><ResourceRecordSet><ResourceRecords><ResourceRecord><Value>
\"
$txtvalue
\"
</Value></ResourceRecord></ResourceRecords><Name>
$fulldomain
.</Name><Type>TXT</Type><TTL>300</TTL></ResourceRecordSet></Change></Changes></ChangeBatch></ChangeResourceRecordSetsRequest>"
_aws_tmpl_xml
=
"<ChangeResourceRecordSetsRequest xmlns=
\"
https://route53.amazonaws.com/doc/2013-04-01/
\"
><ChangeBatch><Changes><Change><Action>DELETE</Action><ResourceRecordSet><ResourceRecords><ResourceRecord><Value>
\"
$txtvalue
\"
</Value></ResourceRecord></ResourceRecords><Name>
$fulldomain
.</Name><Type>TXT</Type><TTL>300</TTL></ResourceRecordSet></Change></Changes></ChangeBatch></ChangeResourceRecordSetsRequest>"
if
aws_rest POST
"2013-04-01
$_domain_id
/rrset/"
""
"
$_aws_tmpl_xml
"
&&
_contains
"
$response
"
"ChangeResourceRecordSetsResponse"
;
then
if
aws_rest POST
"2013-04-01
$_domain_id
/rrset/"
""
"
$_aws_tmpl_xml
"
&&
_contains
"
$response
"
"ChangeResourceRecordSetsResponse"
;
then
_info
"txt record deleted sucess."
_info
"txt record deleted suc
c
ess."
return
0
return
0
fi
fi
...
@@ -74,7 +74,7 @@ dns_aws_rm() {
...
@@ -74,7 +74,7 @@ dns_aws_rm() {
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
_get_root
()
{
_get_root
()
{
domain
=
$1
domain
=
$1
...
...
dnsapi/dns_cf.sh
View file @
8636a156
...
@@ -120,7 +120,7 @@ dns_cf_rm() {
...
@@ -120,7 +120,7 @@ dns_cf_rm() {
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
#_acme-challenge.www.domain.com
#_acme-challenge.www.domain.com
#returns
#returns
# _sub_domain=_acme-challenge.www
# _sub_domain=_acme-challenge.www
...
...
dnsapi/dns_cx.sh
View file @
8636a156
...
@@ -131,7 +131,7 @@ update_record() {
...
@@ -131,7 +131,7 @@ update_record() {
return
1
return
1
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
#_acme-challenge.www.domain.com
#_acme-challenge.www.domain.com
#returns
#returns
# _sub_domain=_acme-challenge.www
# _sub_domain=_acme-challenge.www
...
...
dnsapi/dns_dp.sh
View file @
8636a156
...
@@ -158,7 +158,7 @@ update_record() {
...
@@ -158,7 +158,7 @@ update_record() {
return
1
#error
return
1
#error
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
#_acme-challenge.www.domain.com
#_acme-challenge.www.domain.com
#returns
#returns
# _sub_domain=_acme-challenge.www
# _sub_domain=_acme-challenge.www
...
...
dnsapi/dns_gd.sh
View file @
8636a156
...
@@ -59,7 +59,7 @@ dns_gd_rm() {
...
@@ -59,7 +59,7 @@ dns_gd_rm() {
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
#_acme-challenge.www.domain.com
#_acme-challenge.www.domain.com
#returns
#returns
# _sub_domain=_acme-challenge.www
# _sub_domain=_acme-challenge.www
...
...
dnsapi/dns_ispconfig.sh
View file @
8636a156
...
@@ -30,7 +30,7 @@ dns_ispconfig_rm() {
...
@@ -30,7 +30,7 @@ dns_ispconfig_rm() {
_ISPC_credentials
&&
_ISPC_login
&&
_ISPC_rmTxt
_ISPC_credentials
&&
_ISPC_login
&&
_ISPC_rmTxt
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
_ISPC_credentials
()
{
_ISPC_credentials
()
{
if
[
-z
"
${
ISPC_User
}
"
]
||
[
-z
"
$ISPC_Password
"
]
||
[
-z
"
${
ISPC_Api
}
"
]
||
[
-z
"
${
ISPC_Api_Insecure
}
"
]
;
then
if
[
-z
"
${
ISPC_User
}
"
]
||
[
-z
"
$ISPC_Password
"
]
||
[
-z
"
${
ISPC_Api
}
"
]
||
[
-z
"
${
ISPC_Api_Insecure
}
"
]
;
then
...
...
dnsapi/dns_lua.sh
View file @
8636a156
...
@@ -84,7 +84,7 @@ dns_lua_rm() {
...
@@ -84,7 +84,7 @@ dns_lua_rm() {
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
#_acme-challenge.www.domain.com
#_acme-challenge.www.domain.com
#returns
#returns
# _sub_domain=_acme-challenge.www
# _sub_domain=_acme-challenge.www
...
...
dnsapi/dns_me.sh
View file @
8636a156
...
@@ -81,7 +81,7 @@ dns_me_rm() {
...
@@ -81,7 +81,7 @@ dns_me_rm() {
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
#_acme-challenge.www.domain.com
#_acme-challenge.www.domain.com
#returns
#returns
# _sub_domain=_acme-challenge.www
# _sub_domain=_acme-challenge.www
...
...
dnsapi/dns_myapi.sh
View file @
8636a156
...
@@ -23,7 +23,7 @@ dns_myapi_add() {
...
@@ -23,7 +23,7 @@ dns_myapi_add() {
}
}
#Usage: fulldomain txtvalue
#Usage: fulldomain txtvalue
#Remove the txt record afer validation.
#Remove the txt record af
t
er validation.
dns_myapi_rm
()
{
dns_myapi_rm
()
{
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
...
@@ -32,4 +32,4 @@ dns_myapi_rm() {
...
@@ -32,4 +32,4 @@ dns_myapi_rm() {
_debug txtvalue
"
$txtvalue
"
_debug txtvalue
"
$txtvalue
"
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
dnsapi/dns_nsupdate.sh
View file @
8636a156
...
@@ -44,7 +44,7 @@ EOF
...
@@ -44,7 +44,7 @@ EOF
return
0
return
0
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
_checkKeyFile
()
{
_checkKeyFile
()
{
if
[
-z
"
${
NSUPDATE_KEY
}
"
]
;
then
if
[
-z
"
${
NSUPDATE_KEY
}
"
]
;
then
...
...
dnsapi/dns_ovh.sh
View file @
8636a156
...
@@ -182,7 +182,7 @@ dns_ovh_rm() {
...
@@ -182,7 +182,7 @@ dns_ovh_rm() {
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
_ovh_authentication
()
{
_ovh_authentication
()
{
...
...
dnsapi/dns_pdns.sh
View file @
8636a156
...
@@ -130,7 +130,7 @@ notify_slaves() {
...
@@ -130,7 +130,7 @@ notify_slaves() {
return
0
return
0
}
}
#################### Private functions bel
l
ow ##################################
#################### Private functions below ##################################
#_acme-challenge.www.domain.com
#_acme-challenge.www.domain.com
#returns
#returns
# _domain=domain.com
# _domain=domain.com
...
...
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