Commit Graph

243 Commits

Author SHA1 Message Date
Taylor Payne
7111e8b18c refactor: bring common settings into common module (#37746) 2026-01-09 09:20:59 -07:00
Feanil Patel
92a47097b7 feat: Drop the ENABLE_OAUTH2_PROVIDER flag.
This setting was not actually not changing installation behavior, that
is being set by whether oauth_dispatch is in INSTALLED_APPS or not.

This flag was being used to:

* Hide enable/disable certain URL paths.
    * We need these paths on all the time in the LMS because all other
      services and MFE rely on oauth to authenticate with the LMS so we
      just end up turning this on later in the settings stack.

* We use it to only run certain oauth_dispatch tests in the LMS test
  environment because the oauth_dispatch app is not installed in the
  CMS.
    * We use the `skip_unless_lms` decorator now instead to do this or
      just run the tests in both suites because they are valid tests in
      both contexts.
2025-11-03 12:54:06 -05:00
Muhammad Arslan Abdul Rauf
245c76fc1b fix: add '*' wild card in common ALLOWED_HOSTS 2025-09-22 16:38:05 +05:00
Muhammad Arslan Abdul Rauf
83dbf263d7 refactor: move ALLOWED_HOSTS to openedx/envs/common 2025-09-22 16:27:14 +05:00
Muhammad Arslan Abdul Rauf
b39e6ff20e fix: make ALLOWED_HOSTS configurable through YAML 2025-09-22 16:21:22 +05:00
coder1918
790a67a0d1 refactor: flatten FEATURES dictionary with backward compatible proxy 2025-09-09 14:11:39 -06:00
Ram Chandra Bhavirisetty
42afa1bb62 chore: remove deprecated DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings (#37002) 2025-09-05 17:52:33 -04:00
Ehtesham Alam
cb80118ebf fix: remove CSRF_TRUSTED_ORIGINS_WITH_SCHEME variable (#37195) 2025-08-20 11:12:44 +05:00
Taylor Payne
16d96565e3 refactor: move production defaults to common modules (#37045)
In the effort to simplify settings in edx-platform, as discussed in ADR 22 -
Settings Simplification, this PR brings some of the production defaults defined
in `lms/envs/production.py` and `cms/envs/production.py` up to
`openedx/envs/common.py` or `lms/envs/common.py` and `cms/envs/common.py` as
appropriate.

Bringing these defaults up from the `production.py` settings modules caused
changes in the rendered settings of the `test.py` modules, and so I have
settings to the `test.py` modules to bring the rendered settings back in line
with what is has been. I have not deeply looked at which settings are needed
for tests to pass or not, but just the differences between the rendered
settings between `master` and this branch.

ADR 22: https://github.com/openedx/edx-platform/blob/master/docs/decisions/0022-settings-simplification.rst
Fixes https://github.com/openedx/edx-platform/issues/36892.
2025-08-04 17:06:16 -04:00
Muhammad Arslan
d8ea16f6ec fix: refresh-saml-metadata beat task path fixed (#37080)
This PR fixes the task path in the Celery beat settings for the
refresh-saml-metadata scheduled task.

We had previously added the fetch_saml_metadata task to the Celery beat
schedule to run periodically (default: every 24 hours). However, due to a typo
in the task path, Celery workers were throwing errors. This fix corrects the
task path so the schedule can run as intended.
2025-07-29 15:46:59 -04:00
Robert Raposa
f4c3575bb0 Revert "fix(settings): replace DEFAULT_FILE_STORAGE with STORAGES[default]" (#36907)
This reverts commit 39028b9500.
2025-06-13 16:57:47 +00:00
Ram Chandra Bhavirisetty
39028b9500 fix(settings): replace DEFAULT_FILE_STORAGE with STORAGES[default] 2025-06-13 11:40:56 -04:00
M Umar Khan
a2eda30488 chore: remove csrf with scheme settings from edxapp
See https://github.com/edx/edx-arch-experiments/issues/460 for more
details.
2025-06-02 12:12:09 -04:00
Feanil Patel
88c7cd7bf3 feat!: Remove Legacy Preview Functionality (#36460)
* feat!: Remove all trivial mentions of PREVIEW_LMS_BASE

There are a few more mentions but these are all the ones that don't need
major further followup.

BREAKING CHANGE: The learning MFE now supports preview functionality
natively and it is no longer necessary to use a different domain on the
LMS to render a preview of course content.

See https://github.com/openedx/frontend-app-learning/issues/1455 for
more details.

* feat: Drop the `in_preview_mode` function.

Since we're no longer using a separate domain, that check always
returned false.  Remove it and update any places/tests where it is used.

* feat: Drop courseware_mfe_is_active function.

With the removal of the preview check this function is also a no-op now
so drop calls to it and update the places where it is called to not
change other behavior.

* feat!: Drop redirect to preview from the legacy courseware index.

The CoursewareIndex view is going to be removed eventually but for now
we're focusing on removing the PREVIEW_LMS_BASE setting.  With this
change, if someone tries to load the legacy courseware URL from the
preview domain it will no longer redirect them to the MFE preview.

This is not a problem that will occur for users coming from existing
studio links because those links have already been updated to go
directly to the new urls.

The only way this path could execute is if someone goes directly to the
old Preview URL that they saved off platform somewhere.  eg. If they
bookmarked it for some reason.

BREAKING CHANGE: Saved links (including bookmarks) to the legacy preview
URLs will no longer redirect to the MFE preview URLs.

* test: Drop the set_preview_mode test helper.

This test helper was setting the preview mode for tests by changing the
hostname that was set while tests were running.  This was mostly not
being used to test preview but to run a bunch of legacy courseware tests
while defaulting to the new learning MFE for the courseware.

This commit updates various tests in the `courseware` app to not rely on
the fact that we're in preview to test legacy courseware behavior and
instead directly patches either the `_redirect_to_learning_mfe` function
or uses the `_get_legacy_courseware_url` or both to be able to have the
tests continue to test the legacy coursewary.

This will hopefully make the tests more accuarte even though hopefully
we'll just be removing many of them soon as a part of the legacy
courseware cleanup.

We're just doing the preview removal separately to reduce the number of
things that are changing at once.

* test: Drop the `_get_urls_function`

With the other recent cleanup, this function is no longer being
referenced by anything so we can just drop it.

* test: Test student access to unpublihsed content.

Ensure that students can't get access to unpublished content.
2025-05-14 08:59:11 -04:00
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
Kyle McCormick
e1a8b52dc2 refactor: Use derive_settings to lazy load settings. (#36205)
Some of our settings depend on the values of other settings.  Rather
than explicitly looking up each one in the YAML settings file, we can
simply derive them based on the setting in the YAML file after all the
YAML settings have been loaded.

Part of: https://github.com/openedx/edx-platform/issues/36215
Co-Authored-By: Feanil Patel <feanil@axim.org>
2025-02-05 11:45:35 -05:00
Kyle McCormick
32275662b0 feat!: A Better API for Derived Settings (#36192)
The Python API for declaring derived settings was confusing to the uninitiated
reader, and also prone to spelling mistakes. This replaces the API with one
that is more readable and more concise, and updates the implementation of
`derive_settings` to properly derive settings declared using the new API.

BREAKING CHANGE: The `derived` and `derived_collection_entry` function are
replaced with the `Derived` class. We do not expect those functions to have
been used outside of edx-platform, but if they are, this commit will cause them
to loudly ImportError.

Note that there should be NO change in behavior to the `derive_settings`
function, which we DO know to be used by some external edx-platform plugins.

Part of: https://github.com/openedx/edx-platform/issues/36215
2025-02-04 14:57:43 -05:00
Kyle D. McCormick
0ea4bae7b3 fix: Exactly preserve legacy settings dicts; rm KEYS_WITH_MERGED_VALUES
In the near term, we wish to precisely preserve the existing values of
all Django settings exposed by lms/envs/production.py in order to avoid
breaking legacy Django plugins without a proper announcement.

That includes preserving the behavior of these old, redundant dicts:
* ENV_TOKENS
* AUTH_TOKENS
* ENV_FEATURES
* ENV_CELERY_QUEUES
* ALTERNATE_QUEUE_ENVS

Particularly, it means we need to ensure that updates to Django
settings are reflected in these dicts. The most reliable way to do that
is to change the yaml-loading logic so that these values are aliased
to the corresponding values in the global namespace rather than
deep-copied.

Finally, we remove KEYS_WITH_MERGED_VALUES from the global namespace,
and inline the remaining list. We have modified the list (specifically,
we dropped the no-op MKTG_URL_OVERRIDES). Plugins should not be counting
on the value of the list, so we remove it.
2025-01-30 08:23:09 -05:00
Kyle D. McCormick
4449f43c4e fix: SHARED_kCOOKIE_DOMAIN -> SHARED_COOKIE_DOMAIN 2025-01-30 08:23:09 -05:00
Kyle McCormick
a81493ce7f revert: revert: refactor: Clean up lms/envs/production.py cruft
This reintroduces commit 15939232d5,
which was reverted due to a typo.

The typo is fixed in the commit immediately following this one.

Co-Authored-By: Feanil Patel <feanil@axim.org>
2025-01-30 08:23:09 -05:00
Robert Raposa
4035aa3487 Revert "refactor: Clean up lms/envs/production.py cruft (#36115)" (#36129)
This reverts commit 15939232d5.
2025-01-17 16:16:38 +00:00
Kyle McCormick
15939232d5 refactor: Clean up lms/envs/production.py cruft (#36115)
This is a pure refactoring of lms/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.

Notes on some of the more involved refactorings:

* AWS Locals Load block is handled by the YAML loading at the very top, we
  don't need to re-load it since there were no changes to those settings
  between the YAML loading at the top and this section.

* MKTG_URL_OVERRIDES, we drop doing any overrides and remove it from the merge
  list beacuse the default value in
  lms/envs/common.py is empty.  So the update is a no-op and is the same as just
  loading this data directly from the YAML config.

* CODE_JAIL block, we've been overriding the entire dict if it is in your YAML
  config, so then going through and updating the individual values is not necessary.

* SSL_AUTH_EMAIL_DOMAIN and SSL_AUTH_DN_FORMAT_STRING are not used anywhere in
  the openedx org, looks like they were used by the old `dashboard` djangoapp
  and can probably be deleted but might be used by plugins so not removing for
  now to keep the change backward compatible.

* DEFAULT_FILE_STORAGE, previously two of the braches were no-ops so we only
  keep the one branch we need for when we want to update DEFAULT_FILE_STORAGE
  automatically if AWS keys are set.

Somewhat related to: https://github.com/openedx/open-edx-proposals/issues/587

Co-Authored-By: Feanil Patel <feanil@axim.org>
2025-01-16 15:19:47 -05:00
Kyle McCormick
343a4cad56 docs: update settings comment 2025-01-15 17:35:13 -05:00
Ahtisham Shahid
b50c42318c feat: added country disabling feature (#35451)
* feat: added country disabling feature
2024-09-25 14:40:08 +05:00
Deborah Kaplan
58de0964ca feat: removing visible_date-to-creds updates per-cert (#35113)
* feat: removing visible_date-to-creds updates per-cert

The credentials IDA now relies on  the course certificate configuration
and (if present) `certificate_available_date` for displayability. We no
longer need to send `visible_date` updates for every awarded certificate
when a course  overview changes.
2024-07-17 08:43:12 -04:00
muhammad-ammar
6a04752005 feat: use xpert ai 2024-07-04 18:17:02 +05:00
Emad Rad
c27d55a253 chore: typos fixed 2024-05-25 18:05:28 +03:30
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
Asespinel
76330b36b0 feat: added setting to disable the survey report banner entirely (#34092)
* feat: added setting to disable the survey report banner entirely

* fix: fixed unit test with new setting

* refactor: changed conditions for better code readability

* feat: added exception to stop the report from generating if the setting is set to false

* chore: updated the readme file to include the new setting

* refactor: move survey settings to common and disable admin by setting

* docs: typos in README

Co-authored-by: Tim McCormack <tmccormack@edx.org>

* refactor: set default values to survey report settings

* refactor: rename ENABLE_SURVEY_REPORT setting to SURVEY_REPORT_ENABLE

* test: fix quality tests

---------

Co-authored-by: Alejandro Cardenas <alecar.main@gmail.com>
Co-authored-by: Tim McCormack <tmccormack@edx.org>
2024-01-30 12:29:09 -05:00
Alejandro Cardenas
ebcbe1cd92 refactor: allow editing of ANONYMOUS_SURVEY_REPORT by env tokens (#33954) 2023-12-19 14:40:41 -05:00
Asespinel
e9d84d0ec1 feat: added banner message for survey report (#33633)
* feat: added banner message for survey report

* refactor: addressed PR feedback and changes
* fix: fixed styles on admin templates
* refactor: changed script location to survey report block
* chore: removed whitespaces and renamed the context processor files
* feat: added banner message for survey report
* refactor: separated survey report template from admin and deleted base template
* refactor: changed months variable into a configurable setting


---------

Co-authored-by: Maria Fernanda Magallanes Zubillaga <maria.magallanes@edunext.co>
Co-authored-by: María Fernanda Magallanes <35668326+MaferMazu@users.noreply.github.com>
2023-12-18 10:19:51 -05: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
Andy Shultz
3da6578e9b feat: add settings for detailed search logging (default off)
devstack on, production load from environment
2023-11-16 10:00:30 -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
jszewczulak
512bc405cc feat: added routing keys for ORA workflow batch update (#33136)
* feat: added routing key for ORA batch update
2023-09-27 14:53:11 -04:00
Awais Qureshi
4943674fc1 feat!: upgrading django-storages to 1.13.2 (#33301)
* feat!: upgrading `django-storages` to `1.13.2`
2023-09-21 16:56:50 +05:00
Awais Qureshi
c50e01e107 feat!: Django 4.0 and above, CSRF_TRUSTED_ORIGINS must include scheme. (#33226)
* feat!: Django 4.0 and above, CSRF_TRUSTED_ORIGINS must include scheme.

* feat!: Django 4.0 and above, CSRF_TRUSTED_ORIGINS must include scheme.

* fix: fix quality failure

* feat!: Django 4.0 and above, CSRF_TRUSTED_ORIGINS must include scheme.
2023-09-20 15:49:47 +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
Awais Qureshi
63a080885c feat!: setting AWS_DEFAULT_ACL default value in lms.py. (#32816)
* feat!: setting AWS_DEFAULT_ACL default value in lms.py.

 https://django-storages.readthedocs.io/en/1.10.1/backends/amazon-S3.html
2023-08-24 15:29:23 +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
Feanil Patel
82dde016f6 Merge pull request #32239 from openedx/feanil/migration_check
Migrate migration checks to `minimal.yml` config.
2023-06-15 11:06:14 -04:00
Awais Ansari
52a886d456 feat: filter notifications based on NOTIFICATIONS_EXPIRY (#32411)
* feat: add 2 months limit in notifications list API

* chore: add NOTIFICATIONS_MAX_DAYS in lms settings

* refactor: update NOTIFICATIONS_MAX_DAYS to NOTIFICATIONS_EXPIRY

* feat: add order_by reverse id in notificationslist API
2023-06-13 17:05:18 +05:00
Feanil Patel
4338f55548 fix: Load the DATA_DIR via derived_settings tooling.
If we don't make the DATA_DIR a derived_setting, the only way to
override it is to override the entirety of the MODULESTORE config, or
override DATA_DIR in common.py in your fork.
2023-06-12 15:06:15 -04:00
Sagirov Eugeniy
7213f27ca5 feat: Add GA 4 support to edX platform 2023-04-06 17:15:20 +03:00
Alejandro Cardenas
7f90b5d3e1 feat: add SurveyReportUpload and add send report method (#31431)
* feat: add SurveyReportUpload and add send report method

* docs: Update openedx/features/survey_report/management/commands/generate_report.py

Co-authored-by: Maria Grimaldi <maria.grimaldi@edunext.co>

* docs: Update openedx/features/survey_report/models.py

Co-authored-by: Maria Grimaldi <maria.grimaldi@edunext.co>

* refactor: Update openedx/features/survey_report/models.py

Co-authored-by: Maria Grimaldi <maria.grimaldi@edunext.co>

* style: Update openedx/features/survey_report/api.py

Co-authored-by: Maria Grimaldi <maria.grimaldi@edunext.co>

* feat: add migratio file and update status field name

* refactor: rename send report method

* test: fix test errors

* test: add command options

* refactor: simple conditional instead of ok method

* fix: remove useless imports

* fix: use status code instead of status

* feat: add zapier endpoint

* style: solve pylint issues

* feat: add id field to send report data

* refactor: regenerate migration with correct history

* feat: add anonymous site id model

* feat: update zapier url

---------

Co-authored-by: Maria Grimaldi <maria.grimaldi@edunext.co>
Co-authored-by: Alejandro Cardenas <alejandrocardenas@Alejandros-MacBook-Pro.local>
2023-02-21 10:51:36 -05:00
Usama Sadiq
997f194669 Revert "build: remove boto old version (#31282)" (#31733)
This reverts commit 14e6040141.
2023-02-09 18:36:59 +05:00