diff --git a/.config.sh b/.config.sh index 57411ce6..f4e6273c 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 e466100c..85ac7745 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 ec1d47cb..d79faa03 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 2c5727b1..48b4dd76 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 5ede6630..e3404906 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}