summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérôme Schneider <jschneider@entrouvert.com>2014-06-04 08:30:19 (GMT)
committerJérôme Schneider <jschneider@entrouvert.com>2014-06-04 08:30:19 (GMT)
commit0630b07467af2665debac310624d7e6a91f1097e (patch)
tree97e961aa21f5b4b6390ef4ff626f9e07c580daaf
parent1b3f4144c586e46761d7387f0c49b2d90565abbb (diff)
downloadmandaye-meyzieu-0630b07467af2665debac310624d7e6a91f1097e.zip
mandaye-meyzieu-0630b07467af2665debac310624d7e6a91f1097e.tar.gz
mandaye-meyzieu-0630b07467af2665debac310624d7e6a91f1097e.tar.bz2
auto generate saml key
-rw-r--r--dirs1
-rw-r--r--postinst8
2 files changed, 9 insertions, 0 deletions
diff --git a/dirs b/dirs
index eebb6c3..acea3be 100644
--- a/dirs
+++ b/dirs
@@ -1,3 +1,4 @@
etc/mandaye-meyzieu
+etc/mandaye-meyzieu/certs
etc/mandaye-meyzieu/sites-available
etc/mandaye-meyzieu/sites-enabled
diff --git a/postinst b/postinst
index 3ed2a8b..3a705fe 100644
--- a/postinst
+++ b/postinst
@@ -25,6 +25,14 @@ case "$1" in
$USER
echo "..done"
fi
+ if [ ! -f /etc/mandaye-meyzieu/certs/saml.crt -a ! -f /etc/mandaye-meyzieu/certs/saml.key ]; the
+ echo -n "Generating key material..." >&2
+ openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -out /etc/mandaye-meyzieu/certs/saml.key >&2
+ openssl req -x509 -new -out /etc/mandaye-meyzieu/certs/saml.crt -subj '/CN=whocares' -key /etc/mandaye-meyzieu/certs/saml.key -days 3650 >&2
+ chown root:$GROUP /etc/mandaye-meyzieu/certs/saml.crt /etc/mandaye-meyzieu/certs/saml.key
+ chmod 640 /etc/mandaye-meyzieu/certs/saml.crt /etc/mandaye-meyzieu/certs/saml.key
+ echo "..done" >&2
+ fi
echo -n "Fixing permissions.."
chown $USER:$GROUP /var/lib/$NAME /var/run/$NAME /var/log/$NAME