dnknth / ldap-ui

Minimalistic web frontend for OpenLDAP
MIT License
370 stars 28 forks source link

Manual install? #57

Closed mtissington closed 6 months ago

mtissington commented 6 months ago

I'm a little confused how this runs. Can I install and run it on nginx and if so how? Does it need to be in a virtual environment?

Thanks

dnknth commented 6 months ago

Hello @mtissington,

ldap-ui consists of the TypeScript frontend and the Python backend. A local install is possible but unfortunately the README does not fully spell it out.

For the frontend, npm run build assembles everything in the dist directory. Obviously, npm should be available on the machine / container where this happens. It can be the web server, but I always do it on a development box and then copy the dist folder to the remote box. The result can then be served directly via the backend (during development), or statically by any other web server (remotely).

The backend translates parts of the LDAP protocol as a stateless ReST API for use by the frontend. You can run it locally anywhere, but always as a separate process. There is an example systemd unit in etc/ldap-ui.service. Most people would prefer a virtual environment such that the dependencies from requirements.txt do not clash with other Python processes, but YMMV.

The best reference for local build rules is the provided Makefile. When the backend is run with systemd or make run, the API is available on localhost, port 5000, which is fine for a dev box, but not reachable from outside on a remote box.

So, to have it served remotely via nginx, let's assume that everything should appear under the HTTP path /ldap:

Hope this clarifies it.

mtissington commented 6 months ago

Hello and thanks for the detailed answer ... thinking about docker (which sounds easier) .. I have my ldap server using a socket, ldapi:/// I'm totally new with docker, can I configure the docker image to use host socket for ldap?

dnknth commented 6 months ago

You can probably mount the socket (/run/slapd/ldapi on Debian) into the ldap-ui container, access rights should be no problem as it is world-writable by default. I have not tried it myself, but there are plenty of socket-binding examples for Docker on the internet.

dnknth commented 6 months ago

No further activity → closed