From 03c5ec75db8d0eefa66cd33a24532d933575d7b8 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Mon, 13 Apr 2020 19:29:12 +0200 Subject: [PATCH] Change simpleldap username --- conf/init_calibre_db_ldap_settings | 2 +- sources/patches/app-simpleldap.patch | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 sources/patches/app-simpleldap.patch diff --git a/conf/init_calibre_db_ldap_settings b/conf/init_calibre_db_ldap_settings index b0f6871..edba7e3 100644 --- a/conf/init_calibre_db_ldap_settings +++ b/conf/init_calibre_db_ldap_settings @@ -2,7 +2,7 @@ config_login_type=1, config_ldap_provider_url=\'localhost\', config_ldap_port=389, config_ldap_schema=\'ldap\', -config_ldap_serv_username=\'nicolas\', +config_ldap_serv_username=\'cn=admin,dc=yunohost,dc=org\', config_ldap_serv_password=\'eXVub2hvc3RfZGV2\', config_ldap_dn=\'ou=users,dc=yunohost,dc=org\', config_ldap_user_object=\'uid=%s\', diff --git a/sources/patches/app-simpleldap.patch b/sources/patches/app-simpleldap.patch new file mode 100644 index 0000000..cbf869a --- /dev/null +++ b/sources/patches/app-simpleldap.patch @@ -0,0 +1,12 @@ +--- a/cps/services/simpleldap.py 2020-02-23 09:08:01.000000000 +0100 ++++ b/cps/services/simpleldap.py 2020-04-13 18:57:49.302535092 +0200 +@@ -35,8 +35,7 @@ + app.config['LDAP_HOST'] = config.config_ldap_provider_url + app.config['LDAP_PORT'] = config.config_ldap_port + app.config['LDAP_SCHEMA'] = config.config_ldap_schema +- app.config['LDAP_USERNAME'] = config.config_ldap_user_object.replace('%s', config.config_ldap_serv_username)\ +- + ',' + config.config_ldap_dn ++ app.config['LDAP_USERNAME'] = config.config_ldap_serv_username + app.config['LDAP_PASSWORD'] = base64.b64decode(config.config_ldap_serv_password) + app.config['LDAP_REQUIRE_CERT'] = bool(config.config_ldap_require_cert) + if config.config_ldap_require_cert: