mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
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:
parent
4e7a2a1d3e
commit
025cf4dd2c
@ -21,7 +21,11 @@
|
|||||||
Configuration helper for Matrix-Synapse server.
|
Configuration helper for Matrix-Synapse server.
|
||||||
"""
|
"""
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
import collections
|
||||||
|
|
||||||
from ruamel.yaml import round_trip_dump, round_trip_load
|
from ruamel.yaml import round_trip_dump, round_trip_load
|
||||||
|
from ruamel.yaml.scalarstring import DoubleQuotedScalarString as __
|
||||||
from plinth import action_utils
|
from plinth import action_utils
|
||||||
from plinth.modules.matrixsynapse import CONFIG_FILE_PATH
|
from plinth.modules.matrixsynapse import CONFIG_FILE_PATH
|
||||||
|
|
||||||
@ -58,6 +62,22 @@ def subcommand_post_install(_):
|
|||||||
if listener['port'] == 8448:
|
if listener['port'] == 8448:
|
||||||
listener['bind_address'] = '0.0.0.0'
|
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:
|
with open(CONFIG_FILE_PATH, 'w') as config_file:
|
||||||
round_trip_dump(config, config_file)
|
round_trip_dump(config, config_file)
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ version = 1
|
|||||||
|
|
||||||
managed_services = ['matrix-synapse']
|
managed_services = ['matrix-synapse']
|
||||||
|
|
||||||
managed_packages = ['matrix-synapse']
|
managed_packages = ['matrix-synapse', 'matrix-synapse-ldap3']
|
||||||
|
|
||||||
name = _('Matrix Synapse')
|
name = _('Matrix Synapse')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user