Skip to content

Commit

Permalink
Changes required for upgrading to Python 3.10 and CKAN 2.11 (#39)
Browse files Browse the repository at this point in the history
* Make sure to init CKAN schema in RDS if the problem is DMS as well.

* Add the virtual environment bin to the path so that binaries can be found in the init container.

* Remove redundancy regarding having the datastore and datapusher enabled. There was no need for a special case for DMS.

* Set the SECRET_KEY environment variable.

* Fixed typo.

* Fix CKAN image tag to 2.11.0 and PostgreSQL to whatever is latest.

* Reset PostgreSQL to version 15 as this is a recent change that came from inconsistent runs.

* Configure flask-session to use redis

* Sensible default values for site title and description

* Redis URL is set via an env var

* Update site title and description

---------

Co-authored-by: Jonathan S Berry <[email protected]>
  • Loading branch information
ntwalibas and jonathansberry authored Nov 18, 2024
1 parent 9697ac0 commit 57d8509
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions group_vars/all/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ projectname: "ckan"
ckan_fqdn: "ckan.minikube"
ckan_site_url: "http://{{ ckan_fqdn }}"
ckan_image: "ghcr.io/fjelltopp/fjelltopp-base-images/ckan"
ckan_image_tag: "2.9.8"
ckan_image_tag: "2.11.0"
ckan_db_image: "postgres:15"

# ckan_ds_ro_pass: "123456789"
Expand All @@ -75,9 +75,9 @@ ckan_solr_url: "http://solr:8983/solr/ckan"
ckan_plugins: "stats text_view image_view recline_view blob_storage authz_service"

# CKAN Front-End Settings
ckan_site_title: "Document Management System"
ckan_site_title: "Fjelltopp"
ckan_site_logo: "/images/logo.png"
ckan_site_description: "Department of HIV & AIDS, Ministry of Health, Malawi"
ckan_site_description: "Data Catalogue"
ckan_favicon: "/images/favicon.ico"
ckan_gravatar_default: "identicon"
ckan_preview_direct: "png jpg gif"
Expand Down
14 changes: 10 additions & 4 deletions roles/ckan/templates/ckan/ckan_production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,26 @@ ckan.devserver.host = localhost
ckan.devserver.port = 5000


## Session settings
## CKAN <2.11 Session settings
cache_dir = /tmp/%(ckan.site_id)s/
beaker.session.key = ckan
beaker.session.type = ext:redis
beaker.session.url = redis://redis:6379/3
beaker.session.cookie_expires = 86400
beaker.session.timeout = 86400


# This is the secret token that the beaker library uses to hash the cookie sent
# to the client. `ckan generate config` generates a unique value for this each
# time it generates a config file.
beaker.session.secret = {{ ckan_beaker_secret }}

## CKAN >=2.11 Session settings
SESSION_TYPE = redis
SESSION_COOKIE_NAME = ckan
SESSION_PERMANENT = true
PERMANENT_SESSION_LIFETIME = 86400
# The secret token that is used for session management and other security related tasks as well
SECRET_KEY = {{ ckan_secret_key }}

# `ckan generate config` generates a unique value for this each time it generates
# a config file.
app_instance_uuid = 853f1fc8-aba1-411e-9071-44e3cdce64dd
Expand Down Expand Up @@ -103,7 +109,7 @@ solr_timeout = 60
## Redis Settings

# URL to your Redis instance, including the database to be used.
#ckan.redis.url = redis://localhost:6379/0
# ckan.redis.url = redis://localhost:6379/0 # Fjelltopp sets through ENV VAR


## CORS Settings
Expand Down
1 change: 1 addition & 0 deletions roles/ckan/templates/kubernetes/ckan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ spec:
args:
- cd /usr/lib/ckan/;
export HOME=/usr/lib/ckan/;
export PATH=/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/bin:$PATH;
pipenv --version;
pipenv sync --dev;
rm -rf venv;
Expand Down

0 comments on commit 57d8509

Please sign in to comment.