@@ -59,7 +59,7 @@ usage::
5959 $(basename "$0") activate [service]
6060 $(basename "$0") deactivate [service]
6161 $(basename "$0") inspect [service]
62− $(basename "$0") option [debug-on|debug-off]
62+ $(basename "$0") option [debug-on|debug-off|new-key]
6363 $(basename "$0") apache [install|remove]
6464 $(basename "$0") nginx [install|remove]
6565 $(basename "$0") info [searx]
@@ -79,6 +79,7 @@ inspect service
7979 show service status and log
8080option
8181 set one of the available options
82+ :new-key: set new morty key
8283apache : ${PUBLIC_URL_MORTY}
8384 :install: apache site with a reverse proxy (ProxyPass)
8485 :remove: apache site ${APACHE_MORTY_SITE}
@@ -198,6 +199,7 @@ main() {
198199 option)
199200 sudo_or_exit
200201 case $2 in
202+ new-key) set_new_key ;;
201203 debug-on) enable_debug ;;
202204 debug-off) disable_debug ;;
203205 *) usage "$_usage"; exit 42;;
@@ -410,6 +412,23 @@ disable_debug() {
410412 set_service_env_debug false
411413}
412414
415+
416+set_new_key() {
417+ rst_title "Set morty key"
418+ echo
419+
420+ MORTY_KEY="$(head -c 32 /dev/urandom | base64)"
421+ info_msg "morty key: '${MORTY_KEY}'"
422+
423+ warn_msg "this will need to reinstall services .."
424+ MSG="${_Green}press any [${_BCyan}KEY${_Green}] to continue // stop with [${_BCyan}CTRL-C${_creset}]" wait_key
425+
426+ systemd_install_service "${SERVICE_NAME}" "${SERVICE_SYSTEMD_UNIT}"
427+ "${REPO_ROOT}/utils/searx.sh" option result-proxy "${PUBLIC_URL_MORTY}" "${MORTY_KEY}"
428+ "${REPO_ROOT}/utils/searx.sh" option image-proxy-on
429+}
430+
431+
413432install_apache_site() {
414433
415434 rst_title "Install Apache site $APACHE_MORTY_SITE"