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
6ff3f5d1
Unverified
Commit
6ff3f5d1
authored
Jun 19, 2019
by
neil
Committed by
GitHub
Jun 19, 2019
Browse files
Merge pull request #2346 from Neilpang/dev
sync
parents
803b67af
a2738e85
Changes
4
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
6ff3f5d1
...
@@ -4785,6 +4785,7 @@ renewAll() {
...
@@ -4785,6 +4785,7 @@ renewAll() {
fi
fi
done
done
_debug _error_level
"
$_error_level
"
_debug _error_level
"
$_error_level
"
_debug _set_level
"
$_set_level
"
if
[
"
$ACME_IN_CRON
"
]
&&
[
$_error_level
-le
$_set_level
]
;
then
if
[
"
$ACME_IN_CRON
"
]
&&
[
$_error_level
-le
$_set_level
]
;
then
if
[
-z
"
$NOTIFY_MODE
"
]
||
[
"
$NOTIFY_MODE
"
=
"
$NOTIFY_MODE_BULK
"
]
;
then
if
[
-z
"
$NOTIFY_MODE
"
]
||
[
"
$NOTIFY_MODE
"
=
"
$NOTIFY_MODE_BULK
"
]
;
then
_msg_subject
=
"Renew"
_msg_subject
=
"Renew"
...
...
deploy/routeros.sh
View file @
6ff3f5d1
...
@@ -85,30 +85,27 @@ routeros_deploy() {
...
@@ -85,30 +85,27 @@ routeros_deploy() {
scp
"
$_ckey
"
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
:
$_cdomain
.key"
scp
"
$_ckey
"
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
:
$_cdomain
.key"
_info
"Trying to push cert '
$_cfullchain
' to router"
_info
"Trying to push cert '
$_cfullchain
' to router"
scp
"
$_cfullchain
"
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
:
$_cdomain
.cer"
scp
"
$_cfullchain
"
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
:
$_cdomain
.cer"
DEPLOY_SCRIPT_CMD
=
"/system script add name=
\"
LE Cert Deploy -
$_cdomain
\"
owner=admin policy=ftp,read,write,password,sensitive
source=
\"
## generated by routeros deploy script in acme.sh
\n
/certificate remove [ find name=
$_cdomain
.cer_0 ]
\n
/certificate remove [ find name=
$_cdomain
.cer_1 ]
\n
delay 1
\n
/certificate import file-name=
$_cdomain
.cer passphrase=
\\\"\\\"
\n
/certificate import file-name=
$_cdomain
.key passphrase=
\\\"\\\"
\n
delay 1
\n
/file remove
$_cdomain
.cer
\n
/file remove
$_cdomain
.key
\n
delay 2
\n
/ip service set www-ssl certificate=
$_cdomain
.cer_0
\n
$ROUTER_OS_ADDITIONAL_SERVICES
\n\"
"
# shellcheck disable=SC2029
# shellcheck disable=SC2029
ssh
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
"
bash
-c
"'
ssh
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
"
"
$DEPLOY_SCRIPT_CMD
"
# shellcheck disable=SC2029
/certificate remove
$_cdomain
.cer_0
ssh
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
"
"/system script run
\"
LE Cert Deploy -
$_cdomain
\"
"
# shellcheck disable=SC2029
/certificate remove
$_cdomain
.cer_1
ssh
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
"
"/system script remove
\"
LE Cert Deploy -
$_cdomain
\"
"
delay 1
/certificate import file-name=
$_cdomain
.cer passphrase=
\"\"
/certificate import file-name=
$_cdomain
.key passphrase=
\"\"
delay 1
/file remove
$_cdomain
.cer
/file remove
$_cdomain
.key
delay 2
/ip service set www-ssl certificate=
$_cdomain
.cer_0
$ROUTER_OS_ADDITIONAL_SERVICES
'"
return
0
return
0
}
}
dnsapi/dns_ovh.sh
View file @
6ff3f5d1
...
@@ -121,7 +121,7 @@ _initAuth() {
...
@@ -121,7 +121,7 @@ _initAuth() {
_info
"Checking authentication"
_info
"Checking authentication"
if
!
_ovh_rest GET
"domain"
||
_contains
"
$response
"
"INVALID_CREDENTIAL"
;
then
if
!
_ovh_rest GET
"domain"
||
_contains
"
$response
"
"INVALID_CREDENTIAL"
||
_contains
"
$response
"
"NOT_CREDENTIAL"
;
then
_err
"The consumer key is invalid:
$OVH_CK
"
_err
"The consumer key is invalid:
$OVH_CK
"
_err
"Please retry to create a new one."
_err
"Please retry to create a new one."
_clearaccountconf OVH_CK
_clearaccountconf OVH_CK
...
...
dnsapi/dns_regru.sh
0 → 100644
View file @
6ff3f5d1
#!/usr/bin/env sh
#
# REGRU_API_Username="test"
#
# REGRU_API_Password="test"
#
_domain
=
$_domain
REGRU_API_URL
=
"https://api.reg.ru/api/regru2"
######## Public functions #####################
dns_regru_add
()
{
fulldomain
=
$1
txtvalue
=
$2
REGRU_API_Username
=
"
${
REGRU_API_Username
:-
$(
_readaccountconf_mutable REGRU_API_Username
)
}
"
REGRU_API_Password
=
"
${
REGRU_API_Password
:-
$(
_readaccountconf_mutable REGRU_API_Password
)
}
"
if
[
-z
"
$REGRU_API_Username
"
]
||
[
-z
"
$REGRU_API_Password
"
]
;
then
REGRU_API_Username
=
""
REGRU_API_Password
=
""
_err
"You don't specify regru password or username."
return
1
fi
_saveaccountconf_mutable REGRU_API_Username
"
$REGRU_API_Username
"
_saveaccountconf_mutable REGRU_API_Password
"
$REGRU_API_Password
"
_info
"Adding TXT record to
${
fulldomain
}
"
response
=
"
$(
_get
"
$REGRU_API_URL
/zone/add_txt?input_data={%22username%22:%22
${
REGRU_API_Username
}
%22,%22password%22:%22
${
REGRU_API_Password
}
%22,%22domains%22:[{%22dname%22:%22
${
_domain
}
%22}],%22subdomain%22:%22_acme-challenge%22,%22text%22:%22
${
txtvalue
}
%22,%22output_content_type%22:%22plain%22}&input_format=json"
)
"
if
_contains
"
${
response
}
"
'success'
;
then
return
0
fi
_err
"Could not create resource record, check logs"
_err
"
${
response
}
"
return
1
}
dns_regru_rm
()
{
fulldomain
=
$1
txtvalue
=
$2
REGRU_API_Username
=
"
${
REGRU_API_Username
:-
$(
_readaccountconf_mutable REGRU_API_Username
)
}
"
REGRU_API_Password
=
"
${
REGRU_API_Password
:-
$(
_readaccountconf_mutable REGRU_API_Password
)
}
"
if
[
-z
"
$REGRU_API_Username
"
]
||
[
-z
"
$REGRU_API_Password
"
]
;
then
REGRU_API_Username
=
""
REGRU_API_Password
=
""
_err
"You don't specify regru password or username."
return
1
fi
_info
"Deleting resource record
$fulldomain
"
response
=
"
$(
_get
"
$REGRU_API_URL
/zone/remove_record?input_data={%22username%22:%22
${
REGRU_API_Username
}
%22,%22password%22:%22
${
REGRU_API_Password
}
%22,%22domains%22:[{%22dname%22:%22
${
_domain
}
%22}],%22subdomain%22:%22_acme-challenge%22,%22content%22:%22
${
txtvalue
}
%22,%22record_type%22:%22TXT%22,%22output_content_type%22:%22plain%22}&input_format=json"
)
"
if
_contains
"
${
response
}
"
'success'
;
then
return
0
fi
_err
"Could not delete resource record, check logs"
_err
"
${
response
}
"
return
1
}
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