gitea
gitea copied to clipboard
Proposal: fork count limit
- Gitea version (or commit ref): ced08d1
- Git version: 2.15.1
- Operating system: Linux
- Database (use
[x]):- [ ] PostgreSQL
- [x] MySQL
- [ ] MSSQL
- [ ] SQLite
- Can you reproduce the bug at https://try.gitea.io:
- [ ] Yes (provide example URL)
- [ ] No
- [x] Not relevant (server is down)
- Log gist:
Description
How to reproduce:
- Create new user.
- Set repository limit to 0 for this user.
- Try to create new repo (limit reached, repo won't be created).
- Try to fork existing repo - repo will be forked successfully, resulting user having more repos than he is limited to.
We have two choices, one is add another option fork repository limit, another is to limit fork when the value is 0.
Forking not counting in limit is intended behaviour so that users could still submit PRs even if they can not create own repositories
Then probably forks should count separately from num_repos and max_repo_creation. With unlimited fork feature, repo limit has no sense because user can fork any repo, clean fork's content and use it as he wants.
@SagePtr maybe you can change the title.
Perhaps a third option, a boolean to toggle whether it counts towards limit or not?
This way, admins can decide whether it makes sense for their situation.
While a public instance may worry about forking as a means of bypassing limit, self-hosted private admins may want forks for PRs.
EDIT: I suppose even with a number, a -1 would be the same as just swapping a toggle. Probably the better choice.
Or a repository could have an option to enable or disable fork. Fork limitation is non-meaningful.
Or a repository could have an option to enable or disable fork. Fork limitation is non-meaningful.
this is a much better idea. forking is is designed to be related to its original repository and we must stick to that perspective and not on the point someone cannot create a fork.
This is a major issue for me. I need users to be able to post issues but I don't have the space to afford repo creation nor repo creation by forking. Otherwise I need to shut user registrations down completely.
From this perspective i was surprised that MAX_CREATION_LIMIT didn't target this. Will be happy with a similar MAX_FORKING_LIMIT setting.
New Migration has the same problem.
Bumping. This issue still exists and doesn't seem to have been addressed anywhere.
I've hit this as well. A workaround seems to be to change the permissions in the Gitea root repository folder to deny the Gitea user write access, so Gitea cannot create folders for any new users' repos/forks.
This could be combined (e.g. as suggested in #8831) with custom CSS to hide the “fork” button on the client side.
I note that setting the repo creation limit to 0 is currently recommended in the FAQ to have an “issue only user”. But if forks cannot be limited then this does not create true “issue only” access.
+1, we've seen users use this to bypass the MAX_CREATION_LIMIT. they just fork anything, then clear it out and start adding the material they want to push to our server (hint, it's usually not what we want to be hosting). We would really appreciate a proper way to limit this behaviour as we still would like to allow user sign up for reporting issues on our software, but we may have to look into now allowing that since this is becoming a reoccurring problem
Hope this issue gets addressed, it's a vert essential feature that's needed. I just want users in my git to only use it to submit issues and having the fork means new user just make a fork and clear the stuff leading to a big abuse
Hello, this happened to our gitea instance as well, Users now are forking whatever repository they have access, then cleanup and use it as a new repo despite MAX_CREATION_LIMIT=0 .
Any updates on this? This is a 6 year old report...
JFYI:
chmod u-w,g-w,o-w gitea-repositories
solved the issue))