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') 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') 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') 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') 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 d5917cc029e2736b11412a570470c666af093ec9 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 25 Feb 2020 20:20:17 +0100 Subject: utils/lib.sh: make uWSGI installation available for all distros support: ubuntu, debin, fedora, archlinux Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-archlinux/searx.ini | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 utils/templates/etc/uwsgi/apps-archlinux/searx.ini (limited to 'utils/templates/etc/uwsgi') diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini new file mode 100644 index 000000000..08873cf0f --- /dev/null +++ b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini @@ -0,0 +1,66 @@ +[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 +logger = systemd +disable-logging = false + +# 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,http,systemd_logger + +# 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} + + +# 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_INTERNAL_URL} -- cgit v1.2.3 From af6acd3417bf53c151b9ba6068186c1e472a2776 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 26 Feb 2020 19:07:55 +0100 Subject: LXC: install searx-suite installs searx, filtron & morty on all containers Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-archlinux/searx.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/templates/etc/uwsgi') diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini index 08873cf0f..78ad50443 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini +++ b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini @@ -32,7 +32,7 @@ master = true lazy-apps = true # load uWSGI plugins -plugin = python,http,systemd_logger +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 -- 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-archlinux/searx.ini | 20 +++++++++++++++++--- utils/templates/etc/uwsgi/apps-available/searx.ini | 20 +++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) (limited to 'utils/templates/etc/uwsgi') diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini index 78ad50443..f96554060 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini +++ b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini @@ -57,10 +57,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 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 c15337850e64562c376e5de57d8809a3a05b8a5d Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 6 Mar 2020 22:06:19 +0100 Subject: fix: minor typos Signed-off-by: Markus Heiser --- utils/templates/etc/uwsgi/apps-archlinux/searx.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/templates/etc/uwsgi') diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini index f96554060..66653fc0e 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini +++ b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini @@ -17,7 +17,7 @@ env = SEARX_SETTINGS_PATH=${SEARX_SETTINGS_PATH} # disable logging for privacy logger = systemd -disable-logging = false +disable-logging = true # The right granted on the created socket chmod-socket = 666 -- 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-archlinux/searx.ini | 2 +- utils/templates/etc/uwsgi/apps-available/searx.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/templates/etc/uwsgi') diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini index 66653fc0e..8d3349c58 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini +++ b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini @@ -68,7 +68,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: # 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-archlinux/searx.ini | 4 +- .../etc/uwsgi/apps-archlinux/searx.ini:socket | 80 ++++++++++++++++++++++ utils/templates/etc/uwsgi/apps-available/searx.ini | 4 +- .../etc/uwsgi/apps-available/searx.ini:socket | 79 +++++++++++++++++++++ 4 files changed, 163 insertions(+), 4 deletions(-) create mode 100644 utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket create mode 100644 utils/templates/etc/uwsgi/apps-available/searx.ini:socket (limited to 'utils/templates/etc/uwsgi') diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini index 8d3349c58..51f659d0f 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini +++ b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini @@ -74,7 +74,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 +# 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/searx.ini:socket b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket new file mode 100644 index 000000000..eeabb3715 --- /dev/null +++ b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket @@ -0,0 +1,80 @@ +[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 +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 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