fix(jd): reconcile code-channel push permissions
This commit is contained in:
parent
cc73a708fb
commit
574d1de23b
2 changed files with 24 additions and 0 deletions
18
server-tools/lake-lamp-authz/hooks/guanghu-ice-heart-post-receive
Executable file
18
server-tools/lake-lamp-authz/hooks/guanghu-ice-heart-post-receive
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
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)
|
||||
cd "$repo_dir"
|
||||
owner_uid=$(id -u)
|
||||
|
||||
find "$repo_dir/objects" "$repo_dir/refs" -user "$owner_uid" -type d -exec chmod g+rwx {} +
|
||||
find "$repo_dir/objects" "$repo_dir/refs" -user "$owner_uid" -type f -exec chmod g+rw {} +
|
||||
|
||||
for shared_file in HEAD packed-refs; do
|
||||
if [ -f "$repo_dir/$shared_file" ]; then
|
||||
find "$repo_dir/$shared_file" -user "$owner_uid" -exec chmod g+rw {} +
|
||||
fi
|
||||
done
|
||||
Loading…
Reference in a new issue