Project

General

Profile

Installation

Overview

Seiscode is built on the Redmine project management framework. This is a Rails app running on its own server, which is proxied by Apache at http://seiscode.iris.washington.edu/.

A Redmine plugin (redmine_seiscode) allows Redmine to create a new SVN repository on the server for a project.

Apache is also running a svn_dav module at http://seiscode.iris.washington.edu/svn. This hooks into the Redmine database for authorization, so it can restrict access to repositories based on the corresponding project setup.

Permissions

SVN repositories are created by Redmine, which runs as seiscode:subversion. The Apache server runs as apache:apache. So repositories are created as group-writeable and owned by seiscode:apache, allowing both systems full access.

Running

This is still pretty ad-hoc; it needs to be set up as a service.

# This should be run as the seiscode user
# -d starts as a daemon
# -e sets the environment (determines the database to use, among other things)
/seiscode/redmine/script/server -d -e production

Logs are written to /seiscode/redmine/log/production.log, but some things go to the console for some reason, and running in daemon mode will lose them, so for testing, you might want to run with screen:

screen /seiscode/redmine/script/server -e production

Installation

RVM (Ruby Version Manager)

  • Install instructions: https://rvm.beginrescueend.com/
  • This was installed to the seiscode user home directory; a system-level install may be used in the future.
# Download
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
# Activate
. ~/.rvm/scripts/rvm
# Install openssl
rvm pkg install openssl
# Install Ruby 1.8.7 (required for Redmine) with local openssl
rvm install 1.8.7 --with-openssl-dir=$rvm_path/usr
# Install rails 2.3.14
gem install rails --version 2.3.14

Redmine

# Checkout from subversion
cd /seiscode
svn co http://redmine.rubyforge.org/svn/branches/1.3-stable redmine
cd redmine
# Set up rvm to use our chosen Ruby environment when in the redmine path
echo rvm use 1.8.7 --default > .rvmrc
cd ..; cd redmine
# Set up the production environment
export RAILS_ENV=production
rake generate_session_store
rake db:migrate
rake redmine:load_default_data
# Launch server to test -- this will run on localhost:3000, Ctrl-C to stop
script/server

The page may be missing images and styles, since it expects to run under a subpath through Apache (configured later).

Seiscode config/plugin for Redmine

cd /seiscode
mkdir seiscode
cd seiscode
# Checkout from internal svn
svn co svn+ssh://svn1/svn_repository/iris_repos/SeisCode/trunk .
# Link to components from the Redmine directory
# This should allow both Redmine and the seiscode pieces to live in
# SVN workspaces and each sync to their own repository.
# Config
cd /seiscode/redmine/config
ln -s /seiscode/seiscode/config/*.yml .
# Plugins
cd /seiscode/redmine/vendor/plugins
ln -s /seiscode/redmine_seiscode/plugins/redmine_* .

SVN

# SVN root path
cd /seiscode
mkdir svn
chown seiscode:subversion svn
chmod 755 svn
# Redmine auth module
mkdir /usr/local/share/perl5/Apache
cp /seiscode/redmine/extra/svn/Redmine.pm /usr/local/share/perl5/Apache/

Apache

Currently this config is in a couple of files under /etc/httpd/conf.d, but in the future it should be a single file from the SVN repo.

cp /seiscode/seiscode/apache/seiscode.conf /etc/http/conf.d/