eduNEXT / edunext-platform

Open edX, the project that powers edunext.co
https://www.edunext.co
GNU Affero General Public License v3.0
29 stars 7 forks source link

feat(JU-10/DS-308): Comment log in migration file #700

Closed danielsgz closed 1 year ago

danielsgz commented 1 year ago

This PR add long duration token to nuez. Here are the steps to try it:

  1. In a new folder touch a strain.yml file with the following content:
    STRAIN_NAME: nuezdistro
    STRAIN_TUTOR_VERSION: v14.1.0
    DOCKER_IMAGE_OPENEDX_DEV: docker.io/ednxops/distro-edunext-edxapp-dev:nuez
    DOCKER_IMAGE_OPENEDX: docker.io/ednxops/distro-edunext-edxapp:nuez
    EDX_PLATFORM_REPOSITORY: https://github.com/eduNEXT/edunext-platform.git
    EDX_PLATFORM_VERSION: nu/ednx/JU-10
    CMS_HOST: studio.nutmeg.edunext.link
    LMS_HOST: lms.nutmeg.edunext.link
    DEV_PROJECT_NAME: nuezdistro_dev
    LOCAL_PROJECT_NAME: nuezdistro_local
    PLATFORM_NAME: Nuez
    STRAIN_TUTOR_PLUGINS:
    - REPO: tutor-contrib-edunext-distro
    VERSION: v3.0.0
    EGG: tutor-contrib-edunext-distro==v3.0.0
    PACKAGE_NAME: distro
    PROTOCOL: ssh
    STRAIN_EXTRA_COMMANDS:
    - APP: 'tutor'
    COMMAND: 'distro enable-themes'
    STRAIN_VOLUME_OVERRIDES:
    edxapp:
    - DESTINATION: ../../src/edxapp/edx-platform
      LOCATION: /openedx/edx-platform
    STRAIN_EXPORT_VOLUMES:
    - CONTAINER: lms
    LOCATION: /openedx/edx-platform
    DESTINATION: src/edxapp/edx-platform
    DISTRO_THEMES_NAME:
    - bragi
  2. Use the following commands:
    stack strain create
    source .tvm/bin/activate
    stack strain dev configure -k override_vols -k export_vols
    stack strain dev init
    stack strain dev configure -s override_vols -k export_vols
  3. Create an admin user with the following command: tutor dev createuser --staff --superuser admin admin@edunext.co -p password.
  4. In the Django admin, go to Django OAuth Toolkit > Applications > Add Application.
    • Write down both the _clientid and the _clientsecret.
    • Make sure you pick the admin's id you created in step 3.
    • On redirect urls write the url you environment is using keeping in mind if you're using any tenant.
    • At client type pick Confidential.
    • Choose client credentials at Authorization grant types.
    • Write any random name you want.
    • Lastly, make sure you thick the Slip authorization checkbox.
  5. From here there are two ways to test:
    • Terminal: Copy, paste, and replace where needed the following code:
      curl --location --request POST 'http://<YOUR-URL>/oauth2/access_token' \
      --header 'Content-Type: application/x-www-form-urlencoded' \
      --data-urlencode 'client_id=<YOUR-CLIENT-ID>' \
      --data-urlencode 'client_secret=<YOUR-CLIENT-SECRET>' \
      --data-urlencode 'grant_type=client_credentials'

      You should get something like this:

      {
      "access_token": "7wjnmhIHC3B67EvNDVD0xo68kwVQJy", 
      "expires_in": 31557600, 
      "token_type": "Bearer", 
      "scope": "read write email profile"
      }
    • Postman or such tool: Go to the documentation
danielsgz commented 1 year ago

@MaferMazu This was the cherrypick's message, however, I totally agree, I was also confused when I saw that message in the initial commit. I will apply your remark.