Live data from Hacker News

Poll: Self Hosting Git Repositories

news.ycombinator.com

31–40 of 86 posts

Re: Poll: Self Hosting Git Repositories

#31
I prefer to do my project management in in disjunct tools from the actual source control (and I dislike the tech stack of most integrated solutions), so my main repository host is running fugit[1], which simply allows push/pull access on a per-ssh-key basis. Some repositories are then exposed to the Web using cgit[2]

[1] https://github.com/cbdevnet/fugit [2] https://git.zx2c4.com/cgit/

Re: Poll: Self Hosting Git Repositories

#32
post #21

if it's for personal use and no access rights are needed, just use ssh. If you need to add more people, but don't require access right for the git repos (i.e. everyone will be able to force push). Still use ssh, but create a git user and git-shell as the shell to improve security. If you want to go one step up, I was looking at soft-serve, however it's too immature yet. So I added a git-shell-commands folder and adde…

> if it's for personal use and no access right are needed, just use ssh.

This! I think many people don't realize how easy it is to host git repositories over just pure ssh. I backup all my git repositories this way, and also have a usb disk drive with backups (which is super easy to setup, just add a git remote with a unix path to where you wanna send it). Each repository I have have three remotes (`origin` which is usually GitHub/Codeberg, `ssh` which is my remote backup and `usb` which is my disk drive). My alias `gp` pushes the current branch to all three simultaneously.

Re: Poll: Self Hosting Git Repositories

#33
post #13

Gitea (originally a fork of Gogs) is moving fast, and they are adding ActivityPub federation support to the software. This will allow you to collaborate with projects hosted on remote Gitea instances (and other software once they add federation support too). If you are working on FOSS then Codeberg [1] is a good Gitea instance, which offer Woodpecker CI and Codeberg Pages. [1] https://codeberg.org

I believe the Gitea people are also about to add an artifact registry feature.

I run a Gitea instance on my Synology to act as a source for flux2 on the living room Kubernetes cluster. I don't want to have that on Github so it'll all work without internet connectivity (still a WIP though). I had my own Gitlab for a long time but at some point its hunger for resources made it uneconomic for my use case. Gitea does less but in a fraction of the resources.

Re: Poll: Self Hosting Git Repositories

#34

If you don't need a front-end, push and pull directly from git. https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-...

I am surprised that this got downvoted so quickly without comment. I'd genuinely like to know what the downsides of doing it this way would be. Having to manage your own SSH keys seems like a problem, but I don't know what the others would be since my needs aren't very big.

Re: Poll: Self Hosting Git Repositories

#35
I use ssh, and a script that manages ssh keys and system user accounts, with a umask change and some symlinks. This means I can add read-only ssh access for deployment keys. The remote address would be of the form ssh://{clientname}[-ro]@domain:port/~/repos/{reponame}.git

The [-ro] gives the readonly access. I use git-shell to prevent normal ssh access to the server on those accounts.

Re: Poll: Self Hosting Git Repositories

#37
post #5

Earlier quoted context omitted.

This poll is really me being curious about what the citizens of HN use themselves. My own use case would benefit greatly from CI/CD pipelines, but beyond that I'm mostly looking for a nice web interface to expose the repository contents.

Gitlab CI is powerful, and (IMHO/IME) a selling point compared to other options.

In my company CI is pretty trivial. docker build . -t projectname:branchname and push it to the internal registry. For one project I set up additional docker run step to run integration test (it used docker itself so it was not possible to run it at build time which is docker limitation IMO). I remember setting up complex jenkins jobs back in the past, but at this time usually all you need is to build docker container from your project and actual build configuration is inside Dockerfile. And this should not require complex CI (and I spent more than one hour setting up Gitlab CI for this simple workflow). Gitlab CI is powerful indeed, but needlessly complex IMO. If I would set up project for myself, I probably would downshift to simple bash script like I did CI 15 years ago.

Re: Poll: Self Hosting Git Repositories

#38

I use ssh, and a script that manages ssh keys and system user accounts, with a umask change and some symlinks. This means I can add read-only ssh access for deployment keys. The remote address would be of the form ssh://{clientname}[-ro]@domain:port/~/repos/{reponame}.git The [-ro] gives the readonly access. I use git-shell to prevent normal ssh access to the server on those accounts.

I also use this method. Getting some front-end UIs to work with ssh is kind of a pain though.

That said, I think what the OP actually wants it a web front-end.

Re: Poll: Self Hosting Git Repositories

#39
post #26
post #22

Earlier quoted context omitted.

Hasn't broken for me, using it for a few years now. Are you talking of gitlab breaking specifically? Maybe that's the difference, since I use gitea instead.

Self hosted gitlab breaks all the time, at least for us. Maybe had ~10 significant issues just the last few months.

I keep expecting mine to break, but hasn't missed a beat in 2+ years.
Post reply on HN