on master help sign in
misc: fix variuous marginals

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commite530e20ae6a4d1f8621f535523cd2af76f715b0b authorMarkus Heiser <markus.heiser@darmarit.de> dateSat 4 Apr 2020, 17:53 (7 years ago) parent3c19f2f
5 files changed+13−12
.config.sh+4−1 utils/lib.sh+4−4 utils/morty.sh+1−1 utils/templates/etc/apache2/sites-available/morty.conf+1−3 utils/templates/etc/apache2/sites-available/searx.conf:filtron+3−3
.config.sh+4−1
@@ -16,7 +16,10 @@
1616# The default is taken from ./utils/brand.env.
1717
1818PUBLIC_URL="${SEARX_URL}"
19−#PUBLIC_URL="http://$(uname -n)/searx"
19+
20+if [[ ${PUBLIC_URL} == "https://searx.me" ]]; then
21+ PUBLIC_URL=
22+fi
2023
2124# searx.sh
2225# ---------
utils/lib.sh+4−4
@@ -449,14 +449,14 @@ install_template() {
449449 break
450450 ;;
451451 "interactiv shell")
452− echo "// edit ${dst} to your needs"
452+ echo -e "// edit ${_Red}${dst}${_creset} to your needs"
453453 echo -e "// exit with [${_BCyan}CTRL-D${_creset}]"
454454 sudo -H -u "${owner}" -i
455455 $DIFF_CMD "${dst}" "${template_file}"
456456 echo
457− echo "${_BBlack}did you edit file ...${_creset}"
458− printf " ${template_file}"
459− if ask_yn "... to your needs?"; then
457+ echo -e "// ${_BBlack}did you edit file ...${_creset}"
458+ echo -en "// ${_Red}${dst}${_creset}"
459+ if ask_yn "//${_BBlack}... to your needs?${_creset}"; then
460460 break
461461 fi
462462 ;;
utils/morty.sh+1−1
@@ -15,6 +15,7 @@ in_container && lxc_set_suite_env
1515# ----------------------------------------------------------------------------
1616
1717PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}"
18+PUBLIC_HOST="${PUBLIC_HOST:-$(echo "$PUBLIC_URL" | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/')}"
1819PUBLIC_URL_PATH_MORTY="${PUBLIC_URL_PATH_MORTY:-/morty}"
1920PUBLIC_URL_MORTY="$(echo "$PUBLIC_URL" | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}"
2021
@@ -378,7 +379,6 @@ EOF
378379 return 0
379380}
380381
381−
382382enable_debug() {
383383 warn_msg "Do not enable debug in production enviroments!!"
384384 info_msg "Enabling debug option needs to reinstall systemd service!"
utils/templates/etc/apache2/sites-available/morty.conf+1−3
@@ -19,9 +19,7 @@ ProxyPreserveHost On
1919 RequestHeader set X-Script-Name ${PUBLIC_URL_PATH_MORTY}
2020
2121 # In Apache it seems, that setting HTTP_HOST header direct here does have no
22− # effect. I needed to set 'ProxyPreserveHost On' (see above). HTTP_HOST is
23− # needed by searx to render correct *Search URL* in the *Link* box and
24− # *saved preference*.
22+ # effect. I needed to set 'ProxyPreserveHost On' (see above).
2523
2624 # RequestHeader set Host ${PUBLIC_HOST}
2725
utils/templates/etc/apache2/sites-available/searx.conf:filtron+3−3
@@ -24,9 +24,9 @@ ProxyPreserveHost On
2424 RequestHeader set X-Script-Name ${FILTRON_URL_PATH}
2525
2626 # In Apache it seems, that setting HTTP_HOST header direct here does have no
27− # effect. I needed to set 'ProxyPreserveHost On' (see above). HTTP_HOST is
28− # needed by searx to render correct *Search URL* in the *Link* box and
29− # *saved preference*.
27+ # effect. I needed to set 'ProxyPreserveHost On' (see above). HTTP_HOST
28+ # (ProxyPreserveHost On) is needed by searx to render correct *Search URL*
29+ # in the *Link* box and *saved preference*.
3030
3131 # RequestHeader set Host ${PUBLIC_HOST}
3232