Trac工具主要用于管理工程项目,其中包括项目文档、源代码、需求、bug fix等。通常Trac会和svn等源代码版本控制软件一起使用。Trac的下载和使用文档在http://trac.edgewall.org/上可以找到。下面是工作中利用到底检查配置功能,以及碰到常见问题的解决方法。
一、trac-admin用法
1. trac-admin /path/to/trac_env wiki list
2. 当改变repository_dir的时候,必须把svn project信息同步到trac_env中
trac-admin /path/to/trac_env resync
3. trac-admin /path/to/trac_env 可以进入trac帮助状态
Trac[/path/to/trac_env]> help
Trac[/path/to/trac_env]> help resync
可以获取各种帮助
二 、trac permission 管理
1 增加权限
trac-admin /path/to/trac_env permission add developer WIKI_ADMIN
trac-admin /path/to/trac_env permission add bob developer
2. 删除权限
trac-admin /path/to/trac_env permission remove bob WIKI_ADMIN
3. 查看用户的权限列表
trac-admin /path/to/trac_env permission list
4. trac用户密码创建
1)htdigest -c /data/trac/InfoSec/conf/user.digest realm name
2)htdigest /data/trac/InfoSec/conf/user.digest realm name2
Of course, the digest file can be be shared so that it is used for more than one project:
$ tracd -p 8080 /
--auth project1,/path/to/users.htdigest,mycompany.com /
--auth project2,/path/to/users.htdigest,mycompany.com /
/path/to/project1 /path/to/project2
Another way to share the digest file is to specify "*" for the project name:
$ tracd -p 8080 /
--auth *,/path/to/users.htdigest,mycompany.com /
/path/to/project1 /path/to/project2
tracd -d -p 8000 --auth project1,/data/trac/project1/conf/user.digest,trac /data/trac/project1
5. 配置过程中可能碰到问题
1). 编码冲突问题解决
CREATE DATABASE trac DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
2). 索引Duplicate Entry 问题解决
alter table node_change change path path text not null binary;
或者按照 Ticket #4378(注:可以在http://trac.edgewall.org/的Ticket中搜索): mysql_backend.path.binary.2.diff 的方法改
在trac.ini中
[trac]
database_charset = latin1