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

Documents feature scripts

Some cleanup to the document realted feature scripts
parent c184437d
No related branches found
No related tags found
1 merge request!7Issue16 7102
#!/bin/bash
#
# Copyright (C) 2019 OX Software GmbH
......@@ -37,13 +36,17 @@ if [[ -z "${AS_OFFICE_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 "
$0 [OPTIONS]
--singlenode This flag combines install, enable, server, client and the frontend flag in order to set things up on a singlenode setup
--install The install flag
--enable Enable documents in config and restart the backend
--disable Disable (WIP, may not work)
......@@ -74,23 +77,23 @@ case $key in
shift
;;
--enable)
DOCUMENTCONVERTER_ENABLE=true
DOCCONV_ENABLE=true
shift
;;
--disable)
DOCUMENTS_ENABLE=false
DOCCONV_ENABLE=false
shift
;;
--server)
SERVER=true
DOCCONV_SERVER=true
shift
;;
--client)
CLIENT=true
DOCCONV_CLIENT=true
shift
;;
--frontend)
FRONTEND=true
DOCCONV_FRONTEND=true
shift
;;
--install)
......@@ -101,6 +104,15 @@ case $key in
RESTART_OX=true
shift
;;
--singlenode)
export DOCCONV_ENABLE=true
export DOCCONV_SERVER=true
export DOCCONV_CLIENT=true
export DOCCONV_FRONTEND=true
export INSTALL_DOCUMENTCONVERTER=true
RESTART_OX=true
shift
;;
# -k|--key)
# value="$2"
# shift
......@@ -115,7 +127,12 @@ done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [ "$INSTALL_DOCUMENTCONVERTER" = true ] ; then
if [[ "${SERVER}" = true ]]; then
echo "Document converter setup prepared ..."
echo "=== (CTRL+C to cancel) ==="
sleep 3
if [[ "${DOCCONV_SERVER}" = true ]]; then
echo "Adding OX documentconverter server packages ..."
PACKAGES="readerengine open-xchange-documentconverter-server open-xchange-documentconverter-api "
installPackagesRetry "${PACKAGES}"
......@@ -123,7 +140,7 @@ if [ "$INSTALL_DOCUMENTCONVERTER" = true ] ; then
# client will be installed by documents, frontned does not require packages
fi
if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then
if [[ "${DOCCONV_ENABLE}" = true ]]; then
restartService open-xchange-documentconverter-server
sleep 5
......@@ -131,11 +148,11 @@ if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then
if [ ! -f ${INIT_STATE_FILE} ]; then
# waitPort 8008 oder so?
if [[ "${SERVER}" = true ]]; then
if [[ "${DOCCONV_SERVER}" = true ]]; then
echo "Doing some dc-server config"
fi
if [[ "${CLIENT}" = true ]]; then
if [[ "${DOCCONV_CLIENT}" = true ]]; then
if [[ -z "${CONVERTER_REMOTE_URL}" ]]; then
CONVERTER_REMOTE_URL="http://localhost:8008/documentconverterws"
echo "WARNING: Converter URL not provided, using fallback: $CONVERTER_REMOTE_URL"
......@@ -159,7 +176,7 @@ if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then
elif [[ "${DOCUMENTCONVERTER_ENABLE}" = false ]]; then
elif [[ "${DOCCONV_ENABLE}" = false ]]; then
echo ""
# do something to disable it
fi
......
......@@ -22,7 +22,6 @@
# 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
......@@ -36,7 +35,10 @@ if [[ -z "${AS_OFFICE_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 "
......@@ -46,6 +48,8 @@ Please keep in mind that most of this flags are already provided by the configur
$0 [OPTIONS]
--singlenode This flag combines install, enable, middleware, frontend and the dcs flag in order to set things up on a singlenode setup
--install The install flag
--enable Enable documents in config and restart the backend
--disable Disable (WIP, may not work)
......@@ -84,15 +88,15 @@ case $key in
shift
;;
--middleware)
MIDDLEWARE=true
DOCUMENTS_MIDDLEWARE=true
shift
;;
--frontend)
FRONTEND=true
DOCUMENTS_FRONTEND=true
shift
;;
-dcs|--documents-collaboration)
export INSTALL_DCS=true
export DOCUMENTS_INSTALL_DCS=true
shift
;;
--guard)
......@@ -103,6 +107,18 @@ case $key in
export INSTALL_DOCUMENTS=true
shift
;;
--singlenode)
echo "Configuring documents for singlenode setup (documents, dcs, document converter) ..."
export DOCUMENTS_INSTALL_DCS=true
export DOCUMENTS_FRONTEND=true
export DOCUMENTS_MIDDLEWARE=true
export DOCUMENTS_ENABLE=true
INSTALL_DOCUMENTS=true
INSTALL_TYPE=singlenode
RESTART_OX=true
shift
;;
# -k|--key)
# value="$2"
# shift
......@@ -122,16 +138,20 @@ set -- "${POSITIONAL[@]}" # restore positional parameters
# Install documents middleware and frontend related packages
if [ "$INSTALL_DOCUMENTS" = true ] ; then
if [[ "${MIDDLEWARE}" = true ]]; then
if [[ "${DOCUMENTS_MIDDLEWARE}" = true ]]; then
echo "Adding OX Documents middleware packages ..."
PACKAGES="${PACKAGES} open-xchange-documentconverter-client open-xchange-documents-backend open-xchange-documents-templates open-xchange-documents-ui-common open-xchange-documents-ui-editors open-xchange-documentconverter-api"
fi
if [[ "${FRONTEND}" = true ]]; then
if [[ "${DOCUMENTS_FRONTEND}" = true ]]; then
echo "Adding OX Documents frontend packages ..."
PACKAGES="${PACKAGES} open-xchange-documents-ui-static open-xchange-documents-help-*"
fi
echo "Documents setup prepared"
echo "=== (CTRL+C to cancel) ==="
sleep 3
if [[ -n "${PACKAGES}" ]]; then
installPackagesRetry "${PACKAGES}"
fi
......@@ -143,7 +163,7 @@ if [ "$INSTALL_DOCUMENTS" = true ] ; then
fi
# Install and enable Documents collaboration server, client comes below
if [ "$INSTALL_DCS" = true ] ; then
if [ "$DOCUMENTS_INSTALL_DCS" = true ] ; then
${SCRIPT_DIR}/documents-collaboration.sh --install --server
fi
......@@ -154,8 +174,9 @@ if [[ "${DOCUMENTS_ENABLE}" = true ]]; then
${SCRIPT_DIR}/../config/init-documents-collaboration.sh
fi
# The documents collaboration client requires some special config
${SCRIPT_DIR}/documents-collaboration.sh --enable --client --restart
if [ "$DOCUMENTS_INSTALL_DCS" = true ] ; then
${SCRIPT_DIR}/documents-collaboration.sh --enable --client --restart
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