auto generate saml key

This commit is contained in:
Jérôme Schneider 2014-06-04 10:30:19 +02:00
parent 1b3f4144c5
commit 0630b07467
2 changed files with 9 additions and 0 deletions

1
dirs
View File

@ -1,3 +1,4 @@
etc/mandaye-meyzieu
etc/mandaye-meyzieu/certs
etc/mandaye-meyzieu/sites-available
etc/mandaye-meyzieu/sites-enabled

View File

@ -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