diff options
-rw-r--r-- | changelogs/unreleased/backup_storage_class.yml | 4 | ||||
-rw-r--r-- | config/gitlab.yml.example | 2 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 1 | ||||
-rw-r--r-- | doc/raketasks/backup_restore.md | 2 | ||||
-rw-r--r-- | lib/backup/manager.rb | 3 |
5 files changed, 11 insertions, 1 deletions
diff --git a/changelogs/unreleased/backup_storage_class.yml b/changelogs/unreleased/backup_storage_class.yml new file mode 100644 index 00000000000..fc9989fc251 --- /dev/null +++ b/changelogs/unreleased/backup_storage_class.yml @@ -0,0 +1,4 @@ +--- +title: Add storage class configuration option for Amazon S3 remote backups +merge_request: +author: Jon Keys diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 8f99a4d541f..c9bd6b930d6 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -483,6 +483,8 @@ production: &base # multipart_chunk_size: 104857600 # # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional # # encryption: 'AES256' + # # Specifies Amazon S3 storage class to use for backups, this is optional + # # storage_class: 'STANDARD' ## GitLab Shell settings gitlab_shell: diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 5aeaa7eab81..933844e4ea6 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -399,6 +399,7 @@ if Settings.backup['upload']['connection'] end Settings.backup['upload']['multipart_chunk_size'] ||= 104857600 Settings.backup['upload']['encryption'] ||= nil +Settings.backup['upload']['storage_class'] ||= nil # # Git diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md index 96ec1b178b6..65fcfc77ab1 100644 --- a/doc/raketasks/backup_restore.md +++ b/doc/raketasks/backup_restore.md @@ -159,6 +159,8 @@ For installations from source: remote_directory: 'my.s3.bucket' # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional # 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 diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb index 5cc164a6325..7b4476fa4db 100644 --- a/lib/backup/manager.rb +++ b/lib/backup/manager.rb @@ -51,7 +51,8 @@ module Backup if directory.files.create(key: tar_file, body: File.open(tar_file), public: false, 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) else puts "uploading backup to #{remote_directory} failed".color(:red) |