#!/usr/bin/env bash set -ev GITLAB_USERGROUP=${GITLAB_USERGROUP:-1010} GITLAB_SSH_PORT=${GITLAB_SSH_PORT:-9922} if ! id -u git >> /dev/null 2>&1; then groupadd -g ${GITLAB_USERGROUP} git useradd -m -u ${GITLAB_USERGROUP} -g git -s /bin/sh -d /home/git git fi su git -c "mkdir -p /home/git/.ssh/" su git -c "if [ ! -f /home/git/.ssh/id_rsa ]; then ssh-keygen -t rsa -b 4096 -N \"\" -f /home/git/.ssh/id_rsa; fi" su git -c "if [ -f /home/git/.ssh/id_rsa.pub ]; then mv /home/git/.ssh/id_rsa.pub /home/git/.ssh/authorized_keys_proxy; fi" mkdir -p /home/git/gitlab-shell/bin/ rm -f /home/git/gitlab-shell/bin/gitlab-shell tee -a /home/git/gitlab-shell/bin/gitlab-shell > /dev/null <