From c184437dc1d6a59fa586f81e7dcae6519577ed67 Mon Sep 17 00:00:00 2001 From: Benedikt Kroening <benedikt.kroening@open-xchange.com> Date: Mon, 20 Jan 2020 14:11:40 +0100 Subject: [PATCH] Moved some frontend setup logic --- config/init-frontend.sh | 23 +++++++++-- config/middleware/30_init_singlenode.sh | 55 ------------------------- setup/install-frontend.sh | 10 +---- 3 files changed, 21 insertions(+), 67 deletions(-) delete mode 100755 config/middleware/30_init_singlenode.sh diff --git a/config/init-frontend.sh b/config/init-frontend.sh index 2390860..84259be 100755 --- a/config/init-frontend.sh +++ b/config/init-frontend.sh @@ -35,6 +35,7 @@ show_usage() { echo -n " $0 [OPTIONS] + --singlenode Creates basic balancers for a singlenode setup (App Suite api only) " } @@ -56,8 +57,10 @@ case $key in set -x shift ;; - - + --singlenode) + INSTALL_TYPE=singlenode + shift + ;; # -g|--middleware) # INSTALL_MIDDLEWARE=true # shift @@ -85,8 +88,20 @@ esac done set -- "${POSITIONAL[@]}" # restore positional parameters -echo "Copying default config ..." -cp -f ${SCRIPT_DIR}/frontend/conf/*.conf ${HTTPD_CONF_PATH} +if [[ "${INSTALL_TYPE}" == *"singlenode"* ]]; then + echo "Configuring frontend for singlenode use with localhost balancers" + ${SCRIPT_DIR}/frontend/add-balancer.sh \ + --name "oxcluster" \ + --balancer "http://localhost:8009" \ + --route "$(hostname -s)" \ + --priority 20 + + ${SCRIPT_DIR}/frontend/add-balancer.sh \ + --name "oxcluster_ws" \ + --balancer "ws://localhost:8009" \ + --route "$(hostname -s)" \ + --priority 20 +fi restartService ${HTTPD} diff --git a/config/middleware/30_init_singlenode.sh b/config/middleware/30_init_singlenode.sh deleted file mode 100755 index f5c888e..0000000 --- a/config/middleware/30_init_singlenode.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2019 OX Software GmbH -# -# This file is part of OX Automation. -# -# OX Automation is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OX Automation is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with OX Automation. If not, see <http://www.gnu.org/licenses/>. -# -# -# Authors: -# Benedikt Kroening <benedikt.kroening@open-xchange.com> -# -set -e -SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P)" -source ${SCRIPT_DIR}/../../lib/common.bash -detectDistribution - -if [[ "${INSTALL_TYPE}" == *"singlenode"* ]]; then - echo "Configuring everything for singlenode use with frontend balancers" - echo "=========" - printenv | grep "^INSTALL_" - echo "=========" - sleep 5 - - # one last singlenode restart before qa init will start - restartService open-xchange - - ${SCRIPT_DIR}/../frontend/add-balancer.sh \ - --name "oxcluster" \ - --balancer "http://localhost:8009" \ - --route "$(hostname -s)" \ - --priority 20 - - ${SCRIPT_DIR}/../frontend/add-balancer.sh \ - --name "oxcluster_ws" \ - --balancer "ws://localhost:8009" \ - --route "$(hostname -s)" \ - --priority 20 - - - restartService ${HTTPD} -fi - diff --git a/setup/install-frontend.sh b/setup/install-frontend.sh index d25d2a3..6ded853 100755 --- a/setup/install-frontend.sh +++ b/setup/install-frontend.sh @@ -33,6 +33,8 @@ checkRootPrivileges show_usage() { echo -n " $0 [OPTIONS] + + --init-singlenode forces init process after frontend installation for singlenode/localhost nodes only " @@ -55,14 +57,6 @@ case $key in set -x shift ;; - --guard) - INSTALL_GUARD=true - shift - ;; - --documents) - INSTALL_DOCUMENTS=true - shift - ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift -- GitLab