-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDAP authentication #8
Comments
more info: I use port 389 over TLS for ldap authentication with a user login filter |
This one has me stumped .. updated and tested with espocrm/espocrm:7-apache .. I'm not sure the difference in the docker-compose build vs buildkit dockerhub image. |
Please let me know what LDAP (AD, OpenLDAP) server do you use? |
Hi, I attached a screenshot. The error message from the DEBUG log was ERROR: LDAP: Could not connect to LDAP server [XXXXXXXXXX], details: 0x5b (Connect error; (unknown error code)): XXXXXXXXXX:389 [] [] In case there was a compatibility problem I also updated docker and docker-compose on the host server. If I docker-compose build the resulting image works fine. If I use the one from docker hub it can't connect to ldap. We use an OpenLDAP server |
It seems you have the same problem as me. The docker hub image has some problems with establishing a secure connection (or perhaps with locating the CA cert). When you try connecting using an encryption, it can't locate the CA cert, hence the error. If you try an unsecure connection, most likely it'll succeed... |
@Mexonizator We don't have the option of using an insecure connection; that would be irresponsible anyway. Do you get the same message in your DEBUG logs? I'm curious if building the image would also work for you then? I'm not certain it's a certificate error. |
Agree, as for production, I wouldn't use an unsecure connection either. Yes, if I try TLS, I get the same as you:
If try SSL, it's slightly different:
So, the error basically is the same. As for the building I haven't tried it yet. If I have time, I'll test it. But I hope the devs would investigate and fix the image. |
Yeah, It's most likely the same issue then. I haven't compared the resulting images yet, but was comparing image layers in the containers and they seem the same. I'm thinking it may be something with the multi-platform build and the detection for the php ldap libraries install. I haven't had a chance to dig deeper yet. |
I did a quick image comparison and found that the docker hub image was updated to Debian bullseye. The image in the apache build is still buster. I did a quick test by using the php:7.4-apache-bullseye image and found that is the culprit. The install script probably needs updated for bullseye. |
I'm still going through the bullseye updates needed for the default image switch in the php:7.4-apache image. A quick fix is to use php:7.4-apache-buster for now in your docker hub images. The first hurdle was referenced here ... and solved by adding libldap-common. This alone didn't fix the TLS issue yet in the new docker hub images. |
The php:7.4-apache updated from buster to bullseye. It no longer includes libldap-common by default (link above). You can either use php:7.4-apache-buster or add libldap-common to the base image. I would suggest adding that package at the beginning to avoid the apt-purge later or add in both to your "install php libs" and "install required libs" code blocks. |
Some quick additional testing shows you only need to add it for the "install required libs" and isn't needed for the php install. |
Thank you! With the help from the lib you mentioned I finally found a quick and dirty way to fix the problem. So, all you need is to:
And it'd work like a charm! But of course I'd like to see a proper fix from the devs... |
Yeah, It's simply missing that package. I'm using this Dockerfile right now till it's added to the docker images. FROM espocrm/espocrm:7-apache RUN apt-get update && apt-get install -y --no-install-recommends Our CA cert is already installed with debian so we didn't need that. |
Thanks for your suggestion. Fixed 417b529. |
Unfortunately that doesn't fix it as you are using apt-mark and apt-get purge with auto-remove. The package doesn't end up in the final docker image. You need to install it here https://github.com/espocrm/docker/blob/master/Dockerfile-debian.template#L65 or put it outside of your apt-mark. |
EspoCRM 6.1.10, and 6.1.9
LDAP authentication not working in Docker Hub image. LDAP Authentication working fine when I build using...
docker-compose.yml
CI job
Ldap authentication has been working for multiple versions. I wanted to switch to Docker Hub image. When trying to use docker hub image authentication will not work. I can easily swap in/out docker hub image and going from working to not working and vice versa. Here was the image I tried...
docker-compose.yml
I'm not sure what the differences are/or if you are missing ldap libraries in the docker hub version.
The text was updated successfully, but these errors were encountered: