BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3899d07f
Commit
3899d07f
authored
Aug 03, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move hostname to Gitlab::Environment
parent
0fa94a0d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
4 deletions
+10
-4
1_settings.rb
config/initializers/1_settings.rb
+0
-1
environment.rb
lib/gitlab/environment.rb
+7
-0
circuit_breaker.rb
lib/gitlab/git/storage/circuit_breaker.rb
+1
-1
admin_health_check_spec.rb
spec/features/admin/admin_health_check_spec.rb
+1
-1
circuit_breaker_spec.rb
spec/lib/gitlab/git/storage/circuit_breaker_spec.rb
+1
-1
No files found.
config/initializers/1_settings.rb
View file @
3899d07f
...
...
@@ -222,7 +222,6 @@ Settings.gitlab['default_branch_protection'] ||= 2
Settings
.
gitlab
[
'default_can_create_group'
]
=
true
if
Settings
.
gitlab
[
'default_can_create_group'
].
nil?
Settings
.
gitlab
[
'host'
]
||=
ENV
[
'GITLAB_HOST'
]
||
'localhost'
Settings
.
gitlab
[
'ssh_host'
]
||=
Settings
.
gitlab
.
host
Settings
.
gitlab
[
'hostname'
]
||=
ENV
[
'HOSTNAME'
]
||
Socket
.
gethostname
Settings
.
gitlab
[
'https'
]
=
false
if
Settings
.
gitlab
[
'https'
].
nil?
Settings
.
gitlab
[
'port'
]
||=
ENV
[
'GITLAB_PORT'
]
||
(
Settings
.
gitlab
.
https
?
443
:
80
)
Settings
.
gitlab
[
'relative_url_root'
]
||=
ENV
[
'RAILS_RELATIVE_URL_ROOT'
]
||
''
...
...
lib/gitlab/environment.rb
0 → 100644
View file @
3899d07f
module
Gitlab
module
Environment
def
self
.
hostname
@hostname
||=
ENV
[
'HOSTNAME'
]
||
Socket
.
gethostname
end
end
end
lib/gitlab/git/storage/circuit_breaker.rb
View file @
3899d07f
...
...
@@ -31,7 +31,7 @@ module Gitlab
cached_circuitbreakers
[
storage
]
end
def
initialize
(
storage
,
hostname
=
Gitlab
.
config
.
gitlab
.
hostname
)
def
initialize
(
storage
,
hostname
=
Gitlab
::
Environment
.
hostname
)
@storage
=
storage
@hostname
=
hostname
...
...
spec/features/admin/admin_health_check_spec.rb
View file @
3899d07f
...
...
@@ -64,7 +64,7 @@ feature "Admin Health Check", feature: true, broken_storage: true do
end
it
'shows storage failure information'
do
hostname
=
Gitlab
.
config
.
gitlab
.
hostname
hostname
=
Gitlab
::
Environment
.
hostname
expect
(
page
).
to
have_content
(
'broken: failed storage access attempt on host:'
)
expect
(
page
).
to
have_content
(
"
#{
hostname
}
: 1 of 10 failures."
)
...
...
spec/lib/gitlab/git/storage/circuit_breaker_spec.rb
View file @
3899d07f
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
Git
::
Storage
::
CircuitBreaker
,
clean_gitlab_redis_shared_state:
true
,
broken_storage:
true
do
let
(
:circuit_breaker
)
{
described_class
.
new
(
'default'
)
}
let
(
:hostname
)
{
Gitlab
.
config
.
gitlab
.
hostname
}
let
(
:hostname
)
{
Gitlab
::
Environment
.
hostname
}
let
(
:cache_key
)
{
"storage_accessible:default:
#{
hostname
}
"
}
def
value_from_redis
(
name
)
...
...
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