Remix.run Logo
xrd 6 hours ago

I've been messing around with GitLab as a self hosted alternative for a few years. I do like it, but it is resource intensive!

For the past few days I've been playing with Forgejo (from the Codeberg people). It is fantastic.

The biggest difference is memory usage. GitLab is Ruby on Rails and over a dozen services (gitlab itself, then nginx, postgrest, prometheus, etc). Forgejo is written in go and is a single binary.

I have been running GitLab for several years (for my own personal use only!) and it regularly slowly starts to use up the entirety of the RAM on a 16GB VM. I have only been playing with Forgejo for a few days, but I am using only 300MB of the 8 GB of RAM I allocated, and that machine is running both the server and a runner (it is idle but...).

I'm really excited about Forgejo and dumping GitLab. The biggest difference I can see if that Forgejo does not have GraphQL support, but the REST API seems, at first glance, to be fine.

EDIT: I don't really understand the difference between gitea and forgejo. Can anyone explain? I see lots of directories inside the forgejo volume when I run using podman that clearly indicate they are the same under the hood in many ways.

EDIT 2: Looks like forgejo is a soft fork in 2022 when there were some weird things that happened to governance of the gitea project: https://forgejo.org/compare-to-gitea/#why-was-forgejo-create...

isodev 5 hours ago | parent | next [-]

> I'm really excited about Forgejo

Our product studio with currently around 50 users who need daily git access moved to a self hosted forgejo nearly 2 years ago.

I really can’t overstate the positive effects of this transition. Forgejo is a really straightforward Go service with very manageable mental model for storage and config. It’s been easy and cheap to host and maintain, our team has contributed multiple bugfixes and improvements and we’ve built a lot of internal tooling around forgejo which otherwise would’ve required a much more elaborate (and slow) integration with GitHub.

Our main instance is hosted on premise, so even in the extremely rare event of our internet connection going offline, our development and CI workflows remain unaffected (Forgejo is also a registry/store for most package managers so we also cache our dependencies and docker images).

xrd 5 hours ago | parent [-]

Wait, forgejo offers a built-in container registry? How does that work? I don't see that in the admin section at all.

isodev 5 hours ago | parent | next [-]

Container registry and a lot more, they call it Package registry in the docs https://forgejo.org/docs/latest/user/packages/

irusensei 4 hours ago | parent | prev [-]

Just run podman or docker login your.forgejo.instance.address then push to it as normal. An existing repo must exist. You can check the images under site administration -> packages.

Speaking of authentication it also works as an openid provider meaning you can authenticate every other web software that supports it to Forgejo... which in turn can look for users in other sources.

It also has wikis.

Its an underrated piece of software that uses a ridiculous small amount of computer resources.

xrd 4 hours ago | parent [-]

That's so brilliant. Wow. I'm struggling to wrap my brain around how they not only support OCI (docker) but also APK (alpine) and APT (debian) packages. That's a very cool feature.

homebrewer 6 hours ago | parent | prev | next [-]

Ease of maintenance is an even bigger difference. We've been using gitea for a bit over five years now, and gitlab for a few years before that, and gitea requires no maintenance in comparison. Upgrades come down to pulling the new version and restarting the daemon, and take just a few seconds. It's definitely the best solution for self-hosters who want to spend as little time as possible on their infrastructure.

Backups are handled by zfs snapshots (like every other server).

We've also had at least 10× lower downtime compared to github over the same period of time, and whatever downtime we had was planned and always in the middle of the night. Always funny reading claims here that github has much better uptime than anything self-hosted from people who don't know any better. I usually don't even bother responding anymore.

veeti 4 hours ago | parent | next [-]

I guess I'll just chime in that while Gitlab is a very heavy beast, I have self hosted it for over a decade with little to no issues. It's pretty much as simple as installing their Omnibus package repository and doing apt install gitlab-ce.

c-hendricks 6 hours ago | parent | prev | next [-]

When I self hosted gitlab I never found the maintenance to be that bad, just change a version in a compose.yml, sometimes having to jump between blessed versions if I've missed a few back to back.

Like others, I've switch to Gitea, but whenever I do visit gitlab I can't help but think the design / UX is so much nicer.

dvdkon 3 hours ago | parent [-]

My usual impression of GitLab is that it has too many functions I don't ever use, so the things I actually do want (code, issues, PRs, user permissions) are needlessly hidden. What's your workflow that you find GitLab's UX to be nicer than Gitea's?

mbreese 32 minutes ago | parent [-]

That was my take too. It is a big project with a lot of functionality. But, I never needed all of that functionality, so it just seemed bloated to me. I switched over to Gitea for self-hosted code repositories (non-public repos behind a firewall) a while back and haven't had any issues thus far.

estimator7292 5 hours ago | parent | prev [-]

I found gitea's interface to be so unusably bad that i switched to full-fat GitLab.

Gitea refused to do some perfectly sensible action- I think it had something to do with creating a fork of my own repo. Looking online, there's zero technical reason for this, and the explanation given was "this is how GitHub does things". Immediately uninstalled. I'm not here for this level of disrespect.

IgorPartola 3 hours ago | parent | prev | next [-]

What exactly is the advantage of running something like GitLab vs what I do which is just a server with SSH and a file system? To create a new repo I do:

  ssh example.com ‘mkdir repos/my-proj.git && cd repos/my-proj.git && git init —bare .’
Then I just set my remote origin URL to example.com:repos/my-proj.git

The filesystem on example.com is backed up daily. Since I do not need to send myself pull requests for personal projects and track my own TODOs and issues via TODO.md, what exactly am I missing? I have been using GitHub for open source projects and work for years but for projects where I am the only author, why would I need a UI besides git and my code editor of choice?

RamblingCTO 3 hours ago | parent | next [-]

What exactly is the advantage of running something like a restaurant vs what I do at home which is just cook it myself?

-> convenience, collaboration, mobility

oooyay 3 hours ago | parent | prev | next [-]

Collaboration and specifically collaboration with non git nerds. That's primarily what made GitHub win the VCS wars back in the day. The pull request model appealed to anyone who didn't want to learn crafting and emailing patches.

simpaticoder 2 hours ago | parent [-]

Yes, it's the PRs, and there is a misunderstanding I think because the OP and the GP's use-cases are quite different. Self-hosting your own repository on a remote server (and perhaps sharing it with 1 or 2 collaborators) is simple but quite different than running a public open source project that solicits contributions.

gorgoiler an hour ago | parent | prev | next [-]

You don’t! Forges are for collaboration outside of the rhythm of git commits. You’re happy to make a new commit every time you have something to add to an issue. With X issues and Y comments a hour, polluting the git timeline with commentary is going to become unhelpful.

Some forges even include(d) instant messaging!

https://secure.phabricator.com/Z1336

Etheryte 2 hours ago | parent | prev | next [-]

This is kind of like asking what the point of Dropbox is when we have rsync. Rsync is nice, but most people won't know how to use it.

delusional 3 hours ago | parent | prev [-]

> why would I need a UI besides git and my code editor of choice?

If you ever find yourself wishing for a web UI as well, there's cgit[1]. It's what kernel.org uses[2].

[1]: https://git.zx2c4.com/cgit/ [2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

gchamonlive 5 hours ago | parent | prev | next [-]

https://forgejo.org/docs/latest/user/actions/basic-concepts/

It's a shame that GitHub won the CI race by sheer force of popularity and it propagates its questionable design decisions. I wish more VCS platforms would base their CI systems on Gitlab, which is much much better than GitHub actions.

WD-42 2 hours ago | parent [-]

Both are yaml jungles, I hate them equally.

zdw 6 hours ago | parent | prev | next [-]

If you want even more minimal, Gerrit is structured as a Java app with no external dependencies like databases, and stores all it's configuration and runtime information on the filesystem, mostly as data structures in the git repos.

Shared filesystems is all you need to scale/replicate it, and it also makes the backup process quite simple.

hk1337 5 hours ago | parent | next [-]

I might be one of the few that is intrigued by this being that it’s Java but this looks really neat. Does it do git repositories like gitea, GitHub, etc, or is it more of a project management site for the repositories? They describe it as “code review”, so I wasn’t sure.

I’m a little put off on the google connection but it seems like it could run rather independently.

zdw 8 minutes ago | parent | next [-]

It's hyper-focused on code review and CI integration, which it does really well.

It's not focused on all the other stuff that people think of in code forges (hosting the README in a pretty way, arbitrary page hosting, wiki, bug tracking, etc.) but can be integrated with 3rd party implementations of those fairly trivially.

arccy 2 hours ago | parent | prev [-]

It necessarily hosts a git server (using jgit), but the primary interface is as a code review tool.

even browsing the git repos it hosts uses an embedded version of another tool (gitiles).

https://gerrithub.io/ is a public instance

Kwpolska 4 hours ago | parent | prev [-]

The deployment may be simple, but at the same time, the Gerrit code review workflow is terrible.

zdw 32 minutes ago | parent [-]

I personally find the rebase and stacking commit focused method of integration that Gerrit uses to be easier and cleaner than PR's in GitHub.

Having done CI integrations with both, Gerrit's APIs send pre- and post-merge events through the same channel, instead of needing multiple separate listeners like GitHub.

jmspring 4 hours ago | parent | prev | next [-]

One concern the post brings up - single point of failure. Yes, in this case, blah blah big company microsoft blah blah (I don't disagree, but..). I'm more worried about places like Paypal/Google/etc banning than the beast from Redmond.

Self hosting, it's still a single point of failure and the article arguing "mirroring", well... it allows redundancy with reads but writes?

It's an interesting take on a purist problem.

avhon1 13 minutes ago | parent | next [-]

Redundancy for read access to the source code is a concern for Dillo. Some years ago, the domain name registration lapsed, and was promptly bought by an impersonator, taking the official repository offline. If it hadn't been for people having clones of the repository, the source code and history would have been lost.

How do people find your online project and know it's you (instead of an impersonator) without relying on an authority, like GitHub accounts or domain names? It is a challenging problem with no good solution. At least now the project is alive again and more resilient than before.

II2II an hour ago | parent | prev | next [-]

I found the banning comment to be odd. That said, all it really takes is a policy change (something that I see as far more likely in Microsoft's case) or simply a change in the underlying software (again, somewhat likely with Microsoft) for the platform to become unusable for them. Keep in mind that Dillo is a browser for those who can't on don't want to fit into the reality of the modern web.

isodev 4 hours ago | parent | prev [-]

I think it’s a fair concern, e.g. forgejo is a simple directory on disk, with an option to make that into an S3 storage. It really is a no brainer to set that up for as much resilience as necessary with various degrees of “advanced” depending on your thread model and experience. The lack of a FAANG/M in the equation makes it even more palatable.

adamcharnock 6 hours ago | parent | prev [-]

We've been looking at Forgejo too. Do you have any experience with Forgejo Actions you can share? That is one thing we are looking at with a little trepidation.

iamkonstantin 5 hours ago | parent | next [-]

We use them in our shop. It's quite straightforward if you're already familiar with Github Actions. The Forgejo runner is tiny and you can build it even on unsupported platforms (https://code.forgejo.org/forgejo/runner) e.g. we've setup our CI to also run on Macs (by https://www.oakhost.net) for App Store related builds. It's really quite a joy :)

xrd 2 hours ago | parent [-]

Are you building MacOS apps? More specifically, are you doing code signing and notarization and stamping within CI? If so, is this written up somewhere? I really struggled with getting that working on GitLab. I did have it working, but was always searching for alternatives.

xrd 5 hours ago | parent | prev [-]

I setup actions yesterday. There are a few tiny rough edges, but it is definitely working for me. I'm using it to build my hugo blog which "sprinklylls" in a Svelte app, so it needs to have nodejs + hugo and a custom orchestrator written in Zig.

What I did:

  * used a custom docker image on my own registry domain with hugo/nodejs and my custom zig app
    * no problems
  * store artifacts 
    * required using a different artifact "uses" v3 instead of v4 (uses: actions/upload-artifact@v3)
    * An example of how there are some subtle differences between GitHub Actions, but IMHO, this is a step forward because GitLab CI YAML is totally different
    * can't browse the artifacts like I can on gitlab, only allows download of the zip. Not a big deal, but nice to verify without littering my Downloads folder.
  * Unable to use "forgejo-runner exec" which I use extensively to test whether a workflow is correct before pushing
    * Strange error: "Error: Open(/home/runner/.cache/actcache/bolt.db): timeout"
    * I think GitLab broke this feature recently as well!
  * Getting the runner to work with podman and as a service was a little tricky (but now works)
    * Mostly because of the way the docker socket is not created by default on podman
    * And the docker_host path is different inside the runner config file.
    * There are two config files, one (JSON) is always stored in .runner and contains the auth information and IP, and the other is YAML and runner needs the -c switch to specify it, and has the config of the runner (docker options, etc). It's a bit strange there are two files IMHO.
mfenniak 5 hours ago | parent [-]

> * Strange error: "Error: Open(/home/runner/.cache/actcache/bolt.db): timeout"

This will occur if you have a `forgejo-runner daemon` running while you try to use `exec` -- both are trying to open the cache database, and only the first to open it can operate. You could avoid this by changing the cache directory of the daemon by changing `cache.dir` in the config file, or run the two processes as different users.

> It's a bit strange there are two files IMHO.

The `.runner` file isn't a config file, it's a state file -- not intended for user editing. But yes, it's a bit odd.