Recently 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.
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)
After some research (and panicking) I found the commands I needed to:
- Connect to the Gitlab Docker Container on my NAS and then
- Update the production settings to enable signin.
In general these 2 references I found online were extremely helpful:
- SSH access to Docker Container: http://askubuntu.com/a/654218
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; exit # Close my remote SSH connection to my home NAS. Namek> exit; Connection to 192.168.0.18 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!