Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access source ip address #312

Closed
adamaze opened this issue Apr 10, 2019 · 6 comments
Closed

access source ip address #312

adamaze opened this issue Apr 10, 2019 · 6 comments
Assignees
Milestone

Comments

@adamaze
Copy link

adamaze commented Apr 10, 2019

I was hoping to be able to pass the source IP along to the script, but i couldn't find a way to access it through the request-values section
Am I missing something? Or is my only real option to parse the stdout of webhook and attempt to grab the last line with "incoming HTTP request from" (if that would even work...)

any pointers would be greatly appreciated!

@adnanh
Copy link
Owner

adnanh commented Apr 17, 2019

Hey, sorry for the late reply. So far there isn't support in webhook for fetching the source IP but it's on the roadmap and should be included in the next version.

Current workaround is to put nginx in front of webhook and have it pass the source IP via X-Forwarded-For header, which you can then read using the webhook.

@adamaze
Copy link
Author

adamaze commented Apr 17, 2019

Cool. Thanks for the response. It is good to know that it is on the roadmap. Feel free to close this if you like

@adnanh
Copy link
Owner

adnanh commented Apr 17, 2019

I'll close it once the feature lands in the development branch :-)

@adnanh
Copy link
Owner

adnanh commented Dec 2, 2019

Tagging this with #356 as it should provide a powerful mechanism to craft a solution to this problem.

@moorereason
Copy link
Collaborator

If we include this in webhook, here's a proposed usage:

{
  "source": "request",
  "name": "remote-addr"
}

Potentially relevant name values from http.Request: method and remote-addr.

@Emremir10
Copy link

If we include this in webhook, here's a proposed usage:

{
  "source": "request",
  "name": "remote-addr"
}

Potentially relevant name values from http.Request: method and remote-addr.

Is this still working? As I am getting the following error message:

[webhook] 2023/05/10 16:38:16 [0f27d9] error extracting command arguments: couldn't retrieve argument for {Source:request Name:remote-addr EnvName: Base64Decode:false}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants