lxc-searx.env 2.5 KB

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