- fixed app dir
- fixed missing readme and version file
- keep config on update/remove
This commit is contained in:
Oscar Krause
2022-12-28 07:40:44 +01:00
parent cca24f0ad5
commit 6b3f536681
3 changed files with 10 additions and 7 deletions

View File

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