From 89df9d91412c2ebb8817e72c0ca9c8cfc5852f66 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 16 Jan 2020 14:01:38 +0100 Subject: utils/searx.sh: add script to install isolated searx service (WIP) Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-available/searx.ini | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 utils/templates/etc/uwsgi/apps-available/searx.ini (limited to 'utils/templates/etc/uwsgi/apps-available') diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini b/utils/templates/etc/uwsgi/apps-available/searx.ini new file mode 100644 index 000000000..138a57384 --- /dev/null +++ b/utils/templates/etc/uwsgi/apps-available/searx.ini @@ -0,0 +1,62 @@ +[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} + +# chdir to specified directory before apps loading +chdir = ${SEARX_SRC} + +# 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 + +# 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 = ${SERVICE_HOME} + + +# plugin http +# ----------- +# +# 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_URL} -- cgit v1.2.3 From 9b5a7f7559faf121e44ba3e7260290bd7efe74bf Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 20 Jan 2020 16:55:05 +0100 Subject: utils/searx.sh: add script to install isolated searx service First version which serves searx over uwsgi at http://127.0.0.1:8888 Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-available/searx.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'utils/templates/etc/uwsgi/apps-available') diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini b/utils/templates/etc/uwsgi/apps-available/searx.ini index 138a57384..d3893b3ad 100644 --- a/utils/templates/etc/uwsgi/apps-available/searx.ini +++ b/utils/templates/etc/uwsgi/apps-available/searx.ini @@ -10,7 +10,7 @@ uid = ${SERVICE_USER} gid = ${SERVICE_GROUP} # chdir to specified directory before apps loading -chdir = ${SEARX_SRC} +chdir = ${SEARX_SRC}/searx # disable logging for privacy disable-logging = true @@ -28,7 +28,7 @@ master = true lazy-apps = true # load uWSGI plugins -plugin = python3 +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 @@ -50,7 +50,7 @@ module = searx.webapp virtualenv = ${SEARX_PYENV} # add directory (or glob) to pythonpath -pythonpath = ${SERVICE_HOME} +pythonpath = ${SEARX_SRC} # plugin http -- cgit v1.2.3 From 971a8264b2e21dd844d2cc2b54686def8ba18c06 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 27 Jan 2020 19:08:40 +0100 Subject: utils/searx.sh: add apache site searx.conf:uwsgi (WIP) Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-available/searx.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/templates/etc/uwsgi/apps-available') diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini b/utils/templates/etc/uwsgi/apps-available/searx.ini index d3893b3ad..cff47f896 100644 --- a/utils/templates/etc/uwsgi/apps-available/searx.ini +++ b/utils/templates/etc/uwsgi/apps-available/searx.ini @@ -59,4 +59,4 @@ pythonpath = ${SEARX_SRC} # 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_URL} +http = ${SEARX_INTERNAL_URL} -- cgit v1.2.3 From 59e4026762a809fe2a5b5a5a949d7d671f4d989b Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 17 Feb 2020 18:58:59 +0100 Subject: searx.sh: install settings at /etc/searx/settings.yml Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-available/searx.ini | 3 +++ 1 file changed, 3 insertions(+) (limited to 'utils/templates/etc/uwsgi/apps-available') diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini b/utils/templates/etc/uwsgi/apps-available/searx.ini index cff47f896..bc62e5864 100644 --- a/utils/templates/etc/uwsgi/apps-available/searx.ini +++ b/utils/templates/etc/uwsgi/apps-available/searx.ini @@ -12,6 +12,9 @@ gid = ${SERVICE_GROUP} # chdir to specified directory before apps loading chdir = ${SEARX_SRC}/searx +# searx configuration (settings.yml) +env = SEARX_SETTINGS_PATH=${SEARX_SETTINGS_PATH} + # disable logging for privacy disable-logging = true -- cgit v1.2.3 From 387c6a77691fec514704bdf178b9ab94ad4abb40 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 6 Mar 2020 14:47:00 +0100 Subject: docs: improve description of uwsgi & ngingx setup Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-available/searx.ini | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'utils/templates/etc/uwsgi/apps-available') diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini b/utils/templates/etc/uwsgi/apps-available/searx.ini index bc62e5864..4f8674012 100644 --- a/utils/templates/etc/uwsgi/apps-available/searx.ini +++ b/utils/templates/etc/uwsgi/apps-available/searx.ini @@ -56,10 +56,24 @@ virtualenv = ${SEARX_PYENV} pythonpath = ${SEARX_SRC} -# plugin http -# ----------- +# speak to upstream +# ----------------- # -# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http +# 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_URL} + +# using unix-sockets: +# +# On some distributions you need to create the app folder for the sockets:: +# +# mkdir -p /run/uwsgi/app/searx/socket +# chmod -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx/socket +# +# socket = /run/uwsgi/app/searx/socket \ No newline at end of file -- cgit v1.2.3 From c81849cb5a22d937c0f1de1d02d1fb8e3a7849cd Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 5 Apr 2020 17:40:37 +0200 Subject: filtron.sh & morty.sh: improve usage message (if used in containers) BTW: normalize soma variable names Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-available/searx.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/templates/etc/uwsgi/apps-available') diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini b/utils/templates/etc/uwsgi/apps-available/searx.ini index 4f8674012..806f74439 100644 --- a/utils/templates/etc/uwsgi/apps-available/searx.ini +++ b/utils/templates/etc/uwsgi/apps-available/searx.ini @@ -67,7 +67,7 @@ pythonpath = ${SEARX_SRC} # 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_URL} +http = ${SEARX_INTERNAL_HTTP} # using unix-sockets: # -- cgit v1.2.3 From f693149cded4f783380f8f02154bd9288b72cdd5 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 8 Apr 2020 18:38:36 +0200 Subject: Changes from the installation tests on (all) LXC containers. Tested and fixed HTTP & uWSGI installation on: ubu1604 ubu1804 ubu1910 ubu2004 fedora31 archlinux Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-available/searx.ini | 4 +- .../etc/uwsgi/apps-available/searx.ini:socket | 79 ++++++++++++++++++++++ 2 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 utils/templates/etc/uwsgi/apps-available/searx.ini:socket (limited to 'utils/templates/etc/uwsgi/apps-available') diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini b/utils/templates/etc/uwsgi/apps-available/searx.ini index 806f74439..9785d7cd1 100644 --- a/utils/templates/etc/uwsgi/apps-available/searx.ini +++ b/utils/templates/etc/uwsgi/apps-available/searx.ini @@ -73,7 +73,7 @@ http = ${SEARX_INTERNAL_HTTP} # # On some distributions you need to create the app folder for the sockets:: # -# mkdir -p /run/uwsgi/app/searx/socket -# chmod -R ${SERVICE_USER}:${SERVICE_GROUP} /run/uwsgi/app/searx/socket +# mkdir -p /run/uwsgi/app/searx +# chmod -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:socket b/utils/templates/etc/uwsgi/apps-available/searx.ini:socket new file mode 100644 index 000000000..88436e5eb --- /dev/null +++ b/utils/templates/etc/uwsgi/apps-available/searx.ini:socket @@ -0,0 +1,79 @@ +[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} + +# chdir to specified directory before apps loading +chdir = ${SEARX_SRC}/searx + +# searx configuration (settings.yml) +env = SEARX_SETTINGS_PATH=${SEARX_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