Skip to content

Commit

Permalink
clean up a/ to remove swiftauth, directly use the duplicity hubic bac…
Browse files Browse the repository at this point in the history
…kend
  • Loading branch information
jonasschneider committed Apr 10, 2015
1 parent 36f3392 commit 1cac3f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 113 deletions.
26 changes: 12 additions & 14 deletions a/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
Strategy A is the most crude and hacky one, but has also been in use for longest. (Also, there are no integration tests.)
Strategy A is the most crude and hacky one, has no integration tests, but been in active use for pretty long.

Follow the following checklist on a fairly recent Ubuntu-ish Linux box in order to get weekly incremental updates and a full update every three months, created using [Duplicity](http://duplicity.nongnu.org/).
Follow the below checklist on a fairly recent Ubuntu-ish Linux box (other platforms should work with adjustments) in order to get weekly incremental updates and a full update every three months, created using [Duplicity](http://duplicity.nongnu.org/).

- Install a recent version (>= 0.7.0) of [Duplicity](http://duplicity.nongnu.org/) -- the one that comes with Ubuntu 14.04 is too old and doesn't support the HubiC backend.
- Sign up for a [HubiC](https://hubic.com/en/offers/) account (I recommend the 10TB plan).
- Following the [HubiC API docs](https://api.hubic.com/sandbox/), create an OAuth client application. Use whatever trickery necessary (i.e. the Ruby oauth client libraries, or just cURL) to get the OAuth tokens. You don't need to do this ever again.
- Configure `swiftauth-server` at the places marked with `XXX`. These parameters should also be kept in a safe place.
- Install `swiftauth-server` to `/root/bin/swiftauth-server`.
- Ensure `swiftauth-server` is always running. You can do this with an Upstart job like this:
- In your HubiC account settings, create an application in the "Developer" panel. Put your hubic account data into `/root/.hubic_credentials`:

# cat /etc/init/haven-swiftauth-server.conf
description "haven swiftauth server"

respawn
respawn limit 1000 60

exec /root/bin/swiftauth-server
root@qubit:~# cat .hubic_credentials
[hubic]
email = <your hubic email>
password = <your hubic password>
client_id = <client_id>
client_secret = <secret>
redirect_uri = http://localhost/

- For reporting, sign up for a [Postmark](https://postmarkapp.com/) account. They will give you an API token. Place that into `/etc/postmark-api-token` -- the contents should look like a UUID.
- Install `report` to `/usr/local/bin/report` and customize the sender and recipient addresses. This is a convenience script for people behind NATs who just want to send a bit of email. `$ echo Test report | report test_service` tests the email setup.
- Install `backup-tank` to `/root/bin/backup-tank`, and configure the `swift://` destination address.
- Install `backup-tank` to `/root/bin/backup-tank`.
- Generate a passphrase (`pwgen` should do) and put it in `/.backupkey` (or change the path in `backup-tank`.)
- If your ZFS dataset name isn't `tank`, change it in the last line of `backup-tank`.
- Finally, add a cronjob to trigger the backup:
Expand Down
6 changes: 1 addition & 5 deletions a/backup-tank
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ set -ux
OPTIONS="--full-if-older-than 3M --allow-source-mismatch --volsize 100 -vnotice"

# Where to backup to
TARGETBASE=swift://duplicity-qubit
TARGETBASE=cf+hubic://`hostname`-haven-a

export PASSPHRASE=$(cat /.backupkey)

export SWIFT_USERNAME=a
export SWIFT_PASSWORD=a
export SWIFT_AUTHURL=http://localhost:6666

function backup_zfs
{
FS=$1
Expand Down
94 changes: 0 additions & 94 deletions a/swiftauth-server

This file was deleted.

0 comments on commit 1cac3f8

Please sign in to comment.