X-Git-Url: https://git.jacobcasper.com/?p=sockgit.git;a=blobdiff_plain;f=sockgit-listen%40.service;fp=sockgit-listen%40.service;h=869e37f0238235559236da375318c58b1c577e9a;hp=1674d50aa61ae96abe7d357001bf3f3f79e17dd8;hb=421788a86f2ecef84c98eebc74a1f8a8fe2001e9;hpb=9f5fe0864b61c69907d69213b665600c5ebdfb5a 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