From 2a08c3d251ec0d7bd3f155320b826e888126d336 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 31 Jan 2023 20:01:42 +0100 Subject: [PATCH] Move ldap config to secrets --- annuaire/settings/common.py | 20 ++------------------ annuaire/settings/secret_example.py | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/annuaire/settings/common.py b/annuaire/settings/common.py index 65bc2ba..064f0c3 100644 --- a/annuaire/settings/common.py +++ b/annuaire/settings/common.py @@ -119,21 +119,5 @@ LOGOUT_REDIRECT_URL = reverse_lazy("home") AUTHENS_USE_OLDCAS = False AUTHENS_USE_PASSWORD = False -LDAP = { - "SPI": { - "PROTOCOL": "ldaps", - "URL": "ldap.spi.ens.fr", - "PORT": 636, - }, - "CRI": { - "PROTOCOL": "ldap", - "URL": "annuaire.ens.fr", - "PORT": 389, - }, -} - -ANNUAIRE = { - "PROTOCOL": "http", - "URL": "annuaireweb.ens.fr", - "PORT": 80, -} +LDAP = get_secret("LDAP") +ANNUAIRE = get_secret("ANNUAIRE") diff --git a/annuaire/settings/secret_example.py b/annuaire/settings/secret_example.py index 163a0aa..e87c8e7 100644 --- a/annuaire/settings/secret_example.py +++ b/annuaire/settings/secret_example.py @@ -2,3 +2,22 @@ SECRET_KEY = "$=kp$3e=xh)*4h8(_g#lprlmve_vs9_xv9hlgse%+uk9nhc==x" ADMINS = None SERVER_EMAIL = "root@localhost" EMAIL_HOST = None + +LDAP = { + "SPI": { + "PROTOCOL": "ldaps", + "URL": "ldap.example.com", + "PORT": 636, + }, + "CRI": { + "PROTOCOL": "ldap", + "URL": "ldap.example.com", + "PORT": 636, + }, +} + +ANNUAIRE = { + "PROTOCOL": "http", + "URL": "annuaire.example.com", + "PORT": 80, +}