[Support] GitLab-CE


Recommended Posts

Thanks saarg, I did figure out what to do and updated my post above before I noticed you replied. It was the manual approach, but did fix the images and my SSH url all at once. Will your solution work for both?

 

 

Update:

I tried adding that variable and changing it to match my url and port I used in the external_url setting, restarted server, but it did not have any effect.

 

 

I defined the the setting as so:

external_url 'http://MYURL.com:9080/'; gitlab_rails['lfs_enabled'] = true;

 

 

Images and SSH still show unraid.

Link to comment

Thanks saarg, I did figure out what to do and updated my post above before I noticed you replied. It was the manual approach, but did fix the images and my SSH url all at once. Will your solution work for both?

 

 

Update:

I tried adding that variable and changing it to match my url and port I used in the external_url setting, restarted server, but it did not have any effect.

 

 

I defined the the setting as so:

external_url 'http://MYURL.com:9080/'; gitlab_rails['lfs_enabled'] = true;

 

 

Images and SSH still show unraid.

 

I went looking for what I did, and the last part (after the ;) doesn't have to do anything with the your problem. That is another setting, but don't remember what it's for... Even if I read the documentation.

 

I changed also the ssh port, so I edited this field:  gitlab_rails['gitlab_shell_ssh_port'] = port

 

If you found a solution that worked, don't use mine ;)

 

I just checked, and it works here to change the IP to something else. But you have to wait at least 30 seconds before the container starts fully.

 

 

Link to comment

I waited a few minutes and still nothing. I'll go back to the manual method instead. Hopefully this can be added to the docker officially one day as w/o it, this docker is only good for intranet git repos.

 

How can you say that this container is only good for intranet git repos?

The options are in the config file so you can change it to behave how you would like. Nothing wrong with the container.

 

Edit: you probably didn't get it to work as in the default template the variable is in the extra parameters field. So turn on advanced view, remove the variable I asked you to add, and then edit the external_url in the extra parameters field.

Link to comment
  • 2 months later...

I am attempting to use this docker and I cannot connect with ssh. the connection is refused. I see that the host port being mapped is 9022, but was wondering why the port is being mapped to the application port of 9022 instead of 22? I connect to the GitLab-CE docker with the command:

sudo docker -it GitLab-CE /bin/bash

and list the ssh port within the docker with the command:

grep Port /etc/ssh/sshd_config

 this is returning Port 22

 

I don't see anyway to modify the app ports. Has anyone else got ssh connections to work with this docker?

Link to comment
11 hours ago, kngoswg said:

I am attempting to use this docker and I cannot connect with ssh. the connection is refused. I see that the host port being mapped is 9022, but was wondering why the port is being mapped to the application port of 9022 instead of 22? I connect to the GitLab-CE docker with the command:


sudo docker -it GitLab-CE /bin/bash

and list the ssh port within the docker with the command:


grep Port /etc/ssh/sshd_config

 this is returning Port 22

 

I don't see anyway to modify the app ports. Has anyone else got ssh connections to work with this docker?

 

Make sure you use bridge as network mode. Then enable advanced view and edit the ssh port. The container port should be set to 22 and host port 9022. 

The reason is that some apps use the same port so you need a method to get around it. How would you connect to unraid by ssh and this docker when they use the same port? 

Have a look in the docker faq to get a better understanding of how it works. 

Link to comment
2 hours ago, saarg said:

 

Make sure you use bridge as network mode. Then enable advanced view and edit the ssh port. The container port should be set to 22 and host port 9022. 

The reason is that some apps use the same port so you need a method to get around it. How would you connect to unraid by ssh and this docker when they use the same port? 

Have a look in the docker faq to get a better understanding of how it works. 

I checked this out yesterday.  The template is actually set for container port of 9022.  And take make matters worse, because of how the template is created, you cannot simply change the container port.  You actually have to delete the port mapping and create another one.

  • Upvote 1
Link to comment
9 hours ago, Squid said:

I checked this out yesterday.  The template is actually set for container port of 9022.  And take make matters worse, because of how the template is created, you cannot simply change the container port.  You actually have to delete the port mapping and create another one.

 

Thanks! That worked!

Link to comment
14 hours ago, Squid said:

I checked this out yesterday.  The template is actually set for container port of 9022.  And take make matters worse, because of how the template is created, you cannot simply change the container port.  You actually have to delete the port mapping and create another one.

 

That's true... I didn't check the  whole popup as I was on my phone. Yes saw the TCP option and went running here screaming it works... 

The template isn't very well made.

 

Link to comment
  • 1 month later...
On 12/28/2016 at 9:04 AM, djvj said:

UPDATE:

I fixed this by editing the external_url in the gitlab.rb file by SSH into the docker and editing that file manually:

https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab

Is there any way to control this as a docker setting instead?

Wondering the same.  I have the same behavior where Gitlab thinks everything is on Unraid:9080.  My host isn't Unraid and the port isn't 9080, so that presents a bit of a problem.  I can't seem to SSH into the docker to tinker manually, either.  I just get a "Connection Refused" on the remapped port (7022).

 

A way to change this from the template would be really nice, considering there's a few functions broken without it.  Any ideas on how to fix it when SSH access doesn't seem to work?

 

Update:

I've managed to change the setting without SSH, but I don't think it's possible for it to work if you've had to remap ports from the default.  I did:

sudo docker exec -it GitLab-CE /bin/bash
nano /etc/gitlab/gitlab.rb
* Modify gitlab.rb to add: "external_url 'http://example.com:7080/'" *
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

After doing so, the Gitlab UI is unresponsive.  If I use 9080, the local port inside the container, the setting works and the URLs are updated to example.com:9080, but it doesn't work on my client because 7080 is the actual use-facing port after Docker remaps it.

 

From what I can tell, it's not possible to utilize attachments or images with the Gitlab instance in this docker unless you keep the default port.  Unfortunately I can't because of a conflict. :(

 

Update 2:

I found a workaround.  First, set the default destination for 9080 to some dummy port.  We won't be using it.  Set external_url in gitlab.rb to be the actual host:port you want to use (like 7080).  Then add a custom port in the docker configuration where you map 7080 in the docker to 7080 on the host.  As long as the docker & host ports are the same, it will all work.

 

It's pretty hacky, but it does seem to work just fine.

Edited by Gizmotoy
Link to comment
On 7/14/2016 at 3:08 AM, thomast_88 said:

...this docker contains all necessary dependencies already (Redis, PostgreSQL, Nginx etc.)...

Newbie question. If I already have Nginx and a database running in separate docker containers, does that change this install?

For example, would I need PostgreSQL running in this container if I already have MariaDB running in it's own container?

Link to comment
13 hours ago, Encino Stan said:

Newbie question. If I already have Nginx and a database running in separate docker containers, does that change this install?

For example, would I need PostgreSQL running in this container if I already have MariaDB running in it's own container?

 

@Encino Stan If you already have nginx and a database running, you could use them. But you would have to configure the container to do so. My advice is to use the built in nginx and database. Furthermore, I don't even know what types of databases gitlab supports.

Link to comment
  • 2 months later...

I don't know that I need it....but what's the root password? I tried root with password 5iveL!fe and it doesn't seem work. Otherwise, I was able to setup and account and it's been working great.

 

I'm an idiot...it's the first thing I setup after hitting the web gui :S I realized this after doing a clean install. Unfortunately after testing out for a week or two, I got a 502 error out of know where...never could get it to recover. Wasn't worth the effort, so I just re-installed. 

Edited by Spatial Disorder
Link to comment
  • 3 months later...

Thanks to thomast_88 for setting up this docker :)

 

I've set it up and muddled through learning git at the same time and just wanted to post a config I've came up with to let you use the "Linuxserver.io - letsencrypt" docker to reverse proxy the this (gitlab-ce) docker without having to use SSH etc to edit the gitlab.rb config file or any other suggestion I've seen here that involves a workaround of sorts like Gizmotoy's port workaround (although it did work).

 

##### How to use reverse proxy gitlab-ce with the letsencrypt docker

 

Summary:

I use the letsencrypt docker to reverse proxy my home stuff with each service being on it's own host.domain.com:443. I couldn't/didn't want to:

  • NAT 80/443 or custom ports to this docker's built in nginx server so I could use it externally
  • Not mess around with custom editing the standard docker config files
  • I wanted all my URL's in gitlab-ce to show the proper https://host.domain.com/blah.git URL that I could just copy and paste them


* These steps assume you have a NAT for letsencrypt:nginx set up correctly to reverse proxy on HTTPS/443. Don't ask for help here regarding getting that set up, please ask in the thread for that docker here

 

Steps

1. Stop the docker

 

2. Reset your gitlab.rb file to docker/factory defaults

 

3. Add/Update your letsencrypt ngix config file area for gitlab-ce to use the following config and restart it.

            proxy_pass http://your.unraid.ip.here:9080;

            proxy_set_header X-Forwarded-Proto https;
            proxy_set_header X-Forwarded-Ssl on;

 

4. Edit the gitlab-ce docker, open advanced settings

 

5. Edit the 'Extra Parameters:' section and paste in the following; 

 

--env GITLAB_OMNIBUS_CONFIG="external_url 'https://host.domain.com/'; nginx['listen_port'] = 9080; nginx['listen_https'] = false"

 

This is the standard config line included in the docker where your supposed to change the DNS name only. The line above changes http:// to https:// and passes config to the dockers built in nginx server to listen for https:// but not enable it's own SSL port and config.

 

Reference:

Supporting Proxied SSL

https://docs.gitlab.com/omnibus/settings/nginx.html#supporting-proxied-ssl

 

The reference link mention's about including a few more config items I already have them in the default letsencrypt nginx config so I didn't need to add them

Edited by opticon
  • Like 4
  • Thanks 1
Link to comment

This message seems to be constatnly repeating in the logs:


==> /var/log/gitlab/node-exporter/current <==
2017-12-02_11:13:22.15422 time="2017-12-02T11:13:22Z" level=error msg="ERROR: mdadm collector failed after 0.000246s: error parsing mdstatus: error parsing mdline: sbName=/boot/config/super.dat" source="node_exporter.go:95"

Link to comment
  • 4 weeks later...

My GitLab-CE container seems to have "lost" my repository. I'm really not sure what happened or when because I have been on hiatus from using it for a while. I had imported a new project into the repository several months ago, worked on it for a while, went away, did a couple of upgrades to the container, finally took up writing code for the project this past week, and found I couldn't push my changes. 

 

Attempts to log in via the web interface didn't work so I just assumed I had forgotten my password. But connecting directly to the docker instance and looking in the database showed I wasn't there at all. I changed the root password so I could log into the web interface, but there are no users, no projects, no nothing.

 

Since this was a new, and not heavily developed project and there is one and only one committer (me), this is not a great loss. I can just effectively start from scratch. But I'd really like to try to figure out where I might have gone wrong so I can avoid it.

 

Were there things I was supposed to do before upgrading the container?

 

 

Link to comment
On 12/30/2017 at 4:49 AM, rbroberts said:

Were there things I was supposed to do before upgrading the container?

 

 

 

No idea on this one specifically. I run the CA nightly backup plugin and keep 30 days worth for the reason of auto or manual updates breaking the docker and loosing files

Link to comment
On 29.12.2017 at 9:49 PM, rbroberts said:

My GitLab-CE container seems to have "lost" my repository. I'm really not sure what happened or when because I have been on hiatus from using it for a while. I had imported a new project into the repository several months ago, worked on it for a while, went away, did a couple of upgrades to the container, finally took up writing code for the project this past week, and found I couldn't push my changes. 

 

Attempts to log in via the web interface didn't work so I just assumed I had forgotten my password. But connecting directly to the docker instance and looking in the database showed I wasn't there at all. I changed the root password so I could log into the web interface, but there are no users, no projects, no nothing.

 

Since this was a new, and not heavily developed project and there is one and only one committer (me), this is not a great loss. I can just effectively start from scratch. But I'd really like to try to figure out where I might have gone wrong so I can avoid it.

 

Were there things I was supposed to do before upgrading the container?

 

 

 

I haven't lost anything from updating the container, so it's not the update itself that did it. 

Have your appdata share got moved to the array instead of the cache drive?

Link to comment

I had the same issues as @rbroberts when updating the container a few months back. Everything would be working fine, then break after updating the container. After the first time, I blew everything away, did a clean setup, worked great until another update and it happened again, so I bailed on using it. I was mostly just screwing around with it and wasn't really interested in troubleshooting it. I din't keep any logs, so this is probably useless, other than stating I've also seen this same issue.

Link to comment
  • 2 weeks later...

@saarg, I don't have a cache drive, never had. 

 

@opticon, I didn't think to look at my CA backup...alas, I realized I didn't configure dated backups and whatever might have been recoverable is gone. I've switched to daily backups with 90 days of data. Since I'm not running plex or any media server, I think I'll be fine....

 

Since the only thing I've been playing with is a laravel project, I can start from scratch. But I guess I'll have to pay more attention so I can catch it early if it happens again.

Link to comment

Hello,

    Everything worked great for me in adding this container and setting it up. I am not able to connect via SSH, which perhaps someone can point me in the right direction as to what I'm doing incorrectly.

 

1) With "unraid" being in the name and not my actual server's hostname, I just added a host name for unraid in /etc/hosts on my client, I now hit the correct IP address

2) With SSH being on a different port, I created a config file ( ~/.ssh/config) formatted like the following:

Host unraid

     port 9022

 

Now I'm going to 9022 whenever I try to SSH to the unraid hostname, so all looks good, yet I'm still getting the following:

 

$ git push -u origin master
ssh: connect to host unraid port 9022: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 

The repository has been set up, SSH keys, etc. I must be missing something simple, I'd appreciate any assistance someone could provide.

Thanks!

Link to comment

Oh joy, I had to reboot my unraid server to move some hardware. I just pulled a video card for use elsewhere and shut down the VM that had been using it, no big deal.

 

A few days ago, I bit the bullet and just started over from scratch, importing my project brand new. Before the reboot, I had the gitlab web page open on the server, so I know all was working, I could browse my project, etc.

 

Then, when everything came back up, gitlab-ce wasn't running even though it was set to autostart. So I started it. And then...I get prompted to set a new password. Very odd. I clicked on the part about having an account, but it wouldn't let me leave the page. So I went ahead and set a new password for the root account. Sure enough, I've got a 100% clean install. My project is gone. It's really, really clean.

 

gitlab seems to want to put it's data in /mnt/cache/appdata/gitlab-ce. Is that right? I don't have an actual cache drive, I don't know why it wants to put it's data in that directory. @saarg, your comment makes it seem like that's the expected place. That is where it was before the reboot, I recall thinking it was odd, but just went with it and tweaked my config to get mail working in gitlab.rb. Now, I'm not sure what the point is. If a reboot or update is going to wipe my data it's not much of a revision control package....

 

Any clue on what I'm doing wrong on this would be appreciated. There is a gitlab-ce update ready...wondering if I should install it to see if I get reset once again.

Link to comment
3 hours ago, rbroberts said:

Oh joy, I had to reboot my unraid server to move some hardware. I just pulled a video card for use elsewhere and shut down the VM that had been using it, no big deal.

 

A few days ago, I bit the bullet and just started over from scratch, importing my project brand new. Before the reboot, I had the gitlab web page open on the server, so I know all was working, I could browse my project, etc.

 

Then, when everything came back up, gitlab-ce wasn't running even though it was set to autostart. So I started it. And then...I get prompted to set a new password. Very odd. I clicked on the part about having an account, but it wouldn't let me leave the page. So I went ahead and set a new password for the root account. Sure enough, I've got a 100% clean install. My project is gone. It's really, really clean.

 

gitlab seems to want to put it's data in /mnt/cache/appdata/gitlab-ce. Is that right? I don't have an actual cache drive, I don't know why it wants to put it's data in that directory. @saarg, your comment makes it seem like that's the expected place. That is where it was before the reboot, I recall thinking it was odd, but just went with it and tweaked my config to get mail working in gitlab.rb. Now, I'm not sure what the point is. If a reboot or update is going to wipe my data it's not much of a revision control package....

 

Any clue on what I'm doing wrong on this would be appreciated. There is a gitlab-ce update ready...wondering if I should install it to see if I get reset once again.

 

It's impossible for me to say where you choose to have your appdata. That's something only you can answer.

Since you don't have a cache drive, then I assume you store the appdata on your array. You also must remember which share you have used?

So go hunting for a gitlab-ce folder somewhere. It should contain your old settings.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.