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
|
|
|
|
# environment only is subshells!
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# config
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
lxc_set_suite_env() {
|
|
|
|
# name of https://images.linuxcontainers.org
|
|
|
|
export LINUXCONTAINERS_ORG_NAME="${LINUXCONTAINERS_ORG_NAME:-images}"
|
|
|
|
export LXC_HOST_PREFIX="${LXC_HOST_PREFIX:-searx}"
|
|
|
|
export LXC_SUITE=(
|
|
|
|
# end of standard support see https://wiki.ubuntu.com/Releases
|
|
|
|
"$LINUXCONTAINERS_ORG_NAME:ubuntu/16.04" "ubu1604" # April 2021
|
|
|
|
"$LINUXCONTAINERS_ORG_NAME:ubuntu/18.04" "ubu1804" # April 2023
|
|
|
|
"$LINUXCONTAINERS_ORG_NAME:ubuntu/19.10" "ubu1910" # July 2020
|
|
|
|
"$LINUXCONTAINERS_ORG_NAME:ubuntu/20.04" "ubu2004" # future (EOL 2030)
|
|
|
|
|
|
|
|
# EOL see https://fedoraproject.org/wiki/Releases
|
|
|
|
"$LINUXCONTAINERS_ORG_NAME:fedora/31" "fedora31"
|
|
|
|
|
|
|
|
# rolling releases see https://www.archlinux.org/releng/releases/
|
|
|
|
"$LINUXCONTAINERS_ORG_NAME:archlinux" "archlinux"
|
|
|
|
)
|
|
|
|
export FILTRON_API="0.0.0.0:4005"
|
|
|
|
export FILTRON_LISTEN="0.0.0.0:4004"
|
|
|
|
export MORTY_LISTEN="0.0.0.0:3000"
|
|
|
|
}
|
|
|
|
|
2020-03-30 09:03:46 +00:00
|
|
|
# shellcheck disable=SC2034
|
|
|
|
LXC_SUITE_INSTALL_INFO="suite includes searx, morty & filtron"
|
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
|
2020-03-07 19:24:08 +00:00
|
|
|
"${LXC_REPO_ROOT}/utils/searx.sh" install all
|
|
|
|
"${LXC_REPO_ROOT}/utils/morty.sh" install all
|
|
|
|
"${LXC_REPO_ROOT}/utils/filtron.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
|
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-03-29 14:46:07 +00:00
|
|
|
info_msg "(${ip%|*}) filtron: http://${ip#*|}:4004/"
|
|
|
|
info_msg "(${ip%|*}) morty: http://${ip#*|}:3000/"
|
|
|
|
info_msg "(${ip%|*}) docs-live: http://${ip#*|}:8080/"
|
2020-03-07 19:24:08 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
)
|
|
|
|
}
|