@@ -17,7 +17,7 @@ in_container && lxc_set_suite_env
1717
1818PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}"
1919
20−SEARX_INTERNAL_URL="${SEARX_INTERNAL_URL:-127.0.0.1:8888}"
20+SEARX_INTERNAL_HTTP="${SEARX_INTERNAL_HTTP:-127.0.0.1:8888}"
2121
2222SEARX_URL_PATH="${SEARX_URL_PATH:-$(echo "${PUBLIC_URL}" \
2323| sed -e 's,^.*://[^/]*\(/.*\),\1,g')}"
@@ -79,17 +79,17 @@ case $DIST_ID in
7979 ubuntu|debian)
8080 SEARX_PACKAGES="${SEARX_PACKAGES_debian}"
8181 BUILD_PACKAGES="${BUILD_PACKAGES_debian}"
82− APACHE_APT_PACKAGES="libapache2-mod-uwsgi"
82+ APACHE_PACKAGES="libapache2-mod-uwsgi"
8383 ;;
8484 arch)
8585 SEARX_PACKAGES="${SEARX_PACKAGES_arch}"
8686 BUILD_PACKAGES="${BUILD_PACKAGES_arch}"
87− APACHE_APT_PACKAGES="uwsgi"
87+ APACHE_PACKAGES="uwsgi"
8888 ;;
8989 fedora)
9090 SEARX_PACKAGES="${SEARX_PACKAGES_fedora}"
9191 BUILD_PACKAGES="${BUILD_PACKAGES_fedora}"
92− APACHE_APT_PACKAGES="uwsgi"
92+ APACHE_PACKAGES="uwsgi"
9393 ;;
9494esac
9595
@@ -116,13 +116,13 @@ usage() {
116116usage::
117117
118118 $(basename "$0") shell
119− $(basename "$0") install [all|user|searx-src|pyenv|uwsgi|apache|packages|buildhost]
119+ $(basename "$0") install [all|user|searx-src|pyenv|uwsgi|packages|buildhost]
120120 $(basename "$0") update [searx]
121121 $(basename "$0") remove [all|user|pyenv|searx-src]
122122 $(basename "$0") activate [service]
123123 $(basename "$0") deactivate [service]
124124 $(basename "$0") inspect [service]
125− $(basename "$0") option [debug-on|debug-off]
125+ $(basename "$0") option [debug-[on|off]|image-proxy-[on|off]|result-proxy <url> <key>]
126126 $(basename "$0") apache [install|remove]
127127
128128shell
@@ -153,12 +153,25 @@ apache
153153searx settings: ${SEARX_SETTINGS_PATH}
154154
155155If needed, set PUBLIC_URL of your WEB service in the '${DOT_CONFIG#"$REPO_ROOT/"}' file::
156−
157156 PUBLIC_URL : ${PUBLIC_URL}
158157 SEARX_INSTANCE_NAME : ${SEARX_INSTANCE_NAME}
159158 SERVICE_USER : ${SERVICE_USER}
160−
159+ SEARX_INTERNAL_HTTP : http://${SEARX_INTERNAL_HTTP}
161160EOF
161+ if in_container; then
162+ # searx is listening on 127.0.0.1 and not available from outside container
163+ # in containers the service is listening on 0.0.0.0 (see lxc-searx.env)
164+ echo -e "${_BBlack}HINT:${_creset} searx only listen on loopback device" \
165+ "${_BBlack}inside${_creset} the container."
166+ for ip in $(global_IPs) ; do
167+ if [[ $ip =~ .*:.* ]]; then
168+ echo " container (IPv6): [${ip#*|}]"
169+ else
170+ # IPv4:
171+ echo " container (IPv4): ${ip#*|}"
172+ fi
173+ done
174+ fi
162175 [[ -n ${1} ]] && err_msg "$1"
163176}
164177
@@ -277,8 +290,8 @@ install_all() {
277290 test_local_searx
278291 wait_key
279292 install_searx_uwsgi
280− if ! service_is_available "http://$SEARX_INTERNAL_URL"; then
281− err_msg "URL http://$SEARX_INTERNAL_URL not available, check searx & uwsgi setup!"
293+ if ! service_is_available "http://${SEARX_INTERNAL_HTTP}"; then
294+ err_msg "URL http://${SEARX_INTERNAL_HTTP} not available, check searx & uwsgi setup!"
282295 fi
283296 if ask_yn "Do you want to inspect the installation?" Ny; then
284297 inspect_service
@@ -481,8 +494,8 @@ test_local_searx() {
481494 rst_title "Testing searx instance localy" section
482495 echo
483496
484− if service_is_available "http://$SEARX_INTERNAL_URL" &>/dev/null; then
485− err_msg "URL/port http://$SEARX_INTERNAL_URL is already in use, you"
497+ if service_is_available "http://${SEARX_INTERNAL_HTTP}" &>/dev/null; then
498+ err_msg "URL/port http://${SEARX_INTERNAL_HTTP} is already in use, you"
486499 err_msg "should stop that service before starting local tests!"
487500 if ! ask_yn "Continue with local tests?"; then
488501 return
@@ -494,7 +507,7 @@ export SEARX_SETTINGS_PATH="${SEARX_SETTINGS_PATH}"
494507cd ${SEARX_SRC}
495508timeout 10 python searx/webapp.py &
496509sleep 3
497−curl --location --verbose --head --insecure $SEARX_INTERNAL_URL
510+curl --location --verbose --head --insecure $SEARX_INTERNAL_HTTP
498511EOF
499512 sed -i -e "s/debug : True/debug : False/g" "$SEARX_SETTINGS_PATH"
500513}
@@ -624,12 +637,10 @@ sourced ${DOT_CONFIG#"$REPO_ROOT/"} :
624637 PUBLIC_URL : ${PUBLIC_URL}
625638 SEARX_URL_PATH : ${SEARX_URL_PATH}
626639 SEARX_INSTANCE_NAME : ${SEARX_INSTANCE_NAME}
627− SEARX_INTERNAL_URL : ${SEARX_INTERNAL_URL}
640+ SEARX_INTERNAL_HTTP : ${SEARX_INTERNAL_HTTP}
628641
629642EOF
630643
631− apache_is_installed && info_msg "Apache is installed."
632−
633644 if service_account_is_available "$SERVICE_USER"; then
634645 info_msg "Service account $SERVICE_USER exists."
635646 else
@@ -661,11 +672,11 @@ EOF
661672 lxc_suite_info
662673 else
663674 info_msg "public URL --> ${PUBLIC_URL}"
664− info_msg "internal URL --> http://${SEARX_INTERNAL_URL}"
675+ info_msg "internal URL --> http://${SEARX_INTERNAL_HTTP}"
665676 fi
666677
667− if ! service_is_available "http://${SEARX_INTERNAL_URL}"; then
668− err_msg "uWSGI app (service) at http://${SEARX_INTERNAL_URL} is not available!"
678+ if ! service_is_available "http://${SEARX_INTERNAL_HTTP}"; then
679+ err_msg "uWSGI app (service) at http://${SEARX_INTERNAL_HTTP} is not available!"
669680 MSG="${_Green}[${_BCyan}CTRL-C${_Green}] to stop or [${_BCyan}KEY${_Green}] to continue"\
670681 wait_key
671682 fi
@@ -720,8 +731,8 @@ install_apache_site() {
720731 rst_title "Install Apache site $APACHE_SEARX_SITE"
721732
722733 rst_para "\
723−This installs the searx uwsgi app as apache site. If your server ist public to
724−the internet you should instead use a reverse proxy (filtron) to block
734+This installs the searx uwsgi app as apache site. If your server is public to
735+the internet, you should instead use a reverse proxy (filtron) to block
725736excessively bot queries."
726737
727738 ! apache_is_installed && err_msg "Apache is not installed."
@@ -730,7 +741,7 @@ excessively bot queries."
730741 return
731742 fi
732743
733− pkg_install "$APACHE_APT_PACKAGES"
744+ pkg_install "$APACHE_PACKAGES"
734745 a2enmod uwsgi
735746
736747 echo