For the past month or so, I have been working on a soft quota implementation for #Forgejo. I submitted the initial draft pull request two weeks ago, today I marked it ready for review.

This has been a massive undertaking, which shows in the diffstats too: 3811 lines of tests, and 2929 lines of code is quite a lot! But I'm very happy about how it turned out. Even more so, because this is the first (partial) copyleft contribution to Forgejo: while the core feature is under the MIT license, the tests are under EUPL-1.2.

The aim was to create something that would support both large instances like Codeberg with complex requirements, and small instances that just want to say "You have 1Gb of space to use, use it well". I think I nailed it.

Of course, there are lots of things that can and will be improved, but the pull request above lays down a solid foundation, and is already usable in its current form.

Because various forms of quotas have been requested by #Gitea users over the years, this might be of interest to them too. Mind you, I have no plans to submit the pull request to Gitea myself.

Soft-quota foundations

The goal of the engine is to be flexible and future proof: to be nimble enough to build on it further, without having to rewrite large parts of it. It might feel a little more complicated than necessary, because the goal was to be able to support scenarios only very few Forgejo instances need, s...

Codeberg.org
@algernon This is wonderful to hear! Will it apply to all forms of storage (repositories, packages, anything else)?

@kevin Anything Forgejo tracks the size of. At the moment, that's repositories, packages, attachments (issue & comment attachments and release attachments alike), action artifacts, and git LFS objects.

It's not limited to size-based quotas either, although only those kind are implemented at the moment. But it is perfectly possible to implement stuff like "3 private repositories only" at a later point, without major changes to the system itself.