From be45df494daddfb7a9991d56aa7d06a2d51c96ba Mon Sep 17 00:00:00 2001 From: Bartosz Cisek Date: Wed, 3 Jul 2019 21:43:59 +0200 Subject: [PATCH] Add support for AWS S3 signature version Some 3rd party storage solutions allow upload via S3 protocol but still use v2 of signature schema. [Fog library used by gitlab](https://docs.gitlab.com/ee/administration/uploads.html#s3-compatible-connection-settings) allows to override default version 4. --- README.md | 1 + assets/runtime/config/gitlabhq/gitlab.yml | 1 + assets/runtime/env-defaults | 1 + assets/runtime/functions | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d53bc3c..909054ec 100644 --- a/README.md +++ b/README.md @@ -1148,6 +1148,7 @@ Below is the complete list of available options that can be used to customize yo | `AWS_BACKUP_MULTIPART_CHUNK_SIZE` | Enables mulitpart uploads when file size reaches a defined size. See at [AWS S3 Docs](http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html) | | `AWS_BACKUP_ENCRYPTION` | Turns on AWS Server-Side Encryption. Defaults to `false`. See at [AWS S3 Docs](http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) | | `AWS_BACKUP_STORAGE_CLASS` | Configure the storage class for the item. Defaults to `STANDARD` See at [AWS S3 Docs](http://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) | +| `AWS_BACKUP_SIGNATURE_VERSION` | Configure the storage signature version. Defaults to `4` See at [AWS S3 Docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) | | `GCS_BACKUPS` | Enables automatic uploads to an Google Cloud Storage (GCS) instance. Defaults to `false`. | | `GCS_BACKUP_ACCESS_KEY_ID` | GCS access key id. No defaults | | `GCS_BACKUP_SECRET_ACCESS_KEY` | GCS secret access key. No defaults | diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index 3d36a878..775b4f15 100644 --- a/assets/runtime/config/gitlabhq/gitlab.yml +++ b/assets/runtime/config/gitlabhq/gitlab.yml @@ -606,6 +606,7 @@ production: &base path_style: {{AWS_BACKUP_PATH_STYLE}} aws_access_key_id: {{AWS_BACKUP_ACCESS_KEY_ID}} aws_secret_access_key: '{{AWS_BACKUP_SECRET_ACCESS_KEY}}' + aws_signature_version: {{AWS_BACKUP_SIGNATURE_VERSION}} # The remote 'directory' to store your backups. For S3, this would be the bucket name. remote_directory: '{{AWS_BACKUP_BUCKET}}' #start-multipart-aws diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 4c4318b8..0834090d 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -239,6 +239,7 @@ AWS_BACKUP_BUCKET=${AWS_BACKUP_BUCKET} AWS_BACKUP_MULTIPART_CHUNK_SIZE=${AWS_BACKUP_MULTIPART_CHUNK_SIZE} AWS_BACKUP_ENCRYPTION=${AWS_BACKUP_ENCRYPTION} AWS_BACKUP_STORAGE_CLASS=${AWS_BACKUP_STORAGE_CLASS:-STANDARD} +AWS_BACKUP_SIGNATURE_VERSION=${AWS_BACKUP_SIGNATURE_VERSION:-4} ### GCS BACKUPS GCS_BACKUPS=${GCS_BACKUPS:-false} diff --git a/assets/runtime/functions b/assets/runtime/functions index ab3e02d8..12a49eed 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -844,7 +844,8 @@ gitlab_configure_backups_aws() { AWS_BACKUP_SECRET_ACCESS_KEY \ AWS_BACKUP_BUCKET \ AWS_BACKUP_MULTIPART_CHUNK_SIZE \ - AWS_BACKUP_STORAGE_CLASS + AWS_BACKUP_STORAGE_CLASS \ + AWS_BACKUP_SIGNATURE_VERSION } gitlab_configure_backup_gcs() {