diff options
Diffstat (limited to 'matrix-server/certbot')
5 files changed, 19 insertions, 13 deletions
diff --git a/matrix-server/certbot/Dockerfile b/matrix-server/certbot/Dockerfile index dc6369b..cd1c6bd 100644 --- a/matrix-server/certbot/Dockerfile +++ b/matrix-server/certbot/Dockerfile @@ -1,4 +1,5 @@ FROM certbot/certbot:v1.11.0 RUN apk update && apk add socat COPY ./scripts/ /etc/scripts/ +RUN chmod +x /etc/scripts/*.sh EXPOSE 380 diff --git a/matrix-server/certbot/scripts/concatenate-certificates.sh b/matrix-server/certbot/scripts/concatenate-certificates.sh index 5238a9b..242f5e5 100644 --- a/matrix-server/certbot/scripts/concatenate-certificates.sh +++ b/matrix-server/certbot/scripts/concatenate-certificates.sh @@ -1,5 +1,7 @@ -#!/bin/bash +#!/bin/sh -if [ -f /etc/letsencrypt/live/davole.com/fullchain.pem -a -f /etc/letsencrypt/live/davole.com/privkey.pem ]; then - cat /etc/letsencrypt/live/davole.com/fullchain.pem /etc/letsencrypt/live/davole.com/privkey.pem > /etc/certificates/davole.com.pem +echo "running concat certs..." +if [ -f /etc/letsencrypt/live/terminaldweller.com/fullchain.pem -a -f /etc/letsencrypt/live/terminaldweller.com/privkey.pem ]; then + echo "when you're out, we're in...''" + cat /etc/letsencrypt/live/terminaldweller.com/fullchain.pem /etc/letsencrypt/live/terminaldweller.com/privkey.pem > /etc/certificates/terminaldweller.com.pem fi diff --git a/matrix-server/certbot/scripts/create-certificates.sh b/matrix-server/certbot/scripts/create-certificates.sh index 5fb6345..1bc1094 100644 --- a/matrix-server/certbot/scripts/create-certificates.sh +++ b/matrix-server/certbot/scripts/create-certificates.sh @@ -1,9 +1,10 @@ -#!/bin/bash +#!/bin/sh +echo "running create certs..." # Request certificates certbot certonly --standalone \ - --non-interactive --agree-tos --email info@davole.com --http-01-port=380 \ - --cert-name davole.com \ - -d davole.com + --non-interactive --agree-tos --email thabogre@gmail.com --http-01-port=380 \ + --cert-name terminaldweller.com \ + -d terminaldweller.com # Concatenate certificates . /etc/scripts/concatenate-certificates.sh # Update certificates in HAProxy diff --git a/matrix-server/certbot/scripts/renew-certificates.sh b/matrix-server/certbot/scripts/renew-certificates.sh index e46d412..ff56115 100644 --- a/matrix-server/certbot/scripts/renew-certificates.sh +++ b/matrix-server/certbot/scripts/renew-certificates.sh @@ -1,7 +1,8 @@ -#!/bin/bash +#!/bin/sh +echo "running renew certs..." # Certificates exist -if [ -d /etc/letsencrypt/live/davole.com ]; then +if [ -d /etc/letsencrypt/live/terminaldweller.com ]; then # Check certificates and renew them certbot renew --http-01-port=380 diff --git a/matrix-server/certbot/scripts/update-haproxy-certificates.sh b/matrix-server/certbot/scripts/update-haproxy-certificates.sh index a1f9fc6..9eaae7c 100644 --- a/matrix-server/certbot/scripts/update-haproxy-certificates.sh +++ b/matrix-server/certbot/scripts/update-haproxy-certificates.sh @@ -1,10 +1,11 @@ -#!/bin/bash +#!/bin/sh +echo "running update certs..." # Start transaction -echo -e "set ssl cert /usr/local/etc/haproxy/certificates/davole.com.pem <<\n$(cat /etc/certificates/davole.com.pem)\n" | socat tcp-connect:haproxy:9999 - +echo -e "set ssl cert /etc/letsencrypt/live/terminaldweller.com/fullchain.pem <<\n$(cat /etc/certificates/terminaldweller.com.pem)\n" | socat tcp-connect:haproxy:9999 - # Commit transaction -echo "commit ssl cert /usr/local/etc/haproxy/certificates/davole.com.pem" | socat tcp-connect:haproxy:9999 - +echo "commit ssl cert /etc/letsencrypt/live/terminaldweller.com/fullchain.pem" | socat tcp-connect:haproxy:9999 - # Show certification info (not essential) -echo "show ssl cert /usr/local/etc/haproxy/certificates/davole.com.pem" | socat tcp-connect:haproxy:9999 - +echo "show ssl cert /etc/letsencrypt/live/terminaldweller.com/fullchain.pem" | socat tcp-connect:haproxy:9999 - |