[ldap] Add ldap domain socket (ldapi:///) support
See ##7737 for a description of the issue. That bug was closed in May 2019, but in my 20.0.2 installation of nextcloud, the problem is still present.
I have identified the files that require changes in the user_ldap app:
- lib/Connection.php (backend)
- lib/LDAP.php (backend)
- lib/Wizard.php (frontend)
Making the changes to the backend files as done previously by @nick-dumas in his commit https://github.com/nick-dumas/server/commit/72b8054567b7cac4633616239ea18f49e08a5212 has proven to work for me, so I intend to make the required changes and then send in a PR.
Thanks @zenlord. I ran a patched version for a while and it worked for me, so feel free to use my changes.
I'm struggling with the frontend patch. I have made the required changes to get the Wizard to respond 'Configuration OK', but the tab headings for 'Users', 'Login Attributes' etc. stay greyed out and do not become available.
@nextcloud/ldap @blizzz any hints where the checks to enable these tabs can be found so I can send in a pull request?
@zenlord this probably depends on ajax/testConfiguration.php which eventually triggers the doCriticalValidation() in lib/Connection.php. But the changes on the linked commit should deal with it. Maybe you double check that?
@blizzz At first I thought my configuration was at fault, but even after resetting to default I still was unable to switch tabs in the LDAP settings section.
The ajax/ folder doesn't contain anything relevant, but the js/wizard/ folder does (83 hits for 'port' spread over 20 files :( ), and it seems that quite some checks are triggering an auto-detection of the port number. I'll do some further digging, but JS is not my strongsuit.
I made some progress by adding an additional condition in two functions inside js/wizard/view.js:
basicStatusCheck()
if((host && port && base) && ((!agent && !pwd) || (agent && pwd))) {
view.enableTabs();
} else if((host && base && host.indexOf('ldapi://') > -1 ) && ((!agent && !pwd) || (agent && pwd))) {
view.enableTabs();
} else {
view.disableTabs();
}
(and similar in functionalityCheck()
But the behaviour is erratic: e.g. the check for a username returns 'user found', but the count for users returns 0 ...
Errors were indeed in my configuration (and in me misunderstanding the 'edit Query filter' functionality - one has to click the underlined text for the filter in the textfield to become active...). I'll send in a pull request over the weekend.
Not sure what I have to do. I have filed a pull request that solves this issue almost one year ago, and I am able to apply the patches manually to versions 20, 21 and now also 22.2.3. The PR just sits there. https://github.com/nextcloud/server/pull/24574 Am I doing something wrong?
@zenlord #24574 is merged now, is this issue resolved?
Yes, I just upgraded this instance to v26.0.3 and I no longer have to patch the source files myself.