Open rufuspollock opened 10 years ago
Perhaps it would be even better if there was no local config file and the database was specified in $CKAN_DB or something similar? Certainly more 12-factor and easily set in uwsgi or apache per host.
On further investigation it looks like the current changeable config isn't stored in the database, it's stored back in config.
Apologies if this idea is silly - how about using e.g. honcho to pull environment variables from a local .env file to be used in the config? This could keep confidential information out of the config and help scaling. Downside - it's another wrapper, and it requires some conventions re variable names (or a .env file template), and how would this apply to multi-tenant CKANs wiht multiple dbs.
@florianm that's not bad. I have some concerns about config in the db because I drop and recreate my development databases all the time.
We could also use config files that reference a common base e.g.:
[app:main]
use = config:common-base.ini
That wouldn't require any extra frameworks, but it makes updating settings from an api harder.
@wardi that approach sounds more practicable than using honcho.
Could we have multiple external configs? Multi-tenant instances may want to share some custom config settings (plugins etc, e.g. from config:common-base.ini
) but also have other specific settings (db et al., say from config:site-{one, two, three, ...}.ini
)
If the external configs could live outside the config dir, it would allow Docker images to use persistent mapped directories outside the running container, and might also help server orchestration tools to spin up multiple machines / multi-tenant instances.
+1 on @rgrp 's idea of moving all hot settings to db while being populated initially from config.
(Original ticket: http://trac.ckan.org/ticket/277.html)
What: move most CKAN config into the database from paster ini files (obviously some info must remain like DB connection but not much else!)
Why?
Issues / Questions
What's Been Done Already
Original Proposal - http://trac.ckan.org/ticket/277.html
Table (Settings / Options)
Columns:
Loading settings from DB
Do this in ckan/config/environment.py
Web Interface
/ckan-admin/settings
Show label, plus description plus text field