Project

General

Profile

Actions

Support #17677

open

foreman_hooks plugin - environment variable REMOTE_ADDR not correct on client connect

Added by Enrico Labedzki over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hi folks,

i noticed a strange behavior in our hook ( a custom written script triggert through official foreman_hooks plugin ), which should grant access on noVNC (websockify) port 29876 to all of our customers when they connect from the internet to our foreman.

What i did in this hook is to read on every event (user/after_initialize) the environment variable 'REMOTE_ADDR' which is always set with the client IP (but in my case not with the right one), when our hook is fired up on such event, the environment variable is available/readable, but has always the wrong IP.

On yesterday gambled a colleague of mine and myself a little with apache passenger and foreman and we came to the result that in ruby/perl/php CGI the REMOTE_ADDR is correct, also in sinatra/rails applications, but not when the foreman_hooks plugin fires our script, but why ... !?

Is there a possible solution to get the correct IP from clients in foreman_hooks scripts (foreman_hooks gives us a json string on stdin and inherits the apache environment variables), as far as i know..., please correct me if i'm wrong ?

At the moment we use foreman 1.11.2 on our live setup, on my dev machine i have foreman 1.13.1 installed, but with both the same result.

I didn't know if i'am right here with my request, but the foreman_hooks plugin is listed on your website, so i guess i can't not really be wrong, right?

Best regards
Enrico

No data to display

Actions

Also available in: Atom PDF