1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/element_ynh.git synced 2024-09-03 18:36:08 +02:00

[autopatch] Automatic patch attempt for helpers 2.1

This commit is contained in:
Yunohost-Bot 2024-08-30 22:51:29 +02:00 committed by Alexandre Aubin
parent edb0ce6929
commit bddcd0533d
5 changed files with 17 additions and 8 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
*~
~.sw[op]
.DS_Store
*.sw[op]

View file

@ -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 = "/"

View file

@ -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"
}

View file

@ -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
#=================================================

View file

@ -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
#=================================================