From bddcd0533df8eadacdcff968e433529c2532d763 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 30 Aug 2024 22:51:29 +0200 Subject: [PATCH] [autopatch] Automatic patch attempt for helpers 2.1 --- .gitignore | 1 + manifest.toml | 3 ++- scripts/_common.sh | 4 ++-- scripts/restore | 3 +-- scripts/upgrade | 14 +++++++++++--- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 8727f14..3e037cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *~ ~.sw[op] .DS_Store +*.sw[op] diff --git a/manifest.toml b/manifest.toml index a6331fd..ed3ae2a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,7 @@ code = "https://github.com/element-hq/element-web" cpe = "cpe:2.3:a:matrix:element" [integration] -yunohost = ">= 11.2.27" +yunohost = ">= 11.2.18" helpers_version = "2.1" architectures = "all" multi_instance = true @@ -65,6 +65,7 @@ ram.runtime = "0M" [resources.system_user] [resources.install_dir] + group = "www-data:r-x" [resources.permissions] main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index cb1662c..330e2db 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,6 +7,6 @@ configure_element() { ynh_config_add --template="config.json" --destination="$install_dir/config.json" - chmod -R u=rwX,g=rX,o= "$install_dir" - chown -R $app:www-data "$install_dir" + #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R u=rwX,g=rX,o= "$install_dir" + #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" } diff --git a/scripts/restore b/scripts/restore index 6826928..2c9d94c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -11,8 +11,7 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" -chown -R "$app":www-data "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app":www-data "$install_dir" #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2de10ee..8531d8b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,46 +8,55 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression 'Ensuring downward compatibility...' +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=default_home_server --value='matrix.org' if [ -z "${default_home_server:-}" ]; then default_home_server='matrix.org' ynh_app_setting_set --key=default_home_server --value=$default_home_server fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=disable_custom_urls --value=false if [ -z "${disable_custom_urls:-}" ]; then disable_custom_urls=false ynh_app_setting_set --key=disable_custom_urls --value=$disable_custom_urls fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=disable_guests --value=false if [ -z "${disable_guests:-}" ]; then disable_guests=false ynh_app_setting_set --key=disable_guests --value=$disable_guests fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=disable_3pid_login --value=false if [ -z "${disable_3pid_login:-}" ]; then disable_3pid_login=false ynh_app_setting_set --key=disable_3pid_login --value=$disable_3pid_login fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=default_country_code --value=false if [ -z "${default_country_code:-}" ]; then default_country_code=false ynh_app_setting_set --key=default_country_code --value=$default_country_code fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=brand_text --value=Element if [ -z "${brand_text:-}" ]; then brand_text=Element ynh_app_setting_set --key=brand_text --value=$brand_text fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=default_federate --value=true if [ -z "${default_federate:-}" ]; then default_federate=true ynh_app_setting_set --key=default_federate --value=$default_federate fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=default_theme --value=light if [ -z "${default_theme:-}" ]; then default_theme=light ynh_app_setting_set --key=default_theme --value=$default_theme fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=show_labs_settings --value=false if [ -z "${show_labs_settings:-}" ]; then show_labs_settings=false ynh_app_setting_set --key=show_labs_settings --value=$show_labs_settings @@ -60,9 +69,8 @@ ynh_script_progression "Upgrading source files..." ynh_setup_source --dest_dir="$install_dir" --full_replace --keep="config.json" -chmod -R o-rwx "$install_dir" -chown -R "$app":www-data "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app":www-data "$install_dir" #================================================= # ADD A CONFIGURATION #=================================================