Skip to content

Commit

Permalink
feat: create Superset LMS admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Oct 13, 2023
1 parent 6c8cb82 commit cef50fd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tutoraspects/patches/openedx-common-settings
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG = {
"database": "{{ ASPECTS_EVENT_SINK_DATABASE }}",
"timeout_secs": {{ ASPECTS_EVENT_SINK_CLICKHOUSE_TIMEOUT_SECS }}
}
SUPERSET_CONFIG = {
"service_url": "http://superset:{{ SUPERSET_PORT }}/",
"host": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ SUPERSET_HOST }}",
"username": "{{ SUPERSET_LMS_USERNAME }}",
"password": "{{ SUPERSET_LMS_PASSWORD }}",
"email": "{{ SUPERSET_LMS_EMAIL }}",
}
7 changes: 7 additions & 0 deletions tutoraspects/patches/openedx-development-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SUPERSET_CONFIG = {
"service_url": "http://superset:{{ SUPERSET_PORT }}/",
"host": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ SUPERSET_HOST }}:{{ SUPERSET_PORT }}",
"username": "{{ SUPERSET_LMS_USERNAME }}",
"password": "{{ SUPERSET_LMS_PASSWORD }}",
"email": "{{ SUPERSET_LMS_EMAIL }}",
}
3 changes: 3 additions & 0 deletions tutoraspects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
},
),
("SUPERSET_ADMIN_EMAIL", "admin@openedx.org"),
("SUPERSET_LMS_EMAIL", "lms@openedx.org"),
("SUPERSET_OWNERS", []),
# Set to 0 to have no row limit.
("SUPERSET_ROW_LIMIT", 100_000),
Expand Down Expand Up @@ -409,6 +410,8 @@
("SUPERSET_OAUTH2_CLIENT_SECRET", "{{ 16|random_string }}"),
("SUPERSET_ADMIN_USERNAME", "{{ 12|random_string }}"),
("SUPERSET_ADMIN_PASSWORD", "{{ 24|random_string }}"),
("SUPERSET_LMS_USERNAME", "{{ 12|random_string }}"),
("SUPERSET_LMS_PASSWORD", "{{ 24|random_string }}"),
]
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ superset fab create-admin \
--lastname Admin \
--email "{{ SUPERSET_ADMIN_EMAIL }}"

superset fab create-admin \
--username "{{ SUPERSET_LMS_USERNAME }}" \
--password "{{ SUPERSET_LMS_PASSWORD }}" \
--firstname LMS \
--lastname Admin \
--email "{{ SUPERSET_LMS_EMAIL }}"

# Update the password of the Admin user
# (in case it changed since the user was created)
superset fab reset-password \
Expand Down

0 comments on commit cef50fd

Please sign in to comment.