forked from zaclys/searxng
[install scripts] rename SEARX_<name> variables to SEARXNG_<name>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
0cf5310933
commit
81bba44869
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
# This file should be edited only ones just before the installation of any
|
# This file should be edited only ones just before the installation of any
|
||||||
# service is done. After the installation of the searx service a copy of this
|
# service is done. After the installation of the searx service a copy of this
|
||||||
# file is placed into the $SEARX_SRC of the instance, e.g.::
|
# file is placed into the $SEARXNG_SRC of the instance, e.g.::
|
||||||
#
|
#
|
||||||
# /usr/local/searx/searx-src/.config.sh
|
# /usr/local/searx/searx-src/.config.sh
|
||||||
#
|
#
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
# $ ./utils/searx.sh --help
|
# $ ./utils/searx.sh --help
|
||||||
# ---- SearXNG instance setup (already installed)
|
# ---- SearXNG instance setup (already installed)
|
||||||
# SEARXNG_SETTINGS_PATH : /etc/searxng/settings.yml
|
# SEARXNG_SETTINGS_PATH : /etc/searxng/settings.yml
|
||||||
# SEARX_SRC : /usr/local/searx/searx-src
|
# SEARXNG_SRC : /usr/local/searx/searx-src
|
||||||
#
|
#
|
||||||
# [1] https://docs.searxng.org/admin/engines/settings.html
|
# [1] https://docs.searxng.org/admin/engines/settings.html
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.. template evaluated by: ./utils/searx.sh docs
|
.. template evaluated by: ./utils/searx.sh doc
|
||||||
.. hint: all dollar-names are variables, dollar sign itself is quoted by: \\$
|
.. hint: all dollar-names are variables, dollar sign itself is quoted by: \\$
|
||||||
|
|
||||||
.. START distro-packages
|
.. START distro-packages
|
||||||
|
@ -81,7 +81,7 @@ ${fedora_build}
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
$ sudo -H -u ${SERVICE_USER} -i
|
$ sudo -H -u ${SERVICE_USER} -i
|
||||||
(${SERVICE_USER})$ git clone \"$GIT_URL\" \"$SEARX_SRC\"
|
(${SERVICE_USER})$ git clone \"$GIT_URL\" \"$SEARXNG_SRC\"
|
||||||
|
|
||||||
.. END clone searxng
|
.. END clone searxng
|
||||||
|
|
||||||
|
@ -93,8 +93,8 @@ ${fedora_build}
|
||||||
|
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
(${SERVICE_USER})$ python3 -m venv \"${SEARX_PYENV}\"
|
(${SERVICE_USER})$ python3 -m venv \"${SEARXNG_PYENV}\"
|
||||||
(${SERVICE_USER})$ echo \". ${SEARX_PYENV}/bin/activate\" >> \"$SERVICE_HOME/.profile\"
|
(${SERVICE_USER})$ echo \". ${SEARXNG_PYENV}/bin/activate\" >> \"$SERVICE_HOME/.profile\"
|
||||||
|
|
||||||
.. END create virtualenv
|
.. END create virtualenv
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ ${fedora_build}
|
||||||
$ sudo -H -u ${SERVICE_USER} -i
|
$ sudo -H -u ${SERVICE_USER} -i
|
||||||
|
|
||||||
(${SERVICE_USER})$ command -v python && python --version
|
(${SERVICE_USER})$ command -v python && python --version
|
||||||
$SEARX_PYENV/bin/python
|
$SEARXNG_PYENV/bin/python
|
||||||
Python 3.8.1
|
Python 3.8.1
|
||||||
|
|
||||||
# update pip's boilerplate ..
|
# update pip's boilerplate ..
|
||||||
|
@ -119,7 +119,7 @@ ${fedora_build}
|
||||||
pip install -U pyyaml
|
pip install -U pyyaml
|
||||||
|
|
||||||
# jump to SearXNG's working tree and install SearXNG into virtualenv
|
# jump to SearXNG's working tree and install SearXNG into virtualenv
|
||||||
(${SERVICE_USER})$ cd \"$SEARX_SRC\"
|
(${SERVICE_USER})$ cd \"$SEARXNG_SRC\"
|
||||||
(${SERVICE_USER})$ pip install -e .
|
(${SERVICE_USER})$ pip install -e .
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ ${fedora_build}
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
$ sudo -H mkdir -p \"$(dirname ${SEARXNG_SETTINGS_PATH})\"
|
$ sudo -H mkdir -p \"$(dirname ${SEARXNG_SETTINGS_PATH})\"
|
||||||
$ sudo -H cp \"$SEARX_SRC/utils/templates/etc/searxng/settings.yml\" \\
|
$ sudo -H cp \"$SEARXNG_SRC/utils/templates/etc/searxng/settings.yml\" \\
|
||||||
\"${SEARXNG_SETTINGS_PATH}\"
|
\"${SEARXNG_SETTINGS_PATH}\"
|
||||||
|
|
||||||
.. group-tab:: searx/settings.yml
|
.. group-tab:: searx/settings.yml
|
||||||
|
@ -142,7 +142,7 @@ ${fedora_build}
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
$ sudo -H mkdir -p \"$(dirname ${SEARXNG_SETTINGS_PATH})\"
|
$ sudo -H mkdir -p \"$(dirname ${SEARXNG_SETTINGS_PATH})\"
|
||||||
$ sudo -H cp \"$SEARX_SRC/searx/settings.yml\" \\
|
$ sudo -H cp \"$SEARXNG_SRC/searx/settings.yml\" \\
|
||||||
\"${SEARXNG_SETTINGS_PATH}\"
|
\"${SEARXNG_SETTINGS_PATH}\"
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
|
@ -168,14 +168,14 @@ ${fedora_build}
|
||||||
|
|
||||||
# start webapp
|
# start webapp
|
||||||
$ sudo -H -u ${SERVICE_USER} -i
|
$ sudo -H -u ${SERVICE_USER} -i
|
||||||
(${SERVICE_USER})$ cd ${SEARX_SRC}
|
(${SERVICE_USER})$ cd ${SEARXNG_SRC}
|
||||||
(${SERVICE_USER})$ export SEARXNG_SETTINGS_PATH=\"${SEARXNG_SETTINGS_PATH}\"
|
(${SERVICE_USER})$ export SEARXNG_SETTINGS_PATH=\"${SEARXNG_SETTINGS_PATH}\"
|
||||||
(${SERVICE_USER})$ python searx/webapp.py
|
(${SERVICE_USER})$ python searx/webapp.py
|
||||||
|
|
||||||
# disable debug
|
# disable debug
|
||||||
$ sudo -H sed -i -e \"s/debug : True/debug : False/g\" \"$SEARXNG_SETTINGS_PATH\"
|
$ sudo -H sed -i -e \"s/debug : True/debug : False/g\" \"$SEARXNG_SETTINGS_PATH\"
|
||||||
|
|
||||||
Open WEB browser and visit http://$SEARX_INTERNAL_HTTP . If you are inside a
|
Open WEB browser and visit http://$SEARXNG_INTERNAL_HTTP . If you are inside a
|
||||||
container or in a script, test with curl:
|
container or in a script, test with curl:
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
|
@ -184,13 +184,13 @@ container or in a script, test with curl:
|
||||||
|
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
$ xdg-open http://$SEARX_INTERNAL_HTTP
|
$ xdg-open http://$SEARXNG_INTERNAL_HTTP
|
||||||
|
|
||||||
.. group-tab:: curl
|
.. group-tab:: curl
|
||||||
|
|
||||||
.. code-block:: none
|
.. code-block:: none
|
||||||
|
|
||||||
$ curl --location --verbose --head --insecure $SEARX_INTERNAL_HTTP
|
$ curl --location --verbose --head --insecure $SEARXNG_INTERNAL_HTTP
|
||||||
|
|
||||||
* Trying 127.0.0.1:8888...
|
* Trying 127.0.0.1:8888...
|
||||||
* TCP_NODELAY set
|
* TCP_NODELAY set
|
||||||
|
|
|
@ -569,7 +569,7 @@ This installs a reverse proxy (ProxyPass) into nginx site (${NGINX_FILTRON_SITE}
|
||||||
"${REPO_ROOT}/utils/searx.sh" install uwsgi
|
"${REPO_ROOT}/utils/searx.sh" install uwsgi
|
||||||
|
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
SEARX_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_SRC)
|
SEARXNG_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_SRC)
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
SEARXNG_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_URL_PATH)
|
SEARXNG_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_URL_PATH)
|
||||||
nginx_install_app --variant=filtron "${NGINX_FILTRON_SITE}"
|
nginx_install_app --variant=filtron "${NGINX_FILTRON_SITE}"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# Initialize installation procedures:
|
# Initialize installation procedures:
|
||||||
#
|
#
|
||||||
# - Modified source_dot_config function that
|
# - Modified source_dot_config function that
|
||||||
# - loads .config.sh from an existing installation (at SEARX_SRC).
|
# - loads .config.sh from an existing installation (at SEARXNG_SRC).
|
||||||
# - initialize **SEARX_SRC_INIT_FILES**
|
# - initialize **SEARX_SRC_INIT_FILES**
|
||||||
# - functions like:
|
# - functions like:
|
||||||
# - install_log_searx_instance()
|
# - install_log_searx_instance()
|
||||||
|
@ -25,13 +25,13 @@
|
||||||
# - utils/morty.sh
|
# - utils/morty.sh
|
||||||
# - utils/filtron.sh
|
# - utils/filtron.sh
|
||||||
#
|
#
|
||||||
# If '${SEARX_SRC}/.config.sh' exists, the modified source_dot_config() function
|
# If '${SEARXNG_SRC}/.config.sh' exists, the modified source_dot_config() function
|
||||||
# loads this configuration (instead of './.config.sh').
|
# loads this configuration (instead of './.config.sh').
|
||||||
|
|
||||||
# **SEARX_SRC_INIT_FILES**
|
# **SEARX_SRC_INIT_FILES**
|
||||||
#
|
#
|
||||||
# Array of file names to sync into a installation at $SEARX_SRC. The file names
|
# Array of file names to sync into a installation at $SEARXNG_SRC. The file names
|
||||||
# are relative to the $REPO_ROOT. Set by function init_SEARX_SRC_INIT_FILES().
|
# are relative to the $REPO_ROOT. Set by function init_SEARXNG_SRC_INIT_FILES().
|
||||||
# Most often theses are files like:
|
# Most often theses are files like:
|
||||||
# - .config.sh
|
# - .config.sh
|
||||||
# - searx/settings.yml
|
# - searx/settings.yml
|
||||||
|
@ -46,25 +46,25 @@ eval orig_"$(declare -f source_dot_config)"
|
||||||
source_dot_config() {
|
source_dot_config() {
|
||||||
|
|
||||||
# Modified source_dot_config function that
|
# Modified source_dot_config function that
|
||||||
# - loads .config.sh from an existing installation (at SEARX_SRC).
|
# - loads .config.sh from an existing installation (at SEARXNG_SRC).
|
||||||
# - initialize SEARX_SRC_INIT_FILES
|
# - initialize SEARX_SRC_INIT_FILES
|
||||||
|
|
||||||
if [ -z "$eval_SEARX_SRC" ]; then
|
if [ -z "$eval_SEARXNG_SRC" ]; then
|
||||||
export eval_SEARX_SRC='true'
|
export eval_SEARXNG_SRC='true'
|
||||||
SEARX_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_SRC)
|
SEARXNG_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_SRC)
|
||||||
SEARX_PYENV=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_PYENV)
|
SEARXNG_PYENV=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_PYENV)
|
||||||
SEARXNG_SETTINGS_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_SETTINGS_PATH)
|
SEARXNG_SETTINGS_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_SETTINGS_PATH)
|
||||||
if [ ! -r "${SEARX_SRC}" ]; then
|
if [ ! -r "${SEARXNG_SRC}" ]; then
|
||||||
info_msg "not yet cloned: ${SEARX_SRC}"
|
info_msg "not yet cloned: ${SEARXNG_SRC}"
|
||||||
orig_source_dot_config
|
orig_source_dot_config
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
info_msg "using instance at: ${SEARX_SRC}"
|
info_msg "using instance at: ${SEARXNG_SRC}"
|
||||||
|
|
||||||
# set and log DOT_CONFIG
|
# set and log DOT_CONFIG
|
||||||
if [ -r "${SEARX_SRC}/.config.sh" ]; then
|
if [ -r "${SEARXNG_SRC}/.config.sh" ]; then
|
||||||
info_msg "switching to ${SEARX_SRC}/.config.sh"
|
info_msg "switching to ${SEARXNG_SRC}/.config.sh"
|
||||||
DOT_CONFIG="${SEARX_SRC}/.config.sh"
|
DOT_CONFIG="${SEARXNG_SRC}/.config.sh"
|
||||||
else
|
else
|
||||||
info_msg "using local config: ${DOT_CONFIG}"
|
info_msg "using local config: ${DOT_CONFIG}"
|
||||||
fi
|
fi
|
||||||
|
@ -86,7 +86,7 @@ init_SEARX_SRC_INIT_FILES(){
|
||||||
|
|
||||||
# keep list empty if there is no installation
|
# keep list empty if there is no installation
|
||||||
SEARX_SRC_INIT_FILES=()
|
SEARX_SRC_INIT_FILES=()
|
||||||
if [ ! -r "$SEARX_SRC" ]; then
|
if [ ! -r "$SEARXNG_SRC" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -104,9 +104,9 @@ init_SEARX_SRC_INIT_FILES(){
|
||||||
if [ -z "$fname" ]; then
|
if [ -z "$fname" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ -r "${SEARX_SRC}/${fname}" ]; then
|
if [ -r "${SEARXNG_SRC}/${fname}" ]; then
|
||||||
# diff "${REPO_ROOT}/${fname}" "${SEARX_SRC}/${fname}"
|
# diff "${REPO_ROOT}/${fname}" "${SEARXNG_SRC}/${fname}"
|
||||||
if ! cmp --silent "${REPO_ROOT}/${fname}" "${SEARX_SRC}/${fname}"; then
|
if ! cmp --silent "${REPO_ROOT}/${fname}" "${SEARXNG_SRC}/${fname}"; then
|
||||||
SEARX_SRC_INIT_FILES+=("${fname}")
|
SEARX_SRC_INIT_FILES+=("${fname}")
|
||||||
info_msg "local clone (workingtree), modified file: ./$fname"
|
info_msg "local clone (workingtree), modified file: ./$fname"
|
||||||
msg="to update use: sudo -H ./utils/searx.sh install init-src"
|
msg="to update use: sudo -H ./utils/searx.sh install init-src"
|
||||||
|
@ -120,8 +120,8 @@ install_log_searx_instance() {
|
||||||
|
|
||||||
echo -e "---- SearXNG instance setup ${_BBlue}(status: $(install_searx_get_state))${_creset}"
|
echo -e "---- SearXNG instance setup ${_BBlue}(status: $(install_searx_get_state))${_creset}"
|
||||||
echo -e " SEARXNG_SETTINGS_PATH : ${_BBlue}${SEARXNG_SETTINGS_PATH}${_creset}"
|
echo -e " SEARXNG_SETTINGS_PATH : ${_BBlue}${SEARXNG_SETTINGS_PATH}${_creset}"
|
||||||
echo -e " SEARX_PYENV : ${_BBlue}${SEARX_PYENV}${_creset}"
|
echo -e " SEARXNG_PYENV : ${_BBlue}${SEARXNG_PYENV}${_creset}"
|
||||||
echo -e " SEARX_SRC : ${_BBlue}${SEARX_SRC:-none}${_creset}"
|
echo -e " SEARXNG_SRC : ${_BBlue}${SEARXNG_SRC:-none}${_creset}"
|
||||||
echo -e " SEARXNG_URL : ${_BBlue}${SEARXNG_URL:-none}${_creset}"
|
echo -e " SEARXNG_URL : ${_BBlue}${SEARXNG_URL:-none}${_creset}"
|
||||||
|
|
||||||
if in_container; then
|
if in_container; then
|
||||||
|
@ -148,26 +148,26 @@ install_searx_get_state(){
|
||||||
# Prompts a string indicating the status of the installation procedure
|
# Prompts a string indicating the status of the installation procedure
|
||||||
#
|
#
|
||||||
# missing-searx-clone:
|
# missing-searx-clone:
|
||||||
# There is no clone at ${SEARX_SRC}
|
# There is no clone at ${SEARXNG_SRC}
|
||||||
# missing-searx-pyenv:
|
# missing-searx-pyenv:
|
||||||
# There is no pyenv in ${SEARX_PYENV}
|
# There is no pyenv in ${SEARXNG_PYENV}
|
||||||
# installer-modified:
|
# installer-modified:
|
||||||
# There are files modified locally in the installer (clone),
|
# There are files modified locally in the installer (clone),
|
||||||
# see ${SEARX_SRC_INIT_FILES} description.
|
# see ${SEARX_SRC_INIT_FILES} description.
|
||||||
# python-installed:
|
# python-installed:
|
||||||
# Scripts can be executed in instance's environment
|
# Scripts can be executed in instance's environment
|
||||||
# - user: ${SERVICE_USER}
|
# - user: ${SERVICE_USER}
|
||||||
# - pyenv: ${SEARX_PYENV}
|
# - pyenv: ${SEARXNG_PYENV}
|
||||||
|
|
||||||
if [ -f /etc/searx/settings.yml ]; then
|
if [ -f /etc/searx/settings.yml ]; then
|
||||||
err_msg "settings.yml in /etc/searx/ is deprecated, move file to folder /etc/searxng/"
|
err_msg "settings.yml in /etc/searx/ is deprecated, move file to folder /etc/searxng/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -r "${SEARX_SRC}" ]; then
|
if ! [ -r "${SEARXNG_SRC}" ]; then
|
||||||
echo "missing-searx-clone"
|
echo "missing-searx-clone"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if ! [ -f "${SEARX_PYENV}/bin/activate" ]; then
|
if ! [ -f "${SEARXNG_PYENV}/bin/activate" ]; then
|
||||||
echo "missing-searx-pyenv"
|
echo "missing-searx-pyenv"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -502,7 +502,7 @@ This installs a reverse proxy (ProxyPass) into nginx site (${NGINX_MORTY_SITE})"
|
||||||
"${REPO_ROOT}/utils/searx.sh" install uwsgi
|
"${REPO_ROOT}/utils/searx.sh" install uwsgi
|
||||||
|
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
SEARX_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_SRC)
|
SEARXNG_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_SRC)
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
SEARXNG_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_URL_PATH)
|
SEARXNG_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_URL_PATH)
|
||||||
nginx_install_app "${NGINX_MORTY_SITE}"
|
nginx_install_app "${NGINX_MORTY_SITE}"
|
||||||
|
|
118
utils/searx.sh
118
utils/searx.sh
|
@ -12,7 +12,7 @@ source "${REPO_ROOT}/utils/lib_install.sh"
|
||||||
# config
|
# config
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
SEARX_INTERNAL_HTTP="${SEARXNG_BIND_ADDRESS}:${SEARXNG_PORT}"
|
SEARXNG_INTERNAL_HTTP="${SEARXNG_BIND_ADDRESS}:${SEARXNG_PORT}"
|
||||||
|
|
||||||
SEARXNG_URL_PATH="${SEARXNG_URL_PATH:-$(echo "${PUBLIC_URL}" \
|
SEARXNG_URL_PATH="${SEARXNG_URL_PATH:-$(echo "${PUBLIC_URL}" \
|
||||||
| sed -e 's,^.*://[^/]*\(/.*\),\1,g')}"
|
| sed -e 's,^.*://[^/]*\(/.*\),\1,g')}"
|
||||||
|
@ -26,12 +26,14 @@ SERVICE_HOME="${SERVICE_HOME_BASE}/${SERVICE_USER}"
|
||||||
SERVICE_GROUP="${SERVICE_USER}"
|
SERVICE_GROUP="${SERVICE_USER}"
|
||||||
|
|
||||||
GIT_BRANCH="${GIT_BRANCH:-master}"
|
GIT_BRANCH="${GIT_BRANCH:-master}"
|
||||||
SEARX_PYENV="${SERVICE_HOME}/searx-pyenv"
|
SEARXNG_PYENV="${SERVICE_HOME}/searx-pyenv"
|
||||||
SEARX_SRC="${SERVICE_HOME}/searx-src"
|
SEARXNG_SRC="${SERVICE_HOME}/searx-src"
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
SEARXNG_STATIC="${SEARXNG_SRC}/searx/static"
|
||||||
SEARXNG_SETTINGS_PATH="/etc/searxng/settings.yml"
|
SEARXNG_SETTINGS_PATH="/etc/searxng/settings.yml"
|
||||||
SEARXNG_UWSGI_APP="searxng.ini"
|
SEARXNG_UWSGI_APP="searxng.ini"
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
SEARX_UWSGI_SOCKET="/run/uwsgi/app/searxng/socket"
|
SEARXNG_UWSGI_SOCKET="/run/uwsgi/app/searxng/socket"
|
||||||
|
|
||||||
# apt packages
|
# apt packages
|
||||||
SEARX_PACKAGES_debian="\
|
SEARX_PACKAGES_debian="\
|
||||||
|
@ -153,10 +155,10 @@ shell
|
||||||
install / remove
|
install / remove
|
||||||
:all: complete (de-) installation of SearXNG service
|
:all: complete (de-) installation of SearXNG service
|
||||||
:user: add/remove service user '$SERVICE_USER' ($SERVICE_HOME)
|
:user: add/remove service user '$SERVICE_USER' ($SERVICE_HOME)
|
||||||
:dot-config: copy ./config.sh to ${SEARX_SRC}
|
:dot-config: copy ./config.sh to ${SEARXNG_SRC}
|
||||||
:searx-src: clone $GIT_URL
|
:searx-src: clone $GIT_URL
|
||||||
:init-src: copy files (SEARX_SRC_INIT_FILES) to ${SEARX_SRC}
|
:init-src: copy files (SEARXNG_SRC_INIT_FILES) to ${SEARXNG_SRC}
|
||||||
:pyenv: create/remove virtualenv (python) in $SEARX_PYENV
|
:pyenv: create/remove virtualenv (python) in $SEARXNG_PYENV
|
||||||
:uwsgi: install SearXNG uWSGI application
|
:uwsgi: install SearXNG uWSGI application
|
||||||
:settings: reinstall settings from ${SEARXNG_SETTINGS_PATH}
|
:settings: reinstall settings from ${SEARXNG_SETTINGS_PATH}
|
||||||
:packages: install needed packages from OS package manager
|
:packages: install needed packages from OS package manager
|
||||||
|
@ -173,7 +175,7 @@ deactivate service
|
||||||
stop and deactivate service daemon (systemd unit)
|
stop and deactivate service daemon (systemd unit)
|
||||||
inspect
|
inspect
|
||||||
:service: run some small tests and inspect service's status and log
|
:service: run some small tests and inspect service's status and log
|
||||||
:settings: inspect YAML setting <key> from SearXNG instance (${SEARX_SRC})
|
:settings: inspect YAML setting <key> from SearXNG instance (${SEARXNG_SRC})
|
||||||
option
|
option
|
||||||
set one of the available options
|
set one of the available options
|
||||||
apache
|
apache
|
||||||
|
@ -267,8 +269,8 @@ main() {
|
||||||
rst_title "SearXNG (install uwsgi)"
|
rst_title "SearXNG (install uwsgi)"
|
||||||
verify_continue_install
|
verify_continue_install
|
||||||
install_searx_uwsgi
|
install_searx_uwsgi
|
||||||
if ! service_is_available "http://${SEARX_INTERNAL_HTTP}"; then
|
if ! service_is_available "http://${SEARXNG_INTERNAL_HTTP}"; then
|
||||||
err_msg "URL http://${SEARX_INTERNAL_HTTP} not available, check SearXNG & uwsgi setup!"
|
err_msg "URL http://${SEARXNG_INTERNAL_HTTP} not available, check SearXNG & uwsgi setup!"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
packages)
|
packages)
|
||||||
|
@ -355,8 +357,8 @@ install_all() {
|
||||||
test_local_searx
|
test_local_searx
|
||||||
wait_key
|
wait_key
|
||||||
install_searx_uwsgi
|
install_searx_uwsgi
|
||||||
if ! service_is_available "http://${SEARX_INTERNAL_HTTP}"; then
|
if ! service_is_available "http://${SEARXNG_INTERNAL_HTTP}"; then
|
||||||
err_msg "URL http://${SEARX_INTERNAL_HTTP} not available, check SearXNG & uwsgi setup!"
|
err_msg "URL http://${SEARXNG_INTERNAL_HTTP} not available, check SearXNG & uwsgi setup!"
|
||||||
fi
|
fi
|
||||||
if ask_yn "Do you want to inspect the installation?" Ny; then
|
if ask_yn "Do you want to inspect the installation?" Ny; then
|
||||||
inspect_service
|
inspect_service
|
||||||
|
@ -391,7 +393,7 @@ install_check() {
|
||||||
uWSGI_app_available "$SEARXNG_UWSGI_APP" \
|
uWSGI_app_available "$SEARXNG_UWSGI_APP" \
|
||||||
|| err_msg "uWSGI app $SEARXNG_UWSGI_APP not available!"
|
|| err_msg "uWSGI app $SEARXNG_UWSGI_APP not available!"
|
||||||
|
|
||||||
sudo -H -u "${SERVICE_USER}" "${SEARX_PYENV}/bin/python" "utils/searxng_check.py"
|
sudo -H -u "${SERVICE_USER}" "${SEARXNG_PYENV}/bin/python" "utils/searxng_check.py"
|
||||||
|
|
||||||
if uWSGI_app_available 'searx.ini'; then
|
if uWSGI_app_available 'searx.ini'; then
|
||||||
warn_msg "old searx.ini uWSGI app exists"
|
warn_msg "old searx.ini uWSGI app exists"
|
||||||
|
@ -404,7 +406,7 @@ update_searx() {
|
||||||
|
|
||||||
rst_para "fetch from $GIT_URL and reset to origin/$GIT_BRANCH"
|
rst_para "fetch from $GIT_URL and reset to origin/$GIT_BRANCH"
|
||||||
tee_stderr 0.3 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.3 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
cd ${SEARX_SRC}
|
cd ${SEARXNG_SRC}
|
||||||
git fetch origin "$GIT_BRANCH"
|
git fetch origin "$GIT_BRANCH"
|
||||||
git reset --hard "origin/$GIT_BRANCH"
|
git reset --hard "origin/$GIT_BRANCH"
|
||||||
pip install -U pip
|
pip install -U pip
|
||||||
|
@ -458,7 +460,7 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
clone_is_available() {
|
clone_is_available() {
|
||||||
[[ -f "$SEARX_SRC/.git/config" ]]
|
[[ -f "$SEARXNG_SRC/.git/config" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2164
|
# shellcheck disable=SC2164
|
||||||
|
@ -482,12 +484,12 @@ clone_searx() {
|
||||||
warn_msg "take into account, installing branch $GIT_BRANCH while current branch is $(git rev-parse --abbrev-ref HEAD)"
|
warn_msg "take into account, installing branch $GIT_BRANCH while current branch is $(git rev-parse --abbrev-ref HEAD)"
|
||||||
fi
|
fi
|
||||||
export SERVICE_HOME
|
export SERVICE_HOME
|
||||||
git_clone "$REPO_ROOT" "$SEARX_SRC" \
|
git_clone "$REPO_ROOT" "$SEARXNG_SRC" \
|
||||||
"$GIT_BRANCH" "$SERVICE_USER"
|
"$GIT_BRANCH" "$SERVICE_USER"
|
||||||
|
|
||||||
pushd "${SEARX_SRC}" > /dev/null
|
pushd "${SEARXNG_SRC}" > /dev/null
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
cd "${SEARX_SRC}"
|
cd "${SEARXNG_SRC}"
|
||||||
git remote set-url origin ${GIT_URL}
|
git remote set-url origin ${GIT_URL}
|
||||||
git config user.email "$ADMIN_EMAIL"
|
git config user.email "$ADMIN_EMAIL"
|
||||||
git config user.name "$ADMIN_NAME"
|
git config user.name "$ADMIN_NAME"
|
||||||
|
@ -509,7 +511,7 @@ prompt_installation_status(){
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
info_msg "SearXNG instance already installed at: $SEARX_SRC"
|
info_msg "SearXNG instance already installed at: $SEARXNG_SRC"
|
||||||
info_msg "status: ${_BBlue}$(install_searx_get_state)${_creset} "
|
info_msg "status: ${_BBlue}$(install_searx_get_state)${_creset} "
|
||||||
branch="$(git name-rev --name-only HEAD)"
|
branch="$(git name-rev --name-only HEAD)"
|
||||||
remote="$(git config branch."${branch}".remote)"
|
remote="$(git config branch."${branch}".remote)"
|
||||||
|
@ -549,7 +551,7 @@ prompt_installation_setting(){
|
||||||
_state="$(install_searx_get_state)"
|
_state="$(install_searx_get_state)"
|
||||||
case $_state in
|
case $_state in
|
||||||
python-installed|installer-modified)
|
python-installed|installer-modified)
|
||||||
sudo -H -u "${SERVICE_USER}" "${SEARX_PYENV}/bin/python" <<EOF
|
sudo -H -u "${SERVICE_USER}" "${SEARXNG_PYENV}/bin/python" <<EOF
|
||||||
import sys
|
import sys
|
||||||
from searx import get_setting
|
from searx import get_setting
|
||||||
name = "${1}"
|
name = "${1}"
|
||||||
|
@ -578,7 +580,7 @@ get_installed_version_variables() {
|
||||||
_state="$(install_searx_get_state)"
|
_state="$(install_searx_get_state)"
|
||||||
case $_state in
|
case $_state in
|
||||||
python-installed|installer-modified)
|
python-installed|installer-modified)
|
||||||
sudo -H -u "${SERVICE_USER}" "${SEARX_PYENV}/bin/python" -m searx.version;;
|
sudo -H -u "${SERVICE_USER}" "${SEARXNG_PYENV}/bin/python" -m searx.version;;
|
||||||
*)
|
*)
|
||||||
return 42
|
return 42
|
||||||
;;
|
;;
|
||||||
|
@ -586,7 +588,7 @@ get_installed_version_variables() {
|
||||||
}
|
}
|
||||||
|
|
||||||
init_SEARX_SRC(){
|
init_SEARX_SRC(){
|
||||||
rst_title "Update instance: ${SEARX_SRC}/" section
|
rst_title "Update instance: ${SEARXNG_SRC}/" section
|
||||||
|
|
||||||
if ! clone_is_available; then
|
if ! clone_is_available; then
|
||||||
err_msg "you have to install SearXNG first"
|
err_msg "you have to install SearXNG first"
|
||||||
|
@ -624,19 +626,19 @@ init_SEARX_SRC(){
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"replace file")
|
"replace file")
|
||||||
info_msg "copy: ${REPO_ROOT}/${fname} --> ${SEARX_SRC}/${fname}"
|
info_msg "copy: ${REPO_ROOT}/${fname} --> ${SEARXNG_SRC}/${fname}"
|
||||||
cp "${REPO_ROOT}/${fname}" "${SEARX_SRC}/${fname}"
|
cp "${REPO_ROOT}/${fname}" "${SEARXNG_SRC}/${fname}"
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"diff files")
|
"diff files")
|
||||||
$DIFF_CMD "${SEARX_SRC}/${fname}" "${REPO_ROOT}/${fname}"
|
$DIFF_CMD "${SEARXNG_SRC}/${fname}" "${REPO_ROOT}/${fname}"
|
||||||
;;
|
;;
|
||||||
"interactive shell")
|
"interactive shell")
|
||||||
backup_file "${SEARX_SRC}/${fname}"
|
backup_file "${SEARXNG_SRC}/${fname}"
|
||||||
echo -e "// edit ${_Red}${dst}${_creset} to your needs"
|
echo -e "// edit ${_Red}${dst}${_creset} to your needs"
|
||||||
echo -e "// exit with [${_BCyan}CTRL-D${_creset}]"
|
echo -e "// exit with [${_BCyan}CTRL-D${_creset}]"
|
||||||
sudo -H -u "${SERVICE_USER}" -i
|
sudo -H -u "${SERVICE_USER}" -i
|
||||||
$DIFF_CMD "${SEARX_SRC}/${fname}" "${REPO_ROOT}/${fname}"
|
$DIFF_CMD "${SEARXNG_SRC}/${fname}" "${REPO_ROOT}/${fname}"
|
||||||
echo
|
echo
|
||||||
echo -e "// ${_BBlack}did you edit file ...${_creset}"
|
echo -e "// ${_BBlack}did you edit file ...${_creset}"
|
||||||
echo -en "// ${_Red}${dst}${_creset}"
|
echo -en "// ${_Red}${dst}${_creset}"
|
||||||
|
@ -650,19 +652,19 @@ init_SEARX_SRC(){
|
||||||
}
|
}
|
||||||
|
|
||||||
install_DOT_CONFIG(){
|
install_DOT_CONFIG(){
|
||||||
rst_title "Update instance: ${SEARX_SRC}/.config.sh" section
|
rst_title "Update instance: ${SEARXNG_SRC}/.config.sh" section
|
||||||
|
|
||||||
if cmp --silent "${REPO_ROOT}/.config.sh" "${SEARX_SRC}/.config.sh"; then
|
if cmp --silent "${REPO_ROOT}/.config.sh" "${SEARXNG_SRC}/.config.sh"; then
|
||||||
info_msg "${SEARX_SRC}/.config.sh is up to date"
|
info_msg "${SEARXNG_SRC}/.config.sh is up to date"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
diff "${REPO_ROOT}/.config.sh" "${SEARX_SRC}/.config.sh"
|
diff "${REPO_ROOT}/.config.sh" "${SEARXNG_SRC}/.config.sh"
|
||||||
if ! ask_yn "Do you want to copy file .config.sh into instance?" Yn; then
|
if ! ask_yn "Do you want to copy file .config.sh into instance?" Yn; then
|
||||||
return 42
|
return 42
|
||||||
fi
|
fi
|
||||||
backup_file "${SEARX_SRC}/.config.sh"
|
backup_file "${SEARXNG_SRC}/.config.sh"
|
||||||
cp "${REPO_ROOT}/.config.sh" "${SEARX_SRC}/.config.sh"
|
cp "${REPO_ROOT}/.config.sh" "${SEARXNG_SRC}/.config.sh"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_settings() {
|
install_settings() {
|
||||||
|
@ -689,30 +691,30 @@ remove_settings() {
|
||||||
|
|
||||||
remove_searx() {
|
remove_searx() {
|
||||||
rst_title "Drop SearXNG sources" section
|
rst_title "Drop SearXNG sources" section
|
||||||
if ask_yn "Do you really want to drop SearXNG sources ($SEARX_SRC)?"; then
|
if ask_yn "Do you really want to drop SearXNG sources ($SEARXNG_SRC)?"; then
|
||||||
rm -rf "$SEARX_SRC"
|
rm -rf "$SEARXNG_SRC"
|
||||||
else
|
else
|
||||||
rst_para "Leave SearXNG sources unchanged."
|
rst_para "Leave SearXNG sources unchanged."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
pyenv_is_available() {
|
pyenv_is_available() {
|
||||||
[[ -f "${SEARX_PYENV}/bin/activate" ]]
|
[[ -f "${SEARXNG_PYENV}/bin/activate" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
create_pyenv() {
|
create_pyenv() {
|
||||||
rst_title "Create virtualenv (python)" section
|
rst_title "Create virtualenv (python)" section
|
||||||
echo
|
echo
|
||||||
if [[ ! -f "${SEARX_SRC}/manage" ]]; then
|
if [[ ! -f "${SEARXNG_SRC}/manage" ]]; then
|
||||||
err_msg "to create pyenv for SearXNG, SearXNG has to be cloned first"
|
err_msg "to create pyenv for SearXNG, SearXNG has to be cloned first"
|
||||||
return 42
|
return 42
|
||||||
fi
|
fi
|
||||||
info_msg "create pyenv in ${SEARX_PYENV}"
|
info_msg "create pyenv in ${SEARXNG_PYENV}"
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
rm -rf "${SEARX_PYENV}"
|
rm -rf "${SEARXNG_PYENV}"
|
||||||
python3 -m venv "${SEARX_PYENV}"
|
python3 -m venv "${SEARXNG_PYENV}"
|
||||||
grep -qFs -- 'source ${SEARX_PYENV}/bin/activate' ~/.profile \
|
grep -qFs -- 'source ${SEARXNG_PYENV}/bin/activate' ~/.profile \
|
||||||
|| echo 'source ${SEARX_PYENV}/bin/activate' >> ~/.profile
|
|| echo 'source ${SEARXNG_PYENV}/bin/activate' >> ~/.profile
|
||||||
EOF
|
EOF
|
||||||
info_msg "inspect python's virtual environment"
|
info_msg "inspect python's virtual environment"
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
|
@ -725,22 +727,22 @@ pip install -U pip
|
||||||
pip install -U setuptools
|
pip install -U setuptools
|
||||||
pip install -U wheel
|
pip install -U wheel
|
||||||
pip install -U pyyaml
|
pip install -U pyyaml
|
||||||
cd ${SEARX_SRC}
|
cd ${SEARXNG_SRC}
|
||||||
pip install -e .
|
pip install -e .
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_pyenv() {
|
remove_pyenv() {
|
||||||
rst_title "Remove virtualenv (python)" section
|
rst_title "Remove virtualenv (python)" section
|
||||||
if ! ask_yn "Do you really want to drop ${SEARX_PYENV} ?"; then
|
if ! ask_yn "Do you really want to drop ${SEARXNG_PYENV} ?"; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
info_msg "remove pyenv activation from ~/.profile"
|
info_msg "remove pyenv activation from ~/.profile"
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
grep -v 'source ${SEARX_PYENV}/bin/activate' ~/.profile > ~/.profile.##
|
grep -v 'source ${SEARXNG_PYENV}/bin/activate' ~/.profile > ~/.profile.##
|
||||||
mv ~/.profile.## ~/.profile
|
mv ~/.profile.## ~/.profile
|
||||||
EOF
|
EOF
|
||||||
rm -rf "${SEARX_PYENV}"
|
rm -rf "${SEARXNG_PYENV}"
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_searx() {
|
configure_searx() {
|
||||||
|
@ -748,7 +750,7 @@ configure_searx() {
|
||||||
rst_para "Setup SearXNG config located at $SEARXNG_SETTINGS_PATH"
|
rst_para "Setup SearXNG config located at $SEARXNG_SETTINGS_PATH"
|
||||||
echo
|
echo
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
cd ${SEARX_SRC}
|
cd ${SEARXNG_SRC}
|
||||||
sed -i -e "s/ultrasecretkey/$(openssl rand -hex 16)/g" "$SEARXNG_SETTINGS_PATH"
|
sed -i -e "s/ultrasecretkey/$(openssl rand -hex 16)/g" "$SEARXNG_SETTINGS_PATH"
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
@ -757,8 +759,8 @@ test_local_searx() {
|
||||||
rst_title "Testing SearXNG instance localy" section
|
rst_title "Testing SearXNG instance localy" section
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if service_is_available "http://${SEARX_INTERNAL_HTTP}" &>/dev/null; then
|
if service_is_available "http://${SEARXNG_INTERNAL_HTTP}" &>/dev/null; then
|
||||||
err_msg "URL/port http://${SEARX_INTERNAL_HTTP} is already in use, you"
|
err_msg "URL/port http://${SEARXNG_INTERNAL_HTTP} is already in use, you"
|
||||||
err_msg "should stop that service before starting local tests!"
|
err_msg "should stop that service before starting local tests!"
|
||||||
if ! ask_yn "Continue with local tests?"; then
|
if ! ask_yn "Continue with local tests?"; then
|
||||||
return
|
return
|
||||||
|
@ -767,10 +769,10 @@ test_local_searx() {
|
||||||
sed -i -e "s/debug: false/debug: true/g" "$SEARXNG_SETTINGS_PATH"
|
sed -i -e "s/debug: false/debug: true/g" "$SEARXNG_SETTINGS_PATH"
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
export SEARXNG_SETTINGS_PATH="${SEARXNG_SETTINGS_PATH}"
|
export SEARXNG_SETTINGS_PATH="${SEARXNG_SETTINGS_PATH}"
|
||||||
cd ${SEARX_SRC}
|
cd ${SEARXNG_SRC}
|
||||||
timeout 10 python searx/webapp.py &
|
timeout 10 python searx/webapp.py &
|
||||||
sleep 3
|
sleep 3
|
||||||
curl --location --verbose --head --insecure $SEARX_INTERNAL_HTTP
|
curl --location --verbose --head --insecure $SEARXNG_INTERNAL_HTTP
|
||||||
EOF
|
EOF
|
||||||
sed -i -e "s/debug: true/debug: false/g" "$SEARXNG_SETTINGS_PATH"
|
sed -i -e "s/debug: true/debug: false/g" "$SEARXNG_SETTINGS_PATH"
|
||||||
}
|
}
|
||||||
|
@ -805,7 +807,7 @@ deactivate_service() {
|
||||||
enable_image_proxy() {
|
enable_image_proxy() {
|
||||||
info_msg "try to enable image_proxy ..."
|
info_msg "try to enable image_proxy ..."
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
cd ${SEARX_SRC}
|
cd ${SEARXNG_SRC}
|
||||||
sed -i -e "s/image_proxy: false/image_proxy: true/g" "$SEARXNG_SETTINGS_PATH"
|
sed -i -e "s/image_proxy: false/image_proxy: true/g" "$SEARXNG_SETTINGS_PATH"
|
||||||
EOF
|
EOF
|
||||||
uWSGI_restart "$SEARXNG_UWSGI_APP"
|
uWSGI_restart "$SEARXNG_UWSGI_APP"
|
||||||
|
@ -814,7 +816,7 @@ EOF
|
||||||
disable_image_proxy() {
|
disable_image_proxy() {
|
||||||
info_msg "try to enable image_proxy ..."
|
info_msg "try to enable image_proxy ..."
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
cd ${SEARX_SRC}
|
cd ${SEARXNG_SRC}
|
||||||
sed -i -e "s/image_proxy: true/image_proxy: false/g" "$SEARXNG_SETTINGS_PATH"
|
sed -i -e "s/image_proxy: true/image_proxy: false/g" "$SEARXNG_SETTINGS_PATH"
|
||||||
EOF
|
EOF
|
||||||
uWSGI_restart "$SEARXNG_UWSGI_APP"
|
uWSGI_restart "$SEARXNG_UWSGI_APP"
|
||||||
|
@ -824,7 +826,7 @@ enable_debug() {
|
||||||
warn_msg "Do not enable debug in production environments!!"
|
warn_msg "Do not enable debug in production environments!!"
|
||||||
info_msg "try to enable debug mode ..."
|
info_msg "try to enable debug mode ..."
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
cd ${SEARX_SRC}
|
cd ${SEARXNG_SRC}
|
||||||
sed -i -e "s/debug: false/debug: true/g" "$SEARXNG_SETTINGS_PATH"
|
sed -i -e "s/debug: false/debug: true/g" "$SEARXNG_SETTINGS_PATH"
|
||||||
EOF
|
EOF
|
||||||
uWSGI_restart "$SEARXNG_UWSGI_APP"
|
uWSGI_restart "$SEARXNG_UWSGI_APP"
|
||||||
|
@ -833,7 +835,7 @@ EOF
|
||||||
disable_debug() {
|
disable_debug() {
|
||||||
info_msg "try to disable debug mode ..."
|
info_msg "try to disable debug mode ..."
|
||||||
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
|
||||||
cd ${SEARX_SRC}
|
cd ${SEARXNG_SRC}
|
||||||
sed -i -e "s/debug: true/debug: false/g" "$SEARXNG_SETTINGS_PATH"
|
sed -i -e "s/debug: true/debug: false/g" "$SEARXNG_SETTINGS_PATH"
|
||||||
EOF
|
EOF
|
||||||
uWSGI_restart "$SEARXNG_UWSGI_APP"
|
uWSGI_restart "$SEARXNG_UWSGI_APP"
|
||||||
|
@ -903,11 +905,11 @@ EOF
|
||||||
lxc_suite_info
|
lxc_suite_info
|
||||||
else
|
else
|
||||||
info_msg "public URL --> ${PUBLIC_URL}"
|
info_msg "public URL --> ${PUBLIC_URL}"
|
||||||
info_msg "internal URL --> http://${SEARX_INTERNAL_HTTP}"
|
info_msg "internal URL --> http://${SEARXNG_INTERNAL_HTTP}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! service_is_available "http://${SEARX_INTERNAL_HTTP}"; then
|
if ! service_is_available "http://${SEARXNG_INTERNAL_HTTP}"; then
|
||||||
err_msg "uWSGI app (service) at http://${SEARX_INTERNAL_HTTP} is not available!"
|
err_msg "uWSGI app (service) at http://${SEARXNG_INTERNAL_HTTP} is not available!"
|
||||||
MSG="${_Green}[${_BCyan}CTRL-C${_Green}] to stop or [${_BCyan}KEY${_Green}] to continue"\
|
MSG="${_Green}[${_BCyan}CTRL-C${_Green}] to stop or [${_BCyan}KEY${_Green}] to continue"\
|
||||||
wait_key
|
wait_key
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -4,7 +4,7 @@ LoadModule headers_module ${APACHE_MODULES}/mod_headers.so
|
||||||
LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so
|
LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so
|
||||||
LoadModule proxy_uwsgi_module ${APACHE_MODULES}/mod_proxy_uwsgi.so
|
LoadModule proxy_uwsgi_module ${APACHE_MODULES}/mod_proxy_uwsgi.so
|
||||||
# LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so
|
# LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so
|
||||||
|
#
|
||||||
# SetEnvIf Request_URI "${SEARXNG_URL_PATH}" dontlog
|
# SetEnvIf Request_URI "${SEARXNG_URL_PATH}" dontlog
|
||||||
# CustomLog /dev/null combined env=dontlog
|
# CustomLog /dev/null combined env=dontlog
|
||||||
|
|
||||||
|
@ -22,6 +22,13 @@ LoadModule proxy_uwsgi_module ${APACHE_MODULES}/mod_proxy_uwsgi.so
|
||||||
Allow from all
|
Allow from all
|
||||||
|
|
||||||
ProxyPreserveHost On
|
ProxyPreserveHost On
|
||||||
ProxyPass unix:${SEARX_UWSGI_SOCKET}|uwsgi://uwsgi-uds-searx/
|
ProxyPass unix:${SEARXNG_UWSGI_SOCKET}|uwsgi://uwsgi-uds-searx/
|
||||||
|
|
||||||
</Location>
|
</Location>
|
||||||
|
|
||||||
|
# uWSGI serves the static files and in settings.yml we use::
|
||||||
|
#
|
||||||
|
# ui:
|
||||||
|
# static_use_hash: true
|
||||||
|
#
|
||||||
|
# Alias ${SEARXNG_URL_PATH}/static/ ${SEARXNG_STATIC}/
|
||||||
|
|
|
@ -12,5 +12,5 @@ location ${SEARXNG_URL_PATH} {
|
||||||
}
|
}
|
||||||
|
|
||||||
location ${SEARXNG_URL_PATH}/static/ {
|
location ${SEARXNG_URL_PATH}/static/ {
|
||||||
alias ${SEARX_SRC}/searx/static/;
|
alias ${SEARXNG_STATIC}/;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ env = LANGUAGE=C.UTF-8
|
||||||
env = LC_ALL=C.UTF-8
|
env = LC_ALL=C.UTF-8
|
||||||
|
|
||||||
# chdir to specified directory before apps loading
|
# chdir to specified directory before apps loading
|
||||||
chdir = ${SEARX_SRC}/searx
|
chdir = ${SEARXNG_SRC}/searx
|
||||||
|
|
||||||
# SearXNG configuration (settings.yml)
|
# SearXNG configuration (settings.yml)
|
||||||
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
||||||
|
@ -57,10 +57,10 @@ enable-threads = true
|
||||||
module = searx.webapp
|
module = searx.webapp
|
||||||
|
|
||||||
# set PYTHONHOME/virtualenv
|
# set PYTHONHOME/virtualenv
|
||||||
virtualenv = ${SEARX_PYENV}
|
virtualenv = ${SEARXNG_PYENV}
|
||||||
|
|
||||||
# add directory (or glob) to pythonpath
|
# add directory (or glob) to pythonpath
|
||||||
pythonpath = ${SEARX_SRC}
|
pythonpath = ${SEARXNG_SRC}
|
||||||
|
|
||||||
|
|
||||||
# speak to upstream
|
# speak to upstream
|
||||||
|
@ -74,20 +74,20 @@ pythonpath = ${SEARX_SRC}
|
||||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#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
|
# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html
|
||||||
|
|
||||||
http = ${SEARX_INTERNAL_HTTP}
|
http = ${SEARXNG_INTERNAL_HTTP}
|
||||||
|
|
||||||
# using unix-sockets:
|
# using unix-sockets:
|
||||||
#
|
#
|
||||||
# On some distributions you need to create the app folder for the sockets::
|
# Don't forget to create the folder where the sockets should take place::
|
||||||
#
|
#
|
||||||
# mkdir -p ${SEARX_UWSGI_SOCKET}
|
# mkdir -p "$(dirname ${SEARXNG_UWSGI_SOCKET})"
|
||||||
# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET}
|
# chown -R "${SERVICE_USER}:${SERVICE_GROUP}" "$(dirname ${SEARXNG_UWSGI_SOCKET})"
|
||||||
#
|
#
|
||||||
# socket = ${SEARX_UWSGI_SOCKET}
|
# socket = ${SEARXNG_UWSGI_SOCKET}
|
||||||
|
|
||||||
# uwsgi serves the static files
|
# uwsgi serves the static files
|
||||||
# expires set to one year since there are hashes
|
# expires set to one year since there are hashes
|
||||||
static-map = /static=${SEARX_SRC}/searx/static
|
static-map = /static=${SEARXNG_STATIC}
|
||||||
static-expires = /* 31557600
|
static-expires = /* 31557600
|
||||||
static-gzip-all = True
|
static-gzip-all = True
|
||||||
offload-threads = %k
|
offload-threads = %k
|
||||||
|
|
|
@ -16,7 +16,7 @@ env = LANGUAGE=C.UTF-8
|
||||||
env = LC_ALL=C.UTF-8
|
env = LC_ALL=C.UTF-8
|
||||||
|
|
||||||
# chdir to specified directory before apps loading
|
# chdir to specified directory before apps loading
|
||||||
chdir = ${SEARX_SRC}/searx
|
chdir = ${SEARXNG_SRC}/searx
|
||||||
|
|
||||||
# SearXNG configuration (settings.yml)
|
# SearXNG configuration (settings.yml)
|
||||||
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
||||||
|
@ -57,10 +57,10 @@ enable-threads = true
|
||||||
module = searx.webapp
|
module = searx.webapp
|
||||||
|
|
||||||
# set PYTHONHOME/virtualenv
|
# set PYTHONHOME/virtualenv
|
||||||
virtualenv = ${SEARX_PYENV}
|
virtualenv = ${SEARXNG_PYENV}
|
||||||
|
|
||||||
# add directory (or glob) to pythonpath
|
# add directory (or glob) to pythonpath
|
||||||
pythonpath = ${SEARX_SRC}
|
pythonpath = ${SEARXNG_SRC}
|
||||||
|
|
||||||
|
|
||||||
# speak to upstream
|
# speak to upstream
|
||||||
|
@ -74,20 +74,24 @@ pythonpath = ${SEARX_SRC}
|
||||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#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
|
# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html
|
||||||
|
|
||||||
# http = ${SEARX_INTERNAL_HTTP}
|
# http = ${SEARXNG_INTERNAL_HTTP}
|
||||||
|
|
||||||
# using unix-sockets:
|
# using unix-sockets:
|
||||||
#
|
#
|
||||||
# On some distributions you need to create the app folder for the sockets::
|
# Don't forget to create the folder where the sockets should take place::
|
||||||
#
|
#
|
||||||
# mkdir -p ${SEARX_UWSGI_SOCKET}
|
# mkdir -p "$(dirname ${SEARXNG_UWSGI_SOCKET})"
|
||||||
# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET}
|
# chown -R "${SERVICE_USER}:${SERVICE_GROUP}" "$(dirname ${SEARXNG_UWSGI_SOCKET})"
|
||||||
#
|
#
|
||||||
socket = ${SEARX_UWSGI_SOCKET}
|
socket = ${SEARXNG_UWSGI_SOCKET}
|
||||||
|
|
||||||
# uwsgi serves the static files
|
# uWSGI serves the static files and in settings.yml we use::
|
||||||
|
#
|
||||||
|
# ui:
|
||||||
|
# static_use_hash: true
|
||||||
|
#
|
||||||
|
static-map = /static=${SEARXNG_STATIC}
|
||||||
# expires set to one year since there are hashes
|
# expires set to one year since there are hashes
|
||||||
static-map = /static=${SEARX_SRC}/searx/static
|
|
||||||
static-expires = /* 31557600
|
static-expires = /* 31557600
|
||||||
static-gzip-all = True
|
static-gzip-all = True
|
||||||
offload-threads = %k
|
offload-threads = %k
|
||||||
|
|
|
@ -16,7 +16,7 @@ env = LANGUAGE=C.UTF-8
|
||||||
env = LC_ALL=C.UTF-8
|
env = LC_ALL=C.UTF-8
|
||||||
|
|
||||||
# chdir to specified directory before apps loading
|
# chdir to specified directory before apps loading
|
||||||
chdir = ${SEARX_SRC}/searx
|
chdir = ${SEARXNG_SRC}/searx
|
||||||
|
|
||||||
# SearXNG configuration (settings.yml)
|
# SearXNG configuration (settings.yml)
|
||||||
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
||||||
|
@ -56,10 +56,10 @@ enable-threads = true
|
||||||
module = searx.webapp
|
module = searx.webapp
|
||||||
|
|
||||||
# set PYTHONHOME/virtualenv
|
# set PYTHONHOME/virtualenv
|
||||||
virtualenv = ${SEARX_PYENV}
|
virtualenv = ${SEARXNG_PYENV}
|
||||||
|
|
||||||
# add directory (or glob) to pythonpath
|
# add directory (or glob) to pythonpath
|
||||||
pythonpath = ${SEARX_SRC}
|
pythonpath = ${SEARXNG_SRC}
|
||||||
|
|
||||||
|
|
||||||
# speak to upstream
|
# speak to upstream
|
||||||
|
@ -73,20 +73,20 @@ pythonpath = ${SEARX_SRC}
|
||||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#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
|
# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html
|
||||||
|
|
||||||
http = ${SEARX_INTERNAL_HTTP}
|
http = ${SEARXNG_INTERNAL_HTTP}
|
||||||
|
|
||||||
# using unix-sockets:
|
# using unix-sockets:
|
||||||
#
|
#
|
||||||
# On some distributions you need to create the app folder for the sockets::
|
# Don't forget to create the folder where the sockets should take place::
|
||||||
#
|
#
|
||||||
# mkdir -p /run/uwsgi/app/searxng
|
# mkdir -p "$(dirname ${SEARXNG_UWSGI_SOCKET})"
|
||||||
# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET}
|
# chown -R "${SERVICE_USER}:${SERVICE_GROUP}" "$(dirname ${SEARXNG_UWSGI_SOCKET})"
|
||||||
#
|
#
|
||||||
# socket = ${SEARX_UWSGI_SOCKET}
|
# socket = ${SEARXNG_UWSGI_SOCKET}
|
||||||
|
|
||||||
# uwsgi serves the static files
|
# uwsgi serves the static files
|
||||||
# expires set to one year since there are hashes
|
# expires set to one year since there are hashes
|
||||||
static-map = /static=${SEARX_SRC}/searx/static
|
static-map = /static=${SEARXNG_STATIC}
|
||||||
static-expires = /* 31557600
|
static-expires = /* 31557600
|
||||||
static-gzip-all = True
|
static-gzip-all = True
|
||||||
offload-threads = %k
|
offload-threads = %k
|
||||||
|
|
|
@ -16,7 +16,7 @@ env = LANGUAGE=C.UTF-8
|
||||||
env = LC_ALL=C.UTF-8
|
env = LC_ALL=C.UTF-8
|
||||||
|
|
||||||
# chdir to specified directory before apps loading
|
# chdir to specified directory before apps loading
|
||||||
chdir = ${SEARX_SRC}/searx
|
chdir = ${SEARXNG_SRC}/searx
|
||||||
|
|
||||||
# SearXNG configuration (settings.yml)
|
# SearXNG configuration (settings.yml)
|
||||||
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
||||||
|
@ -56,10 +56,10 @@ enable-threads = true
|
||||||
module = searx.webapp
|
module = searx.webapp
|
||||||
|
|
||||||
# set PYTHONHOME/virtualenv
|
# set PYTHONHOME/virtualenv
|
||||||
virtualenv = ${SEARX_PYENV}
|
virtualenv = ${SEARXNG_PYENV}
|
||||||
|
|
||||||
# add directory (or glob) to pythonpath
|
# add directory (or glob) to pythonpath
|
||||||
pythonpath = ${SEARX_SRC}
|
pythonpath = ${SEARXNG_SRC}
|
||||||
|
|
||||||
|
|
||||||
# speak to upstream
|
# speak to upstream
|
||||||
|
@ -73,20 +73,24 @@ pythonpath = ${SEARX_SRC}
|
||||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#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
|
# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html
|
||||||
|
|
||||||
# http = ${SEARX_INTERNAL_HTTP}
|
# http = ${SEARXNG_INTERNAL_HTTP}
|
||||||
|
|
||||||
# using unix-sockets:
|
# using unix-sockets:
|
||||||
#
|
#
|
||||||
# On some distributions you need to create the app folder for the sockets::
|
# Don't forget to create the folder where the sockets should take place::
|
||||||
#
|
#
|
||||||
# mkdir -p ${SEARX_UWSGI_SOCKET}
|
# mkdir -p "$(dirname ${SEARXNG_UWSGI_SOCKET})"
|
||||||
# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET}
|
# chown -R "${SERVICE_USER}:${SERVICE_GROUP}" "$(dirname ${SEARXNG_UWSGI_SOCKET})"
|
||||||
#
|
#
|
||||||
socket = ${SEARX_UWSGI_SOCKET}
|
socket = ${SEARXNG_UWSGI_SOCKET}
|
||||||
|
|
||||||
# uwsgi serves the static files
|
# uWSGI serves the static files and in settings.yml we use::
|
||||||
|
#
|
||||||
|
# ui:
|
||||||
|
# static_use_hash: true
|
||||||
|
#
|
||||||
|
static-map = /static=${SEARXNG_STATIC}
|
||||||
# expires set to one year since there are hashes
|
# expires set to one year since there are hashes
|
||||||
static-map = /static=${SEARX_SRC}/searx/static
|
|
||||||
static-expires = /* 31557600
|
static-expires = /* 31557600
|
||||||
static-gzip-all = True
|
static-gzip-all = True
|
||||||
offload-threads = %k
|
offload-threads = %k
|
||||||
|
|
Loading…
Reference in New Issue