Cannot disable sign-in and sign-up

I just installed gitlab_7.8.1-omnibus-1_amd64.deb on a Ubuntu 14 (I’m a newbie). After changing the following entries on /etc/gitlab/gitlab.rd to:

gitlab_rails['gitlab_signup_enabled'] = false
gitlab_rails['gitlab_signin_enabled'] = false

I ran the commands:

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

The file /var/opt/gitlab/gitlab-rails/etc/gitlab.yml reflects the changes I made but I got no result. Sign-in and sign-up forms are still available on homepage and anyone can sign-up and login using them.

Did I miss something? Or, did I do something wrong?

PS: I successfully configured LDAP authentication and this is the only way I want users to sign-in.

No longer needed to configure signin in gitlab.rb. Check your admin/application_settings area :wink:

1 Like

Perfect! Thank you very much!

Hi,

What if, like me, both options (sign up and sign in) has been disabled by the root account, because only ldap authentification is needed but there is no ldap account that have engouht rights to set these setting back to default ?

Because once i have disabled normal sign up, i have no way to log myself back with the root account.

Thanks

Is there a way to toggle sign up via the api?

Yes there is. There’s an API endpoint (sorry, I’m running an old instance, it’s probably v4 by now, consult docs for actual endpoint):

http://your-gitlab-instance.com/api/v3/application/settings?signin_enabled

I did the same thing, accidentally disabled signin through the web interface with LDAP enabled and no other admins (d’oh!)

The trick is that you need to dig up the original root user’s API token, which you can do through the dbconsole on the commandline, assuming you have root access to the server (postgres query example):

# gitlab-rails dbconsole
psql (9.2.17)
Type "help" for help.

gitlabhq_production=> select authentication_token from users where id=1;
authentication_token
----------------------
[THIS_STRING_HERE_IS_YOUR_TOKEN]
(1 row)

Then reset that setting on the commandline:

# curl --header "Private-Token:YOUR_TOKEN" -X PUT http://your-gitlab-instance.com/api/v3/application/settings?signin_enabled=true

1 Like

Actually it would be great if this and all the options were made available via gitlab.rb. This would make it so much easier and more reliable to automatically install GitLab using Ansible.