|
|
@ -5,22 +5,16 @@ while ! mariadb -hmariadb -u$GITEA_DATABASE_USR -p$GITEA_DATABASE_PWD $GITEA_DAT |
|
|
|
echo "Gitea waiting db..." |
|
|
|
sleep 5 |
|
|
|
done |
|
|
|
ls -la |
|
|
|
echo "Initializing gitea..." |
|
|
|
adduser -D git |
|
|
|
addgroup --system git git |
|
|
|
mkdir -p /var/lib/gitea/{custom,data,log} |
|
|
|
chown -R git:git /var/lib/gitea/ |
|
|
|
chmod -R 750 /var/lib/gitea/ |
|
|
|
|
|
|
|
if [ ! -f "app.ini.bak" ]; then |
|
|
|
echo "Initializing gitea..." |
|
|
|
mv app.ini app.ini.bak |
|
|
|
cp /tmp/app.ini . |
|
|
|
chown -R root:git . |
|
|
|
chmod -R 770 . |
|
|
|
sed -i "/NAME .*/c\NAME = $GITEA_DATABASE_NAME" app.ini |
|
|
|
sed -i "/USER .*/c\USER = $GITEA_DATABASE_USR" app.ini |
|
|
|
sed -i "/PASSWD .*/c\PASSWD = $GITEA_DATABASE_PWD" app.ini |
|
|
|
su git -c "gitea migrate" |
|
|
|
su git -c "gitea admin user create --username $GITEA_ADMIN_USR --password $GITEA_ADMIN_PWD --email $GITEA_ADMIN_MAIL --admin" |
|
|
|
gitea migrate |
|
|
|
gitea admin user create --username $GITEA_ADMIN_USR --password $GITEA_ADMIN_PWD --email $GITEA_ADMIN_MAIL --admin |
|
|
|
fi |
|
|
|
echo "Launching gitea on localhost:3000" |
|
|
|
su git -c "gitea web --config /etc/gitea/app.ini" |
|
|
|
gitea web --config /etc/gitea/app.ini &> /dev/null |
|
|
|