An SSH server made specifically for accepting git pushes that will trigger an auth script and then a receiver script to handle the push.
This is a more advanced, standalone version of gitreceive.
Usage: ./gitreceived [options] <authchecker> <receiver>
-n=false: disable client authentication
-p="22": port to listen on
-r="/tmp/repos": path to repo cache
-k="": pem file containing private keys (read from SSH_PRIVATE_KEYS by default)
authchecker is a path to an executable that will check if the key is
authorized, and exit with status 0 if it is. It will be called with the
following arguments:
authchecker $USER $KEY
$USERis the username that was provided to the server.$KEYis the public key that was provided to the server.
The receiver is a path to an executable that will handle the push. It will get
a tar stream of the repo via stdin and the following arguments:
receiver $PATH $COMMIT
$PATHis the path of the repo that was pushed to. It will not contain slashes.$COMMITis the SHA of the commit that was pushed to master.
- Write tests.
- Allow authchecker to return JSON including receiver environment.
- Support RPC as an option for authchecker.