Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Be able to login to bare-metal studio easily. #35172

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
19 changes: 17 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,33 @@ sites)::
./manage.py lms collectstatic
./manage.py cms collectstatic

Copy link
Member

Choose a reason for hiding this comment

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

commit should be docs: not feat:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's feat because of the change to devstack.py which adds new behavior being able to take a setting from the config file but happy to split them if you'd like.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough

Setup Studio SSO for Development::
feanil marked this conversation as resolved.
Show resolved Hide resolved

./manage.py lms manage_user studio_worker [email protected] --unusable-password
kdmccormick marked this conversation as resolved.
Show resolved Hide resolved
# DO NOT DO THIS IN PRODUCTION it will make your auth insecure
./manage.py lms create_dot_application --grant-type authorization-code --skip-authorization --redirect-uris "http://localhost:18010/complete/edx-oauth2/" --scopes "user_id" studio-sso studio_worker --client-id studio-sso-key --client-secret studio-sso-secret
feanil marked this conversation as resolved.
Show resolved Hide resolved

Setup Studio SSO for Production::

./manage.py lms manage_user studio_worker <[email protected]> --unusable-password
./manage.py lms create_dot_application --grant-type authorization-code --skip-authorization --redirect-uris "http://localhost:18010/complete/edx-oauth2/" --scopes "user_id" studio-sso studio_worker
# Login to the django admin site (eg. http://localhost:18000/admin/oauth2_provider/application/)
# to view the credentials for the 'studio-sso' app and set them in the config
# for your production studio deployment using the `SOCIAL_AUTH_EDX_OAUTH2_KEY`
# and `SOCIAL_AUTH_EDX_OAUTH2_SECRET` values in your studio settings.

feanil marked this conversation as resolved.
Show resolved Hide resolved
Run the Platform
----------------

First, ensure MySQL, Mongo, and Memcached are running.

Start the LMS::

./manage.py lms runserver
./manage.py lms runserver 18000

Start the CMS::

./manage.py cms runserver
./manage.py cms runserver 18010

This will give you a mostly-headless Open edX platform. Most frontends have
been migrated to "Micro-Frontends (MFEs)" which need to be installed and run
Expand Down
3 changes: 2 additions & 1 deletion cms/envs/devstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
################ Using LMS SSO for login to Studio ################
SOCIAL_AUTH_EDX_OAUTH2_KEY = 'studio-sso-key'
SOCIAL_AUTH_EDX_OAUTH2_SECRET = 'studio-sso-secret' # in stage, prod would be high-entropy secret
SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = 'http://edx.devstack.lms:18000' # routed internally server-to-server
# routed internally server-to-server
SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = ENV_TOKENS.get('SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT', 'http://edx.devstack.lms:18000')
SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT = 'http://localhost:18000' # used in browser redirect

# Don't form the return redirect URL with HTTPS on devstack
Expand Down
3 changes: 3 additions & 0 deletions lms/envs/minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ LMS_INTERNAL_ROOT_URL: "http://localhost"

# So that Swagger config code doesn't complain
API_ACCESS_MANAGER_EMAIL: "[email protected]"

# So that you can login to studio on bare-metal
SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT: 'http://localhost:18000'
kdmccormick marked this conversation as resolved.
Show resolved Hide resolved
Loading