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.
This commit is contained in:
Bartosz Cisek 2019-07-03 21:43:59 +02:00 committed by Niclas Mietz
parent f582876f83
commit be45df494d
4 changed files with 5 additions and 1 deletions

View File

@ -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 |

View File

@ -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

View File

@ -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}

View File

@ -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() {