Adds ssl autoupdate scheduler (#423)

* Adds ssl autoupdate scheduler

* Single quotes for the hound
This commit is contained in:
Philipp Bayer
2017-08-05 18:16:10 +08:00
committed by Bastian Greshake Tzovaras
parent e811ae80c2
commit a08ec4e2e4
2 changed files with 30 additions and 0 deletions

29
bin/ssl_cert.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
echo 'Cloning dehydrated...'
cd /home
git clone https://github.com/lukas2511/dehydrated.git
cd dehydrated
cp docs/examples/config config
mkdir -p /home/app/snpr/public/.well-known/acme-challenge
# by default, WELLKNOWN is commented out, so just set the variable
echo 'WELLKNOWN=/home/app/snpr/public/.well-known/acme-challenge' >> config
echo 'opensnp.org www.opensnp.org' > domains.txt
echo 'opensnp.net www.opensnp.net' >> domains.txt
echo 'Starting dehydrated...'
./dehydrated --cron --accept-terms
echo 'Done, now copying keys'
cp /etc/ssl/private/opensnp.org.key /etc/ssl/private/opensnp.org.key.old
cp privkey.pem /etc/ssl/private/opensnp.org.key
cp /etc/ssl/certs/opensnp.org.crt /etc/ssl/certs/opensnp.org.crt.old
cp fullchain.pem /etc/ssl/certs/opensnp.org.crt
service nginx restart

View File

@@ -27,6 +27,7 @@ end
every :day do
rake 'papers:update'
command '/home/app/snpr/bin/ssl_cert.sh'
end
every :week do