matrixsynapse: Enable LDAP integration

Signed-off-by: Hemanth Kumar Veeranki <hemanthveeranki@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Hemanth Kumar Veeranki 2017-10-11 16:17:30 +05:30 committed by Sunil Mohan Adapa
parent 4e7a2a1d3e
commit 025cf4dd2c
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 21 additions and 1 deletions

View File

@ -21,7 +21,11 @@
Configuration helper for Matrix-Synapse server.
"""
import argparse
import collections
from ruamel.yaml import round_trip_dump, round_trip_load
from ruamel.yaml.scalarstring import DoubleQuotedScalarString as __
from plinth import action_utils
from plinth.modules.matrixsynapse import CONFIG_FILE_PATH
@ -58,6 +62,22 @@ def subcommand_post_install(_):
if listener['port'] == 8448:
listener['bind_address'] = '0.0.0.0'
# Setup ldap parameters
config.insert(0, 'password_providers', [{}])
config['password_providers'][0]['module'] = __(
'ldap_auth_provider.LdapAuthProvider')
ldap_config = {
'enabled': True,
'uri': __('ldap://localhost:389'),
'start_tls': False,
'base': __('ou=users,dc=thisbox'),
'attributes': {
'uid': __('uid'),
'name': __('uid'),
'mail': __('')
}
}
config['password_providers'][0]['config'] = ldap_config
with open(CONFIG_FILE_PATH, 'w') as config_file:
round_trip_dump(config, config_file)

View File

@ -36,7 +36,7 @@ version = 1
managed_services = ['matrix-synapse']
managed_packages = ['matrix-synapse']
managed_packages = ['matrix-synapse', 'matrix-synapse-ldap3']
name = _('Matrix Synapse')