gitea setup fixed

This commit is contained in:
qiaofeng1227 2023-10-18 14:08:11 +08:00
parent 1cbd60e546
commit d5d0850bea
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# Dockerfile refer to:https://github.com/go-gitea/gitea/blob/main/Dockerfile
# Dockerfile refer to: https://github.com/go-gitea/gitea/blob/main/Dockerfile
FROM gitea/gitea:1.20.4
LABEL maintainer="Websoft9<help@websoft9.com>"

View File

@ -39,10 +39,11 @@ su -c "
echo "Read credential from tmp"
username=$(grep -o "New user '[^']*" /tmp/credential | sed "s/New user '//")
if [ -z "$username" ]; then
username="websoft9"
if [ -z "$username" ] || [ "$username" != "websoft9" ]; then
echo "username is not websoft9, exit"
fi
password=$(grep -o "generated random password is '[^']*" /tmp/credential | sed "s/generated random password is '//")
rm -rf /tmp/credential
echo "Save to credential"
json="{\"username\":\"$admin_username\",\"password\":\"$password\",\"email\":\"$admin_email\"}"