Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.1 Config in the Database #8

Open
rossjones opened this issue Dec 10, 2014 · 4 comments
Open

1.1 Config in the Database #8

rossjones opened this issue Dec 10, 2014 · 4 comments

Comments

@rossjones
Copy link

As a Developer I want to set config from a web API so that I can change
these settings from my program (or from a UI that uses AJAX)

Implementing this will likely involve following pieces of work

    1. Moving most configuration to be in Database (in a new table) and 
        making relevant changes to the app in light of this (e.g. so that app 
        loads config from the DB)
            a. Ensuring that changes in config result in a reload of this config
                in the app (e.g. by changing app to load DB config on every request)
    2. Maintaining backwards compatibility by still loading config from disk
        for cases where some or all of config is still on disk (so search disk first, 
        then load DB config - DB config overwrites disk config)
    3. Create a Web UI as part of CKAN Admin Dashboard for viewing and 
        updating config (e.g. located at ckan-admin/config)
@rossjones
Copy link
Author

Moving config to the database has been discussed a little before at ckan/ideas#88

At the most extreme this could involve the postgres url being in an Operating System environment variable (or determined from the ones Postgres already understands) and everything else being in the database - but there are likely to be issues when extensions want their own configuration options.

Moving the .ini values to the database 'as-is', a collection of lines with just string values seems most straightforward, but there may potentially be more value in understanding what the values are and grouping them accordingly. All the solr options together under one heading for instance.

Handling extension configuration options beyond simple map of the .ini format wouldn't really be feasible immediately (unless the plugin itself decided to offer a WUI for it) but could still be done under a heading per extension, or perhaps a section at the end for free-form configuration options.

I'm not sure how feasible the reload on every request is, it would require passing the update configuration information to the plugins that have registered as wanting to modify/update config, and all plugins would have to be reloaded as it isn't known if they read config at any point during their processing. I'd suggest this should be a wider descriptions 'Updates to config should be available relatively shortly after the update, and the plugins may need to be reloaded', so that whoever does the work has the flexibility to implement it as they see fit.

This could probably all be done as a single piece of work.

@jqnatividad
Copy link
Contributor

Also, how would this impact installing plugins/extensions? If we are to cf Wordpress dashboard as per the draft proposal, WP exposes a way to install extensions via the web interface as well.

@rossjones
Copy link
Author

I added ckan/ideas#113 today because it's been bugging me for a while :) Even better if it could be hooked into http://extensions.ckan.org

@jqnatividad
Copy link
Contributor

+1 on hooking up to extensions.ckan.org. Already, there are 275+ CKAN extensions (https://github.com/ckan/extensions.ckan.org), of which 99 are listed on the site.

Hooking up the registry will go a long way towards expanding the CKAN extension development community, and follows the WP plugin registry example, with its 34,000+ plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants