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
Update 'CKAN Configuration Options' docs #693
Conversation
quick thoughts ckan.site_about - this is broken and genshi based remove any ${...} ckan.legacy_templates
site_title in wrong section move to with description Authorization Settings - remove the whole section |
Thanks for the comments, @tobes. Could you explain me why we should remove Authorization Settings? I still see it used in https://github.com/okfn/ckan/blob/master/ckan/model/authz.py#L341. Is it going to be removed for 2.0? Maybe we should remove this part of the documentation whenever we remove that code? Also, remove it from the development.ini... |
Is this a note I should add to the documentation, or you're telling me to remove ${...} from the examples? |
this is old crap that needs removing at some point. The auth stuff changed totally in 2.0. some old code remains and will eventually be removed
this |
@tobes it should be good to merge now, could you double check? |
a)
you have added a note saying they deprecated - this is wrong it should say they are for legacy use only and should not be used b) c) ckan.site_about there is no default value if it is empty we use a template d) openid_enabled openid may be broken so I'm not sure if this should be here? someone else may have a view @seanh will ultimately be doing the merge |
@tobes I've just pushed your last suggestions |
That's a shame that autodoc can't parse the ini file. If that's the case, then I think we should document each config option in Sphinx and not document any of them a second time with comments in the deployment.ini_tmpl, we should delete those. But maybe we should make sure that every option appears in As for the Sphinx docs, I really think it'd be nice to do this with autodoc. Is there really not One Place in the source code where all the config options are defined? There probably should be.. |
I haven't looked through them all but it looks like maybe every Things that are not in Options from libraries that we use, e.g. Some CKAN options are missing from I need to educate myself about what app_globals is for. I think it's a Pylons thing. I'll have a look. Some options in Some other config options are only used in the legacy templates, these should probably just be deleted from both Some options seem to be named wrong in |
@tobes Do you know what this |
Alright. This is a bit of a mess. IMHO ideally we wouldn't have each config value defined in three or four different places ( Maybe we can define the config settings in You can add docstrings to attributes in Python, as long as those attributes are simple assignments at the top-level of a module, class or
With this approach, I think we could add a unit test or other code to enforce that every config setting defined in You can't have dots in python attribute names, so maybe we can say that a config setting called Unfortunately some config settings have even more dots in their names, e.g. Another problem is how to we enforce that every config setting has to have an attribute in There's also quite a lot going on with some config settings in @vitorbaptista @tobes This may all be a stupid idea. Let me know what you think, maybe there's a better solution, or maybe there's nothing to be done and we simply have to document config settings directly in For details about attribute docstrings in Python and autodoc see: http://www.python.org/dev/peps/pep-0258/#attribute-docstrings |
I guess we could try to monkey-patch the |
sometimes I think github isn't the place for these discussions as some people may not see them. I'd like more autodocumentation eg plugins.toolkit maybe we could do this sort of stuff via paster? the toolkit has import circular nightmare issue maybe these will slowly resolve as refactoring happens. as far as config options maybe app_globals is a good place although some eg openid feel they don't belong there. we can definitely sortthe config being used everywhere stuff, perhaps by removing the config or hiding it cunningly - maybe just have a coding standards test that chack for it being imported etc. |
@tobes One thing that is still confusing me is why we add all these config settings (the ones in the If I understand it all right (and I haven't tested to verify this) it looks like we've implemented our own system where the value for a config option may come from the default hardcoded in the |
The reasons for the config vs globals are as follows config is just whatever gets added via the .ini and is unprocessed (this could be changed) because of this config stuff tends to end up in code as config is not available to the templates whilst g is available. having stuff in 2 places is always confusing so that is why I suggest we just use |
Hmm. Didn't we have the stuff in one place (the If So I'm thinking maybe we should look into removing this stuff from P.S. In reading about this I found out that calling it |
I agree that A problem with using Also I'm keen to get ckan to a point when we can switch frameworks. Pylons is unsupported and must have huge security issues by now I'd imagine. I think the app_globals code helps with this.
It was also agreed long ago about config being kept out of the templates due to ease of abuse. |
@tobes I think this is another one of those interesting discussions that should move to the dev list. I'll send an email. @vitorbaptista While we argue about this do you want to make the changes in |
How does this relate to #746? It seems to me that they are quite related as deployment.ini_tmpl should match whatever documentation is in configuration.rst, so I'll wait until this is done (or feel free to do both at the same time) |
@vitorbaptista Do you need more work on this or can it be reviewed? |
@amercader I'll finishing writing the configuration variables discussed in #534 today, and then this might be reviewed. |
The added options are: ckan.tracking_enabled search.facet.limits ckan.root_path ckan.site_intro_text
Conflicts: doc/configuration.rst
Closing this one as I needed to make changes, current is now #833 |
I haven't used autodocs for this either because I couldn't think about a good place to put the file with all the documentations to be parsed. As, AFAIK, we can't use the docs inside the .ini files, it felt duplicated to try and create another file just to gather all config options and document them. That feels like the same as simply creating them directly into the .rst file.
Fixes #534