| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  | # -*- coding: utf-8; mode: sh indent-tabs-mode: nil -*- | 
					
						
							|  |  |  | # SPDX-License-Identifier: AGPL-3.0-or-later | 
					
						
							|  |  |  | # shellcheck shell=bash | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # This file is a setup of a LXC suite.  It is sourced from different context, do | 
					
						
							|  |  |  | # not manipulate the environment directly, implement functions and manipulate | 
					
						
							| 
									
										
										
										
											2022-05-27 18:43:14 +02:00
										 |  |  | # environment only in subshells. | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | lxc_set_suite_env() { | 
					
						
							| 
									
										
										
										
											2022-05-27 18:43:14 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     export LXC_SUITE_NAME="searxng" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  |     # name of https://images.linuxcontainers.org | 
					
						
							|  |  |  |     export LINUXCONTAINERS_ORG_NAME="${LINUXCONTAINERS_ORG_NAME:-images}" | 
					
						
							| 
									
										
										
										
											2020-04-04 12:40:14 +02:00
										 |  |  |     export LXC_HOST_PREFIX="${LXC_SUITE_NAME:-searx}" | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  |     export LXC_SUITE=( | 
					
						
							| 
									
										
										
										
											2020-04-03 17:08:42 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  |         # end of standard support see https://wiki.ubuntu.com/Releases | 
					
						
							| 
									
										
										
										
											2023-02-01 09:30:13 +01:00
										 |  |  |         "$LINUXCONTAINERS_ORG_NAME:ubuntu/20.04"  "ubu2004" # LTS EOSS April 2025 | 
					
						
							|  |  |  |         "$LINUXCONTAINERS_ORG_NAME:ubuntu/22.04"  "ubu2204" # LTS EOSS April 2027 | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # EOL see https://fedoraproject.org/wiki/Releases | 
					
						
							| 
									
										
										
										
											2022-03-12 16:51:42 +01:00
										 |  |  |         "$LINUXCONTAINERS_ORG_NAME:fedora/35"     "fedora35" | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # rolling releases see https://www.archlinux.org/releng/releases/ | 
					
						
							|  |  |  |         "$LINUXCONTAINERS_ORG_NAME:archlinux"     "archlinux" | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-13 11:34:28 +02:00
										 |  |  | lxc_suite_install_info() { | 
					
						
							|  |  |  |     ( | 
					
						
							|  |  |  |         lxc_set_suite_env | 
					
						
							|  |  |  |         cat <<EOF | 
					
						
							| 
									
										
										
										
											2022-05-27 18:43:14 +02:00
										 |  |  | LXC suite: ${LXC_SUITE_NAME} | 
					
						
							|  |  |  |   Suite includes installation of SearXNG | 
					
						
							|  |  |  |   images:     ${LOCAL_IMAGES[*]} | 
					
						
							|  |  |  |   containers: ${CONTAINERS[*]} | 
					
						
							| 
									
										
										
										
											2020-04-13 11:34:28 +02:00
										 |  |  | EOF | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2022-05-27 18:43:14 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2020-04-13 11:34:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  | lxc_suite_install() { | 
					
						
							|  |  |  |     ( | 
					
						
							|  |  |  |         lxc_set_suite_env | 
					
						
							| 
									
										
										
										
											2023-05-21 18:12:39 +02:00
										 |  |  |         FORCE_TIMEOUT=0 "${LXC_REPO_ROOT}/utils/searxng.sh" install all | 
					
						
							|  |  |  |         rst_title "Suite installation finished ($(hostname))" part | 
					
						
							|  |  |  |         if ask_yn "Developer install? (wraps source from HOST into the running instance)" Yn; then | 
					
						
							|  |  |  |             "${LXC_REPO_ROOT}/utils/searxng.sh" searxng.install.link_src "$(pwd)" | 
					
						
							|  |  |  |         fi | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  |         lxc_suite_info | 
					
						
							|  |  |  |         echo | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | lxc_suite_info() { | 
					
						
							|  |  |  |     ( | 
					
						
							|  |  |  |         lxc_set_suite_env | 
					
						
							|  |  |  |         for ip in $(global_IPs) ; do | 
					
						
							|  |  |  |             if [[ $ip =~ .*:.* ]]; then | 
					
						
							| 
									
										
										
										
											2020-03-29 16:46:07 +02:00
										 |  |  |                 info_msg "(${ip%|*}) IPv6:       http://[${ip#*|}]" | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  |             else | 
					
						
							|  |  |  |                 # IPv4: | 
					
						
							| 
									
										
										
										
											2020-04-13 11:34:28 +02:00
										 |  |  |                 # shellcheck disable=SC2034,SC2031 | 
					
						
							| 
									
										
										
										
											2020-03-29 16:46:07 +02:00
										 |  |  |                 info_msg "(${ip%|*}) docs-live:  http://${ip#*|}:8080/" | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  |             fi | 
					
						
							|  |  |  |         done | 
					
						
							| 
									
										
										
										
											2022-05-27 18:43:14 +02:00
										 |  |  |         "${LXC_REPO_ROOT}/utils/searxng.sh" searxng.instance.env | 
					
						
							| 
									
										
										
										
											2020-03-07 20:24:08 +01:00
										 |  |  |     ) | 
					
						
							|  |  |  | } |