Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

use the running users creds for pg_dump and enable gpg encrypt #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danivovich
Copy link
Member

@oestrich some changes I made to use this in a specific way for a client. let me know what you think.


# verify file exists and file size is > 0 bytes
unless File.exists?(filename) && File.new(filename).size > 0
raise "Database was not backed up"
end

if ENV["ENCRYPT_TO"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pipe data into gpg? We could skip the unencrypted file if it does.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably. In the case I wrote this for we are doing all of this within an encrypted partition, so it didn't really matter that there was an inflight unencrypted file. Seems like a reasonable change if gpg can do it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few things that show data being pipped into gpg --encrypt -r identity-key. I don't have gpg keys set up to play around with it so I don't know for sure.

@danivovich danivovich changed the base branch from master to main August 16, 2020 17:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants