lxc-searx.env 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_info="suite includes searx, morty & filtron"
  30. lxc_suite_install() {
  31. (
  32. lxc_set_suite_env
  33. export FORCE_TIMEOUT=0
  34. "${LXC_REPO_ROOT}/utils/searx.sh" install all
  35. "${LXC_REPO_ROOT}/utils/morty.sh" install all
  36. "${LXC_REPO_ROOT}/utils/filtron.sh" install all
  37. rst_title "suite installation finished ($(hostname))" part
  38. lxc_suite_info
  39. echo
  40. )
  41. }
  42. lxc_suite_prepare_buildhost() {
  43. (
  44. lxc_set_suite_env
  45. export FORCE_TIMEOUT=0
  46. "${LXC_REPO_ROOT}/utils/searx.sh" install buildhost
  47. rst_title "buildhost installation finished ($(hostname))" part
  48. echo
  49. )
  50. }
  51. lxc_suite_info() {
  52. (
  53. lxc_set_suite_env
  54. for ip in $(global_IPs) ; do
  55. if [[ $ip =~ .*:.* ]]; then
  56. info_msg "(${ip%|*}) IPv6: http://[${ip#*|}]"
  57. else
  58. # IPv4:
  59. info_msg "(${ip%|*}) filtron: http://${ip#*|}:4004/"
  60. info_msg "(${ip%|*}) morty: http://${ip#*|}:3000/"
  61. fi
  62. done
  63. )
  64. }