2018-08-03 16:06:29 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2024-04-15 23:26:32 +02:00
|
|
|
source ./experimental_helper.sh
|
2023-11-01 18:52:07 +01:00
|
|
|
source ./_common.sh
|
2018-08-03 16:06:29 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2024-02-16 23:26:56 +01:00
|
|
|
ynh_app_config_validate() {
|
|
|
|
# Depending of the status of the $enable_regirtration we should default value of the hidden fields
|
|
|
|
if $enable_registration; then
|
|
|
|
# Must enable password authentication when free registration is enabled as any user must be able to authenticate
|
|
|
|
password_enabled=true
|
|
|
|
else
|
|
|
|
registrations_require_3pid=email
|
|
|
|
allowed_local_3pids_email=''
|
|
|
|
allowed_local_3pids_msisdn=''
|
|
|
|
disable_msisdn_registration=true
|
|
|
|
fi
|
|
|
|
_ynh_app_config_validate
|
|
|
|
}
|
|
|
|
|
2023-11-01 18:52:07 +01:00
|
|
|
ynh_app_config_apply() {
|
2024-02-16 23:26:18 +01:00
|
|
|
_ynh_app_config_apply
|
|
|
|
configure_nginx
|
2024-05-18 00:11:05 +02:00
|
|
|
|
|
|
|
# Force enable it because some client like Element X don't support CAS and so require to have password authentication enabled
|
|
|
|
password_enabled=true
|
|
|
|
|
2024-06-04 21:00:22 +02:00
|
|
|
ynh_add_config --jinja --template="homeserver.yaml" --destination="/etc/matrix-$app/homeserver.yaml"
|
2024-04-05 01:02:47 +02:00
|
|
|
ynh_add_config --template="log.yaml" --destination="/etc/matrix-$app/log.yaml"
|
2024-02-16 23:26:18 +01:00
|
|
|
set_permissions
|
2023-07-01 16:07:50 +02:00
|
|
|
}
|
2023-07-01 10:25:47 +02:00
|
|
|
|
2018-08-03 16:06:29 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# SELECT THE ACTION FOLLOWING THE GIVEN ARGUMENT
|
|
|
|
#=================================================
|
2024-04-27 01:21:40 +02:00
|
|
|
ynh_app_config_run "$1"
|