From 2912924e867d94e91eae303f62735fc950832ec4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 27 May 2021 23:47:07 +0200 Subject: [PATCH] Use venv --- conf/systemd.service | 2 +- scripts/install | 7 ++++--- scripts/restore | 5 +++-- scripts/upgrade | 5 +++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 5462b79..296dbd0 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=network.target User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__ -ExecStart=/usr/bin/python3 __FINALPATH__/zeronet.py --ui_port __PORT__ --ui_host __DOMAIN__ --fileserver_port __FS_PORT__ --data_dir __DATADIR__/data --log_dir __DATADIR__/log --ui_password __PASSWORD__ +ExecStart=__FINALPATH__/venv/bin/python3 __FINALPATH__/zeronet.py --ui_port __PORT__ --ui_host __DOMAIN__ --fileserver_port __FS_PORT__ --data_dir __DATADIR__/data --log_dir __DATADIR__/log --ui_password __PASSWORD__ ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure diff --git a/scripts/install b/scripts/install index fe82a7d..c4f5a04 100755 --- a/scripts/install +++ b/scripts/install @@ -111,8 +111,9 @@ ynh_add_nginx_config ynh_script_progression --message="Building zeronet..." pushd "$final_path" - pip3 install --upgrade pip - pip3 install -r requirements.txt + python3 -m venv venv + venv/bin/pip install --upgrade pip + venv/bin/pip install -r requirements.txt popd #================================================= @@ -158,7 +159,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= ynh_script_progression --message="Configuring permissions..." -# Allow the app to be public +# Everyone can access the app. ynh_permission_update --permission="main" --add="visitors" #================================================= diff --git a/scripts/restore b/scripts/restore index eeaac7b..44dbae2 100755 --- a/scripts/restore +++ b/scripts/restore @@ -87,8 +87,9 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Building zeronet..." pushd "$final_path" - pip3 install --upgrade pip - pip3 install -r requirements.txt + python3 -m venv venv + venv/bin/pip install --upgrade pip + venv/bin/pip install -r requirements.txt popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 95fc918..93cddb7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -119,8 +119,9 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Building zeronet..." pushd "$final_path" - pip3 install --upgrade pip - pip3 install -r requirements.txt + python3 -m venv venv + venv/bin/pip install --upgrade pip + venv/bin/pip install -r requirements.txt popd #=================================================