on master help sign in
tooling box ./utils/*: minor fix from production test
commit71d7550dbe750f35f0dd7b5c513bc9e8db9512ee authorMarkus Heiser <markus.heiser@darmarit.de> dateTue 4 Feb 2020, 19:47 (7 years ago) parent2f40f61
8 files changed+29−7
.config.sh+1−1 utils/filtron.sh+1−1 utils/lib.sh+1−1 utils/morty.sh+7−1 utils/searx.sh+3−3 utils/templates/etc/apache2/sites-available/morty.conf+5 utils/templates/etc/apache2/sites-available/searx.conf:filtron+9 utils/templates/etc/apache2/sites-available/searx.conf:uwsgi+2
.config.sh+1−1
@@ -1,6 +1,6 @@
11# -*- coding: utf-8; mode: sh -*-
22# SPDX-License-Identifier: AGPL-3.0-or-later
3−# shellcheck shell=bash
3+# shellcheck shell=bash disable=SC2034
44#
55# This environment is used by ./utils scripts like filtron.sh or searx.sh. The
66# default values are *most flexible* and *best maintained*, you normally not
utils/filtron.sh+1−1
@@ -96,7 +96,7 @@ If needed, set PUBLIC_URL of your WEB service in the '${DOT_CONFIG#"$REPO_ROOT/"
9696 FILTRON_TARGET : ${FILTRON_TARGET}
9797
9898EOF
99− [ ! -z ${1+x} ] && err_msg "$1"
99+ [ ! -z "${1+x}" ] && err_msg "$1"
100100}
101101
102102main() {
utils/lib.sh+1−1
@@ -279,7 +279,7 @@ cache_download() {
279279 else
280280 wget --progress=bar -O "${CACHE}/$2" "$1" ; exit_value=$?
281281 fi
282− if [[ $exit_value = 0 ]]; then
282+ if [[ ! $exit_value = 0 ]]; then
283283 err_msg "failed to download: $1"
284284 fi
285285 fi
utils/morty.sh+7−1
@@ -84,7 +84,7 @@ ${DOT_CONFIG#"$REPO_ROOT/"} file::
8484 SERVICE_USER : ${SERVICE_USER}
8585EOF
8686 info_searx
87− [ ! -z ${1+x} ] && err_msg "$1"
87+ [ ! -z "${1+x}" ] && err_msg "$1"
8888}
8989
9090info_searx() {
@@ -196,6 +196,12 @@ install_all() {
196196 if ! service_is_available "http://${MORTY_LISTEN}" ; then
197197 err_msg "Morty does not listening on: http://${MORTY_LISTEN}"
198198 fi
199+ if apache_is_installed; then
200+ info_msg "Apache is installed on this host."
201+ if ask_yn "Do you want to install a reverse proxy (ProxyPass)" Yn; then
202+ install_apache_site
203+ fi
204+ fi
199205 if ask_yn "Do you want to inspect the installation?" Yn; then
200206 inspect_service
201207 fi
utils/searx.sh+3−3
@@ -110,7 +110,7 @@ If needed, set PUBLIC_URL of your WEB service in the '${DOT_CONFIG#"$REPO_ROOT/"
110110 SERVICE_USER : ${SERVICE_USER}
111111
112112EOF
113− [ ! -z ${1+x} ] && err_msg "$1"
113+ [ ! -z "${1+x}" ] && err_msg "$1"
114114}
115115
116116main() {
@@ -403,8 +403,8 @@ test_local_searx() {
403403 tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
404404cd ${SEARX_SRC}
405405sed -i -e "s/debug : False/debug : True/g" "$SEARX_SETTINGS"
406−timeout 5 python3 searx/webapp.py &
407−sleep 1
406+timeout 10 python3 searx/webapp.py &
407+sleep 3
408408curl --location --verbose --head --insecure $SEARX_INTERNAL_URL
409409sed -i -e "s/debug : True/debug : False/g" "$SEARX_SETTINGS"
410410EOF
utils/templates/etc/apache2/sites-available/morty.conf+5
@@ -4,7 +4,12 @@ ProxyPreserveHost On
44
55<Location ${PUBLIC_URL_PATH_MORTY} >
66
7+ <IfModule mod_security2.c>
8+ SecRuleEngine Off
9+ </IfModule>
10+
711 Require all granted
12+
813 Order deny,allow
914 Deny from all
1015 #Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1
utils/templates/etc/apache2/sites-available/searx.conf:filtron+9
@@ -2,9 +2,18 @@
22
33ProxyPreserveHost On
44
5+# SecRuleRemoveById 981054
6+# SecRuleRemoveById 981059
7+# SecRuleRemoveById 981060
8+
59<Location ${FILTRON_URL_PATH} >
610
11+ <IfModule mod_security2.c>
12+ SecRuleEngine Off
13+ </IfModule>
14+
715 Require all granted
16+
817 Order deny,allow
918 Deny from all
1019 #Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1
utils/templates/etc/apache2/sites-available/searx.conf:uwsgi+2
@@ -11,6 +11,8 @@
1111 SecRuleEngine Off
1212 </IfModule>
1313
14+ Require all granted
15+
1416 Options FollowSymLinks Indexes
1517 SetHandler uwsgi-handler
1618 uWSGISocket ${SEARX_UWSGI_SOCKET}