- if [ "$TRAVIS_OS_NAME" = "linux" ]; then curl -sSL $SHFMT_URL -o ~/shfmt ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then chmod +x ~/shfmt ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ~/shfmt -l -w -i 2 . ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then curl -sSL $SHFMT_URL -o ~/shfmt && chmod +x ~/shfmt && ~/shfmt -l -w -i 2 . ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then git diff --exit-code && echo "shfmt OK" ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then shellcheck -V ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then shellcheck -e SC2181 **/*.sh && echo "shellcheck OK" ; fi
@ -40,7 +32,6 @@ script:
- if [ "$TRAVIS_OS_NAME" = "linux" -a "$NGROK_TOKEN" ]; then sudo TEST_LOCAL="$TEST_LOCAL" NGROK_TOKEN="$NGROK_TOKEN" ./rundocker.sh testplat ubuntu:latest ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" -a "$NGROK_TOKEN" ]; then sudo TEST_LOCAL="$TEST_LOCAL" NGROK_TOKEN="$NGROK_TOKEN" ACME_OPENSSL_BIN="$ACME_OPENSSL_BIN" ./letest.sh ; fi
@ -204,6 +207,8 @@ Install/copy the cert/key to the production Apache or Nginx path.
The cert will be renewed every **60** days by default (which is configurable). Once the cert is renewed, the Apache/Nginx service will be reloaded automatically by the command: `service apache2 force-reload` or `service nginx force-reload`.
**Please take care: The reloadcmd is very important. The cert can be automatically renewed, but, without a correct 'reloadcmd' the cert may not be flushed to your server(like nginx or apache), then your website will not be able to show renewed cert in 60 days.**
# 4. Use Standalone server to issue cert
**(requires you to be root/sudoer or have permission to listen on port 80 (TCP))**
_info "Installed to $LE_WORKING_DIR/$PROJECT_ENTRY"
if["$IN_CRON" !="1"];then
if["$IN_CRON" !="1"]&&[ -z "$_noprofile"];then
_installalias "$_c_home"
fi
@ -5293,6 +5455,8 @@ Commands:
Parameters:
--domain, -d domain.tld Specifies a domain, used to issue, renew or revoke etc.
--challenge-alias domain.tld The challenge domain aliasfor DNS alias mode: $_DNS_ALIAS_WIKI
--domain-alias domain.tld The domain aliasfor DNS alias mode: $_DNS_ALIAS_WIKI
--force, -f Used to force to install or force to renew a cert immediately.
--staging, --test Use staging server, just for test.
--debug Output debug info.
@ -5300,7 +5464,6 @@ Parameters:
--webroot, -w /path/to/webroot Specifies the web root folder for web root mode.
--standalone Use standalone mode.
--stateless Use stateless mode, see: $_STATELESS_WIKI
--tls Use standalone tls mode.
--apache Use apache mode.
--dns [dns_cf|dns_dp|dns_cx|/path/to/api/file] Use dns mode or dns api.
--dnssleep [$DEFAULT_DNS_SLEEP] The time in seconds to waitfor all the txt records to take effect in dns api mode. Default $DEFAULT_DNS_SLEEP seconds.
@ -5326,11 +5489,10 @@ Parameters:
--cert-home Specifies the home dir to save all the certs, only valid for'--install' command.
--config-home Specifies the home dir to save all the configurations.
--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.
--accountkey Specifies the account key path, Only valid for the '--install' command.
--accountemail Specifies the account email, only valid for the '--install' and '--update-account' command.
--accountkey Specifies the account key path, only valid for the '--install' command.
--days Specifies the days to renew the cert when using '--issue' command. The max value is $MAX_RENEW days.
--httpport Specifies the standalone listening port. Only valid if the server is behind a reverse proxy or load balancer.
--tlsport Specifies the standalone tls listening port. Only valid if the server is behind a reverse proxy or load balancer.
--local-address Specifies the standalone/tls server listening address, in case you have multiple ip addresses.
--listraw Only used for'--list' command, list the certs in raw format.
--stopRenewOnError, -se Only valid for'--renew-all' command. Stop if one cert has error in renewal.
@ -5339,6 +5501,7 @@ Parameters:
--ca-path Specifies directory containing CA certificates in PEM format, used by wget or curl.
--nocron Only valid for'--install' command, which means: do not install the default cron job. In this case, the certs will not be renewed automatically.
--no-color Do not output color text.
--force-color Force output of color text. Useful for non-interactive use with the aha tool for HTML E-Mails.
--ecc Specifies to use the ECC cert. Valid for'--install-cert', '--renew', '--revoke', '--toPkcs' and '--createCSR'
--csr Specifies the input csr.
--pre-hook Command to be run before obtaining any certificates.
@ -5352,13 +5515,16 @@ Parameters:
--listen-v6 Force standalone/tls server to listen at ipv6.
--openssl-bin Specifies a custom openssl bin location.
--use-wget Force to use wget, if you have both curl and wget installed.
--yes-I-know-dns-manual-mode-enough-go-ahead-please Force to use dns manual mode: $_DNS_MANUAL_WIKI
--branch, -b Only valid for'--upgrade' command, specifies the branch name to upgrade to.
"
}
# nocron
# nocron noprofile
_installOnline(){
_info "Installing from online archive."
_nocron="$1"
_noprofile="$2"
if[ ! "$BRANCH"];then
BRANCH="master"
fi
@ -5379,7 +5545,7 @@ _installOnline() {
cd"$PROJECT_NAME-$BRANCH"
chmod +x $PROJECT_ENTRY
if ./$PROJECT_ENTRY install "$_nocron";then
if ./$PROJECT_ENTRY install "$_nocron""""$_noprofile";then
Please note, that the cpanel_uapi hook will deploy only the first domain when your certificate will automatically renew. Therefore you should issue a separete certificate for each domain.
Please note, that the cpanel_uapi hook will deploy only the first domain when your certificate will automatically renew. Therefore you should issue a separate certificate for each domain.
The path for the PEM file will be stored with the domain configuration and will be available when renewing, so that deploy will happen automatically when renewed.
You need to set the HTTP API user ID and password credentials. See: https://www.cloudns.net/wiki/article/42/
You need to set the HTTP API user ID and password credentials. See: https://www.cloudns.net/wiki/article/42/. For security reasons, it's recommended to use a sub user ID that only has access to the necessary zones, as a regular API user has access to your entire account.
```
export CLOUDNS_AUTH_ID=XXXXX
# Use this for a sub auth ID
export CLOUDNS_SUB_AUTH_ID=XXXXX
# Use this for a regular auth ID
#export CLOUDNS_AUTH_ID=XXXXX
export CLOUDNS_AUTH_PASSWORD="YYYYYYYYY"
```
@ -522,8 +531,9 @@ For issues, please report to https://github.com/raidenii/acme.sh/issues.
## 28. Use Name.com API
You'll need to fill out the form at https://www.name.com/reseller/apply to apply
for API username and token.
Create your API token here: https://www.name.com/account/settings/api
Note: `Namecom_Username` should be your Name.com username and not the token name. If you accidentally run the script with the token name as the username see `~/.acme.sh/account.conf` to fix the issue
```
export Namecom_Username="testuser"
@ -585,7 +595,7 @@ For issues, please report to https://github.com/non7top/acme.sh/issues.
## 31. Use Hurricane Electric
Hurricane Electric doesn't have an API so just set your login credentials like so:
Hurricane Electric (https://dns.he.net/) doesn't have an API so just set your login credentials like so:
Set `DA_Api_Insecure` to 1 for insecure and 0 for secure -> difference is whether ssl cert is checked for validity (0) or whether it is just accepted (1)
if ! aws_rest GET "2013-04-01$_domain_id/rrset""name=$fulldomain&type=TXT";then
return1
fi
if _contains "$response""<Name>$fulldomain.</Name>";then
_resource_record="$(echo"$response"| sed 's/<ResourceRecordSet>/"/g'| tr '"'"\n"| grep "<Name>$fulldomain.</Name>"| _egrep_o "<ResourceRecords.*</ResourceRecords>"| sed "s/<ResourceRecords>//"| sed "s#</ResourceRecords>##")"
if ! aws_rest GET "2013-04-01$_domain_id/rrset""name=$fulldomain&type=TXT";then
return1
fi
if _contains "$response""<Name>$fulldomain.</Name>";then
_resource_record="$(echo"$response"| sed 's/<ResourceRecordSet>/"/g'| tr '"'"\n"| grep "<Name>$fulldomain.</Name>"| _egrep_o "<ResourceRecords.*</ResourceRecords>"| sed "s/<ResourceRecords>//"| sed "s#</ResourceRecords>##")"
_err "access denied make sure your Azure settings are correct. See $WIKI"
return1
fi
# See https://docs.microsoft.com/en-us/azure/architecture/best-practices/retry-service-specific#general-rest-and-retry-guidelines for retryable HTTP codes
## Per https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits#dns-limits you are limited to 100 Zone/subscriptions anyways
##
_azure_rest GET "https://management.azure.com/subscriptions/$subscriptionId/providers/Microsoft.Network/dnszones?api-version=2017-09-01""""$accesstoken"
# Find matching domain name is Json response
while true;do
h=$(printf"%s""$domain"| cut -d . -f $i-100)
@ -234,9 +328,14 @@ _get_root() {
fi
if _contains "$response""\"name\":\"$h\"" >/dev/null;then
if _rest PUT "record/$record_id""{\"domain_id\": $_domain_id, \"host\":\"$_sub_domain\", \"value\":\"$txtvalue\", \"type\":\"TXT\",\"ttl\":600, \"line_id\":1}";then
if _contains "$response""Action completed successful";then
return0
fi
return1#error
}
#update the txt record
#Usage: root sub txtvalue
update_record(){
root=$1
sub=$2
txtvalue=$3
fulldomain="$sub.$root"
_info "Updating record"
if ! _rest POST "Record.Modify""login_token=$DP_Id,$DP_Key&format=json&domain_id=$_domain_id&sub_domain=$_sub_domain&record_type=TXT&value=$txtvalue&record_line=默认&record_id=$record_id";then
return1
fi
if _contains "$response""Action completed successful";then
return0
fi
return1#error
_contains "$response""Action completed successful"|| _contains "$response""Domain record already exists"
_LUA_rest PUT "zones/$_domain_id/records/$record_id""{\"id\":$record_id,\"type\":\"TXT\",\"name\":\"$fulldomain.\",\"content\":\"$txtvalue\",\"zone_id\":$_domain_id,\"ttl\":120}"
if _me_rest POST "$_domain_id/records/""{\"type\":\"TXT\",\"name\":\"$_sub_domain\",\"value\":\"$txtvalue\",\"gtdLocation\":\"DEFAULT\",\"ttl\":120}";then
_me_rest PUT "$_domain_id/records/$record_id/""{\"id\":\"$record_id\",\"type\":\"TXT\",\"name\":\"$_sub_domain\",\"value\":\"$txtvalue\",\"gtdLocation\":\"DEFAULT\",\"ttl\":120}"
if["$?"="0"];then
_info "Updated"
_info "Adding record"
if _me_rest POST "$_domain_id/records/""{\"type\":\"TXT\",\"name\":\"$_sub_domain\",\"value\":\"$txtvalue\",\"gtdLocation\":\"DEFAULT\",\"ttl\":120}";then