Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pg_drive_backup

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg_drive_backup

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

PgDriveBackup

Simple solution to make encrypted with ccrypt PostgreSQL backups with storing on Google Drive API

Installation

Add this line to your application's Gemfile:

gem 'pg_drive_backup'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pg_drive_backup

Usage

Quick start

Required database config credentials:

config/initializers/pg_drive_backup.rb

PgDriveBackup::Settings.configure do |config|
  config.database.name = 'database_name'
  config.database.user = ENV.fetch('PG_USERNAME')
  config.database.password = ENV.fetch('PG_PASSWORD')
end

Add your google drive authorization JSON file to config/drive.json

Generate your encryption key, for example:

openssl passwd -1 "somepassword"

And put it into config/key.txt

Run it:

PgDriveBackup::Run.call

It uploads your encrypted backup with name like 20171009083306693-dump.sql.cpt

To decrypt:

ccrypt -k config/key.txt -d 20171009083306693-dump.sql.cpt

Tunning

Config options:

PgDriveBackup::Settings.configure do |config|
  config.credentials_path = 'config/drive.json'       # default: 'config/drive.json'
  config.key_path = 'config/key.txt'                  # default: 'config/key.txt'
  config.prefix = '-dump'                             # default: '-dump'

  config.database.name = 'database_name'              # default: nil
  config.database.user = ENV.fetch('PG_USERNAME')     # default: nil
  config.database.password = ENV.fetch('PG_PASSWORD') # default: nil
  config.database.host = 'localhost'                  # default: 'localhost'
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kirillshevch/pg_drive_backup.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 09 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc