To limit the size of an project the enterprise edition (EE) from GitLab is required.
To bring this useful feature to the community edition (CE) I developed a python script which can be used as a pre-receive hook to block commits if the repository exceeds a given size.
Two limits must be specified. If a repository exceeds the first limit a warning is send to the user. After exceeding the second limit no commits to the repository are possible.
The full project can be found at
https://git.rz.uni-augsburg.de/rothmich/gitlab-repository-size-limit