From a1ab50dcf1ecb3b2505b7b7920a1efe815b283d7 Mon Sep 17 00:00:00 2001 From: MCMic Date: Thu, 23 May 2019 14:49:27 +0000 Subject: [PATCH] Add indexes for fields listed by slapd in the logs I get lots of suggestion of indexes by slapd in my logs: <= mdb_equality_candidates: (cn) not indexed <= mdb_equality_candidates: (gidNumber) not indexed <= mdb_equality_candidates: (mail) not indexed <= mdb_equality_candidates: (member) not indexed <= mdb_equality_candidates: (memberUid) not indexed <= mdb_equality_candidates: (sudoUser) not indexed <= mdb_equality_candidates: (uidNumber) not indexed <= mdb_equality_candidates: (uniqueMember) not indexed <= mdb_equality_candidates: (virtualdomain) not indexed <= mdb_substring_candidates: (sudoUser) not indexed Since Yunohost makes it hard to edit LDAP server configuration (see https://github.com/YunoHost/issues/issues/1350), the default configuration should contain indexes for the fields used by Yunohost a lot. --- data/templates/slapd/slapd.conf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/data/templates/slapd/slapd.conf b/data/templates/slapd/slapd.conf index c8c363795..cc7ac9230 100644 --- a/data/templates/slapd/slapd.conf +++ b/data/templates/slapd/slapd.conf @@ -63,9 +63,13 @@ suffix "dc=yunohost,dc=org" directory "/var/lib/ldap" # Indexing options for database #1 -index objectClass eq -index uid eq,sub -index entryCSN,entryUUID eq +index objectClass eq +index uid,sudoUser eq,sub +index entryCSN,entryUUID eq +index cn,mail eq +index gidNumber,uidNumber eq +index member,memberUid,uniqueMember eq +index virtualdomain eq # Save the time that the entry gets modified, for database #1 lastmod on