git-restrict

simple utility for git repo permission management
git clone https://git.parazyd.org/git-restrict
Log | Files | Refs | README | LICENSE

commit 2cdc1aaee457c45e8943c80f9a5ab7fa17e5da77
parent d11979654e183e95b46501dba3c364c187db5397
Author: parazyd <parazyd@dyne.org>
Date:   Wed, 31 Mar 2021 03:35:08 +0200

Add contrib files.

Diffstat:
Acontrib/gen_rules.sh | 16++++++++++++++++
Acontrib/keys/user0 | 2++
Acontrib/keys/user1 | 1+
3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/contrib/gen_rules.sh b/contrib/gen_rules.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +misc="no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty" + +gen_for_keys() { + while read -r key; do + printf "command=\"/usr/bin/git-restrict %s\",%s %s\n" "$@" "$misc" "$key" + done +} + +# Admin, let's say they don't need "command" guards. +cat keys/user0 + +# Users which we want to cap repos for. +repos_user1="some-repository another-repo" +gen_for_keys "$repos_user1" < keys/user1 diff --git a/contrib/keys/user0 b/contrib/keys/user0 @@ -0,0 +1,2 @@ +ssh-ed25519 AAAA...0N user0@somemachine +ssh-ed25519 AAAA...PI user0@anothermachine diff --git a/contrib/keys/user1 b/contrib/keys/user1 @@ -0,0 +1 @@ +ssh-ed25519 AAAA...foo user1@foo