From 7d54bfd1010c57b9278e4d057dc2a41292ad1221 Mon Sep 17 00:00:00 2001 From: Gredin 67 Date: Wed, 15 Dec 2021 02:57:11 +0100 Subject: [PATCH 01/17] 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 02/17] 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 03/17] 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 04/17] 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 05/17] =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 06/17] 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 07/17] 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 08/17] 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 09/17] 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 10/17] 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 11/17] 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 12/17] 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 13/17] 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 14/17] Update upgrade --- scripts/upgrade | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 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,32 +103,8 @@ 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 -#================================================= -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_package_remove $extra_dependencies -ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies - #================================================= # CONFIGURE ONLYOFFICE #================================================= @@ -134,6 +117,18 @@ 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_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 + #================================================= # 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 15/17] [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 16/17] [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 17/17] [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