fix: git docker shim

This commit is contained in:
Strix 2023-10-30 01:53:54 +01:00
parent 8d45311e0d
commit ce0042117c
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
4 changed files with 3 additions and 2 deletions

View file

@ -4,4 +4,5 @@ if ! getent passwd git &>/dev/null; then
echo "creating git user..."
useradd -m git
usermod git -aG docker
chsh -s /home/git/docker-shell git
fi

View file

@ -1,3 +1,3 @@
Match User git
AuthorizedKeysCommandUser git
AuthorizedKeysCommand /usr/bin/docker exec -i git /usr/local/bin/gitea keys -c /data/gitea/conf/app.ini -e git -u %u -t %t -k %k
AuthorizedKeysCommand /usr/bin/docker exec -iu git git /usr/local/bin/gitea keys -c /data/gitea/conf/app.ini -e git -u %u -t %t -k %k

View file

@ -1,2 +1,2 @@
#!/bin/sh
/usr/bin/docker exec -i --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" gitea sh "$@"
/usr/bin/docker exec -iu git --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" git sh "$@"