From e530e20ae6a4d1f8621f535523cd2af76f715b0b Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 4 Apr 2020 17:53:16 +0200 Subject: [PATCH] misc: fix variuous marginals Signed-off-by: Markus Heiser --- .config.sh | 5 ++++- utils/lib.sh | 8 ++++---- utils/morty.sh | 2 +- utils/templates/etc/apache2/sites-available/morty.conf | 4 +--- .../etc/apache2/sites-available/searx.conf:filtron | 6 +++--- 5 files changed, 13 insertions(+), 12 deletions(-) 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 # --------- diff --git a/utils/lib.sh b/utils/lib.sh index e466100c1..85ac77456 100755 --- a/utils/lib.sh +++ b/utils/lib.sh @@ -449,14 +449,14 @@ install_template() { break ;; "interactiv shell") - echo "// edit ${dst} to your needs" + echo -e "// edit ${_Red}${dst}${_creset} to your needs" echo -e "// exit with [${_BCyan}CTRL-D${_creset}]" sudo -H -u "${owner}" -i $DIFF_CMD "${dst}" "${template_file}" echo - echo "${_BBlack}did you edit file ...${_creset}" - printf " ${template_file}" - if ask_yn "... to your needs?"; then + echo -e "// ${_BBlack}did you edit file ...${_creset}" + echo -en "// ${_Red}${dst}${_creset}" + if ask_yn "//${_BBlack}... to your needs?${_creset}"; then break fi ;; diff --git a/utils/morty.sh b/utils/morty.sh index ec1d47cb6..d79faa037 100755 --- a/utils/morty.sh +++ b/utils/morty.sh @@ -15,6 +15,7 @@ in_container && lxc_set_suite_env # ---------------------------------------------------------------------------- PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}" +PUBLIC_HOST="${PUBLIC_HOST:-$(echo "$PUBLIC_URL" | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/')}" PUBLIC_URL_PATH_MORTY="${PUBLIC_URL_PATH_MORTY:-/morty}" PUBLIC_URL_MORTY="$(echo "$PUBLIC_URL" | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}" @@ -378,7 +379,6 @@ EOF return 0 } - enable_debug() { warn_msg "Do not enable debug in production enviroments!!" info_msg "Enabling debug option needs to reinstall systemd service!" diff --git a/utils/templates/etc/apache2/sites-available/morty.conf b/utils/templates/etc/apache2/sites-available/morty.conf index 2c5727b19..48b4dd766 100644 --- a/utils/templates/etc/apache2/sites-available/morty.conf +++ b/utils/templates/etc/apache2/sites-available/morty.conf @@ -19,9 +19,7 @@ ProxyPreserveHost On RequestHeader set X-Script-Name ${PUBLIC_URL_PATH_MORTY} # In Apache it seems, that setting HTTP_HOST header direct here does have no - # effect. I needed to set 'ProxyPreserveHost On' (see above). HTTP_HOST is - # needed by searx to render correct *Search URL* in the *Link* box and - # *saved preference*. + # effect. I needed to set 'ProxyPreserveHost On' (see above). # RequestHeader set Host ${PUBLIC_HOST} diff --git a/utils/templates/etc/apache2/sites-available/searx.conf:filtron b/utils/templates/etc/apache2/sites-available/searx.conf:filtron index 5ede66301..e34049063 100644 --- a/utils/templates/etc/apache2/sites-available/searx.conf:filtron +++ b/utils/templates/etc/apache2/sites-available/searx.conf:filtron @@ -24,9 +24,9 @@ ProxyPreserveHost On RequestHeader set X-Script-Name ${FILTRON_URL_PATH} # In Apache it seems, that setting HTTP_HOST header direct here does have no - # effect. I needed to set 'ProxyPreserveHost On' (see above). HTTP_HOST is - # needed by searx to render correct *Search URL* in the *Link* box and - # *saved preference*. + # effect. I needed to set 'ProxyPreserveHost On' (see above). HTTP_HOST + # (ProxyPreserveHost On) is needed by searx to render correct *Search URL* + # in the *Link* box and *saved preference*. # RequestHeader set Host ${PUBLIC_HOST}