Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/collabora_integrated.sh')
-rw-r--r--apps/collabora_integrated.sh91
1 files changed, 4 insertions, 87 deletions
diff --git a/apps/collabora_integrated.sh b/apps/collabora_integrated.sh
index 87843cbc..b57a95a1 100644
--- a/apps/collabora_integrated.sh
+++ b/apps/collabora_integrated.sh
@@ -20,48 +20,6 @@ debug_mode
# Check if root
root_check
-# TODO: remove all functions with NC21.0.3 release
-remove_all_office_apps() {
- # remove OnlyOffice-documentserver if installed
- if is_app_installed documentserver_community
- then
- nextcloud_occ app:remove documentserver_community
- fi
-
- # Disable OnlyOffice App if installed
- if is_app_installed onlyoffice
- then
- nextcloud_occ app:remove onlyoffice
- fi
-
- # remove richdocumentscode-documentserver if installed
- if is_app_installed richdocumentscode
- then
- nextcloud_occ app:remove richdocumentscode
- fi
-
- # Disable RichDocuments (Collabora App) if installed
- if is_app_installed richdocuments
- then
- nextcloud_occ app:remove richdocuments
- fi
-}
-remove_from_trusted_domains() {
- local element="$1"
- local count=0
- print_text_in_color "$ICyan" "Removing $element from trusted domains..."
- while [ "$count" -lt 10 ]
- do
- if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ]
- then
- nextcloud_occ_no_check config:system:delete trusted_domains "$count"
- break
- else
- count=$((count+1))
- fi
- done
-}
-
# Check if Collabora is installed using the new method
if ! is_app_installed richdocumentscode
then
@@ -84,56 +42,15 @@ fi
# Check if Collabora is installed using the old method
if does_this_docker_exist 'collabora/code'
then
- msg_box "Your server is compatible with the new way of installing Collabora. \
-We will now remove the old docker and install the app from Nextcloud instead."
- # Remove docker image
- docker_prune_this 'collabora/code'
- # Revoke LE
- SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com")
- if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ]
- then
- yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem"
- REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")"
- for remove in $REMOVE_OLD
- do rm -rf "$remove"
- done
- fi
- # Remove Apache2 config
- if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ]
- then
- a2dissite "$SUBDOMAIN".conf
- restart_webserver
- rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf"
- fi
- # Remove trusted domain
- remove_from_trusted_domains "$SUBDOMAIN"
+ # Removal
+ remove_collabora_docker
fi
# Check if Onlyoffice is installed and remove every trace of it
if does_this_docker_exist 'onlyoffice/documentserver'
then
- msg_box "You can't run both Collabora and OnlyOffice on the same VM. We will now remove Onlyoffice from the server."
- # Remove docker image
- docker_prune_this 'onlyoffice/documentserver'
- # Revoke LE
- SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Onlyoffice, e.g: office.yourdomain.com")
- if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ]
- then
- yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem"
- REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")"
- for remove in $REMOVE_OLD
- do rm -rf "$remove"
- done
- fi
- # Remove Apache2 config
- if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ]
- then
- a2dissite "$SUBDOMAIN".conf
- restart_webserver
- rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf"
- fi
- # Remove trusted domain
- remove_from_trusted_domains "$SUBDOMAIN"
+ # Removal
+ remove_onlyoffice_docker
fi
# Remove all office apps