MI-DPLA / combine

Combine /kämˌbīn/ - Metadata Aggregator Platform
MIT License
26 stars 11 forks source link

explore possibility of DB stored settings to augment localsettings.py #409

Open ghukill opened 5 years ago

ghukill commented 5 years ago

Many important variables/configurations are stored in localsettings.py. Unfortunately, this means only someone with server level access can update these, and restart Combine. A good example of a configuration that a user of Combine might want to edit is COMBINE_OAI_IDENTIFIER which is a string that becomes part of all OAI identifiers on the way out.

Can imagine a JSON document stored in Mongo that could override the normal pipeline of localsettings.py overwriting and augmenting settings.py. If this were called appsettings or hotsettings (suggesting they are DB, not file driven), just as a handle, the series of overrides would be:

settings.py --> localsettings.py --> appsettings (Mongo JSON document)

These settings are almost exclusively retrieved from django.settings, which means it might also be possible to merge/interleave some settings from appsettings "hot" during the request/response cycles, avoiding the need for a restart. The danger here is that not all would be possible in this way, like settings that are used and passed to Livy/Spark, or Celery.

antmoth commented 4 years ago

I'm going to advocate for using an actual settings table instead of a JSON document. :)