Edgewall Software

TracMultipleProjects/MultipleEnvironmentsSingleDatabase: trac_data.sql

File trac_data.sql, 149.9 KB (added by masonjm@…, 6 years ago)

SQL script for populating a new project database

Line 
1SET client_encoding = 'UTF8';
2SET check_function_bodies = false;
3SET client_min_messages = warning;
4
5
6INSERT INTO component (name, "owner", description) VALUES ('component1', 'somebody', NULL);
7INSERT INTO component (name, "owner", description) VALUES ('component2', 'somebody', NULL);
8
9
10INSERT INTO enum ("type", name, value) VALUES ('status', 'new', '1');
11INSERT INTO enum ("type", name, value) VALUES ('status', 'assigned', '2');
12INSERT INTO enum ("type", name, value) VALUES ('status', 'reopened', '3');
13INSERT INTO enum ("type", name, value) VALUES ('status', 'closed', '4');
14INSERT INTO enum ("type", name, value) VALUES ('resolution', 'fixed', '1');
15INSERT INTO enum ("type", name, value) VALUES ('resolution', 'invalid', '2');
16INSERT INTO enum ("type", name, value) VALUES ('resolution', 'wontfix', '3');
17INSERT INTO enum ("type", name, value) VALUES ('resolution', 'duplicate', '4');
18INSERT INTO enum ("type", name, value) VALUES ('resolution', 'worksforme', '5');
19INSERT INTO enum ("type", name, value) VALUES ('priority', 'blocker', '1');
20INSERT INTO enum ("type", name, value) VALUES ('priority', 'critical', '2');
21INSERT INTO enum ("type", name, value) VALUES ('priority', 'major', '3');
22INSERT INTO enum ("type", name, value) VALUES ('priority', 'minor', '4');
23INSERT INTO enum ("type", name, value) VALUES ('priority', 'trivial', '5');
24INSERT INTO enum ("type", name, value) VALUES ('ticket_type', 'defect', '1');
25INSERT INTO enum ("type", name, value) VALUES ('ticket_type', 'enhancement', '2');
26INSERT INTO enum ("type", name, value) VALUES ('ticket_type', 'task', '3');
27
28
29INSERT INTO milestone (name, due, completed, description) VALUES ('milestone1', 0, 0, NULL);
30INSERT INTO milestone (name, due, completed, description) VALUES ('milestone2', 0, 0, NULL);
31INSERT INTO milestone (name, due, completed, description) VALUES ('milestone3', 0, 0, NULL);
32INSERT INTO milestone (name, due, completed, description) VALUES ('milestone4', 0, 0, NULL);
33
34
35INSERT INTO permission (username, "action") VALUES ('anonymous', 'LOG_VIEW');
36INSERT INTO permission (username, "action") VALUES ('anonymous', 'FILE_VIEW');
37INSERT INTO permission (username, "action") VALUES ('anonymous', 'WIKI_VIEW');
38INSERT INTO permission (username, "action") VALUES ('anonymous', 'WIKI_CREATE');
39INSERT INTO permission (username, "action") VALUES ('anonymous', 'WIKI_MODIFY');
40INSERT INTO permission (username, "action") VALUES ('anonymous', 'SEARCH_VIEW');
41INSERT INTO permission (username, "action") VALUES ('anonymous', 'REPORT_VIEW');
42INSERT INTO permission (username, "action") VALUES ('anonymous', 'REPORT_SQL_VIEW');
43INSERT INTO permission (username, "action") VALUES ('anonymous', 'TICKET_VIEW');
44INSERT INTO permission (username, "action") VALUES ('anonymous', 'TICKET_CREATE');
45INSERT INTO permission (username, "action") VALUES ('anonymous', 'TICKET_MODIFY');
46INSERT INTO permission (username, "action") VALUES ('anonymous', 'BROWSER_VIEW');
47INSERT INTO permission (username, "action") VALUES ('anonymous', 'TIMELINE_VIEW');
48INSERT INTO permission (username, "action") VALUES ('anonymous', 'CHANGESET_VIEW');
49INSERT INTO permission (username, "action") VALUES ('anonymous', 'ROADMAP_VIEW');
50INSERT INTO permission (username, "action") VALUES ('anonymous', 'MILESTONE_VIEW');
51
52
53INSERT INTO report (id, author, title, sql, description) VALUES (1, NULL, 'Active Tickets', '
54SELECT p.value AS __color__,
55   id AS ticket, summary, component, version, milestone, t.type AS type,
56   (CASE status WHEN ''assigned'' THEN owner||'' *'' ELSE owner END) AS owner,
57   time AS created,
58   changetime AS _changetime, description AS _description,
59   reporter AS _reporter
60  FROM ticket t, enum p
61  WHERE status IN (''new'', ''assigned'', ''reopened'')
62AND p.name = t.priority AND p.type = ''priority''
63  ORDER BY p.value, milestone, t.type, time
64', '
65 * List all active tickets by priority.
66 * Color each row based on priority.
67 * If a ticket has been accepted, a ''*'' is appended after the owner''s name
68');
69INSERT INTO report (id, author, title, sql, description) VALUES (2, NULL, 'Active Tickets by Version', '
70SELECT p.value AS __color__,
71   version AS __group__,
72   id AS ticket, summary, component, version, t.type AS type,
73   (CASE status WHEN ''assigned'' THEN owner||'' *'' ELSE owner END) AS owner,
74   time AS created,
75   changetime AS _changetime, description AS _description,
76   reporter AS _reporter
77  FROM ticket t, enum p
78  WHERE status IN (''new'', ''assigned'', ''reopened'')
79AND p.name = t.priority AND p.type = ''priority''
80  ORDER BY (version IS NULL),version, p.value, t.type, time
81', '
82This report shows how to color results by priority,
83while grouping results by version.
84
85Last modification time, description and reporter are included as hidden fields
86for useful RSS export.
87');
88INSERT INTO report (id, author, title, sql, description) VALUES (3, NULL, 'All Tickets by Milestone', '
89SELECT p.value AS __color__,
90   milestone||'' Release'' AS __group__,
91   id AS ticket, summary, component, version, t.type AS type,
92   (CASE status WHEN ''assigned'' THEN owner||'' *'' ELSE owner END) AS owner,
93   time AS created,
94   changetime AS _changetime, description AS _description,
95   reporter AS _reporter
96  FROM ticket t, enum p
97  WHERE status IN (''new'', ''assigned'', ''reopened'')
98AND p.name = t.priority AND p.type = ''priority''
99  ORDER BY (milestone IS NULL),milestone, p.value, t.type, time
100', '
101This report shows how to color results by priority,
102while grouping results by milestone.
103
104Last modification time, description and reporter are included as hidden fields
105for useful RSS export.
106');
107INSERT INTO report (id, author, title, sql, description) VALUES (4, NULL, 'Assigned, Active Tickets by Owner', '
108
109SELECT p.value AS __color__,
110   owner AS __group__,
111   id AS ticket, summary, component, milestone, t.type AS type, time AS created,
112   changetime AS _changetime, description AS _description,
113   reporter AS _reporter
114  FROM ticket t,enum p
115  WHERE status = ''assigned''
116AND p.name=t.priority AND p.type=''priority''
117  ORDER BY owner, p.value, t.type, time
118', '
119List assigned tickets, group by ticket owner, sorted by priority.
120');
121INSERT INTO report (id, author, title, sql, description) VALUES (5, NULL, 'Assigned, Active Tickets by Owner (Full Description)', '
122SELECT p.value AS __color__,
123   owner AS __group__,
124   id AS ticket, summary, component, milestone, t.type AS type, time AS created,
125   description AS _description_,
126   changetime AS _changetime, reporter AS _reporter
127  FROM ticket t, enum p
128  WHERE status = ''assigned''
129AND p.name = t.priority AND p.type = ''priority''
130  ORDER BY owner, p.value, t.type, time
131', '
132List tickets assigned, group by ticket owner.
133This report demonstrates the use of full-row display.
134');
135INSERT INTO report (id, author, title, sql, description) VALUES (6, NULL, 'All Tickets By Milestone  (Including closed)', '
136SELECT p.value AS __color__,
137   t.milestone AS __group__,
138   (CASE status
139      WHEN ''closed'' THEN ''color: #777; background: #ddd; border-color: #ccc;''
140      ELSE
141        (CASE owner WHEN ''$USER'' THEN ''font-weight: bold'' END)
142    END) AS __style__,
143   id AS ticket, summary, component, status,
144   resolution,version, t.type AS type, priority, owner,
145   changetime AS modified,
146   time AS _time,reporter AS _reporter
147  FROM ticket t,enum p
148  WHERE p.name=t.priority AND p.type=''priority''
149  ORDER BY (milestone IS NULL), milestone DESC, (status = ''closed''),
150        (CASE status WHEN ''closed'' THEN modified ELSE (-1)*p.value END) DESC
151', '
152A more complex example to show how to make advanced reports.
153');
154INSERT INTO report (id, author, title, sql, description) VALUES (7, NULL, 'My Tickets', '
155SELECT p.value AS __color__,
156   (CASE status WHEN ''assigned'' THEN ''Assigned'' ELSE ''Owned'' END) AS __group__,
157   id AS ticket, summary, component, version, milestone,
158   t.type AS type, priority, time AS created,
159   changetime AS _changetime, description AS _description,
160   reporter AS _reporter
161  FROM ticket t, enum p
162  WHERE t.status IN (''new'', ''assigned'', ''reopened'')
163AND p.name = t.priority AND p.type = ''priority'' AND owner = ''$USER''
164  ORDER BY (status = ''assigned'') DESC, p.value, milestone, t.type, time
165', '
166This report demonstrates the use of the automatically set
167$USER dynamic variable, replaced with the username of the
168logged in user when executed.
169');
170INSERT INTO report (id, author, title, sql, description) VALUES (8, NULL, 'Active Tickets, Mine first', '
171SELECT p.value AS __color__,
172   (CASE owner
173     WHEN ''$USER'' THEN ''My Tickets''
174     ELSE ''Active Tickets''
175    END) AS __group__,
176   id AS ticket, summary, component, version, milestone, t.type AS type,
177   (CASE status WHEN ''assigned'' THEN owner||'' *'' ELSE owner END) AS owner,
178   time AS created,
179   changetime AS _changetime, description AS _description,
180   reporter AS _reporter
181  FROM ticket t, enum p
182  WHERE status IN (''new'', ''assigned'', ''reopened'')
183AND p.name = t.priority AND p.type = ''priority''
184  ORDER BY (owner = ''$USER'') DESC, p.value, milestone, t.type, time
185', '
186 * List all active tickets by priority.
187 * Show all tickets owned by the logged in user in a group first.
188');
189
190
191INSERT INTO "system" (name, value) VALUES ('database_version', '16');
192
193
194INSERT INTO version (name, "time", description) VALUES ('1.0', 0, NULL);
195INSERT INTO version (name, "time", description) VALUES ('2.0', 0, NULL);
196
197
198INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('CamelCase', 1, 1132114161, 'trac', '127.0.0.1', '= !CamelCase =
199New words created by smashing together capitalized words.
200
201CamelCase is the original wiki convention for creating hyperlinks, with the additional requirement that the capitals are followed by a lower-case letter; hence “AlabamA” and “ABc” will not be links.
202
203== More information on !CamelCase ==
204
205 * http://c2.com/cgi/wiki?WikiCase
206 * http://en.wikipedia.org/wiki/CamelCase
207
208----
209See also: WikiPageNames, WikiNewPage, WikiFormatting, TracWiki', NULL, NULL);
210INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('RecentChanges', 1, 1132114161, 'trac', '127.0.0.1', '= Recent Changes =
211
212[[RecentChanges]]
213', NULL, NULL);
214INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('SandBox', 1, 1132114161, 'trac', '127.0.0.1', '= The Sandbox =
215
216This is just a page to practice and learn WikiFormatting.
217
218Go ahead, edit it freely.', NULL, NULL);
219INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TitleIndex', 1, 1132114161, 'trac', '127.0.0.1', '= Title Index =
220
221[[TitleIndex]]
222', NULL, NULL);
223INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracAccessibility', 1, 1132114161, 'trac', '127.0.0.1', '= Accessibility Support in Trac =
224
225Not every user has a graphic environment with a mouse or other pointing device. Some users rely on keyboard, alternative keyboard or voice input to navigate links, activate form controls, etc. In Trac, we work to assure users may interact with devices other than a pointing device.
226
227Trac supports accessibility keys for the most common operations. On Windows and Linux platforms, press any of the keys listed below in combination with the `<Alt>` key; on a Mac, use the `<ctrl>` key instead.
228
229''''Note that when using Internet Explorer on Windows, you need to hit enter after having used the access key.''''
230
231== Global Access Keys ==
232
233 * `1` - WikiStart
234 * `2` - [wiki:TracTimeline Timeline]
235 * `3` - [wiki:TracRoadmap Roadmap]
236 * `4` - [wiki:TracSearch Search]
237 * `6` - [wiki:TracGuide Trac Guide / Documentation]
238 * `7` - [wiki:TracTickets New Ticket]
239 * `9` - [../about About Trac]
240 * `0` - This page
241
242----
243See also: TracGuide', NULL, NULL);
244INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracAdmin', 1, 1132114161, 'trac', '127.0.0.1', '= TracAdmin =
245[[TracGuideToc]]
246
247Trac is distributed with a powerful command-line configuration tool. This tool can be used  to configure and customize your Trac-installation to better fit your needs.
248
249== Usage ==
250
251You can get a comprehensive list of the available options, commands and sub-commands by invoking `trac-admin` with the `help` command:
252{{{
253trac-admin help
254}}}
255
256Unless you''re executing the `help`, `about` or `version` sub-commands, you''ll need to specify the path to the TracEnvironment that you want to administer as the first argument, for example:
257{{{
258trac-admin /path/to/projenv wiki list
259}}}
260
261== Interactive Mode ==
262
263When passing the environment path as the only argument, `trac-admin` starts in interactive mode.
264Commands can then be executed on the selected environment using the prompt, which offers tab-completion
265(on non-Windows environments, and when the Python `readline` module is available) and automatic repetition of the last command issued.
266
267Once you''re in interactive mode, you can also get help on specific commands or subsets of commands:
268
269For example, to get an explanation of the `resync` command, run:
270{{{
271> help resync
272}}}
273
274To get help on a all the Wiki-related commands, run:
275{{{
276> help wiki
277}}}
278
279----
280See also: TracGuide, TracBackup, TracPermissions, TracEnvironment, TracIni
281', NULL, NULL);
282INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracBackup', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Backup =
283[[TracGuideToc]]
284
285Since Trac uses a database backend, some extra care is required to safely create a backup of a [wiki:TracEnvironment project environment]. Luckily, [wiki:TracAdmin trac-admin] has a command to make backups easier: `hotcopy`.
286
287  ''''Note: Trac uses the `hotcopy` nomenclature to match that of [http://subversion.tigris.org/ Subversion], to make it easier to remember when managing both Trac and Subversion servers.''''
288
289== Creating a Backup ==
290
291To create a backup of a live TracEnvironment, simply run:
292{{{
293  $ trac-admin /path/to/projenv hotcopy /path/to/backupdir
294}}}
295
296[wiki:TracAdmin trac-admin] will lock the database while copying.''''
297
298The resulting backup directory is safe to handle using standard file-based backup tools like `tar` or `dump`/`restore`.
299
300=== Restoring a Backup ===
301
302Backups are simply a copied snapshot of the entire [wiki:TracEnvironment project environment] directory, including the SQLite database.
303
304To restore an environment from a backup, simply stop the process running Trac (i.e. the Web server or [wiki:TracStandalone tracd]), restore the directory structure from the backup and restart the service.
305
306  ''''Note: Automatic backup of environments that don''t use SQLite as database backend is not supported at this time. As a workaround, we recommend that you stop the server, copy the environment directory, and make a backup of the database using whatever mechanism is provided by the database system.''''
307
308----
309See also: TracAdmin, TracEnvironment, TracGuide
310', NULL, NULL);
311INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracBrowser', 1, 1132114161, 'trac', '127.0.0.1', '= The Trac Browser =
312[[TracGuideToc]]
313
314The Trac browser can be used to browse directories, change logs
315and specific revisions of files stored in a subversion repository.
316
317Directory entries are displayed in a list with sortable columns. The list
318entries can be sorted by ''''name'''', ''''size'''' or ''''age'''' by clicking on the column
319headers. The sort order can be reversed by clicking on a given column
320header again.
321
322The browser can be used to navigate through the directory structure
323by clicking on the directory names. Clicking on a file name will show
324the contents of the file. Clicking on the revision number of a file or
325directory will take you to the revision history for that file.
326
327It''s also possible to browse directories or files as they were in history,
328at any given repository revision. The default behavior is to display the
329latest revision but another revision number can easily be selected using
330the ''''View revision'''' input field at the top of the page.
331
332== RSS Support ==
333
334The browser module provided RSS feeds to monitor changes to a file or
335directory. To subscribe to an RSS feed for a file or directory, open its
336revision log in the browser and click the orange ''XML'' icon at the bottom
337of the page. For more information on RSS support in Trac, see TracRss.
338
339----
340See also: TracGuide, TracChangeset, FineGrainedPermissions
341', NULL, NULL);
342INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracCgi', 1, 1132114161, 'trac', '127.0.0.1', '= Installing Trac as CGI =
343
344To install Trac as a CGI script, you need to make the `trac.cgi` executable as a CGI by your web server. If you''re using [http://httpd.apache.org/ Apache HTTPD], there are a couple ways to do that:
345
346 1. Use a `ScriptAlias` to map a URL to the `trac.cgi` script
347 2. Copy the `trac.cgi` file into the directory for CGI executables used by your web server (commonly named `cgi-bin`). You can also create a symbolic link, but in that case make sure that the `FollowSymLinks` option is enabled for the `cgi-bin` directory.
348
349The first option is recommended as it also allows you to map the CGI to a friendly URL.
350
351Now, edit the Apache configuration file and add this snippet, file names and locations changed to match your installation:
352{{{
353ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi
354
355# Trac needs to know where the database is located
356<Location "/trac">
357  SetEnv TRAC_ENV "/path/to/projectenv"
358</Location>
359}}}
360
361This will make Trac available at `http://yourhost.example.org/trac`.
362
363 ''''Note: Make sure that the modules mod_alias and mod_env modules are available and enabled in your Apache configuration, otherwise Apache will complain about the above snippet.''''
364
365 ''''Note: If you are using the [http://httpd.apache.org/docs/suexec.html Apache suEXEC] feature see [http://projects.edgewall.com/trac/wiki/ApacheSuexec ApacheSuexec] (on the main Trac site).''''
366
367== Mapping Static Resources ==
368
369Out of the box, Trac will serve static resources such as style sheets or images itself. For a CGI setup, though, this is highly undesirable, because it results in the CGI script being invoked for documents that could be more efficiently served by the web server.
370
371Web servers such as [http://httpd.apache.org/ Apache HTTPD] allow you to create “Aliases” to resources, thereby giving them a virtual URL that doesn''t necessarily bear any resemblance to the layout of the servers file system. We already used this capability above when defining a `ScriptAlias` for the CGI script, and we''ll use it now to map requests to the static resources to the directory on the file system that contains them, thereby bypassing the processing of such requests by the CGI script.
372
373Edit the Apache configuration file again and add the following snippet ''''''before'''''' the `ScriptAlias` for the CGI script , file names and locations changed to match your installation:
374{{{
375Alias /trac/chrome/common /usr/share/trac/htdocs
376<Directory "/usr/share/trac/htdocs">
377  Order allow,deny
378  Allow from all
379</Directory>
380}}}
381
382Note that whatever URL path you mapped the `trac.cgi` script to, the path `/chrome/common` is the path you have to append to that location to intercept requests to the static resources.
383
384For example, if Trac is mapped to `/cgi-bin/trac.cgi` on your server, the URL of the Alias should be `/cgi-bin/trac.cgi/chrome/common`.
385
386Alternatively, you can set the `htdocs_location` configuration option in [wiki:TracIni trac.ini]:
387{{{
388[trac]
389htdocs_location = /trac-htdocs
390}}}
391
392Trac will then use this URL when embedding static resources into HTML pages. Of course, you still need to make the Trac `htdocs` directory available through the web server at the specified URL, for example by copying (or linking) the directory into the document root of the web server.
393
394== Adding Authentication ==
395
396The simplest way to enable authentication with Apache is to create a password file. Use the `htpasswd` program to create the password file:
397{{{
398$ htpasswd -c /somewhere/trac.htpasswd admin
399New password: <type password>
400Re-type new password: <type password again>
401Adding password for user admin
402}}}
403
404After the first user, you dont need the "-c" option anymore:
405{{{
406$ htpasswd /somewhere/trac.htpasswd john
407New password: <type password>
408Re-type new password: <type password again>
409Adding password for user john
410}}}
411
412  ''''See the man page for `htpasswd` for full documentation.''''
413
414After you''ve created the users, you can set their permissions using TracPermissions.
415
416Now, you''ll need to enable authentication against the password file in the Apache configuration:
417{{{
418<Location "/cgi-bin/trac.cgi/login">
419  AuthType Basic
420  AuthName "Trac"
421  AuthUserFile /somewhere/trac.htpasswd
422  Require valid-user
423</Location>
424}}}
425
426For better security, it is recommended that you either enable SSL or at least use the “Digest” authentication scheme instead of “Basic”. Please read the [http://httpd.apache.org/docs/2.0/ Apache HTTPD documentation] to find out more.
427
428----
429See also:  TracGuide, TracInstall, TracFastCgi, TracModPython', NULL, NULL);
430INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracChangeset', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Changeset Module =
431[[TracGuideToc]]
432
433Trac has a built-in functionality for visualizing “diffs” - changes to files.
434
435When viewing a repository check-in, such as when following a
436changeset [wiki:TracLinks link] or a changeset event in the
437[wiki:TracTimeline timeline], Trac will display the exact changes
438made by the check-in.
439
440The changeset view consists of two parts, the ''''header'''' and the ''''diff views''''.
441
442== Changeset Header ==
443
444The header shows an overview of the whole changeset.
445Here you will find information such as:
446
447 * Timestamp -- When the changeset was commited
448 * Author -- Who commited the changeset
449 * Message -- A brief description from the author (the commit log message)
450 * Files -- A list of files affected by this changeset
451
452In front of each listed file, you''ll find  a colored rectangle. The color
453indicates how the file is affected by the changeset.
454 
455 * Green: Added
456 * Red: Removed
457 * Yellow: Modified
458 * Blue: Copied
459 * Gray: Moved
460
461The color legend is located below the header as a reminder.
462
463== Diff Views ==
464
465Below the header is the main part of the changeset, the diff view. Each file is shown in a separate section, each of which will contain only the regions of the file that are affected by the changeset. There are two different styles of displaying the diffs: ''''inline'''' or ''''side-by-side'''' (you can switch between those styles using the preferences form):
466
467 * The ''''inline'''' style shows the changed regions of a file underneath each other. A region removed from the file will be colored red, an added region will be colored green. If a region was modified, the old version is displayed above the new version. Line numbers on the left side indicate the exact position of the change in both the old and the new version of the file.
468 * The ''''side-by-side'''' style shows the old version on the left and the new version on the right (this will typically require more screen width than the inline style.) Added and removed regions will be colored in the same way as with the inline style (green and red, respectively), but modified regions will have a yellow background.
469
470In addition, various advanced options are available in the preferences form for adjusting the display of the diffs:
471 * You can set how many lines are displayed before and after every change
472 * You can toggle whether blank lines, case changes and white space changes are ignored, thereby letting you find the functional changes more quickly
473
474----
475See also: TracGuide, TracBrowser
476', NULL, NULL);
477INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracEnvironment', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Storage - The Environment =
478
479Trac uses a directory structure and a database for storing project data.
480
481== Creating an Environment ==
482
483A new Trac environment is created using [wiki:TracAdmin trac-admin]:
484{{{
485$ trac-admin /path/to/projectenv initenv
486}}}
487
488[wiki:TracAdmin trac-admin] will ask you for the name of the project, the
489database connection string (explained below), and where your subversion
490repository is located.
491
492  ''''Note: The web server user will require file system write permission to
493the environment directory and all the files inside. Please remember to set
494the appropriate permissions. The same applies to the Subversion
495repository, although Trac will only require read access as long as you''re
496not using the BDB file system.''''
497
498== Database Connection Strings ==
499
500Since version 0.9, Trac supports both [http://sqlite.org/ SQLite] and
501[http://www.postgresql.org/ PostgreSQL] as database backends.  The default
502is to use SQLite, which is probably sufficient for most projects. The database file
503is then stored in the environment directory, and can easily be
504[wiki:TracBackup backed up] together with the rest of the environment.
505
506The connection string for an embedded SQLite database is:
507{{{
508sqlite:db/trac.db
509}}}
510
511If you want to use PostgreSQL instead, you''ll have to use a different
512connection string. For example, to connect to a database on the same
513machine called `trac`, that allows access to the user `johndoe` with
514the password `letmein`, use:
515{{{
516postgres://johndoe:letmein@localhost/trac
517}}}
518
519If PostgreSQL is running on a non-standard port (for example 9342), use:
520{{{
521postgres://johndoe:letmein@localhost:9342/trac
522}}}
523
524Note that with PostgreSQL you will have to create the database before running
525`trac-admin initenv`.
526
527== Directory Structure ==
528
529An environment directory will usually consist of the following files and directories:
530
531 * `README` - Brief description of the environment.
532 * `VERSION` - Contains the environment version identifier.
533 * `attachments` - Attachments to wiki pages and tickets are stored here.
534 * `conf`
535   * `trac.ini` - Main configuration file. See TracIni.
536 * `db`
537   * `trac.db` - The SQLite database (if you''re using SQLite).
538 * `plugins` - Environment-specific [wiki:TracPlugins plugins] (Python eggs)
539 * `templates` - Custom environment-specific templates.
540   * `site_css.cs` - Custom CSS rules.
541   * `site_footer.cs` - Custom page footer.
542   * `site_header.cs` - Custom page header.
543 * `wiki-macros` - Environment-specific [wiki:WikiMacros Wiki macros].
544
545----
546See also: TracAdmin, TracBackup, TracIni, TracGuide
547', NULL, NULL);
548INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracFastCgi', 1, 1132114161, 'trac', '127.0.0.1', '= Trac with FastCGI =
549
550Since version 0.9, Trac supports being run through the [http://www.fastcgi.com/ FastCGI] interface. Like [wiki:TracModPython mod_python], this allows Trac to remain resident, and is faster than external CGI interfaces which must start a new process for each request. However, unlike mod_python, it is able to support [http://httpd.apache.org/docs/suexec.html SuEXEC]. Additionally, it is supported by much wider variety of web servers.
551
552== Simple Apache configuration ==
553{{{
554# Enable fastcgi for .fcgi files
555# (If you''re using a distro package for mod_fcgi, something like
556# this is probably already present)
557<IfModule mod_fastcgi.c>
558   AddHandler fastcgi-script .fcgi
559   FastCgiIpcDir /var/lib/apache2/fastcgi
560</IfModule>
561LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so
562}}}
563
564You can either setup the `TRAC_ENV` as an overall default:
565{{{
566FastCgiConfig -initial-env TRAC_ENV=/path/to/env/trac
567}}}
568
569Or you can serve multiple Trac projects in a directory like:
570{{{
571FastCgiConfig -initial-env TRAC_ENV_PARENT_DIR=/parent/dir/of/projects
572}}}
573
574Configure `ScriptAlias` or similar options as described in TracCgi, but calling `trac.fcgi` instead of `trac.cgi`.
575
576== Simple Lighttpd Configuration ==
577
578The FastCGI front-end was developed primarily for use with alternative webservers, such as [http://www.lighttpd.net/ lighttpd].
579
580lighttpd is a secure, fast, compliant and very flexible web-server that has been optimized for high-performance
581environments.  It has a very low memory footprint compared to other web servers and takes care of CPU load.
582
583For using `trac.fcgi` with lighttpd add the following to your lighttpd.conf:
584{{{
585fastcgi.server = ("/trac" =>
586                   ("trac" =>
587                     ("socket" => "/tmp/trac-fastcgi.sock",
588                      "bin-path" => "/path/to/cgi-bin/trac.fcgi",
589                      "check-local" => "disable",
590                      "bin-environment" =>
591                        ("TRAC_ENV" => "/path/to/projenv")
592                     )
593                   )
594                 )
595}}}
596
597Note that you will need to add a new entry to `fastcgi.server` for each separate Trac instance that you wish to run. Alternatively, you may use the `TRAC_ENV_PARENT_DIR` variable instead of `TRAC_ENV` as described  above.
598
599Other important information like [http://trac.lighttpd.net/trac/wiki/TracInstall this updated TracInstall page], [wiki:TracCgi#MappingStaticResources and this] are useful for non-fastcgi specific installation aspects.
600
601Relaunch lighttpd, and browse to `http://yourhost.example.org/trac` to access Trac.
602
603----
604See also TracCgi, TracModPython, TracInstall, TracGuide', NULL, NULL);
605INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracGuide', 1, 1132114161, 'trac', '127.0.0.1', '= The Trac User and Administration Guide =
606[[TracGuideToc]]
607
608The TracGuide is meant to serve as a starting point for all documentation regarding Trac usage and development. The guide is a free document, a collaborative effort, and a part of the [http://projects.edgewall.com/trac/ Trac Project] itself.
609
610== Table of Contents ==
611Currently available documentation:
612 * TracGuide (This page)  -- Documentation starting point.
613   * TracInstall -- How to install and run Trac.
614   * TracUpgrade -- How to upgrade existing installations.
615   * TracAdmin -- Administrating a Trac project.
616   * TracImport -- Importing tickets from other bug databases.
617   * TracIni -- Trac configuration file reference.
618   * TracPermissions -- Access control and permissions.
619   * TracInterfaceCustomization -- Customizing the Trac interface.
620   * TracPlugins -- Installing and managing Trac extensions.
621   * TracWiki -- How to use the built-in Wiki.
622   * TracBrowser -- Browsing source code with Trac.
623   * TracChangeset -- Viewing changes to source code.
624   * TracTickets -- Using the issue tracker.
625   * TracReports -- Writing and using reports.
626   * TracQuery -- Executing custom ticket queries.
627   * TracRoadmap -- The roadmap helps tracking project progress.
628   * TracTimeline -- The timeline provides a historic perspective on a project.
629   * TracLogging -- The Trac logging facility.
630   * TracRss -- RSS content syndication in Trac.
631   * TracNotification -- Email notification.
632
633 * [http://projects.edgewall.com/trac/wiki/TracFaq Trac FAQ] - A collection of Frequently Asked Questions (on the project website)
634
635== Support and Other Sources of Information ==
636If you are looking for a good place to ask a question about Trac, look no further than the [http://projects.edgewall.com/trac/wiki/MailingList MailingList]. It provides a friendly environment to discuss openly among Trac users and developers.
637
638See also the TracSupport page for more information resources.', NULL, NULL);
639INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracImport', 1, 1132114161, 'trac', '127.0.0.1', '= Importing ticket data =
640
641== Bugzilla ==
642
643Ticket data can be imported from Bugzilla using the [http://projects.edgewall.com/trac/browser/trunk/contrib/bugzilla2trac.py bugzilla2trac.py] script, available in the contrib/ directory of the Trac distribution.
644
645{{{
646$ bugzilla2trac.py
647bugzilla2trac - Imports a bug database from Bugzilla into Trac.
648
649Usage: bugzilla2trac.py [options]
650
651Available Options:
652  --db <MySQL dbname>              - Bugzilla''s database
653  --tracenv /path/to/trac/env      - full path to Trac db environment
654  -h | --host <MySQL hostname>     - Bugzilla''s DNS host name
655  -u | --user <MySQL username>     - effective Bugzilla''s database user
656  -p | --passwd <MySQL password>   - Bugzilla''s user password
657  -c | --clean                     - remove current Trac tickets before importing
658  --help | help                    - this help info
659
660Additional configuration options can be defined directly in the script.
661}}}
662
663Currently, the following data is imported from Bugzilla:
664
665  * bugs
666  * bug activity (field changes)
667  * bug attachments
668  * user names and passwords (put into a htpasswd file)
669
670The script provides a number of features to ease the conversion, such as:
671
672  * PRODUCT_KEYWORDS:  Trac doesn''t have the concept of products, so the script provides the ability to attach a ticket keyword instead.
673
674  * IGNORE_COMMENTS:  Don''t import Bugzilla comments that match a certain regexp.
675
676  * STATUS_KEYWORDS:  Attach ticket keywords for the Bugzilla statuses not available in Trac.  By default, the ''VERIFIED'' and ''RELEASED'' Bugzilla statuses are translated into Trac keywords.
677
678For more details on the available options, see the configuration section at the top of the script.
679
680== Sourceforge ==
681
682Ticket data can be imported from Sourceforge using the [http://projects.edgewall.com/trac/browser/trunk/contrib/sourceforge2trac.py sourceforge2trac.py] script, available in the contrib/ directory of the Trac distribution.
683
684== Mantis ==
685
686Mantis bugs can be imported using the attached script.
687
688Currently, the following data is imported from Mantis:
689  * bugs
690  * bug comments
691  * bug activity (field changes)
692
693Attachments are NOT imported.  If you use the script, please read the NOTES section (at the top of the file) and make sure you adjust the config parameters for your environment.
694
695mantis2trac.py has the same parameters as the bugzilla2trac.py script:
696{{{
697mantis2trac - Imports a bug database from Mantis into Trac.
698
699Usage: mantis2trac.py [options]
700
701Available Options:
702  --db <MySQL dbname>              - Mantis database
703  --tracenv /path/to/trac/env      - Full path to Trac db environment
704  -h | --host <MySQL hostname>     - Mantis DNS host name
705  -u | --user <MySQL username>     - Effective Mantis database user
706  -p | --passwd <MySQL password>   - Mantis database user password
707  -c | --clean                     - Remove current Trac tickets before importing
708  --help | help                    - This help info
709
710Additional configuration options can be defined directly in the script.
711}}}
712
713== Other ==
714
715Since trac uses a SQL database to store the data, you can import from other systems by examining the database tables. Just go into [http://www.sqlite.org/sqlite.html sqlite] command line to look at the tables and import into them from your application.
716', NULL, NULL);
717INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracIni', 1, 1132114161, 'trac', '127.0.0.1', '= The Trac Configuration File =
718[[TracGuideToc]]
719
720Trac configuration is done by editing the ''''''`trac.ini`'''''' config file, located in `<projectenv>/conf/trac.ini`.
721
722== Global Configuration ==
723
724Since version 0.9, Trac can also read the configuration from a global `trac.ini` file. These global options will then be merged with the environment-specific options, where local options override global options.
725
726The global configuration is by default localted in `$prefix/share/trac/conf/trac.ini`. It can be moved to a different location (for example, `/etc/trac.ini`), but that requires changing the file `trac/siteconfig.py` which gets created when Trac is installed.
727
728== Reference ==
729
730This is a brief reference of available configuration options.
731
732== [trac] ==
733|| `database`        || [wiki:TracEnvironment#DatabaseConnectionStrings Database connection string] for this project ||
734|| `default_charset` || Charset used in text files in the subversion repository (default is `iso-8859-15`) ||
735|| `default_handler` || Name of the component that handles requests to the base URL (default is `WikiHandler`) (''''since 0.9'''') ||
736|| `repository_dir`  || Path to local Subversion repository ||
737|| `authz_file`      || Path to Subversion [http://svnbook.red-bean.com/en/1.1/ch06s04.html#svn-ch-6-sect-4.4.2 authorization (authz) file]. ||
738|| `authz_module_name` || The module prefix used in the `authz_file` (See FineGrainedPermissions)||
739|| `check_auth_ip` || Whether the IP address of the user should be checked for authentication (true, false) (''''since 0.9'''') ||
740|| `ignore_auth_case` || Whether case should be ignored for login names (true, false) (''''since 0.9'''') ||
741|| `templates_dir`   || Path to the !ClearSilver templates ||
742
743== [project] ==
744|| `name`   || Project name ||
745|| `descr`  || Short project description ||
746|| `url`    || URL to the main project website ||
747|| `icon`   || URL to icon file to use as shortcut icon (favicon) ||
748|| `footer` || Page footer text (right-aligned) ||
749
750== [header_logo] ==
751|| `src`    || URL to image to use as header logo ||
752|| `link`   || Destination URL to link to from header logo ||
753|| `alt`    || ''''alt'''' text for header logo ||
754|| `width`  || Header logo width in pixels ||
755|| `height` || Header logo height in pixels ||
756See also: TracInterfaceCustomization.
757
758== [logging] ==
759|| `log_type`  || Logging facility to use. (none, file, stderr, syslog, winlog) ||
760|| `log_file`  || If ''''log_type'''' is ''''file'''', this should be a path to the log-file ||
761|| `log_level` || Level of verbosity in log (CRITICAL, ERROR, WARN, INFO, DEBUG) ||
762See also: TracLogging
763
764== [attachment] ==
765|| `max_size` || Maximum allowed file size for ticket and wiki attachments ||
766
767== [notification] ==
768|| `smtp_enabled`   || Enable SMTP (email) notification (true, false) ||
769|| `smtp_server`    || SMTP server to use for email notifications ||
770|| `smtp_user`      || Username for SMTP server (''''since 0.9'''') ||
771|| `smtp_password`  || Password for SMTP server (''''since 0.9'''') ||
772|| `smtp_from`      || Sender address to use in notification emails ||
773|| `smtp_replyto`   || Reply-To address to use in notification emails ||
774|| `smtp_always_cc` || Email address(es) to always send notifications to ||
775|| `always_notify_reporter` || Always send notifications to any address in the ''''reporter'''' field ||
776|| `always_notify_owner` || Always send notifications to the ticket owner (''''since 0.9'''') ||
777See also: TracNotification
778
779== [mimeviewer] ==
780|| `enscript_path` || Path to the Enscript program ||
781|| `php_path` || Path to the PHP program ||
782|| `max_preview_size` || Maximum file size for HTML preview (''''since 0.9'''') ||
783|| `tab_width` || Displayed tab width in file preview (''''since 0.9'''') ||
784
785== [ticket] ==
786|| `default_version`   || Default version for newly created tickets ||
787|| `default_severity`  || Default severity for newly created tickets ||
788|| `default_priority`  || Default priority for newly created tickets ||
789|| `default_milestone` || Default milestone for newly created tickets ||
790|| `default_component` || Default component for newly created tickets ||
791|| `restrict_owner`    || Make the owner field of tickets use a drop-down menu (''''since 0.9'''') ||
792
793== [ticket-custom] ==
794Creates [wiki:TracTicketsCustomFields user-defined ticket fields].
795
796== [timeline] ==
797|| `default_daysback` || Default "depth" of the Timeline, in days (''''since 0.9'''') ||
798|| `changeset_show_files` || Number of files to show (-1 for unlimited, 0 to disable) ||
799|| `ticket_show_details` || Enable the display of all ticket changes in the timeline ||
800
801== [browser] ==
802|| `hide_properties` || List of subversion properties to hide from the repository browser (''''since 0.9'''') ||
803
804== [wiki] ==
805|| `ignore_missing_pages` || enable/disable highlighting CamelCase links to missing pages (''''since 0.9'''') ||
806
807== [components] ==
808(''''since 0.9'''')
809
810This 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.
811
812The 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.
813
814Consider the following configuration snippet:
815{{{
816[components]
817trac.ticket.report.ReportModule = disabled
818webadmin.* = enabled
819}}}
820
821The first option tells Trac to disable the [wiki:TracReports report module]. The second option instructs Trac to enable all components in the `webadmin` package. Note that the trailing wildcard is required for module/package matching.
822
823See the ''''Plugins'''' page on ''''About Trac'''' to get the list of active components (requires `CONFIG_VIEW` [wiki:TracPermissions permissions].)
824
825See also: TracPlugins
826
827  ''''Note that prior to Trac r2335 (that applies to 0.9b1 and 0.9b2), you would use a `[disabled_components]` section instead. See a [http://projects.edgewall.com/trac/wiki/TracIni?version=42 previous version] of this page for the details.''''
828
829----
830See also: TracGuide, TracAdmin, TracEnvironment
831', NULL, NULL);
832INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracInstall', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Installation Guide =
833[[TracGuideToc]]
834
835Trac is a lightweight project management tool that is implemented as a web-based application. Trac is written in the Python programming language and can use [http://sqlite.org/ SQLite] or [http://www.postgresql.org/ PostgreSQL] as  database. For HTML rendering, Trac uses the [http://www.clearsilver.net/ Clearsilver] templating system.
836
837What follows are generic instructions for installing and setting up Trac and its requirements. While you can find instructions for installing Trac on specific systems at [http://projects.edgewall.com/trac/wiki/TracInstallPlatforms TracInstallPlatforms] on the main Trac site, please be sure to first read through these general instructions to get a good understanding of the tasks involved.
838
839== Requirements ==
840
841To install Trac, the following software packages must be installed:
842
843 * [http://www.python.org/ Python], version >= 2.3.
844   * Python 2.4 is not supported on Windows since there are no Subversion bindings available for it.
845   * For RPM-based systems you might also need the `python-devel` and `python-xml` packages.
846 * [http://subversion.tigris.org/ Subversion], version >= 1.0. (>= 1.1 recommended) and corresponding [http://svnbook.red-bean.com/svnbook-1.1/ch08s02.html#svn-ch-8-sect-2.3 Python bindings]
847   * Trac uses the [http://www.swig.org/ SWIG] bindings included in the Subversion distribution, ''''''not'''''' [http://pysvn.tigris.org/ PySVN] (which is sometimes confused with the standard SWIG bindings).
848   * If Subversion was already installed without the SWIG bindings, you''ll need to re-`configure` Subversion and `make swig-py`, `make install-swig-py`.
849 * [http://www.clearsilver.net/ ClearSilver], version >= 0.9.3
850   * With python-bindings (`./configure --with-python=/usr/bin/python`)
851
852=== For SQLite ===
853
854 * [http://www.sqlite.org/ SQLite], version 2.8.x or 3.x
855 * [http://pysqlite.org/ PySQLite]
856   * version 1.0.x (for SQLite 2.8.x)
857   * version 1.1.x or 2.x (for SQLite 3.x)
858
859=== For PostgreSQL ===
860
861 * [http://www.postgresql.org/ PostgreSQL]
862 * [http://initd.org/projects/psycopg1 psycopg1], [http://initd.org/projects/psycopg2 psycopg2], or [http://pypgsql.sourceforge.net/ pyPgSQL]
863
864=== Optional Requirements ===
865
866 * A CGI-capable web server (see TracCgi), or
867 * a [http://www.fastcgi.com/ FastCGI]-capable web server (see TracFastCgi), or
868 * [http://httpd.apache.org/ Apache] with [http://www.modpython.org/ mod_python 3.1.3+] (see TracModPython)
869 * [http://peak.telecommunity.com/DevCenter/setuptools setuptools], version >= 0.5a13 for using plugins (see TracPlugins)
870 * [http://docutils.sourceforge.net/ docutils], version >= 0.3.3 for WikiRestructuredText.
871 * [http://silvercity.sourceforge.net/ SilverCity] and/or [http://www.gnu.org/software/enscript/enscript.html Enscript] for [wiki:TracSyntaxColoring syntax highlighting].
872
873''''''Attention'''''': The various available versions of these dependencies are not necessarily interchangable, so please pay attention to the version numbers above. If you are having trouble getting Trac to work please double-check all the dependencies before asking for help on the [http://projects.edgewall.com/trac/wiki/MailingList MailingList] or [http://projects.edgewall.com/trac/wiki/IrcChannel IrcChannel].
874
875Please refer to the documentation of these packages to find out how they are best installed. In addition, most of the [http://projects.edgewall.com/trac/wiki/TracInstallPlatforms platform-specific instructions] also describe the installation of the dependencies.
876
877== Installing Trac ==
878
879Like most Python programs, the Trac Python package is installed by running the following command at the top of the source directory:
880{{{
881$ python ./setup.py install
882}}}
883
884''''Note: you''ll need root permissions or equivalent for this step.''''
885
886This will byte-compile the python source code and install it in the `site-packages` directory
887of your Python installation. The directories `cgi-bin`, `templates`, `htdocs`, `wiki-default` and `wiki-macros` are all copied to `$prefix/share/trac/.`
888
889The script will also install the [wiki:TracAdmin trac-admin] command-line tool, used to create and maintain [wiki:TracEnvironment project environments], as well as the [wiki:TracStandalone tracd] standalone server.
890
891=== Advanced Users ===
892
893To install Trac to a custom location, or find out about other advanced installation options, run:
894{{{
895$ python ./setup.py --help
896}}}
897
898Specifically, you might be interested in:
899{{{
900$ python ./setup.py install --prefix=/path/you/want
901}}}
902
903
904== Creating a Project Environment ==
905
906A [wiki:TracEnvironment Trac environment] is the backend storage where Trac stores information like wiki pages, tickets, reports, settings, etc. An environment is basically a directory that contains a human-readable configuration file and various other files and directories.
907
908A new environment is created using [wiki:TracAdmin trac-admin]:
909{{{
910$ trac-admin /path/to/trac_project_env initenv
911}}}
912
913[wiki:TracAdmin trac-admin] will prompt you for the information it needs to create the environment, such as the name of the project, the path to an existing subversion repository, the [wiki:TracEnvironment#DatabaseConnectionStrings database connection string], and so on. If you''re not sure what to specify for one of these options, just leave it blank to use the default value. The database connection string in particular will always work as long as you have SQLite installed. The only option where the default value is likely to not work is the path to the Subversion repository, so make sure that one''s correct.
914
915Also note that the values you specify here can be changed later by directly editing the [wiki:TracIni] configuration file.
916
917''''Note: The user account under which the web server runs will require write permissions to the environment
918directory and all the files inside.''''
919
920
921== Running the Standalone Server ==
922
923After having created a Trac environment, you can easily try the web interface by running the standalone server [wiki:TracStandalone tracd]:
924{{{
925$ tracd --port 8000 /path/to/projectenv
926}}}
927
928Then, fire up a browser and visit `http://localhost:8000/`. You should get a simple listing of all environments that tracd knows about. Follow the link to the environment you just created, and you should see Trac in action.
929
930
931== Running Trac on a Web Server ==
932
933Trac provides three options for connecting to a “real” web server: [wiki:TracCgi CGI], [wiki:TracFastCgi FastCGI] and [wiki:TracModPython mod_python]. For decent performance, it is recommended that you use either FastCGI or mod_python.
934
935== Configuring Authentication ==
936
937The process of adding, removing, and configuring user accounts for authentication depends on the specific way you run Trac.  To learn about how to accomplish these tasks, please visit one of the following pages:
938
939 * TracStandalone if you use the standalone server, `tracd`.
940 * TracCgi if you use the CGI or FastCGI methods.
941 * TracModPython if you use the mod_python method.
942
943== Using Trac ==
944
945Once you have your Trac site up and running, you should be able to browse your subversion repository, create tickets, view the timeline, etc.
946
947Keep in mind that anonymous (not logged in) users can by default access most but not all of the features. You will need to configure authentication and grant additional [wiki:TracPermissions permissions] to authenticated users to see the full set of features.
948
949''''Enjoy!''''
950
951[http://projects.edgewall.com/trac/wiki/TracTeam The Trac Team]
952
953----
954See also:  TracGuide, TracCgi, TracFastCgi, TracModPython, TracUpgrade, TracPermissions', NULL, NULL);
955INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracInterfaceCustomization', 1, 1132114161, 'trac', '127.0.0.1', '= Customizing the Trac Interface =
956[[TracGuideToc]]
957
958== Introduction ==
959This page is meant to give users suggestions on how they can customize the look of Trac.  Topics on this page cover editing the HTML templates and CSS files, but not the program code itself.  The topics are intended to show users how they can modify the look of Trac to meet their specific needs.  Suggestions for changes to Trac''s interface applicable to all users should be filed as tickets, not listed on this page.
960
961== Project Logo and Icon ==
962The easiest parts of the Trac interface to customize are the logo and the site icon.  Both of these can be configured with settings in [wiki:TracIni trac.ini].
963
964The logo or icon image should be put in a folder named "htdocs" in your project''s environment folder.  (''''Note: in projects created with a Trac version prior to 0.9 you will need to create this folder'''')
965
966Now configure the appropriate section of your [wiki:TracIni trac.ini]:
967
968=== Logo ===
969Change the `src` setting to `site/` followed by the name of your image file.  The `width` and `height` settings should be modified to match your image''s dimensions.
970
971{{{
972[header_logo]
973src = site/my_logo.gif
974alt = My Project
975width = 300
976height = 100
977}}}
978
979=== Icon ===
980Icons should be a 16x16 image in `.gif` or `.ico` format.  Change the `icon` setting to `site/` followed by the name of your icon file.  Icons will typically be displayed by your web browser next to the site''s URL and in the `Bookmarks` menu.
981
982{{{
983[project]
984icon = site/my_icon.ico
985}}}
986
987Note though that this icon is ignored by Internet Explorer, which only accepts a file named ``favicon.ico`` at the root of the host. To make the project icon work in both IE and other browsers, you can store the icon in the document root of the host, and reference it from ``trac.ini`` as follows:
988
989{{{
990[project]
991icon = /favicon.ico
992}}}
993
994== Site Header & Footer ==
995In the environment folder for each Trac project there should be a directory called {{{templates}}}.  This folder contains files {{{site_header.cs}}} and {{{site_footer.cs}}}.  Users can customize their Trac site by adding the required HTML markup to these files.  The content of these two files will be placed immediately following the opening {{{<body>}}} tag and immediately preceding the closing {{{</body>}}} tag of each page in the site, respectively.
996
997These files may contain static HTML, though if users desire to have dynamically generated content they can make use of the [http://www.clearsilver.net/ ClearSilver] templating language from within the pages as well. When you need to see what variables are available to the template, append the query string `?hdfdump=1` to the URL of your Trac site. This will display a structured view of the template data.
998
999== Site CSS ==
1000The primary means to adjust the layout of a Trac site is by add [http://www.w3.org/TR/REC-CSS2/ CSS] style rules that overlay the default rules. This is best done by editing the `site_css.cs` file in the enviroment''s `templates` directory. The content of that template gets inserted into a `<style type="text/css></style>` element on every HTML page generated by Trac.
1001
1002While you can add your custom style rules directory to the `site_css.cs` file, it is recommended that you simply reference an external style sheet, thereby enabling browsers to cache the CSS file instead of transmitting the rules with every response.
1003
1004The following example would import a style sheet located in the `style` root directory of your host:
1005{{{
1006@import url(/style/mytrac.css);
1007}}}
1008
1009You can use a !ClearSilver variable to reference a style sheet stored in the project environment''s `htdocs` directory:
1010{{{
1011@import url(<?cs var:chrome.href ?>/site/style.css);
1012}}}
1013
1014== Main Templates ==
1015
1016It is also possible to use your own modified versions of the Trac [http://www.clearsilver.net/ ClearSilver] templates. Note though that this technique is not recommended because it makes upgrading Trac rather problematic: there are unfortunately several dependencies between the templates and the application code, such as the name of form fields and the structure of the template data, and these are likely to change between different versions of Trac.
1017
1018If you absolutely need to use modified templates, copy the template files from the default templates directory (usually in found in `$prefix/share/trac/templates`) into the `templates` directory of the project environment. Then modify those copies to get the desired results.
1019
1020
1021----
1022See also TracGuide, TracIni', NULL, NULL);
1023INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracLinks', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Links =
1024As you might have guessed, TracLinks are a very fundamental feature of Trac.
1025
1026They allow hyperlinking between Trac entities (tickets, reports, changesets, Wiki
1027pages, milestones and source files) from anywhere WikiFormatting is used.
1028
1029TracLinks are generally of the form ''''''type:id'''''' (where ''''id'''' represents the
1030number, name or path of the item) though some frequently used kinds of items
1031also have short-hand notations.
1032
1033Some examples:
1034 * Tickets: ''''''!#1'''''' or ''''''!ticket:1''''''
1035 * Reports: ''''''!{1}'''''' or ''''''!report:1''''''
1036 * Changesets: ''''''!r1'''''', ''''''![1]'''''' or ''''''!changeset:1''''''
1037 * Revision log: ''''''!r1:3'''''', ''''''![1:3]'''''' or ''''''!log:#1:3''''''
1038 * Wiki pages: ''''''CamelCase'''''' or ''''''!wiki:CamelCase''''''
1039 * Milestones: ''''''!milestone:1.0''''''
1040 * Attachment: ''''''!attachment:ticket:944:attachment.1073.diff''''''
1041 * Files: ''''''!source:trunk/COPYING''''''
1042 * A specific file revision: ''''''!source:/trunk/COPYING#200''''''
1043Display:
1044 * Tickets: #1 or ticket:1
1045 * Reports: {1} or report:1
1046 * Changesets: r1, [1] or changeset:1
1047 * Differences: r1:3, [1:3] or log:#1:3
1048 * Wiki pages: CamelCase or wiki:CamelCase
1049 * Milestones: milestone:1.0
1050 * Files: source:trunk/COPYING
1051 * Attachment: attachment:ticket:944:attachment.1073.diff
1052 * A specific file revision: source:/trunk/COPYING#200
1053
1054''''''Note:'''''' The wiki:CamelCase form is rarely used, but it can be convenient to refer to
1055pages whose names do not follow WikiPageNames rules, i.e., single words,
1056non-alphabetic characters, etc.
1057
1058Trac links using the full (non-shorthand) notation can also be given a custom
1059link title like this:
1060
1061{{{
1062[ticket:1 This is a link to ticket number one].
1063}}}
1064
1065Display: [ticket:1 This is a link to ticket number one].
1066
1067If the title is be omitted, only the id (the part after the colon) is displayed:
1068
1069{{{
1070[ticket:1]
1071}}}
1072
1073Display: [ticket:1]
1074
1075It might seem a simple enough concept at a glance, but actually allows quite a complex network of information. In practice, it''s very intuitive and simple to use, and we''ve found the "link trail" extremely helpful to better understand what''s happening in a project or why a particular change was made.
1076
1077== attachement: links ==
1078
1079The link syntax for attachments is as follows:
1080 * !attachment:the_file.txt creates a link to the attachment the_file.txt of the current object
1081 * !attachment:wiki:MyPage:the_file.txt creates a link to the attachment the_file.txt of the !MyPage wiki page
1082 * !attachment:ticket:753:the_file.txt creates a link to the attachment the_file.txt of the ticket 753 !attachment:wiki:MyPage:the_file.txt
1083
1084== source: links ==
1085
1086The default behavior for a source:/some/path link is to open the directory browser
1087if the path points to a directory and otherwise open the log view.
1088It''s also possible to link directly to a specific revision of a file like this: source:/some/file@123
1089or like this to link to the latest revision: source:/some/file@latest.
1090If the revision is specified, one can even link to a specific line number: !source:/some/file@123#L10
1091[[comment(TODO: remove the ! when Edgewall Trac is upgraded with the support for the line syntax)]]
1092
1093== Quoting space in TracLinks ==
1094
1095The usual syntax for quoting space is:
1096
1097 * !attachment:''the file.txt'' or
1098 * !attachment:"the file.txt"
1099
1100== Where to use TracLinks ==
1101You can use TracLinks in:
1102
1103 * Source code (Subversion) commit messages
1104 * Wiki pages
1105 * Full descriptions for tickets, reports and milestones
1106
1107and any other text fields explicitly marked as supporting WikiFormatting.
1108
1109== Escaping Links ==
1110
1111To prevent parsing of a !TracLink, you can escape it by preceding it with a ''!'' (exclamation mark).
1112{{{
1113 !NoLinkHere.
1114 ![42] is not a link either.
1115}}}
1116
1117Display:
1118 !NoLinkHere.
1119 ![42] is not a link either.
1120
1121----
1122See also: WikiFormatting, TracWiki
1123 ', NULL, NULL);
1124INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracLogging', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Logging =
1125[[TracGuideToc]]
1126
1127Trac supports logging of system messages using the standard [http://docs.python.org/lib/module-logging.html logging module] that comes with Python.
1128
1129Logging is configured in the {{{[logging]}}} section in [wiki:TracIni trac.ini].
1130
1131== Supported Logging Methods ==
1132
1133The log method is set using the `log_type` configuration option, which takes any of the following values:
1134 ''''''none'''':: Suppress all log messages.
1135 ''''''file'''''':: Log messages to a file, specified with the `log_file` option in [wiki:TracIni trac.ini].
1136 ''''''stderr'''''':: Output all log entries to console ([wiki:TracStandalone tracd] only).
1137 ''''''syslog'''''':: (UNIX) Send messages to local syslogd via named pipe `/dev/log`.
1138 ''''''eventlog'''''':: (Windows) Use the system''s NT eventlog for Trac logging.
1139
1140== Log Levels ==
1141
1142The verbosity level of logged messages can be set using the ''''log_level'''' directive in [wiki:TracIni trac.ini]. The log level defines the minimum level of urgency required for a message to be logged.
1143
1144The levels are:
1145 ''''''CRITICAL'''''':: Log only the most critical (typically fatal) errors.
1146 ''''''ERROR'''''':: Log failures, bugs and errors.
1147 ''''''WARN'''''':: Log warnings, non-interrupting events.
1148 ''''''INFO'''''':: Diagnostic information, log information about all processing.
1149 ''''''DEBUG'''''':: Trace messages, profiling, etc.
1150
1151----
1152See also: TracIni, TracGuide, TracEnvironment
1153', NULL, NULL);
1154INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracModPython', 1, 1132114161, 'trac', '127.0.0.1', '= Trac and mod_python =
1155
1156Trac supports [http://www.modpython.org/ mod_python], which speeds up Trac''s response times considerably and permits use of many Apache features not possible with [wiki:TracStandalone tracd]/mod_proxy.
1157
1158== Simple configuration ==
1159
1160If you just installed mod_python, you may have to add a line to load the module in the Apache configuration:
1161{{{
1162LoadModule python_module modules/mod_python.so
1163}}}
1164
1165A simple setup of Trac on mod_python looks like this:
1166{{{
1167<Location /projects/myproject>
1168   SetHandler mod_python
1169   PythonHandler trac.web.modpython_frontend
1170   PythonOption TracEnv /var/trac/myproject
1171   PythonOption TracUriRoot /projects/myproject
1172</Location>
1173}}}
1174
1175Note that the option `TracUriRoot` may or may not be necessary in your setup. Try without first, and if the URLs produced by Trac look wrong or if Trac does not seem to recognize the URLs correctly, add the `TracUriRoot` option.
1176
1177Configuring authentication works the same as for [wiki:TracCgi#AddingAuthentication CGI]:
1178{{{
1179<Location "/projects/myproject/login">
1180  AuthType Basic
1181  AuthName "myproject"
1182  AuthUserFile /var/trac/myproject/.htaccess
1183  Require valid-user
1184</Location>
1185}}}
1186
1187If the Trac installation isn''t installed in your Python path, you''ll have to tell Apache where to find the Trac mod_python handler  using the `PythonPath` directive:
1188{{{
1189<Location /projects/myproject>
1190  ...
1191  PythonPath "sys.path + [''/path/to/trac'']"
1192  ...
1193</Location>
1194}}}
1195
1196
1197== Setting up multiple projects ==
1198
1199The Trac mod_python handler handler supports a configuration option similar to Subversion''s `SvnParentPath`, called `TracEnvParentDir`:
1200{{{
1201<Location /projects>
1202  SetHandler mod_python
1203  PythonHandler trac.web.modpython_frontend
1204  PythonOption TracEnvParentDir /var/trac
1205  PythonOption TracUriRoot /projects
1206</Location>
1207}}}
1208
1209When you request the `/projects` URL, you will get a listing of all subdirectories of the directory you set as `TracEnvParentDir`. Selecting any project in the list will bring you to the corresponding Trac environment.
1210
1211If you don''t want to have the subdirectory listing as your projects home page you can use a
1212{{{
1213<LocationMatch "/.+/">
1214}}}
1215
1216This will instruct Apache to use mod_python for all locations different from root while having the possibility of placing a custom home page for root in your !DocumentRoot folder.
1217
1218You can also use the same authentication realm for all of the projects using a `<LocationMatch>` directive:
1219{{{
1220<LocationMatch "/[^/]+/login">
1221  AuthType Basic
1222  AuthName "Trac"
1223  AuthUserFile /var/trac/.htaccess
1224  Require valid-user
1225</LocationMatch>
1226}}}
1227
1228== Virtual Host Configuration ==
1229
1230Below is the sample configuration required to set up your trac as a virtual server (i.e. when you access it at the URLs like
1231!http://trac.mycompany.com):
1232
1233{{{
1234<VirtualHost * >
1235    DocumentRoot /var/trac/myproject
1236    ServerName trac.mycompany.com
1237    <Directory />
1238        SetHandler mod_python
1239        PythonHandler trac.web.modpython_frontend
1240        PythonOption TracEnv /var/trac/myproject
1241        PythonOption TracUriRoot /
1242    </Directory>
1243    <Location /login>
1244        AuthType Basic
1245        AuthName "MyCompany Trac Server"
1246        AuthUserFile /var/trac/myproject/.htusers
1247        Require valid-user
1248    </Location>
1249</VirtualHost>
1250}}}
1251
1252== Troubleshooting ==
1253
1254=== Form submission problems ===
1255
1256If you''re experiencing problems submitting some of the forms in Trac (a common problem is that you get redirected to the start page after submission), check whether your {{{DocumentRoot}}} contains a folder or file with the same path that you mapped the mod_python handler to. For some reason, mod_python gets confused when it is mapped to a location that also matches a static resource.
1257
1258=== Using .htaccess ===
1259
1260Although it may seem trivial to rewrite the above configuration as a directory in your document root with a `.htaccess` file, this does not work. Apache will append a "/" to any Trac URLs, which interferes with its correct operation.
1261
1262It may be possible to work around this with mod_rewrite, but I failed to get this working. In all, it is more hassle than it is worth. Stick to the provided instructions. :)
1263
1264=== Win32 Issues ===
1265
1266If you run trac with mod_python (3.1.3 or 3.1.4) on Windows,
1267uploading attachments will ''''''not'''''' work.
1268This is a known problem which we can''t solve cleanly at the Trac level.
1269
1270However, there is a workaround for this at the mod_python level,
1271which is to apply the following patch [http://projects.edgewall.com/trac/attachment/ticket/554/util_py.patch attachment:ticket:554:util_py.patch]
1272to the (Lib/site-packages)/modpython/util.py file.
1273
1274If you don''t have the `patch` command, that file can be replaced with the [http://svn.apache.org/viewcvs.cgi/httpd/mod_python/trunk/lib/python/mod_python/util.py?rev=103562&view=markup  fixed util.py] (fix which, although done prior to the 3.1.4 release, is ''''not''''
1275present in 3.1.4).
1276
1277=== OS X issues ===
1278
1279When using mod_python on OS X you will not be able to restart Apache using `apachectl restart`. This is apparently fixed in mod_python 3.2, but there''s also a patch available for earlier versions [http://www.dscpl.com.au/projects/vampire/patches.html here].
1280
1281----
1282See also TracGuide, TracInstall, TracCgi, TracFastCgi', NULL, NULL);
1283INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracNotification', 1, 1132114161, 'trac', '127.0.0.1', '= Email Notification of Ticket Changes =
1284[[TracGuideToc]]
1285
1286Trac supports basic notification for ticket changes using email.
1287
1288Email notification is useful to keep users up-to-date on tickets/issues of interest, and also provides a convenient way to post ticket changes to a dedicated mailing list. ''''''Note:'''''' As an example, this is how the [http://lists.edgewall.com/archive/trac-tickets/ Trac-tickets] mailing list works.
1289
1290Disabled by default, notification can be activated and configured in [wiki:TracIni trac.ini].
1291
1292== Receiving Notification ==
1293When reporting a new ticket or adding a comment, enter a valid email address in the ''''reporter'''', ''''editor'''' or ''''cc'''' field. Trac will automatically send you an email when changes are made to the ticket.
1294
1295This is useful to keep up-to-date on an issue or enhancement request that interests you.
1296
1297== Configuring SMTP Notification ==
1298
1299=== Configuration Options ===
1300These are the available options for the ''''[notification]'''' section in trac.ini.
1301 * ''''''smtp_enabled'''''': Enable email notification.
1302 * ''''''smtp_server'''''': SMTP server used for notification messages.
1303 * ''''''smtp_user'''''': (''''requires [milestone:0.9 0.9]'''') user name for authentication SMTP account.
1304 * ''''''smtp_password'''''': (''''requires [milestone:0.9 0.9]'''') password for authentication SMTP account.
1305 * ''''''smtp_from'''''': Email address to use for ''''Sender''''-headers in notification emails.
1306 * ''''''smtp_replyto'''''': Email address to use for ''''Reply-To''''-headers in notification emails.
1307 * ''''''smtp_always_cc'''''': List of email addresses to always send notifications to. ''''Typically used to post ticket changes to a dedicated mailing list.''''
1308 * ''''''always_notify_reporter'''''':  Always send notifications to any address in the reporter field.
1309 * ''''''always_notify_owner'''''': (''''requires [milestone:0.9 0.9]'''') Always send notifications to the address in the owner field.
1310
1311Either ''''''smtp_from'''''' or ''''''smtp_replyto'''''' (or both) ''''must'''' be set, otherwise Trac refuses to send notification mails.
1312
1313=== Example Configuration ===
1314
1315{{{
1316[notification]
1317smtp_enabled = true
1318smtp_server = mail.example.com
1319smtp_from = notifier@example.com
1320smtp_replyto = myproj@projects.example.com
1321smtp_always_cc = ticketmaster@example.com, theboss+myproj@example.com
1322}}}
1323
1324== Sample Email ==
1325{{{
1326#42: testing
1327---------------------------+------------------------------------------------
1328       Id:  42             |      Status:  assigned               
1329Component:  report system  |    Modified:  Fri Apr  9 00:04:31 2004
1330 Severity:  major          |   Milestone:  0.9                     
1331 Priority:  lowest         |     Version:  0.6                     
1332    Owner:  anonymous      |    Reporter:  jonas@example.com               
1333---------------------------+------------------------------------------------
1334Changes:
1335  * component:  changset view => search system
1336  * priority:  low => highest
1337  * owner:  jonas => anonymous
1338  * cc:  daniel@example.com =>
1339         daniel@example.com, jonas@example.com
1340  * status:  new => assigned
1341
1342Comment:
1343I''m interested too!
1344
1345--
1346Ticket URL: <http://example.com/trac/ticket/42>
1347My Project <http://myproj.example.com/>
1348}}}
1349----
1350See also: TracTickets, TracIni, TracGuide', NULL, NULL);
1351INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracPermissions', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Permissions =
1352[[TracGuideToc]]
1353
1354Trac uses a simple but flexible permission system to control what users can and can''t access.
1355
1356Permission privileges are managed using the [wiki:TracAdmin trac-admin] tool.
1357
1358Regular visitors, non-authenticated users, accessing the system are assigned the default
1359role (''''user'''') named {{{anonymous}}}.
1360Assign permissions to the {{{anonymous}}} user to set privileges for non-authenticated/guest users.
1361
1362In addition to these privileges users can be granted additional individual
1363rights in effect when authenticated and logged into the system.
1364
1365== Available Privileges ==
1366
1367To enable all privileges for a user, use the `TRAC_ADMIN` permission. Having `TRAC_ADMIN` is like being `root` on a *NIX system, it will let you do anything you want.
1368
1369Otherwise, individual privileges can be assigned to users for the various different functional areas of Trac:
1370
1371=== Repository Browser ===
1372
1373|| `BROWSER_VIEW` || View directory listings in the [wiki:TracBrowser repository browser] ||
1374|| `LOG_VIEW` || View revision logs of files and directories in the [wiki:TracBrowser repository browser] ||
1375|| `FILE_VIEW` || View files in the [wiki:TracBrowser repository browser] ||
1376|| `CHANGESET_VIEW` || View [wiki:TracChangeset repository check-ins] ||
1377
1378=== Ticket System ===
1379
1380|| `TICKET_VIEW` || View existing [wiki:TracTickets tickets] and perform [wiki:TracQuery ticket queries] ||
1381|| `TICKET_CREATE` || Create new [wiki:TracTickets tickets] ||
1382|| `TICKET_APPEND` || Add comments or attachments to [wiki:TracTickets tickets] ||
1383|| `TICKET_CHGPROP` || Modify [wiki:TracTickets ticket] properties ||
1384|| `TICKET_MODIFY` || Includes both `TICKET_APPEND` and `TICKET_CHGPROP`, and in addition allows resolving [wiki:TracTickets tickets] ||
1385|| `TICKET_ADMIN` || All `TICKET_*` permissions, plus the deletion of ticket attachments. ||
1386
1387=== Roadmap ===
1388
1389|| `MILESTONE_VIEW` || View a milestone ||
1390|| `MILESTONE_CREATE` || Create a new milestone ||
1391|| `MILESTONE_MODIFY` || Modify existing milestones ||
1392|| `MILESTONE_DELETE` || Delete milestones ||
1393|| `MILESTONE_ADMIN` || All `MILESTONE_*` permissions ||
1394|| `ROADMAP_VIEW` || View the [wiki:TracRoadmap roadmap] page ||
1395|| `ROADMAP_ADMIN` || Alias for `MILESTONE_ADMIN` (deprecated) ||
1396
1397=== Reports ===
1398
1399|| `REPORT_VIEW` || View [wiki:TracReports reports] ||
1400|| `REPORT_SQL_VIEW` || View the underlying SQL query of a [wiki:TracReports report] ||
1401|| `REPORT_CREATE` || Create new [wiki:TracReports reports] ||
1402|| `REPORT_MODIFY` || Modify existing [wiki:TracReports reports] ||
1403|| `REPORT_DELETE` || Delete [wiki:TracReports reports] ||
1404|| `REPORT_ADMIN` || All `REPORT_*` permissions ||
1405
1406=== Wiki System ===
1407
1408|| `WIKI_VIEW` || View existing [wiki:TracWiki wiki] pages ||
1409|| `WIKI_CREATE` || Create new [wiki:TracWiki wiki] pages ||
1410|| `WIKI_MODIFY` || Change [wiki:TracWiki wiki] pages ||
1411|| `WIKI_DELETE` || Delete [wiki:TracWiki wiki] pages and attachments ||
1412|| `WIKI_ADMIN` || All `WIKI_*` permissions, plus the management of ''''readonly'''' pages. ||
1413
1414=== Others ===
1415
1416|| `TIMELINE_VIEW` || View the [wiki:TracTimeline timeline] page ||
1417|| `SEARCH_VIEW` || View and execute [wiki:TracSearch search] queries ||
1418|| `CONFIG_VIEW` || Enables additional pages on ''''About Trac'''' that show the current configuration or the list of installed plugins ||
1419
1420== Granting Privileges ==
1421
1422Currently the only way to grant privileges to users is by using the `trac-admin` script. The current set of privileges can be listed with the following command:
1423{{{
1424  $ trac-admin /path/to/projenv permission list
1425}}}
1426
1427This command will allow the user ''''bob'''' to delete reports:
1428{{{
1429  $ trac-admin /path/to/projenv permission add bob REPORT_DELETE
1430}}}
1431
1432== Permission Groups ==
1433
1434Permissions can be grouped together to form roles such as ''''developer'''', ''''admin'''', etc.
1435{{{
1436  $ trac-admin /path/to/projenv permission add developer WIKI_ADMIN
1437  $ trac-admin /path/to/projenv permission add developer REPORT_ADMIN
1438  $ trac-admin /path/to/projenv permission add developer TICKET_MODIFY
1439  $ trac-admin /path/to/projenv permission add bob developer
1440  $ trac-admin /path/to/projenv permission add john developer
1441}}}
1442
1443== Default Permissions ==
1444
1445Granting privileges to the special user ''''anonymous'''' can be used to control what an anonymous user can do before they have logged in.
1446
1447In the same way, privileges granted to the special user ''''authenticated'''' will apply to any authenticated (logged in) user.
1448
1449----
1450See also: TracAdmin, TracGuide', NULL, NULL);
1451INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracPlugins', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Plugins =
1452[[TracGuideToc]]
1453
1454Since version 0.9, Trac supports plugins that extend the built-in functionality. The plugin functionality is based on the [http://projects.edgewall.com/trac/wiki/TracDev/ComponentArchitecture component architecture].
1455
1456== Requirements ==
1457
1458To use plugins in Trac, you need to have [http://peak.telecommunity.com/DevCenter/setuptools setuptools] (version 0.6) installed.
1459
1460To install `setuptools`, download the bootstrap module [http://peak.telecommunity.com/dist/ez_setup.py ez_setup.py] and execute it as follows:
1461{{{
1462$ python ez_setup.py
1463}}}
1464
1465If the `ez_setup.py` script fails to install the setuptools release, you can download it from [http://www.python.org/pypi/setuptools PyPI] and install it manually.
1466
1467== Installing a Trac Plugin ==
1468
1469=== For a Single Project ===
1470
1471Plugins are packaged as [http://peak.telecommunity.com/DevCenter/PythonEggs Python eggs]. That means they are ZIP archives with the file extension `.egg`. If you have downloaded a source distribution of a plugin, you can run:
1472{{{
1473$ python setup.py bdist_egg
1474}}}
1475to build the `.egg` file.
1476
1477Once you have the plugin archive, you need to copy it into the `plugins` directory of the [wiki:TracEnvironment project environment]. Also, make sure that the web server has sufficient permissions to read the plugin egg.
1478
1479=== For All Projects ===
1480
1481Plugins that you want to use in all your projects (such as [http://projects.edgewall.com/trac/wiki/WebAdmin WebAdmin]) can be installed globally by running:
1482{{{
1483$ python setup.py install
1484}}}
1485
1486Alternatively, you can just drop the `.egg` file in the Python `site-packages` directory.
1487
1488Unlike plugins installed per-environment, you''ll have to explicitly enable globally installed plugins via [wiki:TracIni trac.ini]. This is done in the `[components]` section of the configuration file, for example:
1489{{{
1490[components]
1491webadmin.* = enabled
1492}}}
1493
1494The name of the option is the Python package of the plugin. This should be specified in the documentation of the Plugin, but can also be easily find out by looking at the source (look for a top-level directory that contains a file named `__init__.py`.)
1495
1496== Setting up the Plugin Cache ==
1497
1498Some plugins will need to be extracted by the Python eggs runtime (`pkg_resources`), so that their contents are actual files on the file system. The directory in which they are extracted defaults to the home directory of the current user, which may or may not be a problem. You can however override the default location using the `PYTHON_EGG_CACHE` environment variable.
1499
1500To do this from the Apache configuration, use the `SetEnv` directive as follows:
1501{{{
1502SetEnv PYTHON_EGG_CACHE /path/to/dir
1503}}}
1504
1505This works whether your using the [wiki:TracCgi CGI] or the [wiki:TracModPython mod_python] front-end. Put this directive next to where you set the path to the [wiki:TracEnvironment Trac environment], i.e. in the same `<Location>` block.
1506
1507For example (for CGI):
1508{{{
1509 <Location /trac>
1510   SetEnv TRAC_ENV /path/to/projenv
1511   SetEnv PYTHON_EGG_CACHE /path/to/dir
1512 </Location>
1513}}}
1514
1515or (for mod_python):
1516{{{
1517 <Location /trac>
1518   SetHandler mod_python
1519   ...
1520   SetEnv PYTHON_EGG_CACHE /path/to/dir
1521 </Location>
1522}}}
1523
1524For [wiki:TracFastCgi FastCGI], you''ll need to `-initial-env` option, or whatever is provided by your web server for setting environment variables.
1525
1526----
1527See also TracGuide, [http://projects.edgewall.com/trac/wiki/PluginList plugin list], [http://projects.edgewall.com/trac/wiki/TracDev/ComponentArchitecture component architecture]', NULL, NULL);
1528INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracQuery', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Ticket Queries =
1529[[TracGuideToc]]
1530
1531In addition to [wiki:TracReports reports], Trac provides support for ''''custom ticket queries'''', used to display lists of tickets meeting a specified set of criteria.
1532
1533To configure and execute a custom query, switch to the ''''View Tickets'''' module from the navigation bar, and select the ''''Custom Query'''' link.
1534
1535== Filters ==
1536When you first go to the query page the default filters will display all open tickets, or if you''re logged in it will display open tickets assigned to you.  Current filters can be removed by clicking the button to the right with the minus sign on the label.  New filters are added from the pulldown list in the bottom-right corner of the filters box.  Filters with either a text box or a pulldown menu of options can be added multiple times to perform an ''''or'''' of the criteria.
1537
1538You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.
1539
1540Once you''ve edited your filters click the ''''Update'''' button to refresh your results.
1541
1542== Navigating Tickets ==
1543Clicking on one of the query results will take you to that ticket.  You can navigate through the results by clicking the ''''Next Ticket'''' or ''''Previous Ticket'''' links just below the main menu bar, or click the ''''Back to Query'''' link to return to the query page. 
1544
1545You can safely edit any of the tickets and continue to navigate through the results using the ''''Next/Previous/Back to Query'''' links after saving your results.  When you return to the query any tickets you edited will be displayed with italicized text.  If one of the tickets was edited such that it no longer matches the query criteria the text will also be greyed.  The query results can be refreshed and cleared of these status indicators by clicking the ''''Update'''' button again.
1546
1547== Saving Queries ==
1548
1549While Trac does not yet allow saving a named query and somehow making it available in a navigable list, you can save references to queries in Wiki content, as described below.
1550
1551=== Using TracLinks ===
1552
1553You may want to save some queries so that you can come back to them later.  You can do this by making a link to the query from any Wiki page.
1554{{{
1555[query:status!=closed&version=0.8 Active tickets against 0.8]
1556}}}
1557
1558Which is displayed as:
1559  [query:status!=closed&version=0.8 Active tickets against 0.8]
1560
1561This uses a very simple query language to specify the criteria (see [wiki:TracQuery#QueryLanguage Query Language]).
1562
1563Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading `?` character:
1564{{{
1565[query:?status=assigned&group=owner Assigned tickets by owner]
1566}}}
1567
1568Whis is displayed as:
1569  [query:?status=assigned&group=owner Assigned tickets by owner]
1570
1571The advantage of this approach is that you can also specify the grouping and ordering, which is not possible using the first syntax.
1572
1573=== Using the `[[TicketQuery]]` Macro ===
1574
1575The `[[TicketQuery]]` macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting.
1576
1577Example:
1578{{{
1579[[TicketQuery(version=0.9b1|0.9b2&resolution=duplicate)]]
1580}}}
1581
1582This is displayed as:
1583  [[TicketQuery(version=0.9b1|0.9b2&resolution=duplicate)]]
1584
1585Just like the [wiki:TracQuery#UsingTracLinks query: wiki links], the parameter of this macro expects a query string formatted according to the rules of the simple [wiki:TracQuery#QueryLanguage ticket query language].
1586
1587A more compact representation without the ticket summaries is also available:
1588{{{
1589[[TicketQuery(version=0.9b1|0.9b2&resolution=duplicate, compact)]]
1590}}}
1591
1592This is displayed as:
1593  [[TicketQuery(version=0.9b1|0.9b2&resolution=duplicate, compact)]]
1594
1595=== Query Language ===
1596
1597`query:` TracLinks and the `[[TicketQuery]]` macro both use a mini “query language” for specifying query filters. Basically, the filters are separate by ampersands (`&`). Each filter then consists of the ticket field name, an operator, and one or more values. More than one value are separated by a pipe (`|`), meaning that the filter matches any of the values.
1598
1599The available operators are:
1600|| ''''''='''''' || the field content exactly matches the one of the values ||
1601|| ''''''~='''''' || the field content contains one or more of the values ||
1602|| ''''''!^='''''' || the field content starts with one of the values ||
1603|| ''''''$='''''' || the field content ends with one of the values ||
1604
1605All of these operators can also be negated:
1606|| ''''''!='''''' || the field content matches none of the values ||
1607|| ''''''!~='''''' || the field content does not contain any of the values ||
1608|| ''''''!!^='''''' || the field content does not start with any of the values ||
1609|| ''''''!$='''''' || the field content does not end with any of the values ||
1610
1611----
1612See also: TracTickets, TracReports, TracGuide', NULL, NULL);
1613INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracReports', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Reports =
1614[[TracGuideToc]]
1615
1616The Trac reports module provides a simple, yet powerful reporting facility
1617to present information about tickets in the Trac database.
1618
1619Rather than have its own report definition format, TracReports relies on standard SQL
1620`SELECT` statements for custom report definition.
1621
1622  ''''''Note:'''''' ''''The report module is being phased out in its current form because it seriously limits the ability of the Trac team to make adjustments to the underlying database schema. We believe that the [wiki:TracQuery query module] is a good replacement that provides more flexibility and better usability. While there are certain reports that cannot yet be handled by the query module, we intend to further enhance it so that at some point the reports module can be completely removed. This also means that there will be no major enhancements to the report module anymore.''''
1623
1624  ''''You can already completely replace the reports module by the query module simply be disabling the former in [wiki:TracIni trac.ini]:''''
1625  {{{
1626  [components]
1627  trac.ticket.report.* = disabled
1628  }}}
1629  ''''This will make the query module the default handler for the “View Tickets” navigation item. We encourage you to try this configuration and report back what kind of features of reports you are missing, if any.''''
1630
1631A report consists of these basic parts:
1632 * ''''''ID'''''' -- Unique (sequential) identifier
1633 * ''''''Title''''''  -- Descriptive title
1634 * ''''''Description''''''  -- A brief description of the report, in WikiFormatting text.
1635 * ''''''Report Body'''''' -- List of results from report query, formatted according to the methods described below.
1636 * ''''''Footer'''''' -- Links to alternative download formats for this report.
1637
1638== Changing Sort Order ==
1639Simple reports - ungrouped reports to be specific - can be changed to be sorted by any column simply by clicking the column header.
1640
1641If a column header is a hyperlink (red), click the column you would like to sort by. Clicking the same header again reverses the order.
1642
1643
1644== Alternate Download Formats ==
1645Aside from the default HTML view, reports can also be exported in a number of alternate formats.
1646At the bottom of the report page, you will find a list of available data formats. Click the desired link to
1647download the alternate report format.
1648
1649=== Comma-delimited - CSV (Comma Separated Values) ===
1650Export the report as plain text, each row on its own line, columns separated by a single comma ('','').
1651''''''Note:'''''' Carriage returns, line feeds, and commas are stripped from column data to preserve the CSV structure.
1652
1653=== Tab-delimited ===
1654Like above, but uses tabs (     ) instead of comma.
1655
1656=== RSS - XML Content Syndication ===
1657All reports support syndication using XML/RSS 2.0. To subscribe to an RSS feed, click the orange ''XML'' icon at the bottom of the page. See TracRss for general information on RSS support in Trac.
1658
1659----
1660
1661== Creating Custom Reports ==
1662
1663''''Creating a custom report requires a comfortable knowledge of SQL.''''
1664
1665A report is basically a single named SQL query, executed and presented by
1666Trac.  Reports can be viewed and created from a custom SQL expression directly
1667in from the web interface.
1668
1669Typically, a report consists of a SELECT-expression from the ''ticket'' table,
1670using the available columns and sorting the way you want it.
1671
1672== Ticket columns ==
1673The ''''ticket'''' table has the following columns:
1674 * id
1675 * time
1676 * changetime
1677 * component
1678 * severity 
1679 * priority
1680 * owner
1681 * reporter
1682 * cc
1683 * version
1684 * milestone
1685 * status
1686 * resolution
1687 * summary
1688 * description
1689
1690See TracTickets for a detailed description of the column fields.
1691
1692''''''all active tickets, sorted by priority and time''''''
1693
1694''''''Example:'''''' ''''All active tickets, sorted by priority and time''''
1695{{{
1696SELECT id AS ticket, status, severity, priority, owner,
1697       time as created, summary FROM ticket
1698  WHERE status IN (''new'', ''assigned'', ''reopened'')
1699  ORDER BY priority, time
1700}}}
1701
1702
1703----
1704
1705
1706== Advanced Reports: Dynamic Variables ==
1707For more flexible reports, Trac supports the use of ''''dynamic variables'''' in report SQL statements.
1708In short, dynamic variables are ''''special'''' strings that are replaced by custom data before query execution.
1709
1710=== Using Variables in a Query ===
1711The syntax for dynamic variables is simple, any upper case word beginning with ''$'' is considered a variable.
1712
1713Example:
1714{{{
1715SELECT id AS ticket,summary FROM ticket WHERE priority=''$PRIORITY''
1716}}}
1717
1718To assign a value to $PRIORITY when viewing the report, you must define it as an argument in the report URL, leaving out the the leading ''$''.
1719
1720Example:
1721{{{
1722 http://projects.edgewall.com/trac/reports/14?PRIORITY=high
1723}}}
1724
1725To use multiple variables, separate them with an ''&''.
1726
1727Example:
1728{{{
1729 http://projects.edgewall.com/trac/reports/14?PRIORITY=high&SEVERITY=critical
1730}}}
1731
1732
1733=== Special/Constant Variables ===
1734There is one ''''magic'''' dynamic variable to allow practical reports, its value automatically set without having to change the URL.
1735
1736 * $USER -- Username of logged in user.
1737
1738Example (''''List all tickets assigned to me''''):
1739{{{
1740SELECT id AS ticket,summary FROM ticket WHERE owner=''$USER''
1741}}}
1742
1743
1744----
1745
1746
1747== Advanced Reports: Custom Formatting ==
1748Trac is also capable of more advanced reports, including custom layouts,
1749result grouping and user-defined CSS styles. To create such reports, we''ll use
1750specialized SQL statements to control the output of the Trac report engine.
1751
1752== Special Columns ==
1753To format reports, TracReports looks for ''magic'' column names in the query
1754result. These ''magic'' names are processed and affect the layout and style of the
1755final report.
1756
1757=== Automatically formatted columns ===
1758 * ''''''ticket'''''' -- Ticket ID number. Becomes a hyperlink to that ticket.
1759 * ''''''created, modified, date, time'''''' -- Format cell as a date and/or time.
1760
1761 * ''''''description'''''' -- Ticket description field, parsed through the wiki engine.
1762
1763''''''Example:''''''
1764{{{
1765SELECT id as ticket, created, status, summary FROM ticket
1766}}}
1767
1768=== Custom formatting columns ===
1769Columns whose names begin and end with 2 underscores (Example: ''''''_''''''''''''_color_''''''''''''_'''''') are
1770assumed to be ''''formatting hints'''', affecting the appearance of the row.
1771 
1772 * ''''''_''''''''''''_group_''''''''''''_'''''' -- Group results based on values in this column. Each group will have its own header and table.
1773 * ''''''_''''''''''''_color_''''''''''''_'''''' -- Should be a numeric value ranging from 1 to 5 to select a pre-defined row color. Typically used to color rows by issue priority.
1774 * ''''''_''''''''''''_style_''''''''''''_'''''' -- A custom CSS style expression to use for the current row.
1775
1776''''''Example:'''''' ''''List active tickets, grouped by milestone, colored by priority''''
1777{{{
1778SELECT p.value AS __color__,
1779     t.milestone AS __group__,
1780     (CASE owner WHEN ''daniel'' THEN ''font-weight: bold; background: red;'' ELSE '''' END) AS __style__,
1781       t.id AS ticket, summary
1782  FROM ticket t,enum p
1783  WHERE t.status IN (''new'', ''assigned'', ''reopened'')
1784    AND p.name=t.priority AND p.type=''priority''
1785  ORDER BY t.milestone, p.value, t.severity, t.time
1786}}}
1787
1788''''''Note:'''''' A table join is used to match ''''ticket'''' priorities with their
1789numeric representation from the ''''enum'''' table.
1790
1791=== Changing layout of report rows ===
1792By default, all columns on each row are display on a single row in the HTML
1793report, possibly formatted according to the descriptions above. However, it''s
1794also possible to create multi-line report entries.
1795
1796 * ''''''column_'''''' -- ''''Break row after this''''. By appending an underscore (''_'') to the column name, the remaining columns will be be continued on a second line.
1797
1798 * ''''''_column_'''''' -- ''''Full row''''. By adding an underscore (''_'') both at the beginning and the end of a column name, the data will be shown on a separate row.
1799
1800 * ''''''_column''''''  --  ''''Hide data''''. Prepending an underscore (''_'') to a column name instructs Trac to hide the contents from the HTML output. This is useful for information to be visible only if downloaded in other formats (like CSV or RSS/XML).
1801
1802''''''Example:'''''' ''''List active tickets, grouped by milestone, colored by priority, with  description and multi-line layout''''
1803
1804{{{
1805SELECT p.value AS __color__,
1806       t.milestone AS __group__,
1807       (CASE owner
1808          WHEN ''daniel'' THEN ''font-weight: bold; background: red;''
1809          ELSE '''' END) AS __style__,
1810       t.id AS ticket, summary AS summary_,             -- ## Break line here
1811       component,version, severity, milestone, status, owner,
1812       time AS created, changetime AS modified,         -- ## Dates are formatted
1813       description AS _description_,                    -- ## Uses a full row
1814       changetime AS _changetime, reporter AS _reporter -- ## Hidden from HTML output
1815  FROM ticket t,enum p
1816  WHERE t.status IN (''new'', ''assigned'', ''reopened'')
1817    AND p.name=t.priority AND p.type=''priority''
1818  ORDER BY t.milestone, p.value, t.severity, t.time
1819}}}
1820
1821=== Reporting on custom fields ===
1822
1823If you have added custom fields to your tickets (experimental feature in v0.8, see TracTicketsCustomFields), you can write a SQL query to cover them. You''ll need to make a join on the ticket_custom table, but this isn''t especially easy.
1824
1825If you have tickets in the database ''''before'''' you declare the extra fields in trac.ini, there will be no associated data in the ticket_custom table. To get around this, use SQL''s "LEFT OUTER JOIN" clauses. See TracIniReportCustomFieldSample for some examples.
1826
1827----
1828See also: TracTickets, TracQuery, TracGuide', NULL, NULL);
1829INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracRoadmap', 1, 1132114161, 'trac', '127.0.0.1', '= The Trac Roadmap =
1830[[TracGuideToc]]
1831
1832The roadmap provides a view on the [wiki:TracTickets ticket system] that helps planning and managing the future development of a project.
1833
1834== The Roadmap View ==
1835
1836Basically, the roadmap is just a list of future milestones. You can add a description to milestones (using WikiFormatting) describing main objectives, for example. In addition, tickets targeted for a milestone are aggregated, and the ratio between active and resolved tickets is displayed as a milestone progress bar.
1837
1838== The Milestone View ==
1839
1840It is possible to drill down into this simple statistic by viewing the individual milestone pages. By default, the active/resolved ratio will be grouped and displayed by component. You can also regroup the status by other criteria, such as ticket owner or severity. Ticket numbers are linked to [wiki:TracQuery custom queries] listing corresponding tickets.
1841
1842== Roadmap Administration ==
1843
1844It is possible to add, modify and remove milestones using either TracAdmin or the web interface.
1845
1846''''''Note:'''''' Milestone descriptions can currently only be edited from the web interface. With appropriate permissions, you''ll see buttons for milestone management on the roadmap and milestone pages.
1847
1848== iCalendar Support ==
1849
1850The Roadmap supports the [http://www.ietf.org/rfc/rfc2445.txt iCalendar] format to keep track of planned milestones and related tickets from your favorite calendar software. Calendar applications supporting the iCalendar specification include [http://www.apple.com/ical/ Apple iCal] for Mac OS X and the cross-platform [http://www.mozilla.org/projects/calendar/ Mozilla Calendar]. [http://kdepim.kde.org/components/korganizer.php Korganiser] (the calendar application of the [http://www.kde.org/ KDE] project) and [http://www.novell.com/de-de/products/desktop/features/evolution.html Evolution] also support iCalendar.
1851
1852To subscribe to the roadmap, copy the iCalendar link from the roadmap (found at the bottom of the page) and choose the "Subscribe to remote calendar" action (or similar) of your calendar application, and insert the URL just copied.
1853
1854''''''Note:'''''' For tickets to be included in the calendar as tasks, you need to be logged in when copying the link. You will only see tickets assigned to yourself, and associated with a milestone.
1855
1856More information about iCalendar can be found at [http://en.wikipedia.org/wiki/ICalendar Wikipedia].
1857----
1858See also: TracTickets, TracReports, TracQuery, TracGuide', NULL, NULL);
1859INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracRss', 1, 1132114161, 'trac', '127.0.0.1', '= Using RSS with Trac =
1860[[TracGuideToc]]
1861
1862Several of the Trac modules support content syndication using the RSS (Really Simple Syndication) XML format.
1863Using the RSS subscription feature in Trac, you can easily monitor progress of the project, a set of issues or even changes to a single file .
1864
1865Trac supports RSS feeds in:
1866
1867 * TracTimeline --  Use the RSS feed to ''''''subscribe to project events''''''.[[br]]Monitor overall project progress in your favorite RSS reader.
1868 * TracReports and TracQuery -- Allows syndication of report and ticket query results.[[br]]Be notified about important and relevant issue tickets.
1869 * TracBrowser -- Syndication of file changes.[[br]]Stay up to date with changes to a specific file or directory.
1870
1871== How to access RSS data ==
1872Anywhere in Trac where RSS is available, you should find a small orange ''''''XML'''''' icon, typically placed at the bottom of the page. Clicking the icon will access the RSS feed for that specific resource.
1873
1874''''''Note:'''''' Different modules provide different data in their RSS feeds. Usually, the syndicated information corresponds to the current view. For example, if you click the RSS link on a report page, the feed will be based on that report. It might be explained by thinking of the RSS feeds as an ''''alternate view of the data currently displayed''''.
1875
1876== Links ==
1877 * http://blogs.law.harvard.edu/tech/rss -- RSS 2.0 Specification
1878 * http://www.mozilla.org/products/firefox/ -- Mozilla Firefox supports [http://www.mozilla.org/products/firefox/live-bookmarks.html live bookmarks] using RSS
1879 * http://sage.mozdev.org -- Sage RSS and Atom feed aggregator for Mozilla Firefox
1880 * http://www.rssreader.com/ -- Free and powerful RSS Reader for Windows
1881 * http://liferea.sourceforge.net/ -- Open source GTK2 RSS Reader for Linux
1882 * http://akregator.sourceforge.net/ -- Open source KDE RSS Reader (will be part of KDE-PIM 3.4)
1883 * http://www.sharpreader.net/ -- A free RSS Reader written in .NET for Windows
1884----
1885See also: TracGuide, TracTimeline, TracReports, TracBrowser', NULL, NULL);
1886INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracSearch', 1, 1132114161, 'trac', '127.0.0.1', '= Using Search =
1887
1888Trac has a built-in search engine to allow finding occurrences of keywords and substrings in wiki pages, tickets and changeset descriptions.
1889
1890Using the Trac search facility is straightforward and its interface should be familiar to most www users.
1891
1892Apart from the [search: Search module], you will also find a small search field above the navigation bar at all time. It provides convenient access to the search module from all pages.
1893
1894== Quickjumps ==
1895For intermediate and advanced use, Trac has a useful way to quickly navigate to a given resource, named ''''''quickjumps''''''.
1896
1897If you enter a [wiki:TracLinks TracLink] in the search field above the navigation bar, Trac will recognize this and assume you know where you''re going.
1898
1899For example:
1900
1901 * ![42] -- Opens change set 42
1902 * !#42 -- Opens ticket number 42
1903 * !{1} -- Opens report 1
1904
1905''''''Note:'''''' ''''This is a particularly useful feature to quickly navigate to a specific issue ticket or changeset.''''
1906
1907=== Advanced: Disabling Quickjumps ===
1908To disable the quickjump feature for a search keyword - for example when searching for occurences of the literal word !TracGuide - begin the query with an exclamation mark (!).
1909
1910----
1911See also: TracGuide, TracLinks, TracQuery', NULL, NULL);
1912INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracStandalone', 1, 1132114161, 'trac', '127.0.0.1', '= Tracd =
1913
1914Tracd is a lightweight standalone Trac web server. In most cases it''s easier to setup and runs faster than the [wiki:TracCgi CGI script].
1915
1916== Pros ==
1917
1918 * Fewer dependencies: You don''t need to install apache or any other web-server.
1919 * Fast: Should be as fast as the [wiki:TracModPython mod_python] version (and much faster than the [wiki:TracCgi CGI]).
1920
1921== Cons ==
1922
1923 * Less features: Tracd implements a very simple web-server and is not as configurable as Apache HTTPD.
1924 * No native HTTPS support: [http://www.rickk.com/sslwrap/ sslwrap] can be used instead,
1925   or [http://lists.edgewall.com/archive/trac/2005-August/004381.html STUNNEL].
1926
1927== Usage examples ==
1928
1929A single project on port 8080. (http://localhost:8080/)
1930{{{
1931 $ tracd -p 8080 /path/to/project
1932}}}
1933With more than one project. (http://localhost:8080/project1/ and http://localhost:8080/project2/)
1934{{{
1935 $ tracd -p 8080 /path/to/project1 /path/to/project2
1936}}}
1937
1938You can''t have the last portion of the path identical between the projects since that''s how trac keeps the URLs of the
1939different projects unique. So if you use /project1/path/to and /project2/path/to, you will only see the second project.
1940
1941== Using Authentication ==
1942
1943Tracd provides support for both Basic and Digest authentication. The default is to use Digest; to use Basic authentication, replace `--auth` with `--basic-auth` in the examples below, and omit the realm.
1944
1945If the file `/path/to/users.htdigest` contain user accounts for project1 with the realm "mycompany.com", you''d use the following command-line to start tracd:
1946{{{
1947 $ tracd -p 8080 --auth project1,/path/to/users.htdigest,mycompany.com /path/to/project1
1948}}}
1949''''Note that the project “name” passed to the `--auth` option is actually the base name of the project environment directory.""
1950
1951Of course, the digest file can be be shared so that it is used for more than one project:
1952{{{
1953 $ tracd -p 8080
1954   --auth project1,/path/to/users.htdigest,mycompany.com
1955   --auth project2,/path/to/users.htdigest,mycompany.com
1956   /path/to/project1 /path/to/project2
1957}}}
1958
1959== Generating Passwords Without Apache ==
1960
1961If you don''t have Apache available, you can use this simple Python script to generate your passwords:
1962
1963{{{
1964from optparse import OptionParser
1965import md5
1966
1967# build the options
1968usage = "usage: %prog [options]"
1969parser = OptionParser(usage=usage)
1970parser.add_option("-u", "--username",action="store", dest="username", type = "string",
1971                  help="the username for whom to generate a password")
1972parser.add_option("-p", "--password",action="store", dest="password", type = "string",
1973                  help="the password to use")
1974(options, args) = parser.parse_args()
1975
1976# check options
1977if (options.username is None) or (options.password is None):
1978   parser.error("You must supply both the username and password")
1979   
1980# Generate the string to enter into the htdigest file
1981realm = ''trac''
1982kd = lambda x: md5.md5('':''.join(x)).hexdigest()
1983print '':''.join((options.username, realm, kd([options.username, realm, options.password])))
1984}}}
1985
1986----
1987See also: TracInstall, TracCgi, TracModPython, TracGuide
1988', NULL, NULL);
1989INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracSupport', 1, 1132114161, 'trac', '127.0.0.1', '= Trac Support =
1990
1991Like in most [http://www.opensource.org/ open source projects], "free" Trac support is available primarily through the community itself, mainly through the [http://projects.edgewall.com/trac/wiki/MailingList mailing list] and the project wiki.
1992
1993There is also an [http://projects.edgewall.com/trac/wiki/IrcChannel IRC channel], where people might be able to help out. Much of the ''live'' development discussions also happen there.
1994
1995Before you start a new support query, make sure you''ve done the appropriate searching:
1996 * in the project''s [http://projects.edgewall.com/trac/wiki/TracFaq FAQ]
1997 * in past messages to the Trac [http://blog.gmane.org/gmane.comp.version-control.subversion.trac.general?set_user_css=http%3A%2F%2Fwww.edgewall.com%2Fcss%2Fgmane.css&do_set_user_css=t Mailing List]
1998 * in the Trac ticket system, using either a [http://projects.edgewall.com/trac/search?q=&ticket=on&wiki=on full search] or a [http://projects.edgewall.com/trac/query?summary=~&keywords=~" ticket query].
1999
2000----
2001See also: [http://projects.edgewall.com/trac/wiki/MailingList MailingList]
2002', NULL, NULL);
2003INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracSyntaxColoring', 1, 1132114161, 'trac', '127.0.0.1', '= Syntax Coloring of Source Code =
2004Trac supports language-specific syntax highlighting of source code in [wiki:WikiFormatting wiki formatted] text and the [wiki:TracBrowser repository browser].
2005
2006To do this, Trac uses external libraries with support for a great number of programming languages.
2007
2008Currently Trac supports syntax coloring using one or more of the following packages:
2009
2010 * [http://people.ssh.fi/mtr/genscript/ GNU Enscript]
2011 * [http://silvercity.sourceforge.net/ SilverCity]
2012
2013To activate syntax coloring, simply install either one (or more) of these packages. No additional configuration is required, however to modify the colors, have a look at `trac/htdocs/css/code.css`.
2014
2015When in use, Trac will automatically prioritize !SilverCity highlighting over Enscript if possible, (see note below).
2016
2017If neither package is available, Trac will display the data as plain text.
2018
2019''''''Note:'''''' Enscript supports a greater number of languages, however !SilverCity is generally faster since it is a library and isn''t executed in an external process.
2020
2021=== About SilverCity ===
2022!SilverCity uses the lexer from [http://www.scintilla.org/ Scintilla]. Scintilla supports more languages than !SilverCity implements. If you want to add a language to !SilverCity supported by Scintilla, it''s not very difficult. See [http://projects.edgewall.com/trac/wiki/SilverCityAddLanguage SilverCityAddLanguage] for some information how.
2023
2024
2025== Syntax Coloring Support ==
2026
2027|| || !SilverCity || Enscript ||
2028|| Ada      ||   || X ||
2029|| Asm      ||   || X ||
2030|| * ASP    || X || X ||
2031|| * C      || X || X ||
2032|| * C++    || X || X ||
2033|| * Java   ||   || X ||
2034|| Awk      ||   || X ||
2035|| CSS      || X ||   ||
2036|| Diff     ||   || X ||
2037|| Eiffel   ||   || X ||
2038|| Elisp    ||   || X ||
2039|| Fortran  ||   || X ||
2040|| Haskell  ||   || X ||
2041|| HTML     || X || X ||
2042|| IDL      ||   || X ||
2043|| Javascript || X || X ||
2044
2045|| m4       ||   || X ||
2046|| Makefile ||   || X ||
2047|| Matlab   ||   || X ||
2048|| Objective-C|| || X ||
2049|| Pascal   ||   || X ||
2050|| * Perl   || X || X ||
2051|| * PHP    || X || X ||
2052|| PSP      || X ||   ||
2053|| Pyrex    ||   || X ||
2054|| * Python || X || X ||
2055|| * Ruby   || X || X (1) ||
2056|| Scheme   ||   || X ||
2057|| Shell    ||   || X ||
2058|| SQL      || X || X ||
2059|| Troff    ||   || X ||
2060|| TCL      ||   || X ||
2061|| Tex      ||   || X ||
2062|| Verilog  ||   || X ||
2063|| VHDL     ||   || X ||
2064|| Visual Basic |||| X ||
2065|| VRML     ||   || X ||
2066|| XML      || X || X ||
2067
2068''''(*) Supported as inline code blocks in [wiki:WikiFormatting Wiki text] using WikiProcessors.''''
2069
2070''''(1) Ruby highlighting is not included in the Enscript distribution.  Highlighting rules for Ruby can be obtained from: http://neugierig.org/software/ruby/
2071
2072== Extra Software ==
2073 * GNU Enscript -- http://people.ssh.fi/mtr/genscript/
2074 * !SilverCity -- http://silvercity.sf.net/
2075
2076----
2077See also: WikiProcessors, WikiFormatting, TracWiki, TracBrowser', NULL, NULL);
2078INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracTickets', 1, 1132114161, 'trac', '127.0.0.1', '= The Trac Ticket System =
2079[[TracGuideToc]]
2080
2081The Trac issue database provides simple but effective tracking of issues and bugs within a project.
2082
2083As the central project management element of Trac, tickets are used for ''''''project tasks'''''', ''''''feature requests'''''', ''''''bug reports'''''' and ''''''software support issues''''''.
2084
2085As with the TracWiki, this subsystem has been designed with the goal of making user contribution and participation as simple as possible. It should be as easy as possible to report bugs, ask questions and suggest improvements.
2086
2087An issue is assigned to a person who must resolve it or reassign the ticket to someone else.
2088All tickets can be edited, annotated, assigned, prioritized and discussed at any time.
2089
2090''''''Note:'''''' To make full use of the ticket system, use it as an ''''in bucket'''' for ideas and tasks for your project, rather than just bug/fault reporting.
2091
2092== Ticket Fields ==
2093
2094A  ticket contains the following information attributes:
2095 
2096 * ''''''Reporter'''''' - The author of the ticket.
2097 * ''''''Type'''''' - The nature of the ticket (for example, defect or enhancement request)
2098
2099 * ''''''Component'''''' - The project module or subsystem this ticket concerns.
2100 * ''''''Version'''''' - Version of the project that this ticket pertains to.
2101 * ''''''Keywords'''''' - Keywords that a ticket is marked with.  Useful for searching and report generation.
2102
2103 * ''''''Priority'''''' - The importance of this issue, ranging from ''''trivial'''' to ''''blocker''''.
2104 * ''''''Milestone'''''' - When this issue should be resolved at the latest.
2105 * ''''''Assigned to/Owner'''''' - Principal person responsible for handling the issue.
2106 * ''''''Cc'''''' - A list of other associated people. ''''Note that this does not imply responsiblity or any other policy.''''
2107 
2108 * ''''''Resolution'''''' - Reason for why a ticket was closed. One of {{{fixed}}}, {{{invalid}}}, {{{wontfix}}}, {{{duplicate}}}, {{{worksforme}}}.
2109 * ''''''Status'''''' - What is the current status? One of {{{new}}}, {{{assigned}}}, {{{closed}}}, {{{reopened}}}.
2110 * ''''''Summary'''''' - A brief description summarizing the problem or issue.
2111 * ''''''Description'''''' - The body of the ticket. A good description should be specific, descriptive and to the point.
2112
2113''''''Note:'''''' Versions of Trac prior to 0.9 did not have the ''''type'''' field, but instead provided a ''''severity'''' field and different default values for the ''''priority'''' field. This change was done to simplify the ticket model by removing the somewhat blurry distinction between ''''priority'''' and ''''severity''''. However, the old model is still available if you prefer it: just add/modify the default values of the ''''priority'''' and ''''severity'''', and optionally hide the ''''type'''' field by removing all the possible values through [wiki:TracAdmin trac-admin].
2114
2115
2116== Changing and Commenting Tickets ==
2117
2118Once a ticket has been entered into Trac, you can at any time change the
2119information by ''''''annotating'''''' the bug. This means changes and comments to
2120the ticket are logged as a part of the ticket itself.
2121
2122When viewing a ticket, the history of changes will appear below the main ticket area.
2123
2124''''In the Trac project, we use ticket comments to discuss issues and tasks. This makes
2125understanding the motivation behind a design- or implementation choice easier,
2126when returning to it later.''''
2127
2128''''''Note:'''''' An important feature is being able to use TracLinks and
2129WikiFormatting in ticket descriptions and comments. Use TracLinks to refer to
2130other issues, changesets or files to make your ticket more specific and easier
2131to understand.
2132
2133''''''Note:'''''' See TracNotification for how to configure email notifications of ticket changes.
2134
2135=== State Diagram ===
2136http://projects.edgewall.com/trac/attachment/wiki/TracTickets/Trac%20Ticket%20State%20Chart%2020040607DF.png?format=raw
2137
2138
2139== Default Values for Drop-Down Fields ==
2140
2141The option selected by default for the various drop-down fields can be set in [wiki:TracIni trac.ini], in the `[ticket]` section:
2142
2143 * `default_type`: Default ticket type
2144 * `default_component`: Name of the component selected by default
2145 * `default_version`: Name of the default version
2146 * `default_milestone`: Name of the default milestone
2147 * `default_priority`: Default priority value
2148 * `default_severity`: Default severity value
2149
2150If any of these options are omitted, the default value will either be the first in the list, or an empty value, depending on whether the field in question is required to be set.
2151
2152
2153== Hiding Fields and Adding Custom Fields ==
2154
2155Many of the default ticket fields can be hidden from the ticket web interface simply by removing all the possible values through [wiki:TracAdmin trac-admin]. This of course only applies to drop-down fields, such as ''''type'''', ''''priority'''', ''''severity'''', ''''component'''', ''''version'''' and ''''milestone''''.
2156
2157Trac also lets you add your own custom ticket fields. See TracTicketsCustomFields for more information.
2158
2159
2160== Assign-to as Drop-Down List ==
2161
2162If the list of possible ticket owners is finite, you can change the ''''assign-to'''' ticket field from a text input to a drop-down list. This is done by setting the `restrict_owner` option of the `[ticket]` section in [wiki:TracIni trac.ini] to “true”. In that case, Trac will use the list of all users who have logged in and set their email address to populate the drop-down field.
2163
2164''''Note that this feature is ''''''still experimental as of version 0.9''''''. There is no way to only display a subset of all known users as possible ticket owners. Nor is there a convenient way to remove emeritus users short of directly modifying the database.''''
2165
2166
2167== Preset Values for New Tickets ==
2168
2169To create a link to the new-ticket form filled with preset values, you need to call the `/newticket?` URL with variable=value separated by &.
2170
2171Possible variables are :
2172
2173 * ''''''reporter'''''' - Name or email of the reporter
2174 * ''''''summary'''''' - Summary line for the ticket
2175 * ''''''description'''''' - Long description of the ticket
2176 * ''''''component'''''' - The component droplist
2177 * ''''''version'''''' - The version droplist
2178 * ''''''severity'''''' - The severity droplist
2179 * ''''''keywords'''''' - The keywords
2180 * ''''''priority'''''' - The priority droplist
2181 * ''''''milestone'''''' - The milestone droplist
2182 * ''''''owner'''''' - The person responsible for the ticket
2183 * ''''''cc'''''' - The list of emails for notifying about the ticket change
2184
2185''''''Example:'''''' ''''/trac/newticket?summary=Compile%20Error&version=1.0&component=gui''''
2186
2187
2188See also:  TracGuide, TracWiki, TracTicketsCustomFields, TracNotification', NULL, NULL);
2189INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracTicketsCustomFields', 1, 1132114161, 'trac', '127.0.0.1', '= Custom Ticket Fields =
2190Trac supports adding custom, user-defined fields to the ticket module. Using custom fields, you can add typed, site-specific properties to tickets.
2191
2192== Configuration ==
2193Configuring custom ticket fields is done in the [wiki:TracIni trac.ini] file. All field definitions should be under a section named `[ticket-custom]`.
2194
2195The syntax of each field definition is:
2196{{{
2197 FIELD_NAME = TYPE
2198 (FIELD_NAME.OPTION = VALUE)
2199 ...
2200}}}
2201The example below should help to explain the syntax.
2202
2203=== Available Field Types and Options ===
2204 * ''''''text'''''': A simple (one line) text field.
2205   * label: Descriptive label.
2206   * value: Default value.
2207   * order: Sort order placement. (Determines relative placement in forms.)
2208 * ''''''checkbox'''''': A boolean value check box.
2209   * label: Descriptive label.
2210   * value: Default value (0 or 1).
2211   * order: Sort order placement.
2212 * ''''''select'''''': Drop-down select box. Uses a list of values.
2213   * options: List of values, separated by ''''''|'''''' (vertical pipe).
2214   * value: Default value (Item #, starting at 0).
2215   * order: Sort order placement.
2216 * ''''''radio'''''': Radio buttons. Essentially the same as ''''''select''''''.
2217   * label: Descriptive label.
2218   * options: List of values, separated by ''''''|'''''' (vertical pipe).
2219   * value: Default value (Item #, starting at 0).
2220   * order: Sort order placement.
2221 * ''''''textarea'''''': Multi-line text area.
2222   * label: Descriptive label.
2223   * value: Default text.
2224   * cols: Width in columns.
2225   * rows: Height in lines.
2226   * order: Sort order placement.
2227
2228=== Sample Config ===
2229{{{
2230[ticket-custom]
2231
2232test_one = text
2233test_one.label = Just a text box
2234
2235test_two = text
2236test_two.label = Another text-box
2237test_two.value = Just a default value
2238
2239test_three = checkbox
2240test_three.label = Some checkbox
2241test_three.value = 1
2242
2243test_four = select
2244test_four.label = My selectbox
2245test_four.options = one|two|third option|four
2246test_four.value = 2
2247
2248test_five = radio
2249test_five.label = Radio buttons are fun
2250test_five.options = uno|dos|tres|cuatro|cinco
2251test_five.value = 1
2252
2253test_six = textarea
2254test_six.label = This is a large textarea
2255test_six.value = Default text
2256test_six.cols = 60
2257test_six.rows = 30
2258}}}
2259
2260''''Note: To make an entering an option for a `select` type field optional, specify a leading `|` in the `fieldname.options` option.''''
2261
2262=== Reports Involving Custom Fields ===
2263
2264The SQL required for TracReports to include custom ticket fields is relatively hard to get right. You need a `JOIN` with the `ticket_custom` field for every custom field that should be involved.
2265
2266The following example includes a custom ticket field named `progress` in the report:
2267{{{
2268#!sql
2269SELECT p.value AS __color__,
2270   id AS ticket, summary, component, version, milestone, severity,
2271   (CASE status WHEN ''assigned'' THEN owner||'' *'' ELSE owner END) AS owner,
2272   time AS created,
2273   changetime AS _changetime, description AS _description,
2274   reporter AS _reporter,
2275  (CASE WHEN c.value = ''0'' THEN ''None'' ELSE c.value END) AS progress
2276  FROM ticket t
2277     LEFT OUTER JOIN ticket_custom c ON (t.id = c.ticket AND c.name = ''progress'')
2278     JOIN enum p ON p.name = t.priority AND p.type=''priority''
2279  WHERE status IN (''new'', ''assigned'', ''reopened'')
2280  ORDER BY p.value, milestone, severity, time
2281}}}
2282
2283Note in particular the `LEFT OUTER JOIN` statement here.
2284
2285----
2286See also: TracTickets, TracIni', NULL, NULL);
2287INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracTimeline', 1, 1132114161, 'trac', '127.0.0.1', '= The Trac Timeline =
2288[[TracGuideToc]]
2289
2290The timeline provides a historic view of the project in a single report.
2291
2292It lists all Trac events that have occured in chronological order, a
2293brief description of each event and if applicable, the person responsible for
2294the change.
2295
2296The timeline lists these kinds of events:
2297 * ''''''Wiki page events'''''' -- Creation and changes
2298 * ''''''Ticket events'''''' -- Creation and resolution/closing (and optionally other changes)
2299 * ''''''Source code changes '''''' -- Repository check-ins
2300 * ''''''Milestone '''''' -- Milestone completed
2301
2302Each event entry provides a hyperlink to the specific event in question, as well as
2303a brief excerpt of the actual comment or text, if available.
2304
2305== RSS Support ==
2306
2307The Timeline module supports subscription using RSS 2.0 syndication. To subscribe to project events, click orange ''''''XML'''''' icon at the bottom of the page. See TracRss for more information on RSS support in Trac.
2308
2309----
2310See also: TracGuide, TracWiki, WikiFormatting, TracRss, TracNotification', NULL, NULL);
2311INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracUnicode', 1, 1132114161, 'trac', '127.0.0.1', '= Unicode Support in Trac =
2312Trac stores all text using UTF-8 encoding, including text in tickets and wiki pages.
2313
2314As such, it supports most (all?) commonly used character encodings.
2315
2316
2317== Examples ==
2318Please keep sorted order when you add an entry.
2319
2320=== Arabic ===
2321تراك يقوم بحفظ كل الكلمات باستخدام صيغة UTF-8، بما في ذلك الكلمات المستخدمة في صفحات  التيكت والويكي.
2322
2323=== Bulgarian ===
2324Българският език работи ли?
2325
2326=== Česky ===
2327Čeština v kódování UTF-8, žádný problém.
2328
2329=== Chinese ===
2330Traditional: ''''繁體中文, 許功蓋會育''''; Simplified: ''''简体中文,许功盖会育''''
2331
2332=== English ===
2333Yes indeed, Trac supports English. Fully.
2334
2335=== Français ===
2336''''Il est possible d''écrire en Français : à, ç, û, ...''''
2337
2338=== German ===
2339Trac-Wiki muß auch deutsche Umlaute richtig anzeigen: ö, ä, ü, ...
2340
2341=== Greek ===
2342Τα Ελληνικά υποστηρίζονται επαρκώς επίσης.
2343
2344=== Hebrew ===
2345אני יכול לאכול זכוכית וזה לא מזיק לי
2346
2347=== Icelandic ===
2348''''Ævar sagði við ömmu sína: Sjáðu hvað ég er stór!''''
2349
2350=== Japanese ===
2351''''漢字 ひらがな カタカナ ハンカクカナ''''
2352
2353=== Korean ===
2354''''이번에는 한글로 써보겠습니다. 잘 보이나요?''''
2355
2356=== Persian (Farsi) ===
2357این یک متن فارسی است ولی از چپ به راست
2358
2359=== Polish ===
2360Pchnąć w tę łódź jeża lub ośm skrzyń fig
2361
2362=== Portuguese ===
2363É possível guardar caracteres especias da língua portuguesa, incluindo o símbolo da moeda européia ''€'', trema ''ü'', crase ''à'', agudos ''áéíóú'', circunflexos ''âêô'', til ''ãõ'', cedilha ''ç'', ordinais ''ªº'', grau ''°¹²³''.
2364
2365=== Russian ===
2366Проверка русского языка: кажется работает...
2367
2368=== Serbian ===
2369Podržan, uprkos činjenici da se za njegovo pisanje koriste чак два алфабета.
2370
2371=== Slovenian ===
2372Ta suhi škafec pušča vodo že od nekdaj!
2373
2374=== Spanish ===
2375Esto es un pequeño texto en Español, ahora una con acentó
2376
2377=== Swedish ===
2378''''Räven raskar över isen med luva på.''''
2379
2380=== Thai ===
2381Trac แสดงภาษาไทยได้อย่างถูกต้อง!
2382
2383=== Ukrainian ===
2384Перевірка української мови...', NULL, NULL);
2385INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracUpgrade', 1, 1132114161, 'trac', '127.0.0.1', '= Upgrade Instructions =
2386[[TracGuideToc]]
2387
2388A Trac environment sometimes needs to be upgraded before it can be used with a new version of Trac. This document describes the steps necessary to upgrade an environment.
2389
2390 ''''''Note'''''': ''''Environment upgrades are not necessary for minor version releases unless otherwise noted. For example, there''s no need to upgrade a Trac environment created with (or upgraded) 0.8.0 when installing 0.8.4 (or any other 0.8.x release).''''
2391
2392== General Instructions ==
2393
2394Typically, there are four steps involved in upgrading to a newer version of Trac:
2395
2396=== Update the Trac Code ===
2397
2398Get the new version of Trac, either by downloading an offical release package or by checking it out from the [http://projects.edgewall.com/trac/wiki/SubversionRepository Subversion repository].
2399
2400If you have a source distribution, you need to run
2401{{{
2402python setup.py install
2403}}}
2404
2405to install the new version. If you''ve downloaded the Windows installer, you execute it, and so on.
2406
2407In any case, if you''re doing a major version upgrade (such as from 0.8 to 0.9), it is ''''highly'''' recommended that you first remove the existing Trac code. To do this, you need to delete the `trac` directory from the Python `lib/site-packages` directory. You may also want to remove the Trac `cgi-bin`, `htdocs` and `templates` directories that are commonly found in a directory called `share/trac` (the exact location depends on your platform).
2408
2409=== Upgrade the Trac Environment ===
2410
2411Unless noted otherwise, upgrading between major versions (such as 0.8 and 0.9) involves changes to the database schema, and possibly the layout of the [wiki:TracEnvironment environment directory]. Fortunately, Trac provides automated upgrade scripts to ease the pain. These scripts are run via [wiki:TracAdmin trac-admin]:
2412{{{
2413trac-admin /path/to/projenv upgrade
2414}}}
2415
2416This command will do nothing if the environment is already up-to-date.
2417
2418Note that if you are using a PostgreSQL database, this command will fail with the message that the environment can only be backed up when you use an SQLite database. This means that you will have to backup the repository and the database manually. Then, to perform the actual upgrade, run:
2419{{{
2420trac-admin /path/to/projenv upgrade --no-backup
2421}}}
2422
2423=== Update the Trac Documentation ===
2424
2425Every [wiki:TracEnvironment Trac environment] includes a copy of the Trac documentation for the installed version. As you probably want to keep the included documentation in sync with the installed version of Trac, [wiki:TracAdmin trac-admin] provides a command to upgrade the documentation:
2426{{{
2427trac-admin /path/to/projenv wiki upgrade
2428}}}
2429
2430Note that this procedure will of course leave your `WikiStart` page intact.
2431
2432=== Restart the Web Server ===
2433
2434In order to reload the new Trac code you will need to restart your web server (note this is not necessary for [wiki:TracCgi CGI]).
2435
2436== Specific Versions ==
2437
2438The following sections discuss any extra actions that may need to be taken to upgrade to specific versions of Trac.
2439
2440== From 0.9-beta to 0.9 ==
2441
2442If inclusion of the static resources (style sheets, javascript, images) is not working, check the value of the `htdocs_location` in trac.ini. For [wiki:TracModPython mod_python], [wiki:TracStandalone Tracd] and [wiki:TracFastCgi FastCGI], you can simply remove the option altogether. For [wiki:TracCgi CGI], you should fix it to point to the URL you mapped the Trac `htdocs` directory to (although you can also remove it and then [wiki:TracCgi#MappingStaticResources map the static resources]). If you''re still having problems after removing the option, check the paths in the `trac/siteconfig.py` file and fix them if they''re incorrect.
2443
2444If you''ve been using plugins with a beta release of Trac 0.9, or have disabled some of the built-in components, you might have to update the rules for disabling/enabling components in [wiki:TracIni trac.ini]. In particular, globally installed plugins now need to be enabled explicitly. See TracPlugins and TracIni for more information.
2445
2446If you want to enable the display of all ticket changes in the timeline (the “Ticket Details” option), you now have to explicitly enable that in [wiki:TracIni trac.ini], too:
2447
2448{{{
2449[timeline]
2450ticket_show_details = true
2451}}}
2452
2453== From 0.8.x to 0.9 ==
2454
2455[wiki:TracModPython mod_python] users will also need to change the name of the mod_python handler in the Apache HTTPD configuration:
2456{{{
2457   from: PythonHandler trac.ModPythonHandler
2458   to:   PythonHandler trac.web.modpython_frontend
2459}}}
2460
2461If you have [http://initd.org/tracker/pysqlite PySQLite] 2.x installed, Trac will now try to open your SQLite database using the SQLite 3.x file format. The database formats used by SQLite 2.8.x and SQLite 3.x are incompatible. If you get an error like ''''“file is encrypted or is not a database”'''' after upgrading, then you must convert your database file.
2462
2463To do this, you need to have both SQLite 2.8.x and SQLite 3.x installed (they have different filenames so can coexist on the same system). Then use the following commands:
2464{{{
2465 $ mv trac.db trac2.db
2466 $ sqlite trac2.db .dump | sqlite3 trac.db
2467}}}
2468
2469After testing that the conversion was successful, the `trac2.db` file can be deleted. For more information on the SQLite upgrade see http://www.sqlite.org/version3.html.
2470
2471== From 0.7.x to 0.8 ==
2472
24730.8 adds a new roadmap feature which requires additional permissions. While a
2474fresh installation will by default grant ROADMAP_VIEW and MILESTONE_VIEW
2475permissions to anonymous, these permissions have to be granted manually when
2476upgrading:
2477{{{
2478 $ trac-admin /path/to/projectenv permission add anonymous MILESTONE_VIEW
2479 $ trac-admin /path/to/projectenv permission add anonymous ROADMAP_VIEW
2480}}}
2481
2482-----
2483See also: TracGuide, TracInstall
2484', NULL, NULL);
2485INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('TracWiki', 1, 1132114161, 'trac', '127.0.0.1', '= The Trac Wiki Engine =
2486[[TracGuideToc]]
2487
2488Trac has a built-in wiki engine, used for text and documentation throughout the system. WikiFormatting is used in [wiki:TitleIndex wiki pages], [wiki:TracTickets tickets] and [wiki:TracChangeset check-in log messages].  This allows for formatted text and hyperlinks in and between all Trac modules.
2489
2490Editing wiki text is easy, using any web browser and a simple formatting system (see WikiFormatting), rather than more complex markup languages like HTML.  The reasoning behind its design is that HTML, with its large collection of nestable tags, is too complicated to allow fast-paced editing, and distracts from the actual content of the pages. Note though that Trac also supports [wiki:WikiHtml HTML] and [wiki:WikiRestructuredText reStructuredText] as alternative markup formats.
2491
2492The main goal of the wiki is making editing text easier and ''''encourage'''' people to contribute and annotate text content for a project.
2493
2494The wiki itself does not enforce any structure, but rather resembles a stack of empty paper sheets, where you can organize information and documentation as you see fit, and later reorganize if necessary.
2495
2496For more help on editing wiki text, see:
2497 * WikiFormatting
2498 * WikiPageNames
2499 * WikiNewPage
2500 * TracLinks
2501 * WikiMacros
2502 * WikiProcessors
2503
2504If you want to practice editing, please use the SandBox.
2505
2506Some more information about wiki on the web:
2507 * http://wikipedia.org/wiki/Wiki
2508 * http://c2.com/cgi/wiki?WikiHistory
2509 * http://www.usemod.com/cgi-bin/mb.pl?WhyWikiWorks
2510', NULL, NULL);
2511INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiDeletePage', 1, 1132114161, 'trac', '127.0.0.1', '= Deleting a Wiki Page =
2512
2513Existing wiki pages can be completely deleted using the ''''Delete Page'''' or the ''''Delete this Version'''' buttons at the bottom of the wiki page. These buttons are only visible for users with `WIKI_DELETE` permissions.
2514
2515''''''Note:'''''' This is an irreversible operation.
2516
2517In general, it is recommended to create redirection pages instead of completely deleting an old page, as to not frustrate the visitor with broken links when coming to the site from a search engine. A redirection page is a short page that  contains a link such as  “See !SomeOtherPage”. However, deleting specific versions or even complete pages can make sense to remove spam or other abuse.
2518
2519----
2520See also: TracWiki, TracPermissions
2521', NULL, NULL);
2522INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiFormatting', 1, 1132114161, 'trac', '127.0.0.1', '= WikiFormatting =
2523[[TracGuideToc]]
2524
2525Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a flexible and powerful whole.
2526
2527Trac has a built in small and powerful wiki rendering engine. This wiki engine implements an ever growing subset of the commands from other popular Wikis,
2528especially [http://moinmoin.wikiwikiweb.de/ MoinMoin].
2529
2530
2531This page demonstrates the formatting syntax available anywhere WikiFormatting is allowed.
2532
2533
2534== Font Styles ==
2535
2536The Trac wiki supports the following font styles:
2537{{{
2538 * ''''''bold''''''
2539 * ''''italic''''
2540 * ''''''''''bold italic''''''''''
2541 * __underline__
2542 * {{{monospace}}} or `monospace`
2543 * ~~strike-through~~
2544 * ^superscript^
2545 * ,,subscript,,
2546}}}
2547
2548Display:
2549 * ''''''bold''''''
2550 * ''''italic''''
2551 * ''''''''''bold italic''''''''''
2552 * __underline__
2553 * {{{monospace}}} or `monospace`
2554 * ~~strike-through~~
2555 * ^superscript^
2556 * ,,subscript,,
2557
2558Note that the `{{{...}}}` and {{{`...`}}} commands not only select a monospace font, but also treat their content as verbatim text, meaning that no further wiki processing is done on this text.
2559
2560== Headings ==
2561
2562You can create heading by starting a line with one up to five ''''equal'''' characters ("=")
2563followed by a single space and the headline text. The line should end with a space
2564followed by the same number of ''''='''' characters.
2565
2566Example:
2567{{{
2568= Heading =
2569== Subheading ==
2570=== About ''''this'''' ===
2571}}}
2572
2573Display:
2574= Heading =
2575== Subheading ==
2576=== About ''''this'''' ===
2577
2578
2579== Paragraphs ==
2580
2581A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
2582
2583A forced line break can also be inserted, using:
2584{{{
2585Line 1[[BR]]Line 2
2586}}}
2587Display:
2588
2589Line 1[[BR]]Line 2
2590
2591
2592== Lists ==
2593
2594The wiki supports both ordered/numbered and unordered lists.
2595
2596Example:
2597{{{
2598 * Item 1
2599   * Item 1.1
2600 * Item 2
2601
2602 1. Item 1
2603   1. Item 1.1
2604 1. Item 2
2605}}}
2606
2607Display:
2608 * Item 1
2609   * Item 1.1
2610 * Item 2
2611
2612 1. Item 1
2613   1. Item 1.1
2614 1. Item 2
2615
2616Note that there must be one or more spaces preceding the list item markers, otherwise the list will be treated as a normal paragraph.
2617
2618
2619== Definition Lists ==
2620
2621The wiki also supports definition lists.
2622
2623Example:
2624{{{
2625 llama::
2626   some kind of mammal, with hair
2627 ppython::
2628   some kind of reptile, without hair
2629   (can you spot the typo?)
2630}}}
2631
2632Display:
2633 llama::
2634   some kind of mammal, with hair
2635 ppython::
2636   some kind of reptile, without hair
2637   (can you spot the typo?)
2638
2639Note that you need a space in front of the defined term.
2640
2641
2642== Preformatted Text ==
2643
2644Block containing preformatted text are suitable for source code snippets, notes and examples. Use three ''''curly braces'''' wrapped around the text to define a block quote. The curly braces need to be on a separate line.
2645 
2646Example:
2647{{{
2648 {{{
2649  def HelloWorld():
2650      print "Hello World"
2651 }}}
2652}}}
2653
2654Display:
2655{{{
2656 def HelloWorld():
2657     print "Hello World"
2658}}}
2659
2660
2661== Blockquotes ==
2662
2663In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
2664
2665Example:
2666{{{
2667  This text is a quote from someone else.
2668}}}
2669
2670Display:
2671  This text is a quote from someone else.
2672
2673== Tables ==
2674
2675Simple tables can be created like this:
2676{{{
2677||Cell 1||Cell 2||Cell 3||
2678||Cell 4||Cell 5||Cell 6||
2679}}}
2680
2681Display:
2682||Cell 1||Cell 2||Cell 3||
2683||Cell 4||Cell 5||Cell 6||
2684
2685Note that more complex tables can be created using
2686[wiki:WikiRestructuredText#BiggerReSTExample reStructuredText].
2687
2688
2689== Links ==
2690
2691Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
2692
2693Example:
2694{{{
2695 TitleIndex, http://www.edgewall.com/, !NotAlink
2696}}}
2697
2698Display:
2699 TitleIndex, http://www.edgewall.com/, !NotAlink
2700
2701Links can be given a more descriptive title by writing the link followed by a space and a title and all this inside square brackets.  If the descriptive title is omitted, then the explicit prefix is disguarded, unless the link is an external link. This can be useful for wiki pages not adhering to the WikiPageNames convention.
2702
2703Example:
2704{{{
2705 * [http://www.edgewall.com/ Edgewall Software]
2706 * [wiki:TitleIndex Title Index]
2707 * [wiki:ISO9000]
2708}}}
2709
2710Display:
2711 * [http://www.edgewall.com/ Edgewall Software]
2712 * [wiki:TitleIndex Title Index]
2713 * [wiki:ISO9000]
2714
2715
2716=== Trac Links ===
2717
2718Wiki pages can link directly to other parts of the Trac system. Pages can refer to tickets, reports, changesets, milestones, source files and other Wiki pages using the following notations:
2719{{{
2720 * Tickets: #1 or ticket:1
2721 * Reports: {1} or report:1
2722 * Changesets: r1, [1] or changeset:1
2723 * Revision Logs: r1:3, [1:3] or log:branches/0.8-stable#1:3
2724 * Wiki pages: CamelCase or wiki:CamelCase
2725 * Milestones: milestone:1.0 or milestone:"End-of-days Release"
2726 * Files: source:trunk/COPYING
2727 * Attachments: attachment:"file name.doc"
2728 * A specific file revision: source:/trunk/COPYING#200
2729 * A filename with embedded space: source:"/trunk/README FIRST"
2730}}}
2731
2732Display:
2733 * Tickets: #1 or ticket:1
2734 * Reports: {1} or report:1
2735 * Changesets: r1, [1] or changeset:1
2736 * Revision Logs: r1:3, [1:3] or log:branches/0.8-stable#1:3
2737 * Wiki pages: CamelCase or wiki:CamelCase
2738 * Milestones: milestone:1.0 or milestone:"End-of-days Release"
2739 * Files: source:trunk/COPYING
2740 * Attachments: attachment:"file name.doc"
2741 * A specific file revision: source:/trunk/COPYING#200
2742 * A filename with embedded space: source:"/trunk/README FIRST"
2743
2744See TracLinks for more in-depth information.
2745
2746
2747== Escaping Links and WikiPageNames ==
2748
2749You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
2750
2751Example:
2752{{{
2753 !NoHyperLink
2754 !#42 is not a link
2755}}}
2756
2757Display:
2758 !NoHyperLink
2759 !#42 is not a link
2760
2761
2762== Images ==
2763
2764Urls ending with `.png`, `.gif` or `.jpg` are automatically interpreted as image links, and converted to `<img>` tags.
2765
2766Example:
2767{{{
2768http://www.edgewall.com/gfx/trac_example_image.png
2769}}}
2770
2771Display:
2772
2773http://www.edgewall.com/gfx/trac_example_image.png
2774
2775However, this doesn''t give much control over the display mode. This way of inserting images is deprecated in favor of the more powerful `Image` macro (see WikiMacros).
2776
2777
2778== Macros ==
2779
2780Macros are ''''custom functions'''' to insert dynamic content in a page.
2781
2782Example:
2783{{{
2784 [[Timestamp]]
2785}}}
2786
2787Display:
2788 [[Timestamp]]
2789
2790See WikiMacros for more information, and a list of installed macros.
2791
2792
2793== Processors ==
2794
2795Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in
2796[wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].
2797
2798Example 1:
2799{{{
2800#!html
2801<pre class="wiki">{{{
2802#!html
2803&lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
2804}}}</pre>
2805}}}
2806
2807Display:
2808{{{
2809#!html
2810<h1 style="text-align: right; color: blue">HTML Test</h1>
2811}}}
2812
2813Example:
2814{{{
2815#!html
2816<pre class="wiki">{{{
2817#!python
2818class Test:
2819    def __init__(self):
2820        print "Hello World"
2821if __name__ == ''__main__'':
2822   Test()
2823}}}</pre>
2824}}}
2825
2826Display:
2827{{{
2828#!python
2829class Test:
2830    def __init__(self):
2831        print "Hello World"
2832if __name__ == ''__main__'':
2833   Test()
2834}}}
2835
2836Perl:
2837{{{
2838#!perl
2839my ($test) = 0;
2840if ($test > 0) {
2841echo "hello";
2842}
2843}}}
2844
2845See WikiProcessors for more information.
2846
2847
2848== Miscellaneous ==
2849
2850Four or more dashes will be replaced by a horizontal line (<HR>)
2851
2852Example:
2853{{{
2854 ----
2855}}}
2856
2857Display:
2858----
2859
2860
2861----
2862See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring.', NULL, NULL);
2863INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiHtml', 1, 1132114161, 'trac', '127.0.0.1', '= Using HTML in Wiki Text =
2864
2865Trac supports inserting HTML into any wiki context, accomplished using the HTML [wiki:WikiProcessors WikiProcessor].
2866
2867HTML support is built-in, and does not require installing any additional packages.
2868
2869== How to Use HTML ==
2870To inform the wiki engine that a block of text should be treated as HTML, use the ''''html'''' processor.
2871
2872This example should explain:
2873{{{
2874#!html
2875<pre class="wiki">{{{
2876#!html
2877&lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
2878}}}</pre>
2879}}}
2880
2881Results in:
2882{{{
2883#!html
2884<h1 style="text-align: right; color: blue">HTML Test</h1>
2885}}}
2886
2887== More Information ==
2888
2889 * http://www.w3.org/ -- World Wide Web Consortium
2890 * http://www.w3.org/MarkUp/ -- HTML Markup Home Page
2891
2892----
2893See also:  WikiProcessors, WikiFormatting, WikiRestructuredText', NULL, NULL);
2894INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiMacros', 1, 1132114161, 'trac', '127.0.0.1', '=  Wiki Macros =
2895Trac macros are plugins to extend the Trac engine with custom ''functions'' written in Python. A macro inserts dynamic HTML data in any context supporting WikiFormatting.
2896
2897Another kind of macros are WikiProcessors. They typically deal with alternate markup formats and representation of larger blocks of information (like source code highlighting).
2898
2899== Using Macros ==
2900Macro calls are enclosed in two ''''square brackets''''. Like python functions, macros can also have arguments, a comma separated list within parentheses.
2901
2902=== Examples ===
2903
2904{{{
2905 [[Timestamp]]
2906}}}
2907Display:
2908 [[Timestamp]]
2909
2910{{{
2911 [[HelloWorld(Testing)]]
2912}}}
2913Display:
2914 [[HelloWorld(Testing)]]
2915
2916== Available Macros ==
2917
2918''''Note that the following list will only contain the macro documentation if you''ve not enabled `-OO` optimizations, or not set the `PythonOptimize` option for [wiki:TracModPython mod_python].''''
2919
2920[[MacroList]]
2921
2922== Macros from around the world ==
2923The [http://projects.edgewall.com/trac/ Trac Project] has a section dedicated to user-contributed macros, [http://projects.edgewall.com/trac/wiki/MacroBazaar MacroBazaar]. If you''re looking for new macros, or have written new ones to share with the world, don''t hesitate adding it to the [http://projects.edgewall.com/trac/wiki/MacroBazaar MacroBazaar] wiki page.
2924
2925----
2926
2927== Developing Custom Macros ==
2928Macros, like Trac itself, are written in the [http://www.python.org/ Python programming language]. They are very simple modules, identified by the filename and should contain a single ''''entry point'''' function. Trac will display the returned data inserted into the HTML where the macro was called.
2929
2930It''s easiest to learn from an example:
2931{{{
2932#!python
2933# MyMacro.py -- The world''s simplest macro
2934
2935def execute(hdf, args, env):
2936    return "Hello World called with args: %s" % args
2937}}}
2938
2939You can also use the environment (`env`) object, for example to access configuration data and the database, for example:
2940{{{
2941#!python
2942def execute(hdf, txt, env):
2943    return env.get_config(''trac'', ''repository_dir'')
2944}}}
2945
2946Note that since version 0.9, wiki macros can also be written as TracPlugins. This gives them some capabilities than “classic” macros do not have, such as directly access the HTTP request.
2947
2948For more information about developing macros, see the [http://projects.edgewall.com/trac/wiki/TracDev development resources] on the main project site.
2949
2950----
2951See also:  WikiProcessors, WikiFormatting, TracGuide', NULL, NULL);
2952INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiNewPage', 1, 1132114161, 'trac', '127.0.0.1', '= Steps to Add a New Wiki Page =
2953
2954 1. Choose a name for your new page. See WikiPageNames for naming conventions.
2955 1. Edit an existing page and add a hyperlink to your new page. Save your changes.
2956 1. Follow the link you created to take you to the new page. Trac will display a "describe !PageName here" message.
2957 1. Click the "Edit this page" button to edit and add content to your new page. Save your changes.
2958 1. All done. Your new page is published.
2959
2960
2961See also: TracWiki, WikiFormatting, TracLinks, WikiDeletePage
2962', NULL, NULL);
2963INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiPageNames', 1, 1132114161, 'trac', '127.0.0.1', '= Wiki Page Names =
2964
2965Wiki page names are written using CamelCase. Within a wiki text, any word in CamelCase automatically becomes a hyperlink to the wiki page with that same name.
2966
2967Page names must follow these rules:
2968
2969 1. The name must consist of ''''''alphabetic characters only''''''. No digits, spaces, punctuation, or underscores are allowed.
2970 1. A name must have at least two capital letters.
2971 1. The first character must be capitalized.
2972 1. Every capital letter must be followed by one or more lower-case letters.
2973 1. The use of slash ( / ) is permitted to create a hierarchy inside the wiki.  (See !SubWiki and !ParentWiki macros in the [http://projects.edgewall.com/trac/wiki/MacroBazaar MacroBazaar] which provide a way to list all sub-entries and a link up the hierarchy respectively.)
2974
2975If you want to create a wiki page that doesn''t follow CamelCase rules you could use the following syntax:
2976{{{
2977[wiki:Wiki_page]
2978}}}
2979
2980This will be rendered as:
2981 [wiki:Wiki_page]
2982
2983----
2984See also: WikiNewPage, WikiFormatting, TracWiki', NULL, NULL);
2985INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiProcessors', 1, 1132114161, 'trac', '127.0.0.1', '= Wiki Processors =
2986Processors are WikiMacros designed to provide alternative markup formats for the Trac Wiki engine. Processors can be thought of as ''''macro functions to process user-edited text''''.
2987
2988The wiki engine uses processors to allow using [wiki:WikiRestructuredText Restructured Text] and [wiki:WikiHtml raw HTML] in any wiki text throughout Trac.
2989
2990== Using Processors ==
2991To use a processor on a block of text, use a wiki blockquote, selecting a processor by name using ''''shebang notation'''' (#!), familiar to most UNIX users from scripts.
2992
2993''''''Example 1'''''' (''''inserting raw HTML in a wiki text''''):
2994
2995{{{
2996#!html
2997<pre class="wiki">{{{
2998#!html
2999&lt;h1 style="color: orange"&gt;This is raw HTML&lt;/h1&gt;
3000}}}</pre>
3001}}}
3002
3003''''''Results in:''''''
3004{{{
3005#!html
3006<h1 style="color: orange">This is raw HTML</h1>
3007}}}
3008
3009----
3010
3011''''''Example 2'''''' (''''inserting Restructured Text in wiki text''''):
3012
3013{{{
3014#!html
3015<pre class="wiki">{{{
3016#!rst
3017A header
3018--------
3019This is some **text** with a footnote [*]_.
3020
3021.. [*] This is the footnote.
3022}}}</pre>
3023}}}
3024
3025''''''Results in:''''''
3026{{{
3027#!rst
3028A header
3029--------
3030This is some **text** with a footnote [*]_.
3031
3032.. [*] This is the footnote.
3033}}}
3034----
3035''''''Example 3'''''' (''''inserting a block of C source code in wiki text''''):
3036
3037{{{
3038#!html
3039<pre class="wiki">{{{
3040#!c
3041int main(int argc, char *argv[])
3042{
3043  printf("Hello World
3044");
3045  return 0;
3046}
3047}}}</pre>
3048}}}
3049
3050''''''Results in:''''''
3051{{{
3052#!c
3053int main(int argc, char *argv[])
3054{
3055  printf("Hello World
3056");
3057  return 0;
3058}
3059}}}
3060
3061----
3062
3063== Available Processors ==
3064The following processors are included in the Trac distribution:
3065 * ''''''html'''''' -- Insert custom HTML in a wiki page. See WikiHtml.
3066 * ''''''rst'''''' -- Trac support for Restructured Text. See WikiRestructuredText.
3067 * ''''''textile'''''' -- Supported if  [http://dealmeida.net/projects/textile/ Textile] is installed.
3068
3069=== Code Highlighting Support ===
3070Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for the following languages:
3071 * ''''''c'''''' -- C
3072 * ''''''cpp'''''' -- C++
3073 * ''''''python'''''' -- Python
3074 * ''''''perl'''''' -- Perl
3075 * ''''''ruby'''''' -- Ruby
3076 * ''''''php'''''' -- PHP
3077 * ''''''asp'''''' --- ASP
3078 * ''''''sql'''''' -- SQL
3079 * ''''''xml'''''' -- XML
3080''''''Note:'''''' ''''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.''''
3081
3082By using the MIME type as processor, it is possible to syntax-highlight the same languages that are supported when browsing source code. For example, you can write:
3083{{{
3084{{{
3085#!text/html
3086<h1>text</h1>
3087}}}
3088}}}
3089
3090The result will be syntax highlighted HTML code. The same is valid for all other mime types supported.
3091
3092
3093For more processor macros developed and/or contributed by users, visit:
3094 * [http://projects.edgewall.com/trac/wiki/ProcessorBazaar ProcessorBazaar]
3095 * [http://projects.edgewall.com/trac/wiki/MacroBazaar MacroBazaar]
3096
3097
3098== Advanced Topics: Developing Processor Macros ==
3099Developing processors is no different than WikiMacros. In fact they work the same way, only the usage syntax differs. See WikiMacros for more information.
3100
3101''''''Example:'''''' (''''Restructured Text Processor''''):
3102{{{
3103from docutils.core import publish_string
3104
3105def execute(hdf, text, env):
3106    html = publish_string(text, writer_name = ''html'')
3107    return html[html.find(''<body>'')+6:html.find(''</body>'')].strip()
3108}}}
3109
3110----
3111See also: WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide', NULL, NULL);
3112INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiRestructuredText', 1, 1132114161, 'trac', '127.0.0.1', '= reStructuredText Support in Trac =
3113
3114Trac supports using ''''reStructuredText'''' (RST) as an alternative to wiki markup in any context WikiFormatting is used.
3115
3116From the reStucturedText webpage:
3117 "''''reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser   system. It is useful for in-line program documentation (such as Python docstrings), for quickly creating  simple web pages, and for standalone documents. reStructuredText is designed for extensibility for  specific application domains. ''''"
3118
3119=== Requirements ===
3120Note that to activate RST support in Trac, the python docutils package must be installed.
3121If not already available on your operating system, you can download it at the [http://docutils.sourceforge.net/rst.html RST Website].
3122
3123=== More information on RST ===
3124
3125 * reStructuredText Website -- http://docutils.sourceforge.net/rst.html
3126 * RST Quick Reference -- http://docutils.sourceforge.net/docs/rst/quickref.html
3127
3128----
3129
3130== Using RST in Trac ==
3131To specify that a block of text should be parsed using RST, use the ''''rst'''' processor.
3132
3133=== TracLinks in reStructuredText ===
3134
3135 * Trac provides a custom RST reference-directive ''trac'' to allow TracLinks from within RST text.
3136
3137 Example:
3138 {{{
3139 {{{
3140 #!rst
3141 This is a reference to |a ticket|
3142
3143 .. |a ticket| trac:: #42
3144 }}}
3145 }}}
3146
3147 For a complete example of all uses of the ''''trac''''-directive, please see WikiRestructuredTextLinks.
3148
3149
3150 * Trac allows an even easier way of creating TracLinks in RST, using the custom '''':trac:'''' link naming scheme.
3151
3152 Example:
3153 {{{
3154 {{{
3155 #!rst
3156 This is a reference to ticket `#12`:trac:
3157
3158 To learn how to use Trac, see `TracGuide`:trac:
3159 }}}
3160 }}}
3161
3162=== Syntax highlighting in reStructuredText ===
3163
3164There is a directive for doing TracSyntaxColoring in ReST as well. The directive is called
3165code-block
3166
3167Example
3168
3169{{{
3170{{{
3171#!rst
3172
3173.. code-block:: python
3174
3175 class Test:
3176
3177    def TestFunction(self):
3178        pass
3179
3180}}}
3181}}}
3182
3183Will result in the below.
3184
3185{{{
3186#!rst
3187
3188.. code-block:: python
3189
3190 class Test:
3191
3192    def TestFunction(self):
3193        pass
3194
3195}}}
3196
3197=== WikiMacros in reStructuredText ===
3198
3199For doing WikiMacros in ReST you use the same directive as for syntax highlightning i.e
3200code-block. To work you must use a version of trac that has #801 applied.
3201
3202=== WikiMacro Example ===
3203
3204{{{
3205{{{
3206#!rst
3207
3208.. code-block:: HelloWorld
3209 
3210   Something I wanted to say
3211
3212
3213}}}
3214}}}
3215
3216Will result in the below.
3217
3218[[HelloWorld(Something I wanted to say)]]
3219
3220
3221=== Bigger ReST Example ===
3222The example below should be mostly self-explanatory:
3223{{{
3224#!html
3225<pre class="wiki">{{{
3226#!rst
3227FooBar Header
3228=============
3229reStructuredText is **nice**. It has its own webpage_.
3230
3231A table:
3232
3233=====  =====  ======
3234   Inputs     Output
3235------------  ------
3236  A      B    A or B
3237=====  =====  ======
3238False  False  False
3239True   False  True
3240False  True   True
3241True   True   True
3242=====  =====  ======
3243
3244RST TracLinks
3245-------------
3246
3247See also ticket `#42`:trac:.
3248
3249.. _webpage: http://docutils.sourceforge.net/rst.html
3250}}}</pre>
3251}}}
3252
3253
3254Results in:
3255{{{
3256#!rst
3257FooBar Header
3258=============
3259reStructuredText is **nice**. It has its own webpage_.
3260
3261A table:
3262
3263=====  =====  ======
3264   Inputs     Output
3265------------  ------
3266  A      B    A or B
3267=====  =====  ======
3268False  False  False
3269True   False  True
3270False  True   True
3271True   True   True
3272=====  =====  ======
3273
3274RST TracLinks
3275-------------
3276
3277See also ticket `#42`:trac:.
3278
3279.. _webpage: http://docutils.sourceforge.net/rst.html
3280}}}
3281
3282
3283----
3284See also: WikiRestructuredTextLinks, WikiProcessors, WikiFormatting', NULL, NULL);
3285INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiRestructuredTextLinks', 1, 1132114161, 'trac', '127.0.0.1', '= TracLinks in reStructuredText =
3286
3287This document is for testing the ``..trac::`` directive. The page is written like
3288
3289{{{
3290{{{
3291#!rst
3292
3293Examples
3294...
3295...
3296
3297}}}
3298}}}
3299
3300
3301This is a list of example uses of the ''''trac'''' directive, providing use of TracLinks in WikiRestructuredText.
3302
3303{{{
3304#!rst
3305
3306Examples
3307--------
3308
3309trac role
3310=========
3311Syntax is `link`:trac: or :trac:`link`, and could be put anywhere in the text. ''link'' has the same format as explain for the ``.. trac::`` directive below.
3312
3313``In the middle of my text `WikiFormatting`:trac: see!!!!``
3314   In the middle of my text `WikiFormatting`:trac: see!!!!
3315
3316or
3317
3318``In the middle of my text :trac:`WikiFormatting` see!!!!``
3319   In the middle of my text :trac:`WikiFormatting` see!!!!
3320
3321
3322wiki
3323====
3324``.. trac:: WikiFormatting``
3325        .. trac:: WikiFormatting
3326
3327``.. trac:: wiki:WikiFormatting``
3328       .. trac:: wiki:WikiFormatting
3329
3330``.. trac:: wiki:WikiFormatting WikiFormatting``
3331        .. trac:: wiki:WikiFormatting WikiFormatting
3332
3333``.. trac:: wiki:WikiFormatting LinkText``
3334        .. trac:: wiki:WikiFormatting LinkText
3335
3336tickets
3337=======
3338
3339``.. trac:: #1``
3340        .. trac:: #1
3341``.. trac:: #1 ticket one``
3342        .. trac:: #1 ticket one
3343``.. trac:: ticket:1``
3344        .. trac:: ticket:1
3345``.. trac:: ticket:1 ticket one``
3346        .. trac:: ticket:1 ticket one
3347
3348reports
3349=======
3350
3351``.. trac:: {1}``
3352        .. trac:: {1}
3353``.. trac:: {1} report one``
3354        .. trac:: {1} report one
3355``.. trac:: report:1``
3356        .. trac:: report:1
3357``.. trac:: report:1 report one``
3358        .. trac:: report:1 report one
3359
3360changesets
3361==========
3362
3363``.. trac:: [42]``
3364        .. trac:: [42]
3365``.. trac:: [42] changeset 42``
3366        .. trac:: [42] changeset 42
3367``.. trac:: changeset:42``
3368        .. trac:: changeset:42
3369``.. trac:: changeset:42 changeset 42``
3370        .. trac:: changeset:42 changeset 42
3371``.. trac:: foo``
3372        .. trac:: foo
3373
3374files
3375=====
3376
3377``.. trac:: browser:/trunk/trac``
3378        .. trac:: browser:/trunk/trac
3379
3380The leading ``/`` can be omitted...
3381
3382``.. trac:: repos:trunk/trac trunk/trac``
3383        .. trac:: repos:trunk/trac trunk/trac
3384``.. trac:: source:trunk/trac Trac source code``
3385        .. trac:: source:trunk/trac Trac source code
3386
3387``.. trac:: browser:trunk/README``
3388        .. trac:: browser:trunk/README
3389``.. trac:: repos:trunk/README trunk/README``
3390        .. trac:: repos:trunk/README trunk/README
3391``.. trac:: source:trunk/README README in trunk``
3392        .. trac:: source:trunk/README README in trunk
3393
3394Note that if ``hoo`` is a file, the link targets its revision log. In order to see the file''s content, you need to specify the revision explicitely, like here:
3395
3396``.. trac:: browser:/trunk/README#latest latest of trunk/README``
3397        .. trac:: browser:/trunk/README#latest latest of trunk/README
3398``.. trac:: repos:trunk/README#42 trunk/README in rev 42``
3399        .. trac:: repos:trunk/README#42 trunk/README in rev 42
3400}}}
3401
3402----
3403See also: WikiRestructuredTextLinks, TracLinks', NULL, NULL);
3404INSERT INTO wiki (name, version, "time", author, ipnr, text, "comment", readonly) VALUES ('WikiStart', 1, 1132114161, 'trac', '127.0.0.1', '= Welcome to Trac 0.9 =
3405
3406Trac is a ''''''minimalistic'''''' approach to ''''''web-based'''''' management of
3407''''''software projects''''''. Its goal is to simplify effective tracking and handling of software issues, enhancements and overall progress.
3408
3409All aspects of Trac have been designed with the single goal to
3410''''''help developers write great software'''''' while ''''''staying out of the way''''''
3411and imposing as little as possible on a team''s established process and
3412culture.
3413
3414As all Wiki pages, this page is editable, this means that you can
3415modify the contents of this page simply by using your
3416web-browser. Simply click on the "Edit this page" link at the bottom
3417of the page. WikiFormatting will give you a detailed description of
3418available Wiki formatting commands.
3419
3420"[wiki:TracAdmin trac-admin] ''''yourenvdir'''' initenv" created
3421a new Trac environment, containing a default set of wiki pages and some sample
3422data. This newly created environment also contains
3423[wiki:TracGuide documentation] to help you get started with your project.
3424
3425You can use [wiki:TracAdmin trac-admin] to configure
3426[http://trac.edgewall.com/ Trac] to better fit your project, especially in
3427regard to ''''components'''', ''''versions'''' and ''''milestones''''.
3428
3429
3430TracGuide is a good place to start.
3431
3432Enjoy! [[BR]]
3433''''The Trac Team''''
3434
3435== Starting Points ==
3436
3437 * TracGuide --  Built-in Documentation
3438 * [http://projects.edgewall.com/trac/ The Trac project] -- Trac Open Source Project
3439 * [http://projects.edgewall.com/trac/wiki/TracFaq Trac FAQ] -- Frequently Asked Questions
3440 * TracSupport --  Trac Support
3441
3442For a complete list of local wiki pages, see TitleIndex.
3443
3444Trac is brought to you by [http://www.edgewall.com/ Edgewall Software],
3445providing professional Linux and software development services to clients
3446worldwide. Visit http://www.edgewall.com/ for more information.
3447', NULL, NULL);