Tecnativa / doodba

Base image for making the creation of customized Odoo environments a piece of cake
Apache License 2.0
436 stars 305 forks source link

Question externals Ip's #236

Closed ValentinVinagre closed 5 years ago

ValentinVinagre commented 5 years ago

Hi, I have one question. In the option "Settings/technical/tracking email", the "User IP" is always the same, this is an example, but in all models/fields where we need the external IP, the value is the same(the internal IP of docker). Other example is filter the connection user by one ip, i can't do this because the external IP is always changing to the internal IP(docker).

How can I change the *.yml file so that it does not transform external IPs into internal?

Thanks.

yajo commented 5 years ago

That's a problem in the module code, not in doodba. It's probably not respecting the right proxy protocol parameters.

You can see in the logs the real IP, and that's thanks to that we fixed https://github.com/Tecnativa/doodba/issues/19 long ago in Doodba, but Odoo has a problem with proxies and it must be fixed there, sorry. :man_shrugging:

pedrobaeza commented 5 years ago

Is it maybe this problem: https://github.com/odoo/odoo/pull/36212 ?

yajo commented 5 years ago

Hmm it seems so.

xmo-odoo commented 5 years ago

I wouldn't think so, the fix is only to forward the host and proto (scheme), the remote address (x-forwarded-for) should always have been forwarded / converted when enabling proxy mode.

pedrobaeza commented 5 years ago

Thanks for the clarification!

xmo-odoo commented 5 years ago

Looking at #19 maybe werkzeug 0.15 regressed again on logging REMOTE_ADDR?

edit: though odoo/odoo#32914 seems to say that it does work for the regular workers and not for gevent.

yajo commented 5 years ago

I haven't tested werkezeug 0.15 yet, but let me do a quick test and I'll tell you.

yajo commented 5 years ago

Tested in an odoo 11 instance, with werkzeug 0.15.5.

ValentinVinagre commented 5 years ago

I see this question in stackoverflow:

https://stackoverflow.com/questions/36352842/how-to-get-user-ip-address-on-odoo-when-i-am-using-nginx

I don't know if changing the 'REMOTE_ADDR' parameter by 'HTTP_X_REAL_IP' in odoo base will fix the issue...

I followed this conversation but I didn't understand how to solve the problem.

Thanks.

yajo commented 5 years ago

No, that can't be the fix because not always you have a proxy before odoo.

ValentinVinagre commented 5 years ago

True...