Skip to content

Commit 94d5f68

Browse files
committed
Remove multipart configs if AWS_BACKUP_MULTIPART_CHUNK_SIZE is not set
1 parent a3a23a4 commit 94d5f68

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

assets/runtime/config/gitlabhq/gitlab.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -512,11 +512,13 @@ 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-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}}
518-
# # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
519-
# # encryption: 'AES256'
519+
#end-multipart
520+
# # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
521+
# # encryption: 'AES256'
520522
# Fog storage connection settings, see http://fog.io/storage/ .
521523
#end-aws
522524
#start-gcs

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

+8
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,14 @@ 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+
if [[ -z ${AWS_BACKUP_MULTIPART_CHUNK_SIZE} ]]; then
790+
exec_as_git sed -i "/#start-multipart/,/#end-multipart/d" ${GITLAB_CONFIG}
791+
fi
792+
793+
if [[ -z ${AWS_BACKUP_MULTIPART_CHUNK_SIZE} ]]; then
794+
exec_as_git sed -i "/#start-multipart/,/#end-multipart/d" ${GITLAB_CONFIG}
795+
fi
796+
789797
if [[ -z ${AWS_BACKUP_REGION} && -z ${AWS_BACKUP_ENDPOINT} ]]; then
790798
echo "\nMissing AWS region or endpoint. Aborting...\n"
791799
return 1

0 commit comments

Comments
 (0)