• Instructions for Setting up a New Project in Trac and SVN

  last modified May 8 by cabraham

New Project Setup

This document covers basic infrastructure setup for OpenGeo projects. This assumes a Trac environment will be set up and SVN will be used to manage code. Though Trac setup is described first, if your project will use a subversion repository, read the section on SVN first. Trac can be configured to work with svn before or after the initial setup.

Trac

Basic Setup

This assumes your project will be accessible on the web with a URL like http://projects.opengeo.org/newproject and that you have appropriate permissions on arachnia - prefix all commands with "sudo" if you like.

cd /sites/projects.opengeo.org/trac
trac-admin newproject initenv --inherit=/sites/projects.opengeo.org/shared/trac/conf/trac.ini

At this point, you'll be prompted for some project detail (name, database connection, etc.) Accept the default (by entering nothing) when you don't know better (database connection string, repository type). Leave the path to repository blank if you don't plan on using svn or don't have a repository set up yet.

Finally, give apache permission to write to your new project environment and "upgrade" to take advantage of a couple plugins.

chown -R apache newproject
trac-admin newproject upgrade

At this point, assuming all went well, you should be able to view your new project (http://projects.opengeo.org/newproject).

Users, Permissions, Admin

Users

By default, anybody listed in the shared password file can log in to your new project site. You can find a list of these users with the following:

cat /sites/shared/htpasswd

If you are listed among those users, the login page (http://projects.opengeo.org/newproject/login) should log you in. If you are not listed among those users, the register page (http://projects.opengeo.org/newproject/register) should allow you to register as a user.

Permissions

A fresh trac environment won't have a user with admin privileges yet. Adding an admin user (or group) is your last task at the command line. After this, all trac admin can be done through the web. It's a good idea to give more than one person admin rights to the new environment.

Note that if you want to add groups with specific permissions, this has nothing to do with groups listed in the shared group file (/sites/shared/htgroup). Since trac manages its own permissions, it maintains separate groups.

Since we're just giving out a single permission here, it's easy enough to do this with individual users (groups in trac make sense when you want to share multiple permissions with multiple people).

trac-admin newproject permission add tschaub TRAC_ADMIN

Substitute tschaub with your username (from /sites/shared/htpasswd). If you want to add permissions for more users, you can do so here or through the web later.

By default, anonymous users can view most of trac (tickets, reports, wiki, timeline, milestones, etc). Also by default, authenticated users can create and modify tickets and wiki pages. You can configure these permissions through the web.

Admin

At this point, you are ready to start editing content and configuring trac through the web. Log in (http://projects.opengeo.org/newproject/login) and find the admin link (http://projects.opengeo.org/newproject/admin).

The admin pages let you control everything else you'll want to do with your trac site.

Email notification

The global configuration sends email to ticket owners, reporters, and updaters assuming they have provided an email address under their "preferences" for each trac instance. If you want to configure a single trac instance differently than the global configuration, add a [notification] section to your trac.ini (/sites/projects.opengeo.org/trac/newproject/conf/trac.ini) that contains values different than what you find in the same section of the global trac.ini (/sites/projects.opengeo.org/shared/trac/conf/trac.ini). Mail is sent from ak+trac@openplans by default. This may change in the future.

Subversion

This section assumes you want a subversion repository hosted by apache on arachnia at a URL like http://svn.opengeo.org/newproject. All commands must be run with sufficient privilege (prefix with sudo if you wish).

Basic Setup

Create a new repository and set apache as owner.

cd /sites/svn.opengeo.org
svnadmin create newproject
chown -R apache newproject

Configure Apache

Edit the configuration for the svn.opengeo.org virtual host to include a location block that captures requests to your new repository (http://svn.opengeo.org/newproject).

emacs /etc/httpd/vhosts.d/04_svn_opengeo_org.conf

Paste in the following block somewhere sensible:

        <Location /newproject>
                DAV svn
                SVNPath /sites/svn.opengeo.org/newproject
                # Limit write permission to list of valid users.
                <LimitExcept GET PROPFIND OPTIONS REPORT>
                      # Require SSL connection for password protection.
                      # SSLRequireSSL
                        AuthType Basic
                        AuthName "New Project Subversion Repository"
                        AuthGroupFile /sites/shared/htgroup
                        AuthUserFile /sites/shared/htpasswd
                        Require group opengeo_admin
                </LimitExcept>
        </Location>

(As with all other examples, you'll want to substitute your project name for newproject above.)

Restart apache.

/etc/init.d/httpd restart

Your new repository should be browsable from http://svn.opengeo.org/newproject. Members of the opengeo_admin group have commit rights, everybody else can do checkouts etc. If you want to restrict access in a different way, you can add a group to /sites/shared/htgroup and edit the apache config accordingly.

Removing Trac Environments and SVN Repos

Remove the directories containing trac environments and svn repositories.

rm -rf /sites/svn.opengeo.org/newproject
rm -rf /sites/projects.opengeo.org/trac/newproject

Edit /etc/httpd/vhosts.d/04_svn_opengeo_org.conf to remove the block on your repository (<Location /newproject>).