From e48e2a99144b930e7f1fde3fd47d4782b92f819c Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 8 Mar 2022 17:18:02 +0100 Subject: [PATCH 1/5] [fix] APACHE_SEARX_SITE=searxng.conf renamed in 2b125214 Signed-off-by: Markus Heiser --- utils/searx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/searx.sh b/utils/searx.sh index 819afef13..13ae25a07 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -118,7 +118,7 @@ case $DIST_ID-$DIST_VERS in esac # Apache Settings -APACHE_SEARX_SITE="searx.conf" +APACHE_SEARX_SITE="searxng.conf" # shellcheck disable=SC2034 CONFIG_FILES=( From 5eedd5b72ac2b39bd70b08c179b7bc3b4e6e64a4 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 8 Mar 2022 17:36:49 +0100 Subject: [PATCH 2/5] [fix] socket in SearXNG's uWSGI app (searxng.ini) Use SEARX_UWSGI_SOCKET in uWSGI systemd service Signed-off-by: Markus Heiser --- utils/searx.sh | 2 +- utils/templates/etc/uwsgi/apps-archlinux/searxng.ini | 7 ++++--- .../templates/etc/uwsgi/apps-archlinux/searxng.ini:socket | 7 ++++--- utils/templates/etc/uwsgi/apps-available/searxng.ini | 7 ++++--- .../templates/etc/uwsgi/apps-available/searxng.ini:socket | 7 ++++--- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/utils/searx.sh b/utils/searx.sh index 13ae25a07..5ae9a6ade 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -31,7 +31,7 @@ SEARX_SRC="${SERVICE_HOME}/searx-src" SEARXNG_SETTINGS_PATH="/etc/searxng/settings.yml" SEARXNG_UWSGI_APP="searxng.ini" # shellcheck disable=SC2034 -SEARX_UWSGI_SOCKET="/run/uwsgi/app/searx/socket" +SEARX_UWSGI_SOCKET="/run/uwsgi/app/searxng/socket" # apt packages SEARX_PACKAGES_debian="\ diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini index ceaec19c2..8fd62b708 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini +++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini @@ -1,3 +1,4 @@ +# -*- mode: conf; coding: utf-8 -*- [uwsgi] # uWSGI core @@ -79,10 +80,10 @@ http = ${SEARX_INTERNAL_HTTP} # # 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 +# mkdir -p ${SEARX_UWSGI_SOCKET} +# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET} # -# socket = /run/uwsgi/app/searx/socket +# socket = ${SEARX_UWSGI_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 index fec553165..41ed8c1e8 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket +++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket @@ -1,3 +1,4 @@ +# -*- mode: conf; coding: utf-8 -*- [uwsgi] # uWSGI core @@ -79,7 +80,7 @@ pythonpath = ${SEARX_SRC} # # 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 +# mkdir -p ${SEARX_UWSGI_SOCKET} +# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET} # -socket = /run/uwsgi/app/searx/socket \ No newline at end of file +socket = ${SEARX_UWSGI_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 index db11df54f..618a01cea 100644 --- a/utils/templates/etc/uwsgi/apps-available/searxng.ini +++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini @@ -1,3 +1,4 @@ +# -*- mode: conf; coding: utf-8 -*- [uwsgi] # uWSGI core @@ -78,10 +79,10 @@ http = ${SEARX_INTERNAL_HTTP} # # 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 +# mkdir -p /run/uwsgi/app/searxng +# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET} # -# socket = /run/uwsgi/app/searx/socket +# socket = ${SEARX_UWSGI_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 index a9598b52b..d247ec5af 100644 --- a/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket +++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket @@ -1,3 +1,4 @@ +# -*- mode: conf; coding: utf-8 -*- [uwsgi] # uWSGI core @@ -78,7 +79,7 @@ pythonpath = ${SEARX_SRC} # # 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 +# mkdir -p ${SEARX_UWSGI_SOCKET} +# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET} # -socket = /run/uwsgi/app/searx/socket \ No newline at end of file +socket = ${SEARX_UWSGI_SOCKET} \ No newline at end of file From 8d69ee5e7f5c0115a5db957f2016fee55d4b1ac1 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 8 Mar 2022 18:13:13 +0100 Subject: [PATCH 3/5] [mod] Serving static files with uWSGI (searxng.ini) 1. Serving static files with uWSGI by using static file mount points [1]. 2. Expires set to one year since there are hashes [2] [1] https://uwsgi-docs.readthedocs.io/en/latest/StaticFiles.html#mode-3-using-static-file-mount-points [2] https://github.com/searxng/searxng/pull/932 Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-archlinux/searxng.ini | 9 ++++++++- .../etc/uwsgi/apps-archlinux/searxng.ini:socket | 12 +++++++++++- utils/templates/etc/uwsgi/apps-available/searxng.ini | 9 ++++++++- .../etc/uwsgi/apps-available/searxng.ini:socket | 12 +++++++++++- 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini index 8fd62b708..aaf55a807 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini +++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini @@ -85,5 +85,12 @@ http = ${SEARX_INTERNAL_HTTP} # # socket = ${SEARX_UWSGI_SOCKET} +# uwsgi serves the static files +# expires set to one year since there are hashes +static-map = /static=${SEARX_SRC}/searx/static +static-expires = /* 31557600 +static-gzip-all = True +offload-threads = %k + # Cache -cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1 +cache2 = name=searxngcache,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 index 41ed8c1e8..e8facda86 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket +++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket @@ -83,4 +83,14 @@ pythonpath = ${SEARX_SRC} # mkdir -p ${SEARX_UWSGI_SOCKET} # chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET} # -socket = ${SEARX_UWSGI_SOCKET} \ No newline at end of file +socket = ${SEARX_UWSGI_SOCKET} + +# uwsgi serves the static files +# expires set to one year since there are hashes +static-map = /static=${SEARX_SRC}/searx/static +static-expires = /* 31557600 +static-gzip-all = True +offload-threads = %k + +# Cache +cache2 = name=searxngcache,items=2000,blocks=2000,blocksize=4096,bitmap=1 diff --git a/utils/templates/etc/uwsgi/apps-available/searxng.ini b/utils/templates/etc/uwsgi/apps-available/searxng.ini index 618a01cea..9dad84c16 100644 --- a/utils/templates/etc/uwsgi/apps-available/searxng.ini +++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini @@ -84,5 +84,12 @@ http = ${SEARX_INTERNAL_HTTP} # # socket = ${SEARX_UWSGI_SOCKET} +# uwsgi serves the static files +# expires set to one year since there are hashes +static-map = /static=${SEARX_SRC}/searx/static +static-expires = /* 31557600 +static-gzip-all = True +offload-threads = %k + # Cache -cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1 +cache2 = name=searxngcache,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 index d247ec5af..c76d084e1 100644 --- a/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket +++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket @@ -82,4 +82,14 @@ pythonpath = ${SEARX_SRC} # mkdir -p ${SEARX_UWSGI_SOCKET} # chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET} # -socket = ${SEARX_UWSGI_SOCKET} \ No newline at end of file +socket = ${SEARX_UWSGI_SOCKET} + +# uwsgi serves the static files +# expires set to one year since there are hashes +static-map = /static=${SEARX_SRC}/searx/static +static-expires = /* 31557600 +static-gzip-all = True +offload-threads = %k + +# Cache +cache2 = name=searxngcache,items=2000,blocks=2000,blocksize=4096,bitmap=1 From 1c79c1a3d2e7f18c198492c8d7bdc18911f26c04 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 12 Mar 2022 16:51:42 +0100 Subject: [PATCH 4/5] [LXC] fedora33 EOL [1], upgrade to fedora35 [2] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [1] https://docs.fedoraproject.org/en-US/releases/eol/ [2] https://docs.fedoraproject.org/en-US/releases/f35/ Tested by:: # build the container .. $ sudo -H ./utils/lxc.sh build searx-fedora35 # open a shell in the container $ sudo -H ./utils/lxc.sh cmd searx-fedora35 bash [root@searx-fedora35 SearXNG]# # install a complete SearXNG suite .. [root@searx-fedora35 SearXNG]# ./utils/searx.sh install all ... # install apache to export the SearXNG instance by HTTP [root@searx-fedora35 SearXNG]# ./utils/searx.sh apache install ... INFO: got 200 from http://10.174.184.94/searx To build wheel `python3-devel` needs to be added to SEARX_PACKAGES_fedora:: |searx| × Building wheel for setproctitle (pyproject.toml) did not run successfully. |searx| │ exit code: 1 ... |searx| In file included from src/spt.h:15, |searx| from src/setproctitle.c:14: |searx| src/spt_python.h:16:10: fatal error: Python.h: No such file or directory |searx| 16 | #include |searx| | ^~~~~~~~~~ |searx| compilation terminated. |searx| error: command '/usr/bin/gcc' failed with exit code 1 |searx| [end of output] ... |searx| ERROR: Failed building wheel for setproctitle Signed-off-by: Markus Heiser --- utils/lxc-searx.env | 2 +- utils/lxc.sh | 2 +- utils/searx.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/lxc-searx.env b/utils/lxc-searx.env index 6d9a48a43..f02f919ee 100644 --- a/utils/lxc-searx.env +++ b/utils/lxc-searx.env @@ -26,7 +26,7 @@ lxc_set_suite_env() { "$LINUXCONTAINERS_ORG_NAME:ubuntu/20.10" "ubu2010" # July 2021 # EOL see https://fedoraproject.org/wiki/Releases - "$LINUXCONTAINERS_ORG_NAME:fedora/33" "fedora33" + "$LINUXCONTAINERS_ORG_NAME:fedora/35" "fedora35" # rolling releases see https://www.archlinux.org/releng/releases/ "$LINUXCONTAINERS_ORG_NAME:archlinux" "archlinux" diff --git a/utils/lxc.sh b/utils/lxc.sh index ab96a99ce..0b4e246df 100755 --- a/utils/lxc.sh +++ b/utils/lxc.sh @@ -51,7 +51,7 @@ echo 'Set disable_coredump false' >> /etc/sudo.conf " # shellcheck disable=SC2034 -fedora33_boilerplate=" +fedora35_boilerplate=" dnf update -y dnf install -y git curl wget hostname echo 'Set disable_coredump false' >> /etc/sudo.conf diff --git a/utils/searx.sh b/utils/searx.sh index 5ae9a6ade..ce118ed77 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -58,9 +58,9 @@ texlive-core texlive-latexextra ttf-dejavu" # dnf packages SEARX_PACKAGES_fedora="\ -python python-pip python-lxml python-babel +python python-pip python-lxml python-babel python3-devel uwsgi uwsgi-plugin-python3 -git @development-tools libxml2 +git @development-tools libxml2 openssl ShellCheck" BUILD_PACKAGES_fedora="\ From 7308a6e33c0aaad67ff214be5eb984e6900866f2 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 12 Mar 2022 18:00:45 +0100 Subject: [PATCH 5/5] [LXC] ubuntu 20.10 EOL, upgrade to ubunut 21.10 [1] [1] https://wiki.ubuntu.com/Releases Tested by:: # build the container .. $ sudo -H ./utils/lxc.sh build searx-ubu2110 # open a shell in the container $ sudo -H ./utils/lxc.sh cmd searx-ubu2110 bash [root@searx-ubu2110 SearXNG]# # install a complete SearXNG suite .. [root@searx-ubu2110 SearXNG]# ./utils/searx.sh install all ... # install apache to export the SearXNG instance by HTTP [root@searx-ubu2110 SearXNG]# ./utils/searx.sh apache install ... INFO: got 200 from http://10.174.184.94/searx Signed-off-by: Markus Heiser --- utils/lxc-searx.env | 2 +- utils/lxc.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/lxc-searx.env b/utils/lxc-searx.env index f02f919ee..13b15522c 100644 --- a/utils/lxc-searx.env +++ b/utils/lxc-searx.env @@ -23,7 +23,7 @@ lxc_set_suite_env() { # end of standard support see https://wiki.ubuntu.com/Releases "$LINUXCONTAINERS_ORG_NAME:ubuntu/18.04" "ubu1804" # April 2023 "$LINUXCONTAINERS_ORG_NAME:ubuntu/20.04" "ubu2004" # April 2025 - "$LINUXCONTAINERS_ORG_NAME:ubuntu/20.10" "ubu2010" # July 2021 + "$LINUXCONTAINERS_ORG_NAME:ubuntu/21.10" "ubu2110" # July 2027 # EOL see https://fedoraproject.org/wiki/Releases "$LINUXCONTAINERS_ORG_NAME:fedora/35" "fedora35" diff --git a/utils/lxc.sh b/utils/lxc.sh index 0b4e246df..9754b5d75 100755 --- a/utils/lxc.sh +++ b/utils/lxc.sh @@ -41,7 +41,7 @@ echo 'Set disable_coredump false' >> /etc/sudo.conf " # shellcheck disable=SC2034 -ubu2010_boilerplate="$ubu1904_boilerplate" +ubu2110_boilerplate="$ubu1904_boilerplate" # shellcheck disable=SC2034 archlinux_boilerplate="