本文共 6364 字,大约阅读时间需要 21 分钟。
[root@development ~]# yum install python-setuptools[root@development ~]# easy_install Trac[root@development ~]# trac-admin /var/www/myproject initenv
subversion 仓库配置
vim /srv/example/conf/trac.inirepository_dir = /svnroot/example.com
tracd -s --port 8000 /var/www/myproject
multiple projects
tracd --port 8000 /var/www/trac/project1/ /var/www/trac/project2 ...ortracd --port 8000 -e /var/www/trac/
Using Authentication
To create a .passwd file using htdigest:
htdigest -c /var/www/trac/.passwd localhost neo
then for additional users:
htdigest /var/www/trac/.passwd localhost netkiller
bind ip
tracd -d --host 192.168.3.9 --port 8000 --auth=*,/srv/trac/.passwd,localhost -e /srv/trac
$ tracd -p 8080 \ --auth=project1,/path/to/users.htdigest,mycompany.com \ --auth=project2,/path/to/users.htdigest,mycompany.com \ /path/to/project1 /path/to/project2tracd -p 8000 \ --auth=*,/var/www/trac/.passwd,localhost \ -e /var/www/trac/
# trac-admin /srv/example helptrac-admin - The Trac Administration Console 0.12.3Usage: trac-admin [command [subcommand] [option ...]]Invoking trac-admin without command starts interactive mode.help Show documentationinitenv Create and initialize a new environmentattachment add Attach a file to a resourceattachment export Export an attachment from a resource to a file or stdoutattachment list List attachments of a resourceattachment remove Remove an attachment from a resourcechangeset added Notify trac about changesets added to a repositorychangeset modified Notify trac about changesets modified in a repositorycomponent add Add a new componentcomponent chown Change component ownershipcomponent list Show available componentscomponent remove Remove/uninstall a componentcomponent rename Rename a componentconfig get Get the value of the given option in "trac.ini"config remove Remove the specified option from "trac.ini"config set Set the value for the given option in "trac.ini"deploy Extract static resources from Trac and all pluginshotcopy Make a hot backup copy of an environmentmilestone add Add milestonemilestone completed Set milestone complete datemilestone due Set milestone due datemilestone list Show milestonesmilestone remove Remove milestonemilestone rename Rename milestonepermission add Add a new permission rulepermission list List permission rulespermission remove Remove a permission rulepriority add Add a priority value optionpriority change Change a priority valuepriority list Show possible ticket prioritiespriority order Move a priority value up or down in the listpriority remove Remove a priority valuerepository add Add a source repositoryrepository alias Create an alias for a repositoryrepository list List source repositoriesrepository remove Remove a source repositoryrepository resync Re-synchronize trac with repositoriesrepository set Set an attribute of a repositoryrepository sync Resume synchronization of repositoriesresolution add Add a resolution value optionresolution change Change a resolution valueresolution list Show possible ticket resolutionsresolution order Move a resolution value up or down in the listresolution remove Remove a resolution valuesession add Create a session for the given sidsession delete Delete the session of the specified sidsession list List the name and email for the given sidssession purge Purge all anonymous sessions older than the given agesession set Set the name or email attribute of the given sidseverity add Add a severity value optionseverity change Change a severity valueseverity list Show possible ticket severitiesseverity order Move a severity value up or down in the listseverity remove Remove a severity valueticket remove Remove ticketticket_type add Add a ticket typeticket_type change Change a ticket typeticket_type list Show possible ticket typesticket_type order Move a ticket type up or down in the listticket_type remove Remove a ticket typeupgrade Upgrade database to current versionversion add Add versionversion list Show versionsversion remove Remove versionversion rename Rename versionversion time Set version datewiki dump Export wiki pages to files named by titlewiki export Export wiki page to file or stdoutwiki import Import wiki page from file or stdinwiki list List wiki pageswiki load Import wiki pages from fileswiki remove Remove wiki pagewiki rename Rename wiki pagewiki replace Replace the content of wiki pages from files (DANGEROUS!)wiki upgrade Upgrade default wiki pages to current version
BROWSER_VIEWCHANGESET_VIEWCONFIG_VIEWEMAIL_VIEWFILE_VIEWLOG_VIEWMILESTONE_ADMINMILESTONE_CREATEMILESTONE_DELETEMILESTONE_MODIFYMILESTONE_VIEWPERMISSION_ADMINPERMISSION_GRANTPERMISSION_REVOKEREPORT_ADMINREPORT_CREATEREPORT_DELETEREPORT_MODIFYREPORT_SQL_VIEWREPORT_VIEWROADMAP_ADMINROADMAP_VIEWSEARCH_VIEWTICKET_ADMINTICKET_APPENDTICKET_CHGPROPTICKET_CREATETICKET_EDIT_CCTICKET_EDIT_COMMENTTICKET_EDIT_DESCRIPTIONTICKET_MODIFYTICKET_VIEWTIMELINE_VIEWTRAC_ADMINVERSIONCONTROL_ADMINWIKI_ADMINWIKI_CREATEWIKI_DELETEWIKI_MODIFYWIKI_RENAMEWIKI_VIEW
admin
$ trac-admin /path/to/projenv permission add neo TICKET_ADMIN TRAC_ADMIN WIKI_ADMIN
group
$ trac-admin /path/to/projenv permission add admin MILESTONE_ADMIN PERMISSION_ADMIN REPORT_ADMIN ROADMAP_ADMIN TICKET_ADMIN TRAC_ADMIN VERSIONCONTROL_ADMIN WIKI_ADMIN$ trac-admin /path/to/projenv permission add developer WIKI_ADMIN$ trac-admin /path/to/projenv permission add developer REPORT_ADMIN$ trac-admin /path/to/projenv permission add developer TICKET_ADMIN
user
$ trac-admin /path/to/projenv permission add bob developer$ trac-admin /path/to/projenv permission add john developer
# trac-admin /srv/example repository resync '(default)'
旧版本trac: trac-admin /srv/trac/neo resync
原文出处:Netkiller 系列 手札
本文作者:陈景峯 转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。