Skip to content
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

Authentication over ldap needs some logging #4385

Closed
yennor opened this issue Aug 25, 2020 · 7 comments
Closed

Authentication over ldap needs some logging #4385

yennor opened this issue Aug 25, 2020 · 7 comments
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@yennor
Copy link

yennor commented Aug 25, 2020

Is your feature request related to a problem? Please describe.
I'm using the docker image of weblate and just lost about 45 minutes trying to setup the ldap authentication. In the ip address of the ldap server I've had a mistake. But since there wasn't a single error message in the log file (i've activated debug), I was playing around forever with the dn_templte, dn_search etc. settings (which by the way are pretty bad documented). I've needed to read through settings_docker.py to be sure how they work.
Now everything is working. But still there is not a single mentioning of ldap or authentication in the logs.

Describe the solution you'd like
Give some log output, especially when something isn't working.

@nijel
Copy link
Member

nijel commented Aug 26, 2020

In shipped example configuration verbose LDAP logging is enabled when DEBUG mode is set:

# Django Authentication Using LDAP
"django_auth_ldap": {"handlers": [DEFAULT_LOG], "level": DEFAULT_LOGLEVEL},

Even without that, it should log errors. What is your logging configuration?

@nijel nijel added the question This is more a question for the support than an issue. label Aug 26, 2020
@github-actions
Copy link

This issue looks like a support question. We try to answer these reasonably fast, but in case you are looking for faster resolution, please consider purchasing support subscription and make Weblate stronger.

@yennor
Copy link
Author

yennor commented Aug 26, 2020

Nah, no support question. I've got everything working and am not planing to change the configuration again ;-).
My logging configuration is:
services:
weblate:
environment:
WEBLATE_DEBUG: 1

I can send you the whole log produced by docker if you want to. But I can guarantee you, there's no mention of ldap, dn, cn inside (that were the words I was grepping for).

@nijel
Copy link
Member

nijel commented Aug 26, 2020

On the other side, I've seen such logs in several cases :-). What version do you use? WEBLATE_LOGLEVEL not set?

@yennor
Copy link
Author

yennor commented Aug 27, 2020

I've just tried out:
WEBLATE_DEBUG: 1
WEBLATE_LOGLEVEL: DEBUG

and setting an invalid ldap server. => I can't log in ;-).
But not a single error message in the log file or any mentioning of ldap.
I'm using Weblate 4.2.1 with the current weblate docker-compose project. According to git pull it is uptodate.

@nijel
Copy link
Member

nijel commented Aug 27, 2020

Okay, just tried it, the log contains:

weblate_1   | uwsgi stderr | WARNING Caught LDAPError while authenticating fads: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'errno': 22, 'ctrls': [], 'info': 'Invalid argument'})

My docker-compose.override.yml:

version: '3'
services:
  weblate:
    ports:
      - 80:8080
    environment:
      WEBLATE_SITE_DOMAIN: 127.0.0.1
      WEBLATE_AUTH_LDAP_SERVER_URI: ldap://ldap.example.org
      WEBLATE_AUTH_LDAP_USER_DN_TEMPLATE: uid=%(user)s,ou=People,dc=example,dc=net
      WEBLATE_AUTH_LDAP_USER_ATTR_MAP: first_name:name,email:mail

@stale
Copy link

stale bot commented Sep 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Nobody will work on this. label Sep 7, 2020
@stale stale bot closed this as completed Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.
Projects
None yet
Development

No branches or pull requests

2 participants