1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00
This commit is contained in:
Éric Gaspar 2023-06-07 00:16:52 +02:00
parent 72a395ef26
commit 9916d39347
5 changed files with 9 additions and 12 deletions

View file

@ -2246,7 +2246,7 @@ password_providers:
uid: "uid"
mail: "mail"
name: "givenName"
bind_dn: "uid=__SYNAPSE_USER_APP__,ou=users,dc=yunohost,dc=org"
bind_dn: "uid=__APP__,ou=users,dc=yunohost,dc=org"
bind_password: __SYNAPSE_USER_APP_PWD__
filter: "(&(objectClass=posixAccount)(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))"
@ -2269,7 +2269,7 @@ email:
# Username/password for authentication to the SMTP server. By default, no
# authentication is attempted.
#
smtp_user: __SYNAPSE_USER_APP__
smtp_user: __APP__
smtp_pass: __SYNAPSE_USER_APP_PWD__
# Uncomment the following to require TLS transport security for SMTP.
@ -2297,12 +2297,12 @@ email:
# Note that the placeholder must be written '%(app)s', including the
# trailing 's'.
#
notif_from: "Your Friendly %(app)s Home Server <__SYNAPSE_USER_APP__@__DOMAIN__>"
notif_from: "Your Friendly %(app)s Home Server <__APP__@__DOMAIN__>"
# app_name defines the default value for '%(app)s' in notif_from and email
# subjects. It defaults to 'Matrix'.
#
app_name: Yunohost Matrix-Synapse
app_name: YunoHost Matrix-Synapse
# Uncomment the following to enable sending emails for messages that the user
# has missed. Disabled by default.

View file

@ -74,7 +74,7 @@ ram.runtime = "50M"
turnserver_alt_tls.exposed = "Both"
cli.default = 5766
#[resources.system_user]
[resources.system_user]
[resources.install_dir]
dir = "/opt/yunohost/matrix-__APP__"

View file

@ -88,13 +88,12 @@ fi
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=3
ynh_system_user_create --username=$synapse_user --home_dir=$install_dir
# The format to create an user account varies depending on the version of YunoHost currently installed.
ynh_current_version=$(dpkg-query --showformat='${Version}' --show yunohost)
if $(dpkg --compare-versions "$ynh_current_version" ge "11.1"); then
yunohost user create $synapse_user_app -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
yunohost user create $app -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
else
yunohost user create $synapse_user_app -f Synapse -l Application -d $domain -p "$synapse_user_app_pwd"
yunohost user create $app -f Synapse -l Application -d $domain -p "$synapse_user_app_pwd"
fi
adduser $synapse_user ssl-cert
adduser turnserver ssl-cert

View file

@ -66,7 +66,6 @@ ynh_secure_remove --file=/etc/nginx/conf.d/${server_name}.d/${app}_server_name.c
# Delete a system user
ynh_system_user_delete --username=$synapse_user
yunohost user delete $synapse_user_app
#=================================================
# END OF SCRIPT

View file

@ -24,7 +24,6 @@ main_domain=$(yunohost domain list --output-as json | jq -r .main)
#=================================================
synapse_user="matrix-$app"
synapse_user_app="$app"
upstream_version=$(ynh_app_upstream_version)
upgrade_type=$(ynh_check_app_version_changed)
final_www_path="/var/www/$app"
@ -103,9 +102,9 @@ if [ -z $synapse_user_app_pwd ]; then
# The format to create an user account varies depending on the version of YunoHost currently installed.
ynh_current_version=$(dpkg-query --showformat='${Version}' --show yunohost)
if $(dpkg --compare-versions "$ynh_current_version" ge "11.1"); then
yunohost user create $synapse_user_app -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
yunohost user create $app -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
else
yunohost user create $synapse_user_app -f Synapse -l Application -d $domain -p "$synapse_user_app_pwd"
yunohost user create $app -f Synapse -l Application -d $domain -p "$synapse_user_app_pwd"
fi
fi