lxc-searx.env 2.7 KB

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