Experiences with self-hosted git servers

Emmanuel Vadot manu at bidouilliste.com
Tue Feb 4 17:54:00 UTC 2020


On Tue, 4 Feb 2020 09:37:57 -0500
Ed Maste <emaste at freebsd.org> wrote:

> A remaining task for the Git Working Group is to evaluate and make a
> recommendation for repository hosting. Both self-hosted and third
> party services may be examined.
> 
> There are a number of options for self-hosting, such as Gitea, GitLab,
> as well as git's plain built-in server. Phabricator (which we use for
> code reviews) also includes a repository hosting module named
> Diffusion.
> 
> I am interested in hearing from FreeBSD users and developers who have
> used one or more of these, or other Git hosting tools - what worked
> well, what didn't? What do you wish you had known before getting
> started?
> _______________________________________________
> freebsd-git at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-git
> To unsubscribe, send any mail to "freebsd-git-unsubscribe at freebsd.org"

 My only experience is the hardcore low-level one. I have absolutely
no experience in all the "web thing". (Well we used gitlab at gandi for
both the source and ports tree but we where max 5 people to push stuff
there so ...)

 Back in ~2013 I did the git server for the school I worked at.
 *I* decided to not go the gitlab way so students didn't associate git
as a "web thingy" and external hosting was out of the question at the
time.
 The requirements were: 

 - Each students could create an illimited number of repositories.
 - There was a size quota for each students.
 - Students could set acls on a repository (that was for group projects
and so teachers/teachers assistant could get the code to evaluate the
students).
 - Could handle the flow when all the students did the "big last push"
   The TA cloned all repositories from students at a given date and
   time and all the students would just do a big git push 5 minutes
   before. On a small "big push day" it was ~1000 students doing a git
   push for a somewhat small project.
 - Everything should be on FreeBSD (this one was from me).

 The first thing I noticed is that an authorized_keys files with ~10000
keys doesn't scale well. Using a python script with an 
AuthorizedKeysCommand with the fingerprint of the key as a args that
would look into a redis database was way better. I don't think this
will be a problem with the number of commiters in the freebsd project.

 The git user shell wasn't git-shell on the frontends but also a python
script that looked up the backend node where the repository really was.
This script also used trickle (available in ports) to restrict
bandwidth to the students and set no limit for the TA on certain period.

 Some api/webstuff was done so TA could download a tarball directly,
this was done in python using libgit2, way faster that git-archive (and
easier to integrate into some web thing).

 Anyway, before choosing a tool (because tools can always be
improved overtime) the big question is which model we want to use :
 - The "svn" one where we push/pull.
 - The pull-request a la Linux
 - The pull-request a la "github"

 If we stay with the svn method we only need a replacement for svnweb
and cgit might be enough.

 Cheers,

-- 
Emmanuel Vadot <manu at bidouilliste.com> <manu at freebsd.org>


More information about the freebsd-git mailing list