this post was submitted on 08 Sep 2025
64 points (97.1% liked)

Selfhosted

60542 readers
696 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

Ugh, apparently yesterday a bot visited my Forgejo instance and queried everything, which caused Forgejo to create repo archives for everything. Git on the instance is 2.1 GB in size, but the repo archive filled up everything and is 120 GB. I really didn't expect such a spike.

That meant that it filled up the whole hard drive and the server and all the services and websites on it went down while I was sleeping.

Luckily it seems that just deleting that directory fixes the problem temporarily. I also disabled the possibility of downloading archived from the UI but I'm not sure if this will prevent bots from generating those archives again. I also can't just make the directory read only because it uses it for other things like mirroring, etc too.

For small instances like mine those archives are quite a headache.

you are viewing a single comment's thread
view the rest of the comments
[–] Black616Angel@discuss.tchncs.de 7 points 10 months ago (1 children)

I've searched the docs a bit and found this setting: https://forgejo.org/docs/latest/admin/config-cheat-sheet/#quota-subjects-list

It seems to be partially for your case, though I don't see artifacts, but you could limit all of forgejo to like 5GB and probably be good.

[–] jeena@piefed.jeena.net 1 points 10 months ago (1 children)

Hm, I'm afraid none of them really seems to cover the repo-archives case, therefor I'm afraid the size:all doesn't include the repo-archives either.

But I'm running it in a container, perhaps I can limit the size the container gets assigned.

[–] Black616Angel@discuss.tchncs.de 2 points 10 months ago (1 children)

It kinda seems like it. Docker apparently does have this functionality as seen here: https://stackoverflow.com/questions/40494536/how-to-specify-the-size-of-a-shared-docker-volume/40499023#40499023

You could try limiting it to 5 GB using the forgejo settings and 7GB using docker and then just look, how big it is.

[–] jeena@piefed.jeena.net 1 points 10 months ago

Hm, but this only works on tmpfs which is in memory. It seems that with XFS I could have done it too: https://fabianlee.org/2020/01/13/linux-using-xfs-project-quotas-to-limit-capacity-within-a-subdirectory/ but I used ext4 out of habit.