This commit is contained in:
qiaofeng1227 2023-10-25 09:15:16 +08:00
parent c55dc5797b
commit 3a330292d2
2 changed files with 3 additions and 5 deletions

View file

@ -1,4 +1,4 @@
# modify time: 202310250924, you can modify here to trigger Docker Build action # modify time: 202310250925, you can modify here to trigger Docker Build action
# 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 FROM gitea/gitea:1.20.4

View file

@ -8,7 +8,6 @@ response=""
cred_path="/data/gitea/credential" cred_path="/data/gitea/credential"
admin_username="websoft9" admin_username="websoft9"
admin_email="help@websoft9.com" admin_email="help@websoft9.com"
user_exist=0
while [ "$response" != "200" ]; do while [ "$response" != "200" ]; do
response=$(curl -s -o /dev/null -w "%{http_code}" localhost:3000) response=$(curl -s -o /dev/null -w "%{http_code}" localhost:3000)
@ -35,12 +34,11 @@ su -c "
exit 0 exit 0
else else
gitea admin user create --admin --username '$admin_username' --random-password --email '$admin_email' > /tmp/credential gitea admin user create --admin --username '$admin_username' --random-password --email '$admin_email' > /tmp/credential
user_exist=1 touch /data/gitea/create_user 2>/dev/null
fi fi
" git " git
echo "$user_exist" if [ -f /data/gitea/create_user ]; then
if [ "$user_exist" -eq 1 ]; then
echo "Read credential from tmp" echo "Read credential from tmp"
username=$(grep -o "New user '[^']*" /tmp/credential | sed "s/New user '//") username=$(grep -o "New user '[^']*" /tmp/credential | sed "s/New user '//")
if [ -z "$username" ] || [ "$username" != "websoft9" ]; then if [ -z "$username" ] || [ "$username" != "websoft9" ]; then