Resetting Gitlab Setting via Docker Container

David G - DrupalRecently while working on local projects I locked myself out of my Gitlab access by disabling SignIn globally. Oops! I thought the checkbox was for external, non-trusted access to your Gitlab site … so I unchecked it. Logged out and BAM … I can’t login. Well great! Shucks!  I haven’t used Docker alot so I wasn’t familiar with out to get access to the Gitlab instance to fix the problem. Here are the steps I took to re-activate login to my locally hosted Gitlab instance.

The Problem

So in the Gitlab application settings for the administrative user there are options to define external site urls that can login to gitlab via 3rd party logins. I mistook the general “Sign In” Enabled checkbox to mean allow/disallow external access — when in truth it simply makes the login form active or inactive for the site from anywhere. (Oops)

Unless you need special access considerations to your site. Don't mess with this.

Unless you need special access considerations to your site. Don’t mess with this.

The Solution

After some research (and panicking) I found the commands I needed to:

  1. Connect to the Gitlab Docker Container on my NAS and then
  2. Update the production settings to enable signin.

In general these 2 references I found online were extremely helpful:

  3. SSH access to Docker Container:

After much trial and error, here is my console output of the attempt, which I will annotate:

So from my desktop I first SSH into my home NAS system as a root user. Then I used (3) above to connect to my Docker Gitlab container using a shell with:

docker exec -t -i synology_gitlab /bin/bash

Then from the gitlab container terminal I could fix the problem as below:

# Load the Rails Interactive Console for the Production
# environment of the RAILS Gitlab instance.
root@synology_gitlab:/home/git/gitlab/bin# ./rails console production
Loading production environment (Rails 4.1.12)
# Update the global application settings to allow Login.
irb(main):001:0> ApplicationSetting.last.update_attributes(signin_enabled: true)
=> true
# Try a few times to exit IRB!
irb(main):002:0> ^C
irb(main):002:0> ^C
irb(main):002:0> exit 
# Close my SH connection to the Docker Container.
root@synology_gitlab:/home/git/gitlab/bin# exit;
# Close my remote SSH connection to my home NAS.
Namek> exit;
Connection to closed.
# Return to my local computers last working directory.
dgurba at aw-dgurba in .../src/idprocessing on master△

After completing the above steps instantly the problem is resolved and I see the login form again:



I hope you’ve found this help as hopping through servers and connecting to Containers is not something I typically do. My workplace workflow is somewhat different and uses less directly accessible virtual machines then at my home.

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Posted under Uncategorized | RSS 2.0

Author Spotlight

David Gurba

I am a web programmer currently employed at UCSB. I have been developing web applications professionally for 8+ years now. For the last 5 years I’ve been actively developing websites primarily in PHP using Drupal. I have experience using LAMP and developing data driven websites for clients in aviation, higher education and e-commerce. If you’d like to contact me I can be reached at

Leave a Reply

Your email address will not be published. Required fields are marked *