-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
27 lines (22 loc) · 727 Bytes
/
run.sh
File metadata and controls
27 lines (22 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
if [ "$REPOSITORY_URL" == "" ]; then
REPOSITORY_URL="https://github.com/test-editor/language-examples"
fi
# If there is some public key in keys folder
# then it copies its contain in authorized_keys file
cd /home/git
cat /git-server/keys/*.pub > .ssh/authorized_keys
chown -R git:git .ssh
chmod 700 .ssh
chmod -R 600 .ssh/*
# Checking permissions and fixing SGID bit in repos folder
# More info: https://github.com/jkarlosb/git-server-docker/issues/1
cd /git-server/repos
git clone $REPOSITORY_URL --bare
chown -R git:git .
chmod -R ug+rwX .
find . -type d -exec chmod g+s '{}' +
mkdir -p ~/.ssh
cat /git-server/keys/*.pub > ~/.ssh/authorized_keys
# -D flag avoids executing sshd as a daemon
/usr/sbin/sshd -D