Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c67d9492
Commit
c67d9492
authored
Mar 02, 2021
by
Balasankar "Balu" C
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add setting to control Rails.application.config.hosts
Signed-off-by:
Balasankar "Balu" C
<
balasankar@gitlab.com
>
parent
c89a2f83
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
0 deletions
+13
-0
changelogs/unreleased/add-rails-application-config-hosts.yml
changelogs/unreleased/add-rails-application-config-hosts.yml
+5
-0
config/gitlab.yml.example
config/gitlab.yml.example
+2
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-0
config/initializers/rails_host_authorization.rb
config/initializers/rails_host_authorization.rb
+5
-0
No files found.
changelogs/unreleased/add-rails-application-config-hosts.yml
0 → 100644
View file @
c67d9492
---
title
:
Add setting to control Rails.application.config.hosts
merge_request
:
55491
author
:
type
:
added
config/gitlab.yml.example
View file @
c67d9492
...
...
@@ -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.
...
...
config/initializers/1_settings.rb
View file @
c67d9492
...
...
@@ -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?
...
...
config/initializers/rails_host_authorization.rb
View file @
c67d9492
...
...
@@ -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'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment