Skip to content

Commit

Permalink
update cors and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
FahadKhalid210 committed Apr 18, 2024
1 parent 8d3b09a commit dc62599
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ Postgresql/Superset settings
- ``CAIRN_POSTGRESQL_PASSWORD`` (default: ``"{{ 20|random_string }}"``): Postgresql password.
- ``CAIRN_SUPERSET_SECRET_KEY`` (default: ``"{{ 20|random_string }}"``): randomly-generated secret key for the Superset frontend.

Add/Update Superset Configurations
----------------------------------

Use ``cairn-superset-settings`` patch to add or update `Superset configurations <https://github.com/apache/superset/blob/master/superset/config.py>`__.
Then apply changes with::
tutor local launch

Troubleshooting
---------------

Expand Down
13 changes: 9 additions & 4 deletions tutorcairn/templates/cairn/apps/superset/superset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,17 @@ class CeleryConfig: # pylint: disable=too-few-public-methods
}

# Embedded Dashboard CORS
OPENEDX_CMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ CMS_HOST }}"

if os.environ.get("FLASK_ENV") == "development":
OPENEDX_CMS_ROOT_URL = "http://{{ CMS_HOST }}:8001"

ENABLE_CORS=True
CORS_OPTIONS={
"supports_credentials": True,
"allow_headers": ["*"],
"resources": ["*"],
'origins': ["{{ LMS_HOST }}","{{ CMS_HOST }}"],
"origins": [
f"{OPENEDX_LMS_ROOT_URL}",
f"{OPENEDX_CMS_ROOT_URL}"
],
}

{{ patch("cairn-superset-settings") }}

0 comments on commit dc62599

Please sign in to comment.