Use Yunohost LDAP from server containers

Hi

I would like to use the YH LDAP as a LDAP server for some containerized app. I can perfom ldapsearch from the host machine SSH as expected. But from the shell within a container i can’t reach it
I tried with FQDN, ip, gateway IP, extra host, etc. I tried to add “slapd: ALL : ALL” in hosts.allow (at least to test) but i can’t reach the ldap from any container

Any idea how i could do that ?

Thanks

Could you please put the output of sudo ss -tulnp | grep slapd ?
In my case, it listen on port 389 only for requests from 127.0.0.1, but on port 636 from anywhere.

I know nothing about slapd but it can give some hints.

1 Like

Slapd is configured to only listen to localhost, you need to tweak its configuration to allow other networks.

The file is at /etc/ldap/ldap.conf, edit its URI accordingly (cf. man ldap.conf) and restart slapd service.

2 Likes

Outch i missed the reply ! I will try that after the bookworm upgrade completion !

Check the status of the file after the upgrade, I believe some tweaks have been done recently on that part.

So now that bookworm is up and running on my VPS i tested the connection to the LDAP
I have changed the file /etc/default/slapd to allow connection from docker and it works … but as said in the post below it will lock the server on the next reboot due to the startup sequence. I have to find another solution like redirect the outgoing flow from my container to the localhost 389 port