diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2020-04-13 11:34:28 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2020-04-13 11:34:28 +0200 |
commit | 99ff16c465ed4d3b98041bf308dfeb0918b535ab (patch) | |
tree | 0fe9838cd97b985d37eb9f12f29a9a9383d6d2cd /utils/morty.sh | |
parent | 58d5da8b57c5aeab92f551e8d175be67537c351c (diff) | |
download | searxng-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/morty.sh')
-rwxr-xr-x | utils/morty.sh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/utils/morty.sh b/utils/morty.sh index eae1b5bbc..851b8864d 100755 --- a/utils/morty.sh +++ b/utils/morty.sh @@ -7,6 +7,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" # shellcheck source=utils/brand.env source "${REPO_ROOT}/utils/brand.env" source_dot_config +SEARX_URL="${PUBLIC_URL:-http://$(uname -n)/searx}" source "${REPO_ROOT}/utils/lxc-searx.env" in_container && lxc_set_suite_env @@ -17,12 +18,7 @@ in_container && lxc_set_suite_env MORTY_LISTEN="${MORTY_LISTEN:-127.0.0.1:3000}" PUBLIC_URL_PATH_MORTY="${PUBLIC_URL_PATH_MORTY:-/morty/}" -SEARX_URL="${PUBLIC_URL:-http://$(uname -n)/searx}" -PUBLIC_URL_MORTY="$(echo "$SEARX_URL" | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}" -if in_container; then - # container hostnames do not have a DNS entry, use primary IP - PUBLIC_URL_MORTY="$(url_replace_hostname "$PUBLIC_URL_MORTY" "$(primary_ip)")" -fi +PUBLIC_URL_MORTY="${PUBLIC_URL_MORTY:-$(echo "$SEARX_URL" | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}}" # shellcheck disable=SC2034 MORTY_TIMEOUT=5 @@ -229,6 +225,11 @@ install_all() { if ask_yn "Do you want to install a reverse proxy (ProxyPass)" Yn; then install_apache_site fi + elif nginx_is_installed; then + info_msg "nginx is installed on this host." + if ask_yn "Do you want to install a reverse proxy (ProxyPass)" Yn; then + install_nginx_site + fi fi info_searx if ask_yn "Add image and result proxy to searx settings.yml?" Yn; then @@ -462,7 +463,9 @@ This installs a reverse proxy (ProxyPass) into nginx site (${NGINX_MORTY_SITE})" "${REPO_ROOT}/utils/searx.sh" install uwsgi + # shellcheck disable=SC2034 SEARX_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_SRC) + # shellcheck disable=SC2034 SEARX_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_URL_PATH) nginx_install_app "${NGINX_MORTY_SITE}" |