Opened 19 years ago
Last modified 18 years ago
#1051 closed enhancement
centralized trac.ini — at Version 7
Reported by: | Manuzhai | Owned by: | Matthew Good |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | web frontend/mod_python | Version: | 0.8 |
Severity: | normal | Keywords: | |
Cc: | manuzhai@…, trac.tickets@…, dserodio@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
I was just trying to trick the mod_python handler into displaying a prettier page where you can choose from different projects, and while I got it done in the end, it was not a very pretty solution. This was mainly due to the fact that only the env knows about things like template locations, htdocs_location, and other stuff.
To make it easier to use Trac with multiple projects, I think Trac should have a central configuration file (e.g., /etc/trac.ini
) which contains defaults for all the options in the env trac.ini
that are reasonable. These options can than be overwritten in env-specific trac.ini
's.
Would this be as useful as I think? I could whip up a patch if necessary. :)
Change History (13)
by , 19 years ago
Attachment: | centralini.diff added |
---|
comment:1 by , 19 years ago
Component: | general → mod_python frontend |
---|---|
Milestone: | 0.9 |
Owner: | changed from | to
Priority: | normal → low |
Summary: | Trac needs a central config file → Customizable project listing |
Well, trac.siteconfig
already knows the location of all the default directories, and the other stuff is really environment specific. I don't see how a central configuration file would help very much there. The centralini.diff
patch will obviously only work on Unix systems, and hardcoding the path isn't pretty.
A proper solution would be (IMHO) to add a PythonOption like TracEnvIndexTemplate to the mod_python handler. If you want to get fancy, you could allow setting constant HDF values for use in the template from the Apache config, like:
<Location /projects> SetHandler mod_python PythonHandler trac.ModPythonHandler PythonOption TracUriRoot /projects PythonOption TracEnvParentDir "/var/trac" PythonOption TracEnvIndexTemplate "/var/trac/index.cst" PythonOption TracTemplateVar "htdocs_common = /trac" </Location>
comment:3 by , 19 years ago
Summary: | Customizable project listing → centralized trac.ini |
---|
I've been thinking something like this would be useful for me as well.
I think I'm going to try a solution that will look for a trac.ini in TracEnvParentDir (to avoid the hardcoded path) and will provide a sort of templating ability for using the project path in the central ini (e.g. repository_dir = /var/svn/<project>, though with a different syntax)
comment:4 by , 19 years ago
I've built an implementation of a templated index, following the idea that Chris gave above. Here's a link to my writeup: http://blog.mugfu.com/2005/03/29/template-ized-trac-indices/ The latest patch is in the comments there, and I'll attach a copy here as well.
comment:5 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:6 by , 19 years ago
I've checked code based on Jasons patch in [1498]. As that doesn't resolve the central trac.ini issue raised here, this ticket remains open.
by , 19 years ago
Attachment: | trac-global-config.diff added |
---|
Patch implementing global configuration "underlay" at <prefix>/share/trac/conf/trac.ini
.
by , 19 years ago
Attachment: | trac-global-config-2.diff added |
---|
Patch implementing global configuration "underlay" at <prefix>/share/trac/conf/trac.ini
(new patch includes updates to unit test)
Patch that adds a CENTRAL_CONFIG var.