Upgrade to Koa

This commit is contained in:
Régis Behmo 2020-11-17 13:07:52 +01:00
parent 4c1b5c2f9d
commit fe92a88234
14 changed files with 14 additions and 97 deletions

View File

@ -2,7 +2,7 @@ variables:
TUTOR_PLUGIN: notes
TUTOR_IMAGES: notes
TUTOR_PYPI_PACKAGE: tutor-notes
OPENEDX_RELEASE: juniper
OPENEDX_RELEASE: koa
include:
- project: 'community/tutor-ci'

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-juniper.master/exercises_tools/notes.html>`_).
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-koa.master/exercises_tools/notes.html>`_).
.. image:: https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-juniper.master/_images/SFD_SN_bodyexample.png
.. image:: https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-koa.master/_images/SFD_SN_bodyexample.png
:alt: Notes in action
Installation

View File

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

View File

@ -1 +1 @@
__version__ = "10.1.4"
__version__ = "11.0.0"

View File

@ -0,0 +1,4 @@
# Notes
{{ NOTES_HOST }}{% if not ENABLE_HTTPS %}:80{% endif %} {
reverse_proxy nginx:80
}

View File

@ -1 +0,0 @@
certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d {{ NOTES_HOST }}

View File

@ -1,6 +0,0 @@
- host: {{ NOTES_HOST }}
http:
paths:
- backend:
serviceName: nginx
servicePort: {% if ACTIVATE_HTTPS %}443{% else %}80{% endif %}

View File

@ -1 +0,0 @@
- {{ NOTES_HOST }}

View File

@ -4,4 +4,4 @@ notes-job:
DJANGO_SETTINGS_MODULE: notesserver.settings.tutor
volumes:
- ../plugins/notes/apps/settings/tutor.py:/openedx/edx-notes-api/notesserver/settings/tutor.py:ro
depends_on: {{ [("mysql", ACTIVATE_MYSQL)]|list_if }}
depends_on: {{ [("mysql", RUN_MYSQL)]|list_if }}

View File

@ -7,4 +7,4 @@ notes:
- ../plugins/notes/apps/settings/tutor.py:/openedx/edx-notes-api/notesserver/settings/tutor.py:ro
- ../../data/notes:/openedx/data
restart: unless-stopped
depends_on: {{ [("mysql", ACTIVATE_MYSQL)]|list_if }}
depends_on: {{ [("mysql", RUN_MYSQL)]|list_if }}

View File

@ -3,35 +3,16 @@ upstream notes-backend {
server notes:8000 fail_timeout=0;
}
{% if ACTIVATE_HTTPS %}
server {
server_name {{ NOTES_HOST }};
listen 80;
return 301 https://$server_name$request_uri;
}
{% endif %}
server {
{% if ACTIVATE_HTTPS %}listen 443 {{ "" if WEB_PROXY else "ssl" }};{% else %}listen 80;{% endif %}
server_name notes.localhost {{ NOTES_HOST }};
{% if ACTIVATE_HTTPS and not WEB_PROXY %}
ssl_certificate /etc/letsencrypt/live/{{ NOTES_HOST }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ NOTES_HOST }}/privkey.pem;
{% endif %}
server_name {{ NOTES_HOST }};
# Disables server version feedback on pages and in headers
server_tokens off;
location / {
{% if not WEB_PROXY %}
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr;
{% endif %}
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://notes-backend;
}
}

View File

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

View File

@ -1,27 +0,0 @@
{% if ACTIVATE_HTTPS %}
<VirtualHost *:80>
ServerName {{ NOTES_HOST }}
Redirect / https://notes.{{ LMS_HOST }}/
</VirtualHost>
<VirtualHost *:443>
ServerName {{ NOTES_HOST }}
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/{{ NOTES_HOST }}/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ NOTES_HOST }}/privkey.pem
ProxyPreserveHost On
ProxyRequests On
ProxyPass / http://localhost:{{ NGINX_HTTP_PORT }}/
ProxyPassReverse / http://localhost:{{ NGINX_HTTP_PORT }}/
</VirtualHost>
{% else %}
<VirtualHost *:80>
ServerName {{ NOTES_HOST }}
ProxyPreserveHost On
ProxyRequests On
ProxyPass / http://localhost:{{ NGINX_HTTP_PORT }}/
ProxyPassReverse / http://localhost:{{ NGINX_HTTP_PORT }}/
</VirtualHost>
{% endif %}

View File

@ -1,33 +0,0 @@
server {
listen 80;
server_name {{ NOTES_HOST }};
server_tokens off;
location / {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://localhost:{{ NGINX_HTTP_PORT }};
}
}
{% if ACTIVATE_HTTPS %}
server {
listen 443 ssl;
server_name {{ NOTES_HOST }};
ssl_certificate /etc/letsencrypt/live/{{ NOTES_HOST }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ NOTES_HOST }}/privkey.pem;
server_tokens off;
location / {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://localhost:{{ NGINX_HTTPS_PORT }};
}
}
{% endif %}