fix(jd): install sharing hook through Forgejo

This commit is contained in:
冰朔 2026-07-30 00:00:23 +08:00
commit c7c17f8fd4
2 changed files with 6 additions and 3 deletions

View file

@ -88,7 +88,7 @@ node server-tools/lake-lamp-authz/authorize-repo-push.js \
`safe.directory`,不得使用通配符。
光湖代码频道本身保留 `UMask=0077`,以免放宽数据库和其他状态目录。仅在
`guanghu-ice-heart.git/hooks/post-receive` 安装仓库随附的
`guanghu-ice-heart.git/hooks/post-receive.d/guanghu-ice-heart-share` 安装仓库随附的
`hooks/guanghu-ice-heart-post-receive`,让成功的公共 Git 推送完成后校正
`objects``refs` 的共享组权限。不要为了共享一个裸仓库而修改整个代码频道服务的
UMask。

View file

@ -4,7 +4,10 @@ set -eu
# The code-channel service runs with UMask=0077. Keep that isolation for its
# database and other state, but make Git objects and refs readable/writable by
# the repository's dedicated shared group after an accepted public push.
repo_dir=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd -P)
cat >/dev/null
repo_dir=$(git rev-parse --absolute-git-dir)
expected_repo=/var/lib/guanghu/personas/guanghu/hlcc-v16.0.1/data/repositories/bingshuo/guanghu-ice-heart.git
[ "$repo_dir" = "$expected_repo" ] || exit 0
cd "$repo_dir"
owner_uid=$(id -u)
@ -30,4 +33,4 @@ for shared_file in HEAD packed-refs; do
fi
done
printf '%s\n' "post_receive_permissions_reconciled" >"$repo_dir/hooks/post-receive.last"
printf '%s\n' "post_receive_permissions_reconciled" >"$repo_dir/hooks/post-receive-share.last"