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
b2817897
Commit
b2817897
authored
Apr 16, 2016
by
neil
Browse files
add `--certhome` for `--install` command to save all the certs.
parent
5ef501c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
b2817897
...
@@ -148,6 +148,7 @@ Parameters:
...
@@ -148,6 +148,7 @@ Parameters:
--accountconf Specifies a customized account config file.
--accountconf Specifies a customized account config file.
--home Specifies the home dir for acme.sh .
--home Specifies the home dir for acme.sh .
--certhome Specifies the home dir to save all the certs, only valid for '--install' command.
--useragent Specifies the user agent string. it will be saved for future use too.
--useragent Specifies the user agent string. it will be saved for future use too.
--accountemail Specifies the account email for registering, Only valid for the '--install' command.
--accountemail Specifies the account email for registering, Only valid for the '--install' command.
--accountkey Specifies the account key path, Only valid for the '--install' command.
--accountkey Specifies the account key path, Only valid for the '--install' command.
...
...
acme.sh
View file @
b2817897
...
@@ -740,18 +740,24 @@ _initpath() {
...
@@ -740,18 +740,24 @@ _initpath() {
if
[[
"
$DEBUG
"
-ge
"2"
]]
;
then
if
[[
"
$DEBUG
"
-ge
"2"
]]
;
then
CURL
=
"
$CURL
-L --trace-ascii
$dp
"
CURL
=
"
$CURL
-L --trace-ascii
$dp
"
fi
fi
domain
=
"
$1
"
_DEFAULT_ACCOUNT_KEY_PATH
=
"
$LE_WORKING_DIR
/account.key"
if
[[
-z
"
$ACCOUNT_KEY_PATH
"
]]
;
then
if
[[
-z
"
$ACCOUNT_KEY_PATH
"
]]
;
then
ACCOUNT_KEY_PATH
=
"
$
LE_WORKING_DIR
/account.key
"
ACCOUNT_KEY_PATH
=
"
$
_DEFAULT_ACCOUNT_KEY_PATH
"
fi
fi
domain
=
"
$1
"
if
[[
-z
"
$domain
"
]]
;
then
if
[[
-z
"
$domain
"
]]
;
then
return
0
return
0
fi
fi
domainhome
=
"
$LE_WORKING_DIR
/
$domain
"
_DEFAULT_CERT_HOME
=
"
$LE_WORKING_DIR
"
if
[[
-z
"
$CERT_HOME
"
]]
;
then
CERT_HOME
=
"
$_DEFAULT_CERT_HOME
"
fi
domainhome
=
"
$CERT_HOME
/
$domain
"
mkdir
-p
"
$domainhome
"
mkdir
-p
"
$domainhome
"
if
[[
-z
"
$DOMAIN_PATH
"
]]
;
then
if
[[
-z
"
$DOMAIN_PATH
"
]]
;
then
...
@@ -1428,7 +1434,7 @@ renewAll() {
...
@@ -1428,7 +1434,7 @@ renewAll() {
_initpath
_initpath
_info
"renewAll"
_info
"renewAll"
for
d
in
$(
ls
-F
${
LE_WORKING_DIR
}
/ |
grep
[
^.].
*
[
.].
*
/
$
)
;
do
for
d
in
$(
ls
-F
${
CERT_HOME
}
/ |
grep
[
^.].
*
[
.].
*
/
$
)
;
do
d
=
$(
echo
$d
|
cut
-d
'/'
-f
1
)
d
=
$(
echo
$d
|
cut
-d
'/'
-f
1
)
_info
"renew
$d
"
_info
"renew
$d
"
...
@@ -1679,6 +1685,7 @@ _initconf() {
...
@@ -1679,6 +1685,7 @@ _initconf() {
#ACCOUNT_EMAIL=aaa@aaa.com # the account email used to register account.
#ACCOUNT_EMAIL=aaa@aaa.com # the account email used to register account.
#ACCOUNT_KEY_PATH=
\"
/path/to/account.key
\"
#ACCOUNT_KEY_PATH=
\"
/path/to/account.key
\"
#CERT_HOME=
\"
/path/to/cert/home
\"
#STAGE=1 # Use the staging api
#STAGE=1 # Use the staging api
#FORCE=1 # Force to issue cert
#FORCE=1 # Force to issue cert
...
@@ -1829,6 +1836,14 @@ install() {
...
@@ -1829,6 +1836,14 @@ install() {
_setopt
"
$_DEFAULT_ACCOUNT_CONF_PATH
"
"ACCOUNT_CONF_PATH"
"="
"
\"
$ACCOUNT_CONF_PATH
\"
"
_setopt
"
$_DEFAULT_ACCOUNT_CONF_PATH
"
"ACCOUNT_CONF_PATH"
"="
"
\"
$ACCOUNT_CONF_PATH
\"
"
fi
fi
if
[[
"
$_DEFAULT_CERT_HOME
"
!=
"
$CERT_HOME
"
]]
;
then
_saveaccountconf
"CERT_HOME"
"
$CERT_HOME
"
fi
if
[[
"
$_DEFAULT_ACCOUNT_KEY_PATH
"
!=
"
$ACCOUNT_KEY_PATH
"
]]
;
then
_saveaccountconf
"ACCOUNT_KEY_PATH"
"
$ACCOUNT_KEY_PATH
"
fi
installcronjob
installcronjob
_info OK
_info OK
...
@@ -1906,6 +1921,7 @@ Parameters:
...
@@ -1906,6 +1921,7 @@ Parameters:
--accountconf Specifies a customized account config file.
--accountconf Specifies a customized account config file.
--home Specifies the home dir for
$PROJECT_NAME
.
--home Specifies the home dir for
$PROJECT_NAME
.
--certhome Specifies the home dir to save all the certs.
--useragent Specifies the user agent string. it will be saved for future use too.
--useragent Specifies the user agent string. it will be saved for future use too.
--accountemail Specifies the account email for registering, Only valid for the '--install' command.
--accountemail Specifies the account email for registering, Only valid for the '--install' command.
--accountkey Specifies the account key path, Only valid for the '--install' command.
--accountkey Specifies the account key path, Only valid for the '--install' command.
...
@@ -1958,6 +1974,7 @@ _process() {
...
@@ -1958,6 +1974,7 @@ _process() {
_useragent
=
""
_useragent
=
""
_accountemail
=
""
_accountemail
=
""
_accountkey
=
""
_accountkey
=
""
_certhome
=
""
while
((
${#}
))
;
do
while
((
${#}
))
;
do
case
"
${
1
}
"
in
case
"
${
1
}
"
in
...
@@ -2127,6 +2144,11 @@ _process() {
...
@@ -2127,6 +2144,11 @@ _process() {
LE_WORKING_DIR
=
"
$2
"
LE_WORKING_DIR
=
"
$2
"
shift
shift
;;
;;
--certhome
)
_certhome
=
"
$2
"
CERT_HOME
=
"
$_certhome
"
shift
;;
--useragent
)
--useragent
)
_useragent
=
"
$2
"
_useragent
=
"
$2
"
USER_AGENT
=
"
$_useragent
"
USER_AGENT
=
"
$_useragent
"
...
@@ -2204,9 +2226,7 @@ _process() {
...
@@ -2204,9 +2226,7 @@ _process() {
if
[[
"
$_accountemail
"
]]
;
then
if
[[
"
$_accountemail
"
]]
;
then
_saveaccountconf
"ACCOUNT_EMAIL"
"
$_accountemail
"
_saveaccountconf
"ACCOUNT_EMAIL"
"
$_accountemail
"
fi
fi
if
[[
"
$_accountkey
"
]]
;
then
_saveaccountconf
"ACCOUNT_KEY_PATH"
"
$_accountkey
"
fi
}
}
...
...
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