commit 74f0b3ba3318ae196726929647ece4f2d0d11f6c
parent 306746388f48c379b4a2ce7be4a41cd916ffa79c
Author: Matthias Jaros <jaros@mailbox.org>
Date: Sun, 19 Oct 2025 11:40:00 +0200
Finally works with permission checks
Diffstat:
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/docker-compose.yml b/docker-compose.yml
@@ -11,7 +11,7 @@ services:
- "--users"
- pass,yolo
- "--repos"
- - pass:pass
+ - pass:pass,yolo:yolo
volumes:
- ./keys:/var/keys
- ./repos:/srv/repos
diff --git a/init b/init
@@ -35,7 +35,7 @@ for repoConfig in (string split ',' $_flag_r)
# write user as allowed into permission file
for user in $parsedConfig[2..]
- echo "$repo:$user" >> /srv/repos/permissions
+ echo "$repoDir:$user" >> /srv/repos/permissions
end
# setup repo dir
diff --git a/run b/run
@@ -2,7 +2,9 @@
# echo check for permissions
set -l USER (whoami)
-#cat /srv/repos/permission | grep -E "^
+set matcher (string match -r -g "^.*'(.*)'\$" "$argv")
+cat /srv/repos/permissions | grep -q -E "^$matcher[1]:$USER"
+or exit 1;
# run command
/usr/bin/sudo -u git /usr/bin/git-shell -c "$argv"
diff --git a/sudo-git b/sudo-git
@@ -1,2 +1,2 @@
Defaults:pass !requiretty
-pass ALL=(git) NOPASSWD: /usr/bin/git-shell
+ALL ALL=(git) NOPASSWD: /usr/bin/git-shell