From 60edf2623d7c1a6b394638c6673c0d981674c570 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 11 Oct 2021 10:56:50 +0200 Subject: [PATCH] [brand] SearXNG - reference /etc/searxng/settings.yml Signed-off-by: Markus Heiser --- .config.sh | 2 +- docs/admin/engines/settings.rst | 2 +- docs/admin/installation-searx.rst | 10 +++++----- docs/build-templates/searx.rst | 2 +- docs/dev/lxcdev.rst | 4 ++-- manage | 6 +++++- utils/lib_install.sh | 4 ++++ utils/searx.sh | 2 +- utils/templates/etc/{searx => searxng}/settings.yml | 5 +++-- 9 files changed, 23 insertions(+), 14 deletions(-) rename utils/templates/etc/{searx => searxng}/settings.yml (94%) diff --git a/.config.sh b/.config.sh index 36066139f..9a3a0bbcb 100644 --- a/.config.sh +++ b/.config.sh @@ -23,7 +23,7 @@ # # $ ./utils/searx.sh --help # ---- SearXNG instance setup (already installed) -# SEARXNG_SETTINGS_PATH : /etc/searx/settings.yml +# SEARXNG_SETTINGS_PATH : /etc/searxng/settings.yml # SEARX_SRC : /usr/local/searx/searx-src # # [1] https://searxng.github.io/searxng/admin/engines/settings.html diff --git a/docs/admin/engines/settings.rst b/docs/admin/engines/settings.rst index da5457e8c..7a354afee 100644 --- a/docs/admin/engines/settings.rst +++ b/docs/admin/engines/settings.rst @@ -339,7 +339,7 @@ use_default_settings - :ref:`settings location` - :ref:`use_default_settings.yml` - - :origin:`/etc/searxng/settings.yml ` + - :origin:`/etc/searxng/settings.yml ` The user defined ``settings.yml`` is loaded from the :ref:`settings location` and can relied on the default configuration :origin:`searx/settings.yml` using: diff --git a/docs/admin/installation-searx.rst b/docs/admin/installation-searx.rst index acd2f4579..3aa655e85 100644 --- a/docs/admin/installation-searx.rst +++ b/docs/admin/installation-searx.rst @@ -75,12 +75,12 @@ Configuration - :ref:`settings global` - :ref:`settings location` - :ref:`settings use_default_settings` - - :origin:`/etc/searxng/settings.yml ` + - :origin:`/etc/searxng/settings.yml ` -To create a initial ``/etc/searxng/settings.yml`` you can start with a copy of the -file :origin:`utils/templates/etc/searx/use_default_settings.yml`. This setup +To create a initial ``/etc/searxng/settings.yml`` you can start with a copy of +the file :origin:`utils/templates/etc/searxng/settings.yml`. This setup :ref:`use default settings ` from -:origin:`searx/settings.yml` and is recommended since :pull-searx:`2291` is merged. +:origin:`searx/settings.yml`. For a *minimal setup*, configure like shown below – replace ``searx@$(uname -n)`` with a name of your choice, set ``ultrasecretkey`` -- *and/or* edit @@ -94,7 +94,7 @@ For a *minimal setup*, configure like shown below – replace ``searx@$(uname .. group-tab:: Use default settings - .. literalinclude:: ../../utils/templates/etc/searx/settings.yml + .. literalinclude:: ../../utils/templates/etc/searxng/settings.yml :language: yaml .. group-tab:: searx/settings.yml diff --git a/docs/build-templates/searx.rst b/docs/build-templates/searx.rst index 804514ac8..bea7fa5e0 100644 --- a/docs/build-templates/searx.rst +++ b/docs/build-templates/searx.rst @@ -134,7 +134,7 @@ ${fedora_build} .. code-block:: sh $ sudo -H mkdir -p \"$(dirname ${SEARXNG_SETTINGS_PATH})\" - $ sudo -H cp \"$SEARX_SRC/utils/templates/etc/searx/settings.yml\" \\ + $ sudo -H cp \"$SEARX_SRC/utils/templates/etc/searxng/settings.yml\" \\ \"${SEARXNG_SETTINGS_PATH}\" .. group-tab:: searx/settings.yml diff --git a/docs/dev/lxcdev.rst b/docs/dev/lxcdev.rst index 12f6d7879..49a2df6c8 100644 --- a/docs/dev/lxcdev.rst +++ b/docs/dev/lxcdev.rst @@ -261,7 +261,7 @@ In this section we will see how to change the *"Fully functional SearXNG suite"* from a LXC container (which is quite ready for production) into a developer suite. For this, we have to keep an eye on the :ref:`installation basic`: -- SearXNG setup in: ``/etc/searx/settings.yml`` +- SearXNG setup in: ``/etc/searxng/settings.yml`` - SearXNG user's home: ``/usr/local/searx`` - virtualenv in: ``/usr/local/searx/searx-pyenv`` - SearXNG software in: ``/usr/local/searx/searx-src`` @@ -288,7 +288,7 @@ The uWSGI-App for the archlinux dsitros is configured in least you should attend the settings of ``uid``, ``chdir``, ``env`` and ``http``:: - env = SEARXNG_SETTINGS_PATH=/etc/searx/settings.yml + env = SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml http = 127.0.0.1:8888 chdir = /usr/local/searx/searx-src/searx diff --git a/manage b/manage index e0bec0334..43e34a86d 100755 --- a/manage +++ b/manage @@ -31,7 +31,7 @@ pylint.FILES() { YAMLLINT_FILES=() while IFS= read -r line; do YAMLLINT_FILES+=("$line") -done <<< "$(git ls-files './tests/*.yml' './searx/*.yml' './utils/templates/etc/searx/*.yml')" +done <<< "$(git ls-files './tests/*.yml' './searx/*.yml' './utils/templates/etc/searxng/*.yml')" PYLINT_SEARX_DISABLE_OPTION="\ I,C,R,\ @@ -107,6 +107,10 @@ buildenv() { # settings file from repository's working tree are used by default SEARXNG_SETTINGS_PATH="${REPO_ROOT}/searx/settings.yml" + if [ -f /etc/searx/settings.yml ]; then + err_msg "settings.yml in /etc/searx/ is deprecated, move file to folder /etc/searxng/" + fi + if [ -r '/etc/searxng/settings.yml' ]; then if ask_yn "should settings read from: /etc/searxng/settings.yml"; then SEARXNG_SETTINGS_PATH='/etc/searxng/settings.yml' diff --git a/utils/lib_install.sh b/utils/lib_install.sh index dc9ee6993..4fd63b830 100755 --- a/utils/lib_install.sh +++ b/utils/lib_install.sh @@ -155,6 +155,10 @@ install_searx_get_state(){ # - user: ${SERVICE_USER} # - pyenv: ${SEARX_PYENV} + if [ -f /etc/searx/settings.yml ]; then + err_msg "settings.yml in /etc/searx/ is deprecated, move file to folder /etc/searxng/" + fi + if ! [ -r "${SEARX_SRC}" ]; then echo "missing-searx-clone" return diff --git a/utils/searx.sh b/utils/searx.sh index 41ab3aee5..178a185b6 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -28,7 +28,7 @@ SERVICE_GROUP="${SERVICE_USER}" GIT_BRANCH="${GIT_BRANCH:-master}" SEARX_PYENV="${SERVICE_HOME}/searx-pyenv" SEARX_SRC="${SERVICE_HOME}/searx-src" -SEARXNG_SETTINGS_PATH="/etc/searx/settings.yml" +SEARXNG_SETTINGS_PATH="/etc/searxng/settings.yml" SEARX_UWSGI_APP="searx.ini" # shellcheck disable=SC2034 SEARX_UWSGI_SOCKET="/run/uwsgi/app/searx/socket" diff --git a/utils/templates/etc/searx/settings.yml b/utils/templates/etc/searxng/settings.yml similarity index 94% rename from utils/templates/etc/searx/settings.yml rename to utils/templates/etc/searxng/settings.yml index 5320b0b2c..dd2a29b3b 100644 --- a/utils/templates/etc/searx/settings.yml +++ b/utils/templates/etc/searxng/settings.yml @@ -21,11 +21,12 @@ search: # use codes from 'languages.py' default_lang: '' # remove format to deny access, use lower case. - formats: [html, csv, json, rss] + formats: + - html server: secret_key: "ultrasecretkey" # change this! - # Proxying image results through searx + # Proxying image results through SearXNG image_proxy: false # result_proxy: