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 #!/bin/bash
# #
# Copyright (C) 2019 OX Software GmbH # Copyright (C) 2019 OX Software GmbH
...@@ -37,13 +36,17 @@ if [[ -z "${AS_OFFICE_VERSION}" ]]; then ...@@ -37,13 +36,17 @@ if [[ -z "${AS_OFFICE_VERSION}" ]]; then
echo "Warning: Missing environment variable. Sourcing default versions file ..." echo "Warning: Missing environment variable. Sourcing default versions file ..."
exportProperties ${SCRIPT_DIR}/../setup/versions exportProperties ${SCRIPT_DIR}/../setup/versions
fi fi
if [[ -z "${INSTALL_TYPE}" ]]; then
echo "WARNING: Missing environment variable. Sourcing default config file ..."
exportProperties ${SCRIPT_DIR}/../config/config
fi
## Help text ## Help text
show_usage() { show_usage() {
echo -n " echo -n "
$0 [OPTIONS] $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 --install The install flag
--enable Enable documents in config and restart the backend --enable Enable documents in config and restart the backend
--disable Disable (WIP, may not work) --disable Disable (WIP, may not work)
...@@ -74,23 +77,23 @@ case $key in ...@@ -74,23 +77,23 @@ case $key in
shift shift
;; ;;
--enable) --enable)
DOCUMENTCONVERTER_ENABLE=true DOCCONV_ENABLE=true
shift shift
;; ;;
--disable) --disable)
DOCUMENTS_ENABLE=false DOCCONV_ENABLE=false
shift shift
;; ;;
--server) --server)
SERVER=true DOCCONV_SERVER=true
shift shift
;; ;;
--client) --client)
CLIENT=true DOCCONV_CLIENT=true
shift shift
;; ;;
--frontend) --frontend)
FRONTEND=true DOCCONV_FRONTEND=true
shift shift
;; ;;
--install) --install)
...@@ -101,6 +104,15 @@ case $key in ...@@ -101,6 +104,15 @@ case $key in
RESTART_OX=true RESTART_OX=true
shift 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) # -k|--key)
# value="$2" # value="$2"
# shift # shift
...@@ -115,7 +127,12 @@ done ...@@ -115,7 +127,12 @@ done
set -- "${POSITIONAL[@]}" # restore positional parameters set -- "${POSITIONAL[@]}" # restore positional parameters
if [ "$INSTALL_DOCUMENTCONVERTER" = true ] ; then 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 ..." echo "Adding OX documentconverter server packages ..."
PACKAGES="readerengine open-xchange-documentconverter-server open-xchange-documentconverter-api " PACKAGES="readerengine open-xchange-documentconverter-server open-xchange-documentconverter-api "
installPackagesRetry "${PACKAGES}" installPackagesRetry "${PACKAGES}"
...@@ -123,7 +140,7 @@ if [ "$INSTALL_DOCUMENTCONVERTER" = true ] ; then ...@@ -123,7 +140,7 @@ if [ "$INSTALL_DOCUMENTCONVERTER" = true ] ; then
# client will be installed by documents, frontned does not require packages # client will be installed by documents, frontned does not require packages
fi fi
if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then if [[ "${DOCCONV_ENABLE}" = true ]]; then
restartService open-xchange-documentconverter-server restartService open-xchange-documentconverter-server
sleep 5 sleep 5
...@@ -131,11 +148,11 @@ if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then ...@@ -131,11 +148,11 @@ if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then
if [ ! -f ${INIT_STATE_FILE} ]; then if [ ! -f ${INIT_STATE_FILE} ]; then
# waitPort 8008 oder so? # waitPort 8008 oder so?
if [[ "${SERVER}" = true ]]; then if [[ "${DOCCONV_SERVER}" = true ]]; then
echo "Doing some dc-server config" echo "Doing some dc-server config"
fi fi
if [[ "${CLIENT}" = true ]]; then if [[ "${DOCCONV_CLIENT}" = true ]]; then
if [[ -z "${CONVERTER_REMOTE_URL}" ]]; then if [[ -z "${CONVERTER_REMOTE_URL}" ]]; then
CONVERTER_REMOTE_URL="http://localhost:8008/documentconverterws" CONVERTER_REMOTE_URL="http://localhost:8008/documentconverterws"
echo "WARNING: Converter URL not provided, using fallback: $CONVERTER_REMOTE_URL" echo "WARNING: Converter URL not provided, using fallback: $CONVERTER_REMOTE_URL"
...@@ -159,7 +176,7 @@ if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then ...@@ -159,7 +176,7 @@ if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then
elif [[ "${DOCUMENTCONVERTER_ENABLE}" = false ]]; then elif [[ "${DOCCONV_ENABLE}" = false ]]; then
echo "" echo ""
# do something to disable it # do something to disable it
fi fi
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
# Authors: # Authors:
# Benedikt Kroening <benedikt.kroening@open-xchange.com> # Benedikt Kroening <benedikt.kroening@open-xchange.com>
# #
set -e set -e
SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P)" SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P)"
# sourcing some commonly used functions and executing basic checks # sourcing some commonly used functions and executing basic checks
...@@ -36,7 +35,10 @@ if [[ -z "${AS_OFFICE_VERSION}" ]]; then ...@@ -36,7 +35,10 @@ if [[ -z "${AS_OFFICE_VERSION}" ]]; then
echo "Warning: Missing environment variable. Sourcing default versions file ..." echo "Warning: Missing environment variable. Sourcing default versions file ..."
exportProperties ${SCRIPT_DIR}/../setup/versions exportProperties ${SCRIPT_DIR}/../setup/versions
fi fi
if [[ -z "${INSTALL_TYPE}" ]]; then
echo "WARNING: Missing environment variable. Sourcing default config file ..."
exportProperties ${SCRIPT_DIR}/../config/config
fi
## Help text ## Help text
show_usage() { show_usage() {
echo -n " echo -n "
...@@ -46,6 +48,8 @@ Please keep in mind that most of this flags are already provided by the configur ...@@ -46,6 +48,8 @@ Please keep in mind that most of this flags are already provided by the configur
$0 [OPTIONS] $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 --install The install flag
--enable Enable documents in config and restart the backend --enable Enable documents in config and restart the backend
--disable Disable (WIP, may not work) --disable Disable (WIP, may not work)
...@@ -84,15 +88,15 @@ case $key in ...@@ -84,15 +88,15 @@ case $key in
shift shift
;; ;;
--middleware) --middleware)
MIDDLEWARE=true DOCUMENTS_MIDDLEWARE=true
shift shift
;; ;;
--frontend) --frontend)
FRONTEND=true DOCUMENTS_FRONTEND=true
shift shift
;; ;;
-dcs|--documents-collaboration) -dcs|--documents-collaboration)
export INSTALL_DCS=true export DOCUMENTS_INSTALL_DCS=true
shift shift
;; ;;
--guard) --guard)
...@@ -103,6 +107,18 @@ case $key in ...@@ -103,6 +107,18 @@ case $key in
export INSTALL_DOCUMENTS=true export INSTALL_DOCUMENTS=true
shift 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) # -k|--key)
# value="$2" # value="$2"
# shift # shift
...@@ -122,16 +138,20 @@ set -- "${POSITIONAL[@]}" # restore positional parameters ...@@ -122,16 +138,20 @@ set -- "${POSITIONAL[@]}" # restore positional parameters
# Install documents middleware and frontend related packages # Install documents middleware and frontend related packages
if [ "$INSTALL_DOCUMENTS" = true ] ; then if [ "$INSTALL_DOCUMENTS" = true ] ; then
if [[ "${MIDDLEWARE}" = true ]]; then if [[ "${DOCUMENTS_MIDDLEWARE}" = true ]]; then
echo "Adding OX Documents middleware packages ..." 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" 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 fi
if [[ "${FRONTEND}" = true ]]; then if [[ "${DOCUMENTS_FRONTEND}" = true ]]; then
echo "Adding OX Documents frontend packages ..." echo "Adding OX Documents frontend packages ..."
PACKAGES="${PACKAGES} open-xchange-documents-ui-static open-xchange-documents-help-*" PACKAGES="${PACKAGES} open-xchange-documents-ui-static open-xchange-documents-help-*"
fi fi
echo "Documents setup prepared"
echo "=== (CTRL+C to cancel) ==="
sleep 3
if [[ -n "${PACKAGES}" ]]; then if [[ -n "${PACKAGES}" ]]; then
installPackagesRetry "${PACKAGES}" installPackagesRetry "${PACKAGES}"
fi fi
...@@ -143,7 +163,7 @@ if [ "$INSTALL_DOCUMENTS" = true ] ; then ...@@ -143,7 +163,7 @@ if [ "$INSTALL_DOCUMENTS" = true ] ; then
fi fi
# Install and enable Documents collaboration server, client comes below # 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 ${SCRIPT_DIR}/documents-collaboration.sh --install --server
fi fi
...@@ -154,8 +174,9 @@ if [[ "${DOCUMENTS_ENABLE}" = true ]]; then ...@@ -154,8 +174,9 @@ if [[ "${DOCUMENTS_ENABLE}" = true ]]; then
${SCRIPT_DIR}/../config/init-documents-collaboration.sh ${SCRIPT_DIR}/../config/init-documents-collaboration.sh
fi fi
# The documents collaboration client requires some special config # 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 setOXProperty permissions "text,spreadsheet,presentation,presenter,document_preview" /opt/open-xchange/etc/permissions.properties
if [ "${INSTALL_GUARD}" = true ]; then 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