From fb6b94bbddea6fba9757a79f25538a4b0fc7a318 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 9 Apr 2020 18:34:33 +0200 Subject: [PATCH 1/3] Add new badges --- README.md | 4 ++-- README_fr.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ddf8cd..0869d59 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Etherpad with mypads plugin for YunoHost -[![Integration level](https://dash.yunohost.org/integration/etherpad_mypads.svg)](https://dash.yunohost.org/appci/app/etherpad_mypads) +[![Integration level](https://dash.yunohost.org/integration/etherpad_mypads.svg)](https://dash.yunohost.org/appci/app/etherpad_mypads) ![](https://ci-apps.yunohost.org/ci/badges/etherpad_mypads.status.svg) [![](https://ci-apps.yunohost.org/ci/badges/etherpad_mypads.maintain.svg)](https://github.com/YunoHost/Apps/#what-to-do-if-i-cant-maintain-my-app-anymore-) [![Install Etherpad with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=etherpad_mypads) *[Lire ce readme en français.](./README_fr.md)* @@ -42,7 +42,7 @@ Supported, with LDAP. * x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/etherpad_mypads/) * ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/etherpad_mypads/) -* Jessie x86-64b - [![](https://ci-stretch.nohost.me/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/etherpad_mypads/) +* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/etherpad_mypads/) ## Limitations diff --git a/README_fr.md b/README_fr.md index b192165..b19547f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # Etherpad avec plugin mypads pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/etherpad_mypads.svg)](https://dash.yunohost.org/appci/app/etherpad_mypads) +[![Niveau d'intégration](https://dash.yunohost.org/integration/etherpad_mypads.svg)](https://dash.yunohost.org/appci/app/etherpad_mypads) ![](https://ci-apps.yunohost.org/ci/badges/etherpad_mypads.status.svg) [![](https://ci-apps.yunohost.org/ci/badges/etherpad_mypads.maintain.svg)](https://github.com/YunoHost/Apps/#what-to-do-if-i-cant-maintain-my-app-anymore-) [![Installer Etherpad avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=etherpad_mypads) *[Read this readme in english.](./README.md)* @@ -42,7 +42,7 @@ Supportée, avec LDAP. * x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/etherpad_mypads/) * ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/etherpad_mypads/) -* Jessie x86-64b - [![](https://ci-stretch.nohost.me/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/etherpad_mypads/) +* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/etherpad_mypads/) ## Limitations From 28adea148e840f4d703fdd64a3e69861a569a03e Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 9 Apr 2020 18:37:53 +0200 Subject: [PATCH 2/3] Actions and config_panel tests --- check_process | 22 ++++++++++++++- scripts/actions/add_remove_abiword | 15 +++++++--- scripts/actions/add_remove_libreoffice | 15 +++++++--- scripts/actions/list_all_pads | 7 +++++ scripts/actions/public_private | 7 +++++ scripts/actions/reset_default_config | 7 +++++ scripts/config | 38 ++++++++++++++++++++++---- 7 files changed, 96 insertions(+), 15 deletions(-) diff --git a/check_process b/check_process index 48636c3..e0162f6 100644 --- a/check_process +++ b/check_process @@ -9,6 +9,24 @@ export="libreoffice" mypads=1 useldap=1 + ; Actions + is_public=0|1 + ; Config_panel + main.export.export=none|abiword|libreoffice + main.pad_configuration.pad_config_nocolors=1|0 + main.pad_configuration.pad_config_showlinenumbers=0|1 + main.pad_configuration.pad_config_chatandusers=1|0 + main.pad_configuration.pad_config_alwaysshowchat=1|0 + main.pad_configuration.pad_config_show_markdown=1|0 + main.pad_configuration.pad_config_pageview=1|0 + main.pad_configuration.pad_config_automatic_logout=0|1 + main.mypads_configuration.mypads=0|1 + main.mypads_configuration.useldap=0|1 + main.is_public.is_public=1|0 + main.overwrite_files.overwrite_settings=0|1 + main.overwrite_files.overwrite_credentials=0|1 + main.overwrite_files.overwrite_nginx=0|1 + main.overwrite_files.overwrite_systemd=0|1 ; Checks pkg_linter=1 setup_sub_dir=1 @@ -21,6 +39,8 @@ multi_instance=0 port_already_use=1 (9001) change_url=1 + actions=1 + config_panel=1 ;; Test sans mypads ; Manifest domain="domain.tld" (DOMAIN) @@ -68,7 +88,7 @@ Level 5=auto ;;; Options Email= -Notification=down +Notification=change ;;; Upgrade options ; commit=8bf300413ec3adcb416d168d2e9e98975dd9405b name= Fix nodejs & global update diff --git a/scripts/actions/add_remove_abiword b/scripts/actions/add_remove_abiword index 1ae79da..a3b388d 100755 --- a/scripts/actions/add_remove_abiword +++ b/scripts/actions/add_remove_abiword @@ -9,6 +9,13 @@ source scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # RETRIEVE ARGUMENTS #================================================= @@ -29,14 +36,14 @@ then # abiword is already a dependence of etherpad_mypads. # abiword should be removed. abiword=0 - action1=installed - action2=Installing + action1=removed + action2=Removing else # abiword isn't a dependence of etherpad_mypads. # abiword should be installed. abiword=1 - action1=removed - action2=Removing + action1=installed + action2=Installing fi ynh_print_info --message="Abiword will be $action1." diff --git a/scripts/actions/add_remove_libreoffice b/scripts/actions/add_remove_libreoffice index ec1dc59..13c4091 100755 --- a/scripts/actions/add_remove_libreoffice +++ b/scripts/actions/add_remove_libreoffice @@ -9,6 +9,13 @@ source scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # RETRIEVE ARGUMENTS #================================================= @@ -29,14 +36,14 @@ then # libreoffice is already a dependence of etherpad_mypads. # libreoffice should be removed. libreoffice=0 - action1=installed - action2=Installing + action1=removed + action2=Removing else # libreoffice isn't a dependence of etherpad_mypads. # libreoffice should be installed. libreoffice=1 - action1=removed - action2=Removing + action1=installed + action2=Installing fi ynh_print_info --message="Libreoffice will be $action1." diff --git a/scripts/actions/list_all_pads b/scripts/actions/list_all_pads index 7142b64..c2029e1 100755 --- a/scripts/actions/list_all_pads +++ b/scripts/actions/list_all_pads @@ -9,6 +9,13 @@ source scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # RETRIEVE ARGUMENTS #================================================= diff --git a/scripts/actions/public_private b/scripts/actions/public_private index f8ccebb..3622632 100755 --- a/scripts/actions/public_private +++ b/scripts/actions/public_private @@ -8,6 +8,13 @@ source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # RETRIEVE ARGUMENTS #================================================= diff --git a/scripts/actions/reset_default_config b/scripts/actions/reset_default_config index a643228..c4e280e 100755 --- a/scripts/actions/reset_default_config +++ b/scripts/actions/reset_default_config @@ -9,6 +9,13 @@ source scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # RETRIEVE ARGUMENTS #================================================= diff --git a/scripts/config b/scripts/config index d8076de..05893e3 100644 --- a/scripts/config +++ b/scripts/config @@ -6,11 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -source _common.sh -source /usr/share/yunohost/helpers # Load common variables for all scripts. source _variables +source _common.sh +source /usr/share/yunohost/helpers + #================================================= # RETRIEVE ARGUMENTS #================================================= @@ -157,6 +158,11 @@ show_config() { #================================================= apply_config() { + + #================================================= + # MODIFY ETHERPAD CONFIG + #================================================= + restart_etherpad=0 # Change configuration if needed @@ -245,6 +251,9 @@ apply_config() { ynh_replace_string --match_string="\(\"abiword\" *: \).*," --replace_string="\1null," --target_file="$config_file" ynh_replace_string --match_string="\(\"soffice\" *: \).*," --replace_string="\1null," --target_file="$config_file" fi + + ynh_app_setting_set --app=$app --key=export --value="$export" + restart_etherpad=1 fi @@ -261,6 +270,9 @@ apply_config() { fi popd chown -R $app: $final_path/node_modules + + ynh_app_setting_set --app=$app --key=mypads --value="$mypads" + restart_etherpad=1 fi @@ -273,6 +285,9 @@ apply_config() { else ynh_replace_string --match_string="\(.*\) //useldap" --replace_string="//noldap\1" --target_file="$final_path/settings.json" fi + + ynh_app_setting_set --app=$app --key=useldap --value="$useldap" + restart_etherpad=1 fi @@ -283,14 +298,25 @@ apply_config() { ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" fi + #================================================= + # MODIFY PUBLIC ACCESSIBILITY + #================================================= + # Change public accessibility - if [ "$is_public" = "1" ] + if [ "$is_public" != "$old_is_public" ] then - yunohost app action run $app public_private --args is_public=1 - else - yunohost app action run $app public_private --args is_public=0 + if [ "$is_public" = "1" ] + then + yunohost app action run $app public_private --args is_public=1 + else + yunohost app action run $app public_private --args is_public=0 + fi fi + #================================================= + # MODIFY OVERWRITTING SETTINGS + #================================================= + # Set overwrite_settings ynh_app_setting_set --app=$app --key=overwrite_settings --value="$overwrite_settings" # Set overwrite_credentials From 3d67b528aa403fa1dbd9b5b505d853fd73054078 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 9 Apr 2020 18:38:07 +0200 Subject: [PATCH 3/3] Linter fix --- manifest.json | 2 +- scripts/install | 5 +++-- scripts/restore | 5 +++-- scripts/upgrade | 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/manifest.json b/manifest.json index b0f63b9..139ef45 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "maniackc_dev@crudelis.fr" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.6" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index 92fd0b1..898911d 100644 --- a/scripts/install +++ b/scripts/install @@ -6,11 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -source _common.sh -source /usr/share/yunohost/helpers # Load common variables for all scripts. source _variables +source _common.sh +source /usr/share/yunohost/helpers + #================================================= # MANAGE FAILURE OF THE SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 24c6f93..619f0e4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,11 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -source ../settings/scripts/_common.sh -source /usr/share/yunohost/helpers # Load common variables for all scripts. source ../settings/scripts/_variables +source ../settings/scripts/_common.sh +source /usr/share/yunohost/helpers + #================================================= # MANAGE SCRIPT FAILURE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b582c60..1cf16af 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,11 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -source _common.sh -source /usr/share/yunohost/helpers # Load common variables for all scripts. source _variables +source _common.sh +source /usr/share/yunohost/helpers + #================================================= # LOAD SETTINGS #=================================================