summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-10-02 17:18:05 +0200
committerAlexandre Flament <alex@al-f.net>2021-10-02 17:18:05 +0200
commit253b8503765b6f0d21135254277e72d17a51e04a (patch)
treec52ae4a1d47140d5e531e78b7fbc11e0a354c7ec /utils
parent9e266ecad3cc20faf2c12cdab7862c29cf8df2ec (diff)
downloadsearxng-253b8503765b6f0d21135254277e72d17a51e04a.tar.gz
searxng-253b8503765b6f0d21135254277e72d17a51e04a.zip
SearXNG: SEARXNG_SETTINGS_PATH
Diffstat (limited to 'utils')
-rw-r--r--utils/build_env.py4
-rwxr-xr-xutils/lib_install.sh6
-rwxr-xr-xutils/morty.sh2
-rwxr-xr-xutils/searx.sh40
-rw-r--r--utils/templates/etc/uwsgi/apps-archlinux/searx.ini2
-rw-r--r--utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket2
-rw-r--r--utils/templates/etc/uwsgi/apps-available/searx.ini2
-rw-r--r--utils/templates/etc/uwsgi/apps-available/searx.ini:socket2
8 files changed, 30 insertions, 30 deletions
diff --git a/utils/build_env.py b/utils/build_env.py
index 3ba4e4aaf..42d75fbfb 100644
--- a/utils/build_env.py
+++ b/utils/build_env.py
@@ -12,7 +12,7 @@ sys.path.insert(0, repo_root)
# Assure that the settings file from reposetorie's working tree is used to
# generate the build_env, not from /etc/searx/settings.yml.
-os.environ['SEARX_SETTINGS_PATH'] = join(repo_root, 'etc', 'settings.yml')
+os.environ['SEARXNG_SETTINGS_PATH'] = join(repo_root, 'etc', 'settings.yml')
def _env(*arg, **kwargs):
val = get_setting(*arg, **kwargs)
@@ -51,7 +51,7 @@ for name, option in name_val:
from searx.version import GIT_URL, GIT_BRANCH
from searx import get_setting
-print('build %s (settings from: %s)' % (brand_env, os.environ['SEARX_SETTINGS_PATH']))
+print('build %s (settings from: %s)' % (brand_env, os.environ['SEARXNG_SETTINGS_PATH']))
sys.path.insert(0, repo_root)
with open(repo_root + sep + brand_env, 'w', encoding='utf-8') as f:
diff --git a/utils/lib_install.sh b/utils/lib_install.sh
index 4ad11d63d..dc9ee6993 100755
--- a/utils/lib_install.sh
+++ b/utils/lib_install.sh
@@ -53,7 +53,7 @@ source_dot_config() {
export eval_SEARX_SRC='true'
SEARX_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_SRC)
SEARX_PYENV=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_PYENV)
- SEARX_SETTINGS_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_SETTINGS_PATH)
+ SEARXNG_SETTINGS_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_SETTINGS_PATH)
if [ ! -r "${SEARX_SRC}" ]; then
info_msg "not yet cloned: ${SEARX_SRC}"
orig_source_dot_config
@@ -115,7 +115,7 @@ init_SEARX_SRC_INIT_FILES(){
install_log_searx_instance() {
echo -e "---- SearXNG instance setup ${_BBlue}(status: $(install_searx_get_state))${_creset}"
- echo -e " SEARX_SETTINGS_PATH : ${_BBlue}${SEARX_SETTINGS_PATH}${_creset}"
+ echo -e " SEARXNG_SETTINGS_PATH : ${_BBlue}${SEARXNG_SETTINGS_PATH}${_creset}"
echo -e " SSEARX_PYENV : ${_BBlue}${SEARX_PYENV}${_creset}"
echo -e " SEARX_SRC : ${_BBlue}${SEARX_SRC:-none}${_creset}"
echo -e " SEARX_URL : ${_BBlue}${SEARX_URL:-none}${_creset}"
@@ -163,7 +163,7 @@ install_searx_get_state(){
echo "missing-searx-pyenv"
return
fi
- if ! [ -r "${SEARX_SETTINGS_PATH}" ]; then
+ if ! [ -r "${SEARXNG_SETTINGS_PATH}" ]; then
echo "missing-settings"
return
fi
diff --git a/utils/morty.sh b/utils/morty.sh
index c39568677..0c5401eeb 100755
--- a/utils/morty.sh
+++ b/utils/morty.sh
@@ -111,7 +111,7 @@ info_searx() {
cat <<EOF
To activate result and image proxy in SearXNG read:
https://searxng.github.io/searxng/admin/morty.html
-Check settings in file ${SEARX_SETTINGS_PATH} ...
+Check settings in file ${SEARXNG_SETTINGS_PATH} ...
result_proxy:
url : ${PUBLIC_URL_MORTY}
server:
diff --git a/utils/searx.sh b/utils/searx.sh
index ed33e18c8..41ab3aee5 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"
-SEARX_SETTINGS_PATH="/etc/searx/settings.yml"
+SEARXNG_SETTINGS_PATH="/etc/searx/settings.yml"
SEARX_UWSGI_APP="searx.ini"
# shellcheck disable=SC2034
SEARX_UWSGI_SOCKET="/run/uwsgi/app/searx/socket"
@@ -130,7 +130,7 @@ CONFIG_FILES=(
# shellcheck disable=SC2034
CONFIG_BACKUP_ENCRYPTED=(
- "${SEARX_SETTINGS_PATH}"
+ "${SEARXNG_SETTINGS_PATH}"
)
# ----------------------------------------------------------------------------
@@ -160,7 +160,7 @@ install / remove
:init-src: copy files (SEARX_SRC_INIT_FILES) to ${SEARX_SRC}
:pyenv: create/remove virtualenv (python) in $SEARX_PYENV
:uwsgi: install searx uWSGI application
- :settings: reinstall settings from ${SEARX_SETTINGS_PATH}
+ :settings: reinstall settings from ${SEARXNG_SETTINGS_PATH}
:packages: install needed packages from OS package manager
:buildhost: install packages from OS package manager needed by buildhosts
update searx
@@ -613,16 +613,16 @@ install_DOT_CONFIG(){
}
install_settings() {
- rst_title "${SEARX_SETTINGS_PATH}" section
+ rst_title "${SEARXNG_SETTINGS_PATH}" section
if ! clone_is_available; then
err_msg "you have to install SearXNG first"
exit 42
fi
- mkdir -p "$(dirname "${SEARX_SETTINGS_PATH}")"
+ mkdir -p "$(dirname "${SEARXNG_SETTINGS_PATH}")"
install_template --no-eval \
- "${SEARX_SETTINGS_PATH}" \
+ "${SEARXNG_SETTINGS_PATH}" \
"${SERVICE_USER}" "${SERVICE_GROUP}"
configure_searx
}
@@ -630,8 +630,8 @@ install_settings() {
remove_settings() {
rst_title "remove SearXNG settings" section
echo
- info_msg "delete ${SEARX_SETTINGS_PATH}"
- rm -f "${SEARX_SETTINGS_PATH}"
+ info_msg "delete ${SEARXNG_SETTINGS_PATH}"
+ rm -f "${SEARXNG_SETTINGS_PATH}"
}
remove_searx() {
@@ -692,11 +692,11 @@ EOF
configure_searx() {
rst_title "Configure SearXNG" section
- rst_para "Setup SearXNG config located at $SEARX_SETTINGS_PATH"
+ rst_para "Setup SearXNG config located at $SEARXNG_SETTINGS_PATH"
echo
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
cd ${SEARX_SRC}
-sed -i -e "s/ultrasecretkey/$(openssl rand -hex 16)/g" "$SEARX_SETTINGS_PATH"
+sed -i -e "s/ultrasecretkey/$(openssl rand -hex 16)/g" "$SEARXNG_SETTINGS_PATH"
EOF
}
@@ -711,15 +711,15 @@ test_local_searx() {
return
fi
fi
- sed -i -e "s/debug: false/debug: true/g" "$SEARX_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"
-export SEARX_SETTINGS_PATH="${SEARX_SETTINGS_PATH}"
+export SEARXNG_SETTINGS_PATH="${SEARXNG_SETTINGS_PATH}"
cd ${SEARX_SRC}
timeout 10 python searx/webapp.py &
sleep 3
curl --location --verbose --head --insecure $SEARX_INTERNAL_HTTP
EOF
- sed -i -e "s/debug: true/debug: false/g" "$SEARX_SETTINGS_PATH"
+ sed -i -e "s/debug: true/debug: false/g" "$SEARXNG_SETTINGS_PATH"
}
install_searx_uwsgi() {
@@ -753,7 +753,7 @@ enable_image_proxy() {
info_msg "try to enable image_proxy ..."
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
cd ${SEARX_SRC}
-sed -i -e "s/image_proxy: false/image_proxy: true/g" "$SEARX_SETTINGS_PATH"
+sed -i -e "s/image_proxy: false/image_proxy: true/g" "$SEARXNG_SETTINGS_PATH"
EOF
uWSGI_restart "$SEARX_UWSGI_APP"
}
@@ -762,7 +762,7 @@ disable_image_proxy() {
info_msg "try to enable image_proxy ..."
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
cd ${SEARX_SRC}
-sed -i -e "s/image_proxy: true/image_proxy: false/g" "$SEARX_SETTINGS_PATH"
+sed -i -e "s/image_proxy: true/image_proxy: false/g" "$SEARXNG_SETTINGS_PATH"
EOF
uWSGI_restart "$SEARX_UWSGI_APP"
}
@@ -772,7 +772,7 @@ enable_debug() {
info_msg "try to enable debug mode ..."
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
cd ${SEARX_SRC}
-sed -i -e "s/debug: false/debug: true/g" "$SEARX_SETTINGS_PATH"
+sed -i -e "s/debug: false/debug: true/g" "$SEARXNG_SETTINGS_PATH"
EOF
uWSGI_restart "$SEARX_UWSGI_APP"
}
@@ -781,7 +781,7 @@ disable_debug() {
info_msg "try to disable debug mode ..."
tee_stderr 0.1 <<EOF | sudo -H -i 2>&1 | prefix_stdout "$_service_prefix"
cd ${SEARX_SRC}
-sed -i -e "s/debug: true/debug: false/g" "$SEARX_SETTINGS_PATH"
+sed -i -e "s/debug: true/debug: false/g" "$SEARXNG_SETTINGS_PATH"
EOF
uWSGI_restart "$SEARX_UWSGI_APP"
}
@@ -791,8 +791,8 @@ set_result_proxy() {
# usage: set_result_proxy <URL> [<key>]
info_msg "try to set result proxy: '$1' ($2)"
- cp "${SEARX_SETTINGS_PATH}" "${SEARX_SETTINGS_PATH}.bak"
- _set_result_proxy "$1" "$2" > "${SEARX_SETTINGS_PATH}"
+ cp "${SEARXNG_SETTINGS_PATH}" "${SEARXNG_SETTINGS_PATH}.bak"
+ _set_result_proxy "$1" "$2" > "${SEARXNG_SETTINGS_PATH}"
}
_set_result_proxy() {
@@ -829,7 +829,7 @@ _set_result_proxy() {
fi
fi
echo "$line"
- done < "${SEARX_SETTINGS_PATH}.bak"
+ done < "${SEARXNG_SETTINGS_PATH}.bak"
}
function has_substring() {
diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini
index 71cece3c4..dcb7d1a7d 100644
--- a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini
+++ b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini
@@ -18,7 +18,7 @@ env = LC_ALL=C.UTF-8
chdir = ${SEARX_SRC}/searx
# searx configuration (settings.yml)
-env = SEARX_SETTINGS_PATH=${SEARX_SETTINGS_PATH}
+env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
# disable logging for privacy
logger = systemd
diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket
index 1a0fda913..580600072 100644
--- a/utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket
+++ b/utils/templates/etc/uwsgi/apps-archlinux/searx.ini:socket
@@ -18,7 +18,7 @@ env = LC_ALL=C.UTF-8
chdir = ${SEARX_SRC}/searx
# searx configuration (settings.yml)
-env = SEARX_SETTINGS_PATH=${SEARX_SETTINGS_PATH}
+env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
# disable logging for privacy
logger = systemd
diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini b/utils/templates/etc/uwsgi/apps-available/searx.ini
index 45214ef13..440c2e97d 100644
--- a/utils/templates/etc/uwsgi/apps-available/searx.ini
+++ b/utils/templates/etc/uwsgi/apps-available/searx.ini
@@ -18,7 +18,7 @@ env = LC_ALL=C.UTF-8
chdir = ${SEARX_SRC}/searx
# searx configuration (settings.yml)
-env = SEARX_SETTINGS_PATH=${SEARX_SETTINGS_PATH}
+env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
# disable logging for privacy
disable-logging = true
diff --git a/utils/templates/etc/uwsgi/apps-available/searx.ini:socket b/utils/templates/etc/uwsgi/apps-available/searx.ini:socket
index 9cb292102..08c98cf61 100644
--- a/utils/templates/etc/uwsgi/apps-available/searx.ini:socket
+++ b/utils/templates/etc/uwsgi/apps-available/searx.ini:socket
@@ -18,7 +18,7 @@ env = LC_ALL=C.UTF-8
chdir = ${SEARX_SRC}/searx
# searx configuration (settings.yml)
-env = SEARX_SETTINGS_PATH=${SEARX_SETTINGS_PATH}
+env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
# disable logging for privacy
disable-logging = true