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
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/collabora_docker.sh110
-rw-r--r--apps/collabora_integrated.sh91
-rw-r--r--apps/onlyoffice_docker.sh107
-rw-r--r--apps/onlyoffice_integrated.sh96
-rw-r--r--apps/pico_cms.sh35
5 files changed, 14 insertions, 425 deletions
diff --git a/apps/collabora_docker.sh b/apps/collabora_docker.sh
index 1632d46d..35e3d486 100644
--- a/apps/collabora_docker.sh
+++ b/apps/collabora_docker.sh
@@ -17,66 +17,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
-}
-add_to_trusted_domains() {
- local element="$1"
- local count=0
- print_text_in_color "$ICyan" "Adding $element to trusted domains..."
- while [ "$count" -le 10 ]
- do
- if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ]
- then
- break
- elif [ -z "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" ]
- then
- nextcloud_occ_no_check config:system:set trusted_domains "$count" --value="$element"
- break
- else
- count=$((count+1))
- fi
- done
-}
-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 already installed
print_text_in_color "$ICyan" "Checking if Collabora is already installed..."
if ! does_this_docker_exist 'collabora/code'
@@ -87,33 +27,7 @@ else
# Ask for removal or reinstallation
reinstall_remove_menu "$SCRIPT_NAME"
# Removal
- # Check if Collabora is previously installed
- # If yes, then stop and prune the docker container
- 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
- # Disable RichDocuments (Collabora App) if activated
- if is_app_installed richdocuments
- then
- nextcloud_occ app:remove richdocuments
- fi
- # Remove trusted domain
- remove_from_trusted_domains "$SUBDOMAIN"
+ remove_collabora_docker
# Show successful uninstall if applicable
removal_popup "$SCRIPT_NAME"
fi
@@ -122,26 +36,8 @@ fi
# If yes, then stop and prune the docker container
if does_this_docker_exist 'onlyoffice/documentserver'
then
- 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
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
diff --git a/apps/onlyoffice_docker.sh b/apps/onlyoffice_docker.sh
index 897582f3..2fb877ff 100644
--- a/apps/onlyoffice_docker.sh
+++ b/apps/onlyoffice_docker.sh
@@ -17,66 +17,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
-}
-add_to_trusted_domains() {
- local element="$1"
- local count=0
- print_text_in_color "$ICyan" "Adding $element to trusted domains..."
- while [ "$count" -le 10 ]
- do
- if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ]
- then
- break
- elif [ -z "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" ]
- then
- nextcloud_occ_no_check config:system:set trusted_domains "$count" --value="$element"
- break
- else
- count=$((count+1))
- fi
- done
-}
-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 already installed
if ! does_this_docker_exist 'onlyoffice/documentserver'
then
@@ -86,28 +26,7 @@ else
# Ask for removal or reinstallation
reinstall_remove_menu "$SCRIPT_NAME"
# Removal
- # Check if Collabora is previously installed
- # If yes, then stop and prune the docker container
- 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"
+ remove_onlyoffice_docker
# Show successful uninstall if applicable
removal_popup "$SCRIPT_NAME"
fi
@@ -115,28 +34,8 @@ fi
# Check if collabora is installed and remove every trace of it
if does_this_docker_exist 'collabora/code'
then
- msg_box "You can't run both Collabora and OnlyOffice on the same VM. We will now remove Collabora from the server."
- # 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
# Remove all office apps
diff --git a/apps/onlyoffice_integrated.sh b/apps/onlyoffice_integrated.sh
index 541ac006..2a42c788 100644
--- a/apps/onlyoffice_integrated.sh
+++ b/apps/onlyoffice_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 documentserver_community
then
@@ -84,61 +42,15 @@ fi
# Check if collabora is installed and remove every trace of it
if does_this_docker_exist 'collabora/code'
then
- msg_box "You can't run both Collabora and OnlyOffice on the same VM. \
-We will now remove Collabora from the server."
- # 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
- # Disable Collabora App if activated
- if is_app_installed richdocuments
- then
- nextcloud_occ app:remove richdocuments
- 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
diff --git a/apps/pico_cms.sh b/apps/pico_cms.sh
index 3dc8f95a..81c47023 100644
--- a/apps/pico_cms.sh
+++ b/apps/pico_cms.sh
@@ -18,41 +18,6 @@ debug_mode
# Check if root
root_check
-# TODO: remove both functions with NC21.0.3 release
-add_to_trusted_domains() {
- local element="$1"
- local count=0
- print_text_in_color "$ICyan" "Adding $element to trusted domains..."
- while [ "$count" -le 10 ]
- do
- if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ]
- then
- break
- elif [ -z "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" ]
- then
- nextcloud_occ_no_check config:system:set trusted_domains "$count" --value="$element"
- break
- else
- count=$((count+1))
- fi
- done
-}
-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
-}
-
# Nextcloud Main Domain
NCDOMAIN=$(nextcloud_occ_no_check config:system:get overwrite.cli.url | sed 's|https://||;s|/||')