项目作者: willemvd

项目描述 :
PostgreSQL, client-side encrypted, Amazon S3 backupper
高级语言: Shell
项目地址: git://github.com/willemvd/postgresql-client-side-encrypted-s3-backup.git


PostgreSQL, client-side encrypted, Amazon S3 backupper

Docker image that is used to backup a PostgreSQL database, encrypt the dump file locally and upload to a S3 bucket.
Your own settings define how secure you want it to be :)

Import difference with other PostgreSQL to S3 backup tools is client-side encryption.
This means that it is not necessary to send any unencrypted data towards Amazon

The following (required) environment variables need to be set in order to run everything smoothly:

  1. # Used in the backup file name
  2. # and to place the file inside a subfolder of the S3 bucket
  3. BACKUP_TYPE=<type of backup, should also be a folder/key in the S3 bucket>
  4. # PostgreSQL settings
  5. PGHOST=<database hostname>
  6. PGPORT=<port of the database server, default 5432>
  7. PGDATABASE=<database name>
  8. PGUSER=<database user>
  9. PGPASSWORD=<database password>
  10. # OpenSSL settings
  11. ENCRYPTION_PASS_PHRASE=<strong password>
  12. OPENSSL_CIPHER_TYPE=<strong cipher like aes-256-cbc>
  13. # Amazon settings
  14. AWS_ACCESS_KEY_ID=<access key id got from Amazon>
  15. AWS_SECRET_ACCESS_KEY=<secret access key got from Amazon>
  16. AWS_DEFAULT_REGION=<Amazon region name e.g. eu-central-1>
  17. S3_BUCKET_NAME=<name of the bucket in S3>
  18. # Email settings
  19. ENABLE_ERROR_MAIL=<should an email be send when something goes wrong? other then true will disable this>
  20. ERROR_MAIL_SUBJECT=<subject of the mail, e.g. Failed to run database backup>
  21. SMTP_HOST=<SMTP host e.g. smtp.office365.com>
  22. SMTP_PORT=<SMTP port number, mostly 587 or 25>
  23. SMTP_STARTTLS=<should TLS be used? other then true will disable this>
  24. SMTP_AUTH=<type of auth, login>
  25. SMTP_AUTH_USER=<username to login to the SMTP server>
  26. SMTP_AUTH_PASSWORD=<password for the SMTP user>
  27. SMTP_FROM=<name and email of the sender in the format: Name <full email adres> >
  28. SMTP_TO=<email address to send to, multiple addresses can be used with a comma seperated list>
  29. ALWAYS_EXIT_ZERO=<when true, always return 0 as exit code to prevent failure detection by other scripts (prevent restarts and spam mailing)>