summaryrefslogtreecommitdiff
path: root/utils/lxc-searx.env
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-04-13 11:34:28 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2020-04-13 11:34:28 +0200
commit99ff16c465ed4d3b98041bf308dfeb0918b535ab (patch)
tree0fe9838cd97b985d37eb9f12f29a9a9383d6d2cd /utils/lxc-searx.env
parent58d5da8b57c5aeab92f551e8d175be67537c351c (diff)
downloadsearxng-99ff16c465ed4d3b98041bf308dfeb0918b535ab.tar.gz
searxng-99ff16c465ed4d3b98041bf308dfeb0918b535ab.zip
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 <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/lxc-searx.env')
-rw-r--r--utils/lxc-searx.env38
1 files changed, 31 insertions, 7 deletions
diff --git a/utils/lxc-searx.env b/utils/lxc-searx.env
index fc5b33f06..a51312fb8 100644
--- a/utils/lxc-searx.env
+++ b/utils/lxc-searx.env
@@ -32,13 +32,36 @@ lxc_set_suite_env() {
# rolling releases see https://www.archlinux.org/releng/releases/
"$LINUXCONTAINERS_ORG_NAME:archlinux" "archlinux"
)
- export FILTRON_API="0.0.0.0:4005"
- export FILTRON_LISTEN="0.0.0.0:4004"
- export MORTY_LISTEN="0.0.0.0:3000"
+
+ PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}"
+ if in_container; then
+ # container hostnames do not have a DNS entry: use primary IP!
+ PUBLIC_URL="http://$(primary_ip)/searx"
+
+ # make GUEST's services public to the HOST
+ FILTRON_API="0.0.0.0:4005"
+ FILTRON_LISTEN="0.0.0.0:4004"
+ MORTY_LISTEN="0.0.0.0:3000"
+
+ # export LXC specific environment
+ export PUBLIC_URL FILTRON_API FILTRON_LISTEN MORTY_LISTEN
+ fi
}
-# shellcheck disable=SC2034
-LXC_SUITE_INSTALL_INFO="suite includes searx, morty & filtron"
+lxc_suite_install_info() {
+ (
+ lxc_set_suite_env
+ cat <<EOF
+LXC suite: ${LXC_SUITE_NAME} --> ${PUBLIC_URL}
+ suite includes searx, morty & filtron
+suite images:
+$(echo " ${LOCAL_IMAGES[*]}" | $FMT)
+suite containers:
+$(echo " ${CONTAINERS[*]}" | $FMT)
+EOF
+ )
+ }
+
lxc_suite_install() {
(
lxc_set_suite_env
@@ -62,8 +85,9 @@ lxc_suite_info() {
info_msg "(${ip%|*}) IPv6: http://[${ip#*|}]"
else
# IPv4:
- info_msg "(${ip%|*}) filtron: http://${ip#*|}:4004/"
- info_msg "(${ip%|*}) morty: http://${ip#*|}:3000/"
+ # shellcheck disable=SC2034,SC2031
+ info_msg "(${ip%|*}) filtron: http://${ip#*|}:4004/ $PUBLIC_URL"
+ info_msg "(${ip%|*}) morty: http://${ip#*|}:3000/ $PUBLIC_URL_MORTY"
info_msg "(${ip%|*}) docs-live: http://${ip#*|}:8080/"
fi
done