diff --git a/.DEBIAN/env.default b/.DEBIAN/env.default index 0bb6549..0ea58ae 100644 --- a/.DEBIAN/env.default +++ b/.DEBIAN/env.default @@ -1,6 +1,9 @@ # Toggle debug mode #DEBUG=false +# Cert Path +CERT_PATH="/etc/fastapi-dls/cert" + # Where the client can find the DLS server DLS_URL=127.0.0.1 DLS_PORT=443 diff --git a/.DEBIAN/postinst b/.DEBIAN/postinst index 35c33fb..6427193 100644 --- a/.DEBIAN/postinst +++ b/.DEBIAN/postinst @@ -3,6 +3,8 @@ WORKING_DIR=/usr/share/fastapi-dls CONFIG_DIR=/etc/fastapi-dls +source $CONFIG_DIR/env + while true; do [ -f $CONFIG_DIR/webserver.key ] && default_answer="N" || default_answer="Y" [ $default_answer == "Y" ] && V="Y/n" || V="y/N" @@ -25,27 +27,32 @@ if [ -f $CONFIG_DIR/webserver.key ]; then if [ -x "$(command -v curl)" ]; then echo "> Testing API ..." - source $CONFIG_DIR/env curl --insecure -X GET https://$DLS_URL:$DLS_PORT/-/health else echo "> Testing API failed, curl not available. Please test manually!" fi fi +echo "> Create Certificate-Chain folder ..." +mkdir -p $CERT_PATH + +echo "> Set permissions ..." chown -R www-data:www-data $CONFIG_DIR chown -R www-data:www-data $WORKING_DIR +echo "> Done." + cat <