summaryrefslogtreecommitdiffstats
path: root/root/entrypoint
blob: bf641a5f79a405e0bf3ed0c5b0f9d41422664208 (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\|gogs\)" /etc/passwd > "/tmp/passwd"
echo "gogs:x:${USER_ID}:${GROUP_ID}:gogs.io user:${HOME}:/bin/bash" >> "/tmp/passwd"
cat "/tmp/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 "$@"