Commit c67d9492 authored by Balasankar "Balu" C's avatar Balasankar "Balu" C

Add setting to control Rails.application.config.hosts

Signed-off-by: default avatarBalasankar "Balu" C <balasankar@gitlab.com>
parent c89a2f83
---
title: Add setting to control Rails.application.config.hosts
merge_request: 55491
author:
type: added
......@@ -73,6 +73,8 @@ production: &base
worker_src: "'self' blob:"
report_uri:
allowed_hosts: []
# Trusted Proxies
# Customize if you have GitLab behind a reverse proxy which is running on a different machine.
# Add the IP address for your reverse proxy to the list, otherwise users will appear signed in from that address.
......
......@@ -210,6 +210,7 @@ Settings.gitlab['domain_allowlist'] ||= []
Settings.gitlab['import_sources'] ||= Gitlab::ImportSources.values
Settings.gitlab['trusted_proxies'] ||= []
Settings.gitlab['content_security_policy'] ||= Gitlab::ContentSecurityPolicy::ConfigLoader.default_settings_hash
Settings.gitlab['allowed_hosts'] ||= []
Settings.gitlab['no_todos_messages'] ||= YAML.load_file(Rails.root.join('config', 'no_todos_messages.yml'))
Settings.gitlab['impersonation_enabled'] ||= true if Settings.gitlab['impersonation_enabled'].nil?
Settings.gitlab['usage_ping_enabled'] = true if Settings.gitlab['usage_ping_enabled'].nil?
......
......@@ -2,6 +2,11 @@
# This file requires config/initializers/1_settings.rb
if Gitlab.config.gitlab.allowed_hosts.present?
Rails.application.config.hosts << Gitlab.config.gitlab.host << 'unix'
Rails.application.config.hosts += Gitlab.config.gitlab.allowed_hosts
end
if Rails.env.development?
Rails.application.config.hosts += [Gitlab.config.gitlab.host, 'unix', 'host.docker.internal']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment