Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: fork count limit #4586

Open
2 of 7 tasks
SagePtr opened this issue Aug 1, 2018 · 14 comments
Open
2 of 7 tasks

Proposal: fork count limit #4586

SagePtr opened this issue Aug 1, 2018 · 14 comments

Comments

@SagePtr
Copy link
Contributor

SagePtr commented Aug 1, 2018

  • Gitea version (or commit ref): ced08d1
  • Git version: 2.15.1
  • Operating system: Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant (server is down)
  • Log gist:

Description

How to reproduce:

  1. Create new user.
  2. Set repository limit to 0 for this user.
  3. Try to create new repo (limit reached, repo won't be created).
  4. Try to fork existing repo - repo will be forked successfully, resulting user having more repos than he is limited to.
@lunny
Copy link
Member

lunny commented Aug 1, 2018

We have two choices, one is add another option fork repository limit, another is to limit fork when the value is 0.

@lafriks
Copy link
Member

lafriks commented Aug 1, 2018

Forking not counting in limit is intended behaviour so that users could still submit PRs even if they can not create own repositories

@SagePtr
Copy link
Contributor Author

SagePtr commented Aug 1, 2018

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.

@lunny
Copy link
Member

lunny commented Aug 2, 2018

@SagePtr maybe you can change the title.

@SagePtr SagePtr changed the title Repository limit is not enforced when forking repo Proposal: fork count limit Aug 2, 2018
@jolheiser
Copy link
Member

jolheiser commented Jul 17, 2019

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.

@lunny
Copy link
Member

lunny commented Jul 18, 2019

Or a repository could have an option to enable or disable fork. Fork limitation is non-meaningful.

@1902sysad
Copy link

1902sysad commented Jul 18, 2019

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.

@yusf
Copy link

yusf commented May 21, 2020

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.

@oicu
Copy link

oicu commented May 24, 2020

New Migration has the same problem.

@InfernalPlank
Copy link

Bumping. This issue still exists and doesn't seem to have been addressed anywhere.

@RunasSudo
Copy link

RunasSudo commented Aug 23, 2022

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.

@dballard
Copy link

+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

@red0888
Copy link

red0888 commented Nov 20, 2022

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

@gd197
Copy link

gd197 commented Dec 15, 2022

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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests