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
ccf14b48
Commit
ccf14b48
authored
Jan 24, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
b2873afd
fac725c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
changelogs/unreleased/53676-ip-address-of-gitlab-runner-is-wrong-in-the-runners-description.yml
...-of-gitlab-runner-is-wrong-in-the-runners-description.yml
+5
-0
lib/api/helpers/runner.rb
lib/api/helpers/runner.rb
+1
-1
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+3
-3
No files found.
changelogs/unreleased/53676-ip-address-of-gitlab-runner-is-wrong-in-the-runners-description.yml
0 → 100644
View file @
ccf14b48
---
title
:
Get remote IP address of runner
merge_request
:
24624
author
:
type
:
changed
lib/api/helpers/runner.rb
View file @
ccf14b48
...
...
@@ -28,7 +28,7 @@ module API
end
def
get_runner_ip
{
ip_address:
request
.
ip
}
{
ip_address:
request
.
env
[
"HTTP_X_FORWARDED_FOR"
]
||
request
.
ip
}
end
def
current_runner
...
...
spec/requests/api/runner_spec.rb
View file @
ccf14b48
...
...
@@ -210,8 +210,8 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
it
"sets the runner's ip_address"
do
post
api
(
'/runners'
),
params:
{
token:
registration_token
},
headers:
{
'REMOTE_ADDR
'
=>
'123.111.123.111'
}
params:
{
token:
registration_token
},
headers:
{
'X-Forwarded-For
'
=>
'123.111.123.111'
}
expect
(
response
).
to
have_gitlab_http_status
201
expect
(
Ci
::
Runner
.
first
.
ip_address
).
to
eq
(
'123.111.123.111'
)
...
...
@@ -520,7 +520,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
it
"sets the runner's ip_address"
do
post
api
(
'/jobs/request'
),
params:
{
token:
runner
.
token
},
headers:
{
'User-Agent'
=>
user_agent
,
'
REMOTE_ADDR
'
=>
'123.222.123.222'
}
headers:
{
'User-Agent'
=>
user_agent
,
'
X-Forwarded-For
'
=>
'123.222.123.222'
}
expect
(
response
).
to
have_gitlab_http_status
201
expect
(
runner
.
reload
.
ip_address
).
to
eq
(
'123.222.123.222'
)
...
...
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