git-serv

All-in-one Git hosting container

git clone git://git.janzachar.dev/git-serv.git


0#!/bin/sh
1
2set -eu
3
4die() {
5	echo "$@"
6	exit 1
7}
8
9[ ! -d "/srv/config/" ] && die "You should mount your config at '/srv/config/'!"
10[ ! -d "/srv/ssh/" ] && die "You should mount your ssh keys at '/srv/ssh/'!"
11[ ! -d "/srv/repos/" ] && die "You should mount your repos at '/srv/repos/'!"
12
13
14for file in init/*;
15do
16	echo "Executing: '$file'..."
17	"./$file"
18done
19
20/usr/sbin/sshd
21git daemon \
22  --reuseaddr \
23  --base-path=/srv/repos \
24  --export-all \
25  --verbose \
26  --listen=0.0.0.0 \
27  /srv/repos &
28
29lighttpd -f /srv/config/lighttpd.conf
30
31# Wait indefinitely
32tail -f /dev/null
33