diff --git a/conf/uwsgi.ini b/conf/uwsgi.ini index 580f1c9..4db9104 100644 --- a/conf/uwsgi.ini +++ b/conf/uwsgi.ini @@ -26,8 +26,8 @@ route-run = fixpathinfo: module = searx.webapp # Virtualenv and python path -virtualenv = __INSTALL_DIR__ -pythonpath = __INSTALL_DIR__ +virtualenv = __INSTALL_DIR__/venv +pythonpath = __INSTALL_DIR__/venv chdir = __INSTALL_DIR__/searx/ # The variable holding flask application diff --git a/scripts/install b/scripts/install index f91e008..cde24c9 100644 --- a/scripts/install +++ b/scripts/install @@ -36,10 +36,11 @@ ynh_add_nginx_config "path_no_root" #================================================= ynh_script_progression --message="Installing Searx..." --weight=2 -python3 -m venv --system-site-packages "$install_dir" -set +u; source $install_dir/bin/activate; set -u -pip3 install -U pip setuptools wheel pyyaml --no-cache-dir -pip3 install --requirement $install_dir/requirements-ynh.txt --no-cache-dir +pushd $install_dir + python3 -m venv venv + venv/bin/pip3 install -U pip setuptools wheel pyyaml --no-cache-dir + venv/bin/pip3 install --requirement $install_dir/requirements-ynh.txt --no-cache-dir +popd #================================================= # CONFIGURE SEARX diff --git a/scripts/upgrade b/scripts/upgrade index 8976439..ff02495 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -67,20 +67,24 @@ ynh_add_nginx_config "path_no_root" ynh_script_progression --message="Upgrading Searx..." --weight=7 # Clean venv if it still on python2 -if [ ! -e $install_dir/bin/python3 ] +if [ -e $install_dir/bin ] && [ ! -e $install_dir/bin/python3 ] then ynh_regex_secure_remove --file=$install_dir/lib/ --regex='python[^/.]*' ynh_regex_secure_remove --file=$install_dir/lib64/ --regex='python[^/.]*' ynh_regex_secure_remove --file=$install_dir/share/python-wheels fi + ynh_regex_secure_remove --file=$install_dir/lib/python3/site-packages/setuptools ynh_regex_secure_remove --file=$install_dir/lib/python3/site-packages/ --regex='setuptools-[^/.]*' -python3 -m venv --system-site-packages "$install_dir" +ynh_regex_secure_remove --file=$install_dir/venv/lib/python3/site-packages/setuptools +ynh_regex_secure_remove --file=$install_dir/venv/lib/python3/site-packages/ --regex='setuptools-[^/.]*' -set +u; source $install_dir/bin/activate; set -u -pip3 install -U setuptools -pip3 install --requirement $install_dir/requirements-ynh.txt --upgrade +pushd $install_dir + python3 -m venv venv + venv/bin/pip3 install -U pip setuptools wheel pyyaml --no-cache-dir + venv/bin/pip3 install --requirement $install_dir/requirements-ynh.txt --no-cache-dir +popd chown -R $app: "$install_dir"