Jump to content
thomast_88

[Support] GitLab-CE

145 posts in this topic Last Reply

Recommended Posts

8 hours ago, rbroberts said:

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,

If you forced it to write to a drive that's not actually there, it probably created the folders in RAM, and they are gone after a reboot.

Share this post


Link to post

I must not have been clear. I know where it is. I know where it was. It was in /mnt/cache/appdata/gitlab-ce. But that appears to have been wiped and recreated after the reboot. 

 

My question is, is this the normal place for gitlab-ce to put it's data, rather than /mnt/user/appdata where everything else seems to put their data.

Share this post


Link to post
20 minutes ago, rbroberts said:

I must not have been clear. I know where it is. I know where it was. It was in /mnt/cache/appdata/gitlab-ce. But that appears to have been wiped and recreated after the reboot. 

 

My question is, is this the normal place for gitlab-ce to put it's data, rather than /mnt/user/appdata where everything else seems to put their data.

 

As @jonathanm already said, its gone when you rebooted as /mnt/cache is in RAM.

The problem is that you do not have a cache drive and have not changed the default appdata path in docker settings. This leads to any docker you install will be populated with /mnt/cache/appdata/appname because you didn't change it to an existing disk/folder. 

Share this post


Link to post

Ah, okay. So the default for this docker is a poor choice and I should have paid more attention to the configuration.

Share this post


Link to post
3 minutes ago, rbroberts said:

Ah, okay. So the default for this docker is a poor choice and I should have paid more attention to the configuration.

In a nutshell, yes, you should have paid more attention. However... the defaults are likely the best of a poor compromise. Some dockers, (don't know for sure if this is one) don't work correctly unless you specify a disk destination, e.g. /mnt/disk1, /mnt/disk2,/mnt/cache, etc. If you specify /mnt/user/folder, for some reason the FUSE filesystem that generates the /mnt/user tree from the individual disks gives the docker fits.

 

This has been mostly corrected, but there are some situations and configurations that just don't work with it, and for the few that don't, it's just easier to force a disk. The template maker has to make a choice, either set the default to /mnt/cache that will work for the majority, or specify /mnt/disk1 and deal with the flack of people complaining that the docker keeps their array spun up all the time.

 

It's bad either way, but /mnt/cache is the better default for most, as it's been well established in the documentation that the preferred way to set up unraid is to keep the docker appdata OFF the parity protected array so the array drives can spin down when needed.

Share this post


Link to post

Fix Common Problems plugin keeps throwing this error for this 

 

 

Docker Application GitLab-CE, Container Port 22 not found or changed on installed application

 

 

Docker Application GitLab-CE, Container Port 80 not found or changed on installed application

 

 

Docker Application GitLab-CE, Container Port 443 not found or changed on installed application

 

Share this post


Link to post
On 11/30/2017 at 7:00 AM, opticon said:

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

@opticonThank you very much for sharing this. I've been struggling with the 'external_url' parameter for a while. 

 

I did get this working but I intermittently get sent back to my internal IP:port address. Any ideas on how to solve this?

Share this post


Link to post

Hi everyone,

 

I am currently trying out gitlab for the first time and am having issues with the ssh connection. It continues to ask for a password and I cant seem to find out what is causing this issue. Does anyone have any ideas what could be causing this and or also having this issue?

 

Mark

Share this post


Link to post

Hi Everyone,

 

Just a bit of an update that seems weird to me is that the ports aren't being forwarded. Am I seeing things or could this be my problem? 

problem.png

Share this post


Link to post

Hi, I've booted up my container that I have not used since before Christmas and it won't start, previously it was running fine. It looks like its failing when chef is building the environment, I found this in the '/appdata/gitlab-ce/log/reconfigure' log file:

 

Quote

[2018-02-08T14:46:42+00:00] WARN: Skipped selecting an init system because it looks like we are running in a container
[2018-02-08T14:46:43+00:00] INFO: directory[Create /var/opt/gitlab] owner changed to 0
[2018-02-08T14:46:43+00:00] INFO: directory[Create /var/opt/gitlab] group changed to 0
[2018-02-08T14:46:43+00:00] INFO: directory[Create /var/opt/gitlab] mode changed to 755
[2018-02-08T14:46:43+00:00] INFO: template[/var/opt/gitlab/.gitconfig] owner changed to 998
[2018-02-08T14:46:43+00:00] INFO: template[/var/opt/gitlab/.gitconfig] group changed to 998
[2018-02-08T14:46:43+00:00] INFO: template[/var/opt/gitlab/.gitconfig] mode changed to 644
[2018-02-08T14:46:43+00:00] INFO: ruby_block[directory resource: /var/opt/gitlab/git-data] called
[2018-02-08T14:46:43+00:00] INFO: Running queued delayed notifications before re-raising exception
[2018-02-08T14:46:43+00:00] INFO: Running queued delayed notifications before re-raising exception
[2018-02-08T14:46:43+00:00] ERROR: Running exception handlers
[2018-02-08T14:46:43+00:00] ERROR: Exception handlers complete
[2018-02-08T14:46:43+00:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
[2018-02-08T14:46:43+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-02-08T14:46:43+00:00] ERROR: storage_directory[/var/opt/gitlab/git-data/repositories] (gitlab::gitlab-shell line 44) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[directory resource: /var/opt/gitlab/git-data/repositories] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 33) had an error: Mixlib::ShellOut::ShellCommandFailed: Failed asserting that mode permissions on "/var/opt/gitlab/git-data/repositories" is 2770
---- Begin output of set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] ----
STDOUT: 
STDERR: + grep -o ....$
+ readlink -f /var/opt/gitlab/git-data/repositories
+ stat --printf=%04a /var/opt/gitlab/git-data/repositories
+ [ 0770 = 2770 ]
---- End output of set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] ----
Ran set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] returned 1
[2018-02-08T14:46:43+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

 

Note: None of the other log directories have 2018 date logs.

 

Anyone got any idea what the problem might be? I don't know if this is related to the 6.4.x upgrade that I did last week. Previously I was on 6.3.5.

Share this post


Link to post
On 2/9/2018 at 12:12 AM, Tango said:

Hi, I've booted up my container that I have not used since before Christmas and it won't start, previously it was running fine. It looks like its failing when chef is building the environment, I found this in the '/appdata/gitlab-ce/log/reconfigure' log file:

 

 

Note: None of the other log directories have 2018 date logs.

 

Anyone got any idea what the problem might be? I don't know if this is related to the 6.4.x upgrade that I did last week. Previously I was on 6.3.5.

 

I had a similar issue. Here's how I fixed it:

 

1. SSH to Unraid

2. Start the docker and run 'docker ps' to get the container ID before it crashes again

3. Keep the SSH window open and get ready to do this as quick as possible 

    a) Start the docker again either from cli or WebGUI

    b) Replace the 'DockerID' text below with the container ID you got from step 1 and run the following lines in the SSH windo

 

     docker exec -it DockerID chmod -R 0770 /var/opt/gitlab/git-data
     docker exec -it DockerID chmod -R 2770 /var/opt/gitlab/git-data/repositories

 

     c) If the docker crashes again, try restarting it again and everything was fine for me after that

Share this post


Link to post

Thanks @opticon that indeed work at getting me pass that error, unfortunately it was then failing on another problem:

 

Quote

---- Begin output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----
STDOUT: error: could not open /var/opt/gitlab/.ssh/authorized_keys: Operation not permitted @ rb_file_chmod - /var/opt/gitlab/.ssh/authorized_keys
-rwxrwsrwx 1 99 users 1736 Jul 15  2017 /var/opt/gitlab/.ssh/authorized_keys
STDERR: 
---- End output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----

 

I managed to fix this myself by changing ownership (recursively) of the authorized_keys directory to user/group 998.

 

chown -R 998:998 .ssh

 

For anyone else who has this problem I think it was down to me running the "New Permissions" tool on the appdata share which I know is not recommended, but I was fixing another access permission problem at the time back just before christmas. The container is now starting fine, just hope I wont get any further issues.

 

Lessons learnt i guess.

 

[EDIT] Wow it seems I really did mess things up, gitlab started and all the project where there but it said there was no code repositories available in each project, I shortly needed a new pair of underwear. I've tried to change (recursive) ownership of the git-data directory as well but after restart gitlab still doesn't want to see whats inside the repositories directory. I guess if I can't fix this I might have to start the gitlab container from scratch, and see if I have a copy of all my repositories somewhere.

Share this post


Link to post
On 1/25/2018 at 2:49 AM, johnchomp said:

Fix Common Problems plugin keeps throwing this error for this 

 

 

Docker Application GitLab-CE, Container Port 22 not found or changed on installed application

 

 

Docker Application GitLab-CE, Container Port 80 not found or changed on installed application

 

 

Docker Application GitLab-CE, Container Port 443 not found or changed on installed application

 

same issue here. I don't remember if i changed these to other values. tried to change to 22, 80 and 443, but container does not start anymore.

tried to remove the container and reinstalled, but same values are used by default (9022, 9080, 9443). will post also in the fix common problems plugin

Share this post


Link to post

Is there any way to run GitLab-CE with 2GB or less of RAM? I only have 8GB of RAM in my unRAID box right now and if I let GitLab run unrestricted it gobbles up as much RAM as it can. I have tried restricting the docker RAM to 2GB by adding --memory="2g" to the Extra Parameters line but I get a 502 error when launching the WebUI.

 

I am only looking to use GitLab for me and a few friends occasionally (hobbyist programming) but according to the GitLab documention, 4GB is minimum for up to 100 users: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/requirements.md

 

I don't need anywhere near that capacity and we are only going to be doing small private repos so we won't leverage most of the more advanced features.

 

Is GitLab overkill for small teams? Is there a lighter weight Git hosting server in a Docker container that would work better for small teams?

 

Share this post


Link to post
On 2/20/2018 at 2:55 AM, MacGyver33 said:

Is there any way to run GitLab-CE with 2GB or less of RAM? I only have 8GB of RAM in my unRAID box right now and if I let GitLab run unrestricted it gobbles up as much RAM as it can. I have tried restricting the docker RAM to 2GB by adding --memory="2g" to the Extra Parameters line but I get a 502 error when launching the WebUI.

 

I am only looking to use GitLab for me and a few friends occasionally (hobbyist programming) but according to the GitLab documention, 4GB is minimum for up to 100 users: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/requirements.md

 

I don't need anywhere near that capacity and we are only going to be doing small private repos so we won't leverage most of the more advanced features.

 

Is GitLab overkill for small teams? Is there a lighter weight Git hosting server in a Docker container that would work better for small teams?

 

 

I've wondered the same and also had issues when using the --memory flag. It's suppose to run just fine on a RPI2/3 with 1GB of RAM (non-docker) using the Omnibus package but I guess there's additional config built into it.

 

I started to play around with it but ran out of time. Google around and check the documentation, there's options to limit worker processes etc and this is what I was starting off with:

 

postgresql['shared_buffers'] = '256MB'; unicorn['worker_processes'] = '3'; unicorn['worker_timeout'] = '60';

 

Can't remember how well it worked, other life things have gotten priority lately. Let me know how  you go :)

Share this post


Link to post

I'm not receiving emails sent by Gitlab. They appear to be sending OK

 

Started GET "/users/password/new" for 192.168.69.1 at 2018-03-04 10:04:59 +000$
Processing by PasswordsController#new as HTML
Completed 200 OK in 149ms (Views: 107.8ms | ActiveRecord: 2.1ms)
Started POST "/users/password" for 192.168.69.1 at 2018-03-04 10:05:30 +0000
Processing by PasswordsController#create as HTML
  Parameters: {"utf8"=>"�..", "authenticity_token"=>"[FILTERED]", "user"=>{"email"=>"redacted@example.net"}}
[ActiveJob] Enqueued ActionMailer::DeliveryJob (Job ID: 16360967-a9f7-4559-969a-883d9342633e) to Sidekiq(maile
rs) with arguments: "DeviseMailer", "reset_password_instructions", "deliver_now", gid://gitlab/User/2, "fT5V5L
-YHwVzBvdz5yuw", {}
Redirected to http://192.168.69.99:9080/users/sign_in
Completed 302 Found in 306ms (ActiveRecord: 36.7ms)
Started GET "/users/sign_in" for 192.168.69.1 at 2018-03-04 10:05:31 +0000
Processing by SessionsController#new as HTML
Completed 200 OK in 14ms (Views: 7.6ms | ActiveRecord: 0.3ms)
[ActiveJob] [ActionMailer::DeliveryJob] [16360967-a9f7-4559-969a-883d9342633e] Performing ActionMailer::Delive
ryJob from Sidekiq(mailers) with arguments: "DeviseMailer", "reset_password_instructions", "deliver_now", gid:
//gitlab/User/2, "fT5V5L-YHwVzBvdz5yuw", {}
[ActiveJob] [ActionMailer::DeliveryJob] [16360967-a9f7-4559-969a-883d9342633e]
Sent mail to redacted@example.net (4.2ms)
[ActiveJob] [ActionMailer::DeliveryJob] [16360967-a9f7-4559-969a-883d9342633e] Performed ActionMailer::Deliver
yJob from Sidekiq(mailers) in 97.42ms

but are not showing up in the incoming mail log in my mail server.

 

If I exec a shell on the docker image, ps auxww doesn't appear to show a running mailserver and I wasn't prompted for details of a remote SMTP server anywhere. Looking at https://elijahpaul.co.uk/using-an-smtp-server-with-gitlab/ it appears I need to edit /etc/gitlab/gitlab.rb, but this smells like something that's going to get overwritten the next time the docker gets updated.

 

How can I configure it to send emails and have the settings stick? Ideally, there would be variables in the template that I could configure to use a remote SMTP server. (Even if it's safe to edit gitlab.rb and not have it clobbered on upgrades, it would still be easier this way :)

 

For the record, these are the lines I had to change (obviously, with actual domain redacted — edit as appropriate) before running gitlab-ctl reconfigure:

gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'gitlab@example.co.uk'
gitlab_rails['gitlab_email_display_name'] = 'GitLab'
gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.co.uk'

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "mail.example.co.uk"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_domain'] = "example.co.uk"
gitlab_rails['smtp_enable_starttls_auto'] = false
gitlab_rails['smtp_tls'] = false

Also, how do I get ssh working? Running netstat from within the image shows an ssh server running on port 22 and nothing on port 9022, but the XML at https://github.com/tynor88/docker-templates/blob/master/tynor88/gitlab-ce.xml shows 9022 is being mapped to 9022, not to 22. I don't really want to have to pull and push over HTTP, especially with 2FA enabled…

Edited by ElectricBadger
Added ssh question

Share this post


Link to post
On 04/03/2018 at 6:35 PM, ElectricBadger said:

I'm not receiving emails sent by Gitlab. They appear to be sending OK

 

Are you using your ISP SMTP server? does it 100% require auth? If so you may need to set it.

 

I have 'true' in quotes for my config, which is the only difference I can see?

 

    gitlab_rails['gitlab_email_enabled'] = 'true'; 
    gitlab_rails['gitlab_email_display_name'] = 'Gitlab'; 
    gitlab_rails['gitlab_email_reply_to'] = 'noreply@domain.com'; 
    gitlab_rails['smtp_enable'] = 'true'; 
    gitlab_rails['smtp_user'] = 'user@domain.net.au'; 
    gitlab_rails['smtp_address'] = 'mail.domain.net.au'; 
    gitlab_rails['smtp_port'] = '25'; 
    gitlab_rails['smtp_domain'] = 'domain.net.au'; 
    gitlab_rails['smtp_authentication'] = 'false'; 
    gitlab_rails['smtp_enable_starttls_auto'] = 'false'; 
    

Share this post


Link to post
19 hours ago, opticon said:

 

Are you using your ISP SMTP server? does it 100% require auth? If so you may need to set it.

 

I have 'true' in quotes for my config, which is the only difference I can see?

 

    gitlab_rails['gitlab_email_enabled'] = 'true'; 
    gitlab_rails['gitlab_email_display_name'] = 'Gitlab'; 
    gitlab_rails['gitlab_email_reply_to'] = 'noreply@domain.com'; 
    gitlab_rails['smtp_enable'] = 'true'; 
    gitlab_rails['smtp_user'] = 'user@domain.net.au'; 
    gitlab_rails['smtp_address'] = 'mail.domain.net.au'; 
    gitlab_rails['smtp_port'] = '25'; 
    gitlab_rails['smtp_domain'] = 'domain.net.au'; 
    gitlab_rails['smtp_authentication'] = 'false'; 
    gitlab_rails['smtp_enable_starttls_auto'] = 'false'; 
    

 

I've managed to get it working with my local SMTP server by editing gitlab.rb, but I'm a bit concerned that those changes might get clobbered the next time the docker image is updated. I'd really like to know if it's safe to edit this file.

 

I also fixed the SSH issue by adding another port redirecting to 22 rather than 9022, and using that. Kind of odd that the default points to somewhere that nothing's listening, though :)

Edited by ElectricBadger
Add SSH fix

Share this post


Link to post
On 05/03/2018 at 11:25 PM, ElectricBadger said:

 

I've managed to get it working with my local SMTP server by editing gitlab.rb, but I'm a bit concerned that those changes might get clobbered the next time the docker image is updated. I'd really like to know if it's safe to edit this file.

 

I also fixed the SSH issue by adding another port redirecting to 22 rather than 9022, and using that. Kind of odd that the default points to somewhere that nothing's listening, though :)

 

 

From what I understand you shouldn't edit gitlab.rb at all, it WILL get destroyed on the next update. You need to put all config you want to override in the extra params section in the unraid gitlab docker config page. I have all the stuff I mentioned plus more in a single like and it works fine

Share this post


Link to post
On 29.1.2018 at 12:48 AM, Kash76 said:

@opticonThank you very much for sharing this. I've been struggling with the 'external_url' parameter for a while. 

 

I did get this working but I intermittently get sent back to my internal IP:port address. Any ideas on how to solve this?

 

I've got the same Problem. Can someone help us please :D?

  • Like 1

Share this post


Link to post

OK, so I left it overnight and it died again. Now I'm getting this:

 

[0mRecipe: gitlab::gitlab-rails[0m
* execute[clear the gitlab-rails cache] action run
[32m- execute /opt/gitlab/bin/gitlab-rake cache:clear[0m
[0m[0m
Running handlers:[0m
There was an error running gitlab-ctl reconfigure:

execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8] (gitlab::postgresql line 80) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 ----
STDOUT: The files belonging to this database system will be owned by user "gitlab-psql".
This user must also own the server process.

The database cluster will be initialized with locale "C.UTF-8".
The default text search configuration will be set to "english".

Data page checksums are disabled.
STDERR: initdb: directory "/var/opt/gitlab/postgresql/data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/opt/gitlab/postgresql/data" or run initdb
with an argument other than "/var/opt/gitlab/postgresql/data".
---- End output of /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 ----
Ran /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 returned 1

Running handlers complete
[0mChef Client failed. 25 resources updated in 15 seconds[0m

 

I'm also assuming that plenty of other people are managing to use this docker image, so there's probably something I've done wrong, but I can't see what could cause this, unless it's related to this:

 

I have the data folder set to be /mnt/disk6/appdata/gitlab-ce/data, and the log folder set similarly (config remains on cache). However, it seems to have created both /mnt/disk6/appdata/gitlab-ce and /mnt/cache/appdata/gitlab-ce. I'll try stopping the image, nuking both folders and restarting — if it can survive a couple of nights, I guess that fixes it :)

Edited by ElectricBadger

Share this post


Link to post
On 3/8/2018 at 11:11 PM, CreZo said:

 

I've got the same Problem. Can someone help us please :D?

 

Sorry I missed the other guys post, can you attach a copy of your nginx conf file, docker/gitlab log after it's started/fully running and a copy of the extra params your using? Remember to rename your domain etc to just genericdomain.com or something

Edited by opticon

Share this post


Link to post

 

Here's some instructions on how to configure GitLab-rake to create its backups and automatically purging backups older than 31 days

 

##### How to configure GitLab-CE docker to run rake backups

 

Summary

 

The following steps will create a dedicated backup folder for gitlab rake to export the backups to and automatically purge backups older than 31 days. If you wish, you can use the default folder and time to keep backups by removing the config lines so it uses the defaults from gitlab.rb

This backs up the REPOSITORY DATA ONLY and not your configuration/secret files etc. Use CA Backup/Restore or another method for backing up those files under the appdata/gitlab-ce folder

 

You should already have the CA User Scripts plugin installed to create the backup script and allow you to schedule it to run automatically.

 

References:

https://docs.gitlab.com/ee/raketasks/backup_restore.html

https://docs.gitlab.com/omnibus/settings/backups.html

 

Steps

1. Create a folder called 'backups' on the unraid host:     mkdir /mnt/user/appdata/gitlab-ce/backups

 

2. Edit the gitlab-ce docker, open advanced settings and edit the 'Extra Parameters:' section and paste in the following text. Don't forget to paste it before the last double-quote symbol. Copy and paste it all to notepad if that makes it easier and then copy it back to the webpage.

 

gitlab_rails['manage_backup_path'] = true; gitlab_rails['backup_path'] = '/backups'; gitlab_rails['backup_archive_permissions'] = 0644; gitlab_rails['backup_pg_schema'] = 'public'; gitlab_rails['backup_keep_time'] = 2678400;

 

3. Go to the User.Scripts plugin page and create a new script, call it: Backup-Gitlab. Click on the script name in the webpage and select ‘edit script’ and copy/paste the following text into it:

 

echo ”Backup is starting”

docker exec -t GitLab-CE gitlab-rake gitlab:backup:create

echo ”Backup has completed”

 

I like to give my scripts descriptions; here’s mine: Use docker exec to perform gitlab rake backups 

 

4. Run the script manually and don’t close the window until you see the text: “Backup has completed’. Go to the folder in your unraid SSH session and verify the files where created through SSH under /mnt/user/appdata/gitlab-ce/backups

 

5. Click on the ‘Scheduled Disabled’ menu option in user.scripts and set it to whatever you like. If you run CA Backup/Restore, make sure it’s not going to be running at the same time as this script, otherwise it won’t work because gitlab will be shutdown

 

6. Apply the user.script config and go to bed. Check your server the next day for the rake backups, you won’t have access to the backup’s folder via network sharing so use SSH to verify the file is there under /appdata/gitlab-ce/backups

Edited by opticon
  • Like 1

Share this post


Link to post
On 12/2/2017 at 5:14 AM, realies said:

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"

 

Just installed the docker using defaults, I see these in my logs as well.

Share this post


Link to post
On 12.3.2018 at 5:44 AM, opticon said:

 

Sorry I missed the other guys post, can you attach a copy of your nginx conf file, docker/gitlab log after it's started/fully running and a copy of the extra params your using? Remember to rename your domain etc to just genericdomain.com or something

4

 

Hey there,

 

here is my nginx conf:

 

    #GitLab
    location /gitlab {
    include /config/nginx/proxy.conf;
    proxy_pass http://192.168.1.25:9080;
  }

 

docker/ gitlab log after it's started/fully running:

 

==> /var/log/gitlab/nginx/gitlab_access.log <==
127.0.0.1 - - [19/Mar/2018:12:22:40 +0000] "GET /help HTTP/1.1" 200 28187 "" "curl/7.56.1"

==> /var/log/gitlab/gitlab-monitor/current <==
2018-03-19_12:22:44.75445 127.0.0.1 - - [19/Mar/2018:12:22:44 UTC] "GET /sidekiq HTTP/1.1" 200 11513
2018-03-19_12:22:44.75447 - -> /sidekiq
2018-03-19_12:22:46.65654 127.0.0.1 - - [19/Mar/2018:12:22:46 UTC] "GET /database HTTP/1.1" 200 54250
2018-03-19_12:22:46.65655 - -> /database

==> /var/log/gitlab/node-exporter/current <==
2018-03-19_12:22:48.13647 time="2018-03-19T12:22:48Z" level=error msg="ERROR: mdadm collector failed after 0.000131s: error parsing mdstatus: error parsing mdline: sbName=/boot/config/super.dat" source="collector.go:123"

==> /var/log/gitlab/gitlab-monitor/current <==
2018-03-19_12:22:48.93537 127.0.0.1 - - [19/Mar/2018:12:22:48 UTC] "GET /process HTTP/1.1" 200 3628
2018-03-19_12:22:48.93539 - -> /process

==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/-/metrics" for 127.0.0.1 at 2018-03-19 12:22:52 +0000
Processing by MetricsController#index as HTML
Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)

==> /var/log/gitlab/gitlab-rails/production_json.log <==
{"method":"GET","path":"/-/metrics","format":"html","controller":"MetricsController","action":"index","status":200,"duration":0.81,"view":0.13,"db":0.0,"time":"2018-03-19T12:22:52.852Z","params":[],"remote_ip":null,"user_id":null,"username":null}

==> /var/log/gitlab/redis/current <==
2018-03-19_12:22:54.09839 373:M 19 Mar 12:22:54.098 * 10 changes in 300 seconds. Saving...
2018-03-19_12:22:54.09851 373:M 19 Mar 12:22:54.098 * Background saving started by pid 6894
2018-03-19_12:22:54.10106 6894:C 19 Mar 12:22:54.101 * DB saved on disk
2018-03-19_12:22:54.10126 6894:C 19 Mar 12:22:54.101 * RDB: 2 MB of memory used by copy-on-write
2018-03-19_12:22:54.19871 373:M 19 Mar 12:22:54.198 * Background saving terminated with success

 

 

extra params:

 

--env GITLAB_OMNIBUS_CONFIG="external_url 'http://unraid:9080/'"

 

I've got already a working domain  https://mydomain.bla and I want to open gitlab over https://mydomain.bla/gitlab

Edited by CreZo

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now