Live data from Hacker News

Poll: Self Hosting Git Repositories

news.ycombinator.com

41–50 of 86 posts

Re: Poll: Self Hosting Git Repositories

#41
post #29

SourceHut ( https://sr.ht ) is open source, although I've never tried setting it up for self-hosting. Anyone here with experience?

On Alpine Linux it’s quite simple. Each service of sourcehut is already packaged for Alpine (SourceHut’s author Drew Devault is also an Alpine contributor.) so all that’s needed is a few `apk add` and basic configuration. And a PostgreSQL database. I never finished setting up the CI service though because it requires building your own VM images to run scripts in and that was more work than I was willing to do at the time. But since it’s all modular you can have a working instance without the CI service.

Re: Poll: Self Hosting Git Repositories

#44
post #14

I voted "other": I just put bare git repositories on my VPS, and interact with them over SSH. Tiny and simple cgit exposes a read-only HTTPS interface for the repos that I want to share publicly.

Similar here. So simple:

  user@remote ~ > git init --bare myproject.git
  user@local myproject > git remote add vps user@remote:myproject.git

Re: Poll: Self Hosting Git Repositories

#47

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.

As far as I know there's nothing wrong with access via direct SSH if you have a simple single-user setup and just want to store your repos on a remote host.

However I once saw a small team try that approach and it caused endless problems related to permissions and ownership of the files on the remote system. Maybe things have improved or with a better setup it would be easier but from my experience 0/10 would not recommend.

In that scenario -- where you have a small team and want a remote host for the repos but you don't want all the other baggage -- I've found gitolite to be a good solution. It provides a simple access control layer to handle the multiple git users and basic security requirements while using only a single local user on the server side. Otherwise it stays out of your way and it's mostly just a smart use of git hooks so it's very lightweight.

Re: Poll: Self Hosting Git Repositories

#48
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

Gitea is love. There are not a lot of shenanigans and it just does the job. If you want vcs with an online interface it's great for personal use and smaller teams.

If you want fancier stuff like integrated CI/CD that is more common out there, Gitlab is an option, but running it by yourself it's not as simple (as gitea), for example.

Re: Poll: Self Hosting Git Repositories

#49
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…

Do you mean use VSCode with Remote-SSH and just work on a server?

Re: Poll: Self Hosting Git Repositories

#50
post #2

You may want to give more details about your usecase: do you need _only_ git hosting or other features too (e.g. issue tracker, CI/CD pipelines)? How many users will use this setup? Do you have a dedicated machine or you run it locally (e.g. in a docker container?? Hosting locally or in cloud? IIRC Gitolite was aquired by Gitlab a while back, Gitweb is not really a git hosting, it's more like a web view of your `git…

Gitolite is open source maintained by Sitaram Chamarty https://gitolite.com/ so I don't think it's even possible to acquire it in the way you suggest.

Gitweb can work quite nicely with gitolite to provide a web view of your repositories, with access control managed by gitolite.

Post reply on HN