From 157943a7032ee8f5844cfbee1bd7a93886f83ed2 Mon Sep 17 00:00:00 2001
From: pierreozoux <pierre@ozoux.net>
Date: Tue, 4 Nov 2014 18:07:18 +0000
Subject: [PATCH] Moves per-user and server-wide

---
 Vagrantfile                         |  2 +-
 deploy/add-placeholder-site.sh      |  4 ++--
 deploy/add-site.sh                  |  4 ++--
 deploy/approve-certs.sh             |  2 +-
 deploy/deploy.sh                    |  4 ++--
 doc/architecture-overview.md        |  8 +++----
 doc/deploying-a-server.md           |  6 ++---
 doc/getting-started-as-a-hoster.md  |  2 +-
 importers/backup-snapshot.sh        | 36 ++++++++++++++---------------
 importers/mysql.sh                  |  6 ++---
 importers/nginx.sh                  | 12 +++++-----
 importers/wordpress.sh              |  6 ++---
 scripts/activate-user.sh            |  4 ++--
 scripts/backup-init.sh              | 18 +++++++--------
 scripts/setup.sh                    | 10 ++++----
 unit-files/haproxy-confd.service    |  2 +-
 unit-files/haproxy.path             |  2 +-
 unit-files/haproxy.service          |  2 +-
 unit-files/mysql@.service           |  4 ++--
 unit-files/nginx-gitpuller@.path    |  2 +-
 unit-files/nginx-gitpuller@.service |  2 +-
 unit-files/nginx@.service           |  2 +-
 unit-files/postfix.service          |  2 +-
 unit-files/wordpress@.service       |  6 ++---
 24 files changed, 74 insertions(+), 74 deletions(-)

diff --git a/Vagrantfile b/Vagrantfile
index ed8a35d..4bcc60a 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -44,7 +44,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
       core.vm.network :private_network, ip: "#{BASE_IP_ADDR}.#{i+1}"
       core.vm.synced_folder ".", "/data/indiehosters", id: "coreos-indiehosters", :nfs => true, :mount_options => ['nolock,vers=3,udp']
       core.vm.provision :file, source: "./cloud-config", destination: "/tmp/vagrantfile-user-data"
-      core.vm.provision :shell, inline: "mkdir -p /data/server-wide/haproxy/approved-certs; cp /data/indiehosters/scripts/unsecure-certs/*.pem /data/server-wide/haproxy/approved-certs"
+      core.vm.provision :shell, inline: "mkdir -p /data/runtime/haproxy/approved-certs; cp /data/indiehosters/scripts/unsecure-certs/*.pem /data/runtime/haproxy/approved-certs"
       core.vm.provision :shell, path: "./scripts/setup.sh", args: [HOSTNAME]
     end
   end
diff --git a/deploy/add-placeholder-site.sh b/deploy/add-placeholder-site.sh
index 822615e..8aa0d5b 100755
--- a/deploy/add-placeholder-site.sh
+++ b/deploy/add-placeholder-site.sh
@@ -15,6 +15,6 @@ fi
 echo "Adding $DOMAIN to $SERVER with cert from $PEMFILE"
 echo "Remote user is $USER"
 
-ssh $USER@$SERVER sudo mkdir -p /data/per-user/$DOMAIN/nginx/data
-scp $PEMFILE $USER@$SERVER:/data/server-wide/haproxy/approved-certs/$DOMAIN.pem
+ssh $USER@$SERVER sudo mkdir -p /data/domains/$DOMAIN/nginx/data
+scp $PEMFILE $USER@$SERVER:/data/runtime/haproxy/approved-certs/$DOMAIN.pem
 ssh $USER@$SERVER sudo sh /data/indiehosters/scripts/activate-user.sh $DOMAIN nginx
diff --git a/deploy/add-site.sh b/deploy/add-site.sh
index 2afb641..da4741a 100755
--- a/deploy/add-site.sh
+++ b/deploy/add-site.sh
@@ -17,6 +17,6 @@ fi
 echo "Adding $DOMAIN to $SERVER, running $IMAGE behind $PEMFILE and pulling from $GITREPO"
 echo "Remote user is $USER"
 
-ssh $USER@$SERVER sudo mkdir -p /data/per-user/$DOMAIN/$IMAGE/data
-scp $PEMFILE $USER@$SERVER:/data/server-wide/haproxy/approved-certs/$DOMAIN.pem
+ssh $USER@$SERVER sudo mkdir -p /data/domains/$DOMAIN/$IMAGE/data
+scp $PEMFILE $USER@$SERVER:/data/runtime/haproxy/approved-certs/$DOMAIN.pem
 ssh $USER@$SERVER sudo sh /data/indiehosters/scripts/activate-user.sh $DOMAIN $IMAGE $GITREPO
diff --git a/deploy/approve-certs.sh b/deploy/approve-certs.sh
index 5c5af8b..4839bce 100755
--- a/deploy/approve-certs.sh
+++ b/deploy/approve-certs.sh
@@ -2,5 +2,5 @@
 for i in `deploy/list-sites.sh $1`; do
   echo "Approving combined cert for $i";
   cp ../orchestration/TLS/combined/$i.pem ../orchestration/TLS/approved-certs/$i.pem;
-  scp ../orchestration/TLS/approved-certs/$i.pem root@$1:/data/server-wide/haproxy/approved-certs/
+  scp ../orchestration/TLS/approved-certs/$i.pem root@$1:/data/runtime/haproxy/approved-certs/
 done
diff --git a/deploy/deploy.sh b/deploy/deploy.sh
index 1eaef96..195fb6d 100755
--- a/deploy/deploy.sh
+++ b/deploy/deploy.sh
@@ -21,10 +21,10 @@ else
   USER="core"
 fi
 
-if [ -e "${FOLDER}server-wide/haproxy/approved-certs/${SERVER}.pem" ]; then
+if [ -e "${FOLDER}runtime/haproxy/approved-certs/${SERVER}.pem" ]; then
   DEFAULTSITE=$SERVER
 else
-  echo "Please make sure ${FOLDER}server-wide/haproxy/approved-certs/${SERVER}.pem exists, then retry"
+  echo "Please make sure ${FOLDER}runtime/haproxy/approved-certs/${SERVER}.pem exists, then retry"
   exit 1
 fi
 
diff --git a/doc/architecture-overview.md b/doc/architecture-overview.md
index ce46570..47a0b37 100644
--- a/doc/architecture-overview.md
+++ b/doc/architecture-overview.md
@@ -4,17 +4,17 @@ Our architecture revolves around a
 
 ## Server-wide processes
 
-The haproxy.* and postfix.* unit files correspond to two server-wide processes. They run Docker containers from images in the
+The haproxy.* and postfix.* unit files correspond to two server wide processes. They run Docker containers from images in the
 [server-wide/ folder of our dockerfiles repo](https://github.com/indiehosters/dockerfiles/tree/master/server-wide).
-The haproxy-confd.* unit starts a side-kick service for haproxy, which monitors `etcdctl ls /services` to see if any new backends were created, and updates the haproxy configuration, which lives in `/data/server-wide/haproxy/` on the host sytem. It is required by the haproxy.* unit. That means that when you run `systemctl start haproxy`, and then run `docker ps` or `systemctl list-units`, you will see that systemd not only started the haproxy container, but also the haproxy-confd container.
+The haproxy-confd.* unit starts a side-kick service for haproxy, which monitors `etcdctl ls /services` to see if any new backends were created, and updates the haproxy configuration, which lives in `/data/runtime/haproxy/` on the host sytem. It is required by the haproxy.* unit. That means that when you run `systemctl start haproxy`, and then run `docker ps` or `systemctl list-units`, you will see that systemd not only started the haproxy container, but also the haproxy-confd container.
 
-There is currently no similar side-kick for updating `/data/server-wide/postfix/`, so you will have to update the configuration files in that folder manually, and then run `systemctl restart postfix`.
+There is currently no similar side-kick for updating `/data/runtime/postfix/`, so you will have to update the configuration files in that folder manually, and then run `systemctl restart postfix`.
 
 The `scripts/setup.sh` takes care of setting up etcd, enabling and starting the haproxy and postfix service (as well as one haproxy backend, to serve the default site), and the haproxy-confd side-kick to listen for changes in the backends configuration in etcd, so that new backends are automatically added to the haproxy config as soon as their IP address is written into etcd.
 
 ## HAProxy backends: nginx, wordpress
 
-A per-user process is a haproxy backend for a specific domain name. At the time of writing we have two applications available: nginx and wordpress.
+A per user process is a haproxy backend for a specific domain name. At the time of writing we have two applications available: nginx and wordpress.
 
 You will notice there are also some other units in the `unit-files/` folder of this repo, like the gitpuller and mysql ones. Whenever you start a wordpress unit, it requires a mysql service.
 Whenever you start an nginx unit, it wants a gitpuller unit. In all three cases, an -importer unit and a -discovery unit are required.
diff --git a/doc/deploying-a-server.md b/doc/deploying-a-server.md
index f02af21..eafe5f6 100644
--- a/doc/deploying-a-server.md
+++ b/doc/deploying-a-server.md
@@ -12,8 +12,8 @@ Make sure you read [getting started](getting-started-as-a-hoster.md) first.
 * Add k3 to your /etc/hosts with the right IP address
 * If you have used this name before, run `./deploy/forget-server-fingerprint.sh k3`
 * From the root folder of this repository, run `sh ./deploy/deploy.sh k3 ./data/ master root` (where `./data/` should contain
-  `server-wide/postfix/`
-  and `server-wide/haproxy/approved-certs/k3.pem`; see the existing folder `data/` in this repo for an example of what the email forwards and
+  `runtime/postfix/`
+  and `runtime/haproxy/approved-certs/k3.pem`; see the existing folder `data/` in this repo for an example of what the email forwards and
   TLS certificate files should look like).
 * Add the default site by following the 'Adding a website to your server' instructions below with domain name k3 instead of example.com
 * The rest should be automatic!
@@ -40,7 +40,7 @@ Make sure you read [getting started](getting-started-as-a-hoster.md) first.
   * Decide which image to run as the user's main website software (in version 0.1 only 'nginx' is supported)
   * If you already have some content that should go on there, and which is compatible with the image you chose,
     put it in a public git repository somewhere.
-  * Unless there is already a TLS certificate at `./data/server-wide/haproxy/example.com.pem` get one
+  * Unless there is already a TLS certificate at `./data/runtime/haproxy/example.com.pem` get one
     (from StartSSL or elswhere) for example.com and concatenate the certificate
     and its unencrypted private key into `indiehosters/user-data/example.com/tls.pem`
   * Make sure the TLS certificate is valid (use `scripts/check-cert.sh` for this).
diff --git a/doc/getting-started-as-a-hoster.md b/doc/getting-started-as-a-hoster.md
index fe8dd24..85039a4 100644
--- a/doc/getting-started-as-a-hoster.md
+++ b/doc/getting-started-as-a-hoster.md
@@ -25,7 +25,7 @@ third-party service providers, alongside the services which
 you run on your own servers.
 Note that although it's probably inevitable that you resell DNR and TLS services from some third party, and your monitoring would ideally
 also run on a system that's decoupled from your actual servers, you may not be reselling DNS
-hosting. If you host DNS for your customer on server-wide bind services that directly read data from files on the per-user data folders,
+hosting. If you host DNS for your customer on server-wide bind services that directly read data from files on the per domain data folders,
 then DNS data will be considered user-data for you.
 
 # User data
diff --git a/importers/backup-snapshot.sh b/importers/backup-snapshot.sh
index 2472dcb..ec69584 100755
--- a/importers/backup-snapshot.sh
+++ b/importers/backup-snapshot.sh
@@ -1,38 +1,38 @@
 #!/bin/bash -eux
 
-if [ -e /data/per-user/$DOMAIN/mysql ]; then
+if [ -e /data/domains/$DOMAIN/mysql ]; then
   echo backing up mysql databases for $DOMAIN
-  mkdir -p /data/per-user/$DOMAIN/backup/mysql/
-  cp /data/per-user/$DOMAIN/mysql/.env /data/per-user/$DOMAIN/backup/mysql/.env
+  mkdir -p /data/domains/$DOMAIN/backup/mysql/
+  cp /data/domains/$DOMAIN/mysql/.env /data/domains/$DOMAIN/backup/mysql/.env
   /usr/bin/docker run --link mysql-$DOMAIN:db\
-     --env-file /data/per-user/$DOMAIN/mysql/.env \
+     --env-file /data/domains/$DOMAIN/mysql/.env \
      indiehosters/mysql mysqldump --all-databases --events -u admin \
-     -p$(cat /data/per-user/$DOMAIN/mysql/.env | cut -d'=' -f2) \
-     -h db > /data/per-user/$DOMAIN/backup/mysql/dump.sql
+     -p$(cat /data/domains/$DOMAIN/mysql/.env | cut -d'=' -f2) \
+     -h db > /data/domains/$DOMAIN/backup/mysql/dump.sql
 fi
 
-if [ -e /data/per-user/$DOMAIN/wordpress ]; then
+if [ -e /data/domains/$DOMAIN/wordpress ]; then
   echo backing up www from wordpress for $DOMAIN
-  mkdir -p /data/per-user/$DOMAIN/backup/www/
-  rsync -r /data/per-user/$DOMAIN/wordpress /data/per-user/$DOMAIN/backup/www/wordpress
+  mkdir -p /data/domains/$DOMAIN/backup/www/
+  rsync -r /data/domains/$DOMAIN/wordpress /data/domains/$DOMAIN/backup/www/wordpress
 fi
 
-if [ -e /data/per-user/$DOMAIN/nginx ]; then
+if [ -e /data/domains/$DOMAIN/nginx ]; then
   echo backing up www from nginx for $DOMAIN
-  mkdir -p /data/per-user/$DOMAIN/backup/www/nginx/
-  if [ -e /data/per-user/$DOMAIN/nginx/data/GITURL ]; then
-    cp /data/per-user/$DOMAIN/nginx/data/GITURL /data/per-user/$DOMAIN/backup/www/nginx/GITURL
+  mkdir -p /data/domains/$DOMAIN/backup/www/nginx/
+  if [ -e /data/domains/$DOMAIN/nginx/data/GITURL ]; then
+    cp /data/domains/$DOMAIN/nginx/data/GITURL /data/domains/$DOMAIN/backup/www/nginx/GITURL
   else
-    rsync -r /data/per-user/$DOMAIN/nginx/data/www-content /data/per-user/$DOMAIN/backup/www/nginx/www-content
+    rsync -r /data/domains/$DOMAIN/nginx/data/www-content /data/domains/$DOMAIN/backup/www/nginx/www-content
   fi
 fi
 
 echo copying TLS cert
-mkdir -p /data/per-user/$DOMAIN/backup/TLS/
-cp /data/server-wide/haproxy/approved-certs/$DOMAIN.pem /data/per-user/$DOMAIN/backup/TLS/$DOMAIN.pem
+mkdir -p /data/domains/$DOMAIN/backup/TLS/
+cp /data/runtime/haproxy/approved-certs/$DOMAIN.pem /data/domains/$DOMAIN/backup/TLS/$DOMAIN.pem
 
 echo committing everything
-cd /data/per-user/$DOMAIN/backup/
+cd /data/domains/$DOMAIN/backup/
 pwd
 git add *
 git status
@@ -42,7 +42,7 @@ git config --local user.name "`hostname` hourly backups"
 git config --local push.default simple
 
 git commit -m"backup $DOMAIN @ `hostname` - `date`"
-if [ -e /data/per-user/$DOMAIN/backup/BACKUPDEST ]; then
+if [ -e /data/domains/$DOMAIN/backup/BACKUPDEST ]; then
   git pull --rebase
   git push
 fi
diff --git a/importers/mysql.sh b/importers/mysql.sh
index b0aac26..6658f65 100755
--- a/importers/mysql.sh
+++ b/importers/mysql.sh
@@ -1,6 +1,6 @@
 #!/bin/bash -eux
 
-if [ ! -d "/data/per-user/$DOMAIN/mysql/data" ]; then
-  mkdir -p /data/per-user/$DOMAIN/mysql/data
-  echo MYSQL_PASS=`echo $RANDOM  ${date} | md5sum | base64 | cut -c-10` > /data/per-user/$DOMAIN/mysql/.env
+if [ ! -d "/data/domains/$DOMAIN/mysql/data" ]; then
+  mkdir -p /data/domains/$DOMAIN/mysql/data
+  echo MYSQL_PASS=`echo $RANDOM  ${date} | md5sum | base64 | cut -c-10` > /data/domains/$DOMAIN/mysql/.env
 fi
diff --git a/importers/nginx.sh b/importers/nginx.sh
index 996606f..3a3ff8f 100755
--- a/importers/nginx.sh
+++ b/importers/nginx.sh
@@ -1,11 +1,11 @@
 #!/bin/bash -eux
 
-if [ ! -e "/data/per-user/$DOMAIN/nginx/data/www-content/index.html" ]; then
-  if [ -e "/data/per-user/$DOMAIN/nginx/data/GITURL" ]; then
-    git clone `cat /data/per-user/$DOMAIN/nginx/data/GITURL` /data/per-user/$DOMAIN/nginx/data/www-content
-    cd /data/per-user/$DOMAIN/nginx/data/www-content && git checkout master
+if [ ! -e "/data/domains/$DOMAIN/nginx/data/www-content/index.html" ]; then
+  if [ -e "/data/domains/$DOMAIN/nginx/data/GITURL" ]; then
+    git clone `cat /data/domains/$DOMAIN/nginx/data/GITURL` /data/domains/$DOMAIN/nginx/data/www-content
+    cd /data/domains/$DOMAIN/nginx/data/www-content && git checkout master
   else
-    mkdir -p /data/per-user/$DOMAIN/nginx/data/www-content
-    echo Hello $DOMAIN > /data/per-user/$DOMAIN/nginx/data/www-content/index.html
+    mkdir -p /data/domains/$DOMAIN/nginx/data/www-content
+    echo Hello $DOMAIN > /data/domains/$DOMAIN/nginx/data/www-content/index.html
   fi
 fi
diff --git a/importers/wordpress.sh b/importers/wordpress.sh
index 65f799b..ca01be9 100755
--- a/importers/wordpress.sh
+++ b/importers/wordpress.sh
@@ -1,8 +1,8 @@
 #!/bin/bash -eux
 
-if [ ! -d "/data/per-user/$DOMAIN/wordpress/data" ]; then
-  cd /data/per-user/$DOMAIN/
+if [ ! -d "/data/domains/$DOMAIN/wordpress/data" ]; then
+  cd /data/domains/$DOMAIN/
   tar xvzf /data/indiehosters/blueprints/wordpress.tgz
 fi
 
-cat /data/per-user/$DOMAIN/mysql/.env | sed s/MYSQL_PASS/DB_PASS/ > /data/per-user/$DOMAIN/wordpress/.env
+cat /data/domains/$DOMAIN/mysql/.env | sed s/MYSQL_PASS/DB_PASS/ > /data/domains/$DOMAIN/wordpress/.env
diff --git a/scripts/activate-user.sh b/scripts/activate-user.sh
index c4ce8dd..7cb4ce2 100755
--- a/scripts/activate-user.sh
+++ b/scripts/activate-user.sh
@@ -7,10 +7,10 @@ else
   echo "Usage: sh /data/indiehosters/scripts/activate-user.sh domain image [gitrepo]"
   exit 1
 fi
-mkdir -p /data/per-user/$DOMAIN/$IMAGE/data
+mkdir -p /data/domains/$DOMAIN/$IMAGE/data
 if [ $# -ge 3 ]; then
   GITREPO=$3
-  echo $GITREPO > /data/per-user/$DOMAIN/$IMAGE/data/GITURL
+  echo $GITREPO > /data/domains/$DOMAIN/$IMAGE/data/GITURL
 fi
 
 # Start service for new site (and create the user). This will also enable the git puller.
diff --git a/scripts/backup-init.sh b/scripts/backup-init.sh
index 27f5c0f..c10e764 100755
--- a/scripts/backup-init.sh
+++ b/scripts/backup-init.sh
@@ -9,21 +9,21 @@ fi
 echo "Adding backup job for $DOMAIN to $BACKUPDEST"
 
 echo "First, trying to clone latest master from $BACKUPDEST"
-git clone $BACKUPDEST /data/per-user/$DOMAIN/backup
+git clone $BACKUPDEST /data/domains/$DOMAIN/backup
 
-sudo mkdir -p /data/per-user/$DOMAIN/backup
-sudo echo "$BACKUPDEST" > /data/per-user/$DOMAIN/backup/BACKUPDEST
+sudo mkdir -p /data/domains/$DOMAIN/backup
+sudo echo "$BACKUPDEST" > /data/domains/$DOMAIN/backup/BACKUPDEST
 
 echo initializing backups for $DOMAIN
-mkdir -p /data/per-user/$DOMAIN/backup/mysql
-mkdir -p /data/per-user/$DOMAIN/backup/www
-mkdir -p /data/per-user/$DOMAIN/backup/TLS
-cd /data/per-user/$DOMAIN/backup/
+mkdir -p /data/domains/$DOMAIN/backup/mysql
+mkdir -p /data/domains/$DOMAIN/backup/www
+mkdir -p /data/domains/$DOMAIN/backup/TLS
+cd /data/domains/$DOMAIN/backup/
 git config --local user.email "backups@`hostname`"
 git config --local user.name "`hostname` hourly backups"
 git config --local push.default simple
 
-if [ -e /data/per-user/$DOMAIN/backup/.git ]; then
+if [ -e /data/domains/$DOMAIN/backup/.git ]; then
   git init
 fi
 echo "backups of $DOMAIN at IndieHosters server `hostname`" > README.md
@@ -31,6 +31,6 @@ git add README.md
 git commit -m"initial commit"
 
 echo "Pushing initial commit to $BACKUPDEST master branch"
-cd /data/per-user/$DOMAIN/backup/
+cd /data/domains/$DOMAIN/backup/
 git remote add destination $BACKUPDEST
 git push -u destination master
diff --git a/scripts/setup.sh b/scripts/setup.sh
index 764284d..5436859 100755
--- a/scripts/setup.sh
+++ b/scripts/setup.sh
@@ -29,17 +29,17 @@ sh /data/indiehosters/scripts/activate-user.sh $HOSTNAME nginx
 etcdctl set /services/default '{"app":"nginx", "hostname":"'$HOSTNAME'"}'
 
 # Configure and start HAproxy
-mkdir -p /data/server-wide/haproxy/approved-certs
+mkdir -p /data/runtime/haproxy/approved-certs
 systemctl enable haproxy-confd.service
 systemctl start  haproxy-confd.service
 systemctl enable haproxy.path
 systemctl start  haproxy.path
 
 # Configure and start postfix
-mkdir -p /data/server-wide/postfix
-touch /data/server-wide/postfix/hostname
-touch /data/server-wide/postfix/destinations
-touch /data/server-wide/postfix/forwards
+mkdir -p /data/runtime/postfix
+touch /data/runtime/postfix/hostname
+touch /data/runtime/postfix/destinations
+touch /data/runtime/postfix/forwards
 
 systemctl enable postfix.service
 systemctl start  postfix.service
diff --git a/unit-files/haproxy-confd.service b/unit-files/haproxy-confd.service
index f23d2cb..fc97093 100644
--- a/unit-files/haproxy-confd.service
+++ b/unit-files/haproxy-confd.service
@@ -16,7 +16,7 @@ ExecStartPre=-/usr/bin/docker kill %p
 ExecStartPre=-/usr/bin/docker rm %p
 ExecStart=/usr/bin/docker run \
   --name %p \
-  -v /data/server-wide/haproxy/:/etc/haproxy/ \
+  -v /data/runtime/haproxy/:/etc/haproxy/ \
   -v /data/indiehosters/confd/:/etc/confd/ \
   -v /var/run/docker.sock:/var/run/docker.sock \
   indiehosters/confd
diff --git a/unit-files/haproxy.path b/unit-files/haproxy.path
index 32f78b1..ed6a19b 100644
--- a/unit-files/haproxy.path
+++ b/unit-files/haproxy.path
@@ -1,5 +1,5 @@
 [Path]
-PathExists=/data/server-wide/haproxy/haproxy.cfg
+PathExists=/data/runtime/haproxy/haproxy.cfg
 
 [Install]
 WantedBy=multi-user.target
diff --git a/unit-files/haproxy.service b/unit-files/haproxy.service
index bb35251..2c13025 100644
--- a/unit-files/haproxy.service
+++ b/unit-files/haproxy.service
@@ -13,7 +13,7 @@ ExecStartPre=-/usr/bin/docker kill %p
 ExecStartPre=-/usr/bin/docker rm %p
 ExecStart=/usr/bin/docker run \
   --name %p \
-  -v /data/server-wide/haproxy:/etc/haproxy \
+  -v /data/runtime/haproxy:/etc/haproxy \
   -p 80:80 \
   -p 443:443 \
   indiehosters/haproxy
diff --git a/unit-files/mysql@.service b/unit-files/mysql@.service
index f1d6da9..46d9a34 100644
--- a/unit-files/mysql@.service
+++ b/unit-files/mysql@.service
@@ -15,8 +15,8 @@ ExecStartPre=-/usr/bin/docker kill %p-%i
 ExecStartPre=-/usr/bin/docker rm %p-%i
 ExecStart=/usr/bin/docker run \
   --name %p-%i \
-  -v /data/per-user/%i/%p/data:/var/lib/mysql \
-  --env-file /data/per-user/%i/%p/.env \
+  -v /data/domains/%i/%p/data:/var/lib/mysql \
+  --env-file /data/domains/%i/%p/.env \
   indiehosters/mysql
 ExecReload=/usr/bin/docker restart %p-%i
 ExecStop=/usr/bin/docker stop %p-%i
diff --git a/unit-files/nginx-gitpuller@.path b/unit-files/nginx-gitpuller@.path
index 4ed6246..0431878 100644
--- a/unit-files/nginx-gitpuller@.path
+++ b/unit-files/nginx-gitpuller@.path
@@ -5,5 +5,5 @@ Description=Start the timer if there is a GITURL file
 BindsTo=nginx@%i.service
 
 [Path]
-PathExists=/data/per-user/%i/nginx/data/GITURL
+PathExists=/data/domains/%i/nginx/data/GITURL
 Unit=nginx-gitpuller@%i.timer
diff --git a/unit-files/nginx-gitpuller@.service b/unit-files/nginx-gitpuller@.service
index 7a85e63..17fcba2 100644
--- a/unit-files/nginx-gitpuller@.service
+++ b/unit-files/nginx-gitpuller@.service
@@ -5,5 +5,5 @@ Description=git puller
 Type=oneshot
 ExecStart=/bin/bash -euxc ' \
   app=`echo %p | cut -d"-" -f1`; \
-  cd /data/per-user/%i/$app/data/www-content; \
+  cd /data/domains/%i/$app/data/www-content; \
   git pull'
diff --git a/unit-files/nginx@.service b/unit-files/nginx@.service
index 82bdb9c..c4a2797 100644
--- a/unit-files/nginx@.service
+++ b/unit-files/nginx@.service
@@ -19,7 +19,7 @@ ExecStartPre=-/usr/bin/docker kill %p-%i
 ExecStartPre=-/usr/bin/docker rm %p-%i
 ExecStart=/usr/bin/docker run \
   --name %p-%i \
-  -v /data/per-user/%i/%p/data/www-content:/app \
+  -v /data/domains/%i/%p/data/www-content:/app \
   indiehosters/nginx
 ExecReload=/usr/bin/docker restart %p-%i
 ExecStop=/usr/bin/docker stop %p-%i
diff --git a/unit-files/postfix.service b/unit-files/postfix.service
index bd2dfaa..c30de90 100644
--- a/unit-files/postfix.service
+++ b/unit-files/postfix.service
@@ -13,7 +13,7 @@ ExecStartPre=-/usr/bin/docker kill %p
 ExecStartPre=-/usr/bin/docker rm %p
 ExecStart=/usr/bin/docker run \
   --name %p \
-  -v /data/server-wide/postfix/:/data \
+  -v /data/runtime/postfix/:/data \
   -p 25:25 \
   indiehosters/postfix-forwarder
 ExecReload=/usr/bin/docker restart %p
diff --git a/unit-files/wordpress@.service b/unit-files/wordpress@.service
index 297e883..69a6111 100644
--- a/unit-files/wordpress@.service
+++ b/unit-files/wordpress@.service
@@ -22,9 +22,9 @@ ExecStartPre=-/usr/bin/docker rm %p-%i
 ExecStart=/usr/bin/docker run \
   --name %p-%i \
   --link mysql-%i:db \
-  -v /data/per-user/%i/%p/data/wp-content:/app/wp-content \
-  -v /data/per-user/%i/%p/data/.htaccess:/app/.htaccess \
-  --env-file /data/per-user/%i/%p/.env \
+  -v /data/domains/%i/%p/data/wp-content:/app/wp-content \
+  -v /data/domains/%i/%p/data/.htaccess:/app/.htaccess \
+  --env-file /data/domains/%i/%p/.env \
   indiehosters/wordpress
 ExecReload=/usr/bin/docker restart %p-%i
 ExecStop=/usr/bin/docker stop %p-%i
-- 
GitLab