Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I run a password-protected, read-only git server?

I need an application to be able to fetch from a git repository but not push to it, so, that's the read-only part. That could easily be done with git daemon.

On top of that, I need access to said repository to be password-protected, including for reading it. So before any fetching can happen, the application will need to authenticate.

Is it doable? with git daemon? something else? http + auth maybe?

like image 552
kch Avatar asked Feb 10 '09 18:02

kch


Video Answer


2 Answers

HTTP authentication will not protect the pack being transmitted over the wire, so if you are worried about eavesdroppers HTTP authentication will not suffice. Also, git is much more efficient using the git protocol than the HTTP protocol. git-daemon, however, does not do authentication for you.

Probably the best solution is to use gitosis which will allow you to protect the repository using ssh--cryptographically strong authentication, and confidentiality over the wire--and control access to the repository as well (e.g., have some users read-write and some users read-only). This will use the efficient git protocol over your ssh connection.

If you are willing to outsource this, github is perhaps the best approach. They have plans at different price points to meet many needs.

like image 91
Emil Sit Avatar answered Oct 11 '22 18:10

Emil Sit


The easiest way is to setup HTTP authentication on top of gitweb. See there.

like image 24
Keltia Avatar answered Oct 11 '22 16:10

Keltia