From 5472b9d63ecae6992a3080cfd4246ed206f65dd7 Mon Sep 17 00:00:00 2001 From: Wesley B <62723358+wesleyboar@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:35:50 -0600 Subject: [PATCH] fix: CMD-194 CMS customization fails, CMS is old --- README.md | 10 ++++--- docs/customize-cms.md | 26 +++++++++++++++++++ server/conf/cms/secrets.sample.py | 15 +++-------- .../docker/docker-compose-dev.all.debug.yml | 4 ++- 4 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 docs/customize-cms.md diff --git a/README.md b/README.md index c4068503a..2d824b2e6 100644 --- a/README.md +++ b/README.md @@ -107,11 +107,15 @@ After you clone the repository locally, there are several configuration steps re ##### CMS -- Copy `server/conf/cms/secrets.sample.py` to `server/conf/cms/secrets.py` +Add CMS settings and secrets: -- To emulate a specific CMS project, copy https://github.com/TACC/Core-CMS-Resources/blob/main/__PROJECT_TO_EMULATE__/settings_custom.py to `server/conf/cms/settings_custom.py` +```sh +curl "https://cdn.jsdelivr.net/gh/TACC/Core-CMS@main/taccsite_cms/secrets.example.py" -o server/conf/cms/settings_custom.py +cp server/conf/cms/secrets.sample.py server/conf/cms/secrets.py +curl "https://cdn.jsdelivr.net/gh/TACC/Core-CMS@main/taccsite_cms/settings_local.example.py" -o server/conf/cms/settings_local.py +``` -- To override any standard or custom CMS settings, create a `server/conf/cms/settings_local.py` +To populate or customize the CMS, read [Customize a CMS](./docs/customize-cms.md). #### Build the image for the portal's django container: make build diff --git a/docs/customize-cms.md b/docs/customize-cms.md new file mode 100644 index 000000000..11a0ff032 --- /dev/null +++ b/docs/customize-cms.md @@ -0,0 +1,26 @@ +# Customize a CMS + +This is all optional. You can develop Core-Portal without CMS customization. + +## Basic + +To create your own test content, [learn Django CMS as we use it](https://tacc-main.atlassian.net/wiki/x/phdv). + +To emulate a specific project's CMS settings: +1. Visit https://github.com/TACC/Core-Portal-Resources/blob/main/. +2. Navigate to specific project. +3. Copy its `cms.settings_custom.py` to your `server/conf/cms/settings_custom.py`. + +To override any standard or custom CMS settings, edit `server/conf/cms/settings_local.py`. + +> **Note:** If your `settings_custom.py` and `settings_local.py` are directories, then they were not properly created before starting environment. To fix: +> 1. Run `make stop`. +> 2. [Add CMS settings.](../README.md#CMS) +> 3. Run `make start`. + + +## Advanced + +To populate content from an existing CMS, follow and adapt instructions to [replicate a CMS database](https://tacc-main.atlassian.net/wiki/x/GwBJAg). + +> **Important:** This requires high-level server access or someone to give you a copy of the content. diff --git a/server/conf/cms/secrets.sample.py b/server/conf/cms/secrets.sample.py index 5c1d470e6..24b5883d5 100644 --- a/server/conf/cms/secrets.sample.py +++ b/server/conf/cms/secrets.sample.py @@ -1,12 +1,12 @@ ######################## -# DJANGO SETTINGS +# DJANGO ######################## SECRET_KEY = 'replacethiswithareallysecureandcomplexsecretkeystring' LOGIN_REDIRECT_URL = '/workbench/dashboard/' ######################## -# ELASTICSEARCH +# SEARCH ######################## ES_AUTH = 'username:password' @@ -14,24 +14,15 @@ ES_INDEX_PREFIX = 'cep-dev-{}' ES_DOMAIN = 'https://cep.test' -es_engine = 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine' HAYSTACK_CONNECTIONS = { 'default': { - 'ENGINE': es_engine, + 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 'URL': ES_HOSTS, 'INDEX_NAME': ES_INDEX_PREFIX.format('cms'), 'KWARGS': {'http_auth': ES_AUTH} } } -######################## -# RECAPTCHA SETTINGS -######################## - -RECAPTCHA_PUBLIC_KEY = '' -RECAPTCHA_PRIVATE_KEY = '' -SILENCED_SYSTEM_CHECKS = ['captcha.recaptcha_test_key_error'] - ######################## # REDMINE TRACKER AUTH ######################## diff --git a/server/conf/docker/docker-compose-dev.all.debug.yml b/server/conf/docker/docker-compose-dev.all.debug.yml index 0b4e7be1f..bb8bb767c 100644 --- a/server/conf/docker/docker-compose-dev.all.debug.yml +++ b/server/conf/docker/docker-compose-dev.all.debug.yml @@ -4,9 +4,11 @@ version: "3.8" services: cms: - image: taccwma/core-cms:ff737a3 + image: taccwma/core-cms:latest volumes: - ../cms/secrets.py:/code/taccsite_cms/secrets.py + - ../cms/settings_local.py:/code/taccsite_cms/settings_local.py + - ../cms/settings_custom.py:/code/taccsite_cms/settings_custom.py - ../cms/uwsgi/uwsgi.ini:/code/uwsgi.ini - ../../cms/static:/code/static - ../../cms/media:/code/media