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

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

grep -v ^git /etc/passwd > "$HOME/passwd"
echo "gogs: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 "$@"