Passwordsafe

Preparation

Download webpasswordsafe-src-[[version]].zip and webpasswordsafe-dependencies-bin-[[version]].zip from http://code.google.com/p/webpasswordsafe/downloads/list . Store them in /usr/local/src.

Make sure you have installed java with the “Install the Unlimited Strength Policy Files” selected. Make sure maven is installed:

cd /usr/ports/devel/maven3
make install
make clean

We use mysql as database and Jetty as servlet container.

cd /usr/ports/databases/mysql-connector-java
make install
make clean

Installation

Now unpack files to /usr/local/src

cd /usr/local/src
unzip webpasswordsafe-src-1.2.1.zip
unzip webpasswordsafe-dependencies-bin-1.2.zip
cd /usr/local/src/webpasswordsafe/war/WEB-INF/lib
cp /usr/local/share/java/classes/mysql-connector-java.jar /usr/local/src/webpasswordsafe/war/WEB-INF/lib/
cp -R /usr/local/src/webpasswordsafe-dependencies-bin/resources/* /usr/local/src/webpasswordsafe/war/gxt/
cd /usr/local/src/webpasswordsafe-dependencies-bin/
mvn install:install-file -DgroupId=com.extjs -DartifactId=gxt -Dversion=2.2.5 -Dpackaging=jar -Dfile=gxt-2.2.5-gwt22.jar
mvn install:install-file -DgroupId=net.sf.gwt-widget -DartifactId=gwt-sl -Dversion=1.1 -Dpackaging=jar -Dfile=gwt-sl-1.1.jar
mvn install:install-file -DgroupId=trove -DartifactId=trove -Dversion=2.0.4 -Dpackaging=jar -Dfile=trove-2.0.4.jar

Setup database:

mysql -u root -p mysql
create database wps;
grant all privileges on wps.* to 'wps'@'localhost' identified by 'password';
quit

Configuration

Now we have to change some configfiles:

emacs /usr/local/src/webpasswordsafe/war/WEB-INF/encryption.properties

Make sure to set a random string for encryptor.jasypt.password.

Setup database config:

emacs /usr/local/src/webpasswordsafe/war/WEB-INF/jdbc.properties

Put in here the username, password and database name for mysql.

Configure the link the page is reachable:

emacs /usr/local/src/webpasswordsafe/war/WEB-INF/webservice-servlet.xml
change here locationUri to correct URI.

Build

cd /usr/local/src/webpasswordsafe
mvn clean package

Deployment

cp /usr/local/src/webpasswordsafe/target/webpasswordsafe-1.2.1.war /usr/local/jetty/webapps/
service jetty restart