gitreef

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

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:
Mdocker-compose.yml | 2+-
Minit | 2+-
Mrun | 4+++-
Msudo-git | 2+-
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