Skip to content

Commit 996ec75

Browse files
committed
b2: document example + point to perkeep/b2 fork
- Add documentation in storage-examples for using Perkeep with b2 as a storage backend. The documentation uses the new API terminology: AccountID is no longer a thing in the Backblaze web console. - Replace FiloSottile/b2 by perkeep/b2 where we host a copy of clgillis's Pull Request[1]. We can point to the original project again as soon as it is merged. Note that I haven't updated the vendor directory and it seems that `go mod vendor` updates way more things that are also outdated in the master branch, so I will leave that as an exercise to whoever has commit access :). Before this Pull Request, launching the b2 storage would error with the following error message: ``` Error parsing config: Caught panic: error instantiating storage for prefix "/sto-b2/", type "b2": Post "https://api000.backblazeb2.com/b2api/v1/b2_list_buckets": b2 remote error [bad_request]: accountId invalid ``` Now, it seems to work as expected! 1. FiloSottile/b2#8
1 parent 966a271 commit 996ec75

4 files changed

Lines changed: 37 additions & 10 deletions

File tree

doc/storage-examples.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
To use S3 with Perkeep, you need to:
88

9-
* Sign up for an Amazon Web Services account
10-
* Sign into the AWS console, navigate to 'S3'
11-
* Create an S3 bucket for your Perkeep backups (Perkeep will not work if you put other files in this bucket)
12-
* Configure your Perkeep server to sync blobs to the S3 bucket
9+
* Sign up for an Amazon Web Services account.
10+
* Sign into the AWS console, navigate to 'S3'.
11+
* Create an S3 bucket for your Perkeep backups (Perkeep will not work if you put other files in this bucket).
12+
* Configure your Perkeep server to sync blobs to the S3 bucket.
1313

1414
It is advisable to use a dedicated key/secret for Perkeep:
1515

16-
* Sign into the AWS console, navigate to 'Identity & Access Management' and click 'Users'
17-
* Click 'Create new users' and create a user for Perkeep (keep 'Generate an access key' checked)
16+
* Sign into the AWS console, navigate to 'Identity & Access Management' and click 'Users'.
17+
* Click 'Create new users' and create a user for Perkeep (keep 'Generate an access key' checked).
1818
* Click 'Show User Security Credentials' to get the users Access key and Secret key - these will be required to configure Perkeep and can't be obtained after you leave this screen.
19-
* Go back to the user list and select the new user, and on the 'permissions' tab add the following 'inline policy' (replacing YOUR_BUCKET_NAME with the name of the bucket you created)
19+
* Go back to the user list and select the new user, and on the 'permissions' tab add the following 'inline policy' (replacing YOUR_BUCKET_NAME with the name of the bucket you created):
2020

2121
```
2222
{
@@ -42,5 +42,29 @@ It is advisable to use a dedicated key/secret for Perkeep:
4242

4343
Finally, add the s3 config line to your Perkeep `server-config.json`:
4444
```
45-
s3: "ACCESS_KEY:SECRET_KEY:YOUR_BUCKET_NAME"
45+
"s3": "ACCESS_KEY:SECRET_KEY:YOUR_BUCKET_NAME"
46+
```
47+
48+
## B2
49+
50+
[Backblaze B2](https://www.backblaze.com/b2/cloud-storage.html) is simple, reliable, affordable object storage.
51+
52+
To use b2 with Perkep, you need to:
53+
* Sign up for a Backblaze account.
54+
* Sign in to the Backblaze console, navigate to 'Buckets'.
55+
* Create a bucket for your Perkeep backups (Perkeep will not work if you put other files on this bucket).
56+
* Configure your perkeep server to sync blobs to the Backblaze bucket.
57+
58+
It is advisable to create a dedicated Application Key for Perkeep:
59+
60+
* Sign in to the Backblaze console, navigate to 'App Keys'.
61+
* Click 'Add a New Application Key'.
62+
* Give it a name, for example 'perkeep'.
63+
* Allow access to the bucket that you just created.
64+
* Choose 'Read and Write'.
65+
* Click 'Create New Key'.
66+
67+
Finally, add the b2 config line to your perkeep `server-config.json`:
68+
```
69+
"b2": "keyID:applicationKey:bucket"
4670
```

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
cloud.google.com/go/datastore v1.1.0
99
cloud.google.com/go/logging v1.1.2
1010
cloud.google.com/go/storage v1.10.0
11-
github.com/FiloSottile/b2 v0.0.0-20170207175032-b197f7a2c317
11+
github.com/FiloSottile/b2 v0.0.0-20170207175032-b197f7a2c317 // indirect
1212
github.com/aws/aws-sdk-go v1.14.31
1313
github.com/bradfitz/latlong v0.0.0-20170410180902-f3db6d0dff40
1414
github.com/cznic/fileutil v0.0.0-20180108211300-6a051e75936f // indirect
@@ -42,6 +42,7 @@ require (
4242
github.com/nf/cr2 v0.0.0-20140528043846-05d46fef4f2f
4343
github.com/onsi/ginkgo v1.8.0 // indirect
4444
github.com/onsi/gomega v1.5.0 // indirect
45+
github.com/perkeep/b2 v0.0.0-20180913003434-1ae8d9b78db9
4546
github.com/pkg/sftp v0.0.0-20180419200840-5bf2a174b604
4647
github.com/plaid/plaid-go v0.0.0-20161222051224-02b6af68061b
4748
github.com/russross/blackfriday v2.0.0+incompatible

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa
269269
github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
270270
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
271271
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
272+
github.com/perkeep/b2 v0.0.0-20180913003434-1ae8d9b78db9 h1:Wns4DneT6dMNbGPylkKfdU992jsoEL7bvwlnPQ46+fg=
273+
github.com/perkeep/b2 v0.0.0-20180913003434-1ae8d9b78db9/go.mod h1:wr5gMCoMWNiQbxfI5DTPRtwdTHMHheInIYNljOvo2ZE=
272274
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
273275
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
274276
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

pkg/blobserver/b2/b2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"perkeep.org/pkg/blobserver/memory"
3333
"perkeep.org/pkg/constants"
3434

35-
"github.com/FiloSottile/b2"
35+
"github.com/perkeep/b2"
3636
"go4.org/jsonconfig"
3737
"go4.org/syncutil"
3838
)

0 commit comments

Comments
 (0)