Changes between Version 1 and Version 2 of TracEnvironment
- Timestamp:
- 08/21/13 19:46:14 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracEnvironment
v1 v2 ˆà 5 5 == Creating an Environment ==ˆà 6 6 ˆà 7 ˆà A new Trac environment is created using [ wiki:TracAdmin trac-admin]:ˆàˆà 7 A new Trac environment is created using [TracAdmin#initenv trac-admin's initenv]:ˆà 8 8 {{{ˆà 9 9 $ trac-admin /path/to/myproject initenvˆà 10 10 }}}ˆà 11 11 ˆà 12 ˆà [wiki:TracAdmin trac-admin] will ask you for the name of the project, theˆà 13 ˆà database connection string (explained below), and the type and path toˆà 14 ˆà your source code repository.ˆà ˆà 12 `trac-admin` will ask you for the name of the project and theˆà ˆà 13 database connection string (explained below).ˆà 15 14 ˆà 16 ˆà ''Note: The web server user will require file system write permission to ˆà 17 ˆà the environment directory and all the files inside. Please remember to setˆà 18 ˆà the appropriate permissions. The same applies to the Subversion repository ˆà 19 ˆà Trac is eventually using, although Trac will only require read access as long ˆà 20 ˆà as you're not using the BDB file system. Also, it seems that project namesˆà 21 ˆà with spaces can be problematic for authentication (see [trac:#7163]).''ˆà ˆà 15 === Some Useful Tipsˆà ˆà 16 - The user under which the web server runs will require file system write permission to ˆà ˆà 17 the environment directory and all the files inside. Please remember to setˆà ˆà 18 the appropriate permissions. The same applies to the source code repository, ˆà ˆà 19 although the user under which Trac runs will only require write access to a Subversion repository created with the BDB file system; for other repository types, check the corresponding plugin's documentation. ˆà ˆà 20 ˆà ˆà 21 - `initenv`, when using an svn repository, does not imply that trac-admin will perform `svnadmin create` for the specified repository path. You need to perform the `svnadmin create` prior to `trac-admin initenv` if you're creating a new svn repository altogether with a new trac environment, otherwise you will see a message "Warning: couldn't index the repository" when initializing the environment.ˆà 22 22 ˆà 23 ˆà ''Note: "initenv" when using svn repository does not imply that trac-admin will perform "svnadmin create" for the specified repository path. You need to perform the "svnadmin create" prior to trac-admin initenv if you're creating a new svn repository altogether with a new trac environment, otherwise you will see a message "Warning: couldn't index the repository" when initializing the environment.''ˆà ˆà 23 - Non-ascii environment paths are not supportedˆà ˆà 24 ˆà ˆà 25 - Also, it seems that project names with spaces can be problematic for authentication (see [trac:#7163]).ˆà ˆà 26 ˆà ˆà 27 - TracPlugins located in a [TracIni#inherit-section shared plugins folder] that is defined in an [TracIni#GlobalConfiguration inherited configuration] are currently not loaded during creation, and hence, if they need to create extra tables for example, you'll need to [TracUpgrade#UpgradetheTracEnvironment upgrade the environment] before being able to use it.ˆà 24 28 ˆà 25 29 == Database Connection Strings ==ˆà òÀæ òÀæ ˆà 32 36 [wiki:TracBackup backed up] together with the rest of the environment.ˆà 33 37 ˆà 34 ˆà === EmbeddedSQLite Connection String ===ˆà35 ˆà The connection string for an embeddedSQLite database is:ˆàˆà 38 === SQLite Connection String ===ˆà ˆà 39 The connection string for an SQLite database is:ˆà 36 40 {{{ˆà 37 41 sqlite:db/trac.dbˆà 38 42 }}}ˆà ˆà 43 where `db/trac.db` is the path to the database file within the Trac environment.ˆà 39 44 ˆà 40 45 === PostgreSQL Connection String ===ˆà òÀæ òÀæ ˆà 97 102 == Source Code Repository ==ˆà 98 103 ˆà 99 ˆà You'll first have to provide the ''type'' of your repository (e.g. `svn` for Subversion,ˆà 100 ˆà which is the default), then the ''path'' where the repository is located.ˆà ˆà 104 Since version 0.12, a single Trac environment can be connected to more than one repository. There are many different ways to connect repositories to an environment, see TracRepositoryAdmin. This page also details the various attributes that can be set for a repository (like `type`, `url`, `description`).ˆà 101 105 ˆà 102 ˆà If you don't want to use Trac with a source code repository, simply leave the ''path'' emptyˆà 103 ˆà (the ''type'' information doesn't matter, then).ˆà ˆà 106 In Trac 0.12 `trac-admin` no longer asks questions related to repositories. Therefore, by default Trac is not connected to any source code repository, and the ''Browse Source'' toolbar item will not be displayed.ˆà ˆà 107 You can also explicitly disable the `trac.versioncontrol.*` components (which are otherwise still loaded)ˆà ˆà 108 {{{ˆà ˆà 109 [components]ˆà ˆà 110 trac.versioncontrol.* = disabledˆà ˆà 111 }}}ˆà 104 112 ˆà 105 ˆà For some systems, it is possible to specify not only the path to the repository,ˆàˆà 113 For some version control systems, it is possible to specify not only the path to the repository,ˆà 106 114 but also a ''scope'' within the repository. Trac will then only show informationˆà 107 115 related to the files and changesets below that scope. The Subversion backend forˆà 108 116 Trac supports this; for other types, check the corresponding plugin's documentation.ˆà 109 117 ˆà 110 ˆà Example of a configuration for a Subversion repository :ˆàˆà 118 Example of a configuration for a Subversion repository used as the default repository:ˆà 111 119 {{{ˆà 112 120 [trac]ˆà òÀæ òÀæ ˆà 133 141 * `db`ˆà 134 142 * `trac.db` - The SQLite database (if you're using SQLite).ˆà 135 ˆà * `htdocs` - directory containing web resources, which can be referenced in Genshi templates . '''''(0.11 only)'''''ˆàˆà 143 * `htdocs` - directory containing web resources, which can be referenced in Genshi templates using `/htdocs/site/...` URLs. ''(since 0.11)''ˆà 136 144 * `log` - default directory for log files, if logging is turned on and a relative path is given.ˆà 137 ˆà * `plugins` - Environment-specific [wiki:TracPlugins plugins] (Python eggs , since [trac:milestone:0.10 0.10])ˆà138 ˆà * `templates` - Custom Genshi environment-specific templates. '' '''(0.11 only)'''''ˆàˆà 145 * `plugins` - Environment-specific [wiki:TracPlugins plugins] (Python eggs or single file plugins, since [trac:milestone:0.10 0.10])ˆà ˆà 146 * `templates` - Custom Genshi environment-specific templates. ''(since 0.11)''ˆà 139 147 * `site.html` - method to customize header, footer, and style, described in TracInterfaceCustomization#SiteAppearanceˆà 140 ˆà * ''`templates` - Custom [trac:ClearSilver ClearSilver] environment-specific templates. '''(0.10 only)''' ''ˆà141 ˆà * ''`site_css.cs` - Custom CSS rules.''ˆà142 ˆà * ''`site_footer.cs` - Custom page footer.''ˆà143 ˆà * ''`site_header.cs` - Custom page header.''ˆà144 ˆà * ''`wiki-macros` - Environment-specific [WikiMacros Wiki macros]. '''(0.10 only)''' ''ˆà145 148 ˆà 146 ˆà '''Note: don't confuse a Trac environment directory with the source code repository directory.ˆà 147 ˆà It happens that the above structure is loosely modelled after the Subversion repository directory ˆà 148 ˆà structure, but they are not and ''must not'' be located at the same place.'''ˆà ˆà 149 === Caveat: don't confuse a ''Trac environment directory'' with the ''source code repository directory'' #Caveatˆà ˆà 150 ˆà ˆà 151 This is a common beginners' mistake.ˆà ˆà 152 It happens that the structure for a Trac environment is loosely modelled after the Subversion repository directory ˆà ˆà 153 structure, but those are two disjoint entities and they are not and ''must not'' be located at the same place.ˆà 149 154 ˆà 150 155 ----ˆà