mirror of
				https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
				synced 2025-11-04 02:16:07 +00:00 
			
		
		
		
	fixes
- fixed app dir - fixed missing readme and version file - keep config on update/remove
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
WORKING_DIR=/usr/share/fastapi-dls
 | 
			
		||||
CONFIG_DIR=/etc/fastapi-dls
 | 
			
		||||
 | 
			
		||||
echo "> Create config directory ..."
 | 
			
		||||
@@ -15,12 +16,12 @@ After=network.target
 | 
			
		||||
User=www-data
 | 
			
		||||
Group=www-data
 | 
			
		||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
 | 
			
		||||
WorkingDirectory=/usr/share/fastapi-dls
 | 
			
		||||
WorkingDirectory=$WORKING_DIR
 | 
			
		||||
EnvironmentFile=$CONFIG_DIR/env
 | 
			
		||||
ExecStart=uvicorn main:app \\
 | 
			
		||||
  --env-file /etc/fastapi-dls/env \\
 | 
			
		||||
  --host \$DLS_URL --port \$DLS_PORT \\
 | 
			
		||||
  --app-dir /usr/share/fastapi-dls \\
 | 
			
		||||
  --app-dir $WORKING_DIR/app \\
 | 
			
		||||
  --ssl-keyfile /etc/fastapi-dls/webserver.key \\
 | 
			
		||||
  --ssl-certfile /etc/fastapi-dls/webserver.crt \\
 | 
			
		||||
  --proxy-headers
 | 
			
		||||
@@ -41,7 +42,7 @@ cat <<EOF >$CONFIG_DIR/env
 | 
			
		||||
DLS_URL=127.0.0.1
 | 
			
		||||
DLS_PORT=443
 | 
			
		||||
LEASE_EXPIRE_DAYS=90
 | 
			
		||||
DATABASE=sqlite:////usr/share/fastapi-dls/db.sqlite
 | 
			
		||||
DATABASE=sqlite:///$CONFIG_DIR/db.sqlite
 | 
			
		||||
INSTANCE_KEY_RSA=$CONFIG_DIR/instance.private.pem
 | 
			
		||||
INSTANCE_KEY_PUB=$CONFIG_DIR/instance.public.pem
 | 
			
		||||
 | 
			
		||||
@@ -77,6 +78,7 @@ if [[ -f $CONFIG_DIR/webserver.key ]]; then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
chown -R www-data:www-data $CONFIG_DIR/*
 | 
			
		||||
chown -R www-data:www-data $WORKING_DIR
 | 
			
		||||
 | 
			
		||||
cat <<EOF
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user