Commit Graph

144 Commits

Author SHA1 Message Date
Kyle McCormick
774b7e9821 refactor: Clean up CMS production settings cruft (#36306)
This is a pure refactoring of cms/envs/production.py, removing several
redundant statements that have accrued over the years as the platform moved
from python-only, to python+json, to python+json+yaml, to today's python+yaml
setup.

This is the CMS version of:
* a81493ce7f
* (originally 15939232d5)

Also included:

* Add some more explicit structure to the both LMS's and CMS's
  production.py using big comments.

* In both LMS and CMS settings, alphabetize the production overrides,
  and remove the extraneous comments. Separate out the handful of settings
  which have useful comments. The rest of the settings' comments were not
  helpful--they were either just stating the obvious, or they were duplicative
  of what's documented in common.py.

Co-Authored-By: Feanil Patel <feanil@axim.org>

Part of: https://github.com/openedx/edx-platform/issues/36215
2025-03-05 08:24:59 -05:00
Rômulo Penido
4f13ee0171 fix: advanced editor styling on library authoring [FC-0076] (#36146)
Fixes the styles for the advanced editors (poll, survey, LTI Provider, etc). Updated the code if `xblock_v2/xblock_iframe.html` to use `course-unit-mfe-iframe-bundle.scss`
2025-01-30 17:36:21 +00:00
Ahtisham Shahid
b50c42318c feat: added country disabling feature (#35451)
* feat: added country disabling feature
2024-09-25 14:40:08 +05:00
muhammad-ammar
6a04752005 feat: use xpert ai 2024-07-04 18:17:02 +05:00
qasim.gulzar
48cdbce893 refactor: [DEPR]: Neo4J Support #34342 2024-05-17 18:55:16 +05:00
Kyle McCormick
15caa9746f refactor: Completely remove Blockstore (#34739)
Blockstore and all of its (experimental) functionality has been replaced with
openedx-learning, aka "Learning Core". This commit uninstalls the now-unused
openedx-blockstore package and removes all dangling references to it.

Note: This also removes the `copy_library_from_v1_to_v2` management command,
which has been broken ever since we switched from Blockstore to Learning Core.

Part of this DEPR: https://github.com/openedx/public-engineering/issues/238
2024-05-13 09:48:18 -04:00
David Ormsbee
6308c968db refactor: always define CORS_ALLOW_HEADERS centrally
The LMS and Studio need to set values for CORS_ALLOW_HEADERS so that the
MFEs can work properly, since preflight requests will need to send over
extra headers. Prior to this commit, CORS_ALLOW_HEADERS was being
redefined in multiple places in edx-platform and again in Tutor's config
because it was only being conditionally set if ENABLE_CORS_HEADERS was
True (which was a policy setting). But CORS_ALLOW_HEADERS is application
logic in that the value is determined by what the view needs, and won't
vary by deployment.

By consolidating this to always be defined in the common.py files, we
make sure that deployment environments don't have to define it. An
example of where this bit us was when course import in the course
authoring MFE did not work because Tutor was using an outdated value for
this setting.

A followup to this would be to just rip out the ENABLE_CORS_HEADERS
setting entirely, and just always have it on. But that would benefit
from a little more discovery to make sure there's no weird use case that
still requires it to be False (maybe something in the test suite?).
2024-05-08 16:16:05 -04:00
Feanil Patel
5ec8737856 chore: Remove old datadog related settings.
Datadog was removed 6+ years ago but some settings and related keys got
left behind.  Get rid of them since we don't need them and also to
prevent people from assuming it's okay to hardcode datadog settings into
our codebase.
2023-12-14 12:17:37 -05:00
Kristin Aoki
d08e93d42c feat: update cors headers for cross domain request (#33898) 2023-12-12 09:09:18 -05:00
Kyle McCormick
140f85853d feat!: remove Content Libraries V2 index (#33888)
BREAKING CHANGE: Removes all code, tests, and settings related to
indexing of V2 (blockstore-backed) content libraries in elasticsearch.
This includes indexing of top-level library metadata as well as indexing
of library block metadata. Operators who enabled the experimental
Library Authoring MFE *and* the experimental ENABLE_CONTENT_LIBRARY_INDEX
feature may notice that sorting, filtering, and searching of V2
libraries and their blocks may now be slower and/or less powerful.
The ENABLE_CONTENT_LIBRARY_INDEX feature was already disabled by
default, so most/all operators (including edx.org) should not notice
any difference.

Removed settings include:

* FEATURES['ENABLE_CONTENT_LIBRARY_INDEX']
* ENABLE_ELASTICSEARCH_FOR_TESTS
* TEST_ELASTICSEARCH_USE_SSL
* TEST_ELASTICSEARCH_HOST
* TEST_ELASTICSEARCH_PORT

For rationale, see the updated "Status" section of:
./openedx/core/djangoapps/content_libraries/docs/decisions/0001-index-libraries-in-elasticsearch.rst
2023-12-07 14:57:31 -05:00
Jesper Hodge
7fd4c30daf Chore adjust swagger for api gateway (#33694)
* chore: add api.edx.org server and correct route to swagger file endpoints

* chore: make server urls for swagger doc depend on env variables

* chore: add yaml file server descriptions

* chore: rename authoring api route and add description to swagger

* Update cms/urls.py

Co-authored-by: connorhaugh <49422820+connorhaugh@users.noreply.github.com>

* fix: lint

* fix: lint

* fix: lint

---------

Co-authored-by: connorhaugh <49422820+connorhaugh@users.noreply.github.com>
2023-11-16 15:39:46 -05:00
Ahtisham Shahid
c6b36a8558 feat: added beamer to edx-platform (#33701) 2023-11-16 14:56:08 +05:00
Rodrigo Martin
e51c01bf4e feat: add support for user feedback on autogenerated transcripts (#33518)
* feat: WIP transcript feedback

* feat: Add UI mock for Transcript Feedbacks (#33416)

* feat: Add UI mock for Transcript Feedbacks

* fix: Fix mongo tests

* feat: Get video_uuid, user_uuid and language for request (#33445)

* feat: make call to ai-translations to obtain feedback

* feat: Show widget if transcript was AI generated

* feat: bind all class methods

* fix: async calls

* feat: send request when choosing feedback

* feat: update showing condition (#33474)

* fix: ajax success lint

* fix: video caption specs errors fixed

* feat: add coverage to feedback widget

* chore: connect XT to LMS and CMS

* feat: use url

* chore: add vars to devstack

* chore: fix url name

* feat: update unit tests regarding env vars

* fix: fix test_video_mongo

* feat: add more tests

* feat: remove console log

Co-authored-by: Jesper Hodge <19345795+jesperhodge@users.noreply.github.com>

* fix: rename shouldShowWidget to loadAndSetVisibility

---------

Co-authored-by: María Guillermina Véscovo <mvescovo@2u.com>
Co-authored-by: Jesper Hodge <19345795+jesperhodge@users.noreply.github.com>
2023-11-06 16:33:53 +00:00
Rebecca Graber
80a25bc368 feat: use new event_bus_producer_config (#33458) 2023-10-16 14:07:10 -04:00
Awais Qureshi
b353019c3f chore: Adding condition to pick values in case of django42. (#33440)
* fix: add default for CSRF_TRUSTED_ORIGINS_WITH_SCHEME.
2023-10-09 14:25:35 +05:00
Feanil Patel
8151d67592 feat: Be able to recieve e-mails in dev mode.
Set an e-mail destination path if no overrides are provided.  This
setting is only relevant when the file based email backend is in use
like it is in devstack.

As a part of this change, we render the DATA_DIR setting higher in the
settings file so we can reference it sooner but this should not impact
any other uses of this setting.
2023-09-01 15:05:58 -04:00
Saleem Latif
4136147d58 chore: Added new settings required by edx-enterprise latest version. 2023-08-25 15:40:33 +05:00
stv
96699d577c build: swap default file storage _away_ from deprecated lib
The S3BotoStorage backend was deprecated in favor of the S3Boto3Storage
backend. This change updates the default backend to use the latter.

style: This re-links and rewords a relevant comment that had been
disconnected during previous refactoring.

docs: ade79308a3/docs/backends/amazon-S3.rst (migrating-from-boto-to-boto3)

Fixes: FAL-3431
Fixes: public-engineering/128
2023-07-31 15:33:27 +02:00
David Ormsbee
53718094a5 fix: update Studio DEFAULT_FILE_STORAGE to s3boto3
s3boto is no longer a supported backend in django-storages, so this was
causing failues on startup when trying to run with the tutor-minio
plugin.
2023-07-17 11:46:09 -04:00
Usama Sadiq
997f194669 Revert "build: remove boto old version (#31282)" (#31733)
This reverts commit 14e6040141.
2023-02-09 18:36:59 +05:00
Muhammad Umar Khan
14e6040141 build: remove boto old version (#31282) 2023-02-09 15:21:10 +05:00
Jeff Cohen
f03b141f05 fix: do not clear request cache when running eager Celery tasks (#31261)
Clearing the RequestCache was intended to address memory leaks in the
celery workers. Celery worker processes will process many tasks before
they are terminated. RequestCache cleanup typically happens in the
RequestCacheMiddleware class, and middleware never executes for celery.
To get around that issue, the CLEAR_REQUEST_CACHE_ON_TASK_COMPLETION
setting was created to clear the RequestCache after every task was
successfully completed.

This works fine when celery is running as a separate process, as it's
set up to do in production. But during development, the
CELERY_ALWAYS_EAGER setting variable is set to True, meaning that
celery tasks are run in the same thread as the Django Request. This is
meant to make debugging easier, as task failures run as part of the
request cycle and will raise exceptions that are visible to the
browser.

However, celery tasks are triggered from many different actions. That
means that the RequestCache was being cleared many times during the
course of processing a request. This led to behavior that was
potentially slower, but also incorrect–the RequestCache was getting
flushed in a way that wouldn't happen in any deployed environment
because celery would be running in separate processes there. This came
up when trying to fix an issue around extra history records being
created during problem submissions:

  https://discuss.openedx.org/t/extra-history-record-stored-on-each-problem-submission/8081

Furthermore, it's not necessary to prevent RequestCache memory leaks
when running in CELERY_AWLAYS_EAGER mode in development because the
middleware cleanup happens automatically–as everything is running as
part of the request/response cycle.

There are times in which we may want to run celery eagerly and still
clear the cache, such as testing. I have set
CLEAR_REQUEST_CACHE_ON_TASK_COMPLETION = False in all dev and test
environments that already have CELERY_ALWAYS_EAGER = True. The unit
test that specifically tests whether the request cache is getting
cleared upon completion of a celery task then overrides
CLEAR_REQUEST_CACHE_ON_TASK_COMPLETION = True even though
CELERY_ALWAYS_EAGER = True for the sake of that specific testing
purpose.
2022-11-07 11:48:39 -05:00
Zachary Hancock
2f3c93ed9f feat: sync with exam service on course publish (#31015)
Call into the exam service instead of the edx-proctoring plugin on course publish if the course_apps.exams_ida course waffle flag is enabled. This is an early step in moving away from edx-proctoring
2022-09-20 12:38:32 -04:00
Eugene Dyudyunov
ff33fc1014 fix: studio registration using the LMS SSO (#30855)
* fix: studio registration using the LMS SSO

Add the social-core settings:
```
INACTIVE_USER_LOGIN = True
INACTIVE_USER_URL = 'http://localhost:18010'
```

Change the registration link's `next` parameter to trigger SSO login
after the registration.
2022-09-01 11:25:22 -04:00
Jansen Kantor
33e8d26502 Jkantor/learner course regrade queue (#30778)
* temp: move recalculate_course_and_subsection_grades_for_user to new queue
2022-07-25 15:14:05 -04:00
Ahtisham Shahid
73c2b1be7e Added Big Blue button as live provider (#30613)
* feat: added new live provider and fixed tests

* feat: added free_tier compatiblity

* fix: resolved linter issues and other refactors

* fix: ran makemigration to generate migrations

* fix: Implemeted key retrival for tabs

Co-authored-by: AhtishamShahid <ahtishamshahid@A006-00850.local>
2022-06-23 11:48:44 +05:00
Navin Karkera
4e74b16a41 refactor: [BB-6077] allow setting celery backend in yml 2022-06-10 12:39:59 +05:30
Kyle McCormick
8039e40f47 refactor: move coursegraph to cms
This code was originally located at:
  ./openedx/core/djangoapps/coursegraph

However, code makes more sense within the ./cms tree, because:
* it is responsible for publishing course content to an
  external system, with is within the responsibilities of CMS, and
* is uses modulestore, which is discouraged for use in LMS
  (see 0011-limit-modulestore-use-in-lms.rst).

So, we move the code to:
  ./cms/djangoapps/coursegraph
and uninstall coursegraph from LMS.

We do not expect this refactor to have any breaking downstream effects.
2022-03-29 11:21:20 -04:00
Tim McCormack
7c7d7d8b6f feat: Allow REST_FRAMEWORK to be configured by (shallow) merge (#30112)
ARCHBOM-2073
2022-03-28 20:38:34 +00:00
Feanil Patel
7d2a8340c5 feat: Update how some settings are read in production.py settings files.
Most settings in the production.py files fall back to their values in
common.py if they aren't set in the yaml config files but some
historically didn't.  Update them so that they are more in-line with the
rest of the settings in this file.
2022-03-24 09:59:53 -04:00
Awais Ansari
5a4cbc56ae feat: link discussions feedback URL with feedback button (#29919)
* feat: link discussions feedback URL with feedback button
2022-02-15 17:28:03 +05:00
Keith Grootboom
9d3f52ed67 feat: add PREPEND_LOCALE_PATHS configuration setting (#29851)
edx-platform supports COMPREHENSIVE_THEME_LOCALE_PATHS setting, which
appends paths to the end of LOCALE_PATHS,  but there's currently no
way to add additional paths to the start of the list.

https://tasks.opencraft.com/browse/SE-5299
2022-02-09 13:30:21 -05:00
Ahtisham Shahid
47c62d119d chore: added url for discussions mfe in prod settings (#29837) 2022-01-28 20:42:50 +05:00
Kyle McCormick
5e30c725a1 fix: check CMS_CFG before STUDIO_CFG; prefer the latter 2022-01-04 15:07:04 -05:00
Abdurrehman
6c6cf0ad0b feat: external plugin integration in instructor dashboard (#29376)
* feat: external plugin integration fixes
2021-12-07 15:54:00 +05:00
Ken Clary
81f7d10452 fix: correct path for dump_course_to_neo4j task, so it goes to correct celery queue.
TNL-8386
2021-11-05 14:37:33 -04:00
Ken Clary
c783684a09 fix: move coursegraph celery tasks to cms (from lms), and on a non-default, non-high-priority queue.
This is so that the lms default celery queue does not get backed up
when coursegraph is hosed (which is likely when coursegraph has been
redeployed and needs to get the full set of courses).

TNL-8386
2021-11-01 10:05:22 -04:00
Agrendalath
e633cc9c24 feat: support adding custom editors to Studio
This:
1. Introduces a variable for the Course Outline view in Studio.
   A custom theme can override it to add new editors.
2. Exports a function for creating new editor modals.
   A custom theme can use it to create editors without adding boilerplate code.
3. Adds a pluggable override for XBlock fields that are passed to the Studio.
   Without this, custom editors in Studio cannot retrieve values of XBlock fields.
2021-10-27 13:35:19 -04:00
Max Sokolski
acd83d1c05 fix: use common default for LANGUAGE_COOKIE_NAME (#29096)
Changes:
- use default LANGUAGE_COOKIE_NAME value from common for cases when there is no
`LANGUAGE_COOKIE` and `LANGUAGE_COOKIE_NAME` in ENV_TOKENS
2021-10-25 14:22:00 -04:00
Soban Javed
44ddbdf925 fix: use cookies for storing language instead of session
- Fixed LANGUAGE_COOKIE settings name to LANGUAGE_COOKIE_NAME beacuse later is recognised by django
- Added test to verify cookies use in dark lang middleware
- Fixing Django 3.0 tests
2021-10-04 21:00:29 +05:00
Awais Qureshi
fa959f1ed9 Merge pull request #28810 from edx/removing-cors-headers-checks
chore: `django-cor-headers` post deployment cleanup.
2021-10-04 17:12:47 +05:00
Gábor Boros
0935b5c51f feat: adds CELERY_BROKER_TRANSPORT_OPTIONS (#28849)
which can be configured from the lms/studio environment

refactor: raise ImproperlyConfigured on TypeError
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

Co-authored-by: Jillian Vogel <jill@opencraft.com>
2021-09-30 14:30:28 -04:00
Awais Qureshi
780ff09ce3 chore: django-cor-headers post deployment cleanup.
CORS_ORIGIN_WHITELIST configs already updated with schemes so no need for other list.
2021-09-21 20:01:32 +05:00
edX requirements bot
5e84e3761f feat: djang-cor-headers need schemes with urls. Adding condition to switch lists with different version.
With the PR it will load the old `CORS_ORIGIN_WHITELIST` since there is no change in `djang-cor-headers` version. In next PR this version will get upgraded.
2021-09-01 23:02:45 +05:00
Hamza Farooq
4a2549f49a fix: making LOGIN_REDIRECT_WHITELIST configurable through env files (#26760)
LOGIN_REDIRECT_WHITELIST has been used to filter redirect-url while processing logout requests but its configurations were not picked through environment files like lms.yml or studio.yml. This PR fixes that bug.
2021-08-03 08:29:23 -04:00
Diana Huang
9173707a50 feat: Allow shared cookies' domains to be set separately. (#28135)
Several of our cookies are meant to be shared between the LMS
and the marketing site. The previous assumption was that
SESSION_COOKIE_DOMAIN would cover both. We would like to make
it so that these can be set independently of each other.

https://openedx.atlassian.net/browse/ARCHBOM-1831
2021-07-12 15:49:11 -04:00
Feanil Patel
c2d848860d fix!: Make default queue names service variant specific.
common.py has queue names that always get overridden by production.py
and lead to confusion.  Set a default SERVICE_VANIANT in common.py and
then set the queue names based on that in common.py so that
production.py doesn't make it more complicated.

This should prevent the issue where if you copy a queue name in
common.py it ends up being incorrect in the production system.  This is
what happened with the sample_task change.

https://github.com/edx/edx-platform/pull/23731 made it so that the queue
name for that queue is independently configurable but the default was
set to the value of HIGH_PRIORITY_QUEUE in common.py which is not the
same as the value set in production.py leading to stale tasks that never
get picked up in production.

BREAKING_CHANGE: If anyone was building a different settings file on top
of common, the default names in common.py are now change to be service
variant specific. eg 'edx.cms.core.high' instead of 'edx.core.high'
2021-06-30 10:06:28 -04:00
adeelehsan
78f1f1916c Account activation popup added
VAN-434
2021-06-10 14:46:49 +05:00
Awais Jibran
30c80082c3 Use config settings for olxcleaner (#27294)
* Use config settings for olxcleaner

Use config settings instead of hardcoded values for olx validation. This would help in adding a great deal of control when you want to change these settings in the future. With this approch we would not need a redeploy.

* Use configs and deprecate waffleflag and also add / update tests
2021-04-12 16:27:42 +05:00
Zainab Amir
8cc5f13daf Add rate limit to registration endpoint (#27060)
Currently the registration endpoint has no rate limit. Added a new ratelimit
variable to support the change, it's value is set to 60/7d.

VAN-302
2021-03-25 16:28:30 +05:00