lxc-searx.env 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # -*- coding: utf-8; mode: sh indent-tabs-mode: nil -*-
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. # shellcheck shell=bash
  4. # This file is a setup of a LXC suite. It is sourced from different context, do
  5. # not manipulate the environment directly, implement functions and manipulate
  6. # environment only is subshells!
  7. # ----------------------------------------------------------------------------
  8. # config
  9. # ----------------------------------------------------------------------------
  10. lxc_set_suite_env() {
  11. # name of https://images.linuxcontainers.org
  12. export LINUXCONTAINERS_ORG_NAME="${LINUXCONTAINERS_ORG_NAME:-images}"
  13. export LXC_HOST_PREFIX="${LXC_HOST_PREFIX:-searx}"
  14. export LXC_SUITE=(
  15. # to disable containers, comment out lines ..
  16. # end of standard support see https://wiki.ubuntu.com/Releases
  17. "$LINUXCONTAINERS_ORG_NAME:ubuntu/16.04" "ubu1604" # April 2021
  18. "$LINUXCONTAINERS_ORG_NAME:ubuntu/18.04" "ubu1804" # April 2023
  19. "$LINUXCONTAINERS_ORG_NAME:ubuntu/19.10" "ubu1910" # July 2020
  20. "$LINUXCONTAINERS_ORG_NAME:ubuntu/20.04" "ubu2004" # future (EOL 2030)
  21. # EOL see https://fedoraproject.org/wiki/Releases
  22. "$LINUXCONTAINERS_ORG_NAME:fedora/31" "fedora31"
  23. # rolling releases see https://www.archlinux.org/releng/releases/
  24. "$LINUXCONTAINERS_ORG_NAME:archlinux" "archlinux"
  25. )
  26. export FILTRON_API="0.0.0.0:4005"
  27. export FILTRON_LISTEN="0.0.0.0:4004"
  28. export MORTY_LISTEN="0.0.0.0:3000"
  29. }
  30. # shellcheck disable=SC2034
  31. LXC_SUITE_INSTALL_INFO="suite includes searx, morty & filtron"
  32. lxc_suite_install() {
  33. (
  34. lxc_set_suite_env
  35. FORCE_TIMEOUT=0
  36. export FORCE_TIMEOUT
  37. "${LXC_REPO_ROOT}/utils/searx.sh" install all
  38. "${LXC_REPO_ROOT}/utils/morty.sh" install all
  39. "${LXC_REPO_ROOT}/utils/filtron.sh" install all
  40. rst_title "suite installation finished ($(hostname))" part
  41. lxc_suite_info
  42. echo
  43. )
  44. }
  45. lxc_suite_info() {
  46. (
  47. lxc_set_suite_env
  48. for ip in $(global_IPs) ; do
  49. if [[ $ip =~ .*:.* ]]; then
  50. info_msg "(${ip%|*}) IPv6: http://[${ip#*|}]"
  51. else
  52. # IPv4:
  53. info_msg "(${ip%|*}) filtron: http://${ip#*|}:4004/"
  54. info_msg "(${ip%|*}) morty: http://${ip#*|}:3000/"
  55. info_msg "(${ip%|*}) docs-live: http://${ip#*|}:8080/"
  56. fi
  57. done
  58. )
  59. }