@@ -19,6 +19,7 @@ HOST_PREFIX="${HOST_PREFIX:-searx}"
20# where all folders from HOST are mounted
20# where all folders from HOST are mounted
21LXC_SHARE_FOLDER="/share"
21LXC_SHARE_FOLDER="/share"
22+LXC_REPO_ROOT="${LXC_SHARE_FOLDER}/$(basename "${REPO_ROOT}")"
23TEST_IMAGES=(
24TEST_IMAGES=(
24 "$LINUXCONTAINERS_ORG_NAME:ubuntu/18.04" "ubu1804"
25 "$LINUXCONTAINERS_ORG_NAME:ubuntu/18.04" "ubu1804"
@@ -71,6 +72,7 @@ usage() {
73 $(basename "$0") build [containers]
74 $(basename "$0") build [containers]
75+ $(basename "$0") install [searx-suite]
74 $(basename "$0") remove [containers|subordinate]
76 $(basename "$0") remove [containers|subordinate]
75 $(basename "$0") [start|stop] [containers]
77 $(basename "$0") [start|stop] [containers]
76 $(basename "$0") inspect [info|config]
78 $(basename "$0") inspect [info|config]
@@ -87,6 +89,8 @@ inspect
87 :config: show config of all containers
89 :config: show config of all containers
89 run commandline ... in all containers
91 run commandline ... in all containers
93+ :searx-suite: install searx suite, includes morty & filtron
91all LXC containers:
95all LXC containers:
92 ${LOCAL_IMAGES[@]}
96 ${LOCAL_IMAGES[@]}
@@ -110,14 +114,24 @@ EOF
112 local exit_val
116 local exit_val
114− if ! required_commands lxc; then
119 local _usage="unknown or missing $1 command $2"
117 local _usage="unknown or missing $1 command $2"
123+ searx-suite) install_searx_suite ;;
128+ if ! required_commands lxc; then
121 case $1 in
135 case $1 in
122 --source-only) ;;
136 --source-only) ;;
123 -h|--help) usage; exit 0;;
137 -h|--help) usage; exit 0;;
@@ -161,6 +175,7 @@ main() {
161 sudo_or_exit
175 sudo_or_exit
163 for i in "${LOCAL_IMAGES[@]}"; do
177 for i in "${LOCAL_IMAGES[@]}"; do
164 info_msg "[${_BBlue}${i}${_creset}] ${_BGreen}${*}${_creset}"
179 info_msg "[${_BBlue}${i}${_creset}] ${_BGreen}${*}${_creset}"
165 lxc exec "${i}" -- "$@"
180 lxc exec "${i}" -- "$@"
166 exit_val=$?
181 exit_val=$?
@@ -171,11 +186,37 @@ main() {
193+ for i in "${LOCAL_IMAGES[@]}"; do
194+ info_msg "[${_BBlue}${i}${_creset}] ${_BGreen}${LXC_REPO_ROOT}/utils/lxc.sh install $2${_creset}"
195+ lxc exec "${i}" -- "${LXC_REPO_ROOT}/utils/lxc.sh" __install "$2"
198+ *) usage "$_usage"; exit 42;;
175 usage "unknown or missing command $1"; exit 42;;
201 usage "unknown or missing command $1"; exit 42;;
205+install_searx_suite() {
206+ export FILTRON_API="0.0.0.0:4005"
207+ export FILTRON_LISTEN="0.0.0.0:4004"
208+ export MORTY_LISTEN="0.0.0.0:3000"
209+ FORCE_TIMEOUT=0 "${LXC_REPO_ROOT}/utils/searx.sh" install all
210+ FORCE_TIMEOUT=0 "${LXC_REPO_ROOT}/utils/morty.sh" install all
211+ FORCE_TIMEOUT=0 "${LXC_REPO_ROOT}/utils/filtron.sh" install all
212+ rst_title "[$(hostname)] searx-suite installation finished" part
213+ rst_para "IPs of the container ..."
215+ ip addr show | grep "inet\s*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*"
179build_instances() {
220build_instances() {
180 rst_title "Build LXC instances"
221 rst_title "Build LXC instances"
@@ -271,7 +312,7 @@ lxc_config_containers() {
271 # https://lxd.readthedocs.io/en/latest/instances/#type-disk
312 # https://lxd.readthedocs.io/en/latest/instances/#type-disk
272 lxc config device add "$i" repo_share disk \
313 lxc config device add "$i" repo_share disk \
273 source="${REPO_ROOT}" \
314 source="${REPO_ROOT}" \
274− path="${LXC_SHARE_FOLDER}/$(basename "${REPO_ROOT}")" &>/dev/null
315+ path="${LXC_REPO_ROOT}" &>/dev/null
275 # lxc config show "$i" && wait_key
316 # lxc config show "$i" && wait_key