fix letsencrypt

This commit is contained in:
sniper-py 2020-04-26 14:18:38 +08:00
parent 6968236e22
commit 12319e41b7
5 changed files with 5 additions and 5 deletions

View file

@ -5,7 +5,7 @@ FROM phusion/baseimage:0.11
RUN apt-get update --fix-missing RUN apt-get update --fix-missing
# Utility tools # Utility tools
RUN apt-get install -y vim htop net-tools psmisc wget curl RUN apt-get install -y vim htop net-tools psmisc wget curl git
# For suport set local time zone. # For suport set local time zone.
RUN export DEBIAN_FRONTEND=noninteractive && apt-get install tzdata -y RUN export DEBIAN_FRONTEND=noninteractive && apt-get install tzdata -y

View file

@ -5,7 +5,7 @@ FROM phusion/baseimage:0.11
RUN apt-get update --fix-missing RUN apt-get update --fix-missing
# Utility tools # Utility tools
RUN apt-get install -y vim htop net-tools psmisc wget curl RUN apt-get install -y vim htop net-tools psmisc wget curl git
# For suport set local time zone. # For suport set local time zone.
RUN export DEBIAN_FRONTEND=noninteractive && apt-get install tzdata -y RUN export DEBIAN_FRONTEND=noninteractive && apt-get install tzdata -y

View file

@ -16,7 +16,7 @@ renew_cert_script=/scripts/renew_cert.sh
if [[ ! -x ${renew_cert_script} ]]; then if [[ ! -x ${renew_cert_script} ]]; then
cat > ${renew_cert_script} << EOF cat > ${renew_cert_script} << EOF
#!/bin/bash #!/bin/bash
python ${letsencrypt_script} --account-key ${ssldir}/${ssl_account_key} --csr ${ssldir}/${ssl_csr} --acme-dir /var/www/challenges/ > ${ssldir}/${ssl_crt} || exit python3 ${letsencrypt_script} --account-key ${ssldir}/${ssl_account_key} --csr ${ssldir}/${ssl_csr} --acme-dir /var/www/challenges/ > ${ssldir}/${ssl_crt} || exit
$(which nginx) -s reload $(which nginx) -s reload
EOF EOF

View file

@ -37,7 +37,7 @@ if [[ ! -e ${ssl_csr} ]]; then
openssl req -new -sha256 -key ${ssl_key} -subj "/CN=$domain" > $ssl_csr openssl req -new -sha256 -key ${ssl_key} -subj "/CN=$domain" > $ssl_csr
fi fi
python $letsencrypt_script --account-key ${ssl_account_key} --csr $ssl_csr --acme-dir /var/www/challenges/ > ./signed.crt python3 $letsencrypt_script --account-key ${ssl_account_key} --csr $ssl_csr --acme-dir /var/www/challenges/ > ./signed.crt
curl -sSL -o intermediate.pem https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem curl -sSL -o intermediate.pem https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem
cat signed.crt intermediate.pem > ${ssl_crt} cat signed.crt intermediate.pem > ${ssl_crt}

View file

@ -171,7 +171,7 @@ def git_current_commit():
def get_command_output(cmd): def get_command_output(cmd):
shell = not isinstance(cmd, list) shell = not isinstance(cmd, list)
return subprocess.check_output(cmd, shell=shell) return str(subprocess.check_output(cmd, shell=shell))
def ask_yes_or_no(msg, prompt='', default=None): def ask_yes_or_no(msg, prompt='', default=None):
print('\n' + msg + '\n') print('\n' + msg + '\n')