From a9fc4885f2d4ab3fba8fd9fbaa0386090250bd11 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 11 Oct 2021 19:59:34 +0200 Subject: [brand] SearXNG - bash env SEARXNG_URL Signed-off-by: Markus Heiser --- utils/brand.env | 2 +- utils/build_env.py | 2 +- utils/filtron.sh | 2 +- utils/lib_install.sh | 14 +++++++------- utils/morty.sh | 2 +- utils/searx.sh | 4 ++-- utils/templates/etc/httpd/sites-available/searx.conf:uwsgi | 4 ++-- .../etc/nginx/default.apps-available/searx.conf:filtron | 6 +++--- 8 files changed, 18 insertions(+), 18 deletions(-) (limited to 'utils') diff --git a/utils/brand.env b/utils/brand.env index 5cc2af35b..31afce53c 100644 --- a/utils/brand.env +++ b/utils/brand.env @@ -1,4 +1,4 @@ -export SEARX_URL='' +export SEARXNG_URL='' export SEARXNG_PORT='8888' export SEARXNG_BIND_ADDRESS='127.0.0.1' export GIT_URL='https://github.com/searxng/searxng' diff --git a/utils/build_env.py b/utils/build_env.py index cd2fc2d04..709da6815 100644 --- a/utils/build_env.py +++ b/utils/build_env.py @@ -28,7 +28,7 @@ def _env(*arg, **kwargs): name_val = [ - ('SEARX_URL' , 'server.base_url'), + ('SEARXNG_URL' , 'server.base_url'), ('SEARXNG_PORT' , 'server.port'), ('SEARXNG_BIND_ADDRESS' , 'server.bind_address'), diff --git a/utils/filtron.sh b/utils/filtron.sh index eb34b2413..e4a4d32e8 100755 --- a/utils/filtron.sh +++ b/utils/filtron.sh @@ -560,7 +560,7 @@ This installs a reverse proxy (ProxyPass) into nginx site (${NGINX_FILTRON_SITE} # shellcheck disable=SC2034 SEARX_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_SRC) # shellcheck disable=SC2034 - SEARX_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_URL_PATH) + SEARXNG_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_URL_PATH) nginx_install_app --variant=filtron "${NGINX_FILTRON_SITE}" info_msg "testing public url .." diff --git a/utils/lib_install.sh b/utils/lib_install.sh index 4fd63b830..4a251c096 100755 --- a/utils/lib_install.sh +++ b/utils/lib_install.sh @@ -116,9 +116,9 @@ install_log_searx_instance() { echo -e "---- SearXNG instance setup ${_BBlue}(status: $(install_searx_get_state))${_creset}" echo -e " SEARXNG_SETTINGS_PATH : ${_BBlue}${SEARXNG_SETTINGS_PATH}${_creset}" - echo -e " SSEARX_PYENV : ${_BBlue}${SEARX_PYENV}${_creset}" + echo -e " SEARX_PYENV : ${_BBlue}${SEARX_PYENV}${_creset}" echo -e " SEARX_SRC : ${_BBlue}${SEARX_SRC:-none}${_creset}" - echo -e " SEARX_URL : ${_BBlue}${SEARX_URL:-none}${_creset}" + echo -e " SEARXNG_URL : ${_BBlue}${SEARXNG_URL:-none}${_creset}" if in_container; then # searx is listening on 127.0.0.1 and not available from outside container @@ -184,17 +184,17 @@ install_searx_get_state(){ # shellcheck source=utils/brand.env source "${REPO_ROOT}/utils/brand.env" -# SEARX_URL aka PUBLIC_URL: the public URL of the instance (e.g. -# "https://example.org/searx"). The value is taken from environment $SEARX_URL +# SEARXNG_URL aka PUBLIC_URL: the public URL of the instance (e.g. +# "https://example.org/searx"). The value is taken from environment $SEARXNG_URL # in ./utils/brand.env. This variable is a empty string if server.base_url in # the settings.yml is set to 'false'. -SEARX_URL="${SEARX_URL:-http://$(uname -n)}" +SEARXNG_URL="${SEARXNG_URL:-http://$(uname -n)}" if in_container; then # hint: Linux containers do not have DNS entries, lets use IPs - SEARX_URL="http://$(primary_ip)" + SEARXNG_URL="http://$(primary_ip)" fi -PUBLIC_URL="${SEARX_URL}" +PUBLIC_URL="${SEARXNG_URL}" source_dot_config diff --git a/utils/morty.sh b/utils/morty.sh index 60220df02..fdbe2b54e 100755 --- a/utils/morty.sh +++ b/utils/morty.sh @@ -513,7 +513,7 @@ This installs a reverse proxy (ProxyPass) into nginx site (${NGINX_MORTY_SITE})" # shellcheck disable=SC2034 SEARX_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_SRC) # shellcheck disable=SC2034 - SEARX_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_URL_PATH) + SEARXNG_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_URL_PATH) nginx_install_app "${NGINX_MORTY_SITE}" info_msg "testing public url .." diff --git a/utils/searx.sh b/utils/searx.sh index e3393835c..00ee93010 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -14,9 +14,9 @@ source "${REPO_ROOT}/utils/lib_install.sh" SEARX_INTERNAL_HTTP="${SEARXNG_BIND_ADDRESS}:${SEARXNG_PORT}" -SEARX_URL_PATH="${SEARX_URL_PATH:-$(echo "${PUBLIC_URL}" \ +SEARXNG_URL_PATH="${SEARXNG_URL_PATH:-$(echo "${PUBLIC_URL}" \ | sed -e 's,^.*://[^/]*\(/.*\),\1,g')}" -[[ "${SEARX_URL_PATH}" == "${PUBLIC_URL}" ]] && SEARX_URL_PATH=/ +[[ "${SEARXNG_URL_PATH}" == "${PUBLIC_URL}" ]] && SEARXNG_URL_PATH=/ SERVICE_NAME="searx" SERVICE_USER="${SERVICE_USER:-${SERVICE_NAME}}" diff --git a/utils/templates/etc/httpd/sites-available/searx.conf:uwsgi b/utils/templates/etc/httpd/sites-available/searx.conf:uwsgi index ef702de3a..aabc125ae 100644 --- a/utils/templates/etc/httpd/sites-available/searx.conf:uwsgi +++ b/utils/templates/etc/httpd/sites-available/searx.conf:uwsgi @@ -5,10 +5,10 @@ LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so LoadModule proxy_uwsgi_module ${APACHE_MODULES}/mod_proxy_uwsgi.so # LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so -# SetEnvIf Request_URI "${SEARX_URL_PATH}" dontlog +# SetEnvIf Request_URI "${SEARXNG_URL_PATH}" dontlog # CustomLog /dev/null combined env=dontlog - + SecRuleEngine Off diff --git a/utils/templates/etc/nginx/default.apps-available/searx.conf:filtron b/utils/templates/etc/nginx/default.apps-available/searx.conf:filtron index a89aa38b3..e25461c47 100644 --- a/utils/templates/etc/nginx/default.apps-available/searx.conf:filtron +++ b/utils/templates/etc/nginx/default.apps-available/searx.conf:filtron @@ -1,6 +1,6 @@ # https://example.org/searx -location ${SEARX_URL_PATH} { +location ${SEARXNG_URL_PATH} { proxy_pass http://127.0.0.1:4004/; proxy_set_header Host \$host; @@ -8,9 +8,9 @@ location ${SEARX_URL_PATH} { proxy_set_header X-Real-IP \$remote_addr; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header X-Scheme \$scheme; - proxy_set_header X-Script-Name ${SEARX_URL_PATH}; + proxy_set_header X-Script-Name ${SEARXNG_URL_PATH}; } -location ${SEARX_URL_PATH}/static/ { +location ${SEARXNG_URL_PATH}/static/ { alias ${SEARX_SRC}/searx/static/; } -- cgit v1.2.3 From 2b1252148d083eb47382733980ec069ef20dcfb6 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 11 Oct 2021 21:20:22 +0200 Subject: [brand] SearXNG - nginx & apache searxng.conf, uwsgi searxng.conf Signed-off-by: Markus Heiser --- utils/filtron.sh | 4 +- utils/searx.sh | 80 ++++++++++---------- .../etc/httpd/sites-available/searx.conf:filtron | 33 -------- .../etc/httpd/sites-available/searx.conf:uwsgi | 27 ------- .../etc/httpd/sites-available/searxng.conf:filtron | 33 ++++++++ .../etc/httpd/sites-available/searxng.conf:uwsgi | 27 +++++++ .../default.apps-available/searx.conf:filtron | 16 ---- .../default.apps-available/searxng.conf:filtron | 16 ++++ utils/templates/etc/uwsgi/apps-archlinux/searx.ini | 88 ---------------------- .../etc/uwsgi/apps-archlinux/searx.ini:socket | 85 --------------------- .../templates/etc/uwsgi/apps-archlinux/searxng.ini | 88 ++++++++++++++++++++++ .../etc/uwsgi/apps-archlinux/searxng.ini:socket | 85 +++++++++++++++++++++ utils/templates/etc/uwsgi/apps-available/searx.ini | 87 --------------------- .../etc/uwsgi/apps-available/searx.ini:socket | 84 --------------------- .../templates/etc/uwsgi/apps-available/searxng.ini | 87 +++++++++++++++++++++ .../etc/uwsgi/apps-available/searxng.ini:socket | 84 +++++++++++++++++++++ 16 files changed, 462 insertions(+), 462 deletions(-) delete mode 100644 utils/templates/etc/httpd/sites-available/searx.conf:filtron delete mode 100644 utils/templates/etc/httpd/sites-available/searx.conf:uwsgi create mode 100644 utils/templates/etc/httpd/sites-available/searxng.conf:filtron create mode 100644 utils/templates/etc/httpd/sites-available/searxng.conf:uwsgi delete mode 100644 utils/templates/etc/nginx/default.apps-available/searx.conf:filtron create mode 100644 utils/templates/etc/nginx/default.apps-available/searxng.conf:filtron delete mode 100644 utils/templates/etc/uwsgi/apps-archlinux/searx.ini delete mode 100644 utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket create mode 100644 utils/templates/etc/uwsgi/apps-archlinux/searxng.ini create mode 100644 utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket delete mode 100644 utils/templates/etc/uwsgi/apps-available/searx.ini delete mode 100644 utils/templates/etc/uwsgi/apps-available/searx.ini:socket create mode 100644 utils/templates/etc/uwsgi/apps-available/searxng.ini create mode 100644 utils/templates/etc/uwsgi/apps-available/searxng.ini:socket (limited to 'utils') diff --git a/utils/filtron.sh b/utils/filtron.sh index e4a4d32e8..e9fc79c87 100755 --- a/utils/filtron.sh +++ b/utils/filtron.sh @@ -46,8 +46,8 @@ GO_VERSION="go1.17.2" GO_PKG_URL="https://golang.org/dl/${GO_VERSION}.linux-amd64.tar.gz" GO_TAR=$(basename "$GO_PKG_URL") -APACHE_FILTRON_SITE="searx.conf" -NGINX_FILTRON_SITE="searx.conf" +APACHE_FILTRON_SITE="searxng.conf" +NGINX_FILTRON_SITE="searxng.conf" # shellcheck disable=SC2034 CONFIG_FILES=( diff --git a/utils/searx.sh b/utils/searx.sh index 00ee93010..3f50646e3 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -29,7 +29,7 @@ GIT_BRANCH="${GIT_BRANCH:-master}" SEARX_PYENV="${SERVICE_HOME}/searx-pyenv" SEARX_SRC="${SERVICE_HOME}/searx-src" SEARXNG_SETTINGS_PATH="/etc/searxng/settings.yml" -SEARX_UWSGI_APP="searx.ini" +SEARXNG_UWSGI_APP="searxng.ini" # shellcheck disable=SC2034 SEARX_UWSGI_SOCKET="/run/uwsgi/app/searx/socket" @@ -125,7 +125,7 @@ APACHE_SEARX_SITE="searx.conf" # shellcheck disable=SC2034 CONFIG_FILES=( - "${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP}" + "${uWSGI_APPS_AVAILABLE}/${SEARXNG_UWSGI_APP}" ) # shellcheck disable=SC2034 @@ -367,7 +367,7 @@ pip install -U pyyaml pip install -U -e . EOF install_settings - uWSGI_restart "$SEARX_UWSGI_APP" + uWSGI_restart "$SEARXNG_UWSGI_APP" } remove_all() { @@ -729,30 +729,30 @@ EOF } install_searx_uwsgi() { - rst_title "Install SearXNG's uWSGI app (searx.ini)" section + rst_title "Install SearXNG's uWSGI app (searxng.ini)" section echo install_uwsgi - uWSGI_install_app "$SEARX_UWSGI_APP" + uWSGI_install_app "$SEARXNG_UWSGI_APP" } remove_searx_uwsgi() { - rst_title "Remove SearXNG's uWSGI app (searx.ini)" section + rst_title "Remove SearXNG's uWSGI app (searxng.ini)" section echo - uWSGI_remove_app "$SEARX_UWSGI_APP" + uWSGI_remove_app "$SEARXNG_UWSGI_APP" } activate_service() { rst_title "Activate SearXNG (service)" section echo - uWSGI_enable_app "$SEARX_UWSGI_APP" - uWSGI_restart "$SEARX_UWSGI_APP" + uWSGI_enable_app "$SEARXNG_UWSGI_APP" + uWSGI_restart "$SEARXNG_UWSGI_APP" } deactivate_service() { rst_title "De-Activate SearXNG (service)" section echo - uWSGI_disable_app "$SEARX_UWSGI_APP" - uWSGI_restart "$SEARX_UWSGI_APP" + uWSGI_disable_app "$SEARXNG_UWSGI_APP" + uWSGI_restart "$SEARXNG_UWSGI_APP" } enable_image_proxy() { @@ -761,7 +761,7 @@ enable_image_proxy() { cd ${SEARX_SRC} sed -i -e "s/image_proxy: false/image_proxy: true/g" "$SEARXNG_SETTINGS_PATH" EOF - uWSGI_restart "$SEARX_UWSGI_APP" + uWSGI_restart "$SEARXNG_UWSGI_APP" } disable_image_proxy() { @@ -770,7 +770,7 @@ disable_image_proxy() { cd ${SEARX_SRC} sed -i -e "s/image_proxy: true/image_proxy: false/g" "$SEARXNG_SETTINGS_PATH" EOF - uWSGI_restart "$SEARX_UWSGI_APP" + uWSGI_restart "$SEARXNG_UWSGI_APP" } enable_debug() { @@ -780,7 +780,7 @@ enable_debug() { cd ${SEARX_SRC} sed -i -e "s/debug: false/debug: true/g" "$SEARXNG_SETTINGS_PATH" EOF - uWSGI_restart "$SEARX_UWSGI_APP" + uWSGI_restart "$SEARXNG_UWSGI_APP" } disable_debug() { @@ -789,7 +789,7 @@ disable_debug() { cd ${SEARX_SRC} sed -i -e "s/debug: true/debug: false/g" "$SEARXNG_SETTINGS_PATH" EOF - uWSGI_restart "$SEARX_UWSGI_APP" + uWSGI_restart "$SEARXNG_UWSGI_APP" } set_result_proxy() { @@ -869,14 +869,14 @@ EOF err_msg "~$SERVICE_USER: Missing SearXNG software!" fi - if uWSGI_app_enabled "$SEARX_UWSGI_APP"; then - info_msg "uWSGI app $SEARX_UWSGI_APP is enabled." + if uWSGI_app_enabled "$SEARXNG_UWSGI_APP"; then + info_msg "uWSGI app $SEARXNG_UWSGI_APP is enabled." else - err_msg "uWSGI app $SEARX_UWSGI_APP not enabled!" + err_msg "uWSGI app $SEARXNG_UWSGI_APP not enabled!" fi - uWSGI_app_available "$SEARX_UWSGI_APP" \ - || err_msg "uWSGI app $SEARX_UWSGI_APP not available!" + uWSGI_app_available "$SEARXNG_UWSGI_APP" \ + || err_msg "uWSGI app $SEARXNG_UWSGI_APP not available!" if in_container; then lxc_suite_info @@ -955,9 +955,9 @@ excessively bot queries." apache_install_site --variant=uwsgi "${APACHE_SEARX_SITE}" - rst_title "Install SearXNG's uWSGI app (searx.ini)" section + rst_title "Install SearXNG's uWSGI app (searxng.ini)" section echo - uWSGI_install_app --variant=socket "$SEARX_UWSGI_APP" + uWSGI_install_app --variant=socket "$SEARXNG_UWSGI_APP" if ! service_is_available "${PUBLIC_URL}"; then err_msg "Public service at ${PUBLIC_URL} is not available!" @@ -979,9 +979,9 @@ This removes apache site ${APACHE_SEARX_SITE}." apache_remove_site "${APACHE_SEARX_SITE}" - rst_title "Remove SearXNG's uWSGI app (searx.ini)" section + rst_title "Remove SearXNG's uWSGI app (searxng.ini)" section echo - uWSGI_remove_app "$SEARX_UWSGI_APP" + uWSGI_remove_app "$SEARXNG_UWSGI_APP" } rst-doc() { @@ -1025,12 +1025,12 @@ rst-doc() { # For uWSGI debian uses the LSB init process, this might be changed # one day, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833067 - create ${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP} - enable: sudo -H ln -s ${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP} ${uWSGI_APPS_ENABLED}/ - start: sudo -H service uwsgi start ${SEARX_UWSGI_APP%.*} - restart: sudo -H service uwsgi restart ${SEARX_UWSGI_APP%.*} - stop: sudo -H service uwsgi stop ${SEARX_UWSGI_APP%.*} - disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP} + create ${uWSGI_APPS_AVAILABLE}/${SEARXNG_UWSGI_APP} + enable: sudo -H ln -s ${uWSGI_APPS_AVAILABLE}/${SEARXNG_UWSGI_APP} ${uWSGI_APPS_ENABLED}/ + start: sudo -H service uwsgi start ${SEARXNG_UWSGI_APP%.*} + restart: sudo -H service uwsgi restart ${SEARXNG_UWSGI_APP%.*} + stop: sudo -H service uwsgi stop ${SEARXNG_UWSGI_APP%.*} + disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARXNG_UWSGI_APP} EOF ;; @@ -1043,12 +1043,12 @@ EOF # - http://0pointer.de/blog/projects/instances.html # - https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd - create: ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP} - enable: sudo -H systemctl enable uwsgi@${SEARX_UWSGI_APP%.*} - start: sudo -H systemctl start uwsgi@${SEARX_UWSGI_APP%.*} - restart: sudo -H systemctl restart uwsgi@${SEARX_UWSGI_APP%.*} - stop: sudo -H systemctl stop uwsgi@${SEARX_UWSGI_APP%.*} - disable: sudo -H systemctl disable uwsgi@${SEARX_UWSGI_APP%.*} + create: ${uWSGI_APPS_ENABLED}/${SEARXNG_UWSGI_APP} + enable: sudo -H systemctl enable uwsgi@${SEARXNG_UWSGI_APP%.*} + start: sudo -H systemctl start uwsgi@${SEARXNG_UWSGI_APP%.*} + restart: sudo -H systemctl restart uwsgi@${SEARXNG_UWSGI_APP%.*} + stop: sudo -H systemctl stop uwsgi@${SEARXNG_UWSGI_APP%.*} + disable: sudo -H systemctl disable uwsgi@${SEARXNG_UWSGI_APP%.*} EOF ;; @@ -1060,9 +1060,9 @@ EOF # The unit file starts uWSGI in emperor mode (/etc/uwsgi.ini), see # - https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html - create: ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP} - restart: sudo -H touch ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP} - disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP} + create: ${uWSGI_APPS_ENABLED}/${SEARXNG_UWSGI_APP} + restart: sudo -H touch ${uWSGI_APPS_ENABLED}/${SEARXNG_UWSGI_APP} + disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARXNG_UWSGI_APP} EOF ;; @@ -1072,7 +1072,7 @@ EOF echo -e "\n.. START searx uwsgi-appini $DIST_NAME" echo ".. code:: bash" echo - eval "echo \"$(< "${TEMPLATES}/${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP}")\"" | prefix_stdout " " + eval "echo \"$(< "${TEMPLATES}/${uWSGI_APPS_AVAILABLE}/${SEARXNG_UWSGI_APP}")\"" | prefix_stdout " " echo -e "\n.. END searx uwsgi-appini $DIST_NAME" ) diff --git a/utils/templates/etc/httpd/sites-available/searx.conf:filtron b/utils/templates/etc/httpd/sites-available/searx.conf:filtron deleted file mode 100644 index 379d47e24..000000000 --- a/utils/templates/etc/httpd/sites-available/searx.conf:filtron +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8; mode: apache -*- - -LoadModule headers_module ${APACHE_MODULES}/mod_headers.so -LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so -LoadModule proxy_http_module ${APACHE_MODULES}/mod_proxy_http.so -#LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so - -# SetEnvIf Request_URI "${FILTRON_URL_PATH}" dontlog -# CustomLog /dev/null combined env=dontlog - -# SecRuleRemoveById 981054 -# SecRuleRemoveById 981059 -# SecRuleRemoveById 981060 -# SecRuleRemoveById 950907 - - - - - SecRuleEngine Off - - - Require all granted - - Order deny,allow - Deny from all - #Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1 - Allow from all - - ProxyPreserveHost On - ProxyPass http://${FILTRON_LISTEN} - RequestHeader set X-Script-Name ${FILTRON_URL_PATH} - - diff --git a/utils/templates/etc/httpd/sites-available/searx.conf:uwsgi b/utils/templates/etc/httpd/sites-available/searx.conf:uwsgi deleted file mode 100644 index aabc125ae..000000000 --- a/utils/templates/etc/httpd/sites-available/searx.conf:uwsgi +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8; mode: apache -*- - -LoadModule headers_module ${APACHE_MODULES}/mod_headers.so -LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so -LoadModule proxy_uwsgi_module ${APACHE_MODULES}/mod_proxy_uwsgi.so -# LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so - -# SetEnvIf Request_URI "${SEARXNG_URL_PATH}" dontlog -# CustomLog /dev/null combined env=dontlog - - - - - SecRuleEngine Off - - - Require all granted - - Order deny,allow - Deny from all - # Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1 - Allow from all - - ProxyPreserveHost On - ProxyPass unix:${SEARX_UWSGI_SOCKET}|uwsgi://uwsgi-uds-searx/ - - diff --git a/utils/templates/etc/httpd/sites-available/searxng.conf:filtron b/utils/templates/etc/httpd/sites-available/searxng.conf:filtron new file mode 100644 index 000000000..379d47e24 --- /dev/null +++ b/utils/templates/etc/httpd/sites-available/searxng.conf:filtron @@ -0,0 +1,33 @@ +# -*- coding: utf-8; mode: apache -*- + +LoadModule headers_module ${APACHE_MODULES}/mod_headers.so +LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so +LoadModule proxy_http_module ${APACHE_MODULES}/mod_proxy_http.so +#LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so + +# SetEnvIf Request_URI "${FILTRON_URL_PATH}" dontlog +# CustomLog /dev/null combined env=dontlog + +# SecRuleRemoveById 981054 +# SecRuleRemoveById 981059 +# SecRuleRemoveById 981060 +# SecRuleRemoveById 950907 + + + + + SecRuleEngine Off + + + Require all granted + + Order deny,allow + Deny from all + #Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1 + Allow from all + + ProxyPreserveHost On + ProxyPass http://${FILTRON_LISTEN} + RequestHeader set X-Script-Name ${FILTRON_URL_PATH} + + diff --git a/utils/templates/etc/httpd/sites-available/searxng.conf:uwsgi b/utils/templates/etc/httpd/sites-available/searxng.conf:uwsgi new file mode 100644 index 000000000..aabc125ae --- /dev/null +++ b/utils/templates/etc/httpd/sites-available/searxng.conf:uwsgi @@ -0,0 +1,27 @@ +# -*- coding: utf-8; mode: apache -*- + +LoadModule headers_module ${APACHE_MODULES}/mod_headers.so +LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so +LoadModule proxy_uwsgi_module ${APACHE_MODULES}/mod_proxy_uwsgi.so +# LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so + +# SetEnvIf Request_URI "${SEARXNG_URL_PATH}" dontlog +# CustomLog /dev/null combined env=dontlog + + + + + SecRuleEngine Off + + + Require all granted + + Order deny,allow + Deny from all + # Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1 + Allow from all + + ProxyPreserveHost On + ProxyPass unix:${SEARX_UWSGI_SOCKET}|uwsgi://uwsgi-uds-searx/ + + diff --git a/utils/templates/etc/nginx/default.apps-available/searx.conf:filtron b/utils/templates/etc/nginx/default.apps-available/searx.conf:filtron deleted file mode 100644 index e25461c47..000000000 --- a/utils/templates/etc/nginx/default.apps-available/searx.conf:filtron +++ /dev/null @@ -1,16 +0,0 @@ -# https://example.org/searx - -location ${SEARXNG_URL_PATH} { - proxy_pass http://127.0.0.1:4004/; - - proxy_set_header Host \$host; - proxy_set_header Connection \$http_connection; - proxy_set_header X-Real-IP \$remote_addr; - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Scheme \$scheme; - proxy_set_header X-Script-Name ${SEARXNG_URL_PATH}; -} - -location ${SEARXNG_URL_PATH}/static/ { - alias ${SEARX_SRC}/searx/static/; -} diff --git a/utils/templates/etc/nginx/default.apps-available/searxng.conf:filtron b/utils/templates/etc/nginx/default.apps-available/searxng.conf:filtron new file mode 100644 index 000000000..e25461c47 --- /dev/null +++ b/utils/templates/etc/nginx/default.apps-available/searxng.conf:filtron @@ -0,0 +1,16 @@ +# https://example.org/searx + +location ${SEARXNG_URL_PATH} { + proxy_pass http://127.0.0.1:4004/; + + proxy_set_header Host \$host; + proxy_set_header Connection \$http_connection; + proxy_set_header X-Real-IP \$remote_addr; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + proxy_set_header X-Scheme \$scheme; + proxy_set_header X-Script-Name ${SEARXNG_URL_PATH}; +} + +location ${SEARXNG_URL_PATH}/static/ { + alias ${SEARX_SRC}/searx/static/; +} diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini deleted file mode 100644 index dcb7d1a7d..000000000 --- a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini +++ /dev/null @@ -1,88 +0,0 @@ -[uwsgi] - -# uWSGI core -# ---------- -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core - -# Who will run the code -uid = ${SERVICE_USER} -gid = ${SERVICE_GROUP} - -# set (python) default encoding UTF-8 -env = LANG=C.UTF-8 -env = LANGUAGE=C.UTF-8 -env = LC_ALL=C.UTF-8 - -# chdir to specified directory before apps loading -chdir = ${SEARX_SRC}/searx - -# searx configuration (settings.yml) -env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH} - -# disable logging for privacy -logger = systemd -disable-logging = true - -# The right granted on the created socket -chmod-socket = 666 - -# Plugin to use and interpretor config -single-interpreter = true - -# enable master process -master = true - -# load apps in each worker instead of the master -lazy-apps = true - -# load uWSGI plugins -plugin = python - -# By default the Python plugin does not initialize the GIL. This means your -# app-generated threads will not run. If you need threads, remember to enable -# them with enable-threads. Running uWSGI in multithreading mode (with the -# threads options) will automatically enable threading support. This *strange* -# default behaviour is for performance reasons. -enable-threads = true - - -# plugin: python -# -------------- -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python - -# load a WSGI module -module = searx.webapp - -# set PYTHONHOME/virtualenv -virtualenv = ${SEARX_PYENV} - -# add directory (or glob) to pythonpath -pythonpath = ${SEARX_SRC} - - -# speak to upstream -# ----------------- -# -# Activate the 'http' configuration for filtron or activate the 'socket' -# configuration if you setup your HTTP server to use uWSGI protocol via sockets. - -# using IP: -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http -# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html - -http = ${SEARX_INTERNAL_HTTP} - -# using unix-sockets: -# -# On some distributions you need to create the app folder for the sockets:: -# -# mkdir -p /run/uwsgi/app/searx -# chown -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx -# -# socket = /run/uwsgi/app/searx/socket - -# Cache -cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1 diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket deleted file mode 100644 index 580600072..000000000 --- a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket +++ /dev/null @@ -1,85 +0,0 @@ -[uwsgi] - -# uWSGI core -# ---------- -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core - -# Who will run the code -uid = ${SERVICE_USER} -gid = ${SERVICE_GROUP} - -# set (python) default encoding UTF-8 -env = LANG=C.UTF-8 -env = LANGUAGE=C.UTF-8 -env = LC_ALL=C.UTF-8 - -# chdir to specified directory before apps loading -chdir = ${SEARX_SRC}/searx - -# searx configuration (settings.yml) -env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH} - -# disable logging for privacy -logger = systemd -disable-logging = true - -# The right granted on the created socket -chmod-socket = 666 - -# Plugin to use and interpretor config -single-interpreter = true - -# enable master process -master = true - -# load apps in each worker instead of the master -lazy-apps = true - -# load uWSGI plugins -plugin = python - -# By default the Python plugin does not initialize the GIL. This means your -# app-generated threads will not run. If you need threads, remember to enable -# them with enable-threads. Running uWSGI in multithreading mode (with the -# threads options) will automatically enable threading support. This *strange* -# default behaviour is for performance reasons. -enable-threads = true - - -# plugin: python -# -------------- -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python - -# load a WSGI module -module = searx.webapp - -# set PYTHONHOME/virtualenv -virtualenv = ${SEARX_PYENV} - -# add directory (or glob) to pythonpath -pythonpath = ${SEARX_SRC} - - -# speak to upstream -# ----------------- -# -# Activate the 'http' configuration for filtron or activate the 'socket' -# configuration if you setup your HTTP server to use uWSGI protocol via sockets. - -# using IP: -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http -# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html - -# http = ${SEARX_INTERNAL_HTTP} - -# using unix-sockets: -# -# On some distributions you need to create the app folder for the sockets:: -# -# mkdir -p /run/uwsgi/app/searx -# chown -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx -# -socket = /run/uwsgi/app/searx/socket \ No newline at end of file diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini new file mode 100644 index 000000000..dcb7d1a7d --- /dev/null +++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini @@ -0,0 +1,88 @@ +[uwsgi] + +# uWSGI core +# ---------- +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core + +# Who will run the code +uid = ${SERVICE_USER} +gid = ${SERVICE_GROUP} + +# set (python) default encoding UTF-8 +env = LANG=C.UTF-8 +env = LANGUAGE=C.UTF-8 +env = LC_ALL=C.UTF-8 + +# chdir to specified directory before apps loading +chdir = ${SEARX_SRC}/searx + +# searx configuration (settings.yml) +env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH} + +# disable logging for privacy +logger = systemd +disable-logging = true + +# The right granted on the created socket +chmod-socket = 666 + +# Plugin to use and interpretor config +single-interpreter = true + +# enable master process +master = true + +# load apps in each worker instead of the master +lazy-apps = true + +# load uWSGI plugins +plugin = python + +# By default the Python plugin does not initialize the GIL. This means your +# app-generated threads will not run. If you need threads, remember to enable +# them with enable-threads. Running uWSGI in multithreading mode (with the +# threads options) will automatically enable threading support. This *strange* +# default behaviour is for performance reasons. +enable-threads = true + + +# plugin: python +# -------------- +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python + +# load a WSGI module +module = searx.webapp + +# set PYTHONHOME/virtualenv +virtualenv = ${SEARX_PYENV} + +# add directory (or glob) to pythonpath +pythonpath = ${SEARX_SRC} + + +# speak to upstream +# ----------------- +# +# Activate the 'http' configuration for filtron or activate the 'socket' +# configuration if you setup your HTTP server to use uWSGI protocol via sockets. + +# using IP: +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http +# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html + +http = ${SEARX_INTERNAL_HTTP} + +# using unix-sockets: +# +# On some distributions you need to create the app folder for the sockets:: +# +# mkdir -p /run/uwsgi/app/searx +# chown -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx +# +# socket = /run/uwsgi/app/searx/socket + +# Cache +cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1 diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket new file mode 100644 index 000000000..580600072 --- /dev/null +++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket @@ -0,0 +1,85 @@ +[uwsgi] + +# uWSGI core +# ---------- +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core + +# Who will run the code +uid = ${SERVICE_USER} +gid = ${SERVICE_GROUP} + +# set (python) default encoding UTF-8 +env = LANG=C.UTF-8 +env = LANGUAGE=C.UTF-8 +env = LC_ALL=C.UTF-8 + +# chdir to specified directory before apps loading +chdir = ${SEARX_SRC}/searx + +# searx configuration (settings.yml) +env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH} + +# disable logging for privacy +logger = systemd +disable-logging = true + +# The right granted on the created socket +chmod-socket = 666 + +# Plugin to use and interpretor config +single-interpreter = true + +# enable master process +master = true + +# load apps in each worker instead of the master +lazy-apps = true + +# load uWSGI plugins +plugin = python + +# By default the Python plugin does not initialize the GIL. This means your +# app-generated threads will not run. If you need threads, remember to enable +# them with enable-threads. Running uWSGI in multithreading mode (with the +# threads options) will automatically enable threading support. This *strange* +# default behaviour is for performance reasons. +enable-threads = true + + +# plugin: python +# -------------- +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python + +# load a WSGI module +module = searx.webapp + +# set PYTHONHOME/virtualenv +virtualenv = ${SEARX_PYENV} + +# add directory (or glob) to pythonpath +pythonpath = ${SEARX_SRC} + + +# speak to upstream +# ----------------- +# +# Activate the 'http' configuration for filtron or activate the 'socket' +# configuration if you setup your HTTP server to use uWSGI protocol via sockets. + +# using IP: +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http +# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html + +# http = ${SEARX_INTERNAL_HTTP} + +# using unix-sockets: +# +# On some distributions you need to create the app folder for the sockets:: +# +# mkdir -p /run/uwsgi/app/searx +# chown -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx +# +socket = /run/uwsgi/app/searx/socket \ No newline at end of file diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini b/utils/templates/etc/uwsgi/apps-available/searx.ini deleted file mode 100644 index 440c2e97d..000000000 --- a/utils/templates/etc/uwsgi/apps-available/searx.ini +++ /dev/null @@ -1,87 +0,0 @@ -[uwsgi] - -# uWSGI core -# ---------- -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core - -# Who will run the code -uid = ${SERVICE_USER} -gid = ${SERVICE_GROUP} - -# set (python) default encoding UTF-8 -env = LANG=C.UTF-8 -env = LANGUAGE=C.UTF-8 -env = LC_ALL=C.UTF-8 - -# chdir to specified directory before apps loading -chdir = ${SEARX_SRC}/searx - -# searx configuration (settings.yml) -env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH} - -# disable logging for privacy -disable-logging = true - -# The right granted on the created socket -chmod-socket = 666 - -# Plugin to use and interpretor config -single-interpreter = true - -# enable master process -master = true - -# load apps in each worker instead of the master -lazy-apps = true - -# load uWSGI plugins -plugin = python3,http - -# By default the Python plugin does not initialize the GIL. This means your -# app-generated threads will not run. If you need threads, remember to enable -# them with enable-threads. Running uWSGI in multithreading mode (with the -# threads options) will automatically enable threading support. This *strange* -# default behaviour is for performance reasons. -enable-threads = true - - -# plugin: python -# -------------- -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python - -# load a WSGI module -module = searx.webapp - -# set PYTHONHOME/virtualenv -virtualenv = ${SEARX_PYENV} - -# add directory (or glob) to pythonpath -pythonpath = ${SEARX_SRC} - - -# speak to upstream -# ----------------- -# -# Activate the 'http' configuration for filtron or activate the 'socket' -# configuration if you setup your HTTP server to use uWSGI protocol via sockets. - -# using IP: -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http -# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html - -http = ${SEARX_INTERNAL_HTTP} - -# using unix-sockets: -# -# On some distributions you need to create the app folder for the sockets:: -# -# mkdir -p /run/uwsgi/app/searx -# chown -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx -# -# socket = /run/uwsgi/app/searx/socket - -# Cache -cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1 diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini:socket b/utils/templates/etc/uwsgi/apps-available/searx.ini:socket deleted file mode 100644 index 08c98cf61..000000000 --- a/utils/templates/etc/uwsgi/apps-available/searx.ini:socket +++ /dev/null @@ -1,84 +0,0 @@ -[uwsgi] - -# uWSGI core -# ---------- -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core - -# Who will run the code -uid = ${SERVICE_USER} -gid = ${SERVICE_GROUP} - -# set (python) default encoding UTF-8 -env = LANG=C.UTF-8 -env = LANGUAGE=C.UTF-8 -env = LC_ALL=C.UTF-8 - -# chdir to specified directory before apps loading -chdir = ${SEARX_SRC}/searx - -# searx configuration (settings.yml) -env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH} - -# disable logging for privacy -disable-logging = true - -# The right granted on the created socket -chmod-socket = 666 - -# Plugin to use and interpretor config -single-interpreter = true - -# enable master process -master = true - -# load apps in each worker instead of the master -lazy-apps = true - -# load uWSGI plugins -plugin = python3,http - -# By default the Python plugin does not initialize the GIL. This means your -# app-generated threads will not run. If you need threads, remember to enable -# them with enable-threads. Running uWSGI in multithreading mode (with the -# threads options) will automatically enable threading support. This *strange* -# default behaviour is for performance reasons. -enable-threads = true - - -# plugin: python -# -------------- -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python - -# load a WSGI module -module = searx.webapp - -# set PYTHONHOME/virtualenv -virtualenv = ${SEARX_PYENV} - -# add directory (or glob) to pythonpath -pythonpath = ${SEARX_SRC} - - -# speak to upstream -# ----------------- -# -# Activate the 'http' configuration for filtron or activate the 'socket' -# configuration if you setup your HTTP server to use uWSGI protocol via sockets. - -# using IP: -# -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http -# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html - -# http = ${SEARX_INTERNAL_HTTP} - -# using unix-sockets: -# -# On some distributions you need to create the app folder for the sockets:: -# -# mkdir -p /run/uwsgi/app/searx -# chown -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx -# -socket = /run/uwsgi/app/searx/socket \ No newline at end of file diff --git a/utils/templates/etc/uwsgi/apps-available/searxng.ini b/utils/templates/etc/uwsgi/apps-available/searxng.ini new file mode 100644 index 000000000..440c2e97d --- /dev/null +++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini @@ -0,0 +1,87 @@ +[uwsgi] + +# uWSGI core +# ---------- +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core + +# Who will run the code +uid = ${SERVICE_USER} +gid = ${SERVICE_GROUP} + +# set (python) default encoding UTF-8 +env = LANG=C.UTF-8 +env = LANGUAGE=C.UTF-8 +env = LC_ALL=C.UTF-8 + +# chdir to specified directory before apps loading +chdir = ${SEARX_SRC}/searx + +# searx configuration (settings.yml) +env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH} + +# disable logging for privacy +disable-logging = true + +# The right granted on the created socket +chmod-socket = 666 + +# Plugin to use and interpretor config +single-interpreter = true + +# enable master process +master = true + +# load apps in each worker instead of the master +lazy-apps = true + +# load uWSGI plugins +plugin = python3,http + +# By default the Python plugin does not initialize the GIL. This means your +# app-generated threads will not run. If you need threads, remember to enable +# them with enable-threads. Running uWSGI in multithreading mode (with the +# threads options) will automatically enable threading support. This *strange* +# default behaviour is for performance reasons. +enable-threads = true + + +# plugin: python +# -------------- +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python + +# load a WSGI module +module = searx.webapp + +# set PYTHONHOME/virtualenv +virtualenv = ${SEARX_PYENV} + +# add directory (or glob) to pythonpath +pythonpath = ${SEARX_SRC} + + +# speak to upstream +# ----------------- +# +# Activate the 'http' configuration for filtron or activate the 'socket' +# configuration if you setup your HTTP server to use uWSGI protocol via sockets. + +# using IP: +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http +# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html + +http = ${SEARX_INTERNAL_HTTP} + +# using unix-sockets: +# +# On some distributions you need to create the app folder for the sockets:: +# +# mkdir -p /run/uwsgi/app/searx +# chown -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx +# +# socket = /run/uwsgi/app/searx/socket + +# Cache +cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1 diff --git a/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket new file mode 100644 index 000000000..08c98cf61 --- /dev/null +++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket @@ -0,0 +1,84 @@ +[uwsgi] + +# uWSGI core +# ---------- +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core + +# Who will run the code +uid = ${SERVICE_USER} +gid = ${SERVICE_GROUP} + +# set (python) default encoding UTF-8 +env = LANG=C.UTF-8 +env = LANGUAGE=C.UTF-8 +env = LC_ALL=C.UTF-8 + +# chdir to specified directory before apps loading +chdir = ${SEARX_SRC}/searx + +# searx configuration (settings.yml) +env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH} + +# disable logging for privacy +disable-logging = true + +# The right granted on the created socket +chmod-socket = 666 + +# Plugin to use and interpretor config +single-interpreter = true + +# enable master process +master = true + +# load apps in each worker instead of the master +lazy-apps = true + +# load uWSGI plugins +plugin = python3,http + +# By default the Python plugin does not initialize the GIL. This means your +# app-generated threads will not run. If you need threads, remember to enable +# them with enable-threads. Running uWSGI in multithreading mode (with the +# threads options) will automatically enable threading support. This *strange* +# default behaviour is for performance reasons. +enable-threads = true + + +# plugin: python +# -------------- +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python + +# load a WSGI module +module = searx.webapp + +# set PYTHONHOME/virtualenv +virtualenv = ${SEARX_PYENV} + +# add directory (or glob) to pythonpath +pythonpath = ${SEARX_SRC} + + +# speak to upstream +# ----------------- +# +# Activate the 'http' configuration for filtron or activate the 'socket' +# configuration if you setup your HTTP server to use uWSGI protocol via sockets. + +# using IP: +# +# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http +# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html + +# http = ${SEARX_INTERNAL_HTTP} + +# using unix-sockets: +# +# On some distributions you need to create the app folder for the sockets:: +# +# mkdir -p /run/uwsgi/app/searx +# chown -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx +# +socket = /run/uwsgi/app/searx/socket \ No newline at end of file -- cgit v1.2.3 From 38482739de32ee6a6a41763c5b992c1ad689eb2e Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 29 Oct 2021 18:09:44 +0200 Subject: [mod] utils/searx.sh - check a SearXNG installation Signed-off-by: Markus Heiser --- utils/searx.sh | 74 +++++++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 34 deletions(-) (limited to 'utils') diff --git a/utils/searx.sh b/utils/searx.sh index 3f50646e3..baac48a90 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -141,7 +141,7 @@ usage() { cat < Date: Fri, 29 Oct 2021 20:54:30 +0200 Subject: [mod] utils/searx.sh - apache, nginx & uwsgi check old 'searx' installations Signed-off-by: Markus Heiser --- utils/filtron.sh | 9 +++++++++ utils/searx.sh | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'utils') diff --git a/utils/filtron.sh b/utils/filtron.sh index e9fc79c87..1b33e6277 100755 --- a/utils/filtron.sh +++ b/utils/filtron.sh @@ -274,6 +274,15 @@ install_check() { else info_msg "golang $(go_version) is installed (min needed is: $GO_VERSION)" fi + + if [ -f "${APACHE_SITES_AVAILABLE}/searx.conf" ]; then + warn_msg "old searx.conf apache site exists" + fi + + if [ -f "${NGINX_APPS_AVAILABLE}/searx.conf" ]; then + warn_msg "old searx.conf nginx site exists" + fi + } go_version(){ diff --git a/utils/searx.sh b/utils/searx.sh index baac48a90..3528f1da2 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -382,6 +382,10 @@ install_check() { || err_msg "uWSGI app $SEARXNG_UWSGI_APP not available!" sudo -H -u "${SERVICE_USER}" "${SEARX_PYENV}/bin/python" "utils/searxng_check.py" + + if uWSGI_app_available 'searx.ini'; then + warn_msg "old searx.ini uWSGI app exists" + fi } update_searx() { -- cgit v1.2.3 From db6a4d13e7ebe08a5df4fe6f99b0ef87aac94cc8 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 30 Oct 2021 16:06:14 +0200 Subject: [mod] searx, filtron & morty scripts: add 'reinstall all' command Signed-off-by: Markus Heiser --- utils/filtron.sh | 17 ++++++++++++++++- utils/morty.sh | 14 ++++++++++++++ utils/searx.sh | 14 ++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/filtron.sh b/utils/filtron.sh index 1b33e6277..fa661ab8b 100755 --- a/utils/filtron.sh +++ b/utils/filtron.sh @@ -64,6 +64,7 @@ usage() { usage:: $(basename "$0") shell $(basename "$0") install [all|user|rules] + $(basename "$0") reinstall all $(basename "$0") update [filtron] $(basename "$0") remove [all] $(basename "$0") activate [service] @@ -77,9 +78,12 @@ shell start interactive shell from user ${SERVICE_USER} install / remove :all: complete setup of filtron service - :check: check the filtron installation :user: add/remove service user '$SERVICE_USER' ($SERVICE_HOME) :rules: reinstall filtron rules $FILTRON_RULES +install + :check: check the filtron installation +reinstall: + :all: runs 'install/remove all' update filtron Update filtron installation ($SERVICE_HOME) activate service @@ -133,6 +137,16 @@ main() { ;; *) usage "$_usage"; exit 42;; esac ;; + reinstall) + rst_title "re-install $SERVICE_NAME" part + sudo_or_exit + case $2 in + all) + remove_all + install_all + ;; + *) usage "$_usage"; exit 42;; + esac ;; install) rst_title "$SERVICE_NAME" part sudo_or_exit @@ -271,6 +285,7 @@ install_check() { if [[ "${GO_VERSION}" > "$(go_version)" ]]; then warn_msg "golang ($(go_version)) needs to be $GO_VERSION at least" + warn_msg "you need to reinstall $SERVICE_USER --> $0 reinstall all" else info_msg "golang $(go_version) is installed (min needed is: $GO_VERSION)" fi diff --git a/utils/morty.sh b/utils/morty.sh index fdbe2b54e..e1481016f 100755 --- a/utils/morty.sh +++ b/utils/morty.sh @@ -49,6 +49,7 @@ usage() { usage:: $(basename "$0") shell $(basename "$0") install [all|check|user] + $(basename "$0") reinstall all $(basename "$0") update [morty] $(basename "$0") remove [all] $(basename "$0") activate [service] @@ -66,6 +67,8 @@ install / remove :user: add/remove service user '$SERVICE_USER' ($SERVICE_HOME) install :check: check the morty installation +reinstall: + :all: runs 'install/remove all' update morty Update morty installation ($SERVICE_HOME) activate service @@ -145,6 +148,16 @@ main() { ;; *) usage "$_usage"; exit 42;; esac ;; + reinstall) + rst_title "re-install $SERVICE_NAME" part + sudo_or_exit + case $2 in + all) + remove_all + install_all + ;; + *) usage "$_usage"; exit 42;; + esac ;; install) rst_title "$SERVICE_NAME" part sudo_or_exit @@ -286,6 +299,7 @@ install_check() { if [[ "${GO_VERSION}" > "$(go_version)" ]]; then warn_msg "golang ($(go_version)) needs to be $GO_VERSION at least" + warn_msg "you need to reinstall $SERVICE_USER --> $0 reinstall all" else info_msg "golang $(go_version) is installed (min needed is: $GO_VERSION)" fi diff --git a/utils/searx.sh b/utils/searx.sh index 3528f1da2..79cd2f26d 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -142,6 +142,7 @@ usage() { usage:: $(basename "$0") shell $(basename "$0") install [all|check|init-src|dot-config|user|searx-src|pyenv|uwsgi|packages|settings|buildhost] + $(basename "$0") reinstall all $(basename "$0") update [searx] $(basename "$0") remove [all|user|pyenv|searx-src] $(basename "$0") activate [service] @@ -165,6 +166,8 @@ install / remove :buildhost: install packages from OS package manager needed by buildhosts install :check: check the SearXNG installation +reinstall: + :all: runs 'install/remove all' update searx Update SearXNG installation ($SERVICE_HOME) activate service @@ -214,6 +217,16 @@ main() { ;; *) usage "$_usage"; exit 42;; esac ;; + reinstall) + rst_title "re-install $SERVICE_NAME" part + sudo_or_exit + case $2 in + all) + remove_all + install_all + ;; + *) usage "$_usage"; exit 42;; + esac ;; install) sudo_or_exit case $2 in @@ -385,6 +398,7 @@ install_check() { if uWSGI_app_available 'searx.ini'; then warn_msg "old searx.ini uWSGI app exists" + warn_msg "you need to reinstall $SERVICE_USER --> $0 reinstall all" fi } -- cgit v1.2.3