Browse Source

misc: fix variuous marginals

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Markus Heiser 5 years ago
parent
commit
e530e20ae6

+ 4 - 1
.config.sh

@@ -16,7 +16,10 @@
 # The default is taken from ./utils/brand.env.
 # The default is taken from ./utils/brand.env.
 
 
 PUBLIC_URL="${SEARX_URL}"
 PUBLIC_URL="${SEARX_URL}"
-#PUBLIC_URL="http://$(uname -n)/searx"
+
+if [[ ${PUBLIC_URL} == "https://searx.me" ]]; then
+    PUBLIC_URL=
+fi
 
 
 # searx.sh
 # searx.sh
 # ---------
 # ---------

+ 4 - 4
utils/lib.sh

@@ -449,14 +449,14 @@ install_template() {
                 break
                 break
                 ;;
                 ;;
             "interactiv shell")
             "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}]"
                 echo -e "// exit with [${_BCyan}CTRL-D${_creset}]"
                 sudo -H -u "${owner}" -i
                 sudo -H -u "${owner}" -i
                 $DIFF_CMD "${dst}" "${template_file}"
                 $DIFF_CMD "${dst}" "${template_file}"
                 echo
                 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
                     break
                 fi
                 fi
                 ;;
                 ;;

+ 1 - 1
utils/morty.sh

@@ -15,6 +15,7 @@ in_container && lxc_set_suite_env
 # ----------------------------------------------------------------------------
 # ----------------------------------------------------------------------------
 
 
 PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}"
 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_PATH_MORTY="${PUBLIC_URL_PATH_MORTY:-/morty}"
 PUBLIC_URL_MORTY="$(echo "$PUBLIC_URL" |  sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}"
 PUBLIC_URL_MORTY="$(echo "$PUBLIC_URL" |  sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}"
 
 
@@ -378,7 +379,6 @@ EOF
     return 0
     return 0
 }
 }
 
 
-
 enable_debug() {
 enable_debug() {
     warn_msg "Do not enable debug in production enviroments!!"
     warn_msg "Do not enable debug in production enviroments!!"
     info_msg "Enabling debug option needs to reinstall systemd service!"
     info_msg "Enabling debug option needs to reinstall systemd service!"

+ 1 - 3
utils/templates/etc/apache2/sites-available/morty.conf

@@ -19,9 +19,7 @@ ProxyPreserveHost On
     RequestHeader set X-Script-Name ${PUBLIC_URL_PATH_MORTY}
     RequestHeader set X-Script-Name ${PUBLIC_URL_PATH_MORTY}
 
 
     # In Apache it seems, that setting HTTP_HOST header direct here does have no
     # 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}
     # RequestHeader set Host ${PUBLIC_HOST}
 
 

+ 3 - 3
utils/templates/etc/apache2/sites-available/searx.conf:filtron

@@ -24,9 +24,9 @@ ProxyPreserveHost On
     RequestHeader set X-Script-Name ${FILTRON_URL_PATH}
     RequestHeader set X-Script-Name ${FILTRON_URL_PATH}
 
 
     # In Apache it seems, that setting HTTP_HOST header direct here does have no
     # 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}
     # RequestHeader set Host ${PUBLIC_HOST}