summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutils/searx.sh6
-rw-r--r--utils/searxng_check.py27
2 files changed, 33 insertions, 0 deletions
diff --git a/utils/searx.sh b/utils/searx.sh
index 178a185b6..e3393835c 100755
--- a/utils/searx.sh
+++ b/utils/searx.sh
@@ -154,6 +154,7 @@ shell
start interactive shell from user ${SERVICE_USER}
install / remove
:all: complete (de-) installation of searx service
+ :check: check the SearXNG installation
:user: add/remove service user '$SERVICE_USER' ($SERVICE_HOME)
:dot-config: copy ./config.sh to ${SEARX_SRC}
:searx-src: clone $GIT_URL
@@ -215,6 +216,11 @@ main() {
install)
sudo_or_exit
case $2 in
+ check)
+ rst_title "SearXNG (check installation)" part
+ verify_continue_install
+ sudo -H -u "${SERVICE_USER}" "${SEARX_PYENV}/bin/python" "utils/searxng_check.py"
+ ;;
all)
rst_title "SearXNG (install)" part
install_all
diff --git a/utils/searxng_check.py b/utils/searxng_check.py
new file mode 100644
index 000000000..afd0c4056
--- /dev/null
+++ b/utils/searxng_check.py
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: AGPL-3.0-or-later
+# lint: pylint
+"""Implement some checks in the active installation
+"""
+
+import os
+import sys
+import logging
+import warnings
+
+LOG_FORMAT_DEBUG = '%(levelname)-7s %(name)-30.30s: %(message)s'
+logging.basicConfig(level=logging.getLevelName('DEBUG'), format=LOG_FORMAT_DEBUG)
+os.environ['SEARXNG_DEBUG'] = '1'
+
+# from here on implement the checks of the installation
+
+import searx
+
+OLD_SETTING = '/etc/searx/settings.yml'
+
+if os.path.isfile(OLD_SETTING):
+ msg = (
+ '%s is no longer valid, move setting to %s' % (
+ OLD_SETTING,
+ os.environ.get('SEARXNG_SETTINGS_PATH', '/etc/searxng/settings.yml')
+ ))
+ warnings.warn(msg, DeprecationWarning)