Edgewall Software

TracMultipleProjects/MultipleEnvironmentsSingleDatabase: trac_data.sql

File trac_data.sql, 149.9 kB (added by masonjm@…, 3 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] ==