summaryrefslogtreecommitdiff
path: root/lib/backup
diff options
context:
space:
mode:
authorPaul Beattie <paul@paul-beattie.com>2015-09-10 16:57:43 +0100
committerPaul Beattie <paul@paul-beattie.com>2015-09-25 17:06:31 +0100
commit253d2320ab3d3473509d6abe4a62be90428f20c4 (patch)
tree4d30261c81ddb3e93f70b12101701735ed033844 /lib/backup
parentb623391720e2687ca88c6bf1166ee571d85807fa (diff)
downloadgitlab-ce-253d2320ab3d3473509d6abe4a62be90428f20c4.tar.gz
Add support for AWS S3 Server-Side Encryption support
This adds support for AWS S3 SSE with S3 managed keys, this means the data is encrypted at rest and the encryption is handled transparently to the end user as well as in the AWS Console. This is optional and not required to make S3 uploads work.
Diffstat (limited to 'lib/backup')
-rw-r--r--lib/backup/manager.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb
index ac63f89c6ec..5c42f25f4a2 100644
--- a/lib/backup/manager.rb
+++ b/lib/backup/manager.rb
@@ -45,7 +45,8 @@ module Backup
directory = connection.directories.get(remote_directory)
if directory.files.create(key: tar_file, body: File.open(tar_file), public: false,
- multipart_chunk_size: Gitlab.config.backup.upload.multipart_chunk_size)
+ multipart_chunk_size: Gitlab.config.backup.upload.multipart_chunk_size,
+ encryption: Gitlab.config.backup.upload.encryption)
$progress.puts "done".green
else
puts "uploading backup to #{remote_directory} failed".red
@@ -55,7 +56,7 @@ module Backup
def cleanup
$progress.print "Deleting tmp directories ... "
-
+
backup_contents.each do |dir|
next unless File.exist?(File.join(Gitlab.config.backup.path, dir))
@@ -75,7 +76,7 @@ module Backup
if keep_time > 0
removed = 0
-
+
Dir.chdir(Gitlab.config.backup.path) do
file_list = Dir.glob('*_gitlab_backup.tar')
file_list.map! { |f| $1.to_i if f =~ /(\d+)_gitlab_backup.tar/ }