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