diff --git a/conf/dockerless-run.sh b/conf/dockerless-run.sh new file mode 100644 index 0000000..55e6e12 --- /dev/null +++ b/conf/dockerless-run.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# stop if one process fails +set -e + +# bookwyrm +__FINALPATH__/venv/bin/gunicorn bookwyrm.wsgi:application --bind 0.0.0.0:__PORT__ & + +# celery +__FINALPATH__/venv/bin/celery -A celerywyrm worker -l info -Q high_priority,medium_priority,low_priority & +__FINALPATH__/venv/bin/celery -A celerywyrm beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler & +# __FINALPATH__/venv/bin/celery -A celerywyrm flower & \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service index 05b08b2..73d0628 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,9 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/dockerless-run.sh -StandardOutput=append:/var/log/__APP__/__APP__.log -StandardError=inherit +ExecStart=/bin/bash __FINALPATH__/dockerless-run.sh # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these diff --git a/scripts/install b/scripts/install index 495a271..d2f357e 100755 --- a/scripts/install +++ b/scripts/install @@ -109,6 +109,13 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +ynh_add_config --template="dockerless-run.sh" --destination="$final_path/dockerless-run.sh" +chmod 700 "$final_path/dockerless-run.sh" +chown $app:$app "$final_path/dockerless-run.sh" + +mkdir "$final_path/venv" +python3 -m venv "$final_path/venv" +$final_path/venv/bin/pip3 install -r "$final_path/requirements.txt" #================================================= # NGINX CONFIGURATION @@ -155,7 +162,7 @@ ynh_add_systemd_config ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="BookWyrm service" --log="/var/log/$app/$app.log" #================================================= diff --git a/scripts/restore b/scripts/restore index 0275776..7b4ddab 100755 --- a/scripts/restore +++ b/scripts/restore @@ -132,7 +132,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="BookWyrm service" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index af4a7fd..951da60 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -163,7 +163,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="BookWyrm service" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE