diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2022-05-27 18:43:14 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2022-07-30 13:39:35 +0200 |
commit | 782f73540e2d383ea122716507ccd9582918ab51 (patch) | |
tree | 2cca6c47e63cdf383883a2a47ac8329e629bb40d /utils/lxc-searxng.env | |
parent | 81bba4486916dbca4467a7e8c8b839a7c55c2a09 (diff) | |
download | searxng-782f73540e2d383ea122716507ccd9582918ab51.tar.gz searxng-782f73540e2d383ea122716507ccd9582918ab51.zip |
[utils/searxng.sh] implement new script to install SearXNG
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/lxc-searxng.env')
-rw-r--r-- | utils/lxc-searxng.env | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/utils/lxc-searxng.env b/utils/lxc-searxng.env new file mode 100644 index 000000000..86279d4b3 --- /dev/null +++ b/utils/lxc-searxng.env @@ -0,0 +1,68 @@ +# -*- 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 +# environment only in subshells. + +lxc_set_suite_env() { + + export LXC_SUITE_NAME="searxng" + + # name of https://images.linuxcontainers.org + export LINUXCONTAINERS_ORG_NAME="${LINUXCONTAINERS_ORG_NAME:-images}" + export LXC_HOST_PREFIX="${LXC_SUITE_NAME:-searx}" + export LXC_SUITE=( + + # end of standard support see https://wiki.ubuntu.com/Releases + "$LINUXCONTAINERS_ORG_NAME:ubuntu/20.04" "ubu2004" # April 2025 + "$LINUXCONTAINERS_ORG_NAME:ubuntu/21.10" "ubu2110" # July 2027 + + # EOL see https://fedoraproject.org/wiki/Releases + "$LINUXCONTAINERS_ORG_NAME:fedora/35" "fedora35" + + # rolling releases see https://www.archlinux.org/releng/releases/ + "$LINUXCONTAINERS_ORG_NAME:archlinux" "archlinux" + ) +} + +lxc_suite_install_info() { + ( + lxc_set_suite_env + cat <<EOF +LXC suite: ${LXC_SUITE_NAME} + Suite includes installation of SearXNG + images: ${LOCAL_IMAGES[*]} + containers: ${CONTAINERS[*]} +EOF + ) +} + +lxc_suite_install() { + ( + lxc_set_suite_env + FORCE_TIMEOUT=0 + export FORCE_TIMEOUT + "${LXC_REPO_ROOT}/utils/searxng.sh" install all + 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 + info_msg "(${ip%|*}) IPv6: http://[${ip#*|}]" + else + # IPv4: + # shellcheck disable=SC2034,SC2031 + info_msg "(${ip%|*}) docs-live: http://${ip#*|}:8080/" + fi + done + "${LXC_REPO_ROOT}/utils/searxng.sh" searxng.instance.env + ) +} |