From b6a55e223ce0e287adeeafce8164e411154b5423 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 20 Jul 2021 13:16:21 +0200 Subject: [mod] reduce enviroment variables in shell scripts to what is needed Not all settings from the 'brand:' section of the YAML files are needed in the shell scripts. This patch reduce the variables in ./utils/brand.env to what is needed. The following ('brand:' settings) can be removed from this file: - ISSUE_URL - DOCS_URL - PUBLIC_INSTANCES - WIKI_URL Tasks running outside of an *installed instance*, need the following settings from the YAML configuration: - GIT_URL <--> brand.git_url - GIT_BRANCH <--> brand.git_branch - SEARX_URL <--> server.base_url (aka PUBLIC_URL) - SEARX_PORT <--> server.port - SEARX_BIND_ADDRESS <--> server.bind_address Signed-off-by: Markus Heiser --- utils/brand.env | 8 +++----- utils/build_env.py | 15 ++++++++++----- utils/lxc.sh | 2 +- utils/morty.sh | 3 +-- utils/templates/etc/searx/settings.yml | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) (limited to 'utils') diff --git a/utils/brand.env b/utils/brand.env index a8491d15d..2075a2bf4 100644 --- a/utils/brand.env +++ b/utils/brand.env @@ -1,7 +1,5 @@ -export SEARX_URL='' export GIT_URL='https://github.com/searxng/searxng' export GIT_BRANCH='master' -export ISSUE_URL='https://github.com/searxng/searxng/issues' -export DOCS_URL='https://searxng.github.io/searxng' -export PUBLIC_INSTANCES='https://searx.space' -export WIKI_URL='https://github.com/searxng/searxng/wiki' +export SEARX_URL='' +export SEARX_PORT='8888' +export SEARX_BIND_ADDRESS='127.0.0.1' diff --git a/utils/build_env.py b/utils/build_env.py index 52ca94611..28674f923 100644 --- a/utils/build_env.py +++ b/utils/build_env.py @@ -23,14 +23,19 @@ def _env(*arg, **kwargs): val = '' return val +# If you add or remove variables here, do not forgett to update: +# - docs/admin/engines/settings.rst +# - /docs/dev/makefile.rst (section make buildenv) + name_val = [ - ('SEARX_URL' , 'server.base_url'), + ('GIT_URL' , 'brand.git_url'), ('GIT_BRANCH' , 'brand.git_branch'), - ('ISSUE_URL' , 'brand.issue_url'), - ('DOCS_URL' , 'brand.docs_url'), - ('PUBLIC_INSTANCES' , 'brand.public_instances'), - ('WIKI_URL' , 'brand.wiki_url'), + + ('SEARX_URL' , 'server.base_url'), + ('SEARX_PORT' , 'server.port'), + ('SEARX_BIND_ADDRESS' , 'server.bind_address'), + ] brand_env = 'utils' + sep + 'brand.env' diff --git a/utils/lxc.sh b/utils/lxc.sh index f94e9841a..9a79606ca 100755 --- a/utils/lxc.sh +++ b/utils/lxc.sh @@ -568,7 +568,7 @@ check_connectivity() { info_msg "Most often the connectivity is blocked by a docker installation:" info_msg "Whenever docker is started (reboot) it sets the iptables policy " info_msg "for the FORWARD chain to DROP, see:" - info_msg " ${DOCS_URL}/utils/lxc.sh.html#internet-connectivity-docker" + info_msg " https://searxng.github.io/searxng/utils/lxc.sh.html#internet-connectivity-docker" iptables-save | grep ":FORWARD" fi return $ret_val diff --git a/utils/morty.sh b/utils/morty.sh index ccf920273..8be0e6ba6 100755 --- a/utils/morty.sh +++ b/utils/morty.sh @@ -12,7 +12,6 @@ source "${REPO_ROOT}/utils/lib_install.sh" MORTY_LISTEN="${MORTY_LISTEN:-127.0.0.1:3000}" PUBLIC_URL_PATH_MORTY="${PUBLIC_URL_PATH_MORTY:-/morty/}" - PUBLIC_URL_MORTY="${PUBLIC_URL_MORTY:-$(echo "$PUBLIC_URL" | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}}" # shellcheck disable=SC2034 @@ -111,7 +110,7 @@ info_searx() { # shellcheck disable=SC1117 cat <