diff --git a/Changelog.md b/Changelog.md index 7ddc8f95..58c5a317 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,7 @@ This file only reflects the changes that are made in this image. Please refer to - gitlab-workhorse: upgrade to v.0.4.2 - gitlab: upgrade to CE v8.2.0 - added `GITLAB_SHARED_DIR` configuration parameter +- added `GITLAB_LFS_OBJECTS_DIR` configuration parameter **8.1.4** - gitlab: upgrade to CE v8.1.4 diff --git a/README.md b/README.md index 071d6313..8247397e 100644 --- a/README.md +++ b/README.md @@ -774,6 +774,7 @@ Below is the complete list of available options that can be used to customize yo - **GITLAB_BACKUP_DIR**: The backup folder in the container. Defaults to `/home/git/data/backups` - **GITLAB_BUILDS_DIR**: The build traces directory. Defaults to `/home/git/data/builds` - **GITLAB_SHARED_DIR**: The directory to store the build artifacts. Defaults to `/home/git/data/shared` +- **GITLAB_LFS_OBJECTS_DIR**: Directory to store the lfs-objects. Defaults to `$GITLAB_SHARED_DIR/lfs-objects` - **GITLAB_BACKUPS**: Setup cron job to automatic backups. Possible values `disable`, `daily`, `weekly` or `monthly`. Disabled by default - **GITLAB_BACKUP_EXPIRY**: Configure how long (in seconds) to keep backups before they are deleted. By default when automated backups are disabled backups are kept forever (0 seconds), else the backups expire in 7 days (604800 seconds). - **GITLAB_BACKUP_ARCHIVE_PERMISSIONS**: Sets the permissions of the backup archives. Defaults to `0600`. [See](http://doc.gitlab.com/ce/raketasks/backup_restore.html#backup-archive-permissions) diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index e44b8905..ba06ff35 100644 --- a/assets/runtime/config/gitlabhq/gitlab.yml +++ b/assets/runtime/config/gitlabhq/gitlab.yml @@ -128,7 +128,7 @@ production: &base lfs: enabled: false # The location where LFS objects are stored (default: shared/lfs-objects). - storage_path: {{GITLAB_SHARED_DIR}}/lfs-objects + storage_path: {{GITLAB_LFS_OBJECTS_DIR}} ## Gravatar ## For Libravatar see: http://doc.gitlab.com/ce/customization/libravatar.html diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index b0757978..e558d259 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -7,6 +7,7 @@ GITLAB_BACKUP_DIR="${GITLAB_BACKUP_DIR:-$GITLAB_DATA_DIR/backups}" GITLAB_REPOS_DIR="${GITLAB_REPOS_DIR:-$GITLAB_DATA_DIR/repositories}" GITLAB_BUILDS_DIR="${GITLAB_BUILDS_DIR:-$GITLAB_DATA_DIR/builds}" GITLAB_SHARED_DIR="${GITLAB_SHARED_DIR:-$GITLAB_DATA_DIR/shared}" +GITLAB_LFS_OBJECTS_DIR="${GITLAB_LFS_OBJECTS_DIR:-$GITLAB_SHARED_DIR/lfs-objects}" GITLAB_HTTPS=${GITLAB_HTTPS:-false} GITLAB_HOST=${GITLAB_HOST:-localhost} diff --git a/assets/runtime/functions b/assets/runtime/functions index dfd9a2f3..8ecd5b24 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -590,6 +590,11 @@ gitlab_configure_ci() { exec_as_git sed -i 's,{{GITLAB_BUILDS_DIR}},'"${GITLAB_BUILDS_DIR}"',g' ${GITLAB_INSTALL_DIR}/config/gitlab.yml } +gitlab_configure_lfs() { + echo "Configuring gitlab::lfs..." + exec_as_git sed -i 's,{{GITLAB_LFS_OBJECTS_DIR}},'"${GITLAB_LFS_OBJECTS_DIR}"',g' ${GITLAB_INSTALL_DIR}/config/gitlab.yml +} + gitlab_configure_project_features() { echo "Configuring gitlab::project_features..." exec_as_git sed -i 's/{{GITLAB_PROJECTS_ISSUES}}/'"${GITLAB_PROJECTS_ISSUES}"'/' ${GITLAB_INSTALL_DIR}/config/gitlab.yml @@ -754,9 +759,9 @@ initialize_datadir() { ln -sf ${GITLAB_SHARED_DIR} ${GITLAB_INSTALL_DIR}/shared # create lfs-objects directory - mkdir -p ${GITLAB_SHARED_DIR}/lfs-objects - chmod u+rwX ${GITLAB_SHARED_DIR}/lfs-objects - chown ${GITLAB_USER}:${GITLAB_USER} ${GITLAB_SHARED_DIR}/lfs-objects + mkdir -p ${GITLAB_LFS_OBJECTS_DIR} + chmod u+rwX ${GITLAB_LFS_OBJECTS_DIR} + chown ${GITLAB_USER}:${GITLAB_USER} ${GITLAB_LFS_OBJECTS_DIR} # create the backups directory mkdir -p ${GITLAB_BACKUP_DIR} @@ -802,9 +807,9 @@ sanitize_datadir() { chmod -R u+rwX ${GITLAB_SHARED_DIR} chown -R ${GITLAB_USER}:${GITLAB_USER} ${GITLAB_SHARED_DIR} - mkdir -p ${GITLAB_SHARED_DIR}/lfs-objects - chmod -R u+rwX ${GITLAB_SHARED_DIR}/lfs-objects - chown -R ${GITLAB_USER}:${GITLAB_USER} ${GITLAB_SHARED_DIR}/lfs-objects + mkdir -p ${GITLAB_LFS_OBJECTS_DIR} + chmod -R u+rwX ${GITLAB_LFS_OBJECTS_DIR} + chown -R ${GITLAB_USER}:${GITLAB_USER} ${GITLAB_LFS_OBJECTS_DIR} find ${GITLAB_DATA_DIR}/uploads -type f -exec chmod 0644 {} \; find ${GITLAB_DATA_DIR}/uploads -type d -not -path ${GITLAB_DATA_DIR}/uploads -exec chmod 0755 {} \; @@ -909,6 +914,7 @@ configure_gitlab() { gitlab_configure_unicorn gitlab_configure_timezone gitlab_configure_ci + gitlab_configure_lfs gitlab_configure_project_features gitlab_configure_mail_delivery gitlab_configure_mailroom