automated letsencrypt
authorLisa Marie Maginnis <lisam@fsf.org>
Mon, 29 Feb 2016 04:04:00 +0000 (23:04 -0500)
committerLisa Marie Maginnis <lisam@fsf.org>
Mon, 29 Feb 2016 04:04:00 +0000 (23:04 -0500)
class/LETSENCRYPT.var
class/gmg0d.libreplanet.org.var [new file with mode: 0644]
class/gmg0p.libreplanet.org.var [new file with mode: 0644]
files/etc/init.d/request-letsencrypt/DEFAULT [new file with mode: 0755]
scripts/LETSENCRYPT/00_fetch.sh

index 298d032..f03fde1 100644 (file)
@@ -1 +1,2 @@
 LETSENCRYPT_PATH=/srv/
+LETSENCRYPT_EMAIL=sysadmin@fsf.org
diff --git a/class/gmg0d.libreplanet.org.var b/class/gmg0d.libreplanet.org.var
new file mode 100644 (file)
index 0000000..02a2d5b
--- /dev/null
@@ -0,0 +1 @@
+SERVERNAME=media-dev.libreplanet.org
diff --git a/class/gmg0p.libreplanet.org.var b/class/gmg0p.libreplanet.org.var
new file mode 100644 (file)
index 0000000..3cf9846
--- /dev/null
@@ -0,0 +1 @@
+SERVERNAME=media.libreplanet.org
\ No newline at end of file
diff --git a/files/etc/init.d/request-letsencrypt/DEFAULT b/files/etc/init.d/request-letsencrypt/DEFAULT
new file mode 100755 (executable)
index 0000000..b0081a0
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+if [ ! -d /etc/letsencrypt/archive/$HOSTNAME ]; then
+    cd /srv/letsencrypt
+    /letsencrypt-auto certonly --standalone --agree-tos --email $LETSENCRYPT_EMAIL -d $HOSTNAME -d $SERVERNAME
+fi
+
index 92cd520..0d0c45f 100755 (executable)
@@ -4,3 +4,5 @@ if [ ! -d $LETSENCRYPT_PATH/letsencrypt ]; then
     cd $target/$LETSENCRYPT_PATH
     git clone https://github.com/letsencrypt/letsencrypt
 fi
+fcopy -Bv /etc/init.d/request-letsencrypt
+$ROOTCMD update-rc.d request-letsencrypt defaults