diff --git a/plugins/notes/tutornotes/patches/lms-env b/plugins/notes/tutornotes/patches/lms-env index 8ec6970..227ad0a 100644 --- a/plugins/notes/tutornotes/patches/lms-env +++ b/plugins/notes/tutornotes/patches/lms-env @@ -1,2 +1,2 @@ "EDXNOTES_PUBLIC_API": "{{ "https" if ACTIVATE_HTTPS else "http" }}://{{ NOTES_HOST }}/api/v1", -"EDXNOTES_INTERNAL_API": "http://notes.openedx:8000/api/v1" \ No newline at end of file +"EDXNOTES_INTERNAL_API": "http://notes:8000/api/v1" \ No newline at end of file diff --git a/plugins/notes/tutornotes/patches/local-docker-compose-services b/plugins/notes/tutornotes/patches/local-docker-compose-services index 1f53743..6ed39ae 100644 --- a/plugins/notes/tutornotes/patches/local-docker-compose-services +++ b/plugins/notes/tutornotes/patches/local-docker-compose-services @@ -1,10 +1,6 @@ ############# Notes: backend store for edX Student Notes notes: image: {{ DOCKER_REGISTRY }}{{ NOTES_DOCKER_IMAGE }} - networks: - default: - aliases: - - notes.openedx environment: DJANGO_SETTINGS_MODULE: notesserver.settings.tutor volumes: diff --git a/plugins/notes/tutornotes/templates/notes/apps/settings/tutor.py b/plugins/notes/tutornotes/templates/notes/apps/settings/tutor.py index 63ee1de..dbb7be6 100644 --- a/plugins/notes/tutornotes/templates/notes/apps/settings/tutor.py +++ b/plugins/notes/tutornotes/templates/notes/apps/settings/tutor.py @@ -4,7 +4,6 @@ SECRET_KEY = "{{ NOTES_SECRET_KEY }}" ALLOWED_HOSTS = [ "localhost", "notes", - "notes.openedx", "notes.localhost", "{{ NOTES_HOST }}", ] diff --git a/plugins/notes/tutornotes/templates/notes/hooks/lms/init b/plugins/notes/tutornotes/templates/notes/hooks/lms/init index 7814811..e30a655 100644 --- a/plugins/notes/tutornotes/templates/notes/hooks/lms/init +++ b/plugins/notes/tutornotes/templates/notes/hooks/lms/init @@ -1,5 +1,18 @@ -./manage.py lms --settings=tutor.production manage_user notes notes@{{ LMS_HOST }} --staff --superuser -./manage.py lms --settings=tutor.production create_oauth2_client \ - "http://notes.openedx:8000" "http://notes.openedx:8000/complete/edx-oidc/" confidential \ - --client_name edx-notes --client_id notes --client_secret {{ NOTES_OAUTH2_SECRET }} \ - --trusted --logout_uri "http://notes.openedx:8000/logout/" --username notes \ No newline at end of file +export DJANGO_SETTINGS_MODULE=lms.envs.tutor.production + +# Modify users created an incorrect email and that might clash with the newly created users +./manage.py lms shell -c \ + "from django.contrib.auth import get_user_model;\ + get_user_model().objects.filter(username='notes').exclude(email='notes@openedx').update(email='notes@openedx')" + +./manage.py lms manage_user notes notes@openedx --staff --superuser +./manage.py lms create_oauth2_client \ + "http://notes:8000" \ + "http://notes:8000/complete/edx-oidc/" \ + confidential \ + --client_name notes \ + --client_id notes \ + --client_secret {{ NOTES_OAUTH2_SECRET }} \ + --trusted \ + --logout_uri "http://notes:8000/logout/" \ + --username notes \ No newline at end of file diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index 583eaf4..65d15e2 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -49,6 +49,9 @@ RUN pip install -r requirements/edx/development.txt RUN pip uninstall -y ora2 && \ pip install git+https://github.com/overhangio/edx-ora2.git@2.2.0-patched#egg=ora2==2.2.0 +# Install patched version of edx-oauth2-provider +RUN pip install git+https://github.com/overhangio/edx-oauth2-provider.git@1.2.3#egg=edx-oauth2-provider==1.2.3 + # Install a recent version of nodejs RUN nodeenv /openedx/nodeenv --node=8.9.3 --prebuilt ENV PATH /openedx/nodeenv/bin:${PATH}