paperless-ng icon indicating copy to clipboard operation
paperless-ng copied to clipboard

Add LDAP auth support

Open dani opened this issue 2 years ago • 24 comments

I needed LDAP auth to use paperless (which I'm evaluating as a personal document management system), so, I've hacked it. It's pretty basic, only support users (not groups or fancy searches) but should fit most needs. Tested against a samba4 (AD style) directory only, but should work with most directories

dani avatar Aug 04 '21 21:08 dani

Please rebase this on the dev branch.

jonaswinkler avatar Aug 18 '21 19:08 jonaswinkler

  • Also, some dependencies are missing for the build, apparently some header files required to build the python wheel.
  • paperless ng uses Pipenv. Please install packages with "pipenv install --keep-outdated" and then generate the requirements.txt with "pipenv lock -r > requirements.txt".

jonaswinkler avatar Aug 19 '21 15:08 jonaswinkler

OK, I'll try to update the PR as soon as I have some spare time :-)

dani avatar Aug 24 '21 12:08 dani

Sorry, wrong push on my fork closed this PR, so reopening. I could rebase but the pipenv commands do not change anything in requirements.txt.

dani avatar Aug 25 '21 22:08 dani

I've added the missing dependencies to the Dockerfile and in ansible/tasks/main.yml (libldap2-dev and libsasl2-dev), now the ansible test is passing, but the build-release is still failing. Where should I specify those dependencies for the build to succeed ?

dani avatar Aug 26 '21 12:08 dani

any hint ?

dani avatar Aug 27 '21 15:08 dani

@dani I looked at the build log, and it appears that the ldap development packages need to be added to the apt package install list. I would try adding these, and see if the build then completes.

libsasl2-dev
python-dev
libldap2-dev
libssl-dev

tfmm avatar Sep 03 '21 12:09 tfmm

But where's this list defined ? Is it the one in the Dockerfile or elsewhere ?

dani avatar Sep 03 '21 12:09 dani

The portion of the build that's failing appears to be docker, so yes, it should be the list in the Dockerfile.

tfmm avatar Sep 03 '21 12:09 tfmm

Looks like it's still failing on the lber.h (which should be installed with libldap2-dev)...

dani avatar Sep 03 '21 15:09 dani

Hello I use paperless-ng and want to integrate it in app catalog of the project YunoHost, but for better support they require to have LDAP support. Can this PR be more under development please

andretheolauret avatar Sep 10 '21 03:09 andretheolauret

I'd like to go foward but I really have no idea why is the test build failing.

dani avatar Sep 10 '21 06:09 dani

I'd like to go foward but I really have no idea why is the test build failing.

I think it’s because you need this sudo apt-get install libldap2-dev

andretheolauret avatar Sep 10 '21 07:09 andretheolauret

I'd like to go foward but I really have no idea why is the test build failing.

I think it’s because you need this sudo apt-get install libldap2-dev

Are you sure the CI have this ?

andretheolauret avatar Sep 10 '21 07:09 andretheolauret

Here you can find some answer https://stackoverflow.com/questions/4768446/i-cant-install-python-ldap

andretheolauret avatar Sep 10 '21 07:09 andretheolauret

Well, I've added the dependencies in the Dockerfile. If they have to be specified somewhere else, I have no idea where

dani avatar Sep 10 '21 11:09 dani

I dont see Also error with, so i think you should mention project maintainer may he will can help you better

andretheolauret avatar Sep 10 '21 16:09 andretheolauret

@dani in the .github/workflows/ci.yaml directory you'll probably need to add the dependencies as well

Line 188 and following ones I'd guess

TheFehr avatar Sep 10 '21 18:09 TheFehr

Looks like the build is now successful. Only the test coverage slightly decreased. Is this enough for the PR to be merged ?

dani avatar Sep 16 '21 12:09 dani

Would be great having this feature :)

maxulm avatar Oct 08 '21 05:10 maxulm

Update?

telvgehc avatar Jan 28 '22 07:01 telvgehc

Puh-leeez? :)

christianreiss avatar Apr 07 '22 12:04 christianreiss

Yea... Waiting on this before I can do a rollout of it to my family...

hydrian avatar May 03 '22 17:05 hydrian

I would love to test this feature :)

Marook332 avatar May 25 '22 14:05 Marook332