From 5a16e4cd7447a4f76bfd8e48e5ef363b17c56bf1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 16 Sep 2021 13:50:54 +0200 Subject: [PATCH 1/4] Update restore --- scripts/restore | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index e7ee13c..6073ce2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -42,8 +42,6 @@ ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_pr #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " From c1989a97e5b38a885bb34869090333edfbb6b45a Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 28 Sep 2021 22:31:37 +0200 Subject: [PATCH 2/4] Do not add authentication headers from the SSO to the admin page It conflicts with Etherpad's own login system --- scripts/install | 4 ++-- scripts/upgrade | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index fef4106..799366a 100644 --- a/scripts/install +++ b/scripts/install @@ -300,11 +300,11 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failrege ynh_script_progression --message="Configuring permissions..." --weight=2 if [ $is_public -eq 1 ]; then - ynh_permission_update --permission="main" --add="visitors" + ynh_permission_update --permission="main" --add="visitors" fi # Only the admin can access the admin panel of the app (if the app has an admin panel) -ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin +ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin --auth_header=false #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index dfe4f87..c811618 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -135,6 +135,10 @@ fi if ! ynh_permission_exists --permission="admin"; then # Create the required permissions ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin +else + # Make sure the admin panel is not exposed to the SSO's authentication headers + # AFAIK there is no helper to check if that flag is up or not, so let's force it. + ynh_permission_url --permission="admin" --auth_header=false fi #================================================= From 54ee286a76a4258475ac6eef8eb5a6fe828e0d52 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 28 Sep 2021 23:27:43 +0200 Subject: [PATCH 3/4] Fix linter warning --- manifest.json | 10 +++------- scripts/_common.sh | 2 -- scripts/install | 8 ++------ scripts/restore | 4 +--- scripts/upgrade | 2 +- 5 files changed, 7 insertions(+), 19 deletions(-) diff --git a/manifest.json b/manifest.json index c2afcbd..836091f 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,6 @@ "website": "http://etherpad.org", "demo": "https://video.etherpad.com", "admindoc": "http://etherpad.org/doc/v1.8.14", - "userdoc": "https://yunohost.org/en/app_etherpad_mypads", "code": "https://github.com/ether/etherpad-lite" }, "license": "Apache-2.0", @@ -37,8 +36,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "sub.domain.org" + "type": "domain" }, { "name": "path", @@ -48,13 +46,11 @@ }, { "name": "admin", - "type": "user", - "example": "john" + "type": "user" }, { "name": "password", - "type": "password", - "example": "Choose a password" + "type": "password" }, { "name": "language", diff --git a/scripts/_common.sh b/scripts/_common.sh index abc4bcc..77760cc 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,6 @@ # COMMON VARIABLES #================================================= -#!/bin/bash - # Dependencies for AbiWord abiword_app_depencencies="abiword" diff --git a/scripts/install b/scripts/install index fef4106..ed9e12c 100644 --- a/scripts/install +++ b/scripts/install @@ -32,7 +32,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN -ynh_print_OFF; password=$YNH_APP_ARG_PASSWORD; ynh_print_ON +password=$YNH_APP_ARG_PASSWORD language=$YNH_APP_ARG_LANGUAGE is_public=$YNH_APP_ARG_IS_PUBLIC export=$YNH_APP_ARG_EXPORT @@ -46,12 +46,10 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." -ynh_print_OFF if [ "${#password}" -lt 8 ] || [ "${#password}" -gt 30 ] then ynh_die --message="The password must be between 8 and 30 characters." fi -ynh_print_ON final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -67,7 +65,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=3 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_print_OFF; ynh_app_setting_set --app=$app --key=password --value=$password; ynh_print_ON +ynh_app_setting_set --app=$app --key=password --value=$password ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=export --value=$export ynh_app_setting_set --app=$app --key=mypads --value=$mypads @@ -344,7 +342,6 @@ else Informations="You can access the admin panel by accessing https://$domain${path_url%/}/admin." fi -ynh_print_OFF echo "$Informations You can also find a config file for Etherpad at this path /var/www/etherpad_mypads/settings.json. @@ -354,7 +351,6 @@ You can also find some specific actions for this app by using the experimental a If you are facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh" > mail_to_send ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="$admin" --type=install -ynh_print_ON #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 6073ce2..592082d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -35,7 +35,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) export=$(ynh_app_setting_get --app=$app --key=export) mypads=$(ynh_app_setting_get --app=$app --key=mypads) admin=$(ynh_app_setting_get --app=$app --key=admin) -ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_print_ON +password=$(ynh_app_setting_get --app=$app --key=password) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -191,14 +191,12 @@ else Informations="You can access to the admin panel, by accessing https://$domain${path_url%/}/admin." fi -ynh_print_OFF echo "$Informations You can also find a config file for Etherpad at this path /var/www/etherpad_mypads/settings.json. If you are facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh" > mail_to_send ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="$admin" --type=restore -ynh_print_ON #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index dfe4f87..ccc7e5b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,7 +27,7 @@ export=$(ynh_app_setting_get --app=$app --key=export) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_print_ON +password=$(ynh_app_setting_get --app=$app --key=password) mypads=$(ynh_app_setting_get --app=$app --key=mypads) useldap=$(ynh_app_setting_get --app=$app --key=useldap) overwrite_settings=$(ynh_app_setting_get --app=$app --key=overwrite_settings) From afddfdf13e70f13ef21ba8ef13c326b35818dc68 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Tue, 28 Sep 2021 21:27:52 +0000 Subject: [PATCH 4/4] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index 33df9ef..b2f67d9 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,6 @@ You can also find a configuration file for Etherpad at this path `/var/www/ether ## Documentation and resources * Official app website: http://etherpad.org -* Official user documentation: https://yunohost.org/en/app_etherpad_mypads * Official admin documentation: http://etherpad.org/doc/v1.8.14 * Upstream app code repository: https://github.com/ether/etherpad-lite * YunoHost documentation for this app: https://yunohost.org/app_etherpad_mypads diff --git a/README_fr.md b/README_fr.md index 343e1b8..23d5543 100644 --- a/README_fr.md +++ b/README_fr.md @@ -59,7 +59,6 @@ Vous pouvez accéder à deux panneaux d'administration différents, pour Etherpa ## Documentations et ressources * Site officiel de l'app : http://etherpad.org -* Documentation officielle utilisateur : https://yunohost.org/en/app_etherpad_mypads * Documentation officielle de l'admin : http://etherpad.org/doc/v1.8.14 * Dépôt de code officiel de l'app : https://github.com/ether/etherpad-lite * Documentation YunoHost pour cette app : https://yunohost.org/app_etherpad_mypads