Skip to content

Commit

Permalink
Lets encrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvandescheur committed Jan 7, 2017
1 parent 74824b2 commit 48e8647
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ RUN apt-get update && apt-get install -y \
cd /srv/nginx/svenv/ && \
python manage.py collectstatic --noinput && \

rsync -a svenv.nl@recovery.svenv.nl:~/recovery/ /
rsync -a svenv.nl@recovery.svenv.nl:~/recovery/ / && \
/usr/local/bin/createcertlinks.sh

# Set volumes
VOLUME ["/etc/nginx/conf.d", "/etc/ssh/", "/etc/ssl/", "/root/", "/srv/", "/tmp/", "/usr/local/lib/python2.7/dist-packages", "/usr/lib/python2.7/dist-packages", "/usr/local/etc/", "/var/run/postgresql/", "/var/log/", "/var/mail"]
16 changes: 16 additions & 0 deletions files/usr/local/bin/createcertlinks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Script to link nginx certificates to Lets Encrypt

# Summary:
# --------
# * Link certificates


# Link certificates
hostname=`hostname`
dir=`ls -t /etc/letsencrypt/live/ | grep $hostname | head -n 1`
path="/etc/letsencrypt/live/$dir"

ln /etc/ssl/certs/svenv.nl.key "$path/privkey.pem"
ln /etc/ssl/certs/svenv.nl.crt "$path/fullchain.pem"

0 comments on commit 48e8647

Please sign in to comment.