NAME
git-server - Secure Git Server with more granular hooks capabilities than default git.
SYNOPSIS
Standard Method:
With SHELL=/bin/bash, use the following format in ~/.ssh/authorized_keys:
command="~/git-server/gitserver KEY=user1" ssh-ed25519 AAAA_OAX+blah_pub__ user1@workstation
-- OR --
Advanced Method:
Set SHELL=/path/to/git-server (in /etc/passwd) and
Set "PermitUserEnvironment yes" (in /etc/ssh/sshd_config)
Then use the following format in ~/.ssh/authorized_keys:
environment="KEY=user1" ssh-ed25519 AAAA_OAX+blah_pub__ user1@workstation
ENV
You can set as many %ENV variables as you want within the authorized_keys configuration.
KEY
KEY has a special meaning to define a word for the associated user and KEY should be unique for each public key and this can be used for ACL rules.
INSTALL
This can be used with any existing git repositories or as a drop-in replacement for git-shell or you can create a fresh repo on the git host:
git init --bare project
Then add hooks/git-server to override the default behavior:
vi project/hooks/git-server
chmod 755 project/hooks/git-server
If hooks/git-server exists from within the repository being targeted, then this will run with the correct GIT_DIR and any other ENV settings defined in authorized_keys.
SEE ALSO
Similar functionality to the following:
gitlab-shell, gitolite, git-shell
AUTHOR
Rob Brown <bbb@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2015-2025 by Rob Brown <bbb@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.