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

Fix LDAP_SERVER_PORT not being used #183

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions githubapp/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class LDAPClient:
def __init__(self):
# Read settings from the config file and store them as constants
self.LDAP_SERVER_HOST = os.environ["LDAP_SERVER_HOST"]
self.LDAP_SERVER_PORT = os.environ["LDAP_SERVER_PORT"]
self.LDAP_BASE_DN = os.environ["LDAP_BASE_DN"]
self.LDAP_USER_BASE_DN = os.environ["LDAP_USER_BASE_DN"]
self.LDAP_USER_ATTRIBUTE = os.environ["LDAP_USER_ATTRIBUTE"]
Expand Down Expand Up @@ -73,10 +72,17 @@ def __init__(self):
)
else:
self.tls = None
if "LDAP_SERVER_PORT" in os.environ:
self.LDAP_SERVER_PORT = os.environ["LDAP_SERVER_PORT"]
else:
if self.LDAP_USE_SSL:
self.LDAP_SERVER_PORT = 636
else:
self.LDAP_SERVER_PORT = 389

self.srv = Server(
host=self.LDAP_SERVER_HOST,
port=self.LDAP_SERVER_HOST,
port=self.LDAP_SERVER_PORT,
use_ssl=self.USE_SSL,
tls=self.tls,
)
Expand Down
Loading