-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Use a dedicated LDAP host and port for background jobs if configured #35229
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
Conversation
| $ldapLogin = @$this->ldap->bind($cr, | ||
| $this->configuration->ldapAgentName, | ||
| $this->configuration->ldapAgentPassword); | ||
| $this->configuration->ldapAgentName, |
Check notice
Code scanning / Psalm
PossiblyNullArgument
| $this->configuration->ldapAgentName, | ||
| $this->configuration->ldapAgentPassword); | ||
| $this->configuration->ldapAgentName, | ||
| $this->configuration->ldapAgentPassword); |
Check notice
Code scanning / Psalm
PossiblyNullArgument
|
I pushed a commit to make code clearer, but it makes it clear that there is a logic flaw: When in CLI, background host is used and backuphost is not used even if backgroundhost do not answer. But, if backuphost is used by web UI because a fallback, then it will be used in CLI as well because of the cache. So we need to decide to either:
(These is considering there is a backgroundhost configured, if not we always fallback if needed to keep the same behavior as before) |
|
(There is also the question what to do when backup host is forced from admin settings, should that apply to cli if there is a background host?) |
I would say so (provided that backuphost differs from background host) |
Ok, makes sense to me to always fallback to the backup if first host is not answering. The problem with that is that we’ll need to split cache into 2 vars, to not go to backup for CLI when main is down but backgroundHost is still working. |
|
|
/rebase |
| $this->bindResult = []; | ||
| $bindStatus = $this->bind(); | ||
| $error = $this->ldap->isResource($this->ldapConnectionRes) ? | ||
| $this->ldap->errno($this->ldapConnectionRes) : -1; |
Check notice
Code scanning / Psalm
PossiblyNullArgument
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Now forcing backup host applies to both main and background. And background will fallback to backup if not responding. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
ce86ffe to
6b7ffcd
Compare
|
rebased |
blizzz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
Signed-off-by: Côme Chilliet come.chilliet@nextcloud.com