mirror of
https://github.com/nicolabs/git-server-docker.git
synced 2025-09-07 18:11:08 +02:00
Added permission check in repos folder
This commit is contained in:
parent
2ed3bd3ac2
commit
371e509e62
12
start.sh
12
start.sh
|
@ -1,15 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd /home/git
|
||||
|
||||
# If there is some public key in keys folder
|
||||
# then it copies its contain in authorized_keys file
|
||||
if [ "$(ls -A /git-server/keys/)" ]; then
|
||||
cd /home/git
|
||||
cat /git-server/keys/*.pub > .ssh/authorized_keys
|
||||
chown -R git:git .ssh
|
||||
chmod 700 .ssh
|
||||
chmod -R 600 .ssh/*
|
||||
fi
|
||||
|
||||
# Checking permissions and fixing SGID bit in repos folder
|
||||
# More info: https://github.com/jkarlosb/git-server-docker/issues/1
|
||||
if [ "$(ls -A /git-server/repos/)" ]; then
|
||||
cd /git-server/repos
|
||||
chown -R git:git .
|
||||
chmod -R ug+rwX .
|
||||
find . -type d -exec chmod g+s '{}' +
|
||||
fi
|
||||
|
||||
# -D flag avoids executing sshd as a daemon
|
||||
/usr/sbin/sshd -D
|
||||
|
|
Loading…
Reference in a new issue