Skip to content
Snippets Groups Projects
Commit 4017c8a7 authored by benedikt.kroening's avatar benedikt.kroening
Browse files

Fixes to documents, dcs, docconv

parent 802857ee
No related branches found
No related tags found
1 merge request!7Issue16 7102
#!/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)"
# sourcing some commonly used functions and executing basic checks
source ${SCRIPT_DIR}/../lib/common.bash
checkRootPrivileges
detectDistribution
## Help text
show_usage() {
echo -n "
$0 [OPTIONS]
"
}
### reading config from command line; overriding defaults
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
show_usage
exit 0
shift
;;
--debug)
echo "WARNING: Debug flag set (--debug)"
set -x
shift
;;
# -g|--middleware)
# INSTALL_MIDDLEWARE=true
# shift
# ;;
# --guard)
# INSTALL_GUARD=true
# shift
# ;;
# --documents)
# INSTALL_DOCUMENTS=true
# shift
# ;;
# --repo-guard)
# OX_REPO_GUARD="$2"
# echo "WARNING: Using $OX_REPO_GUARD as guard repository source"
# shift
# shift
# ;;
*) # unknown option
echo "Unknonwn option: $1"
POSITIONAL+=("$1") # save it in an array for later
shift
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
# echo "Copying default config ..."
# cp -f ${SCRIPT_DIR}/frontend/conf/*.conf ${HTTPD_CONF_PATH}
# restartService ${HTTPD}
INIT_STATE_FILE="/opt/open-xchange/etc/01-init-documents-collaboration-done"
if [ ! -f ${INIT_STATE_FILE} ]; then
${SCRIPT_DIR}/../features/documents-collaboration.sh --enable --server
echo "$(date)" > ${INIT_STATE_FILE}
else
echo "WARNING: This scripts has already been executed and will be skipped!"
sleep 5
fi
......@@ -75,9 +75,7 @@ fi
INIT_STATE_FILE="/opt/open-xchange/etc/21-init-documents-done"
if [ ! -f ${INIT_STATE_FILE} ]; then
# Restart will be done later
${SCRIPT_DIR}/../../features/documents.sh --enable
${SCRIPT_DIR}/../../features/documents.sh --enable --documents-collaboration
echo "$(date)" >> ${INIT_STATE_FILE}
else
......
......@@ -183,5 +183,5 @@ fi
if [[ "${RESTART_OX}" = true ]]; then
restartService open-xchange
restartService open-xchange-documentconverter
fi
\ No newline at end of file
......@@ -37,7 +37,10 @@ if [[ -z "${AS_OFFICE_COLLABORATION_VERSION}" ]]; then
echo "Warning: Missing environment variable. Sourcing default versions file ..."
exportProperties ${SCRIPT_DIR}/../setup/versions
fi
if [[ -z "${INSTALL_TYPE}" ]]; then
echo "WARNING: Missing environment variable. Sourcing default config file ..."
exportProperties ${SCRIPT_DIR}/../config/config
fi
## Help text
show_usage() {
echo -n "
......@@ -124,7 +127,6 @@ if [[ "${ENABLE_DCS}" = true ]]; then
--mysql-root-user "${DATABASE_ROOT_USER}" \
--mysql-root-passwd "${DATABASE_ROOT_PASS}"
# TODO: docker supervisor service file
restartService open-xchange-documents-collaboration
fi
......@@ -140,5 +142,5 @@ elif [[ "${FEATURE_ENABLE}" = false ]]; then
fi
if [[ "${RESTART_OX}" = true ]]; then
restartService open-xchange
restartService open-xchange-documents-collaboration
fi
\ No newline at end of file
......@@ -80,19 +80,19 @@ case $key in
shift
;;
--enable)
DOCUMENTS_ENABLE=true
export DOCUMENTS_ENABLE=true
shift
;;
--disable)
DOCUMENTS_ENABLE=false
export DOCUMENTS_ENABLE=false
shift
;;
--middleware)
DOCUMENTS_MIDDLEWARE=true
export DOCUMENTS_MIDDLEWARE=true
shift
;;
--frontend)
DOCUMENTS_FRONTEND=true
export DOCUMENTS_FRONTEND=true
shift
;;
-dcs|--documents-collaboration)
......@@ -164,19 +164,29 @@ fi
# Install and enable Documents collaboration server, client comes below
if [ "$DOCUMENTS_INSTALL_DCS" = true ] ; then
${SCRIPT_DIR}/documents-collaboration.sh --install --server
if [[ "${INSTALL_TYPE}" == *"singlenode"* ]]; then
# ensure that dcs server will be enabled if on any singlenode type (otherwise documents won't work due to missing dcs-configdb)
echo "Installing dcs for singlenode environment ..."
${SCRIPT_DIR}/documents-collaboration.sh --install --server --client
else
echo "ERROR: Could not install documents ... TODO: check for other install type"
exit 99
fi
fi
if [[ "${DOCUMENTS_ENABLE}" = true ]]; then
# The dcs config is placed here because it is mandatory for documents while the documentconverter part is optional (it has its own mw init scripts)
if [[ -f /usr/share/open-xchange-documents-collaboration/bin/initdcsdb.sh ]]; then
${SCRIPT_DIR}/../config/init-documents-collaboration.sh
fi
# The documents collaboration client requires some special config
if [ "$DOCUMENTS_INSTALL_DCS" = true ] ; then
${SCRIPT_DIR}/documents-collaboration.sh --enable --client --restart
if [[ "${INSTALL_TYPE}" == *"singlenode"* ]]; then
# ensure that dcs server will be enabled if on any singlenode type (otherwise documents won't work due to missing dcs-configdb)
echo "Enabling dcs for singlenode environment ..."
${SCRIPT_DIR}/documents-collaboration.sh --enable --client --server --restart
else
echo "ERROR: Could not enable documents ... TODO: check for other install type"
exit 99
fi
fi
setOXProperty permissions "text,spreadsheet,presentation,presenter,document_preview" /opt/open-xchange/etc/permissions.properties
if [ "${INSTALL_GUARD}" = true ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment