Skip to content

Commit

Permalink
Added permission check in repos folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jkarlosb committed Feb 12, 2017
1 parent 2ed3bd3 commit 371e509
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
@@ -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

1 comment on commit 371e509

@jkarlosb
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #1

Please sign in to comment.