From bbed506cd28ac8b921de2c862eca2c052f6b68c8 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Fri, 12 May 2023 15:22:51 -0400 Subject: [PATCH 1/3] fix: add configuration to enable correct redirect_uri --- .../superset/apps/pythonpath/superset_config_docker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py b/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py index 5db9a24..0e40ad0 100644 --- a/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py +++ b/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py @@ -90,3 +90,9 @@ JINJA_CONTEXT_ADDONS = { 'can_view_courses': can_view_courses, } + +PREFERRED_URL_SCHEME = "https" +ENABLE_PROXY_FIX = True +FEATURE_FLAGS = { + "DYNAMIC_PLUGINS": True +} From ffae3630b74e0d9635dd59071547d7473b898679 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Fri, 12 May 2023 16:42:52 -0400 Subject: [PATCH 2/3] fix: add configuration to enable correct redirect_uri --- .../superset/apps/pythonpath/superset_config_docker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py b/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py index 0e40ad0..5dbb8ee 100644 --- a/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py +++ b/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py @@ -91,8 +91,9 @@ 'can_view_courses': can_view_courses, } -PREFERRED_URL_SCHEME = "https" +{% if ENABLE_HTTPS %} ENABLE_PROXY_FIX = True FEATURE_FLAGS = { "DYNAMIC_PLUGINS": True } +{% endif %} From 099ea33f358c60cd322930e96139caa2d3fafb8a Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Tue, 23 May 2023 17:14:37 -0400 Subject: [PATCH 3/3] fix: add configuration to enable correct redirect_uri Fix inspired by these changes: https://github.com/overhangio/tutor-cairn/commit/490565333ee950640ca841f0a093721ae9328cb1 --- .../superset/apps/pythonpath/superset_config_docker.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py b/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py index 5dbb8ee..e2f7256 100644 --- a/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py +++ b/tutorsuperset/templates/superset/apps/pythonpath/superset_config_docker.py @@ -91,9 +91,8 @@ 'can_view_courses': can_view_courses, } -{% if ENABLE_HTTPS %} +{% if not ENABLE_WEB_PROXY %} +# Caddy is running behind a proxy: Superset needs to handle x-forwarded-* headers +# https://flask.palletsprojects.com/en/latest/deploying/proxy_fix/ ENABLE_PROXY_FIX = True -FEATURE_FLAGS = { - "DYNAMIC_PLUGINS": True -} {% endif %}