Skip to content

Commit 5ea41eb

Browse files
committed
Add AWS_BACKUP_ENCRYPTION ENV to enable aws backup aes encryption backups
Also refactor the multi part config to match
1 parent 94d5f68 commit 5ea41eb

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,7 @@ Below is the complete list of available options that can be used to customize yo
10271027
| `AWS_BACKUP_SECRET_ACCESS_KEY` | AWS secret access key. No defaults. |
10281028
| `AWS_BACKUP_BUCKET` | AWS bucket for backup uploads. No defaults. |
10291029
| `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) |
1030+
| `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) |
10301031
| `GCS_BACKUPS` | Enables automatic uploads to an Google Cloud Storage (GCS) instance. Defaults to `false`. |
10311032
| `GCS_BACKUP_ACCESS_KEY_ID` | GCS access key id. No defaults |
10321033
| `GCS_BACKUP_SECRET_ACCESS_KEY` | GCS secret access key. No defaults |

assets/runtime/config/gitlabhq/gitlab.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,15 @@ 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
515+
#start-multipart-aws
516516
# Use multipart uploads when file size reaches 100MB, see
517517
# http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
518518
multipart_chunk_size: {{AWS_BACKUP_MULTIPART_CHUNK_SIZE}}
519-
#end-multipart
520-
# # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
521-
# # encryption: 'AES256'
519+
#end-multipart-aws
520+
#start-encryption-aws
521+
# Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
522+
encryption: 'AES256'
523+
#end-encryption-aws
522524
# Fog storage connection settings, see http://fog.io/storage/ .
523525
#end-aws
524526
#start-gcs

assets/runtime/env-defaults

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ 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}
160160
AWS_BACKUP_MULTIPART_CHUNK_SIZE=${AWS_BACKUP_MULTIPART_CHUNK_SIZE}
161+
AWS_BACKUP_ENCRYPTION=${AWS_BACKUP_ENCRYPTION}
161162

162163
### GCS BACKUPS
163164
GCS_BACKUPS=${GCS_BACKUPS:-false}

assets/runtime/functions

+5-1
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,11 @@ gitlab_configure_backups_aws() {
791791
fi
792792

793793
if [[ -z ${AWS_BACKUP_MULTIPART_CHUNK_SIZE} ]]; then
794-
exec_as_git sed -i "/#start-multipart/,/#end-multipart/d" ${GITLAB_CONFIG}
794+
exec_as_git sed -i "/#start-multipart-aws/,/#end-multipart-aws/d" ${GITLAB_CONFIG}
795+
fi
796+
797+
if [[ ${AWS_BACKUP_ENCRYPTION} != true ]]; then
798+
exec_as_git sed -i "/#start-encryption-aws/,/#end-encryption-aws/d" ${GITLAB_CONFIG}
795799
fi
796800

797801
if [[ -z ${AWS_BACKUP_REGION} && -z ${AWS_BACKUP_ENDPOINT} ]]; then

0 commit comments

Comments
 (0)