Upgrade to juniper

This commit is contained in:
Régis Behmo 2020-05-09 20:38:36 +02:00
parent f842759d39
commit 8e63a6ac37
12 changed files with 48 additions and 27 deletions

View File

@ -1,9 +1,9 @@
Students notes plugin for `Tutor <https://docs.tutor.overhang.io>`_
===================================================================
This is a plugin for `Tutor <https://docs.tutor.overhang.io>`_ to easily add the `Open edX note-taking app <https://github.com/edx/edx-notes-api>`_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation <https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-ironwood.master/exercises_tools/notes.html?highlight=notes>`_).
This is a plugin for `Tutor <https://docs.tutor.overhang.io>`_ to easily add the `Open edX note-taking app <https://github.com/edx/edx-notes-api>`_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation <https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-juniper.master/exercises_tools/notes.html>`_).
.. image:: https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-ironwood.master/_images/SFD_SN_bodyexample.png
.. image:: https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-juniper.master/_images/SFD_SN_bodyexample.png
:alt: Notes in action
Installation
@ -17,11 +17,11 @@ Then, to enable this plugin, run::
tutor plugins enable notes
You should beware that the ``notes.<LMS_HOST>`` domain name should exist and point to your server. For instance, if your LMS is hosted at http://myopenedx.com, the notes service should be found at http://notes.myopenedx.com.
If you would like to host the notes service at a different domain name, you can set the ``NOTES_HOST`` configuration variable (see below). In particular, in development you should set this configuration variable to ``notes.localhost`` in order to be able to access the notes service from the LMS. Otherwise you will get a "Sorry, we could not search the store for annotations" error.
If you would like to host the notes service at a different domain name, you can set the ``NOTES_HOST`` configuration variable (see below). When testing Tutor on a local computer, this will be automatically set to notes.local.overhang.io.
To enable student notes for a specific course, you should go to the course advanced settings in the studio, and set "Enable Student Notes" to "true". Then, hit "save changes".
Configuration
-------------

View File

@ -31,7 +31,7 @@ setup(
packages=find_packages(exclude=["tests*"]),
include_package_data=True,
python_requires=">=3.5",
install_requires=["tutor-openedx"],
install_requires=["tutor-openedx>=10.0.0,<11.0.0"],
entry_points={"tutor.plugin.v0": ["notes = tutornotes.plugin"]},
classifiers=[
"Development Status :: 5 - Production/Stable",

View File

@ -1 +1 @@
__version__ = "0.1.8"
__version__ = "10.0.0"

View File

@ -1,2 +0,0 @@
"EDXNOTES_PUBLIC_API": "{{ "https" if ACTIVATE_HTTPS else "http" }}://{{ NOTES_HOST }}/api/v1",
"EDXNOTES_INTERNAL_API": "http://notes:8000/api/v1"

View File

@ -0,0 +1 @@
ENABLE_EDXNOTES: true

View File

@ -0,0 +1,4 @@
notes:
command: ./manage.py runserver 0.0.0.0:8120
ports:
- "8120:8120"

View File

@ -0,0 +1,3 @@
# Notes
EDXNOTES_CLIENT_NAME = "notes"
EDXNOTES_INTERNAL_API = "http://notes:8000/api/v1"

View File

@ -0,0 +1 @@
EDXNOTES_PUBLIC_API = "http://{{ NOTES_HOST }}:8120/api/v1"

View File

@ -0,0 +1 @@
EDXNOTES_PUBLIC_API = "{{ "https" if ACTIVATE_HTTPS else "http" }}://{{ NOTES_HOST }}/api/v1"

View File

@ -2,9 +2,7 @@ from .common import *
SECRET_KEY = "{{ NOTES_SECRET_KEY }}"
ALLOWED_HOSTS = [
"localhost",
"notes",
"notes.localhost",
"{{ NOTES_HOST }}",
]
@ -33,4 +31,19 @@ HAYSTACK_CONNECTIONS = {
}
}
LOGGING["handlers"]["local"] = LOGGING["handlers"]["console"].copy()
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"level": "INFO",
"class": "logging.StreamHandler",
},
},
"loggers": {
"": {
"handlers": ["console"],
"level": "INFO",
},
},
}

View File

@ -1,15 +1,19 @@
FROM docker.io/ubuntu:18.04
FROM docker.io/ubuntu:20.04
MAINTAINER Overhang.io <contact@overhang.io>
RUN apt update && \
apt upgrade -y && \
apt install -y language-pack-en git python-pip libmysqlclient-dev
# python 3.8
apt install -y language-pack-en git python3 python3-pip libmysqlclient-dev
RUN ln -s /usr/bin/python3 /usr/bin/python \
&& ln -s /usr/bin/pip3 /usr/bin/pip
RUN mkdir /openedx
RUN git clone https://github.com/edx/edx-notes-api --branch open-release/ironwood.2 --depth 1 /openedx/edx-notes-api
RUN git clone https://github.com/edx/edx-notes-api --branch open-release/juniper.1 --depth 1 /openedx/edx-notes-api
WORKDIR /openedx/edx-notes-api
RUN pip install -r requirements/base.txt
RUN pip3 install -r requirements/base.txt
EXPOSE 8000
CMD gunicorn --workers=2 --name notes --bind=0.0.0.0:8000 --max-requests=1000 notesserver.wsgi:application

View File

@ -1,18 +1,14 @@
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 edx-notes \
--client_id notes \
--client_secret {{ NOTES_OAUTH2_SECRET }} \
--trusted \
--logout_uri "http://notes:8000/logout/" \
--username notes
./manage.py lms create_dot_application \
notes \
notes \
--redirect-uris "http://notes:8000" \
--skip-authorization \
--client-id notes \
--client-secret "{{ NOTES_OAUTH2_SECRET }}" \
--update