Dernière activité 6 months ago

Révision a54a58101417acd3a93198928991583ba538ae51

README.md Brut

Deploying letsencrypt.sh for apache2 on Debian Jessie:

wget https://gist.githubusercontent.com/waja/8df78afb09691e4f383d818685f48885/raw/deploy_letsencrypth.sh \
 -O /tmp/deploy_letsencrypth.sh && \
 bash /tmp/deploy_letsencrypth.sh <registration email>

Now you need to create /etc/letsencrypt.sh/domains.txt like documented.

Running the cronjob for initial request of certs:

/etc/cron.daily/letsencrypt_autorenew

Linking certs and keys into usual places:

for CERT in $(awk {'print $1'} /etc/letsencrypt.sh/domains.txt); do\
 [ -e /var/lib/letsencrypt.sh/certs/${CERT}/privkey.pem ] || \
   ln -s /var/lib/letsencrypt.sh/certs/${CERT}/privkey.pem /etc/ssl/private/${CERT}.key;\
 [ -e /var/lib/letsencrypt.sh/certs/${CERT}/fullchain.pem ] || \
   ln -s /var/lib/letsencrypt.sh/certs/${CERT}/fullchain.pem /etc/ssl/certs/${CERT}.pem;\
done
deploy_letsencrypth.sh Brut
1#!/bin/bash
2CRON="/etc/cron.daily/letsencrypt_autorenew"
3CONFIGURL="https://gist.githubusercontent.com/waja/8df78afb09691e4f383d818685f48885/raw/local.sh"
4CONFIGNAME="$(basename ${CONFIGURL})"
5CONFIGPATH="/etc/letsencrypt.sh/conf.d/"
6HOOKNAME="hook.sh"
7HOOKPATH="/etc/letsencrypt.sh/"
8SUITE="jessie-backports"
9PACKAGES="letsencrypt.sh letsencrypt.sh-apache2"
10
11apt-get install -t ${SUITE} ${PACKAGES}
12
13if [ ! -x ${CRON} ]; then
14 echo '#!/bin/bash' > ${CRON}
15 echo 'test -x /usr/bin/letsencrypt.sh && /usr/bin/letsencrypt.sh -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|^$)"; exit 0' >> ${CRON}
16 chmod +x ${CRON}
17fi
18
19[ -f ${CONFIGPATH}/${CONFIGNAME} ] || wget ${CONFIGURL} -O ${CONFIGPATH}/${CONFIGNAME}
20
21sed -i "s/^CONTACT_EMAIL=*/CONTACT_EMAIL=${1}/" ${CONFIGPATH}/${CONFIGNAME}
22[ -f ${HOOKPATH}/${HOOKNAME} ] || printf '#!/bin/sh\n[ "$1" != "deploy_cert" ] || /usr/sbin/service apache2 restart' > ${HOOKPATH}/${HOOKNAME} && chmod +x ${HOOKPATH}/${HOOKNAME}
23
local.sh Brut
1# Path to certificate authority (default: https://acme-v01.api.letsencrypt.org/directory)
2#CA="https://acme-v01.api.letsencrypt.org/directory"
3
4# Program or function called in certain situations
5#
6# After generating the challenge-response, or after failed challenge (in this case altname is empty)
7# Given arguments: clean_challenge|deploy_challenge altname token-filename token-content
8#
9# After successfully signing certificate
10# Given arguments: deploy_cert domain path/to/privkey.pem path/to/cert.pem path/to/fullchain.pem
11#
12# BASEDIR and WELLKNOWN variables are exported and can be used in an external program
13# default: <unset>
14HOOK='/etc/letsencrypt.sh/hook.sh'
15
16# Chain clean_challenge|deploy_challenge arguments together into one hook call per certificate (default: no)
17HOOK_CHAIN="yes"
18
19# Which public key algorithm should be used? Supported: rsa, prime256v1 and secp384r1
20#KEY_ALGO=rsa
21
22# E-mail to use during the registration (default: <unset>)
23CONTACT_EMAIL=
24