Contents

Trac is configured through the trac.ini file, located in the <projectenv>/conf directory. The trac.ini configuration file and its parent directory should be writable by the web server.

Trac monitors the timestamp of the file to trigger a complete environment reload and flush its caches when the timestamp changes. Most changes to the configuration will be reflected immediately, though changes to the [components] or [logging] sections will require restarting the web server. You may also need to restart the web server after creating a global configuration file when none was previously present.

Global Configuration

Configuration can be shared among environments using one or more global configuration files. Options in the global configuration will be merged with the environment-specific options, with local options overriding global options. The global configuration file is specified as follows:

[inherit]
file = /path/to/global/trac.ini

Multiple files can be specified using a comma-separated list.

Note that you can also specify a global option file when creating a new project, by adding the option --inherit=/path/to/global/trac.ini to trac-admin's initenv command. If you do not do this but nevertheless intend to use a global option file with your new environment, you will have to go through the newly generated conf/trac.ini file and delete the entries that will otherwise override those set in the global file.

There are two more entries in the [inherit] section, templates_dir for sharing global templates and plugins_dir, for sharing plugins. Those entries can themselves be specified in the shared configuration file, and in fact, configuration files can even be chained if you specify another [inherit] file there.

Note that the templates found in the templates/ directory of the TracEnvironment have precedence over those found in [inherit] templates_dir. In turn, the latter have precedence over the installed templates, so be careful about what you put there. Notably, if you override a default template, refresh your modifications when you upgrade to a new version of Trac. The preferred way to perform TracInterfaceCustomization is still to write a custom plugin doing an appropriate ITemplateStreamFilter transformation.

Reference for settings

This is a brief reference of available configuration options, and their default settings.

Leave this option empty if you want to disable all downloads, otherwise
set it to a comma-separated list of authorized paths (those paths are
glob patterns, i.e. "*" can be used as a wild card). In a
multi-repository environment, the path must be qualified with the
repository name if the path does not point to the default repository
(e.g. /reponame/trunk). Note that a simple prefix matching is
performed on the paths, so aliases won't get automatically resolved.

(r,g,b) color triple to use for the color corresponding
to the intermediate color, if two linear interpolations are used
for the color scale (see intermediate_point).
If not set, the intermediate color between oldest_color and
newest_color will be used.

If this option is disabled, changeset messages will be rendered as
pre-formatted text.

enabled

[components]

This section is used to enable or disable components
provided by plugins, as well as by Trac itself. The component
to enable/disable is specified via the name of the
option. Whether its enabled is determined by the option value;
setting the value to enabled or on will enable the
component, any other value (typically disabled or off)
will disable the component.

The option name is either the fully qualified name of the
components or the module/package prefix of the component. The
former enables/disables a specific component, while the latter
enables/disables any component in the specified
package/module.

The first option tells Trac to disable the
report module.
The second option instructs Trac to enable all components in
the acct_mgr package. Note that the trailing wildcard is
required for module/package matching.

To view the list of active components, go to the Plugins
page on About Trac (requires CONFIG_VIEWpermissions).

URL of the image to use as header logo.
It can be absolute, server relative or relative.

If relative, it is relative to one of the /chrome locations:
site/your-logo.png if your-logo.png is located in the htdocs
folder within your TracEnvironment;
common/your-logo.png if your-logo.png is located in the
folder mapped to the htdocs_location URL.
Only specifying your-logo.png is equivalent to the latter.

Templates in that directory are loaded in addition to those in the
environments templates directory, but the latter take precedence.

(no default)

[intertrac]

This section configures InterTrac prefixes. Options in this section
whose name contain a . define aspects of the InterTrac prefix
corresponding to the option name up to the .. Options whose name
don't contain a . define an alias.

The .url is mandatory and is used for locating the other Trac.
This can be a relative URL in case that Trac environment is located
on the same server.

The .title information is used for providing a useful tooltip when
moving the cursor over an InterTrac link.

[interwiki]

Every option in the [interwiki] section defines one InterWiki
prefix. The option name defines the prefix. The option value defines
the URL, optionally followed by a description separated from the URL
by whitespace. Parametric URLs are supported as well.

[metanav]

Configures the meta navigation
entries, which by default are Login, Logout, Preferences,
Help/Guide and About Trac. The allowed attributes are the
same as for [mainnav]. Additionally, a special entry is supported -
logout.redirect is the page the user sees after hitting the logout
button. For example:

Name of the component implementing ITicketGroupStatsProvider,
which is used to collect statistics on groups of tickets for display
in the milestone views.

DefaultTicketGroupStatsProvider

[milestone-groups]

As the workflow for tickets is now configurable, there can
be many ticket states, and simply displaying closed tickets
vs. all the others is maybe not appropriate in all cases. This
section enables one to easily create groups of states that
will be shown in different colors in the milestone progress
bar.

Note that the groups can only be based on the ticket
status, nothing else. In particular, it's not possible to
distinguish between different closed tickets based on the
resolution.

Example configuration with three groups, closed, new
and active (the default only has closed and active):

# the 'closed' group correspond to the 'closed' tickets
closed = closed
# .order: sequence number in the progress bar
closed.order = 0
# .query_args: optional parameters for the corresponding
# query. In this example, the changes from the
# default are two additional columns ('created' and
# 'modified'), and sorting is done on 'created'.
closed.query_args = group=resolution,order=time,col=id,col=summary,col=owner,col=type,col=priority,col=component,col=severity,col=time,col=changetime
# .overall_completion: indicates groups that count for overall
# completion percentage
closed.overall_completion = true
new = new
new.order = 1
new.css_class = new
new.label = new
# Note: one catch-all group for other statuses is allowed
active = *
active.order = 2
# .css_class: CSS class for this interval
active.css_class = open
# .label: displayed label for this group
active.label = in progress

The definition consists in a comma-separated list of accepted
status. Also, '*' means any status and could be used to
associate all remaining states to one catch-all group.

The CSS class can be one of: new (yellow), open (no color) or
closed (green). Other styles can easily be added using custom
CSS rule: table.progress td.<class> { background: <color> }
to a site/style.css file
for example.

List of additional MIME types associated to filename patterns.
Mappings are comma-separated, and each mapping consists of a MIME type
and a Python regexp used for matching filenames, separated by a colon
(":"). (since 1.0)

This component is used by the notification system to send emails.
Trac currently provides SmtpEmailSender for connecting to an SMTP
server, and SendmailEmailSender for running a sendmail-compatible
executable. (since 0.12)

Supported values are: none, the default value which uses 7-bit
encoding if the text is plain ASCII or 8-bit otherwise. base64,
which works with any kind of content but may cause some issues with
touchy anti-spam/anti-virus engine. qp or quoted-printable,
which works best for european languages (more compact than base64) if
8-bit encoding cannot be used.

Default host/domain to append to addresses that do not specify
one. Fully qualified addresses are not modified. The default
domain is appended to all username/login for which an email
address cannot be found in the user settings.

Use the author of the change as the sender in notification emails
(e.g. reporter of a new ticket, author of a comment). If the
author hasn't set an email address, smtp_from and
smtp_from_name are used instead.
(since 1.0)

[search]

Specifies which search filters should be disabled by
default on the search page. This will also restrict the
filters for the quick search function. The filter names
defined by default components are: wiki, ticket,
milestone and changeset. For plugins, look for
their implementation of the ISearchSource interface, in
the get_search_filters() method, the first member of
returned tuple. Once disabled, search filters can still
be manually enabled by the user on the search page.
(since 0.12)

[sqlite]

[svn]

The path to the Subversion
​authorization (authz) file.
To enable authz permission checking, the AuthzSourcePolicy permission
policy must be added to [trac] permission_policies. Non-absolute
paths are relative to the Environment conf directory.

Comma separated list of paths categorized as branches.
If a path ends with '*', then all the directory entries found below
that path will be included.
Example: /trunk, /branches/*, /projectAlpha/trunk, /sandbox/*

If a path ends with '*', then all the directory entries found below
that path will be included.
Example: /tags/*, /projectAlpha/tags/A-1.0, /projectAlpha/tags/A-v1.1

tags/*

[svn:externals]

The TracBrowser for Subversion can interpret the svn:externals
property of folders. By default, it only turns the URLs into links as
Trac can't browse remote repositories.

However, if you have another Trac instance (or an other repository
browser like ​ViewVC) configured to browse the
target repository, then you can instruct Trac which other repository
browser to use for which external URL. This mapping is done in the
[svn:externals] section of the TracIni.

With the above, the
svn://anotherserver.com/tools_repository/tags/1.1/tools external will
be mapped to http://ourserver/tracs/tools/browser/tags/1.1/tools?rev=
(and rev will be set to the appropriate revision number if the
external additionally specifies a revision, see the
​SVN Book on externals for more details).

Note that the number used as a key in the above section is purely used
as a place holder, as the URLs themselves can't be used as a key due to
various limitations in the configuration file parser.

Finally, the relative URLs introduced in
​Subversion 1.5
are not yet supported.

Whether Wiki formatter should respect the new lines present
in the Wiki text.
If set to 'default', this is equivalent to 'yes' for new environments
but keeps the old behavior for upgraded environments (i.e. 'no').

[ticket-custom]

[ticket-workflow]

The workflow for tickets is controlled by plugins. By default,
there's only a ConfigurableTicketWorkflow component in charge.
That component allows the workflow to be configured via this section
in the trac.ini file. See TracWorkflow for more details.

This value determines how long the browser will cache
authentication information, and therefore, after how much
inactivity a user will have to log in again. The value
of 0 makes the cookie expire at the end of the browsing
session. (since 0.12)

Inactivity timeout in seconds after which the automatic wiki preview
triggers an update. This option can contain floating-point values. The
lower the setting, the more requests will be made to the server. Set
this to 0 to disable automatic preview. (since 0.12)

This is the base URL that will be used when producing
documents that will be used outside of the web browsing
context, like for example when inserting URLs pointing to Trac
resources in notification e-mails.

The maximum number of templates that the template loader will cache
in memory. You may want to choose a higher value if your site uses a
larger number of templates, and you have enough memory to spare, or
you can reduce it if you are short on memory.

It can be left empty, and Trac will simply serve those resources
itself.

Advanced users can use this together with
trac-admin ... deploy <deploydir> to allow serving the
static resources for Trac directly from the web server.
Note however that this only applies to the <deploydir>/htdocs/common
directory, the other deployed resources (i.e. those from plugins)
will not be made available this way and additional rewrite
rules will be needed in the web server.

In some configurations, usually involving running Trac behind
a HTTP proxy, Trac can't automatically reconstruct the URL
that is used to access it. You may need to use this option to
force Trac to use the base_url setting also for
redirects. This introduces the obvious limitation that this
environment will only be usable when accessible from that URL,
as redirects are frequently used.

When true, send a X-Sendfile header and no content when sending
files from the filesystem, so that the web server handles the content.
This requires a web server that knows how to handle such a header,
like Apache with mod_xsendfile or lighttpd. (since 1.0)

[versioncontrol]

Comma-separated list of allowed prefixes for repository
directories when adding and editing repositories in the repository
admin panel. If the list is empty, all repository directories are
allowed. (since 0.12.1)

List of URIs considered "safe cross-origin", that will be
rendered as img element without crossorigin="anonymous" attribute
or used in url() of inline style attribute even if
[wiki] render_unsafe_content is false (since 1.0.15).