Configure EdX Notes
These instructions will allow you to Configure EdX Notes.
Setup Oauth between LMS and the Notes API
Log into LMS-URL/admin. This is the Django Admin panel.
From DJANGO OAUTH TOOLKIT, click Applications.
Add a Application by clicking button.
Fill form using appropriate values. It would auto generate Client id and Client secret, save these for later use.
Configure sub domain and perform DNS configuration for notes.domain_name (This is optional step, if not configuring this, you can use the notes api through port.)
Make sure to get the port 18120 and 9200 as open through firewall settings.
Set Ansible Parameters, for this access the file /edx/app/edx_ansible/edx_ansible/playbooks/roles/edx_notes_api/defaults/main.yml
nano /edx/app/edx_ansible/edx_ansible/playbooks/roles/edx_notes_api/defaults/main.yml
Following are the exact parameters that we’ll modify.
- EDX_NOTES_API_MYSQL_DB_PASS – Choose a new strong password that the Notes user will pass to MySQL when connecting to the Notes database.
- EDX_NOTES_API_MYSQL_HOST – This is “localhost” by default on Native installations unless you have migrated your MySQL environment elsewhere.
- EDX_NOTES_API_ELASTICSEARCH_URL – set this to “localhost:9200”
- EDX_NOTES_API_DATASTORE_NAME – This is the name of the MySQL database that Ansible will create for you. Use a simple, sensible name like “notes”
- EDX_NOTES_API_SECRET_KEY – Choose a new strong password of at least 16 characters.
- EDX_NOTES_API_CLIENT_ID – This is the “Client ID” value from the Oauth setup screen from the previous step
- EDX_NOTES_API_CLIENT_SECRET – This is the “Client Secret” value from the Oauth setup screen from the previous step
- EDX_NOTES_API_ALLOWED_HOSTS – add a new item to this list containing the fully qualified domain name of your LMS.
Set the following flags in lms.yml.
Use the following command to access the files from the terminal:
nano /edx/etc/lms.yml
Find and Update the following in the file:
EDXNOTES_INTERNAL_API: https://notes.LMS-URL/api/v1 EDXNOTES_PUBLIC_API: https://notes.LMS-URL/api/v1 ENABLE_EDXNOTES: true LOGIN_REDIRECT_WHITELIST: - notes.LMS-URL - https://notes.LMS-URL
Find all occurance of JWT_ISSUER and update it as following.
JWT_ISSUER: https://LMS-URL/oauth2
Set the following flags in studio.yml.
Use the following command to access the files from the terminal:
nano /edx/etc/studio.yml
Find and Update the following in the file:
ENABLE_EDXNOTES: true
Create Users with Ansible. Use Ansible to create a new Linux user, “edx_notes_api”, plus create a MySQL user and then finally add permissions so that our new user can perform basic CRUD operations on the database. Execute the commands below:
- source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate - cd /edx/app/edx_ansible/edx_ansible/playbooks - sudo ansible-playbook -i 'localhost,' -c local ./run_role.yml -e 'role=edxlocal' -e@roles/edx notes_api/defaults/main.yml
Install Notes Software with Ansible. Execute the commands below:
- source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate - cd /edx/app/edx_ansible/edx_ansible/playbooks/edx-east - sudo ansible-playbook -i 'localhost,' -c local ./notes.yml
Check and confirm if edx_notes_api is successfully running. Execute the following:
sudo /edx/bin/supervisorctl status edx_notes_api
Run Database Migrations. Execute the commands below:
- export EDXNOTES_CONFIG_ROOT=/edx/etc/ - export DB_MIGRATION_USER=root - export DB_MIGRATION_PASS=YOUR PASS FOR MYSQL ROOT USER(if using root user then no pass needed) - source /edx/app/edx_notes_api/edx_notes_api_env - python /edx/bin/manage.edx_notes_api makemigrations --settings="notesserver.settings.yaml_config" - python /edx/bin/manage.edx_notes_api migrate --settings="notesserver.settings.yaml_config"
Compile Assets by issuing the paver command. Execute the commands below:
- sudo -H -u edxapp bash - source /edx/app/edxapp/edxapp_env - cd /edx/app/edxapp/edx-platform - paver update_assets cms --settings=production - paver update_assets lms --settings=production
Restart the edx service by issuing the following command:
sudo /edx/bin/supervisorctl restart all
Perform nginx configuration in /etc/nginx/sites-enabled/edx_notes_api (If your site is using subdomain)
Update the listen port from 18120 to 80.
listen 80;
Issue SSL certificates for sub domain. (If your site is using subdomain and SSL is enabled.)
sudo certbot -d LMS-URL.com,studio.LMS-URL.com,notes.LMS-URL.com --expand sudo service nginx restart
Enable notes in one or more of your courses. To enable notes go to studio -> Advanced Settings and then set Enable Student Notes to true
Verify the installation.