Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

fix: add configuration to enable correct redirect_uri #36

Merged
merged 3 commits into from
May 24, 2023
Merged
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,10 @@
JINJA_CONTEXT_ADDONS = {
'can_view_courses': can_view_courses,
}

{% if ENABLE_HTTPS %}
ENABLE_PROXY_FIX = True
FEATURE_FLAGS = {
Copy link
Collaborator

@bmtcril bmtcril May 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As written this will overwrite the FEATURE_FLAGS from above, but I think this is a big enough change that we either want it on or off since it's not really related to HTTPS. Is there a plugin needed for the proxy fix?

Copy link
Contributor Author

@mariajgrimaldi mariajgrimaldi May 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this without the override and I think it works. So we're good. Now, regarding the https issue, I'm no expert so I'll go with what you suggest. Our setups (docker-compose, k8s) are behind a proxy (caddy, a lb) so we needed the change in both cases. Maybe someone won't. Should we use something like SUPERSET_ENABLE_PROXY_FIX?

Is there a plugin needed for the proxy fix?

No, this is part of the superset config: https://github.com/apache/superset/blob/master/superset/config.py#L273-L277

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably make it a flag, sadly. For instance I think that running tutor dev doesn't use the caddy proxy. Otherwise looks good!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running tutor dev the setting ENABLE_HTTPS should be False so we're good as it is right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I'll follow these changes instead:

{% 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
{% endif %}

From the tutor-cairn plugin

"DYNAMIC_PLUGINS": True
}
{% endif %}