Reputation: 2574
Git official document shows the way use git server via http with apache and git-http-backend
.
I want straight interactive with git-http-backend
in my program via http.
It's just like what's the apache proxy does but I need control more things from git client, such as refuse client pull
by his username and the path of repository directory what he request.
how to use git-http-backend
as a http service straightly?
Upvotes: 1
Views: 2073
Reputation: 1323943
You can read its documentation at docs/git-http-backend
and see its sources in http-backend.c
(tested here).
Sicne it is a Common Gateway Interface (CGI), it is called by a listener, like an http server, but also any other listener(!), like SSH.
See Gitolite (an authorization layer), which does precisely that: since it is called git-xxx
(here: git-hhtp-backend
), you can call: git http-backend
: that is what its gitolite-shell does.
Since that backend in turn calls git services (git-upload-pack, git-receive-pack, objects/info/packs, ...), you can do what git-http-backend does directly. That is also what gitolite implements here.
Upvotes: 0
Reputation:
git-http-backend
is described in the documentation as a CGI program. Since a CGI program alone doesn't speak HTTP, you must either talk to it with the CGI protocol instead (this is an inter-process communication protocol involving environment variables and stdin and stdout) or hook it up to an HTTP server such as Apache.
The name might be confusing, but this "HTTP backend" goes behind the HTTP server.
Upvotes: 1