From 06ecea88552d7abb755dafd0da987ab8672b2f6b Mon Sep 17 00:00:00 2001 From: Lewis Marshall Date: Wed, 7 Nov 2018 09:08:15 +0000 Subject: [PATCH] Make the chown of backup files optional --- README.md | 1 + assets/runtime/env-defaults | 2 +- assets/runtime/functions | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 255d29df..dfd0182a 100644 --- a/README.md +++ b/README.md @@ -844,6 +844,7 @@ Below is the complete list of available options that can be used to customize yo | `GITLAB_NOTIFY_PUSHER` | Add pusher to recipients list of broken build notification emails. Defaults to `false` | | `GITLAB_REPOS_DIR` | The git repositories folder in the container. Defaults to `/home/git/data/repositories` | | `GITLAB_BACKUP_DIR` | The backup folder in the container. Defaults to `/home/git/data/backups` | +| `GITLAB_BACKUP_DIR_CHOWN` | Optionally change ownership of backup files on start-up | Defaults to `true` | | `GITLAB_BUILDS_DIR` | The build traces directory. Defaults to `/home/git/data/builds` | | `GITLAB_DOWNLOADS_DIR` | The repository downloads directory. A temporary zip is created in this directory when users click **Download Zip** on a project. Defaults to `/home/git/data/tmp/downloads`. | | `GITLAB_SHARED_DIR` | The directory to store the build artifacts. Defaults to `/home/git/data/shared` | diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 29ac89fb..d2a4295b 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -5,6 +5,7 @@ DEBUG=${DEBUG:-$DEBUG_ENTRYPOINT} ## GITLAB CORE GITLAB_TEMP_DIR="${GITLAB_DATA_DIR}/tmp" GITLAB_BACKUP_DIR="${GITLAB_BACKUP_DIR:-$GITLAB_DATA_DIR/backups}" +GITLAB_BACKUP_DIR_CHOWN=${GITLAB_BACKUP_DIR_CHOWN:-true} GITLAB_REPOS_DIR="${GITLAB_REPOS_DIR:-$GITLAB_DATA_DIR/repositories}" GITLAB_BUILDS_DIR="${GITLAB_BUILDS_DIR:-$GITLAB_DATA_DIR/builds}" GITLAB_DOWNLOADS_DIR="${GITLAB_DOWNLOADS_DIR:-$GITLAB_TEMP_DIR/downloads}" @@ -425,4 +426,3 @@ GITLAB_MONITORING_IP_WHITELIST=${GITLAB_MONITORING_IP_WHITELIST:-"0.0.0.0/8"} GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED:-true} GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS:-"0.0.0.0"} GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT:-3807} - diff --git a/assets/runtime/functions b/assets/runtime/functions index d41d689c..848b444c 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -1329,7 +1329,9 @@ initialize_datadir() { # create the backups directory mkdir -p ${GITLAB_BACKUP_DIR} - chown ${GITLAB_USER}: ${GITLAB_BACKUP_DIR} + if [[ ${GITLAB_BACKUP_DIR_CHOWN} == true ]]; then + chown ${GITLAB_USER}: ${GITLAB_BACKUP_DIR} + fi # create the uploads directory mkdir -p ${GITLAB_DATA_DIR}/uploads