changeset 1581:ae8043b014c7 dockerise

Updates, fixes, and tidying to scripted deployment stuff
author Chris Cannam
date Tue, 15 Aug 2017 13:33:56 +0100
parents fa3d9c22497c
children f26dc3004b3f
files .dockerignore .hgignore extra/soundsoftware/dockertest/Dockerfile extra/soundsoftware/dockertest/code.conf extra/soundsoftware/dockertest/database.yml extra/soundsoftware/dockertest/hgweb.config extra/soundsoftware/dockertest/index.cgi extra/soundsoftware/dockertest/passenger.conf extra/soundsoftware/dockertest/passenger.load extra/soundsoftware/dockertest/perl.conf extra/soundsoftware/dockertest/start.sh extra/soundsoftware/scripted-deploy/config/code.conf extra/soundsoftware/scripted-deploy/config/database.yml extra/soundsoftware/scripted-deploy/config/hgweb.config extra/soundsoftware/scripted-deploy/config/index.cgi extra/soundsoftware/scripted-deploy/config/passenger.conf extra/soundsoftware/scripted-deploy/config/passenger.load extra/soundsoftware/scripted-deploy/config/perl.conf extra/soundsoftware/scripted-deploy/docker/Dockerfile extra/soundsoftware/scripted-deploy/docker/start.sh extra/soundsoftware/scripted-deploy/vagrant/Vagrantfile extra/soundsoftware/scripted-deploy/vagrant/provision.d/000-apt.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/010-passenger.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/020-users.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/030-webapp-dir.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/040-hg-dir.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/050-webapp-db.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/060-bundler.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/070-secret-token.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/080-database-load.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/090-perl-auth-module.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/100-apache-config.sh extra/soundsoftware/scripted-deploy/vagrant/provision.d/110-apache-start.sh extra/soundsoftware/scripted-deploy/vagrant/start.sh extra/soundsoftware/scripted-deploy/vagrant/vagrant-provision.sh extra/soundsoftware/vagranttest/Vagrantfile extra/soundsoftware/vagranttest/provision.d/000-apt.sh extra/soundsoftware/vagranttest/provision.d/010-passenger.sh extra/soundsoftware/vagranttest/provision.d/020-users.sh extra/soundsoftware/vagranttest/provision.d/030-webapp-dir.sh extra/soundsoftware/vagranttest/provision.d/040-hg-dir.sh extra/soundsoftware/vagranttest/provision.d/050-webapp-db.sh extra/soundsoftware/vagranttest/provision.d/060-bundler.sh extra/soundsoftware/vagranttest/provision.d/070-secret-token.sh extra/soundsoftware/vagranttest/provision.d/080-database-load.sh extra/soundsoftware/vagranttest/provision.d/090-perl-auth-module.sh extra/soundsoftware/vagranttest/provision.d/100-apache-config.sh extra/soundsoftware/vagranttest/vagrant-provision.sh
diffstat 48 files changed, 608 insertions(+), 543 deletions(-) [+]
line wrap: on
line diff
--- a/.dockerignore	Fri Aug 04 18:01:54 2017 +0100
+++ b/.dockerignore	Tue Aug 15 13:33:56 2017 +0100
@@ -2,3 +2,4 @@
 .hg
 extra/soundsoftware/dockertest/Dockerfile
 extra/soundsoftware/dockertest/start.sh
+*.log
--- a/.hgignore	Fri Aug 04 18:01:54 2017 +0100
+++ b/.hgignore	Tue Aug 15 13:33:56 2017 +0100
@@ -1,5 +1,4 @@
 syntax: glob
-
 .project
 .loadpath
 .powrc
@@ -40,3 +39,7 @@
 *.interpolated
 re:^config\.ru$
 .vagrant
+*.orig
+*.pyc
+*-console.log
+postgres-dumpall
--- a/extra/soundsoftware/dockertest/Dockerfile	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-
-# For documentation and experimental purposes only. As a
-# reconstruction of the machine image that runs this application,
-# there are lots of things missing here; but as a good Docker
-# configuration, it fails by mixing together rather a lot of concerns.
-
-FROM ubuntu:16.04
-MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
-
-RUN apt-get update && \
-    apt-get install -y \
-    apache2 \
-    apache2-dev \
-    apt-utils \
-    build-essential \
-    cron \
-    curl \
-    doxygen \
-    exim4 \
-    git \
-    graphviz \
-    imagemagick \
-    libapache-dbi-perl \
-    libapache2-mod-perl2 \
-    libapr1-dev \
-    libaprutil1-dev \
-    libauthen-simple-ldap-perl \
-    libcurl4-openssl-dev \
-    libdbd-pg-perl \
-    libpq-dev \
-    libmagickwand-dev \
-    libio-socket-ssl-perl \
-    logrotate \
-    mercurial \
-    postgresql \
-    rsync \
-    ruby \
-    ruby-dev \
-    sudo
-
-# Also used on the live site, for javadoc extraction, but this is
-# would be by far the biggest package here: let's omit it while we're
-# not making use of it
-#   openjdk-9-jdk-headless
-
-RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
-
-
-# Passenger gets installed through gem, not apt
-
-RUN gem install passenger -v 4.0.60 --no-rdoc --no-ri
-RUN passenger-install-apache2-module --languages=ruby
-
-
-# Copy across webapp, set up ownership
-
-COPY . /var/www/code
-
-RUN groupadd code
-RUN useradd -g code -G www-data code
-RUN chown -R code.www-data /var/www/code
-RUN find /var/www/code -type d -exec chmod g+s \{\} \;
-
-
-# Initialise /var/hg (in reality this would be mounted from somewhere)
-
-RUN mkdir -p /var/hg
-RUN chown code.www-data /var/hg
-RUN chmod g+s /var/hg
-COPY extra/soundsoftware/dockertest/index.cgi /var/hg/
-COPY extra/soundsoftware/dockertest/hgweb.config /var/hg/
-RUN chmod +x /var/hg/index.cgi
-
-
-# We're based in the code webapp directory from here on
-
-WORKDIR /var/www/code
-
-
-# Set up database config etc
-
-RUN cp extra/soundsoftware/dockertest/database.yml.interpolated config/database.yml
-
-
-# Install Rails and dependencies (database.yml must be populated before this)
-
-RUN gem install bundler
-RUN bundle install
-
-
-# Initialise Redmine token (bundler must be installed before this)
-
-RUN bundle exec rake generate_secret_token
-
-
-# Import Postgres database from postgres-dumpall file
-
-RUN chown postgres postgres-dumpall
-RUN /etc/init.d/postgresql start && sudo -u postgres psql -f postgres-dumpall postgres
-
-
-# Install Perl auth module for Hg access
-
-RUN mkdir -p /usr/local/lib/site_perl/Apache/Authn/
-RUN cp extra/soundsoftware/SoundSoftware.pm /usr/local/lib/site_perl/Apache/Authn/
-
-
-# Set up Apache config (todo: insert variables)
-
-RUN rm -f /etc/apache2/sites-enabled/000-default.conf
-
-RUN cp extra/soundsoftware/dockertest/passenger.conf /etc/apache2/mods-available/
-RUN cp extra/soundsoftware/dockertest/passenger.load /etc/apache2/mods-available/
-RUN cp extra/soundsoftware/dockertest/perl.conf      /etc/apache2/mods-available/
-
-RUN ln -s ../mods-available/passenger.conf  /etc/apache2/mods-enabled/
-RUN ln -s ../mods-available/passenger.load  /etc/apache2/mods-enabled/
-RUN ln -s ../mods-available/perl.conf       /etc/apache2/mods-enabled/
-RUN ln -s ../mods-available/expires.load    /etc/apache2/mods-enabled/
-RUN ln -s ../mods-available/rewrite.load    /etc/apache2/mods-enabled/
-RUN ln -s ../mods-available/cgi.load        /etc/apache2/mods-enabled/
-
-RUN cp extra/soundsoftware/dockertest/code.conf.interpolated /etc/apache2/sites-available/code.conf
-RUN ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf
-
-RUN apache2ctl configtest
-
-
-# Start Postgres and foregrounded Apache
-
-RUN echo "#!/bin/bash"                      > container-run.sh
-RUN echo "/etc/init.d/postgresql start"    >> container-run.sh
-RUN echo "apache2ctl -D FOREGROUND"        >> container-run.sh
-RUN chmod +x container-run.sh
-
-EXPOSE 80
-CMD ./container-run.sh
-
--- a/extra/soundsoftware/dockertest/code.conf	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-
-# A test Apache config. Lacks SSL, lacks a desirable extra layer of
-# authentication for admin interface paths. Do not deploy this.
-
-PerlLoadModule Apache::Authn::SoundSoftware
-
-<VirtualHost *:80>
-        ServerName code.soundsoftware.ac.uk
-        ServerAdmin chris.cannam@soundsoftware.ac.uk
-
-        DocumentRoot /var/www/code/public
-        PassengerRestartDir restart_files
-        PassengerHighPerformance on
-        PassengerMaxRequests 50000
-        PassengerStatThrottleRate 5
-	PassengerStartTimeout 60
-	PassengerFriendlyErrorPages on
-        RailsSpawnMethod smart
-        ExpiresDefault "access plus 1 minute"
-
-        <DirectoryMatch "^/.*/\.svn/">
-                Order allow,deny
-                Deny from all
-                Satisfy All
-        </DirectoryMatch>
-
-        <DirectoryMatch "^/.*/\.hg/">
-                Order allow,deny
-                Deny from all
-                Satisfy All
-        </DirectoryMatch>
-
-        <DirectoryMatch "^/.*/\.git/">
-                Order allow,deny
-                Deny from all
-                Satisfy All
-        </DirectoryMatch>
-
-        <Directory /var/www/code/public>
-                Options -MultiViews
-	</Directory>
-
-        <Directory /var/www/code/public/themes/soundsoftware/stylesheets/fonts>
-		# Avoid other sites embedding our fonts
-		RewriteEngine on
-		RewriteCond %{HTTP_REFERER} !^$
-		RewriteCond %{HTTP_REFERER} !^http(s)?://code.soundsoftware.ac.uk/.*$ [NC]
-		RewriteRule \.(ttf|woff|eot|otf|svg|zip|gz|html|txt)$ - [F]
-	</Directory>
-
-	ScriptAlias /hg "/var/hg/index.cgi"
-
-	<Location /hg>
-               	AuthName "Mercurial"
-                AuthType Basic
-                Require valid-user
-		PerlAccessHandler Apache::Authn::SoundSoftware::access_handler
-      		PerlAuthenHandler Apache::Authn::SoundSoftware::authen_handler
-		PerlSetVar HTTPS "on"
-		SoundSoftwareDSN "dbi:Pg:database=code;host=localhost"
-    		SoundSoftwareDbUser "code"
-     		SoundSoftwareDbPass "INSERT_POSTGRES_PASSWORD_HERE"
-		SoundSoftwareRepoPrefix "/var/hg/"
-                #!!! "on" in production please!:
-                SoundSoftwareSslRequired "off"
-		Options +ExecCGI
-		AddHandler cgi-script .cgi
-		ExpiresDefault now
-        </Location>
-
-	Alias /git "/var/files/git-mirror"	
-
-	<Directory "/var/files/git-mirror">
-		Options -Indexes +FollowSymLinks
-                Order allow,deny
-                Allow from all
-	</Directory>
-	<Directory ~ "/var/files/git-mirror/.*\.workdir">
-		Order allow,deny
-		Deny from all
-	</Directory>
-	<Directory ~ "/var/files/git-mirror/__.*">
-                Order allow,deny
-                Deny from all
-	</Directory>
-
-	ErrorLog /var/log/apache2/code-error.log
-	CustomLog /var/log/apache2/code-access.log vhost_combined
-
-        LogLevel warn
-        ServerSignature Off
-        
-</VirtualHost>
-
--- a/extra/soundsoftware/dockertest/database.yml	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-production:
-  adapter: postgresql
-  database: code
-  host: localhost
-  username: code
-  password: "INSERT_POSTGRES_PASSWORD_HERE"
-
--- a/extra/soundsoftware/dockertest/hgweb.config	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-[paths]
-/ = /var/hg/*
-
-[web]
-allow_archive = gz, zip, bz2
-allow_push = *
--- a/extra/soundsoftware/dockertest/index.cgi	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-#
-# An example CGI script to export multiple hgweb repos, edit as necessary
-
-# adjust python path if not a system-wide install:
-#import sys
-#sys.path.insert(0, "/path/to/python/lib")
-
-# enable importing on demand to reduce startup time
-from mercurial import demandimport; demandimport.enable()
-
-# Uncomment to send python tracebacks to the browser if an error occurs:
-import cgitb
-cgitb.enable()
-
-# If you'd like to serve pages with UTF-8 instead of your default
-# locale charset, you can do so by uncommenting the following lines.
-# Note that this will cause your .hgrc files to be interpreted in
-# UTF-8 and all your repo files to be displayed using UTF-8.
-#
-import os
-os.environ["HGENCODING"] = "UTF-8"
-
-from mercurial.hgweb.hgwebdir_mod import hgwebdir
-import mercurial.hgweb.wsgicgi as wsgicgi
-
-# The config file looks like this.  You can have paths to individual
-# repos, collections of repos in a directory tree, or both.
-#
-# [paths]
-# virtual/path1 = /real/path1
-# virtual/path2 = /real/path2
-# virtual/root = /real/root/*
-# / = /real/root2/*
-# virtual/root2 = /real/root2/**
-#
-# [collections]
-# /prefix/to/strip/off = /root/of/tree/full/of/repos
-#
-# paths example: 
-#
-# * First two lines mount one repository into one virtual path, like
-# '/real/path1' into 'virtual/path1'.
-#
-# * The third entry mounts every mercurial repository found in '/real/root'
-# in 'virtual/root'. This format is preferred over the [collections] one,
-# since using absolute paths as configuration keys is not supported on every
-# platform (especially on Windows).
-#
-# * The fourth entry is a special case mounting all repositories in
-# /'real/root2' in the root of the virtual directory.
-#
-# * The fifth entry recursively finds all repositories under the real root,
-# and mounts them using their relative path (to given real root) under the
-# virtual root.
-#
-# collections example: say directory tree /foo contains repos /foo/bar,
-# /foo/quux/baz.  Give this config section:
-#   [collections]
-#   /foo = /foo
-# Then repos will list as bar and quux/baz.
-#
-# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
-# or use a dictionary with entries like 'virtual/path': '/real/path'
-
-application = hgwebdir('hgweb.config')
-wsgicgi.launch(application)
--- a/extra/soundsoftware/dockertest/passenger.conf	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-PassengerMaxPoolSize 60
-
--- a/extra/soundsoftware/dockertest/passenger.load	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-LoadModule passenger_module /var/lib/gems/2.3.0/gems/passenger-4.0.60/buildout/apache2/mod_passenger.so
-PassengerRoot /var/lib/gems/2.3.0/gems/passenger-4.0.60
-PassengerDefaultRuby /usr/bin/ruby2.3
--- a/extra/soundsoftware/dockertest/perl.conf	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-# Apache::DBI is supposed to be a transparent replacement for Perl DBI with
-# better performance when multiple connections are made with common DSN, user
-# and password
-PerlModule Apache::DBI
--- a/extra/soundsoftware/dockertest/start.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-dbpwd="$1"
-if [ -z "$dbpwd" ]; then
-    echo "Usage: $0 <database-password>" 1>&2
-    exit 2
-fi
-
-set -eu
-
-dockerdir=./extra/soundsoftware/dockertest
-if [ ! -d "$dockerdir" ]; then
-    echo "Run this script from the root of a working copy of soundsoftware-site"
-    exit 2
-fi
-
-for f in database.yml code.conf ; do
-    cat "$dockerdir/$f" |
-        sed 's/INSERT_POSTGRES_PASSWORD_HERE/'"$dbpwd"'/g' > \
-            "$dockerdir/$f.interpolated"
-done
-
-dockertag="cannam/soundsoftware-site"
-
-sudo docker build -t "$dockertag" -f "$dockerdir/Dockerfile" .
-sudo docker run -p 8080:80 -d "$dockertag"
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/config/code.conf	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,94 @@
+
+# A test Apache config. Lacks SSL, lacks a desirable extra layer of
+# authentication for admin interface paths. Do not deploy this.
+
+PerlLoadModule Apache::Authn::SoundSoftware
+
+<VirtualHost *:80>
+        ServerName code.soundsoftware.ac.uk
+        ServerAdmin chris.cannam@soundsoftware.ac.uk
+
+        DocumentRoot /var/www/code/public
+        PassengerRestartDir restart_files
+        PassengerHighPerformance on
+        PassengerMaxRequests 50000
+        PassengerStatThrottleRate 5
+	PassengerStartTimeout 60
+	PassengerFriendlyErrorPages on
+        RailsSpawnMethod smart
+        ExpiresDefault "access plus 1 minute"
+
+        <DirectoryMatch "^/.*/\.svn/">
+                Order allow,deny
+                Deny from all
+                Satisfy All
+        </DirectoryMatch>
+
+        <DirectoryMatch "^/.*/\.hg/">
+                Order allow,deny
+                Deny from all
+                Satisfy All
+        </DirectoryMatch>
+
+        <DirectoryMatch "^/.*/\.git/">
+                Order allow,deny
+                Deny from all
+                Satisfy All
+        </DirectoryMatch>
+
+        <Directory /var/www/code/public>
+                Options -MultiViews
+	</Directory>
+
+        <Directory /var/www/code/public/themes/soundsoftware/stylesheets/fonts>
+		# Avoid other sites embedding our fonts
+		RewriteEngine on
+		RewriteCond %{HTTP_REFERER} !^$
+		RewriteCond %{HTTP_REFERER} !^http(s)?://code.soundsoftware.ac.uk/.*$ [NC]
+		RewriteRule \.(ttf|woff|eot|otf|svg|zip|gz|html|txt)$ - [F]
+	</Directory>
+
+	ScriptAlias /hg "/var/hg/index.cgi"
+
+	<Location /hg>
+               	AuthName "Mercurial"
+                AuthType Basic
+                Require valid-user
+		PerlAccessHandler Apache::Authn::SoundSoftware::access_handler
+      		PerlAuthenHandler Apache::Authn::SoundSoftware::authen_handler
+		PerlSetVar HTTPS "on"
+		SoundSoftwareDSN "dbi:Pg:database=code;host=localhost"
+    		SoundSoftwareDbUser "code"
+     		SoundSoftwareDbPass "INSERT_POSTGRES_PASSWORD_HERE"
+		SoundSoftwareRepoPrefix "/var/hg/"
+                #!!! "on" in production please!:
+                SoundSoftwareSslRequired "off"
+		Options +ExecCGI
+		AddHandler cgi-script .cgi
+		ExpiresDefault now
+        </Location>
+
+	Alias /git "/var/files/git-mirror"	
+
+	<Directory "/var/files/git-mirror">
+		Options -Indexes +FollowSymLinks
+                Order allow,deny
+                Allow from all
+	</Directory>
+	<Directory ~ "/var/files/git-mirror/.*\.workdir">
+		Order allow,deny
+		Deny from all
+	</Directory>
+	<Directory ~ "/var/files/git-mirror/__.*">
+                Order allow,deny
+                Deny from all
+	</Directory>
+
+	ErrorLog /var/log/apache2/code-error.log
+	CustomLog /var/log/apache2/code-access.log vhost_combined
+
+        LogLevel warn
+        ServerSignature Off
+        
+</VirtualHost>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/config/database.yml	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,7 @@
+production:
+  adapter: postgresql
+  database: code
+  host: localhost
+  username: code
+  password: "INSERT_POSTGRES_PASSWORD_HERE"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/config/hgweb.config	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,6 @@
+[paths]
+/ = /var/hg/*
+
+[web]
+allow_archive = gz, zip, bz2
+allow_push = *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/config/index.cgi	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+#
+# An example CGI script to export multiple hgweb repos, edit as necessary
+
+# adjust python path if not a system-wide install:
+#import sys
+#sys.path.insert(0, "/path/to/python/lib")
+
+# enable importing on demand to reduce startup time
+from mercurial import demandimport; demandimport.enable()
+
+# Uncomment to send python tracebacks to the browser if an error occurs:
+import cgitb
+cgitb.enable()
+
+# If you'd like to serve pages with UTF-8 instead of your default
+# locale charset, you can do so by uncommenting the following lines.
+# Note that this will cause your .hgrc files to be interpreted in
+# UTF-8 and all your repo files to be displayed using UTF-8.
+#
+import os
+os.environ["HGENCODING"] = "UTF-8"
+
+from mercurial.hgweb.hgwebdir_mod import hgwebdir
+import mercurial.hgweb.wsgicgi as wsgicgi
+
+# The config file looks like this.  You can have paths to individual
+# repos, collections of repos in a directory tree, or both.
+#
+# [paths]
+# virtual/path1 = /real/path1
+# virtual/path2 = /real/path2
+# virtual/root = /real/root/*
+# / = /real/root2/*
+# virtual/root2 = /real/root2/**
+#
+# [collections]
+# /prefix/to/strip/off = /root/of/tree/full/of/repos
+#
+# paths example: 
+#
+# * First two lines mount one repository into one virtual path, like
+# '/real/path1' into 'virtual/path1'.
+#
+# * The third entry mounts every mercurial repository found in '/real/root'
+# in 'virtual/root'. This format is preferred over the [collections] one,
+# since using absolute paths as configuration keys is not supported on every
+# platform (especially on Windows).
+#
+# * The fourth entry is a special case mounting all repositories in
+# /'real/root2' in the root of the virtual directory.
+#
+# * The fifth entry recursively finds all repositories under the real root,
+# and mounts them using their relative path (to given real root) under the
+# virtual root.
+#
+# collections example: say directory tree /foo contains repos /foo/bar,
+# /foo/quux/baz.  Give this config section:
+#   [collections]
+#   /foo = /foo
+# Then repos will list as bar and quux/baz.
+#
+# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
+# or use a dictionary with entries like 'virtual/path': '/real/path'
+
+application = hgwebdir('hgweb.config')
+wsgicgi.launch(application)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/config/passenger.conf	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,2 @@
+PassengerMaxPoolSize 60
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/config/passenger.load	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,3 @@
+LoadModule passenger_module /var/lib/gems/2.3.0/gems/passenger-4.0.60/buildout/apache2/mod_passenger.so
+PassengerRoot /var/lib/gems/2.3.0/gems/passenger-4.0.60
+PassengerDefaultRuby /usr/bin/ruby2.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/config/perl.conf	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,4 @@
+# Apache::DBI is supposed to be a transparent replacement for Perl DBI with
+# better performance when multiple connections are made with common DSN, user
+# and password
+PerlModule Apache::DBI
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/docker/Dockerfile	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,139 @@
+
+# For documentation and experimental purposes only. As a
+# reconstruction of the machine image that runs this application,
+# there are lots of things missing here; but as a good Docker
+# configuration, it fails by mixing together rather a lot of concerns.
+
+FROM ubuntu:16.04
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+
+RUN apt-get update && \
+    apt-get install -y \
+    apache2 \
+    apache2-dev \
+    apt-utils \
+    build-essential \
+    cron \
+    curl \
+    doxygen \
+    exim4 \
+    git \
+    graphviz \
+    imagemagick \
+    libapache-dbi-perl \
+    libapache2-mod-perl2 \
+    libapr1-dev \
+    libaprutil1-dev \
+    libauthen-simple-ldap-perl \
+    libcurl4-openssl-dev \
+    libdbd-pg-perl \
+    libpq-dev \
+    libmagickwand-dev \
+    libio-socket-ssl-perl \
+    logrotate \
+    mercurial \
+    postgresql \
+    rsync \
+    ruby \
+    ruby-dev \
+    sudo
+
+# Also used on the live site, for javadoc extraction, but this is
+# would be by far the biggest package here: let's omit it while we're
+# not making use of it
+#   openjdk-9-jdk-headless
+
+RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+
+# Passenger gets installed through gem, not apt
+
+RUN gem install passenger -v 4.0.60 --no-rdoc --no-ri
+RUN passenger-install-apache2-module --languages=ruby
+
+
+# Copy across webapp, set up ownership
+
+COPY . /var/www/code
+
+RUN groupadd code
+RUN useradd -g code -G www-data code
+RUN chown -R code.www-data /var/www/code
+RUN find /var/www/code -type d -exec chmod g+s \{\} \;
+
+
+# Initialise /var/hg (in reality this would be mounted from somewhere)
+
+RUN mkdir -p /var/hg
+RUN chown code.www-data /var/hg
+RUN chmod g+s /var/hg
+COPY extra/soundsoftware/scripted-deploy/config/index.cgi /var/hg/
+COPY extra/soundsoftware/scripted-deploy/config/hgweb.config /var/hg/
+RUN chmod +x /var/hg/index.cgi
+
+
+# We're based in the code webapp directory from here on
+
+WORKDIR /var/www/code
+
+
+# Set up database config etc
+
+RUN cp extra/soundsoftware/scripted-deploy/config/database.yml.interpolated config/database.yml
+
+
+# Install Rails and dependencies (database.yml must be populated before this)
+
+RUN gem install bundler
+RUN bundle install
+
+
+# Initialise Redmine token (bundler must be installed before this)
+
+RUN bundle exec rake generate_secret_token
+
+
+# Import Postgres database from postgres-dumpall file
+
+RUN chown postgres postgres-dumpall
+RUN /etc/init.d/postgresql start && sudo -u postgres psql -f postgres-dumpall postgres
+RUN rm postgres-dumpall
+
+
+# Install Perl auth module for Hg access
+
+RUN mkdir -p /usr/local/lib/site_perl/Apache/Authn/
+RUN cp extra/soundsoftware/SoundSoftware.pm /usr/local/lib/site_perl/Apache/Authn/
+
+
+# Set up Apache config (todo: insert variables)
+
+RUN rm -f /etc/apache2/sites-enabled/000-default.conf
+
+RUN cp extra/soundsoftware/scripted-deploy/config/passenger.conf /etc/apache2/mods-available/
+RUN cp extra/soundsoftware/scripted-deploy/config/passenger.load /etc/apache2/mods-available/
+RUN cp extra/soundsoftware/scripted-deploy/config/perl.conf      /etc/apache2/mods-available/
+
+RUN ln -s ../mods-available/passenger.conf  /etc/apache2/mods-enabled/
+RUN ln -s ../mods-available/passenger.load  /etc/apache2/mods-enabled/
+RUN ln -s ../mods-available/perl.conf       /etc/apache2/mods-enabled/
+RUN ln -s ../mods-available/expires.load    /etc/apache2/mods-enabled/
+RUN ln -s ../mods-available/rewrite.load    /etc/apache2/mods-enabled/
+RUN ln -s ../mods-available/cgi.load        /etc/apache2/mods-enabled/
+
+RUN cp extra/soundsoftware/scripted-deploy/config/code.conf.interpolated /etc/apache2/sites-available/code.conf
+RUN ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf
+
+RUN apache2ctl configtest
+
+
+# Start Postgres and foregrounded Apache
+
+RUN echo "#!/bin/bash"                      > container-run.sh
+RUN echo "/etc/init.d/postgresql start"    >> container-run.sh
+RUN echo "apache2ctl -D FOREGROUND"        >> container-run.sh
+RUN chmod +x container-run.sh
+
+EXPOSE 80
+CMD ./container-run.sh
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/docker/start.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+dbpwd="$1"
+if [ -z "$dbpwd" ]; then
+    echo "Usage: $0 <database-password>" 1>&2
+    exit 2
+fi
+
+set -eu
+
+deploydir=./extra/soundsoftware/scripted-deploy
+if [ ! -d "$deploydir" ]; then
+    echo "Run this script from the root of a working copy of soundsoftware-site"
+    exit 2
+fi
+
+managerdir="$deploydir/docker"
+if [ ! -d "$managerdir" ]; then
+    echo "ERROR: Required directory $managerdir not found"
+    exit 2
+fi
+
+configdir="$deploydir/config"
+if [ ! -d "$configdir" ]; then
+    echo "ERROR: Required directory $configdir not found"
+    exit 2
+fi
+
+if [ ! -f "postgres-dumpall" ]; then
+    echo "ERROR: I expect to find a Postgres SQL multi-db dump file in ./postgres-dumpall"
+    exit 2
+fi
+
+for f in database.yml code.conf ; do
+    cat "$configdir/$f" |
+        sed 's/INSERT_POSTGRES_PASSWORD_HERE/'"$dbpwd"'/g' > \
+            "$configdir/$f.interpolated"
+done
+
+dockertag="cannam/soundsoftware-site"
+
+sudo docker build -t "$dockertag" -f "$managerdir/Dockerfile" .
+sudo docker run -p 8080:80 -d "$dockertag"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/Vagrantfile	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,9 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure("2") do |config|
+  config.vm.box = "ubuntu/xenial64"
+  config.vm.network "forwarded_port", guest: 80, host: 8080
+  config.vm.synced_folder "../../../..", "/vagrant-code"
+  config.vm.provision :shell, path: "vagrant-provision.sh"
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/000-apt.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+set -e
+
+apt-get update && \
+    apt-get dist-upgrade -y && \
+    apt-get install -y \
+    ack-grep \
+    apache2 \
+    apache2-dev \
+    apt-utils \
+    build-essential \
+    cron \
+    curl \
+    doxygen \
+    exim4 \
+    git \
+    graphviz \
+    imagemagick \
+    libapache-dbi-perl \
+    libapache2-mod-perl2 \
+    libapr1-dev \
+    libaprutil1-dev \
+    libauthen-simple-ldap-perl \
+    libcurl4-openssl-dev \
+    libdbd-pg-perl \
+    libpq-dev \
+    libmagickwand-dev \
+    libio-socket-ssl-perl \
+    logrotate \
+    mercurial \
+    postgresql \
+    rsync \
+    ruby \
+    ruby-dev \
+    sudo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/010-passenger.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+# Passenger gets installed through gem, not apt
+
+if [ ! -f /var/lib/gems/2.3.0/gems/passenger-4.0.60/buildout/apache2/mod_passenger.so ]; then
+    gem install passenger -v 4.0.60 --no-rdoc --no-ri
+    passenger-install-apache2-module --languages=ruby
+fi
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/020-users.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+if ! grep -q '^code:' /etc/passwd ; then
+    groupadd code
+    useradd -g code -G www-data code
+fi
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/030-webapp-dir.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -e
+
+if [ ! -d /var/www/code ]; then
+    cp -a /vagrant-code /var/www/code
+    chown -R code.www-data /var/www/code
+    find /var/www/code -type d -exec chmod g+s \{\} \;
+fi
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/040-hg-dir.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -e
+
+if [ ! -f /var/hg/index.cgi ]; then
+    mkdir -p /var/hg
+    chown code.www-data /var/hg
+    chmod g+s /var/hg
+    cp /var/www/code/extra/soundsoftware/scripted-deploy/config/index.cgi /var/hg/
+    cp /var/www/code/extra/soundsoftware/scripted-deploy/config/hgweb.config /var/hg/
+    chmod +x /var/hg/index.cgi
+fi
+
+if [ ! -d /var/hg/vamp-plugin-sdk ]; then
+    # This project can be used for testing
+    cd /var/hg
+    hg clone https://code.soundsoftware.ac.uk/hg/vamp-plugin-sdk
+    chown -R code.www-data vamp-plugin-sdk
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/050-webapp-db.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+if [ ! -f /var/www/code/config/database.yml ]; then
+    cp /var/www/code/extra/soundsoftware/scripted-deploy/config/database.yml.interpolated \
+       /var/www/code/config/database.yml
+fi
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/060-bundler.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -e
+
+cd /var/www/code
+gem install bundler
+bundle install
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/070-secret-token.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+
+cd /var/www/code
+bundle exec rake generate_secret_token
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/080-database-load.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -e
+
+/etc/init.d/postgresql start
+
+cd /var/www/code
+
+if [ -f postgres-dumpall ]; then
+    chmod ugo+r postgres-dumpall
+    sudo -u postgres psql -f postgres-dumpall postgres
+    rm postgres-dumpall # This was just a copy of the shared folder file anyway
+fi
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/090-perl-auth-module.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+if [ ! -f /usr/local/lib/site_perl/Apache/Authn/SoundSoftware.pm ]; then
+    mkdir -p /usr/local/lib/site_perl/Apache/Authn/
+    cp /var/www/code/extra/soundsoftware/SoundSoftware.pm /usr/local/lib/site_perl/Apache/Authn/
+fi
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/100-apache-config.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+set -e
+
+cd /var/www/code
+
+if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then
+    
+    rm -f /etc/apache2/sites-enabled/000-default.conf
+
+    cp extra/soundsoftware/scripted-deploy/config/passenger.conf /etc/apache2/mods-available/
+    cp extra/soundsoftware/scripted-deploy/config/passenger.load /etc/apache2/mods-available/
+    cp extra/soundsoftware/scripted-deploy/config/perl.conf      /etc/apache2/mods-available/
+
+    ln -s ../mods-available/passenger.conf  /etc/apache2/mods-enabled/
+    ln -s ../mods-available/passenger.load  /etc/apache2/mods-enabled/
+    ln -s ../mods-available/perl.conf       /etc/apache2/mods-enabled/
+    ln -s ../mods-available/expires.load    /etc/apache2/mods-enabled/
+    ln -s ../mods-available/rewrite.load    /etc/apache2/mods-enabled/
+    ln -s ../mods-available/cgi.load        /etc/apache2/mods-enabled/
+
+    cp extra/soundsoftware/scripted-deploy/config/code.conf.interpolated /etc/apache2/sites-available/code.conf
+    ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf
+
+    apache2ctl configtest
+
+fi
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/provision.d/110-apache-start.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -e
+
+apache2ctl restart
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/start.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+dbpwd="$1"
+if [ -z "$dbpwd" ]; then
+    echo "Usage: $0 <database-password>" 1>&2
+    exit 2
+fi
+
+set -eu
+
+deploydir=./extra/soundsoftware/scripted-deploy
+if [ ! -d "$deploydir" ]; then
+    echo "Run this script from the root of a working copy of soundsoftware-site"
+    exit 2
+fi
+
+managerdir="$deploydir/vagrant"
+if [ ! -d "$managerdir" ]; then
+    echo "ERROR: Required directory $managerdir not found"
+    exit 2
+fi
+
+configdir="$deploydir/config"
+if [ ! -d "$configdir" ]; then
+    echo "ERROR: Required directory $configdir not found"
+    exit 2
+fi
+
+if [ ! -f "postgres-dumpall" ]; then
+    echo "ERROR: I expect to find a Postgres SQL multi-db dump file in ./postgres-dumpall"
+    exit 2
+fi
+
+for f in database.yml code.conf ; do
+    cat "$configdir/$f" |
+        sed 's/INSERT_POSTGRES_PASSWORD_HERE/'"$dbpwd"'/g' > \
+            "$configdir/$f.interpolated"
+done
+
+cd "$managerdir"
+
+vagrant up
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/scripted-deploy/vagrant/vagrant-provision.sh	Tue Aug 15 13:33:56 2017 +0100
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+#!!! still not covered:
+# * cron jobs
+# * https
+# * web fonts
+
+set -e
+
+for f in /vagrant/provision.d/[0-9]* ; do
+    case "$f" in
+        *~) ;;
+        *) echo "Running provision script: $f"
+           /bin/bash "$f";;
+    esac
+done
+
--- a/extra/soundsoftware/vagranttest/Vagrantfile	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-Vagrant.configure("2") do |config|
-  config.vm.box = "ubuntu/xenial64"
-  config.vm.network "forwarded_port", guest: 80, host: 8080
-  config.vm.synced_folder "../../..", "/vagrant-code"
-  config.vm.provision :shell, path: "vagrant-provision.sh"
-end
--- a/extra/soundsoftware/vagranttest/provision.d/000-apt.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-set -e
-
-apt-get update && \
-    apt-get install -y \
-    ack-grep \
-    apache2 \
-    apache2-dev \
-    apt-utils \
-    build-essential \
-    cron \
-    curl \
-    doxygen \
-    exim4 \
-    git \
-    graphviz \
-    imagemagick \
-    libapache-dbi-perl \
-    libapache2-mod-perl2 \
-    libapr1-dev \
-    libaprutil1-dev \
-    libauthen-simple-ldap-perl \
-    libcurl4-openssl-dev \
-    libdbd-pg-perl \
-    libpq-dev \
-    libmagickwand-dev \
-    libio-socket-ssl-perl \
-    logrotate \
-    mercurial \
-    postgresql \
-    rsync \
-    ruby \
-    ruby-dev \
-    sudo
--- a/extra/soundsoftware/vagranttest/provision.d/010-passenger.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# Passenger gets installed through gem, not apt
-
-if [ ! -f /var/lib/gems/2.3.0/gems/passenger-4.0.60/buildout/apache2/mod_passenger.so ]; then
-    gem install passenger -v 4.0.60 --no-rdoc --no-ri
-    passenger-install-apache2-module --languages=ruby
-fi
-
--- a/extra/soundsoftware/vagranttest/provision.d/020-users.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-set -e
-
-if ! grep -q '^code:' /etc/passwd ; then
-    groupadd code
-    useradd -g code -G www-data code
-fi
-
--- a/extra/soundsoftware/vagranttest/provision.d/030-webapp-dir.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-set -e
-
-if [ ! -d /var/www/code ]; then
-    cp -a /vagrant-code /var/www/code
-    chown -R code.www-data /var/www/code
-    find /var/www/code -type d -exec chmod g+s \{\} \;
-fi
-
--- a/extra/soundsoftware/vagranttest/provision.d/040-hg-dir.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-set -e
-
-if [ ! -f /var/hg/index.cgi ]; then
-    mkdir -p /var/hg
-    chown code.www-data /var/hg
-    chmod g+s /var/hg
-    cp /var/www/code/extra/soundsoftware/dockertest/index.cgi /var/hg/
-    cp /var/www/code/extra/soundsoftware/dockertest/hgweb.config /var/hg/
-    chmod +x /var/hg/index.cgi
-fi
-
-if [ ! -d /var/hg/vamp-plugin-sdk ]; then
-    # This project can be used for testing
-    cd /var/hg
-    hg clone https://code.soundsoftware.ac.uk/hg/vamp-plugin-sdk
-    chown -R code.www-data vamp-plugin-sdk
-fi
--- a/extra/soundsoftware/vagranttest/provision.d/050-webapp-db.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-set -e
-
-#!!! This will fail until we have the user-supplied password
-#!!! interpolation logic (also the path is silly)
-
-if [ ! -f /var/www/code/config/database.yml ]; then
-    cp /var/www/code/extra/soundsoftware/dockertest/database.yml.interpolated \
-       /var/www/code/config/database.yml
-fi
-
--- a/extra/soundsoftware/vagranttest/provision.d/060-bundler.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-set -e
-
-cd /var/www/code
-gem install bundler
-bundle install
-
--- a/extra/soundsoftware/vagranttest/provision.d/070-secret-token.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-set -e
-
-cd /var/www/code
-bundle exec rake generate_secret_token
-
--- a/extra/soundsoftware/vagranttest/provision.d/080-database-load.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-set -e
-
-/etc/init.d/postgresql start
-
-cd /var/www/code
-
-if [ -f postgres-dumpall ]; then
-    chmod ugo+r postgres-dumpall
-    sudo -u postgres psql -f postgres-dumpall postgres
-    rm postgres-dumpall # This was just a copy of the shared folder file anyway
-fi
-
-
-
--- a/extra/soundsoftware/vagranttest/provision.d/090-perl-auth-module.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-set -e
-
-if [ ! -f /usr/local/lib/site_perl/Apache/Authn/SoundSoftware.pm ]; then
-    mkdir -p /usr/local/lib/site_perl/Apache/Authn/
-    cp /var/www/code/extra/soundsoftware/SoundSoftware.pm /usr/local/lib/site_perl/Apache/Authn/
-fi
-
--- a/extra/soundsoftware/vagranttest/provision.d/100-apache-config.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-set -e
-
-cd /var/www/code
-
-#!!! This will fail until we have the user-supplied password
-#!!! interpolation logic (also the source paths are silly)
-
-if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then
-    
-    rm -f /etc/apache2/sites-enabled/000-default.conf
-
-    cp extra/soundsoftware/dockertest/passenger.conf /etc/apache2/mods-available/
-    cp extra/soundsoftware/dockertest/passenger.load /etc/apache2/mods-available/
-    cp extra/soundsoftware/dockertest/perl.conf      /etc/apache2/mods-available/
-
-    ln -s ../mods-available/passenger.conf  /etc/apache2/mods-enabled/
-    ln -s ../mods-available/passenger.load  /etc/apache2/mods-enabled/
-    ln -s ../mods-available/perl.conf       /etc/apache2/mods-enabled/
-    ln -s ../mods-available/expires.load    /etc/apache2/mods-enabled/
-    ln -s ../mods-available/rewrite.load    /etc/apache2/mods-enabled/
-    ln -s ../mods-available/cgi.load        /etc/apache2/mods-enabled/
-
-    cp extra/soundsoftware/dockertest/code.conf.interpolated /etc/apache2/sites-available/code.conf
-    ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf
-
-    apache2ctl configtest
-
-fi
-
--- a/extra/soundsoftware/vagranttest/vagrant-provision.sh	Fri Aug 04 18:01:54 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-#!!! still not covered:
-# * user-supplied db password
-# * cron jobs
-# * https
-# * web fonts
-
-set -e
-
-for f in /vagrant/provision.d/[0-9]* ; do
-    case "$f" in
-        *~) ;;
-        *) echo "Running provision script: $f"
-           /bin/bash "$f";;
-    esac
-done
-