lxc-searx.env 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. # end of standard support see https://wiki.ubuntu.com/Releases
  16. "$LINUXCONTAINERS_ORG_NAME:ubuntu/16.04" "ubu1604" # April 2021
  17. "$LINUXCONTAINERS_ORG_NAME:ubuntu/18.04" "ubu1804" # April 2023
  18. "$LINUXCONTAINERS_ORG_NAME:ubuntu/19.10" "ubu1910" # July 2020
  19. "$LINUXCONTAINERS_ORG_NAME:ubuntu/20.04" "ubu2004" # future (EOL 2030)
  20. # EOL see https://fedoraproject.org/wiki/Releases
  21. "$LINUXCONTAINERS_ORG_NAME:fedora/31" "fedora31"
  22. # rolling releases see https://www.archlinux.org/releng/releases/
  23. "$LINUXCONTAINERS_ORG_NAME:archlinux" "archlinux"
  24. )
  25. export FILTRON_API="0.0.0.0:4005"
  26. export FILTRON_LISTEN="0.0.0.0:4004"
  27. export MORTY_LISTEN="0.0.0.0:3000"
  28. }
  29. lxc_suite_install() {
  30. (
  31. lxc_set_suite_env
  32. export FORCE_TIMEOUT=0
  33. "${LXC_REPO_ROOT}/utils/searx.sh" install all
  34. "${LXC_REPO_ROOT}/utils/morty.sh" install all
  35. "${LXC_REPO_ROOT}/utils/filtron.sh" install all
  36. rst_title "suite installation finished ($(hostname))" part
  37. lxc_suite_info
  38. echo
  39. )
  40. }
  41. lxc_suite_info() {
  42. (
  43. lxc_set_suite_env
  44. for ip in $(global_IPs) ; do
  45. if [[ $ip =~ .*:.* ]]; then
  46. info_msg "(${ip%|*}) IPv6: http://[${ip#*|}]"
  47. else
  48. # IPv4:
  49. info_msg "(${ip%|*}) filtron: http://${ip#*|}:4004/"
  50. info_msg "(${ip%|*}) morty: http://${ip#*|}:3000/"
  51. fi
  52. done
  53. )
  54. }