1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/element_ynh.git synced 2024-09-03 18:36:08 +02:00
This commit is contained in:
Josué Tille 2024-08-31 09:39:05 +02:00
parent bddcd0533d
commit 844d58471e
No known key found for this signature in database
GPG key ID: 5F259226AD51F2F5
5 changed files with 21 additions and 76 deletions

View file

@ -18,7 +18,7 @@ code = "https://github.com/element-hq/element-web"
cpe = "cpe:2.3:a:matrix:element" cpe = "cpe:2.3:a:matrix:element"
[integration] [integration]
yunohost = ">= 11.2.18" yunohost = ">= 11.2.27"
helpers_version = "2.1" helpers_version = "2.1"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true

View file

@ -7,6 +7,17 @@
configure_element() configure_element()
{ {
ynh_config_add --template="config.json" --destination="$install_dir/config.json" ynh_config_add --template="config.json" --destination="$install_dir/config.json"
#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" 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" chown -R "$app":www-data "$install_dir"
}
set_settings_default() {
ynh_app_setting_set_default --key=disable_custom_urls --value=false
ynh_app_setting_set_default --key=disable_guests --value=false
ynh_app_setting_set_default --key=disable_3pid_login --value=false
ynh_app_setting_set_default --key=default_country_code --value=GB
ynh_app_setting_set_default --key=brand_text --value=Element
ynh_app_setting_set_default --key=default_federate --value=true
ynh_app_setting_set_default --key=default_theme --value=light
ynh_app_setting_set_default --key=show_labs_settings --value=false
} }

View file

@ -7,23 +7,7 @@ source /usr/share/yunohost/helpers
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
disable_custom_urls=false set_settings_default
disable_guests=false
disable_3pid_login=false
default_country_code=GB
brand_text=Element
default_federate=true
default_theme=light
show_labs_settings=false
ynh_app_setting_set --key=disable_custom_urls --value=$disable_custom_urls
ynh_app_setting_set --key=disable_guests --value=$disable_guests
ynh_app_setting_set --key=disable_3pid_login --value=$disable_3pid_login
ynh_app_setting_set --key=default_country_code --value=$default_country_code
ynh_app_setting_set --key=brand_text --value=$brand_text
ynh_app_setting_set --key=default_federate --value=$default_federate
ynh_app_setting_set --key=default_theme --value=$default_theme
ynh_app_setting_set --key=show_labs_settings --value=$show_labs_settings
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE

View file

@ -10,8 +10,8 @@ source /usr/share/yunohost/helpers
ynh_script_progression "Restoring the app main directory..." ynh_script_progression "Restoring the app main directory..."
ynh_restore "$install_dir" 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 # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================

View file

@ -8,59 +8,8 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression 'Ensuring downward compatibility...' ynh_script_progression 'Ensuring downward compatibility...'
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=default_home_server --value='matrix.org' ynh_app_setting_set_default --key=default_home_server --value='matrix.org'
if [ -z "${default_home_server:-}" ]; then set_settings_default
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
fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -69,8 +18,9 @@ ynh_script_progression "Upgrading source files..."
ynh_setup_source --dest_dir="$install_dir" --full_replace --keep="config.json" ynh_setup_source --dest_dir="$install_dir" --full_replace --keep="config.json"
#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" 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" chown -R "$app":www-data "$install_dir"
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================