From 79e1f837ef7e7c402fd6e9dbb167aac695f2aee7 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 4 Feb 2020 10:39:42 +0100 Subject: utils & Makefile: add .config.mk & .config.sh for searx brands By isolating the environment of makefiles and bash scripts into .config.mk and .config.sh it is simple to maintain searx brands by setting some central environments. Signed-off-by: Markus Heiser --- .config.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .config.sh (limited to '.config.sh') diff --git a/.config.sh b/.config.sh new file mode 100644 index 000000000..346cb9018 --- /dev/null +++ b/.config.sh @@ -0,0 +1,54 @@ +# -*- coding: utf-8; mode: sh -*- +# SPDX-License-Identifier: AGPL-3.0-or-later +# shellcheck shell=bash +# +# This environment is used by ./utils scripts like filtron.sh or searx.sh. The +# default values are *most flexible* and *best maintained*, you normally not +# need to change the defaults (except PUBLIC_URL). +# +# Before you change any value here you have to uninstall any previous +# installation. Further is it recommended to backup your changes simply by +# adding them to you local brand (git branch):: +# +# git add .config +# +# Compare your settings here with file .config.mk used by the Makefile targets. + +# The public URL of the searx instance: PUBLIC_URL="https://mydomain.xy/searx" +PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}" +PUBLIC_HOST="${PUBLIC_HOST:-$(echo "$PUBLIC_URL" | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/')}" + +# searx.sh +# --------- + +SEARX_INTERNAL_URL="${SEARX_INTERNAL_URL:-127.0.0.1:8888}" + +# Only change, if you maintain a searx brand in your searx fork +SEARX_DOCS_URL="${SEARX_DOCS_URL:-https://asciimoo.github.io/searx}" +SEARX_GIT_URL="${SEARX_GIT_URL:-https://github.com/asciimoo/searx.git}" +SEARX_GIT_BRANCH="${SEARX_GIT_BRANCH:-master}" + +# filtron.sh +# ---------- + +FILTRON_API="${FILTRON_API:-127.0.0.1:4005}" +FILTRON_LISTEN="${FILTRON_LISTEN:-127.0.0.1:4004}" +FILTRON_TARGET="${FILTRON_TARGET:-127.0.0.1:8888}" + +# morty.sh +# -------- + +# morty listen address +MORTY_LISTEN="${MORTY_LISTEN:-127.0.0.1:3000}" + +# system services +# --------------- + +# **experimental**: Set SERVICE_USER to run all services by one account, but be +# aware that removing discrete components might conflict! +# +# SERVICE_USER=searx + +# Common $HOME folder of the service accounts +SERVICE_HOME_BASE="${SERVICE_HOME_BASE:-/usr/local}" + -- cgit v1.2.3 From 8ca86f46d3dfd81a69d2c2d1515bb163f327826c Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 4 Feb 2020 10:43:48 +0100 Subject: .config.sh: wrap up to use environment from Makefile as best defaults Signed-off-by: Markus Heiser --- .config.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to '.config.sh') diff --git a/.config.sh b/.config.sh index 346cb9018..e4c5f9928 100644 --- a/.config.sh +++ b/.config.sh @@ -15,7 +15,8 @@ # Compare your settings here with file .config.mk used by the Makefile targets. # The public URL of the searx instance: PUBLIC_URL="https://mydomain.xy/searx" -PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}" +# The default is taken from the Makefile environment (SEARX_URL). +PUBLIC_URL="${SEARX_URL:-http://$(uname -n)/searx}" PUBLIC_HOST="${PUBLIC_HOST:-$(echo "$PUBLIC_URL" | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/')}" # searx.sh @@ -23,9 +24,10 @@ PUBLIC_HOST="${PUBLIC_HOST:-$(echo "$PUBLIC_URL" | sed -e 's/[^/]*\/\/\([^@]*@\) SEARX_INTERNAL_URL="${SEARX_INTERNAL_URL:-127.0.0.1:8888}" -# Only change, if you maintain a searx brand in your searx fork -SEARX_DOCS_URL="${SEARX_DOCS_URL:-https://asciimoo.github.io/searx}" -SEARX_GIT_URL="${SEARX_GIT_URL:-https://github.com/asciimoo/searx.git}" +# Only change, if you maintain a searx brand in your searx fork. The default is +# taken from the Makefile environment (DOCS_URL, GIT_URL). +SEARX_DOCS_URL="${DOCS_URL:-https://asciimoo.github.io/searx}" +SEARX_GIT_URL="${GIT_URL:-https://github.com/asciimoo/searx.git}" SEARX_GIT_BRANCH="${SEARX_GIT_BRANCH:-master}" # filtron.sh -- cgit v1.2.3 From 71d7550dbe750f35f0dd7b5c513bc9e8db9512ee Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 4 Feb 2020 19:47:33 +0100 Subject: tooling box ./utils/*: minor fix from production test --- .config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.config.sh') diff --git a/.config.sh b/.config.sh index e4c5f9928..0fdc0ca12 100644 --- a/.config.sh +++ b/.config.sh @@ -1,6 +1,6 @@ # -*- coding: utf-8; mode: sh -*- # SPDX-License-Identifier: AGPL-3.0-or-later -# shellcheck shell=bash +# shellcheck shell=bash disable=SC2034 # # This environment is used by ./utils scripts like filtron.sh or searx.sh. The # default values are *most flexible* and *best maintained*, you normally not -- cgit v1.2.3 From 7b4cf2eb489d8f6c95ccac5af180254b78e7c460 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 29 Mar 2020 15:09:34 +0200 Subject: tooling box: simplify build enviroments - no more need for a .config.mk - docs: use searx.brands environment - searx.sh, filtron.sh & morty.sh are sourcing utils/brand.env Signed-off-by: Markus Heiser --- .config.sh | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to '.config.sh') diff --git a/.config.sh b/.config.sh index 0fdc0ca12..57411ce6f 100644 --- a/.config.sh +++ b/.config.sh @@ -11,46 +11,41 @@ # adding them to you local brand (git branch):: # # git add .config -# -# Compare your settings here with file .config.mk used by the Makefile targets. # The public URL of the searx instance: PUBLIC_URL="https://mydomain.xy/searx" -# The default is taken from the Makefile environment (SEARX_URL). -PUBLIC_URL="${SEARX_URL:-http://$(uname -n)/searx}" -PUBLIC_HOST="${PUBLIC_HOST:-$(echo "$PUBLIC_URL" | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/')}" +# The default is taken from ./utils/brand.env. + +PUBLIC_URL="${SEARX_URL}" +#PUBLIC_URL="http://$(uname -n)/searx" # searx.sh # --------- -SEARX_INTERNAL_URL="${SEARX_INTERNAL_URL:-127.0.0.1:8888}" +# SEARX_INTERNAL_URL="127.0.0.1:8888" -# Only change, if you maintain a searx brand in your searx fork. The default is -# taken from the Makefile environment (DOCS_URL, GIT_URL). -SEARX_DOCS_URL="${DOCS_URL:-https://asciimoo.github.io/searx}" -SEARX_GIT_URL="${GIT_URL:-https://github.com/asciimoo/searx.git}" -SEARX_GIT_BRANCH="${SEARX_GIT_BRANCH:-master}" +# Only change, if you maintain a searx brand in your searx fork. +# GIT_BRANCH="${GIT_BRANCH:-master}" # filtron.sh # ---------- -FILTRON_API="${FILTRON_API:-127.0.0.1:4005}" -FILTRON_LISTEN="${FILTRON_LISTEN:-127.0.0.1:4004}" -FILTRON_TARGET="${FILTRON_TARGET:-127.0.0.1:8888}" +# FILTRON_API="127.0.0.1:4005" +# FILTRON_LISTEN="127.0.0.1:4004" +# FILTRON_TARGET="127.0.0.1:8888" # morty.sh # -------- # morty listen address -MORTY_LISTEN="${MORTY_LISTEN:-127.0.0.1:3000}" +# MORTY_LISTEN="127.0.0.1:3000" +# PUBLIC_URL_PATH_MORTY="/morty" # system services # --------------- +# Common $HOME folder of the service accounts +# SERVICE_HOME_BASE="/usr/local" + # **experimental**: Set SERVICE_USER to run all services by one account, but be # aware that removing discrete components might conflict! -# # SERVICE_USER=searx - -# Common $HOME folder of the service accounts -SERVICE_HOME_BASE="${SERVICE_HOME_BASE:-/usr/local}" - -- cgit v1.2.3 From e530e20ae6a4d1f8621f535523cd2af76f715b0b Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 4 Apr 2020 17:53:16 +0200 Subject: misc: fix variuous marginals Signed-off-by: Markus Heiser --- .config.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '.config.sh') diff --git a/.config.sh b/.config.sh index 57411ce6f..f4e6273c4 100644 --- a/.config.sh +++ b/.config.sh @@ -16,7 +16,10 @@ # The default is taken from ./utils/brand.env. PUBLIC_URL="${SEARX_URL}" -#PUBLIC_URL="http://$(uname -n)/searx" + +if [[ ${PUBLIC_URL} == "https://searx.me" ]]; then + PUBLIC_URL= +fi # searx.sh # --------- -- cgit v1.2.3 From 44edc9256932961f5fd3c0778da009c493d9ce35 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 9 Apr 2020 14:28:34 +0200 Subject: [fix] morty: PUBLIC_URL_PATH_MORTY needs trailing slash Signed-off-by: Markus Heiser --- .config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.config.sh') diff --git a/.config.sh b/.config.sh index f4e6273c4..835bfecf4 100644 --- a/.config.sh +++ b/.config.sh @@ -41,7 +41,7 @@ fi # morty listen address # MORTY_LISTEN="127.0.0.1:3000" -# PUBLIC_URL_PATH_MORTY="/morty" +# PUBLIC_URL_PATH_MORTY="/morty/" # system services # --------------- -- cgit v1.2.3 From 99ff16c465ed4d3b98041bf308dfeb0918b535ab Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 13 Apr 2020 11:34:28 +0200 Subject: tooling box: added nginx + polished bash scripts and environment - add installation method for nginx sites, morty and filtron - clean up PUBLIC_URL environment in and outside of containers - clean up comand lines - handle uWSGI quirks on fedora (emperor mode) - handle Python quirks on debian (there is no 'python' command anymore) - lib.sh: add die and die_caller functions - lxc_suite_install_info is now a function - lint: shellcheck Signed-off-by: Markus Heiser --- .config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.config.sh') diff --git a/.config.sh b/.config.sh index 835bfecf4..4eff5f4c6 100644 --- a/.config.sh +++ b/.config.sh @@ -18,7 +18,8 @@ PUBLIC_URL="${SEARX_URL}" if [[ ${PUBLIC_URL} == "https://searx.me" ]]; then - PUBLIC_URL= + # hint: Linux containers do not have DNS entries, lets use IPs + PUBLIC_URL="http://$(primary_ip)/searx" fi # searx.sh -- cgit v1.2.3