lxc-searxng.env 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 "${LXC_REPO_ROOT}/utils/searxng.sh" install all
  37. rst_title "Suite installation finished ($(hostname))" part
  38. if ask_yn "Developer install? (wraps source from HOST into the running instance)" Yn; then
  39. "${LXC_REPO_ROOT}/utils/searxng.sh" searxng.install.link_src "$(pwd)"
  40. fi
  41. lxc_suite_info
  42. echo
  43. )
  44. }
  45. lxc_suite_info() {
  46. (
  47. lxc_set_suite_env
  48. for ip in $(global_IPs) ; do
  49. if [[ $ip =~ .*:.* ]]; then
  50. info_msg "(${ip%|*}) IPv6: http://[${ip#*|}]"
  51. else
  52. # IPv4:
  53. # shellcheck disable=SC2034,SC2031
  54. info_msg "(${ip%|*}) docs-live: http://${ip#*|}:8080/"
  55. fi
  56. done
  57. "${LXC_REPO_ROOT}/utils/searxng.sh" searxng.instance.env
  58. )
  59. }