diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index 0eb5c121ce..fea6daeb67 100644 --- a/assets/runtime/config/gitlabhq/gitlab.yml +++ b/assets/runtime/config/gitlabhq/gitlab.yml @@ -512,9 +512,11 @@ production: &base aws_secret_access_key: '{{AWS_BACKUP_SECRET_ACCESS_KEY}}' # The remote 'directory' to store your backups. For S3, this would be the bucket name. remote_directory: '{{AWS_BACKUP_BUCKET}}' + #start-aws-multipart # Use multipart uploads when file size reaches 100MB, see - # http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html + # http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html multipart_chunk_size: {{AWS_BACKUP_MULTIPART_CHUNK_SIZE}} + #end-aws-multipart # # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional # # encryption: 'AES256' # Fog storage connection settings, see http://fog.io/storage/ . diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 66a65bcfce..a039b1b110 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -157,7 +157,7 @@ AWS_BACKUP_PATH_STYLE=${AWS_BACKUP_PATH_STYLE:-false} AWS_BACKUP_ACCESS_KEY_ID=${AWS_BACKUP_ACCESS_KEY_ID} AWS_BACKUP_SECRET_ACCESS_KEY=${AWS_BACKUP_SECRET_ACCESS_KEY} AWS_BACKUP_BUCKET=${AWS_BACKUP_BUCKET} -AWS_BACKUP_MULTIPART_CHUNK_SIZE=${AWS_BACKUP_MULTIPART_CHUNK_SIZE:-104857600} +AWS_BACKUP_MULTIPART_CHUNK_SIZE=${AWS_BACKUP_MULTIPART_CHUNK_SIZE} ### GCS BACKUPS GCS_BACKUPS=${GCS_BACKUPS:-false} diff --git a/assets/runtime/functions b/assets/runtime/functions index e92f261906..b28fdf338c 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -786,6 +786,11 @@ gitlab_configure_backups_aws() { exec_as_git sed -i "/#start-aws/d" ${GITLAB_CONFIG} exec_as_git sed -i "/#end-aws/d" ${GITLAB_CONFIG} + # Remove multipart config if we don't have it configured + if [[ -z ${AWS_BACKUP_MULTIPART_CHUNK_SIZE} ]]; then + exec_as_git sed -i "/#start-aws-multipart/,/#end-aws-multipart/d" ${GITLAB_CONFIG} + fi + if [[ -z ${AWS_BACKUP_REGION} && -z ${AWS_BACKUP_ENDPOINT} ]]; then echo "\nMissing AWS region or endpoint. Aborting...\n" return 1