I want to limit the number of users from a particular domain that can register into my Gitlab instance. I noticed that I could set a “user cap”, but it wasn’t specific to a domain.
I want to limit the number of users registered from these domains. 20 users from testdomain1.com and 30 users fromtestdomain2.com are allowed to sign up. So, if there are already 20 users registered sucessfully from testdomain1.com, new user from testdomain1.com will not be allowed to sign up.
Since the related issue does not get any response yet. I asked a question in stackoverflow and I edited the question today.
I’m tring to implement it by myself and it seems like that I need to extend the UI of the Admin Settings page and add some related tables to database to set different “user cap” for different email domain.
I do see your use-case, but I do think you’ll have to implement it yourself. Perhaps contribute it back, so others can benefit from it. The core of GitLab is open source.
I haven’t looked at that part of the code, but from a short look at the code you shared on stack overflow, I would guess you need to add a new table to the underlying database to store the cap for each domain and add some default (no cap) for domains that can’t be found in that table.