From 27784107f0a4acea35e4ca5f434a65da9c9be03e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 19 Nov 2021 15:32:50 +0100 Subject: [PATCH 01/40] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 9696c87..352e27e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Create and edit documents collaboratively", "fr": "Créez et éditer des documents collaborativement" }, - "version": "6.4.0~ynh2", + "version": "6.4.2~ynh1", "url": "https://www.onlyoffice.com", "upstream": { "license": "GPL-3.0-or-later", From 74da7d9ae586e7b73a290a946aebae6ea5f82f64 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 19 Nov 2021 14:32:56 +0000 Subject: [PATCH 02/40] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fbac6bb..1789e1f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Create and edit documents collaboratively -**Shipped version:** 6.4.0~ynh2 +**Shipped version:** 6.4.2~ynh1 **Demo:** https://www.onlyoffice.com/fr/download-desktop.aspx diff --git a/README_fr.md b/README_fr.md index 2fddf3d..fc821be 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Créez et éditer des documents collaborativement -**Version incluse :** 6.4.0~ynh2 +**Version incluse :** 6.4.2~ynh1 **Démo :** https://www.onlyoffice.com/fr/download-desktop.aspx From 7d54bfd1010c57b9278e4d057dc2a41292ad1221 Mon Sep 17 00:00:00 2001 From: Gredin 67 Date: Wed, 15 Dec 2021 02:57:11 +0100 Subject: [PATCH 03/40] secure files --- scripts/install | 11 +++++++++++ scripts/restore | 11 +++++++++++ scripts/upgrade | 9 +++++++++ 3 files changed, 31 insertions(+) diff --git a/scripts/install b/scripts/install index a70a476..282d912 100644 --- a/scripts/install +++ b/scripts/install @@ -151,6 +151,17 @@ ynh_script_progression --message="Storing the config file checksum..." # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="/etc/onlyoffice/documentserver/default.json" +#================================================= +# GENERIC FINALIZATION +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # RELOAD ONLYOFFICE #================================================= diff --git a/scripts/restore b/scripts/restore index 9d78ad9..81e9757 100644 --- a/scripts/restore +++ b/scripts/restore @@ -117,6 +117,17 @@ ynh_script_progression --message="Generating fonts..." /usr/bin/documentserver-generate-allfonts.sh +#================================================= +# GENERIC FINALIZATION +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # RELOAD ONLYOFFICE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 819d017..b92df34 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -153,6 +153,15 @@ ynh_script_progression --message="Generating fonts..." #================================================= # GENERIC FINALIZATION +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # RELOAD ONLYOFFICE #================================================= From e178f292e2d546e1cc4852385f93177f68696d80 Mon Sep 17 00:00:00 2001 From: Gredin 67 Date: Wed, 15 Dec 2021 02:57:32 +0100 Subject: [PATCH 04/40] actually upgrade only office --- scripts/_common.sh | 1 + scripts/install | 26 +++++++++++++------------- scripts/restore | 14 +++++++------- scripts/upgrade | 22 +++++++++++++++------- 4 files changed, 36 insertions(+), 27 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 58ae541..710740d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,6 +6,7 @@ # dependencies used by the app pkg_dependencies="postgresql postgresql-contrib libstdc++6 rabbitmq-server libcurl4-dev" +extra_dependencies="onlyoffice-documentserver>=6.4.2" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 282d912..9132f90 100644 --- a/scripts/install +++ b/scripts/install @@ -80,6 +80,17 @@ ynh_script_progression --message="Add OnlyOffice repository..." apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append +#================================================= +# INSTALL ONLYOFFICE +#================================================= +ynh_script_progression --message="Install OnlyOffice..." + +# The onlyoffice dev had the magnificent idea to add a "nginx restart" during +# the install/configure of their package, which is awful since that will +# restart nginx and the whole webadmin and maybe even the yunohost command +# running the install ... +ynh_exec_warn_less ynh_add_app_dependencies --package=$extra_dependencies + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -87,6 +98,8 @@ ynh_script_progression --message="Installing dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +# ynh_install_extra_app_dependencies --repo="https://updates.signald.org unstable main" --package="$extra_dependencies" --key="https://updates.signald.org/apt-signing-key.asc" + #================================================= # CREATE A POSTGRESQL DATABASE #================================================= @@ -125,17 +138,6 @@ echo onlyoffice-documentserver onlyoffice/db-user string $db_user | debconf-set- echo onlyoffice-documentserver onlyoffice/db-pwd password $db_pwd | debconf-set-selections echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-selections -#================================================= -# INSTALL ONLYOFFICE -#================================================= -ynh_script_progression --message="Install OnlyOffice..." - -# The onlyoffice dev had the magnificent idea to add a "nginx restart" during -# the install/configure of their package, which is awful since that will -# restart nginx and the whole webadmin and maybe even the yunohost command -# running the install ... -ynh_exec_warn_less ynh_add_app_dependencies --package="onlyoffice-documentserver" - #================================================= # MODIFY A CONFIG FILE #================================================= @@ -178,8 +180,6 @@ ynh_script_progression --message="Generating fonts..." /usr/bin/documentserver-generate-allfonts.sh -#================================================= -# GENERIC FINALIZATION #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/restore b/scripts/restore index 81e9757..57646ff 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,6 +68,13 @@ ynh_script_progression --message="Add OnlyOffice repository..." apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append +#================================================= +# REINSTALL ONLYOFFICE +#================================================= +ynh_script_progression --message="Reinstalling OnlyOffice..." + +ynh_exec_warn_less ynh_add_app_dependencies --package=$extra_dependencies + #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -96,13 +103,6 @@ echo onlyoffice-documentserver onlyoffice/db-user string $db_user | debconf-set- echo onlyoffice-documentserver onlyoffice/db-pwd password $db_pwd | debconf-set-selections echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-selections -#================================================= -# REINSTALL ONLYOFFICE -#================================================= -ynh_script_progression --message="Reinstalling OnlyOffice..." - -ynh_exec_warn_less ynh_add_app_dependencies --package="onlyoffice-documentserver" - #================================================= # RESTORE THE CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b92df34..2a95c80 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -113,6 +113,21 @@ ynh_script_progression --message="Add OnlyOffice repository..." apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append +#================================================= +# UPGRADE ONLYOFFICE +#================================================= +ynh_script_progression --message="Upgrading OnlyOffice..." + +# ynh_remove_app_dependencies +ynh_exec_warn_less ynh_add_app_dependencies --package=$extra_dependencies + +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." + +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies + #================================================= # CONFIGURE ONLYOFFICE #================================================= @@ -125,13 +140,6 @@ echo onlyoffice-documentserver onlyoffice/db-user string $db_user | debconf-set- echo onlyoffice-documentserver onlyoffice/db-pwd password $db_pwd | debconf-set-selections echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-selections -#================================================= -# UPGRADE ONLYOFFICE -#================================================= -ynh_script_progression --message="Upgrading OnlyOffice..." - -ynh_exec_warn_less ynh_add_app_dependencies --package="onlyoffice-documentserver" - #================================================= # MODIFY A CONFIG FILE #================================================= From 6dededde98b7324d62fa85f4052ed80ed93b652b Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Wed, 15 Dec 2021 12:27:04 +0100 Subject: [PATCH 05/40] ynh_install_app_dependencies $extra_dependencies --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9132f90..660d926 100644 --- a/scripts/install +++ b/scripts/install @@ -89,14 +89,14 @@ ynh_script_progression --message="Install OnlyOffice..." # the install/configure of their package, which is awful since that will # restart nginx and the whole webadmin and maybe even the yunohost command # running the install ... -ynh_exec_warn_less ynh_add_app_dependencies --package=$extra_dependencies +#ynh_exec_warn_less ynh_add_app_dependencies --package=$extra_dependencies #================================================= # INSTALL DEPENDENCIES #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies $extra_dependencies" # ynh_install_extra_app_dependencies --repo="https://updates.signald.org unstable main" --package="$extra_dependencies" --key="https://updates.signald.org/apt-signing-key.asc" From e3bf8f571ba4b62a0cbc31894a07db8a33156c1a Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Wed, 22 Dec 2021 21:57:03 +0100 Subject: [PATCH 06/40] use ynh_install_extra_app_dependencies --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 660d926..40f8def 100644 --- a/scripts/install +++ b/scripts/install @@ -78,7 +78,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Add OnlyOffice repository..." apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append +#ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append #================================================= # INSTALL ONLYOFFICE @@ -96,9 +96,9 @@ ynh_script_progression --message="Install OnlyOffice..." #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies $extra_dependencies" +ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" -# ynh_install_extra_app_dependencies --repo="https://updates.signald.org unstable main" --package="$extra_dependencies" --key="https://updates.signald.org/apt-signing-key.asc" +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package="$extra_dependencies" #================================================= # CREATE A POSTGRESQL DATABASE From d16459d86cca628dd5ab23a0c51cb723348881c6 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Wed, 22 Dec 2021 21:58:07 +0100 Subject: [PATCH 07/40] =6.4.2 --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 710740d..7a6d1b0 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ # dependencies used by the app pkg_dependencies="postgresql postgresql-contrib libstdc++6 rabbitmq-server libcurl4-dev" -extra_dependencies="onlyoffice-documentserver>=6.4.2" +extra_dependencies="onlyoffice-documentserver=6.4.2" #================================================= # PERSONAL HELPERS From 60c53a37eb2e1b3126b144564f2aaed59d316feb Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Wed, 22 Dec 2021 22:07:36 +0100 Subject: [PATCH 08/40] remove and ynh_install_extra_app_dependencies --- scripts/upgrade | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 2a95c80..d743010 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,7 +111,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Add OnlyOffice repository..." apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append +#ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append #================================================= # UPGRADE ONLYOFFICE @@ -119,14 +119,8 @@ ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian sq ynh_script_progression --message="Upgrading OnlyOffice..." # ynh_remove_app_dependencies -ynh_exec_warn_less ynh_add_app_dependencies --package=$extra_dependencies - -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." - -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_package_remove onlyoffice-documentserver +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package="$extra_dependencies" #================================================= # CONFIGURE ONLYOFFICE From 5d151010683eb8e67cf6c046930b9e7364e33e29 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Thu, 23 Dec 2021 01:16:59 +0100 Subject: [PATCH 09/40] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 40f8def..23eec97 100644 --- a/scripts/install +++ b/scripts/install @@ -96,9 +96,9 @@ ynh_script_progression --message="Install OnlyOffice..." #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies -ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package="$extra_dependencies" +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies #================================================= # CREATE A POSTGRESQL DATABASE From c5d20a468962bf505795ba562f8c199372ce557a Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 28 Dec 2021 15:48:30 +0100 Subject: [PATCH 10/40] remove and reinstall $extra_dependencies --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index d743010..b299abc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -119,8 +119,8 @@ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 ynh_script_progression --message="Upgrading OnlyOffice..." # ynh_remove_app_dependencies -ynh_package_remove onlyoffice-documentserver -ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package="$extra_dependencies" +ynh_package_remove $extra_dependencies +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies #================================================= # CONFIGURE ONLYOFFICE From af27449a27fd255fc37d3d5f2c883626b2a9e59d Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 28 Dec 2021 15:49:08 +0100 Subject: [PATCH 11/40] no version spec --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 7a6d1b0..11faf8f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ # dependencies used by the app pkg_dependencies="postgresql postgresql-contrib libstdc++6 rabbitmq-server libcurl4-dev" -extra_dependencies="onlyoffice-documentserver=6.4.2" +extra_dependencies="onlyoffice-documentserver" #================================================= # PERSONAL HELPERS From 1138fc524df6595b2d8667eb23b0100ac3d6e7ce Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Thu, 30 Dec 2021 12:44:26 +0100 Subject: [PATCH 12/40] setup postgre before onlyoffice --- scripts/install | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/scripts/install b/scripts/install index 23eec97..129b3ca 100644 --- a/scripts/install +++ b/scripts/install @@ -72,25 +72,6 @@ ynh_script_progression --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app -#================================================= -# ADD ONLYOFFICE REPOSITORY -#================================================= -ynh_script_progression --message="Add OnlyOffice repository..." - -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -#ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append - -#================================================= -# INSTALL ONLYOFFICE -#================================================= -ynh_script_progression --message="Install OnlyOffice..." - -# The onlyoffice dev had the magnificent idea to add a "nginx restart" during -# the install/configure of their package, which is awful since that will -# restart nginx and the whole webadmin and maybe even the yunohost command -# running the install ... -#ynh_exec_warn_less ynh_add_app_dependencies --package=$extra_dependencies - #================================================= # INSTALL DEPENDENCIES #================================================= @@ -98,8 +79,6 @@ ynh_script_progression --message="Installing dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies -ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies - #================================================= # CREATE A POSTGRESQL DATABASE #================================================= @@ -111,6 +90,20 @@ ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_name --db_name=$db_name +#================================================= +# INSTALL ONLYOFFICE +#================================================= +ynh_script_progression --message="Install OnlyOffice..." + +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 + +# The onlyoffice dev had the magnificent idea to add a "nginx restart" during +# the install/configure of their package, which is awful since that will +# restart nginx and the whole webadmin and maybe even the yunohost command +# running the install ... + +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies + #================================================= # NGINX CONFIGURATION #================================================= From 94ef82af9870c025e6dde9282738d92abcbb5feb Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Sun, 2 Jan 2022 23:22:13 +0100 Subject: [PATCH 13/40] install after nginx and config --- scripts/install | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/install b/scripts/install index 129b3ca..2fdfcef 100644 --- a/scripts/install +++ b/scripts/install @@ -90,20 +90,6 @@ ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_name --db_name=$db_name -#================================================= -# INSTALL ONLYOFFICE -#================================================= -ynh_script_progression --message="Install OnlyOffice..." - -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 - -# The onlyoffice dev had the magnificent idea to add a "nginx restart" during -# the install/configure of their package, which is awful since that will -# restart nginx and the whole webadmin and maybe even the yunohost command -# running the install ... - -ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies - #================================================= # NGINX CONFIGURATION #================================================= @@ -131,6 +117,20 @@ echo onlyoffice-documentserver onlyoffice/db-user string $db_user | debconf-set- echo onlyoffice-documentserver onlyoffice/db-pwd password $db_pwd | debconf-set-selections echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-selections +#================================================= +# INSTALL ONLYOFFICE +#================================================= +ynh_script_progression --message="Install OnlyOffice..." + +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 + +# The onlyoffice dev had the magnificent idea to add a "nginx restart" during +# the install/configure of their package, which is awful since that will +# restart nginx and the whole webadmin and maybe even the yunohost command +# running the install ... + +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies + #================================================= # MODIFY A CONFIG FILE #================================================= From f920933870624ae98ae9abebd6f07390a1c2ac0c Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Mon, 3 Jan 2022 11:07:38 +0100 Subject: [PATCH 14/40] Update restore --- scripts/restore | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/scripts/restore b/scripts/restore index 57646ff..597af3e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -58,23 +58,6 @@ ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) ynh_system_user_create --username=$app -#================================================= -# SPECIFIC RESTORATION -#================================================= -# ADD ONLYOFFICE REPOSITORY -#================================================= -ynh_script_progression --message="Add OnlyOffice repository..." - -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append - -#================================================= -# REINSTALL ONLYOFFICE -#================================================= -ynh_script_progression --message="Reinstalling OnlyOffice..." - -ynh_exec_warn_less ynh_add_app_dependencies --package=$extra_dependencies - #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -83,6 +66,8 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#================================================= +# SPECIFIC RESTORATION #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= @@ -103,6 +88,15 @@ echo onlyoffice-documentserver onlyoffice/db-user string $db_user | debconf-set- echo onlyoffice-documentserver onlyoffice/db-pwd password $db_pwd | debconf-set-selections echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-selections +#================================================= +# REINSTALL ONLYOFFICE +#================================================= +ynh_script_progression --message="Reinstalling OnlyOffice..." + +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 + +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies + #================================================= # RESTORE THE CONFIGURATION #================================================= From 18e5695c7bd14f71299f9999e29bbcd7a2a9f174 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Mon, 3 Jan 2022 11:26:02 +0100 Subject: [PATCH 15/40] Update remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index bb57f83..82f2dc5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -55,7 +55,7 @@ ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies -ynh_remove_extra_repo +#ynh_remove_extra_repo dpkg --configure -a From 8e9561753e84ebfc8d28a4befbb8b38ac3c77999 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Mon, 3 Jan 2022 11:26:15 +0100 Subject: [PATCH 16/40] Update upgrade --- scripts/upgrade | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b299abc..b72a0f7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -80,6 +80,13 @@ ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." + +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -96,44 +103,32 @@ fi # Create a dedicated nginx config ynh_add_nginx_config "nextclouddomain" -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." - -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies - #================================================= # SPECIFIC UPGRADE #================================================= -# ADD ONLYOFFICE REPOSITORY +# CONFIGURE ONLYOFFICE #================================================= -ynh_script_progression --message="Add OnlyOffice repository..." +ynh_script_progression --message="Configuring OnlyOffice..." -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -#ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append +ynh_backup_if_checksum_is_different --file="/etc/onlyoffice/documentserver/default.json" +echo onlyoffice-documentserver onlyoffice/ds-port select $port | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/db-host string 127.0.0.1 | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/db-user string $db_user | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/db-pwd password $db_pwd | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-selections #================================================= # UPGRADE ONLYOFFICE #================================================= ynh_script_progression --message="Upgrading OnlyOffice..." +ynh_remove_extra_repo # backward compat +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 + # ynh_remove_app_dependencies ynh_package_remove $extra_dependencies ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies -#================================================= -# CONFIGURE ONLYOFFICE -#================================================= -ynh_script_progression --message="Configuring OnlyOffice..." - -ynh_backup_if_checksum_is_different --file="/etc/onlyoffice/documentserver/default.json" -echo onlyoffice-documentserver onlyoffice/ds-port select $port | debconf-set-selections -echo onlyoffice-documentserver onlyoffice/db-host string 127.0.0.1 | debconf-set-selections -echo onlyoffice-documentserver onlyoffice/db-user string $db_user | debconf-set-selections -echo onlyoffice-documentserver onlyoffice/db-pwd password $db_pwd | debconf-set-selections -echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-selections - #================================================= # MODIFY A CONFIG FILE #================================================= From 2afd5dc77004ba6d485ba10e75b0f6c07a91ad22 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sat, 8 Jan 2022 00:41:44 +0100 Subject: [PATCH 17/40] [fix] Remove temporary workaround --- scripts/upgrade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b72a0f7..17c3910 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -122,11 +122,10 @@ echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set- #================================================= ynh_script_progression --message="Upgrading OnlyOffice..." -ynh_remove_extra_repo # backward compat +ynh_remove_extra_repo --name="$app" # backward compat apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 # ynh_remove_app_dependencies -ynh_package_remove $extra_dependencies ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies #================================================= From 840cb9feb45a91247dd7fb8e08cac415097d5d5b Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Tue, 8 Mar 2022 23:38:00 +0100 Subject: [PATCH 18/40] [fix] Missing cache (#69) * [fix] Missing cache Co-authored-by: Gredin67 --- scripts/backup | 1 + scripts/restore | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/scripts/backup b/scripts/backup index 48daceb..be60c30 100644 --- a/scripts/backup +++ b/scripts/backup @@ -52,6 +52,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_backup --src_path="/etc/onlyoffice" +ynh_backup --src_path="/var/lib/onlyoffice/documentserver/App_Data/cache/files" #================================================= # BACKUP THE POSTGRESQL DATABASE diff --git a/scripts/restore b/scripts/restore index 597af3e..28795e1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -104,6 +104,11 @@ ynh_script_progression --message="Restoring the configuration..." ynh_restore_file --origin_path="/etc/onlyoffice" +#================================================= +# RESTORE THE CACHE +#================================================= +ynh_restore_file --origin_path="/var/lib/onlyoffice/documentserver/App_Data/cache/files" + #================================================= # REGENERATE FONTS #================================================= From 690367fcdb072bbff451f57f1b31975edf409d31 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Fri, 18 Mar 2022 01:22:37 +0100 Subject: [PATCH 19/40] [fix] Cache could be unexistant if not used --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index be60c30..9ca3edc 100644 --- a/scripts/backup +++ b/scripts/backup @@ -52,7 +52,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_backup --src_path="/etc/onlyoffice" -ynh_backup --src_path="/var/lib/onlyoffice/documentserver/App_Data/cache/files" +ynh_backup --src_path="/var/lib/onlyoffice/documentserver/App_Data/cache/files" --not_mandatory #================================================= # BACKUP THE POSTGRESQL DATABASE From a6f07afb4360f9554b5fc6e24fdbf4de0dc5c315 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Thu, 31 Mar 2022 17:14:55 +0200 Subject: [PATCH 20/40] [fix] permission --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 2fdfcef..e6956e2 100644 --- a/scripts/install +++ b/scripts/install @@ -155,7 +155,7 @@ ynh_store_file_checksum --file="/etc/onlyoffice/documentserver/default.json" # Set permissions to app files chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chown -R ds:ds "$final_path" #================================================= # RELOAD ONLYOFFICE From 8d28bce4324ee6ba76ae6cbe481ef35d6eaa6aec Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Thu, 31 Mar 2022 17:15:31 +0200 Subject: [PATCH 21/40] [fix] Permission --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 28795e1..d31dfe2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -125,7 +125,7 @@ ynh_script_progression --message="Generating fonts..." # Set permissions to app files chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chown -R ds:ds "$final_path" #================================================= # RELOAD ONLYOFFICE From b4820f3eee6243b491b1e1662a63c791ac9a8d0a Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Thu, 31 Mar 2022 17:15:56 +0200 Subject: [PATCH 22/40] [fix] Permission --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 17c3910..b694eeb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -156,7 +156,7 @@ ynh_script_progression --message="Generating fonts..." # Set permissions to app files chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chown -R ds:ds "$final_path" #================================================= # RELOAD ONLYOFFICE From 786ce573021881ddc387db7d6a8478dd46ca3328 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 14:08:31 +0200 Subject: [PATCH 23/40] Silence warnings --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index e6956e2..9e79847 100644 --- a/scripts/install +++ b/scripts/install @@ -129,7 +129,7 @@ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 # restart nginx and the whole webadmin and maybe even the yunohost command # running the install ... -ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies #================================================= # MODIFY A CONFIG FILE From 1b46fa631609c46fd7c677efca3e637d670e1425 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 14:15:03 +0200 Subject: [PATCH 24/40] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 352e27e..e9e2c88 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Create and edit documents collaboratively", "fr": "Créez et éditer des documents collaborativement" }, - "version": "6.4.2~ynh1", + "version": "7.1.0~ynh1", "url": "https://www.onlyoffice.com", "upstream": { "license": "GPL-3.0-or-later", @@ -20,7 +20,7 @@ "email": "liberodark@gmail.com" }, "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ From 56e55d0b5b4b17e6d32562fb58130c7ea3f31743 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 20 May 2022 12:15:09 +0000 Subject: [PATCH 25/40] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1789e1f..956aab3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Create and edit documents collaboratively -**Shipped version:** 6.4.2~ynh1 +**Shipped version:** 7.1.0~ynh1 **Demo:** https://www.onlyoffice.com/fr/download-desktop.aspx diff --git a/README_fr.md b/README_fr.md index fc821be..e66234a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Créez et éditer des documents collaborativement -**Version incluse :** 6.4.2~ynh1 +**Version incluse :** 7.1.0~ynh1 **Démo :** https://www.onlyoffice.com/fr/download-desktop.aspx From 671def2cbac67b76fc6ece0df26995a97bb81d05 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 14:16:32 +0200 Subject: [PATCH 26/40] Fix --- scripts/backup | 2 +- scripts/change_url | 2 +- scripts/install | 2 +- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/backup b/scripts/backup index 9ca3edc..aa0bf53 100644 --- a/scripts/backup +++ b/scripts/backup @@ -65,4 +65,4 @@ ynh_psql_dump_db --database="$db_name" > db.sql # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for OnlyOffice. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index d1742a8..3371f26 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -114,4 +114,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for OnlyOffice" +ynh_script_progression --message="Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 9e79847..bef44b3 100644 --- a/scripts/install +++ b/scripts/install @@ -195,4 +195,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of OnlyOffice completed" +ynh_script_progression --message="Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 82f2dc5..aaf7cab 100644 --- a/scripts/remove +++ b/scripts/remove @@ -107,4 +107,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of OnlyOffice completed" +ynh_script_progression --message="Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index d31dfe2..6769bc0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -149,4 +149,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for OnlyOffice" +ynh_script_progression --message="Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index b694eeb..c227292 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -178,4 +178,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of OnlyOffice completed" +ynh_script_progression --message="Upgrade of $app completed" From 4a6687be4bb020a2b5226614d61428d3fe79631a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 14:18:04 +0200 Subject: [PATCH 27/40] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index bef44b3..1fa9aeb 100644 --- a/scripts/install +++ b/scripts/install @@ -88,7 +88,7 @@ db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_name --db_name=$db_name +ynh_psql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # NGINX CONFIGURATION From 9169bbdfdd48978849050376fde7a5c82b3c4fd6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 14:28:23 +0200 Subject: [PATCH 28/40] Fix --- scripts/install | 2 +- scripts/remove | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 1fa9aeb..8387958 100644 --- a/scripts/install +++ b/scripts/install @@ -129,7 +129,7 @@ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 # restart nginx and the whole webadmin and maybe even the yunohost command # running the install ... -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies 2>/dev/null #================================================= # MODIFY A CONFIG FILE diff --git a/scripts/remove b/scripts/remove index aaf7cab..2e897fe 100644 --- a/scripts/remove +++ b/scripts/remove @@ -55,7 +55,6 @@ ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies -#ynh_remove_extra_repo dpkg --configure -a From 30c0f03c7c83fa6a53aaf0d722d30bc8a07b479e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 14:43:16 +0200 Subject: [PATCH 29/40] Fix --- scripts/_common.sh | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 11faf8f..be1de98 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ # dependencies used by the app pkg_dependencies="postgresql postgresql-contrib libstdc++6 rabbitmq-server libcurl4-dev" -extra_dependencies="onlyoffice-documentserver" +extra_dependencies="onlyoffice-documentserver ttf-mscorefonts-installer" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 8387958..866c5fe 100644 --- a/scripts/install +++ b/scripts/install @@ -122,7 +122,7 @@ echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set- #================================================= ynh_script_progression --message="Install OnlyOffice..." -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 2>/dev/null # The onlyoffice dev had the magnificent idea to add a "nginx restart" during # the install/configure of their package, which is awful since that will From 9d2c558edf9ba32d214fba92378d39b038a0bb04 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 14:45:13 +0200 Subject: [PATCH 30/40] Update remove --- scripts/remove | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 2e897fe..b53a4ac 100644 --- a/scripts/remove +++ b/scripts/remove @@ -37,8 +37,8 @@ ynh_secure_remove --file=/var/lib/dpkg/info/onlyoffice-documentserver.prerm # already removed ... so their removal fails which breaks dpkg. # So instead, we trick it with this stupid link to /bin/true which is removed # right after. -ln -s /bin/true /usr/local/bin/supervisorctl -ynh_package_autopurge onlyoffice-documentserver +#ln -s /bin/true /usr/local/bin/supervisorctl +ynh_package_autopurge "onlyoffice-documentserver ttf-mscorefonts-installer" #================================================= # REMOVE THE POSTGRESQL DATABASE From d6f08bf225c0731401803797e644028257514408 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 14:46:01 +0200 Subject: [PATCH 31/40] Update remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index b53a4ac..aa85a24 100644 --- a/scripts/remove +++ b/scripts/remove @@ -58,7 +58,7 @@ ynh_remove_app_dependencies dpkg --configure -a -apt-key del "E09C A29F 6E17 8040 EF22 B409 8320 CA65 CB2D E8E5" +apt-key del "E09C A29F 6E17 8040 EF22 B409 8320 CA65 CB2D E8E5" 2>/dev/null #================================================= # REMOVE APP MAIN DIR From ce9e809ee3005a0981c7a9a8019ed708240dc722 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 14:48:00 +0200 Subject: [PATCH 32/40] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index be1de98..11faf8f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ # dependencies used by the app pkg_dependencies="postgresql postgresql-contrib libstdc++6 rabbitmq-server libcurl4-dev" -extra_dependencies="onlyoffice-documentserver ttf-mscorefonts-installer" +extra_dependencies="onlyoffice-documentserver" #================================================= # PERSONAL HELPERS From d71a4615bfbd91fa2f14daa7955befd28638ac33 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 15:00:38 +0200 Subject: [PATCH 33/40] Update remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index aa85a24..1a93505 100644 --- a/scripts/remove +++ b/scripts/remove @@ -38,7 +38,7 @@ ynh_secure_remove --file=/var/lib/dpkg/info/onlyoffice-documentserver.prerm # So instead, we trick it with this stupid link to /bin/true which is removed # right after. #ln -s /bin/true /usr/local/bin/supervisorctl -ynh_package_autopurge "onlyoffice-documentserver ttf-mscorefonts-installer" +ynh_package_autopurge "onlyoffice-documentserver" #================================================= # REMOVE THE POSTGRESQL DATABASE From 79b185501d563707da9dd3c9847f8fb10511d707 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 May 2022 15:04:16 +0200 Subject: [PATCH 34/40] Update remove --- scripts/remove | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 1a93505..4cced44 100644 --- a/scripts/remove +++ b/scripts/remove @@ -38,7 +38,7 @@ ynh_secure_remove --file=/var/lib/dpkg/info/onlyoffice-documentserver.prerm # So instead, we trick it with this stupid link to /bin/true which is removed # right after. #ln -s /bin/true /usr/local/bin/supervisorctl -ynh_package_autopurge "onlyoffice-documentserver" +ynh_package_autopurge onlyoffice-documentserver #================================================= # REMOVE THE POSTGRESQL DATABASE @@ -86,7 +86,6 @@ ynh_script_progression --message="Removing file..." # Remove a directory securely ynh_secure_remove --file="/etc/onlyoffice" ynh_secure_remove --file="/var/lib/onlyoffice" -#ynh_secure_remove --file="/var/cache/nginx/onlyoffice" # Remove the log files ynh_secure_remove --file="/var/log/$app" From 725d00056eaa9255eca6add8fc904a2ce801fe2c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 23 May 2022 12:05:15 +0200 Subject: [PATCH 35/40] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 11faf8f..be1de98 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ # dependencies used by the app pkg_dependencies="postgresql postgresql-contrib libstdc++6 rabbitmq-server libcurl4-dev" -extra_dependencies="onlyoffice-documentserver" +extra_dependencies="onlyoffice-documentserver ttf-mscorefonts-installer" #================================================= # PERSONAL HELPERS From ffd7e446db08b4daba0748478fa7b7d926bf128e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jul 2022 02:39:26 +0200 Subject: [PATCH 36/40] Apply example_ynh --- check_process | 3 ++- doc/.DS_Store | Bin 6148 -> 0 bytes doc/DESCRIPTION.md | 12 ++++++++++++ doc/DESCRIPTION_fr.md | 12 ++++++++++++ manifest.json | 24 ++++++++++++------------ scripts/backup | 10 +--------- scripts/change_url | 9 ++++++--- scripts/install | 35 +++++++++++++++-------------------- scripts/remove | 6 +++--- scripts/restore | 30 +++++++++++++++--------------- scripts/upgrade | 31 +++++++++++++++++++------------ 11 files changed, 97 insertions(+), 75 deletions(-) delete mode 100644 doc/.DS_Store create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md diff --git a/check_process b/check_process index db9d51a..11c5a19 100644 --- a/check_process +++ b/check_process @@ -2,8 +2,8 @@ ; Manifest domain="domain.tld" path="/path" - nextclouddomain="domain.tld" is_public=1 + nextclouddomain="domain.tld" ; Checks pkg_linter=1 setup_sub_dir=1 @@ -15,6 +15,7 @@ upgrade=1 from_commit=eca1121ff00c59325227163109d11c46bbff8e03 backup_restore=1 multi_instance=0 + port_already_use=0 change_url=1 ;;; Options Email= diff --git a/doc/.DS_Store b/doc/.DS_Store deleted file mode 100644 index c90376b56b73b627c519d1a34c5d8c9abb7004dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyG{c^3>-s>NNG}1?l15Mt0;UyegFv&DbPhqfch%Fi%(bFB<-Yt6!=#P*lfL7ulP#UTPH8)y|&RG>0a|qcjG!J4AG8> j(T=(Cc6=8_S=W5c^IkY62A%n!6ZJFTy2zx!wH5dQ#>Eyj diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..7517adc --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,12 @@ +OnlyOffice Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time. + +Online collaborative edition of OnlyOffice documents requires: +1. a server part, with two installation options: + 1. OnlyOffice Document Server packaged for YunoHost. + 2. The [Community Document Server for Nextcloud](https://apps.nextcloud.com/apps/documentserver_community) + +2. a client part, such as: + 1. The [ONLYOFFICE connector for Nextcloud](https://apps.nextcloud.com/apps/onlyoffice) + 2. The [ONLYOFFICE Desktop Editors](https://www.onlyoffice.com/fr/download-desktop.aspx) + +The Nextcloud addicts may follow [this tutorial](https://github.com/YunoHost-Apps/nextcloud_ynh#configure-onlyoffice-integration) to install (1.ii) and (2.i) on one Nextcloud instance. However, performance and architecture are limited. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..f1b78ca --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,12 @@ +OnlyOffice Document Server est une suite bureautique en ligne comprenant des visualiseurs et des éditeurs de textes, feuilles de calcul et présentations, entièrement compatible avec les formats Office Open XML: .docx, .xlsx, .pptx et permettant l'édition collaborative en temps réel. + +L'édition collaborative en ligne des documents OnlyOffice nécessite : +1. une partie serveur, avec deux options d'installation : + 1. OnlyOffice Document Server packagé pour YunoHost. + 2. Le [Community Document Server pour Nextcloud](https://apps.nextcloud.com/apps/documentserver_community). + +2. une partie client, telle que : + 1. [ONLYOFFICE connector pour Nextcloud](https://apps.nextcloud.com/apps/onlyoffice) + 2. [ONLYOFFICE Desktop Editors](https://www.onlyoffice.com/fr/download-desktop.aspx) + +Les utilisateurs de Nextcloud peuvent suivre [ce tutoriel](https://github.com/YunoHost-Apps/nextcloud_ynh/blob/testing/README_fr.md#configurer-lint%C3%A9gration-donlyoffice) pour installer le Community Document Server (1.ii) et ONLYOFFICE connector (2.i) sur une instance Nextcloud. Cependant, les performances et l'architecture sont limitées. diff --git a/manifest.json b/manifest.json index e9e2c88..b296ef8 100644 --- a/manifest.json +++ b/manifest.json @@ -16,8 +16,8 @@ }, "license": "GPL-3.0-or-later", "maintainer": { - "name": "liberodark", - "email": "liberodark@gmail.com" + "name": "", + "email": "" }, "requirements": { "yunohost": ">= 4.3.0" @@ -27,7 +27,7 @@ "nginx" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain", @@ -47,6 +47,15 @@ }, "default": "/onlyoffice" }, + { + "name": "is_public", + "type": "boolean", + "help": { + "en": "You will only be able to connect OnlyOffice to Nextcloud if both apps are public!", + "fr": "Nextcloud et OnlyOffice doivent être des applications publiques si vous voulez les connecter !" + }, + "default": true + }, { "name": "nextclouddomain", "type": "string", @@ -60,15 +69,6 @@ "fr": "Installez le connecteur OnlyOffice pour éditer des documents dans Nextcloud." }, "default": "yunohost.domain/nextcloud" - }, - { - "name": "is_public", - "type": "boolean", - "help": { - "en": "You will only be able to connect OnlyOffice to Nextcloud if both apps are public!", - "fr": "Nextcloud et OnlyOffice doivent être des applications publiques si vous voulez les connecter !" - }, - "default": true } ] } diff --git a/scripts/backup b/scripts/backup index aa0bf53..79170ba 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -33,14 +33,6 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= ynh_print_info --message="Declaring files to be backed up..." -#================================================= -# BACKUP THE APP MAIN DIR -#================================================= - -ynh_backup --src_path="$final_path" - -#================================================= -# STANDARD BACKUP STEPS #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/change_url b/scripts/change_url index 3371f26..d3fdc67 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -27,13 +27,16 @@ app=$YNH_APP_INSTANCE_NAME ynh_script_progression --message="Loading installation settings..." # Needed for helper "ynh_add_nginx_config" +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +# Add settings here as needed by your application port=$(ynh_app_setting_get --app=$app --key=port) nextclouddomain=$(ynh_app_setting_get --app=$app --key=nextclouddomain) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up OnlyOffice before changing its URL (may take a while)..." +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -41,7 +44,7 @@ ynh_clean_setup () { # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script diff --git a/scripts/install b/scripts/install index 866c5fe..499f699 100644 --- a/scripts/install +++ b/scripts/install @@ -65,19 +65,19 @@ port=$(ynh_find_port --port=8095) ynh_app_setting_set --app=$app --key=port --value=$port #================================================= -# CREATE DEDICATED USER +# INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Configuring system user..." +ynh_script_progression --message="Installing dependencies..." -# Create a system user -ynh_system_user_create --username=$app +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= -# INSTALL DEPENDENCIES +# CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Installing dependencies..." +ynh_script_progression --message="Configuring system user..." -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE A POSTGRESQL DATABASE @@ -132,22 +132,13 @@ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 2>/de ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies 2>/dev/null #================================================= -# MODIFY A CONFIG FILE +# ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Modifying a config file..." +ynh_script_progression --message="Adding a configuration file..." ynh_replace_string --match_string="\"rejectUnauthorized\": true" --replace_string="\"rejectUnauthorized\": false" --target_file="/etc/onlyoffice/documentserver/default.json" - -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= -ynh_script_progression --message="Storing the config file checksum..." - -# Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="/etc/onlyoffice/documentserver/default.json" -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -158,9 +149,11 @@ chmod -R o-rwx "$final_path" chown -R ds:ds "$final_path" #================================================= -# RELOAD ONLYOFFICE +# GENERIC FINALIZATION +#================================================= +# START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Reloading OnlyOffice..." +ynh_script_progression --message="Starting a systemd service..." supervisorctl reload @@ -181,6 +174,8 @@ ynh_script_progression --message="Configuring permissions..." # Make app public if necessary if [ $is_public -eq 1 ] then + # Everyone can access the app. + # The "main" permission is automatically created before the install script. ynh_permission_update --permission="main" --add="visitors" fi diff --git a/scripts/remove b/scripts/remove index 4cced44..ece5530 100644 --- a/scripts/remove +++ b/scripts/remove @@ -63,7 +63,7 @@ apt-key del "E09C A29F 6E17 8040 EF22 B409 8320 CA65 CB2D E8E5" 2>/dev/null #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing OnlyOffice main directory..." +ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -79,9 +79,9 @@ ynh_remove_nginx_config #================================================= # SPECIFIC REMOVE #================================================= -# REMOVE FILE +# REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing file..." +ynh_script_progression --message="Removing various files..." # Remove a directory securely ynh_secure_remove --file="/etc/onlyoffice" diff --git a/scripts/restore b/scripts/restore index 6769bc0..cbbf2c0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -25,8 +25,8 @@ ynh_script_progression --message="Loading settings..." app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) path_url=$(ynh_app_setting_get --app=$app --key=path) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) @@ -43,21 +43,16 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" +#================================================= +# SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -67,7 +62,12 @@ ynh_script_progression --message="Reinstalling dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= -# SPECIFIC RESTORATION +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= @@ -116,8 +116,6 @@ ynh_script_progression --message="Generating fonts..." /usr/bin/documentserver-generate-allfonts.sh -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -128,9 +126,11 @@ chmod -R o-rwx "$final_path" chown -R ds:ds "$final_path" #================================================= -# RELOAD ONLYOFFICE +# GENERIC FINALIZATION +#================================================= +# START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Reloading OnlyOffice..." +ynh_script_progression --message="Starting a systemd service..." supervisorctl reload diff --git a/scripts/upgrade b/scripts/upgrade index c227292..09a445f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,20 +25,29 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) port=$(ynh_app_setting_get --app=$app --key=port) nextclouddomain=$(ynh_app_setting_get --app=$app --key=nextclouddomain) +#================================================= +# CHECK VERSION +#================================================= +ynh_script_progression --message="Checking version..." + +upgrade_type=$(ynh_check_app_version_changed) + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up OnlyOffice before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# STANDARD UPGRADE STEPS #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -78,7 +87,7 @@ ynh_secure_remove --file="/etc/apt/sources.list.d/nodesource.list" ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # UPGRADE DEPENDENCIES @@ -87,12 +96,10 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies -#================================================= -# STANDARD UPGRADE STEPS #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." if [ "$path_url" = "/" ]; then ynh_replace_string --match_string="__SUB_PATH__" --replace_string="" --target_file="../conf/nginx.conf" @@ -129,9 +136,9 @@ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies #================================================= -# MODIFY A CONFIG FILE +# UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Modifying a config file..." +ynh_script_progression --message="Updating a configuration file..." ynh_backup_if_checksum_is_different --file="/etc/onlyoffice/documentserver/default.json" @@ -147,8 +154,6 @@ ynh_script_progression --message="Generating fonts..." /usr/bin/documentserver-generate-allfonts.sh -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -159,9 +164,11 @@ chmod -R o-rwx "$final_path" chown -R ds:ds "$final_path" #================================================= -# RELOAD ONLYOFFICE +# GENERIC FINALIZATION +#================================================= +# START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Reloading OnlyOffice..." +ynh_script_progression --message="Starting a systemd service..." supervisorctl reload From dd0b7cf6e17af86727e295fd9e1ea35a6af1b2a4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jul 2022 03:11:21 +0200 Subject: [PATCH 37/40] Fix ttf-mscorefonts-installer --- scripts/_common.sh | 3 ++- scripts/install | 1 + scripts/restore | 1 + scripts/upgrade | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index be1de98..afbf1a8 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,8 @@ # dependencies used by the app pkg_dependencies="postgresql postgresql-contrib libstdc++6 rabbitmq-server libcurl4-dev" -extra_dependencies="onlyoffice-documentserver ttf-mscorefonts-installer" +contrib_dependencies="ttf-mscorefonts-installer" +extra_dependencies="onlyoffice-documentserver" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 499f699..08d7760 100644 --- a/scripts/install +++ b/scripts/install @@ -70,6 +70,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Installing dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian/ buster main contrib" --package=$contrib_dependencies #================================================= # CREATE DEDICATED USER diff --git a/scripts/restore b/scripts/restore index cbbf2c0..2691c8e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -60,6 +60,7 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian/ buster main contrib" --package=$contrib_dependencies #================================================= # RESTORE THE NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 09a445f..ac705ea 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,6 +95,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" ynh_script_progression --message="Upgrading dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian/ buster main contrib" --package=$contrib_dependencies #================================================= # NGINX CONFIGURATION From 88b821fa9f0cb88aec91f5dc5665215bce6d3105 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jul 2022 03:11:30 +0200 Subject: [PATCH 38/40] Add auto-updater --- .github/workflows/updater.sh | 65 +++++++++++++++++++++++++++++++++++ .github/workflows/updater.yml | 49 ++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 .github/workflows/updater.sh create mode 100644 .github/workflows/updater.yml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh new file mode 100644 index 0000000..c6c82b4 --- /dev/null +++ b/.github/workflows/updater.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +#================================================= +# PACKAGE UPDATING HELPER +#================================================= + +# This script is meant to be run by GitHub Actions +# The YunoHost-Apps organisation offers a template Action to run this script periodically +# Since each app is different, maintainers can adapt its contents so as to perform +# automatic actions when a new upstream release is detected. + +#================================================= +# FETCHING LATEST RELEASE AND ITS ASSETS +#================================================= + +# Fetching information +current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') +repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') +# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) +version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) + +# Later down the script, we assume the version has only digits and dots +# Sometimes the release name starts with a "v", so let's filter it out. +# You may need more tweaks here if the upstream repository has different naming conventions. +if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then + version=${version:1} +fi + +# Setting up the environment variables +echo "Current version: $current_version" +echo "Latest release from upstream: $version" +echo "VERSION=$version" >> $GITHUB_ENV +echo "REPO=$repo" >> $GITHUB_ENV +# For the time being, let's assume the script will fail +echo "PROCEED=false" >> $GITHUB_ENV + +# Proceed only if the retrieved version is greater than the current one +if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then + echo "::warning ::No new version available" + exit 0 +# Proceed only if a PR for this new version does not already exist +elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then + echo "::warning ::A branch already exists for this update" + exit 0 +fi + +#================================================= +# SPECIFIC UPDATE STEPS +#================================================= + +# Any action on the app's source code can be done. +# The GitHub Action workflow takes care of committing all changes after this script ends. + +#================================================= +# GENERIC FINALIZATION +#================================================= + +# Replace new version in manifest +echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json + +# No need to update the README, yunohost-bot takes care of it + +# The Action will proceed only if the PROCEED environment variable is set to true +echo "PROCEED=true" >> $GITHUB_ENV +exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..fb72ba0 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,49 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false From 90c68e8f6befa93593ad362cb97acc883f1629ae Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 13 Jul 2022 01:17:34 +0000 Subject: [PATCH 39/40] Auto-update README --- README.md | 33 +++++++++++++++++++++++---------- README_fr.md | 39 ++++++++++++++++++++++++++++----------- 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 956aab3..6befc92 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # OnlyOffice for YunoHost -[![Integration level](https://dash.yunohost.org/integration/onlyoffice.svg)](https://dash.yunohost.org/appci/app/onlyoffice) ![](https://ci-apps.yunohost.org/ci/badges/onlyoffice.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/onlyoffice.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/onlyoffice.svg)](https://dash.yunohost.org/appci/app/onlyoffice) ![Working status](https://ci-apps.yunohost.org/ci/badges/onlyoffice.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/onlyoffice.maintain.svg) [![Install OnlyOffice with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=onlyoffice) *[Lire ce readme en français.](./README_fr.md)* @@ -15,7 +15,19 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Create and edit documents collaboratively +OnlyOffice Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time. + +Online collaborative edition of OnlyOffice documents requires: +1. a server part, with two installation options: + 1. OnlyOffice Document Server packaged for YunoHost. + 2. The [Community Document Server for Nextcloud](https://apps.nextcloud.com/apps/documentserver_community) + +2. a client part, such as: + 1. The [ONLYOFFICE connector for Nextcloud](https://apps.nextcloud.com/apps/onlyoffice) + 2. The [ONLYOFFICE Desktop Editors](https://www.onlyoffice.com/fr/download-desktop.aspx) + +The Nextcloud addicts may follow [this tutorial](https://github.com/YunoHost-Apps/nextcloud_ynh#configure-onlyoffice-integration) to install (1.ii) and (2.i) on one Nextcloud instance. However, performance and architecture are limited. + **Shipped version:** 7.1.0~ynh1 @@ -23,8 +35,8 @@ Create and edit documents collaboratively ## Screenshots -![](./doc/screenshots/.DS_Store) -![](./doc/screenshots/document-short.png) +![Screenshot of OnlyOffice](./doc/screenshots/.DS_Store) +![Screenshot of OnlyOffice](./doc/screenshots/document-short.png) ## Disclaimers / important information @@ -78,20 +90,21 @@ Prerequisite: **OnlyOffice should be public**, see previous section. ## Documentation and resources -* Official app website: https://www.onlyoffice.com -* Upstream app code repository: https://github.com/ONLYOFFICE/DocumentServer -* YunoHost documentation for this app: https://yunohost.org/app_onlyoffice -* Report a bug: https://github.com/YunoHost-Apps/onlyoffice_ynh/issues +* Official app website: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/onlyoffice_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/onlyoffice_ynh/tree/testing --debug or sudo yunohost app upgrade onlyoffice -u https://github.com/YunoHost-Apps/onlyoffice_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index e66234a..ccddef9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,17 +1,33 @@ + + # OnlyOffice pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/onlyoffice.svg)](https://dash.yunohost.org/appci/app/onlyoffice) ![](https://ci-apps.yunohost.org/ci/badges/onlyoffice.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/onlyoffice.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/onlyoffice.svg)](https://dash.yunohost.org/appci/app/onlyoffice) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/onlyoffice.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/onlyoffice.maintain.svg) [![Installer OnlyOffice avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=onlyoffice) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer OnlyOffice rapidement et simplement sur un serveur YunoHost. Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* ## Vue d'ensemble -Créez et éditer des documents collaborativement +OnlyOffice Document Server est une suite bureautique en ligne comprenant des visualiseurs et des éditeurs de textes, feuilles de calcul et présentations, entièrement compatible avec les formats Office Open XML: .docx, .xlsx, .pptx et permettant l'édition collaborative en temps réel. + +L'édition collaborative en ligne des documents OnlyOffice nécessite : +1. une partie serveur, avec deux options d'installation : + 1. OnlyOffice Document Server packagé pour YunoHost. + 2. Le [Community Document Server pour Nextcloud](https://apps.nextcloud.com/apps/documentserver_community). + +2. une partie client, telle que : + 1. [ONLYOFFICE connector pour Nextcloud](https://apps.nextcloud.com/apps/onlyoffice) + 2. [ONLYOFFICE Desktop Editors](https://www.onlyoffice.com/fr/download-desktop.aspx) + +Les utilisateurs de Nextcloud peuvent suivre [ce tutoriel](https://github.com/YunoHost-Apps/nextcloud_ynh/blob/testing/README_fr.md#configurer-lint%C3%A9gration-donlyoffice) pour installer le Community Document Server (1.ii) et ONLYOFFICE connector (2.i) sur une instance Nextcloud. Cependant, les performances et l'architecture sont limitées. + **Version incluse :** 7.1.0~ynh1 @@ -19,8 +35,8 @@ Créez et éditer des documents collaborativement ## Captures d'écran -![](./doc/screenshots/.DS_Store) -![](./doc/screenshots/document-short.png) +![Capture d'écran de OnlyOffice](./doc/screenshots/.DS_Store) +![Capture d'écran de OnlyOffice](./doc/screenshots/document-short.png) ## Avertissements / informations importantes @@ -74,20 +90,21 @@ Prérequis : **OnlyOffice doit être public**, voir la section précédente. ## Documentations et ressources -* Site officiel de l'app : https://www.onlyoffice.com -* Dépôt de code officiel de l'app : https://github.com/ONLYOFFICE/DocumentServer -* Documentation YunoHost pour cette app : https://yunohost.org/app_onlyoffice -* Signaler un bug : https://github.com/YunoHost-Apps/onlyoffice_ynh/issues +* Site officiel de l'app : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/onlyoffice_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/onlyoffice_ynh/tree/testing --debug ou sudo yunohost app upgrade onlyoffice -u https://github.com/YunoHost-Apps/onlyoffice_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From fff976e4b725efc811ba66607548f04eb9cc6680 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 19 Jul 2022 23:05:27 +0200 Subject: [PATCH 40/40] Fix repository key --- scripts/install | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 08d7760..9d3a30c 100644 --- a/scripts/install +++ b/scripts/install @@ -70,7 +70,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Installing dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian/ buster main contrib" --package=$contrib_dependencies +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian/ buster main contrib" --package=$contrib_dependencies --key="https://ftp-master.debian.org/keys/release-$(lsb_release --release --short).asc" #================================================= # CREATE DEDICATED USER @@ -130,7 +130,7 @@ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 2>/de # restart nginx and the whole webadmin and maybe even the yunohost command # running the install ... -ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies 2>/dev/null +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies --key="https://ftp-master.debian.org/keys/release-$(lsb_release --release --short).asc" #================================================= # ADD A CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 2691c8e..c63df84 100644 --- a/scripts/restore +++ b/scripts/restore @@ -60,7 +60,7 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian/ buster main contrib" --package=$contrib_dependencies +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian/ buster main contrib" --package=$contrib_dependencies --key="https://ftp-master.debian.org/keys/release-$(lsb_release --release --short).asc" #================================================= # RESTORE THE NGINX CONFIGURATION @@ -96,7 +96,7 @@ ynh_script_progression --message="Reinstalling OnlyOffice..." apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies --key="https://ftp-master.debian.org/keys/release-$(lsb_release --release --short).asc" #================================================= # RESTORE THE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index ac705ea..1a32e7a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,7 +95,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" ynh_script_progression --message="Upgrading dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian/ buster main contrib" --package=$contrib_dependencies +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian/ buster main contrib" --package=$contrib_dependencies --key="https://ftp-master.debian.org/keys/release-$(lsb_release --release --short).asc" #================================================= # NGINX CONFIGURATION @@ -134,7 +134,7 @@ ynh_remove_extra_repo --name="$app" # backward compat apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 # ynh_remove_app_dependencies -ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies +ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies --key="https://ftp-master.debian.org/keys/release-$(lsb_release --release --short).asc" #================================================= # UPDATE A CONFIG FILE