最終更新 6 months ago

Jan Wagner revised this gist 8 years ago. Go to revision

1 file changed, 4 insertions, 2 deletions

deploy_dehydrated.sh

@@ -5,10 +5,12 @@ CONFIGNAME="$(basename ${CONFIGURL})"
5 5 CONFIGPATH="/etc/dehydrated/conf.d/"
6 6 HOOKNAME="hook.sh"
7 7 HOOKPATH="/etc/dehydrated/"
8 - SUITE="jessie-backports"
8 + if [ "$(lsb_release -cs)" = "jessie" ]; then
9 + BPO="-t $(lsb_release -cs)-backports"
10 + fi
9 11 PACKAGES="dehydrated dehydrated-apache2"
10 12
11 - apt-get install -t ${SUITE} ${PACKAGES}
13 + apt-get install ${BPO} ${PACKAGES}
12 14
13 15 if [ ! -x ${CRON} ]; then
14 16 cat > ${CRON} <<EOF

waja revised this gist 8 years ago. Go to revision

1 file changed, 3 insertions, 3 deletions

deploy_dehydrated.sh

@@ -12,9 +12,9 @@ apt-get install -t ${SUITE} ${PACKAGES}
12 12
13 13 if [ ! -x ${CRON} ]; then
14 14 cat > ${CRON} <<EOF
15 - #!/bin/bash
16 - test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit 0
17 - EOF
15 + #!/bin/bash
16 + test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit 0
17 + EOF
18 18 chmod +x ${CRON}
19 19 fi
20 20

waja revised this gist 8 years ago. Go to revision

1 file changed, 6 insertions, 8 deletions

update_cron.sh

@@ -1,10 +1,8 @@
1 1 #!/bin/bash
2 - CRON="/etc/cron.daily/dehydrated_autorenew";
3 - rm ${CRON} && \
2 + CRON="/etc/cron.daily/dehydrated_autorenew"; rm ${CRON}; \
4 3 if [ ! -x ${CRON} ]; then
5 - cat > ${CRON} <<EOF
6 - #!/bin/bash
7 - test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit 0
8 - EOF
9 - chmod +x ${CRON}
10 - fi
4 + cat > ${CRON} <<EOF
5 + #!/bin/bash
6 + test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit 0
7 + EOF
8 + chmod +x ${CRON}; fi

waja revised this gist 8 years ago. Go to revision

1 file changed, 2 insertions, 2 deletions

update_cron.sh

@@ -1,6 +1,6 @@
1 1 #!/bin/bash
2 - CRON="/etc/cron.daily/dehydrated_autorenew"; && \
3 - rm ${CRON}; && \
2 + CRON="/etc/cron.daily/dehydrated_autorenew";
3 + rm ${CRON} && \
4 4 if [ ! -x ${CRON} ]; then
5 5 cat > ${CRON} <<EOF
6 6 #!/bin/bash

waja revised this gist 8 years ago. Go to revision

1 file changed, 6 insertions, 1 deletion

update_cron.sh

@@ -2,4 +2,9 @@
2 2 CRON="/etc/cron.daily/dehydrated_autorenew"; && \
3 3 rm ${CRON}; && \
4 4 if [ ! -x ${CRON} ]; then
5 - test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit
5 + cat > ${CRON} <<EOF
6 + #!/bin/bash
7 + test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit 0
8 + EOF
9 + chmod +x ${CRON}
10 + fi

waja revised this gist 8 years ago. Go to revision

1 file changed, 5 insertions

update_cron.sh(file created)

@@ -0,0 +1,5 @@
1 + #!/bin/bash
2 + CRON="/etc/cron.daily/dehydrated_autorenew"; && \
3 + rm ${CRON}; && \
4 + if [ ! -x ${CRON} ]; then
5 + test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit

waja revised this gist 8 years ago. Go to revision

1 file changed, 4 insertions, 2 deletions

deploy_dehydrated.sh

@@ -11,8 +11,10 @@ PACKAGES="dehydrated dehydrated-apache2"
11 11 apt-get install -t ${SUITE} ${PACKAGES}
12 12
13 13 if [ ! -x ${CRON} ]; then
14 - echo '#!/bin/bash' > ${CRON}
15 - echo 'test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit 0' >> ${CRON}
14 + cat > ${CRON} <<EOF
15 + #!/bin/bash
16 + test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit 0
17 + EOF
16 18 chmod +x ${CRON}
17 19 fi
18 20

waja revised this gist 8 years ago. Go to revision

1 file changed, 1 insertion, 1 deletion

deploy_dehydrated.sh

@@ -12,7 +12,7 @@ apt-get install -t ${SUITE} ${PACKAGES}
12 12
13 13 if [ ! -x ${CRON} ]; then
14 14 echo '#!/bin/bash' > ${CRON}
15 - echo 'test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|^$)"; exit 0' >> ${CRON}
15 + echo 'test -x /usr/bin/dehydrated && /usr/bin/dehydrated -c | grep -v -E "(^#|^Processing|Skipping renew|unchanged|Checking expire date of existing cert|Certificate will not expire|^$)"; exit 0' >> ${CRON}
16 16 chmod +x ${CRON}
17 17 fi
18 18

waja revised this gist 8 years ago. Go to revision

1 file changed, 2 insertions

README.md

@@ -23,3 +23,5 @@ for CERT in $(awk {'print $1'} /etc/dehydrated/domains.txt); do\
23 23 ln -s /var/lib/dehydrated/certs/${CERT}/fullchain.pem /etc/ssl/certs/${CERT}.pem;\
24 24 done
25 25 ```
26 +
27 + For distributed setups you might want to have a look into [Using redirects](https://nekudo.com/blog/letsencrypt-in-a-multiserver-environment) or [Use and automate letsencrypt certificates (ACME) in an high-availability environment](https://chr4.org/blog/2016/11/14/use-letsencrypt-acme-in-an-high-availability-environment/).

waja revised this gist 8 years ago. Go to revision

1 file changed, 3 insertions

lighttpd_dehydrated.conf(file created)

@@ -0,0 +1,3 @@
1 + alias.url += (
2 + "/.well-known/acme-challenge/" => "/var/lib/dehydrated/acme-challenges/",
3 + )