The UABgridProjects resource offers document revision control and project tracking services via Subversion and Trac. It is the goal that a project can be created either as a requested resource of a collaboration group. The plan is to support 1 or more projects per collaboration group, so that the group memberships can influence authorization decisions in multiple project instances.
In order for a project to be established the following commands need to be executed as root on projects.uabgrid
Start by defining the name of the project:
PROJECTNAME=name-of-project
Run the create-svn script to create a default subversion repository.
~/bin/create-svn $PROJECTNAME
The default access rights are sufficient for read-only access by the Trac web application. As the authorization integration is implemented, we will need to extend the svn repostitory configuration to address the access rights for the project.
After the repository is created the Trac project management tool can be initialized.
trac-admin /srv/www/projects.uabgrid/$PROJECTNAME \
initenv $PROJECTNAME sqlite:db/trac.db \
svn \
/srv/svn/projects.uabgrid/$PROJECTNAME \
/usr/share/trac/templates
In the current configuration, Trac runs under as the web server user, therefore, this user account needs write access to the newly created trac repository files so the SQLite file-based database that stores the wiki and other project data can be maintained. One of the goals is to use a system like MySQL to support standalone database access, this would prevent needing write access to these files. We could also consider running Trac under a dedicated user id via fast-cgi for accounting and finer access control. This would change the ownership requirements as well.
For now, the following is sufficient.
chown -R www-data.www-data /srv/www/projects.uabgrid/$PROJECTNAME
This will take you through a sequence of steps that
Email Configuration for projects
Update the trac configuration to support mailing of tickets
patch -b trac.ini << EOF 46,47c46,47 < smtp_enabled = false < smtp_from = trac@localhost --- > smtp_enabled = true > smtp_from = no-reply@projects.uabgrid.uab.edu 50c50 < smtp_replyto = trac@localhost --- > smtp_replyto = EOF
Graphics and Logo Configuration
Set variables to change the the project specific settings
pname=sc08 pdesc="SC08: Austin or Bust"
update config with above values
patch -b trac.ini << EOF 20,21c20,21 < link = http://example.org/ < src = common/trac_banner.png --- > link = http://projects.uabgrid.uab.edu/$pname > src = site/$pname-logo.png 59c59 < descr = My example project --- > descr = $pdesc 61c61 < icon = common/trac.ico --- > icon = site/$pname.ico 63c63 < url = http://example.org/ --- > url = http://projects.uabgrid.uab.edu/$pname EOF
Add just project description and urls (no favicon or banner images)
patch -b trac.ini << EOF 20c20 < link = http://example.org/ --- > link = http://projects.uabgrid.uab.edu/$pname 59c59 < descr = My example project --- > descr = $pdesc 63c63 < url = http://example.org/ --- > url = http://projects.uabgrid.uab.edu/$pname EOF
Copy the $pname-logo.png and $pname.ico project images to the htdocs/ dir in the project trac instance (assumes images already staged on project host)
cp /tmp/$pname-logo.png /srv/www/projects.uabgrid/$pname/htdocs cp /tmp/$pname.ico /srv/www/projects.uabgrid/$pname/htdocs
Installing Plugins
Be sure to read the TracPlugins documentation.
uabgrid-projects needed the python egg environment set up to support installing Trac Macros, see the TracPlugins documentation for details:
projects:/tmp# wget http://peak.telecommunity.com/dist/ez_setup.py
--12:40:12-- http://peak.telecommunity.com/dist/ez_setup.py
=> `ez_setup.py'
Resolving peak.telecommunity.com... 209.190.5.234
Connecting to peak.telecommunity.com|209.190.5.234|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8,960 (8.8K) [text/plain]
100%[====================================>] 8,960 31.70K/s
12:40:13 (31.61 KB/s) - `ez_setup.py' saved [8960/8960]
projects:/tmp# python ez_setup.py
Downloading http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c7-py2.4.egg
Processing setuptools-0.6c7-py2.4.egg
creating /usr/lib/python2.4/site-packages/setuptools-0.6c7-py2.4.egg
Extracting setuptools-0.6c7-py2.4.egg to /usr/lib/python2.4/site-packages
Adding setuptools 0.6c7 to easy-install.pth file
Installing easy_install script to /usr/bin
Installing easy_install-2.4 script to /usr/bin
Installed /usr/lib/python2.4/site-packages/setuptools-0.6c7-py2.4.egg
Processing dependencies for setuptools==0.6c7
Finished processing dependencies for setuptools==0.6c7
uabgrid.projects also needed the unzip utility installed
apt-get install unzip
Installing TOC Plugin
The Table of Contents Plugin supports the [[TOC]] markup to build a table of contents for a page (default) or site (by referencing specific pages to build a navigation menu.
Download the source from the plugin page, extract it.
cd /tmp projects:/tmp# wget -O tocmacro.zip 'http://trac-hacks.org/changeset/latest/tocmacro?old_path=/&filename=tocmacro&format=zip' unzip tocmacro.zip
Build the egg file for the macro:
cd /tmp/tocmacro/0.10 python setup.py bdist_egg
For now, the plugin is not installed globally so it needs to be added to each project's plugin dir. Put the egg file in place:
cp dist/TracTocMacro-1.0-py2.4.egg /srv/www/projects.uabgrid/r-group/plugins/
Patch the projects's trac.ini to enable the plugin
patch -b trac.ini <<EOF *************** *** 102,104 **** --- 102,106 ---- ignore_missing_pages = false split_page_names = false + [components] + tractoc.* = enabled EOF
Updated the page you want the TOC on to use just one main header and the rest subheaders to get TOC plugin to build TOC for page. By default, it uses only level 2 headers and below. This is very customizable, see the documentation.
Plugins of Interest
Project Permissions
Open Working Group
This configuration is open edits from non-affiliated users but does require authentication first. It is based off the default configuration for full anonymous access. It simply restricts modifications to authenticated users by converting edit permissions to the authenticated group (a special group in Trac for all authenticated users). It assumes that remaining view permissions are assign (as by default) to the anonymous user.
permission remove anonymous TICKET_CREATE TICKET_MODIFY WIKI_CREATE WIKI_MODIFY permission add authenticated TICKET_CREATE TICKET_MODIFY WIKI_CREATE WIKI_MODIFY
Private Working Group
Trac Project settings for a private working group project page. The assumption is that is is for a non-software project, so were' removing the software sounding config. This doesn't prevent it being used for software projects, of course, and this config can be generally seen as a minimal useful config to start a working group
create member group:
permission add member \ BROWSER_VIEW \ CHANGESET_VIEW \ FILE_VIEW \ LOG_VIEW \ MILESTONE_VIEW REPORT_SQL_VIEW \ REPORT_VIEW \ ROADMAP_VIEW \ SEARCH_VIEW \ TICKET_CREATE \ TICKET_MODIFY \ TICKET_VIEW \ TIMELINE_VIEW \ WIKI_CREATE \ WIKI_MODIFY \ WIKI_VIEW
remove default anonymous permissions
permission remove anonymous BROWSER_VIEW CHANGESET_VIEW FILE_VIEW LOG_VIEW MILESTONE_VIEW REPORT_SQL_VIEW REPORT_VIEW ROADMAP_VIEW SEARCH_VIEW TICKET_CREATE TICKET_MODIFY TICKET_VIEW TIMELINE_VIEW WIKI_CREATE WIKI_MODIFY WIKI_VIEW
remove the default version definitions
version remove 2.0 version remove 1.0
remove existing milestones
milestone remove milestone1 milestone remove milestone2 milestone remove milestone3 milestone remove milestone4
remove existing priorities (their too software oriented and too subtle anyway)
priority remove blocker priority remove critical priority remove major priority remove minor priority remove trivial
remove existing components
component remove component1 component remove component2
move task ticket type to the top of the list
ticket_type order task up ticket_type order task up
use more sane priorities
priority add normal priority add low priority add high
add collab group members to the new member definition using their ePPN, one per line
permission add puri@uab.edu member permission add jpr@uab.edu member permission add dls@uab.edu member permission add recloud@uab.edu member
References
- Software Management with Trac and Subversion - book extract describing motivations for using Trac as a software documentation tool for developers.
