on master help sign in
utils/searx.sh & filtron.sh: misc changes from first tests (WIP)
cd9b877Markus Heiser
utils/dot_config+4−3
@@ -1,8 +1,9 @@
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#
3#
4−# Set environment used by ./utils scripts like filtron.sh or searx.sh
4+# environment used by utils scripts like filtron.sh or searx.sh
5#
5#
6
6
7−# Public URL of the searx instance
7+# the public URL of the searx instance
8−PUBLIC_URL="${PUBLIC_URL:-https://$(uname -n)/searx}"
8+PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}"
9+PUBLIC_HOST="${PUBLIC_HOST:-$(echo "$PUBLIC_URL" | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/')}"
utils/filtron.sh+4−2
@@ -1,7 +1,7 @@
1#!/usr/bin/env bash
1#!/usr/bin/env bash
2# -*- coding: utf-8; mode: sh indent-tabs-mode: nil -*-
2# -*- coding: utf-8; mode: sh indent-tabs-mode: nil -*-
3# SPDX-License-Identifier: AGPL-3.0-or-later
3# SPDX-License-Identifier: AGPL-3.0-or-later
4−# shellcheck disable=SC2119
4+# shellcheck disable=SC2119,SC2001
5
5
6# shellcheck source=utils/lib.sh
6# shellcheck source=utils/lib.sh
7source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
7source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
@@ -84,7 +84,8 @@ apache
84If needed change the environment variable PUBLIC_URL of your WEB service in the
84If needed change the environment variable PUBLIC_URL of your WEB service in the
85${DOT_CONFIG#"$REPO_ROOT/"} file:
85${DOT_CONFIG#"$REPO_ROOT/"} file:
86
86
87− PUBLIC_URL : ${PUBLIC_URL}
87+ PUBLIC_URL : ${PUBLIC_URL}
88+ PUBLIC_HOST : ${PUBLIC_HOST}
88
89
89EOF
90EOF
90 [ ! -z ${1+x} ] && echo -e "$1"
91 [ ! -z ${1+x} ] && echo -e "$1"
@@ -335,6 +336,7 @@ inspect_service() {
335sourced ${DOT_CONFIG#"$REPO_ROOT/"} :
336sourced ${DOT_CONFIG#"$REPO_ROOT/"} :
336
337
337 PUBLIC_URL : ${PUBLIC_URL}
338 PUBLIC_URL : ${PUBLIC_URL}
339+ PUBLIC_HOST : ${PUBLIC_HOST}
338 FILTRON_URL_PATH : ${FILTRON_URL_PATH}
340 FILTRON_URL_PATH : ${FILTRON_URL_PATH}
339 FILTRON_API : ${FILTRON_API}
341 FILTRON_API : ${FILTRON_API}
340 FILTRON_LISTEN : ${FILTRON_LISTEN}
342 FILTRON_LISTEN : ${FILTRON_LISTEN}
utils/lib.sh+1−1
@@ -440,7 +440,7 @@ service_is_available() {
440 case "$http_code" in
440 case "$http_code" in
441 404|410|423) exit_val=$http_code;;
441 404|410|423) exit_val=$http_code;;
442 esac
442 esac
443− return $exit_val
443+ return "$exit_val"
444}
444}
445
445
446
446
utils/searx.sh+2
@@ -102,6 +102,7 @@ If needed change the environment variable PUBLIC_URL of your WEB service in the
102${DOT_CONFIG#"$REPO_ROOT/"} file:
102${DOT_CONFIG#"$REPO_ROOT/"} file:
103
103
104 PUBLIC_URL : ${PUBLIC_URL}
104 PUBLIC_URL : ${PUBLIC_URL}
105+ PUBLIC_HOST : ${PUBLIC_HOST}
105 SEARX_INSTANCE_NAME : ${SEARX_INSTANCE_NAME}
106 SEARX_INSTANCE_NAME : ${SEARX_INSTANCE_NAME}
106
107
107EOF
108EOF
@@ -481,6 +482,7 @@ inspect_service() {
481sourced ${DOT_CONFIG#"$REPO_ROOT/"} :
482sourced ${DOT_CONFIG#"$REPO_ROOT/"} :
482
483
483 PUBLIC_URL : ${PUBLIC_URL}
484 PUBLIC_URL : ${PUBLIC_URL}
485+ PUBLIC_HOST : ${PUBLIC_HOST}
484 SEARX_URL_PATH : ${SEARX_URL_PATH}
486 SEARX_URL_PATH : ${SEARX_URL_PATH}
485 SEARX_INSTANCE_NAME : ${SEARX_INSTANCE_NAME}
487 SEARX_INSTANCE_NAME : ${SEARX_INSTANCE_NAME}
486 SEARX_INTERNAL_URL : ${SEARX_INTERNAL_URL}
488 SEARX_INTERNAL_URL : ${SEARX_INTERNAL_URL}