Edgewall Software

Ticket #5525 (reopened enhancement)

Opened 15 months ago

Last modified 7 weeks ago

Allow trac.ini to include other files

Reported by: anonymous Owned by: jonas
Priority: normal Milestone: 0.11
Component: general Version:
Severity: normal Keywords:
Cc:

Description

Support an include directive in the configuration file syntax.

include "trac-ldap.ini"

will recursively load the directives in trac-ldap.ini .

Rationale: this will make it possible to split the configuration into multiple files.

TracAdmin will be able to write to a tracadmin.ini, included by trac.ini (included eg at the bottom to give it higher priority).

This is necessary to manage trac configuration programmatically.

My use case is to install trac plugins with a plugin.ini snippet using puppet (this requires no manual intervention). Currently I am merging all these small .ini files into one big trac.ini, but this also means that any changes TracAdmin writes to the file are lost.

Attachments

Change History

  Changed 15 months ago by eblot

  • status changed from new to closed
  • resolution set to worksforme
  • milestone set to 0.11

This is already implemented in 0.11, you can use the inherit section, such as in:

[inherit]
file = /another/path/trac.ini

follow-up: ↓ 3   Changed 15 months ago by anonymous

This is great.

Is it also possible to change the path TracAdmin writes to?

in reply to: ↑ 2   Changed 15 months ago by eblot

Replying to anonymous:

Is it also possible to change the path TracAdmin writes to?

Which one: .../conf/trac.ini?
No, it is not.

  Changed 7 weeks ago by haizaar@…

Is globbing supported? I.e. can I do something like this:

[inherit]
file = /etc/trac/*.ini

follow-up: ↓ 6   Changed 7 weeks ago by haizaar@…

  • status changed from closed to reopened
  • resolution worksforme deleted

Problem: Can not include more then one file:

$>  cat /etc/trac/trac-graphviz.ini
[components]
graphviz.* = enabled
$>  cat /etc/trac/trac-toc-macro.ini
[components]
tractop.* = enabled
$> cat $PWD/conf/trac.ini
...
[inherit]
file = /etc/trac/trac-graphviz.ini
file = /etc/trac/trac-toc-macro.ini

Only the last mentioned file is included. Trac-0.11

in reply to: ↑ 5   Changed 7 weeks ago by eblot

Replying to haizaar@haizaar.com:

Problem: Can not include more then one file:

This is a limitation of the Ini file parser, and the .ini file format: you cannot use the same key more than once within the same section. I guess this limitation could be overcomed with a list of files, such as:

file = a.ini, b.ini

Add/Change #5525 (Allow trac.ini to include other files)

Author



Change Properties
<Author field>
Action
as reopened
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.