6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-05 04:48:00 +00:00
Commit Graph

948 Commits

Author SHA1 Message Date
Régis Behmo
0d0cb0e71e Fix incorrect loading of some resources from localhost:18000
In the LMS, some resources where loaded from localhost:18000. For
instance: http://localhost:18000/static/images/logo.png

This was due to the fact that the LMS_BASE, LMS_ROOT_URL and thus
SITE_NAME settings are overwritten by the devstack settings, so we need
to define them again in development.
2020-08-16 11:56:37 +02:00
Régis Behmo
9a6439b08c Fix Samesite=None Secure=False cookie errors in Chrome
Recent releases of Chrome refuse to set csrf and session cookies for
which secure=False samesite=None. The "secure" attribute is not set by
the SameSite middleware in v0.5.1. It was introduced in v0.6.0.

Instead, the "secure" attribute is set on the sessions cookie by the
openedx.core.djangoapps.safe_sessions.middleware.SafeSessionMiddleware
middleware. For the csrf cookie, the "secure" attribute is set by
Django.

We could certainly get rid of the SafeSessionMiddleware by upgrading the
django-cookie-samesite dependency to v0.6.0. Instead, we need to define
environment-specific settings manually.

See:
https://github.com/edx/edx-platform/pull/23671
https://github.com/edx/edx-platform/pull/24593
https://discuss.overhang.io/t/users-cannot-login-csrf-cookie-not-set/815
https://discuss.openedx.org/t/lti-xblock-and-samesite/759/3
https://blog.heroku.com/chrome-changes-samesite-cookie
https://docs.djangoproject.com/en/2.2/ref/settings/#csrf-cookie-secure
https://github.com/jotes/django-cookies-samesite/issues/23
2020-08-16 11:39:00 +02:00
Régis Behmo
1d5bc05328 Apply javascript security patch
See pull request: https://github.com/edx/edx-platform/pull/24762
2020-08-15 19:18:45 +02:00
Régis Behmo
a161dbf843 Fix "FileError" on Scorm package upload in Scorm XBlock
See https://github.com/overhangio/openedx-scorm-xblock/issues/3
2020-08-15 17:24:11 +02:00
Régis Behmo
62d7fd00b9 Serve static assets with whitenoise instead of nginx
This drastically simplifies volume management, as it is no longer
necessary to manually copy static assets from the docker image to the
bind-mounted volume.

This deprecates the "k8s-deployments-nginx-init-containers" patch, as we
no longer need to init the nginx container. Plugins are encouraged to
start using whitenoise as well for serving static assets.

TODO:
- test media serving: DOES NOT WORK. Whitenoise was designed to serve a
fixed list of static files. Godammit.
- compare performances
2020-08-04 09:39:53 +02:00
Régis Behmo
70872dfa9b Fix instructions for running "openedx-assets" 2020-08-04 09:24:58 +02:00
Régis Behmo
895be87bca Fix dependency on mysql service when mysql is not activated
See https://github.com/overhangio/tutor/pull/359
2020-08-02 16:46:20 +02:00
aszykm
d79dec5a65 Update docker-compose.yml
Missing conditions to control individual service.
2020-08-02 16:42:16 +02:00
Régis Behmo
398e1b96e8 Switch to multi-stage build for openedx image
This reduces the size of the final image from 3.25Gb to 2.8Gb. Also, it
should be faster to rebuild the image in most cases. For instance, we
will not have to re-install nodejs requirements after part of the
edx-platform repo was modified.
2020-07-26 00:51:26 +02:00
Régis Behmo
c46cab3df9 Revert "Enable LMS sysadmin dashboard by default"
This reverts commit 90c5842c1c.

Turns out that the sysadmin dashboard is slated for deprecation. It is
currently impossible to download the list of users in csv (see
https://discuss.overhang.io/t/tutor-10-0-11-sysadmin-feature-generates-500-error/776/4).
We should not attempt to resolve this issue.
2020-07-24 08:31:42 +02:00
Régis Behmo
ddee6f4d87 v10.1.0 (2020-07-23)
- [Security] Apply edx-platform upstream xss security fixes ([pull
request](https://github.com/edx/edx-platform/pull/24568))
- 💥[Feature] Make it possible to override the docker registry for just
a few services by setting `DOCKER_IMAGE_SERVICENAME` values.
2020-07-23 16:19:26 +02:00
Régis Behmo
8e2a06dc6f Apply edx-platform upstream xss security fixes 2020-07-23 16:18:40 +02:00
Régis Behmo
00573d69d6 Fix asset collection docs in dev mode
`paver update_assets` generates errors.

See
https://discuss.overhang.io/t/local-edx-platform-paver-and-juniper/773/2
2020-07-21 11:27:50 +02:00
Régis Behmo
5f81aae616 Fix images.get_tag unit test 2020-07-21 09:28:44 +02:00
Régis Behmo
bbd92223ee Make it possible to override the docker registry for individual services
Previously, it was not possible to override the docker registry for just
one or a few services. Setting the DOCKER_REGISTRY configuration
parameter would apply to all images. This was inconvenient. To resolve
this, we include the docker registry value in the DOCKER_IMAGE_*
configuration parameters. This allows users to override the docker
registry individually by defining the DOCKER_IMAGE_SERVICENAME
configuration parameter.

See https://discuss.overhang.io/t/kubernetes-ci-cd-pipeline/765/3
2020-07-21 09:16:51 +02:00
susguzman
156b0de115 k8s workers queues fix 2020-07-19 15:05:38 +02:00
Régis Behmo
d5659cc03b v10.0.11 (2020-07-16)
- [Feature] Upgrade all repositories to open-release/juniper.2
- [Bugfix] Fix `reload-gunicorn` command
- [Feature] Enable sysadmin dashboard in LMS at /sysadmin
2020-07-16 15:33:28 +02:00
Régis Behmo
ee0f6de499 Add changelog entry for reload-gunicorn fix
See https://github.com/overhangio/tutor/pull/354
2020-07-16 11:58:13 +02:00
Régis Behmo
ef6b1c3433 Upgrade to open-release/juniper.2 2020-07-16 11:57:35 +02:00
David Oviedo
ec95ea13cf reload-gunicorn: look for python3 binary 2020-07-16 11:57:22 +02:00
Régis Behmo
90c5842c1c Enable LMS sysadmin dashboard by default
The dashboard is available at /sysadmin. It's a CRUD interface for
managing users and courses.

Enabling this interface required that the DATA_DIR setting was not a
string, but a Path object.

Close #353.
2020-07-16 10:49:57 +02:00
Régis Behmo
27d74c1343 Fix pip install instructions
Close #352.
2020-07-16 09:21:10 +02:00
Régis Behmo
66ab851848 v10.0.10 (2020-07-01)
- [Bugfix] Fix pycontracts installation error when building openedx
Docker image
- [Bugfix] Fix access to dicussion forum in development mode
2020-07-01 18:27:16 +02:00
Régis Behmo
e1e6a00c0f Fix pycontracts error in openedx docker image build
See
https://discuss.overhang.io/t/tutor-images-build-openedx-failed/717/2
2020-07-01 18:25:51 +02:00
Régis Behmo
a552c5af6f Fix access to dicussion forum in development mode
The devstack settings from edx-platform set the forum url to
http://edx.devstack.forum:4567 so we need to override this value.
2020-07-01 11:04:14 +02:00
Régis Behmo
521b7e8098 v10.0.9 (2020-07-07)
- [Bugfix] Share grade download settings between the LMS and the CMS
2020-07-01 10:10:38 +02:00
Régis Behmo
169a96c44f Share grade download settings between the LMS and the CMS
The GRADES_DOWNLOAD setting is shared between the LMS and the CMS, so
its definition is moved to the common settings file.

This is to address part of this issue:
https://discuss.overhang.io/t/grades-file-not-generating-juniper-version/704
An upgrade to the minio plugin is also required.
2020-07-01 10:06:53 +02:00
Régis Behmo
443d7fa46c Add CI command to view size of bundled tutor binary 2020-07-01 09:32:08 +02:00
Régis Behmo
0978e2d10f No need for docker in Travis CI 2020-07-01 09:32:08 +02:00
Régis Behmo
e1f9637780 Upgrade Travis CI dist from Trusty to Xenial
Trusty is unsupported since April 2019. Also, out of the box Trusty
ships with Python 3.4, which means that we cannot replicate the CI in a
docker container. Finally, the binaries produced in Trusty are more than
twice the size of those produced in later releases.

After testing this change, unfortunately the binary size remains too
big.

See
https://discuss.overhang.io/t/size-of-tutor-16mb-built-on-my-machine-is-less-than-the-official-tutor-binary-37mb/714
2020-07-01 09:32:08 +02:00
Régis Behmo
a9907d7eb3 v10.0.8 (2020-06-23)
- [Bugfix] Fix android user creation during init
- [Bugfix] Fix undefined settings in k8s scripts, such as `createuser`
2020-06-23 19:27:14 +02:00
Régis Behmo
f28ecca498 Fix android user creation during init
Init was crashing with error:

    django.db.utils.IntegrityError: (1062, "Duplicate entry 'android' for key 'client_id'")

See
https://discuss.overhang.io/t/reset-password-email-sent-but-activation-email-dont/690/4
2020-06-23 19:25:56 +02:00
Régis Behmo
b328e0f7d9 Fix undefined settings in k8s scripts
In k8s, creating a user is an interactive command, so it needs to run in
exec. Thus, the DJANGO_SETTINGS_MODULE needs to be defined for this
command.

Close #344
2020-06-23 19:11:35 +02:00
Régis Behmo
2fc28bef79 v10.0.7 (2020-06-22)
- [Bugfix] Fix TypeError on viewing xblock
- [Bugfix] Fix authentication in Android mobile application
2020-06-22 16:31:31 +02:00
Régis Behmo
d8676978f1 Fix TypeError due to None LEARNING_MICROFRONTEND_URL setting value
We observed the following error in production:

    lms_1             | 2020-06-22 14:03:10,220 ERROR 10 [django.request]
    [user 4] log.py:228 - Internal Server Error:
    /xblock/block-v1:edX+DemoX+Demo_Course+type@html+block@6bcccc2d7343416e9e03
    fd7325b2f232
    lms_1             | Traceback (most recent call last):
    lms_1             |   File
    "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/exception.py",
    line 34, in inner
    lms_1             |     response = get_response(request)
    lms_1             |   File
    "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/base.py",
    line 115, in _get_response
    lms_1             |     response =
    self.process_exception_by_middleware(e, request)
    lms_1             |   File
    "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/base.py",
    line 113, in _get_response
    lms_1             |     response = wrapped_callback(request,
    *callback_args, **callback_kwargs)
    lms_1             |   File
    "/openedx/venv/lib/python3.5/site-packages/django/views/decorators/http.py",
    line 40, in inner
    lms_1             |     return func(request, *args, **kwargs)
    lms_1             |   File
    "/openedx/edx-platform/common/djangoapps/util/views.py", line 66, in
    inner
    lms_1             |     response = view_func(request, *args, **kwargs)
    lms_1             |   File
    "/openedx/venv/lib/python3.5/site-packages/django/views/decorators/clickjacking.py",
    line 50, in wrapped_view
    lms_1             |     resp = view_func(*args, **kwargs)
    lms_1             |   File
    "/openedx/venv/lib/python3.5/site-packages/django/utils/decorators.py",
    line 142, in _wrapped_view
    lms_1             |     response = view_func(request, *args, **kwargs)
    lms_1             |   File
    "/openedx/edx-platform/lms/djangoapps/courseware/views/views.py", line
    1683, in render_xblock
    lms_1             |     'is_learning_mfe':
    request.META.get('HTTP_REFERER',
    '').startswith(settings.LEARNING_MICROFRONTEND_URL),
    lms_1             | TypeError: startswith first arg must be str or a
    tuple of str, not NoneType
2020-06-22 16:18:21 +02:00
Régis Behmo
c2e30a6855 Fix authentication in Android mobile application
Login on Android mobile app was failing with "check your username and
password".
2020-06-22 16:01:46 +02:00
Régis Behmo
92c4055b36 v10.0.6 (2020-06-22)
- [Bugfix] Fix unsent activation emails and other asynchronous tasks
2020-06-22 12:19:57 +02:00
Régis Behmo
6ba35738d4 Make sure that LMS can send tasks to the CMS
In production, the ALTERNATE_WORKER_QUEUES setting is overridden by ""
(empty string). This might prevent LMS from sending tasks to the CMS. We
have not seen this issue emerge yet, but better be safe than sorry.

We must be careful not to process the tasks from the CMS, just like for
the CMS worker which does not process the tasks from the LMS.
2020-06-22 12:19:57 +02:00
Régis Behmo
40a76330f6 Fix unsent activation emails and other asynchronous tasks
Half of the tasks from edx.lms.core.default celery queue were being
processed by the CMS worker. Unfortunately, this CMS worker crashes on
some of those tasks. For instance, activation emails complain of a
missing "django_markup" template tag library because "xss_utils" is not
part of the installed app in the CMS.

The problem is that we need this edx.lms.core.default queue to be part
of the CELERY_QUEUES in the cms in order to send tasks from the CMS to
the LMS. The trick to resolve this situation is to ask the CMS celery
worker to not process the tasks from this queue.

To debug this issue, run in the LMS:

    from student.tasks import send_activation_email
    send_activation_email("{}")

Then watch the logs of the lms and cms workers. If the CMS workers picks
up this task (50% of the time prior to this change) then we have an
issue.

See:
https://discuss.overhang.io/t/reset-password-email-sent-but-activation-email-dont/690
2020-06-22 12:11:15 +02:00
Régis Behmo
77150c0424 Push to repo as part of "make release" 2020-06-21 13:47:14 +02:00
Régis Behmo
cdf6b7e315 v10.0.5 (2020-06-21)
- [Security] Apply edx-platform upstream xss security fixes ([pull
request](https://github.com/edx/edx-platform/pull/24258))
2020-06-21 13:46:19 +02:00
Régis Behmo
1773e2a347 Apply edx-platform upstream xss security fixes 2020-06-21 11:04:46 +02:00
Régis Behmo
77a0a6f60d v10.0.4 (2020-06-19)
- [Bugfix] Fix broken `tutor ui` command in binary
2020-06-19 16:37:58 +02:00
Régis Behmo
2b0ed7daac Fix broken ui command in tutor binary
"tutor ui" was failing miserably, printing a lot of garbled characters
in the shell. In fact, a FileNotFound error was being raised and
automatically caught by the ui command. When removing the catch all,
this was the error that was raised:

    FileNotFoundError: [Errno 2] No such file or directory:
    '/tmp/_MEIimsqmq/wcwidth/version.json'     │

This is resolved on SO:
https://stackoverflow.com/questions/62155242/pyinstaller-cant-find-wcwidth-version-json-when-running-executable
2020-06-19 16:33:58 +02:00
Régis Behmo
001da4e24e v10.0.3 (2020-06-19)
- [Bugfix] Fix error on android user creation
2020-06-19 12:53:18 +02:00
Régis Behmo
2f8efbc656 Revert "Fix DoesNotExist error on android credentials creation"
This reverts commit a88d9cfc19.
2020-06-19 11:40:46 +02:00
Régis Behmo
d9aab8b314 v10.0.1 (2020-06-17)
- [Bugfix] Fix crash when viewing problem in LMS
- [Bugfix] Fix missing webpack-stats.json in openedx Docker image
2020-06-17 21:51:52 +02:00
Régis Behmo
a88d9cfc19 Fix DoesNotExist error on android credentials creation
In some environments, the login_service_user may not be available. Thus,
we create a dedicated android user for the mobile app.

See
https://discuss.overhang.io/t/upgrading-to-juniper-fails-with-user-matching-query-does-not-exist/678
2020-06-17 15:14:27 +02:00
Régis Behmo
3956abb9aa Clarify instructions to manually upgrade from ironwood 2020-06-17 14:38:54 +02:00
Régis Behmo
ccef360253 It is no longer necessary to define DJANGO_SETTINGS_MODULE in jobs
That's because we use "docker run" and no longer "docker exec".
2020-06-17 13:24:48 +02:00