|Version 8 (modified by k0s, 8 years ago) (diff)|
NOTE: not all of the functionality presented herein has been implemented. This documentation primarily serves as a spec for how TracLegos should work.
TracLegos is designed to support several ways of creating trac projects: from the command line (create-trac-project), via a paster web interface, and via API calls to TracLegos.create_project and support functions such as traclegosscript/anyrelease/traclegos/legos#L253.
In all three cases, you can have a site configuration file. The site configuration file contains template variables appropriate to the particular site as well driven configuration defining the project directory, database type, a default set of templates, and other configuration needed to define trac project creation. A site configuration .ini file may be used to enable a trac project creation policy, whether by convention (using create-trac-project from the command line) or by enforcement (using the web front end). The site configuration is tailored to the needs of a particular site or organization and so is not useful to share. Contrast this to trac project templates which are generally meant to be generic and therefore sharable.
Site Configuration Example
An example site configuration is at source:traclegosscript/anyrelease/example/topp/site.ini :
# example site configuration file for TracLegos [site-configuration] directory = /usr/local/topp/trac/projects inherit = /usr/local/topp/trac/trac.ini db_types = MySQL project_types = oss_project [variables] domain = trac.openplans.org basedir = /usr/local/topp/trac [permissions] k0s = TRAC_ADMIN nickyg = TRAC_ADMIN
There are two sections:
- [site-configuration] contains defaults for arguments to TracLegos.create_project and the TracLegos constructor. These have the same name as specified on the command line and also the method arguments. This section also contains the database types and project types TO BE IMPLEMENTED?
- [variables] contains default values for variables. For instance, if your company has a standard footer, and you are using which is set by $footer in templates, you could set footer = Visit <a href="http://example.com">Our Company</a>" to have a sane default.
Use of TracLegos Site Configuration
This diagram illustrates the use of TracLegos site configuration via three major methods of invocation:
- via create-trac-project -c
- via the web interface invoked by paster serve
- via API calls to TracLegos.create_project
Running create-trac-projct -c site-configuration.ini will read the variables and defaults from the site-configuration.ini file. Additional parameters and variables passed via the command line will override those in site-configuration.ini.