lxc-searx.env 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 packages
  47. "${LXC_REPO_ROOT}/utils/searx.sh" install buildhost
  48. rst_title "buildhost installation finished ($(hostname))" part
  49. echo
  50. )
  51. }
  52. lxc_suite_info() {
  53. (
  54. lxc_set_suite_env
  55. for ip in $(global_IPs) ; do
  56. if [[ $ip =~ .*:.* ]]; then
  57. info_msg "(${ip%|*}) IPv6: http://[${ip#*|}]"
  58. else
  59. # IPv4:
  60. info_msg "(${ip%|*}) filtron: http://${ip#*|}:4004/"
  61. info_msg "(${ip%|*}) morty: http://${ip#*|}:3000/"
  62. fi
  63. done
  64. )
  65. }