diff --git a/conf/searx.ini b/conf/searx.ini index 5b503d4..72b60cc 100644 --- a/conf/searx.ini +++ b/conf/searx.ini @@ -12,13 +12,16 @@ chmod-socket = 666 # Plugin to use and interpretor config single-interpreter = true master = true -plugin = python +plugin = python3 lazy-apps = true enable-threads = true # Application base folder base = __FINALPATH__ +# Support running the module from a webserver subdirectory. +route-run = fixpathinfo: + # Module to import module = __APP__.webapp diff --git a/scripts/_common.sh b/scripts/_common.sh index 1ef3de8..03febb9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,4 +5,4 @@ #================================================= # dependencies used by the app -pkg_dependencies="git build-essential libxslt-dev python-dev python-virtualenv python-cffi virtualenv python-babel zlib1g-dev libffi-dev libssl-dev python-lxml uwsgi uwsgi-plugin-python" +pkg_dependencies="git build-essential libxslt-dev python3-dev python3-venv python3-cffi python3-babel zlib1g-dev libffi-dev libssl-dev python3-lxml uwsgi uwsgi-plugin-python3" diff --git a/scripts/install b/scripts/install index f6a1719..f151451 100644 --- a/scripts/install +++ b/scripts/install @@ -98,10 +98,10 @@ ynh_replace_string --match_string="werkzeug.contrib.fixers" --replace_string="we #================================================= ynh_script_progression --message="Installing Searx..." -virtualenv --system-site-packages "$final_path" +python3 -m venv "$final_path" set +u; source $final_path/bin/activate; set -u -pip install -U setuptools -pip install --requirement $final_path/requirements-ynh.txt +pip3 install -U pip setuptools +pip3 install --requirement $final_path/requirements-ynh.txt #================================================= # CONFIGURE SEARX diff --git a/scripts/upgrade b/scripts/upgrade index 9d2062a..646ec62 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -123,11 +123,12 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Upgrading Searx..." --weight=7 -rm -r $final_path/lib/python2.7/site-packages/setuptools $final_path/lib/python2.7/site-packages/setuptools-* -virtualenv --system-site-packages "$final_path" +# Clean venv if it still on python2 +test -e $final_path/bin/python3 || ynh_secure_remove --file=$final_path +python3 -m venv "$final_path" set +u; source $final_path/bin/activate; set -u -pip install -U setuptools -pip install --requirement $final_path/requirements-ynh.txt --upgrade +pip3 install -U pip setuptools +pip3 install --requirement $final_path/requirements-ynh.txt --upgrade #================================================= # CONFIGURE SEARX