#!/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_ed25519 ]; then ssh-keygen -t ed25519 -N \"\" -f /home/git/.ssh/id_ed25519; fi" su git -c "if [ -f /home/git/.ssh/id_ed25519.pub ]; then mv /home/git/.ssh/id_ed25519.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 <