Commit 7a7ec1ac authored by Jon Keys's avatar Jon Keys

Add storage class configuration option for Amazon S3 remote backups

parent 261f5a68
---
title: Add storage class configuration option for Amazon S3 remote backups
merge_request:
author: Jon Keys
...@@ -483,6 +483,8 @@ production: &base ...@@ -483,6 +483,8 @@ production: &base
# multipart_chunk_size: 104857600 # multipart_chunk_size: 104857600
# # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional # # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
# # encryption: 'AES256' # # encryption: 'AES256'
# # Specifies Amazon S3 storage class to use for backups, this is optional
# # storage_class: 'STANDARD'
## GitLab Shell settings ## GitLab Shell settings
gitlab_shell: gitlab_shell:
......
...@@ -399,6 +399,7 @@ if Settings.backup['upload']['connection'] ...@@ -399,6 +399,7 @@ if Settings.backup['upload']['connection']
end end
Settings.backup['upload']['multipart_chunk_size'] ||= 104857600 Settings.backup['upload']['multipart_chunk_size'] ||= 104857600
Settings.backup['upload']['encryption'] ||= nil Settings.backup['upload']['encryption'] ||= nil
Settings.backup['upload']['storage_class'] ||= nil
# #
# Git # Git
......
...@@ -175,6 +175,8 @@ For installations from source: ...@@ -175,6 +175,8 @@ For installations from source:
remote_directory: 'my.s3.bucket' remote_directory: 'my.s3.bucket'
# Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
# encryption: 'AES256' # encryption: 'AES256'
# Specifies Amazon S3 storage class to use for backups, this is optional
# storage_class: 'STANDARD'
``` ```
If you are uploading your backups to S3 you will probably want to create a new If you are uploading your backups to S3 you will probably want to create a new
......
...@@ -51,7 +51,8 @@ module Backup ...@@ -51,7 +51,8 @@ module Backup
if directory.files.create(key: tar_file, body: File.open(tar_file), public: false, 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) encryption: Gitlab.config.backup.upload.encryption,
storage_class: Gitlab.config.backup.upload.storage_class)
$progress.puts "done".color(:green) $progress.puts "done".color(:green)
else else
puts "uploading backup to #{remote_directory} failed".color(:red) puts "uploading backup to #{remote_directory} failed".color(:red)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment