Skip to content

Commit 75e60b6

Browse files
committed
Remove multipart configs if AWS_BACKUP_MULTIPART_CHUNK_SIZE is not set
1 parent a3a23a4 commit 75e60b6

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

assets/runtime/config/gitlabhq/gitlab.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,11 @@ production: &base
512512
aws_secret_access_key: '{{AWS_BACKUP_SECRET_ACCESS_KEY}}'
513513
# The remote 'directory' to store your backups. For S3, this would be the bucket name.
514514
remote_directory: '{{AWS_BACKUP_BUCKET}}'
515+
#start-aws-multipart
515516
# Use multipart uploads when file size reaches 100MB, see
516-
# http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
517+
# http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
517518
multipart_chunk_size: {{AWS_BACKUP_MULTIPART_CHUNK_SIZE}}
519+
#end-aws-multipart
518520
# # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
519521
# # encryption: 'AES256'
520522
# Fog storage connection settings, see http://fog.io/storage/ .

assets/runtime/env-defaults

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ AWS_BACKUP_PATH_STYLE=${AWS_BACKUP_PATH_STYLE:-false}
157157
AWS_BACKUP_ACCESS_KEY_ID=${AWS_BACKUP_ACCESS_KEY_ID}
158158
AWS_BACKUP_SECRET_ACCESS_KEY=${AWS_BACKUP_SECRET_ACCESS_KEY}
159159
AWS_BACKUP_BUCKET=${AWS_BACKUP_BUCKET}
160-
AWS_BACKUP_MULTIPART_CHUNK_SIZE=${AWS_BACKUP_MULTIPART_CHUNK_SIZE:-104857600}
160+
AWS_BACKUP_MULTIPART_CHUNK_SIZE=${AWS_BACKUP_MULTIPART_CHUNK_SIZE}
161161

162162
### GCS BACKUPS
163163
GCS_BACKUPS=${GCS_BACKUPS:-false}

assets/runtime/functions

+5
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,11 @@ gitlab_configure_backups_aws() {
786786
exec_as_git sed -i "/#start-aws/d" ${GITLAB_CONFIG}
787787
exec_as_git sed -i "/#end-aws/d" ${GITLAB_CONFIG}
788788

789+
# Remove multipart config if we don't have it configured
790+
if [[ -z ${AWS_BACKUP_MULTIPART_CHUNK_SIZE} ]]; then
791+
exec_as_git sed -i "/#start-aws-multipart/,/#end-aws-multipart/d" ${GITLAB_CONFIG}
792+
fi
793+
789794
if [[ -z ${AWS_BACKUP_REGION} && -z ${AWS_BACKUP_ENDPOINT} ]]; then
790795
echo "\nMissing AWS region or endpoint. Aborting...\n"
791796
return 1

0 commit comments

Comments
 (0)