How to show the complete current configuration

After installing gitlab-ee on a new Ubuntu system it tries to send email to admin@example.com.

That makes me wonder where that comes from. The gitlab.rb contains a commented out section where I see that email address, but it is commented out. When I run gitlab-ctl show-config there is nothing in there with admin@example.com.

Is there a command to actually see all effective configuration in a running GitLab?

The admin@example.com email address was configured for user root.

Still my question remains. Especially to see the built-in defaults. Or is that already given with gitlab-ctl show-config?

The built in defaults are the ones that are commented out in the config. If the option is commented out in the config file it is considered as non-existant by the software, therefore the default value is used. The default values are usually the ones that are set in the commented line in the config.

For example, not so long ago, I decided to change some default options for newly created repos on my GL instance. I opened the gitlab.rb file, copied the lines that I want to change, uncommented them and changed their values

### Default project feature settings
# gitlab_rails['gitlab_default_projects_features_issues'] = true
# gitlab_rails['gitlab_default_projects_features_merge_requests'] = true
# gitlab_rails['gitlab_default_projects_features_wiki'] = true
gitlab_rails['gitlab_default_projects_features_wiki'] = false
# gitlab_rails['gitlab_default_projects_features_snippets'] = true
gitlab_rails['gitlab_default_projects_features_snippets'] = false
# gitlab_rails['gitlab_default_projects_features_builds'] = true
gitlab_rails['gitlab_default_projects_features_builds'] = false
# gitlab_rails['gitlab_default_projects_features_container_registry'] = true
gitlab_rails['gitlab_default_projects_features_container_registry'] = false

I usually copy the config lines just to know what’s the default value if I need to know it in the future, but you don’t have to leave it there.

As you can see, the default value for gitlab_default_projects_features_container_registry property is true. Since it is commented out by default, the software doesn’t have a set value, so it uses the default one (true in this case). If I were to uncomment it and leave it as true, the software would now get the set value and use it (because it is set). If I want to change it, I simply change the config value and it will overwrite the default one.

To finally directly answer your question

Still my question remains. Especially to see the built-in defaults. Or is that already given with gitlab-ctl show-config ?

You can see the default values in /etc/gitlab/gitlab.rb file. They’re the commented lines.

please mark this reply as the solution to your issue if it’s “fixed” / “resolved”. Else just provide more info
Kind regards.

1 Like

That is simply not true. It is only so if you have not done any upgrade. I have a GitLab server installed about three years ago, I forgot which version that was, maybe 9.x. I have upgraded the major version at least three times. During all these upgrades some defaults have changed, but my original gitlab.rb is basically the same as the one I started with.

For example, none of the grafana or alertmanager settings are present in my gitlab.rb. They were introduced in 11.9, I think.

I’m now more or less convinced that the output of gitlab-ctl show-config shows all the values, including the defaults.

1 Like

Oof true ! :thonk:

Haven’t thought of that one :confused:

Welp I nice workaround would be just installing a new clean version and looking at that config for defaults :stuck_out_tongue:

1 Like