Personal tools
You are here: Home log Trac
Document Actions

Trac

install Trac, the enhanced wiki and issue tracking system for software development projects.

http://trac.edgewall.org/wiki

1   2007-11-03 Install Trac

install the debian package, 'trac'

read /usr/share/doc/trac/README.Debian

trac-admin /path/to/projectenv initenv (give out project name, svn repositary)

chown -R www-data /path/to/projectenv"

add following to /etc/apache2/sites-enabled/000-default:

<Location /projects>
      SetHandler mod_python
      PythonInterpreter main_interpreter
      PythonHandler trac.web.modpython_frontend
      PythonOption TracEnvParentDir /usr/local/projects
      PythonOption TracUriRoot /projects
</Location>
#2007-11-01 Trac http digest authentication
<LocationMatch "/projects/[^/]+/login">
      AuthType Digest
      AuthName "Trac Realm"
      AuthDigestProvider file
      AuthUserFile /etc/digest
      Require user_name
      #Require valid-user
</LocationMatch>
#2007-11-01 Trac
RewriteRule ^/projects/ -     [l]

disallow anonymous browser view, trac-admin /usr/local/tracprojectenv/ permission remove anonymous BROWSER_VIEW

2   2007-11-04 install WebAdmin plugin

  • download from http://trac.edgewall.org/wiki/WebAdmin into /tmp

  • remove the .zip extension (it's confusing, but check the footnote on its page. the python installation program 'easy_install' can handle zipped egg. however, the extension has to be .egg.)

  • install by easy_install --always-unzip TracWebAdmin-0.1.2dev_r4240-py2.4.egg. it's installed into /usr/lib/python2.4/site-packages/ (not /usr/share/trac/plugins/)

  • modify trac.ini to have following:

    [components]
    webadmin.* = enabled
    

3   2007-11-04 egg cache directory

--always-unzip option for easy_install makes sure that egg cache directory is not needed.

however, SetEnv PYTHON_EGG_CACHE /tmp/python_egg_cache is required to be inserted into apache's <Location> block. (not tested)

4   2007-11-04 install Account Manager Plugin

easy_install --always-unzip http://trac-hacks.org/svn/accountmanagerplugin/0.10

comment out the apache's http authentication block (<LocationMatch> block above)

add following to the trac.ini(check its page for details):

[components]
#2007-11-04 enable Account Manager
acct_mgr.api.AccountManager = enabled
acct_mgr.admin.AccountManagerAdminPage = enabled
trac.web.auth.LoginModule = disabled
acct_mgr.web_ui.AccountModule = enabled
acct_mgr.web_ui.LoginModule = enabled
acct_mgr.web_ui.RegistrationModule = disabled
acct_mgr.htfile.HtDigestStore = enabled

[account-manager]
; configure the plugin to store passwords in the htdigest format:
password_format = htdigest
; with Trac 0.10 use this instead:
password_store = HtDigestStore

; the file where user accounts are stored
; the webserver will need write permissions to this file
; and its parent folder
password_file = /usr/local/projects/digest

; the name of the authentication "realm"
; it can be any text to identify your site or project
htdigest_realm = Trac Users

5   2007-11-05 install the discussion plugin

easy_install --always-unzip  http://trac-hacks.org/svn/discussionplugin/0.10/

add following to trac.ini:

  [discussion]
  title = Discussion

  [components]
  tracdiscussion.api.DiscussionApi = enabled # For 0.11 branch. API object is component since then.
  tracdiscussion.admin.DiscussionWebAdmin = enabled
  tracdiscussion.core.DiscussionCore = enabled
  tracdiscussion.init.DiscussionInit = enabled
  tracdiscussion.search.DiscussionSearch = enabled
  tracdiscussion.timeline.DiscussionTimeline = enabled
  tracdiscussion.wiki.DiscussionWiki = enabled
  tracdiscussion.notification.DiscussionNotifyEmail = enabled

``trac-admin /usr/local/projects/hapmap upgrade``

6   2007-11-04 ticket notification

change trac.ini:

[notification]
always_notify_owner = true
always_notify_reporter = true
always_notify_updater = true
mime_encoding = base64
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =
smtp_enabled = true
smtp_from = notifier@example.org
smtp_password =
smtp_port = 25
smtp_replyto = replyto@example.org
smtp_server = localhost

7   2007-11-04 Group management

the user authentication is by http digest. the group management is offered by trac. go to Admin tab, click Permissions, "Add Subject to Group:". add any user to a group. if this is a new group, the group is created automatically.

9   2007-11-16 change the logo of Trac

in trac.ini, the default logo is "src = common/trac_banner.png".

  1. copy the custom logo into htdocs/ of the trac environment
  2. modify trac.ini and change the default logo to "src = site/trac_banner_hapmap.png"

10   2008-03-17 LdapPlugin

http://trac-hacks.org/wiki/LdapPlugin

check out code:

svn co http://trac-hacks.org/svn/ldapplugin/0.10/ ldapplugin

build egg:

cd ldapplugin
python setup.py bdist_egg

install the egg:

easy_install --always-unzip dist/LdapPlugin-0.5.1dev_r1611-py2.4.egg

11   2008-03-17 LDAPAuthPlugin (AccountManager password store)

download the egg from http://pypi.python.org/packages/2.4/T/TracLDAPAuth/TracLDAPAuth-1.0-py2.4.egg#md5=659e255a6151b8801bdb0fbe081e9c9f

easy_install --always-unzip TracLDAPAuth-1.0-py2.4.egg

The setup works but it doesn't support user listing, changing password, registration or non-simple binding. setup based on http://trac-hacks.org/wiki/LDAPAuthPlugin:

[ldap]
bind_dn =<bind DN>
;e.g. bind_dn = uid=%s,ou=people,dc=foo,dc=bar,dc=moo

server = <ldap server address>

[components]
trac.web.auth.LoginModule = disabled
 
acct_mgr.admin.accountmanageradminpage = enabled
acct_mgr.api.accountmanager = enabled
acct_mgr.web_ui.LoginModule = enabled
 
; be sure to enable the component
ldapauth.store.LDAPStore = enabled
 
[account-manager]
; configure the plugin to store passwords in the htdigest format:
password_store = LDAPStore

13   2008-03-17 LDAPAuthStore for Account Manager plugin

LDAPAuthStore works as an add-on for AccountManager but utilizes LdapPlugin to read configurations from trac.ini and do the actual LDAP connection/query.

add sasl binding in the check_password()

Setup:

Add following line to entry_points.txt (This file is in EGG_INFO directory in AccountManagerPlugin).:

acct_mgr.ldap_store = acct_mgr.ldap_store

Leave the apache setting same as after AccountManager is installed. Don't follow LdapPlugin's apache setting.

Follow LdapPlugin's trac.ini setting. didn't use its Permission/Groups part. It requires customize attributes (tracperm) to be added to the LDAP server schema.

Disable AccountManager's old password store mechanism (such as acct_mgr.htfile.htdigeststore). acct_mgr.web_ui.registrationmodule should also be disabled as LDAPAuthStore doesn't offer functionality to add new user into LDAP server. acct_mgr.web_ui.registrationmodule checks whether the password store component has the set_password() function to decide its own enability.

Enable acct_mgr.ldap_store.LdapAuthStore and set password_store = LdapAuthStore.

Complete configuration. Change store_bind, bind_user according to your LDAP server.:

[account-manager]
#htdigest_realm = Trac Users
#password_file = /usr/local/digest
#password_format = htdigest
#password_store = HtDigestStore
;2008-03-17
password_store = LdapAuthStore

[components]
acct_mgr.admin.accountmanageradminpage = enabled
acct_mgr.api.accountmanager = enabled
;acct_mgr.htfile.htdigeststore = enabled
acct_mgr.web_ui.accountmodule = enabled
acct_mgr.web_ui.loginmodule = enabled
;acct_mgr.web_ui.registrationmodule = enabled
trac.web.auth.loginmodule = disabled
;2008-03-17
acct_mgr.ldap_store.LdapAuthStore = enabled
...

;2008-03-17
ldapplugin.* = enabled

...

[ldap]
;2008-03-17 for ldapplugin.* and LdapAuthStore
# enable LDAP support for Trac
enable = true
# enable TLS support
use_tls = false
# LDAP directory host
host = localhost
# LDAP directory port (default port for LDAPS/TLS connections is 636)
port = 389
# BaseDN
basedn = dc=example,dc=org
# Relative DN for users (defaults to none)
user_rdn = cn=users
# Relative DN for group of names (defaults to none)
group_rdn = cn=groups
# objectclass for groups
groupname = posixGroup
# dn entry in a groupname
groupmember = memberUid
# attribute name for a group
groupattr = cn
# attribute name for a user
uidattr = uid
# attribute name to store trac permission
permattr = tracperm
# filter to search for dn with 'permattr' attributes
permfilter = objectclass=*
# time, in seconds, before a cached entry is purged out of the local cache.
cache_ttl = 900
# maximum number of entries in the cache
cache_size = 100
# whether to perform an authenticated bind for group resolution
group_bind = false
# whether to perform an authenticated bind for permision store operations
store_bind = true
# user for authenticated connection to the LDAP directory
bind_user = bind_user_dn
# password for authenticated connection
bind_passwd = secret
# global permissions (vs. per-environment permissions)
global_perms = false
# group permissions are managed as addition/removal to the LDAP directory groups
manage_groups = false
# whether a group member contains the full dn or a simple uid
groupmemberisdn = false

...

[trac]
...
;permission_store = LdapPermissionStore
permission_store = DefaultPermissionStore

15   2008-03-19 Trac Edit Tips

15.1   2008-03-19 PageOutline

[PageOutline] only works in wiki. Putting into ticket will display the outline of the default wiki page, not the ticket itself.

15.2   2008-03-19 wiki in Attachment Info

In filling "Attachment Info", TracLinks could be used but has some minor bugs. Some TracLinks examples:

attachment:'the file.txt'
attachment:"the file.txt"
attachment:"ticket:123:the file.txt"

It'll display ok in "Change History" section of the ticket. But it can't link correctly in "Attachments" section of the ticket. [../newticket newticket] could work but when the name, newticket has space in it, wrapping it with "(double-quotes) doesn't help.

16   2008-04-29 Install XmlRpcPlugin

http://trac-hacks.org/wiki/XmlRpcPlugin

  • check out source code by svn co http://trac-hacks.org/svn/xmlrpcplugin.
  • install easy_install -Z /tmp/xmlrpcplugin/0.10/

You will also probably need to enable the plugin in your environments trac.ini:

[components]
tracrpc.* = enabled

16.1   2008-04-29 Install HttpAuthPlugin

http://trac-hacks.org/wiki/HttpAuthPlugin

  • check out source code by svn co http://trac-hacks.org/svn/httpauthplugin.
  • install easy_install -Z /tmp/httpauthplugin/0.10/

To enable:

[components]
httpauth.* = enabled

To add additional paths:

[httpauth]
paths = /xmlrpc, /login/xmlrpc

It doesn't work. might be related to the complicated LDAP authentication. Get:

xmlrpclib.ProtocolError: <ProtocolError for user:pass@dl324b-1.cmb.usc.edu/...: 500 Internal Server Error>
« November 2009 »
Su Mo Tu We Th Fr Sa
1234567
89101112 1314
1516171819 20 21
22232425262728
2930
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: