-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
458cfd5
commit abe4f66
Showing
1 changed file
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# gs-backup | ||
Google Cloud storage encrypted backup | ||
Encrypt a file and upload it to Google Cloud storage. | ||
|
||
## Required environment variables | ||
|
||
* `BACKUP_FILE`: path to a file that should be uploaded. | ||
* `BACKUP_BUCKET`: bucket url like gs://awesome-backups | ||
* `BACKUP_PGP_KEY`: path to public key, defaults to /pubkey.asc | ||
|
||
## Volumes | ||
|
||
* `/scratch`: temporary storage | ||
* `/.config`: gcloud config | ||
|
||
## Usage | ||
|
||
Authenticate with service account (if the `/.config` volume is permanent this only needs to be done once): | ||
``` | ||
docker run -i --rm \ | ||
-v /PATH/TO/gcloud-config/:/.config \ | ||
-v /PATH/TO/:/key.json \ | ||
gs-backup \ | ||
gcloud auth activate-service-account --key-file=/key.json | ||
``` | ||
|
||
Run: | ||
``` | ||
docker run -i --rm \ | ||
-v /PATH/TO/gcloud-config/:/.config \ | ||
-v /PATH/TO/paperhive-backups.pub.asc:/pubkey.asc \ | ||
-v /PATH/TO/data:/data \ | ||
-e BACKUP_FILE=/data/file \ | ||
-e BACKUP_BUCKET=gs://awesome-backups \ | ||
gs-backup | ||
``` |