@@ -17,66 +17,6 @@ debug_mode
17
17
# Check if root
18
18
root_check
19
19
20
- # TODO: remove all functions with NC21.0.3 release
21
- remove_all_office_apps () {
22
- # remove OnlyOffice-documentserver if installed
23
- if is_app_installed documentserver_community
24
- then
25
- nextcloud_occ app:remove documentserver_community
26
- fi
27
-
28
- # Disable OnlyOffice App if installed
29
- if is_app_installed onlyoffice
30
- then
31
- nextcloud_occ app:remove onlyoffice
32
- fi
33
-
34
- # remove richdocumentscode-documentserver if installed
35
- if is_app_installed richdocumentscode
36
- then
37
- nextcloud_occ app:remove richdocumentscode
38
- fi
39
-
40
- # Disable RichDocuments (Collabora App) if installed
41
- if is_app_installed richdocuments
42
- then
43
- nextcloud_occ app:remove richdocuments
44
- fi
45
- }
46
- add_to_trusted_domains () {
47
- local element=" $1 "
48
- local count=0
49
- print_text_in_color " $ICyan " " Adding $element to trusted domains..."
50
- while [ " $count " -le 10 ]
51
- do
52
- if [ " $( nextcloud_occ_no_check config:system:get trusted_domains " $count " ) " = " $element " ]
53
- then
54
- break
55
- elif [ -z " $( nextcloud_occ_no_check config:system:get trusted_domains " $count " ) " ]
56
- then
57
- nextcloud_occ_no_check config:system:set trusted_domains " $count " --value=" $element "
58
- break
59
- else
60
- count=$(( count+ 1 ))
61
- fi
62
- done
63
- }
64
- remove_from_trusted_domains () {
65
- local element=" $1 "
66
- local count=0
67
- print_text_in_color " $ICyan " " Removing $element from trusted domains..."
68
- while [ " $count " -lt 10 ]
69
- do
70
- if [ " $( nextcloud_occ_no_check config:system:get trusted_domains " $count " ) " = " $element " ]
71
- then
72
- nextcloud_occ_no_check config:system:delete trusted_domains " $count "
73
- break
74
- else
75
- count=$(( count+ 1 ))
76
- fi
77
- done
78
- }
79
-
80
20
# Check if Collabora is already installed
81
21
print_text_in_color " $ICyan " " Checking if Collabora is already installed..."
82
22
if ! does_this_docker_exist ' collabora/code'
87
27
# Ask for removal or reinstallation
88
28
reinstall_remove_menu " $SCRIPT_NAME "
89
29
# Removal
90
- # Check if Collabora is previously installed
91
- # If yes, then stop and prune the docker container
92
- docker_prune_this ' collabora/code'
93
- # Revoke LE
94
- SUBDOMAIN=$( input_box_flow " Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com" )
95
- if [ -f " $CERTFILES /$SUBDOMAIN /cert.pem" ]
96
- then
97
- yes no | certbot revoke --cert-path " $CERTFILES /$SUBDOMAIN /cert.pem"
98
- REMOVE_OLD=" $( find " $LETSENCRYPTPATH /" -name " $SUBDOMAIN *" ) "
99
- for remove in $REMOVE_OLD
100
- do rm -rf " $remove "
101
- done
102
- fi
103
- # Remove Apache2 config
104
- if [ -f " $SITES_AVAILABLE /$SUBDOMAIN .conf" ]
105
- then
106
- a2dissite " $SUBDOMAIN " .conf
107
- restart_webserver
108
- rm -f " $SITES_AVAILABLE /$SUBDOMAIN .conf"
109
- fi
110
- # Disable RichDocuments (Collabora App) if activated
111
- if is_app_installed richdocuments
112
- then
113
- nextcloud_occ app:remove richdocuments
114
- fi
115
- # Remove trusted domain
116
- remove_from_trusted_domains " $SUBDOMAIN "
30
+ remove_collabora_docker
117
31
# Show successful uninstall if applicable
118
32
removal_popup " $SCRIPT_NAME "
119
33
fi
122
36
# If yes, then stop and prune the docker container
123
37
if does_this_docker_exist ' onlyoffice/documentserver'
124
38
then
125
- docker_prune_this ' onlyoffice/documentserver'
126
- # Revoke LE
127
- SUBDOMAIN=$( input_box_flow " Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com" )
128
- if [ -f " $CERTFILES /$SUBDOMAIN /cert.pem" ]
129
- then
130
- yes no | certbot revoke --cert-path " $CERTFILES /$SUBDOMAIN /cert.pem"
131
- REMOVE_OLD=" $( find " $LETSENCRYPTPATH /" -name " $SUBDOMAIN *" ) "
132
- for remove in $REMOVE_OLD
133
- do rm -rf " $remove "
134
- done
135
- fi
136
- # Remove Apache2 config
137
- if [ -f " $SITES_AVAILABLE /$SUBDOMAIN .conf" ]
138
- then
139
- a2dissite " $SUBDOMAIN " .conf
140
- restart_webserver
141
- rm -f " $SITES_AVAILABLE /$SUBDOMAIN .conf"
142
- fi
143
- # Remove trusted domain
144
- remove_from_trusted_domains " $SUBDOMAIN "
39
+ # Removal
40
+ remove_onlyoffice_docker
145
41
fi
146
42
147
43
# Remove all office apps
0 commit comments