# How to set data limits for users? Limit types of data?

**URL:** <https://forum.gitea.com/t/how-to-set-data-limits-for-users-limit-types-of-data/2358>\
**Category:** Gitea Usages\
**Created:** [July 29, 2020, 2:34am UTC](https://forum.gitea.com/t/how-to-set-data-limits-for-users-limit-types-of-data/2358 "2020-07-29T02:34:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eb2127](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@eb2127](https://forum.gitea.com/u/eb2127)\
**Post date:** [July 29, 2020, 2:34am UTC](https://forum.gitea.com/t/how-to-set-data-limits-for-users-limit-types-of-data/2358/1 "2020-07-29T02:34:59Z")

</div>

I’m setting up a public gitea server for a specific projects, which has git lfs enabled (as the project does require large files).

I’m still a bit concerned that certain users could start to use this platform to simply save their (irrelevant) data

- Is there a way to limit the amount of data stored per user, and if violated, send the administrators an email?
- How can I filter by the type of data?

There are prereceive hooks: [linux - How to limit file size on commit? - Stack Overflow](https://stackoverflow.com/questions/39576257/how-to-limit-file-size-on-commit)

But it’s not clear (1) how this would apply to all users and all repos on the server and (2) this only uses file extensions

---

<div class="post-metadata">

**Author:** ![eb2127](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@eb2127](https://forum.gitea.com/u/eb2127)\
**Post date:** [July 29, 2020, 5:38pm UTC](https://forum.gitea.com/t/how-to-set-data-limits-for-users-limit-types-of-data/2358/2 "2020-07-29T17:38:33Z")

</div>

It looks like GitLab has server-side hooks which allows restrictions on commits

> **[Git pre-receive hook](https://forum.gitlab.com/t/git-pre-receive-hook/11132)**
>
> How to configure the global pre-receive hook on server side? I want to block a specific type of file pushing. I think this hook code will work fine (https://github.com/github/platform-samples/blob/master/pre-receive-hooks/block\_file\_extensions.sh)...

Does this exist for gitea?

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [August 6, 2020, 5:54pm UTC](https://forum.gitea.com/t/how-to-set-data-limits-for-users-limit-types-of-data/2358/3 "2020-08-06T17:54:47Z")

</div>

Yes, Gitea admins can add git hooks to specific repos (or globally), however be aware if you want to give specific people access to editing githooks as it allows them to run code on the server (as that is what git hooks are). Look in the settings tab for repos for git hooks for a place to add the repo specific hooks.

---

<div class="post-metadata">

**Author:** ![eb2127](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@eb2127](https://forum.gitea.com/u/eb2127)\
**Post date:** [August 14, 2020, 11:25pm UTC](https://forum.gitea.com/t/how-to-set-data-limits-for-users-limit-types-of-data/2358/4 "2020-08-14T23:25:02Z")

</div>

Thanks @techknowlogick

How does one apply git hooks globally for all users? I’m not interested in repo-specific hooks
