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

Allow to configure LDAP startup check (retries, enable/disable) #5989

Open
2 tasks done
rhafer opened this issue Sep 12, 2023 · 4 comments
Open
2 tasks done

Allow to configure LDAP startup check (retries, enable/disable) #5989

rhafer opened this issue Sep 12, 2023 · 4 comments
Labels
priority/4/normal Normal priority items status/needs-design Requires thoughtful design type/feature Request for adding a new feature

Comments

@rhafer
Copy link

rhafer commented Sep 12, 2023

Description

When starting authelia there is a startup check for the LDAP server. Opening a connection to the server, reading the RootDSE and checking certain supported features. This creates issues when e.g. using a single docker-compose that starts the LDAP server and Authelia in parallel. I think it would be great if the startup check would at least retry the LDAP connection a couple of time (with a little backoff timeout) or if that check could be disabled completely.

Use Case

Starting Authelia and LDAP server in parallel.

Details

No response

Documentation

No response

Pre-Submission Checklist

  • I agree to follow the Code of Conduct

  • I have checked for related issues and checked the documentation

@rhafer rhafer added priority/4/normal Normal priority items status/needs-design Requires thoughtful design type/feature Request for adding a new feature labels Sep 12, 2023
@james-d-elliott
Copy link
Member

james-d-elliott commented Sep 12, 2023

Startup order is a job for the service / orchestration tool you're using in my opinion. In this case it's docker compose. For which there are multiple solutions already available:

I don't see connecting to LDAP as an optional check, skipping the RootDSE check is something we already do however the LDAP server must be serviceable at startup time. I also don't see it as viable to add this complex logic which is very hard to test properly when solutions already solve this problem.

@rhafer
Copy link
Author

rhafer commented Sep 13, 2023

Isn't the same true for the storage db connection check at startup? AFAICS there is at least a retry mechanism in place for that one. A very simple one, but still ...

Still thanks for the hint about the long syntax for depends_on I didn't know about the condition flag yet. I only knew the short syntax, which does not really help for this kind of problem.

@james-d-elliott
Copy link
Member

I can see if the LDAP library has a similar implementation that allows for a simple check but I'm fairly sure it does not.

@rhafer
Copy link
Author

rhafer commented Sep 14, 2023

There is no specific LDAP ping request but checking the Bind Response (or the StartTLS response) for the ldap.ErrorNetwork error should do the trick.

I can try to come up with a patch for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/4/normal Normal priority items status/needs-design Requires thoughtful design type/feature Request for adding a new feature
Projects
None yet
Development

No branches or pull requests

2 participants