add gitea bonus
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
export HOME=/data
|
||||
|
||||
GITEA_ADMIN_PASSWORD=$(cat /run/secrets/gitea_admin_password)
|
||||
|
||||
if [ ! -f "/data/gitea/conf/app.ini" ]; then
|
||||
mkdir -p /data/gitea/conf /data/git/repositories /data/gitea/log
|
||||
|
||||
SECRET_KEY=$(gitea generate secret SECRET_KEY)
|
||||
INTERNAL_TOKEN=$(gitea generate secret INTERNAL_TOKEN)
|
||||
JWT_SECRET=$(gitea generate secret JWT_SECRET)
|
||||
|
||||
sed \
|
||||
-e "s|__GITEA_DOMAIN__|${GITEA_DOMAIN}|g" \
|
||||
-e "s|__SECRET_KEY__|${SECRET_KEY}|" \
|
||||
-e "s|__INTERNAL_TOKEN__|${INTERNAL_TOKEN}|" \
|
||||
-e "s|__JWT_SECRET__|${JWT_SECRET}|" \
|
||||
/etc/gitea/app.ini.template > /data/gitea/conf/app.ini
|
||||
|
||||
chown -R git:git /data
|
||||
|
||||
setpriv --reuid=git --regid=git --clear-groups \
|
||||
/usr/local/bin/gitea migrate --config /data/gitea/conf/app.ini
|
||||
|
||||
setpriv --reuid=git --regid=git --clear-groups \
|
||||
/usr/local/bin/gitea admin user create \
|
||||
--config /data/gitea/conf/app.ini \
|
||||
--username "${GITEA_ADMIN_USER}" \
|
||||
--password "${GITEA_ADMIN_PASSWORD}" \
|
||||
--email "${GITEA_ADMIN_EMAIL}" \
|
||||
--admin \
|
||||
--must-change-password=false
|
||||
fi
|
||||
|
||||
chown -R git:git /data
|
||||
|
||||
exec setpriv --reuid=git --regid=git --clear-groups \
|
||||
/usr/local/bin/gitea web --config /data/gitea/conf/app.ini
|
||||
Reference in New Issue
Block a user