From: Jacob Casper Date: Sat, 18 Apr 2020 04:29:01 +0000 (-0500) Subject: Add ip filtering X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=421788a86f2ecef84c98eebc74a1f8a8fe2001e9;p=sockgit.git Add ip filtering --- diff --git a/sockgit-listen@.service b/sockgit-listen@.service index 1674d50..869e37f 100644 --- a/sockgit-listen@.service +++ b/sockgit-listen@.service @@ -8,7 +8,7 @@ Type=oneshot User=git Group=git WorkingDirectory=/srv/git -ExecStart=/bin/bash -c 'while read REPO; do /usr/bin/git init --bare --shared $REPO.git && cd $REPO.git && /usr/bin/git remote add public $USER@$PUBLIC:$PATH/$REPO.git; done;' +ExecStart=/bin/bash -c '[ $REMOTE_ADDR == $WHITELIST_IP ] && while read REPO; do /usr/bin/git init --bare --shared $REPO.git && cd $REPO.git && /usr/bin/git remote add public $USER@$PUBLIC:$PATH/$REPO.git; done;' StandardInput=socket StandardOutput=syslog StandardError=syslog @@ -16,6 +16,7 @@ Environment="USER=git" Environment="PUBLIC=add your url" Environment="PATH=/srv/git" Environment="GIT_TEMPLATE_DIR=/usr/share/sockgit/templates" +Environment="WHITELIST_IP=your ip" [Install] WantedBy=multi-user.target