Skip to content

Commit e64640c

Browse files
committed
Add encryption details to README
1 parent a7a1f7f commit e64640c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ The following environment variables are required to run pg2s3:
3939
| `PG2S3_BACKUP_PREFIX` | Prefix attached to the name of each backup |
4040
| `PG2S3_BACKUP_RETENTION` | Number of backups to retain after pruning |
4141

42+
## Encryption
43+
Backups managed by pg2s3 can be optionally encrypted using [age](https://github.com/FiloSottile/age).
44+
To enable this feature, an age public key must be defined as an additional environment variable.
45+
Note that your age private key must be kept safe and secure!
46+
When restoring a backup, pg2s3 will prompt for a private key.
47+
This key is explicitly kept out of pg2s3's environment in order to require user intervention for any data decryption.
48+
49+
| Variable | Description |
50+
| ------------------------- | ----------- |
51+
| `PG2S3_AGE_PUBLIC_KEY` | Public key generated by [age](https://github.com/FiloSottile/age) |
52+
4253
## Usage
4354
The pg2s3 command-line tool offers three commands:
4455
* `pg2s3 backup` - Create a new backup and upload to S3

pg2s3.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func New(pgConnectionURI, s3Endpoint, s3AccessKeyID, s3SecretAccessKey, s3Bucket
5151
return &client, nil
5252
}
5353

54-
// pg_dump -Fc -f dvdrental.backup $PG2S3_DATABASE_URL
54+
// pg_dump -Fc -f dvdrental.backup $PG2S3_PG_CONNECTION_URI
5555
func (c *Client) CreateBackup(path string) error {
5656
args := []string{
5757
"-Fc",
@@ -73,7 +73,7 @@ func (c *Client) CreateBackup(path string) error {
7373
return nil
7474
}
7575

76-
// pg_restore -c -d $PG2S3_DATABASE_URL testdata/dvdrental.backup
76+
// pg_restore -c -d $PG2S3_PG_CONNECTION_URI testdata/dvdrental.backup
7777
func (c *Client) RestoreBackup(path string) error {
7878
args := []string{
7979
"-c",

0 commit comments

Comments
 (0)