mirror of
				https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
				synced 2025-11-04 02:16:07 +00:00 
			
		
		
		
	postinst improvements
This commit is contained in:
		@@ -37,9 +37,10 @@ EOF
 | 
			
		||||
 | 
			
		||||
systemctl daemon-reload
 | 
			
		||||
 | 
			
		||||
echo "> Writing default config parameters ..."
 | 
			
		||||
touch $CONFIG_DIR/env
 | 
			
		||||
cat <<EOF >$CONFIG_DIR/env
 | 
			
		||||
if [[ ! -f $CONFIG_DIR/env ]]; then
 | 
			
		||||
  echo "> Writing initial config ..."
 | 
			
		||||
  touch $CONFIG_DIR/env
 | 
			
		||||
  cat <<EOF >$CONFIG_DIR/env
 | 
			
		||||
DLS_URL=127.0.0.1
 | 
			
		||||
DLS_PORT=443
 | 
			
		||||
LEASE_EXPIRE_DAYS=90
 | 
			
		||||
@@ -48,6 +49,7 @@ INSTANCE_KEY_RSA=$CONFIG_DIR/instance.private.pem
 | 
			
		||||
INSTANCE_KEY_PUB=$CONFIG_DIR/instance.public.pem
 | 
			
		||||
 | 
			
		||||
EOF
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "> Create dls-instance keypair ..."
 | 
			
		||||
openssl genrsa -out $CONFIG_DIR/instance.private.pem 2048
 | 
			
		||||
@@ -72,7 +74,8 @@ if [[ -f $CONFIG_DIR/webserver.key ]]; then
 | 
			
		||||
 | 
			
		||||
  if [ -x "$(command -v curl)" ]; then
 | 
			
		||||
    echo "> Testing API ..."
 | 
			
		||||
    curl --insecure -X GET https://127.0.0.1/status
 | 
			
		||||
    source $CONFIG_DIR/env
 | 
			
		||||
    curl --insecure -X GET https://$DLS_URL:$DLS_PORT/status
 | 
			
		||||
  else
 | 
			
		||||
    echo "> Testing API failed, curl not available. Please test manually!"
 | 
			
		||||
  fi
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user