on master help sign in
tooling box ./utils/*: minor fix from production test
71d7550Markus Heiser
.config.sh+1−1
@@ -1,6 +1,6 @@
1# -*- coding: utf-8; mode: sh -*-
1# -*- coding: utf-8; mode: sh -*-
2# SPDX-License-Identifier: AGPL-3.0-or-later
2# SPDX-License-Identifier: AGPL-3.0-or-later
3−# shellcheck shell=bash
3+# shellcheck shell=bash disable=SC2034
4#
4#
5# This environment is used by ./utils scripts like filtron.sh or searx.sh. The
5# This environment is used by ./utils scripts like filtron.sh or searx.sh. The
6# default values are *most flexible* and *best maintained*, you normally not
6# 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/"
96 FILTRON_TARGET : ${FILTRON_TARGET}
96 FILTRON_TARGET : ${FILTRON_TARGET}
97
97
98EOF
98EOF
99− [ ! -z ${1+x} ] && err_msg "$1"
99+ [ ! -z "${1+x}" ] && err_msg "$1"
100}
100}
101
101
102main() {
102main() {
utils/lib.sh+1−1
@@ -279,7 +279,7 @@ cache_download() {
279 else
279 else
280 wget --progress=bar -O "${CACHE}/$2" "$1" ; exit_value=$?
280 wget --progress=bar -O "${CACHE}/$2" "$1" ; exit_value=$?
281 fi
281 fi
282− if [[ $exit_value = 0 ]]; then
282+ if [[ ! $exit_value = 0 ]]; then
283 err_msg "failed to download: $1"
283 err_msg "failed to download: $1"
284 fi
284 fi
285 fi
285 fi
utils/morty.sh+7−1
@@ -84,7 +84,7 @@ ${DOT_CONFIG#"$REPO_ROOT/"} file::
84 SERVICE_USER : ${SERVICE_USER}
84 SERVICE_USER : ${SERVICE_USER}
85EOF
85EOF
86 info_searx
86 info_searx
87− [ ! -z ${1+x} ] && err_msg "$1"
87+ [ ! -z "${1+x}" ] && err_msg "$1"
88}
88}
89
89
90info_searx() {
90info_searx() {
@@ -196,6 +196,12 @@ install_all() {
196 if ! service_is_available "http://${MORTY_LISTEN}" ; then
196 if ! service_is_available "http://${MORTY_LISTEN}" ; then
197 err_msg "Morty does not listening on: http://${MORTY_LISTEN}"
197 err_msg "Morty does not listening on: http://${MORTY_LISTEN}"
198 fi
198 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
199 if ask_yn "Do you want to inspect the installation?" Yn; then
205 if ask_yn "Do you want to inspect the installation?" Yn; then
200 inspect_service
206 inspect_service
201 fi
207 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/"
110 SERVICE_USER : ${SERVICE_USER}
110 SERVICE_USER : ${SERVICE_USER}
111
111
112EOF
112EOF
113− [ ! -z ${1+x} ] && err_msg "$1"
113+ [ ! -z "${1+x}" ] && err_msg "$1"
114}
114}
115
115
116main() {
116main() {
@@ -403,8 +403,8 @@ test_local_searx() {
403 tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
403 tee_stderr 0.1 <<EOF | sudo -H -u "${SERVICE_USER}" -i 2>&1 | prefix_stdout "$_service_prefix"
404cd ${SEARX_SRC}
404cd ${SEARX_SRC}
405sed -i -e "s/debug : False/debug : True/g" "$SEARX_SETTINGS"
405sed -i -e "s/debug : False/debug : True/g" "$SEARX_SETTINGS"
406−timeout 5 python3 searx/webapp.py &
406+timeout 10 python3 searx/webapp.py &
407−sleep 1
407+sleep 3
408curl --location --verbose --head --insecure $SEARX_INTERNAL_URL
408curl --location --verbose --head --insecure $SEARX_INTERNAL_URL
409sed -i -e "s/debug : True/debug : False/g" "$SEARX_SETTINGS"
409sed -i -e "s/debug : True/debug : False/g" "$SEARX_SETTINGS"
410EOF
410EOF
utils/templates/etc/apache2/sites-available/morty.conf+5
@@ -4,7 +4,12 @@ ProxyPreserveHost On
4
4
5<Location ${PUBLIC_URL_PATH_MORTY} >
5<Location ${PUBLIC_URL_PATH_MORTY} >
6
6
7+ <IfModule mod_security2.c>
8+ SecRuleEngine Off
9+ </IfModule>
10+
7 Require all granted
11 Require all granted
12+
8 Order deny,allow
13 Order deny,allow
9 Deny from all
14 Deny from all
10 #Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1
15 #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 @@
2
2
3ProxyPreserveHost On
3ProxyPreserveHost On
4
4
5+# SecRuleRemoveById 981054
6+# SecRuleRemoveById 981059
7+# SecRuleRemoveById 981060
8+
5<Location ${FILTRON_URL_PATH} >
9<Location ${FILTRON_URL_PATH} >
6
10
11+ <IfModule mod_security2.c>
12+ SecRuleEngine Off
13+ </IfModule>
14+
7 Require all granted
15 Require all granted
16+
8 Order deny,allow
17 Order deny,allow
9 Deny from all
18 Deny from all
10 #Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1
19 #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 @@
11 SecRuleEngine Off
11 SecRuleEngine Off
12 </IfModule>
12 </IfModule>
13
13
14+ Require all granted
15+
14 Options FollowSymLinks Indexes
16 Options FollowSymLinks Indexes
15 SetHandler uwsgi-handler
17 SetHandler uwsgi-handler
16 uWSGISocket ${SEARX_UWSGI_SOCKET}
18 uWSGISocket ${SEARX_UWSGI_SOCKET}