lxc-searxng.env 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 in subshells.
  7. lxc_set_suite_env() {
  8. export LXC_SUITE_NAME="searxng"
  9. # name of https://images.linuxcontainers.org
  10. export LINUXCONTAINERS_ORG_NAME="${LINUXCONTAINERS_ORG_NAME:-images}"
  11. export LXC_HOST_PREFIX="${LXC_SUITE_NAME:-searx}"
  12. export LXC_SUITE=(
  13. # end of standard support see https://wiki.ubuntu.com/Releases
  14. "$LINUXCONTAINERS_ORG_NAME:ubuntu/20.04" "ubu2004" # LTS EOSS April 2025
  15. "$LINUXCONTAINERS_ORG_NAME:ubuntu/22.04" "ubu2204" # LTS EOSS April 2027
  16. # EOL see https://fedoraproject.org/wiki/Releases
  17. "$LINUXCONTAINERS_ORG_NAME:fedora/35" "fedora35"
  18. # rolling releases see https://www.archlinux.org/releng/releases/
  19. "$LINUXCONTAINERS_ORG_NAME:archlinux" "archlinux"
  20. )
  21. }
  22. lxc_suite_install_info() {
  23. (
  24. lxc_set_suite_env
  25. cat <<EOF
  26. LXC suite: ${LXC_SUITE_NAME}
  27. Suite includes installation of SearXNG
  28. images: ${LOCAL_IMAGES[*]}
  29. containers: ${CONTAINERS[*]}
  30. EOF
  31. )
  32. }
  33. lxc_suite_install() {
  34. (
  35. lxc_set_suite_env
  36. FORCE_TIMEOUT=0
  37. export FORCE_TIMEOUT
  38. "${LXC_REPO_ROOT}/utils/searxng.sh" install all
  39. rst_title "suite installation finished ($(hostname))" part
  40. lxc_suite_info
  41. echo
  42. )
  43. }
  44. lxc_suite_info() {
  45. (
  46. lxc_set_suite_env
  47. for ip in $(global_IPs) ; do
  48. if [[ $ip =~ .*:.* ]]; then
  49. info_msg "(${ip%|*}) IPv6: http://[${ip#*|}]"
  50. else
  51. # IPv4:
  52. # shellcheck disable=SC2034,SC2031
  53. info_msg "(${ip%|*}) docs-live: http://${ip#*|}:8080/"
  54. fi
  55. done
  56. "${LXC_REPO_ROOT}/utils/searxng.sh" searxng.instance.env
  57. )
  58. }