summaryrefslogtreecommitdiffstats
path: root/root/entrypoint
blob: 9845a7784d3908b6e6802c865a8bbc5335498456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/sh

export USER=git
export HOME=/data
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)

grep -v ^git /etc/passwd > "$HOME/passwd"
echo "git:x:${USER_ID}:${GROUP_ID}:gogs.io user:${HOME}:/bin/bash" >> "$HOME/passwd"
cat "$HOME/passwd" > /etc/passwd

#No nss_wrapper in Alpine Linux yet
#export LD_PRELOAD=libnss_wrapper.so
#export NSS_WRAPPER_PASSWD=${HOME}/passwd
#export NSS_WRAPPER_GROUP=/etc/group
#export PORT=3000

mkdir -p /data/gogs/data /data/gogs/conf /data/gogs/log /data/git /data/ssh

exec "$@"