From ffa2efd33142cfd1974cb5420c081bb42c40b75c Mon Sep 17 00:00:00 2001 From: Michiel de Jong <michiel@unhosted.org> Date: Mon, 17 Nov 2014 12:46:03 +0000 Subject: [PATCH] fix backups, close #43 --- doc/deploying-a-server.md | 2 +- unit-files/backup@.service | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/deploying-a-server.md b/doc/deploying-a-server.md index c1e2410..4e062c2 100644 --- a/doc/deploying-a-server.md +++ b/doc/deploying-a-server.md @@ -15,7 +15,7 @@ Make sure you read [getting started](getting-started-as-a-hoster.md) first. * Ssh into your server, and run `ssh-keygen -t rsa` (use all the default settings, empty passphrase) * Set up a backups server at an independent location (at least a different data center, but preferably also a different IaaS provider, the bu25 plan of https://securedragon.net/ is a good option at 3 dollars per month). * Set up a git server by following http://www.git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server (no need to set up any repos like 'project.git' yet). Let's call the backup server 'bu25' (add this to /etc/hosts on k3). -* Add the ssh key from k3 to the authorized_keys for the git user (not the root user) on bu25. +* Add the ssh key from k3:.ssh/id_rsa.pub to the authorized_keys for the git user (not the root user) on bu25. * Check that you can `ssh git@bu25` from k3. * Exit from the double ssh back to your laptop, and from the root folder of this repository, run `sh ./deploy/deploy.sh k3 git@bu25 master root` * The rest should be automatic! (ignore the warning about backup.dev, and note that haproxy will not start as long as there are no website on your server). diff --git a/unit-files/backup@.service b/unit-files/backup@.service index 69260b5..7551fc9 100644 --- a/unit-files/backup@.service +++ b/unit-files/backup@.service @@ -24,6 +24,8 @@ ExecStart=/bin/bash -euxc ' \ cd /data/domains/%i/; \ git add *; \ git status; \ + git config --local user.email "backups@%i"; \ + git config --local user.name "backup service running at %i"; \ git commit --allow-empty -m"backup %i @ `hostname` - `date`"; \ # be careful: hidden sync functionnality; \ git pull --rebase; \ -- GitLab