Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions assets/runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -1501,13 +1501,27 @@ initialize_datadir() {
chmod u+rwX ${GITLAB_LFS_OBJECTS_DIR}
chown ${GITLAB_USER}: ${GITLAB_LFS_OBJECTS_DIR}

# create terraform_state directory
# TODO : parametarize path and replace with it (e.g. GITLAB_TERRAFORM_STATE_STORAGE_PATH) - see sameersbn/gitlab#2438
# TODO : wrap with "if [[ _ENABLED == true ]]" condition
mkdir -p ${GITLAB_SHARED_DIR}/terraform_state
chmod u+rwX ${GITLAB_SHARED_DIR}/terraform_state
chown ${GITLAB_USER}: ${GITLAB_SHARED_DIR}/terraform_state

# create registry dir
if [[ ${GITLAB_REGISTRY_ENABLED} == true ]]; then
mkdir -p ${GITLAB_REGISTRY_DIR}
chmod u+rwX ${GITLAB_REGISTRY_DIR}
chown ${GITLAB_USER}: ${GITLAB_REGISTRY_DIR}
fi

# create packages directory
if [[ ${GITLAB_PACKAGES_ENABLED} == true ]]; then
mkdir -p ${GITLAB_PACKAGES_DIR}
chmod u+rwX ${GITLAB_PACKAGES_DIR}
chown ${GILTAB_USER}: ${GITLAB_PACKAGES_DIR}
fi

# create the backups directory
mkdir -p ${GITLAB_BACKUP_DIR}
if [[ ${GITLAB_BACKUP_DIR_CHOWN} == true ]]; then
Expand Down Expand Up @@ -1574,11 +1588,21 @@ sanitize_datadir() {
chmod -R u+rwX ${GITLAB_LFS_OBJECTS_DIR}
chown -R ${GITLAB_USER}: ${GITLAB_LFS_OBJECTS_DIR}

# create terraform_state directory
# TODO : wrap with "if [[ _ENABLED ]]" condition
chmod u+rwX ${GITLAB_SHARED_DIR}/terraform_state
chown ${GITLAB_USER}: ${GITLAB_SHARED_DIR}/terraform_state

if [[ ${GITLAB_REGISTRY_ENABLED} == true ]]; then
chmod -R u+rwX ${GITLAB_REGISTRY_DIR}
chown -R ${GITLAB_USER}: ${GITLAB_REGISTRY_DIR}
fi

if [[ ${GITLAB_PACKAGES_ENABLED} ]]; then
chmod u+rwX ${GITLAB_PACKAGES_DIR}
chown ${GILTAB_USER}: ${GITLAB_PACKAGES_DIR}
fi

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 {} \;
chmod 0700 ${GITLAB_DATA_DIR}/uploads/
Expand Down