2020-03-07 19:24:08 +00: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 16:43:14 +00:00
|
|
|
# environment only in subshells.
|
2020-03-07 19:24:08 +00:00
|
|
|
|
|
|
|
lxc_set_suite_env() {
|
2022-05-27 16:43:14 +00:00
|
|
|
|
|
|
|
export LXC_SUITE_NAME="searxng"
|
|
|
|
|
2020-03-07 19:24:08 +00:00
|
|
|
# name of https://images.linuxcontainers.org
|
|
|
|
export LINUXCONTAINERS_ORG_NAME="${LINUXCONTAINERS_ORG_NAME:-images}"
|
2020-04-04 10:40:14 +00:00
|
|
|
export LXC_HOST_PREFIX="${LXC_SUITE_NAME:-searx}"
|
2020-03-07 19:24:08 +00:00
|
|
|
export LXC_SUITE=(
|
2020-04-03 15:08:42 +00:00
|
|
|
|
2020-03-07 19:24:08 +00:00
|
|
|
# end of standard support see https://wiki.ubuntu.com/Releases
|
2021-01-02 16:23:18 +00:00
|
|
|
"$LINUXCONTAINERS_ORG_NAME:ubuntu/20.04" "ubu2004" # April 2025
|
2022-03-12 17:00:45 +00:00
|
|
|
"$LINUXCONTAINERS_ORG_NAME:ubuntu/21.10" "ubu2110" # July 2027
|
2020-03-07 19:24:08 +00:00
|
|
|
|
|
|
|
# EOL see https://fedoraproject.org/wiki/Releases
|
2022-03-12 15:51:42 +00:00
|
|
|
"$LINUXCONTAINERS_ORG_NAME:fedora/35" "fedora35"
|
2020-03-07 19:24:08 +00:00
|
|
|
|
|
|
|
# rolling releases see https://www.archlinux.org/releng/releases/
|
|
|
|
"$LINUXCONTAINERS_ORG_NAME:archlinux" "archlinux"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-04-13 09:34:28 +00:00
|
|
|
lxc_suite_install_info() {
|
|
|
|
(
|
|
|
|
lxc_set_suite_env
|
|
|
|
cat <<EOF
|
2022-05-27 16:43:14 +00:00
|
|
|
LXC suite: ${LXC_SUITE_NAME}
|
|
|
|
Suite includes installation of SearXNG
|
|
|
|
images: ${LOCAL_IMAGES[*]}
|
|
|
|
containers: ${CONTAINERS[*]}
|
2020-04-13 09:34:28 +00:00
|
|
|
EOF
|
|
|
|
)
|
2022-05-27 16:43:14 +00:00
|
|
|
}
|
2020-04-13 09:34:28 +00:00
|
|
|
|
2020-03-07 19:24:08 +00:00
|
|
|
lxc_suite_install() {
|
|
|
|
(
|
|
|
|
lxc_set_suite_env
|
2020-03-30 09:03:46 +00:00
|
|
|
FORCE_TIMEOUT=0
|
|
|
|
export FORCE_TIMEOUT
|
2022-05-27 16:43:14 +00:00
|
|
|
"${LXC_REPO_ROOT}/utils/searxng.sh" install all
|
2020-03-07 19:24:08 +00:00
|
|
|
rst_title "suite installation finished ($(hostname))" part
|
|
|
|
lxc_suite_info
|
|
|
|
echo
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
lxc_suite_info() {
|
|
|
|
(
|
|
|
|
lxc_set_suite_env
|
|
|
|
for ip in $(global_IPs) ; do
|
|
|
|
if [[ $ip =~ .*:.* ]]; then
|
2020-03-29 14:46:07 +00:00
|
|
|
info_msg "(${ip%|*}) IPv6: http://[${ip#*|}]"
|
2020-03-07 19:24:08 +00:00
|
|
|
else
|
|
|
|
# IPv4:
|
2020-04-13 09:34:28 +00:00
|
|
|
# shellcheck disable=SC2034,SC2031
|
2020-03-29 14:46:07 +00:00
|
|
|
info_msg "(${ip%|*}) docs-live: http://${ip#*|}:8080/"
|
2020-03-07 19:24:08 +00:00
|
|
|
fi
|
|
|
|
done
|
2022-05-27 16:43:14 +00:00
|
|
|
"${LXC_REPO_ROOT}/utils/searxng.sh" searxng.instance.env
|
2020-03-07 19:24:08 +00:00
|
|
|
)
|
|
|
|
}
|