Skip to content

Commit 23cdbad

Browse files
committed
Allow to configure WIRECLOUD_HTTPS_VERIFY
1 parent 2f7b1b7 commit 23cdbad

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

1.3/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@
227227
'haystack',
228228
)
229229

230+
# HTTPS verification
231+
verify = os.environ.get("HTTPS_VERIFY", "/etc/ssl/certs/ca-certificates.crt").strip()
232+
WIRECLOUD_HTTPS_VERIFY = True if verify.lower() == "true" else False if verify.lower() == "false" else verify
233+
230234
# Login/logout URLs
231235
LOGIN_URL = reverse_lazy('login')
232236
LOGOUT_URL = reverse_lazy('wirecloud.root')

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ The following environment variables are also honored for configuring your WireCl
6767
- `-e KEYCLOAK_GLOBAL_ROLE=...` (default to "False")
6868
- `-e SOCIAL_AUTH_KEYCLOAK_KEY=...` (defaults to nothing)
6969
- `-e SOCIAL_AUTH_KEYCLOAK_SECRET=...` (defaults to nothing)
70+
- `-e HTTPS_VERIFY=...` (True, False or path to a certificate bundle, default to
71+
"/etc/ssl/certs/ca-certificates.crt"
7072

7173
In addition to those environment variables, this docker image also allows you to
7274
configure the following Django settings using environment variables with the

dev/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@
202202
locals()[setting] = value.lower() == "true"
203203

204204

205+
# HTTPS verification
206+
verify = os.environ.get("HTTPS_VERIFY", "/etc/ssl/certs/ca-certificates.crt").strip()
207+
WIRECLOUD_HTTPS_VERIFY = True if verify.lower() == "true" else False if verify.lower() == "false" else verify
208+
205209
# FIWARE & Keycloak configuration
206210
IDM_AUTH = 'fiware' if "FIWARE_IDM_SERVER" in locals() and "SOCIAL_AUTH_FIWARE_KEY" in locals() and "SOCIAL_AUTH_FIWARE_SECRET" in locals() else None
207211
IDM_AUTH = 'keycloak' if "KEYCLOAK_SERVER" in locals() and "KEYCLOAK_REALM" in locals() and "KEYCLOAK_KEY" in locals() and "SOCIAL_AUTH_KEYCLOAK_KEY" in locals() and "SOCIAL_AUTH_KEYCLOAK_SECRET" in locals() else IDM_AUTH

0 commit comments

Comments
 (0)