Skip to content

Commit

Permalink
Merge branch 'nightly' into redwood
Browse files Browse the repository at this point in the history
  • Loading branch information
FahadKhalid210 committed Jun 6, 2024
2 parents e7b2312 + d816204 commit be12749
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,21 @@ 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>`__.

e.g, to customize visualizations, add following configurations in ``cairn-superset-settings`` patch::

APP_NAME = "<APP_NAME>"
APP_ICON = "<APP_ICON>"
APP_ICON_WIDTH = <APP_ICON_WIDTH>

Then apply changes with::
tutor local launch

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

Expand Down
1 change: 1 addition & 0 deletions changelog.d/20240416_165758_fahad.khalid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Improvement] Added CORS for embeded Dashboards. (by @Fahadkhalid210)
17 changes: 15 additions & 2 deletions tutorcairn/templates/cairn/apps/superset/superset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,22 @@
db=REDIS_CACHE_DB,
key_prefix="superset_results",
)
OPENEDX_LMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}"
OPENEDX_CMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ CMS_HOST }}"

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

{% if CAIRN_ENABLE_SSO %}
# Authentication
# https://superset.apache.org/docs/installation/configuring-superset/#custom-oauth2-configuration
# https://flask-appbuilder.readthedocs.io/en/latest/security.html#authentication-oauth
from flask_appbuilder.security.manager import AUTH_OAUTH
AUTH_TYPE = AUTH_OAUTH
OPENEDX_LMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}"

OPENEDX_SSO_CLIENT_ID = "{{ CAIRN_SSO_CLIENT_ID }}"
if os.environ.get("FLASK_ENV") == "development":
OPENEDX_LMS_ROOT_URL = "http://{{ LMS_HOST }}:8000"
OPENEDX_SSO_CLIENT_ID = "{{ CAIRN_SSO_CLIENT_ID }}-dev"
OAUTH_PROVIDERS = [
{
Expand Down Expand Up @@ -163,4 +168,12 @@ class CeleryConfig: # pylint: disable=too-few-public-methods
"EMBEDDED_SUPERSET": True
}

ENABLE_CORS=True
CORS_OPTIONS={
"origins": [
f"{OPENEDX_LMS_ROOT_URL}",
f"{OPENEDX_CMS_ROOT_URL}"
],
}

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

0 comments on commit be12749

Please sign in to comment.