From 5fe67775bf3da9c23757ecd31284096c83e76bea Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Jan 2021 22:44:51 +0100 Subject: [PATCH 01/10] Finding an available port --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index a19f196..ff9ab9b 100644 --- a/scripts/install +++ b/scripts/install @@ -53,7 +53,7 @@ ynh_app_setting_set --app=$app --key=nextcloud_domain --value=$nextcloud_domain #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Finding an available port..." # Find a free port port=$(ynh_find_port --port=9980) From ca1b291b491a9428b6bb420ddc78e22031e1ea5c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Jan 2021 23:59:37 +0100 Subject: [PATCH 02/10] Fix installation and config handling ... --- conf/nginx.conf | 6 ++++++ manifest.json | 2 +- scripts/install | 31 +++++++++++++------------------ scripts/restore | 2 +- scripts/upgrade | 14 ++------------ 5 files changed, 23 insertions(+), 32 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 2fecb65..30217dd 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,3 +1,9 @@ +rewrite ^$ /; +location ~ ^/$ { + default_type text/plain; + return 200 "This is where Collabora Online is installed. To actually be useful, this needs to be integrated in a front-end such as Nextcloud for example."; +} + # static files location ^~ /loleaflet { proxy_pass http://localhost:__PORT__; diff --git a/manifest.json b/manifest.json index e4f2b19..3faac8c 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "rafi59_dev@srvmaison.fr.nf" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.4.4" }, "multi_instance": false, "services": [ diff --git a/scripts/install b/scripts/install index ff9ab9b..3478e2a 100644 --- a/scripts/install +++ b/scripts/install @@ -60,6 +60,17 @@ port=$(ynh_find_port --port=9980) ynh_app_setting_set --app=$app --key=port --value=$port +#================================================= +# CONFIGURE ONLYOFFICE +#================================================= + +# Turns out we need to create/copy this file BEFORE the actual .deb install, +# otherwise stupid collabora will expect to find a certificate file in its own +# config directory which of course doesn't exists and we want to disable SSL +# because we're in a reverse proxy context... +mkdir -p /etc/loolwsd +ynh_add_config ../conf/loolwsd.xml /etc/loolwsd/loolwsd.xml + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -79,23 +90,6 @@ ynh_add_nginx_config #================================================= # SPECIFIC SETUP #================================================= -# MODIFY A CONFIG FILE -#================================================= - -config="/etc/loolwsd/loolwsd.xml" - -cp -f ../conf/loolwsd.xml $config - -ynh_replace_string --match_string="__NEXTCLOUD_DOMAIN__" --replace_string="$nextcloud_domain" --target_file="$config" -ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$config" - -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= - -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum "/etc/loolwsd/loolwsd.xml" - #================================================= # GENERIC FINALIZATION #================================================= @@ -104,7 +98,8 @@ ynh_store_file_checksum "/etc/loolwsd/loolwsd.xml" ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name="loolwsd" --action="start" --log_path="systemd" --line_match="Started LibreOffice Online WebSocket Daemon" +# NB. : we need a stupid *re*start because the service is in fact already started during the damn package install ... so it won't find a recent "Ready to accept connection" match ... +ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 045bc9b..5078f9f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,7 +68,7 @@ ynh_restore_file --origin_path="/etc/loolwsd/loolwsd.xml" #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Started LibreOffice Online WebSocket Daemon" +ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 3bad87d..e755dff 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,17 +89,7 @@ ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos # UPGRADE CONFIG #================================================= -config="/etc/loolwsd/loolwsd.xml" - -ynh_backup_if_checksum_is_different --file="$config" - -cp -f ../conf/loolwsd.xml $config - -ynh_replace_string "__NEXTCLOUD_DOMAIN__" "$nextcloud_domain" "$config" -ynh_replace_string "__PASSWORD__" "$password" "$config" - -# Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$config" +ynh_add_config "../conf/loolwsd.xml" "/etc/loolwsd/loolwsd.xml" #================================================= # GENERIC FINALIZATION @@ -117,7 +107,7 @@ ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Started LibreOffice Online WebSocket Daemon" +ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections" #================================================= # RELOAD NGINX From 893aa1bf1297e950818803fbda0f8638e93742ca Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 10 Jan 2021 02:11:51 +0100 Subject: [PATCH 03/10] Fix version requirement --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 3faac8c..f0ba25a 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "rafi59_dev@srvmaison.fr.nf" }, "requirements": { - "yunohost": ">= 4.1.4.4" + "yunohost": ">= 4.1.4.3" }, "multi_instance": false, "services": [ From 88f6682a4e559ca43468b04a42430e551a7c6160 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 3 Feb 2021 22:39:15 +0100 Subject: [PATCH 04/10] Update loolwsd.xml --- conf/loolwsd.xml | 111 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 96 insertions(+), 15 deletions(-) diff --git a/conf/loolwsd.xml b/conf/loolwsd.xml index d1c74b1..916a0a6 100644 --- a/conf/loolwsd.xml +++ b/conf/loolwsd.xml @@ -3,27 +3,41 @@ - - - - + de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru - + + + + + - + 1 4 + 5 + + false 3600 - 30 - 300 - 0 - 0 + + 30 + 300 + false + 0 8000 0 0 + 100 + 100 + + 10000 + 60 + 300 + 3072 + 85 + @@ -36,7 +50,12 @@ true warning + false + + -INFO-WARN + /var/log/loolwsd.log never timestamp @@ -46,12 +65,16 @@ true false + + false + 82589933 + false - /tmp/looltrace-%.gz + @@ -60,12 +83,33 @@ + + + all + any + + + + 192\.168\.[0-9]{1,3}\.[0-9]{1,3} + ::ffff:192\.168\.[0-9]{1,3}\.[0-9]{1,3} + 127\.0\.0\.1 + ::ffff:127\.0\.0\.1 + ::1 + 172\.17\.[0-9]{1,3}\.[0-9]{1,3} + ::ffff:172\.17\.[0-9]{1,3}\.[0-9]{1,3} + + + + + - false - true + true + false /etc/loolwsd/cert.pem /etc/loolwsd/key.pem /etc/loolwsd/ca-chain.cert.pem + 1000 @@ -75,6 +119,26 @@ + + true + true + + + + + + + + + true + false + + + + + classic + + @@ -86,17 +150,34 @@ 192\.168\.[0-9]{1,3}\.[0-9]{1,3} 192\.168\.1\.1 0 + false + + 900 + __NEXTCLOUD_DOMAIN__ + + true + + + + + + true - admin - __PASSWORD__ + true + false + admin + __PASSWORD__ + + + From d9f1dd6ef62b3a290215a04631eef0a821f165cc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 4 Feb 2021 09:04:11 +0100 Subject: [PATCH 05/10] Update loolwsd.xml --- conf/loolwsd.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/loolwsd.xml b/conf/loolwsd.xml index 916a0a6..06b91b5 100644 --- a/conf/loolwsd.xml +++ b/conf/loolwsd.xml @@ -104,7 +104,7 @@ - true + false false /etc/loolwsd/cert.pem /etc/loolwsd/key.pem From f5094e9c36095e5c3e50f7e474bd8c3e783b7389 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 4 Feb 2021 12:36:52 +0100 Subject: [PATCH 06/10] Update version --- README.md | 2 +- manifest.json | 2 +- pull_request_template.md | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 83adeac..ecae06a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [Collabora](https://www.collaboraoffice.com/code/) is an online office suite usable with Nextcloud. -**Shipped version:** 4.0.0 RC2 +**Shipped version:** 6.4.0 ## Screenshots diff --git a/manifest.json b/manifest.json index f0ba25a..c813759 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "LibreOffice-based online office suite with collaborative editing", "fr": "Suite office en ligne et collaborative, basée sur LibreOffice" }, - "version": "4.0.0~ynh2", + "version": "6.4.0~ynh1", "url": "https://collaboraoffice.com", "license": "MPL-2.0", "maintainer": { diff --git a/pull_request_template.md b/pull_request_template.md index f6155d6..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/collabora_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/collabora_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* From 69e2ac84b0454a5159187d1f65f1d51a498622df Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 4 Feb 2021 12:44:49 +0100 Subject: [PATCH 07/10] Add permissions --- scripts/install | 10 +++++++--- scripts/remove | 11 +++++++++++ scripts/restore | 7 +++++++ scripts/upgrade | 14 +++++++++----- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 3478e2a..2ee8492 100644 --- a/scripts/install +++ b/scripts/install @@ -88,8 +88,12 @@ ynh_script_progression --message="Configuring NGINX web server..." ynh_add_nginx_config #================================================= -# SPECIFIC SETUP +# INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + +yunohost service add $app --description="LibreOffice-based online office suite" --log="/var/log/$app/$app.log" + #================================================= # GENERIC FINALIZATION #================================================= @@ -104,11 +108,11 @@ ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="syste #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." # Make app public # unprotected_uris allows SSO credentials to be passed anyway. -ynh_app_setting_set $app unprotected_uris "/" +ynh_permission_update --permission="main" --add="visitors" --show_tile="false" #================================================= # RELOAD NGINX diff --git a/scripts/remove b/scripts/remove index ecd3650..66c8507 100644 --- a/scripts/remove +++ b/scripts/remove @@ -21,6 +21,17 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # STANDARD REMOVE +#================================================= +# REMOVE SERVICE INTEGRATION IN YUNOHOST +#================================================= + +# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) +if ynh_exec_warn_less yunohost service status $app >/dev/null +then + ynh_script_progression --message="Removing $app service integration..." + yunohost service remove $app +fi + #================================================= # REMOVE DEPENDENCIES #================================================= diff --git a/scripts/restore b/scripts/restore index 5078f9f..55ed06f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -63,6 +63,13 @@ ynh_script_progression --message="Restoring the configuration..." ynh_restore_file --origin_path="/etc/loolwsd/loolwsd.xml" +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + +yunohost service add $app --description="LibreOffice-based online office suite" --log="/var/log/$app/$app.log" + #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e755dff..e658ae3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -42,6 +42,12 @@ if [ -z "$path_url" ]; then ynh_app_setting_set --app=$app --key=path_url --value=$path_url fi +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -94,13 +100,11 @@ ynh_add_config "../conf/loolwsd.xml" "/etc/loolwsd/loolwsd.xml" #================================================= # GENERIC FINALIZATION #================================================= -# SETUP SSOWAT +# INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." +ynh_script_progression --message="Integrating service in YunoHost..." -# Make app public -# unprotected_uris allows SSO credentials to be passed anyway -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" +yunohost service add $app --description="LibreOffice-based online office suite" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE From 2c20bff1a3c2de4acff2aeaa84d9d1317af57ea5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 4 Feb 2021 12:52:42 +0100 Subject: [PATCH 08/10] Fix --- scripts/install | 7 ------- scripts/remove | 11 ----------- scripts/restore | 7 ------- scripts/upgrade | 7 ------- 4 files changed, 32 deletions(-) diff --git a/scripts/install b/scripts/install index 2ee8492..8f75917 100644 --- a/scripts/install +++ b/scripts/install @@ -87,13 +87,6 @@ ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --description="LibreOffice-based online office suite" --log="/var/log/$app/$app.log" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/remove b/scripts/remove index 66c8507..ecd3650 100644 --- a/scripts/remove +++ b/scripts/remove @@ -21,17 +21,6 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST -#================================================= - -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." - yunohost service remove $app -fi - #================================================= # REMOVE DEPENDENCIES #================================================= diff --git a/scripts/restore b/scripts/restore index 55ed06f..5078f9f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -63,13 +63,6 @@ ynh_script_progression --message="Restoring the configuration..." ynh_restore_file --origin_path="/etc/loolwsd/loolwsd.xml" -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --description="LibreOffice-based online office suite" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e658ae3..d2a5fe4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,13 +99,6 @@ ynh_add_config "../conf/loolwsd.xml" "/etc/loolwsd/loolwsd.xml" #================================================= # GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --description="LibreOffice-based online office suite" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= From eb38c3ba55ac8ce22793342ac66730d35a6830dd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 4 Feb 2021 13:00:32 +0100 Subject: [PATCH 09/10] Fix version --- README.md | 2 +- manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ecae06a..2b43238 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [Collabora](https://www.collaboraoffice.com/code/) is an online office suite usable with Nextcloud. -**Shipped version:** 6.4.0 +**Shipped version:** 6.4.4 ## Screenshots diff --git a/manifest.json b/manifest.json index c813759..937b0fc 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "LibreOffice-based online office suite with collaborative editing", "fr": "Suite office en ligne et collaborative, basée sur LibreOffice" }, - "version": "6.4.0~ynh1", + "version": "6.4.4~ynh1", "url": "https://collaboraoffice.com", "license": "MPL-2.0", "maintainer": { From 2701da0d67f93da82eb08364b50e089cac32fbed Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 6 Feb 2021 19:28:55 +0100 Subject: [PATCH 10/10] Update loolwsd.xml --- conf/loolwsd.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/loolwsd.xml b/conf/loolwsd.xml index 06b91b5..ddd1a43 100644 --- a/conf/loolwsd.xml +++ b/conf/loolwsd.xml @@ -74,7 +74,7 @@ false - + /tmp/looltrace-%.gz @@ -105,7 +105,7 @@ false - false + true /etc/loolwsd/cert.pem /etc/loolwsd/key.pem /etc/loolwsd/ca-chain.cert.pem