odoo / odoo

Odoo. Open Source Apps To Grow Your Business.
https://www.odoo.com
Other
39.27k stars 25.43k forks source link

[12] Mixed content on customer invoices #35671

Closed cgarnier closed 5 years ago

cgarnier commented 5 years ago

Impacted versions: 12 (docker) Steps to reproduce: Send an invoice by mail, click on the button in the mail. Current behavior: The invoice page dont load correcly. The preview doesnt display and there is a mixed content error in the preview. Expected behavior: Load with no error and wither the preview.

Video/Screenshot link (optional):

Capture d’écran de 2019-08-12 23-11-43

http is redirected to https by the loadbalancer (traefik) web.base.url starts with https web.base.url.freeze is True

pedrobaeza commented 5 years ago

This is something on your deployment, as I don't get that problem in mine. Check your proxy configuration, werkzeug version and so on.

Closing meanwhile there's no more proof of Odoo itself issue.

cgarnier commented 5 years ago

Please dont close it until i didnt find where is the issue.

pedrobaeza commented 5 years ago

I will open it when that happens.

cgarnier commented 5 years ago

I found that the src link of the iframe: https://xxxx/my/invoices/6?access_token=448fa9da-1338-42cd-9df8-b6f71f081f8b&report_type=html

is making a 302 redirection to http://xxxx/FR_fr/my/invoices/6?access_token=448fa9da-1338-42cd-9df8-b6f71f081f8b&report_type=html

It s what is causing the mixed content. I dont understand yet why odoo is redirecting with a http link.

pedrobaeza commented 5 years ago

As said, that's because your proxy or werkzeug version. I can't deep more, as it depends on that configurations that are very different per configuration, but you can check that with our Docker solution - https://github.com/Tecnativa/doodba - it's working, as fast option for contrasting the problem (this is not advertising, but a way to check that is working).

cgarnier commented 5 years ago

In fact i just added proxy_mode = True in /etc/odoo/odoo.conf and now it s working well.

pedrobaeza commented 5 years ago

Oh, I was assuming you already had that. Well, I noted for others with the same problem. Glad you found the deployment problem.

cgarnier commented 5 years ago

Maybe you could add a paragraph about it in this readme: https://hub.docker.com/_/odoo I think most people use this docker behind a reverse proxy. Thanks for your help.

pedrobaeza commented 5 years ago

Well, I'm only a contributor giving a hand managing Odoo issues, but not Odoo employee or Docker image maintainer, but I think it's your duty to check general documentation about that, where it's indicated: https://www.odoo.com/documentation/12.0/setup/deploy.html

cgarnier commented 5 years ago

Yes you right, but the point to use docker is to not have to read install documentation :D It should work out the box by linking services together and it should expose some usefull env var to setup this kind of options.

pedrobaeza commented 5 years ago

I don't agree on that part. Docker only provides a layer for not bothering with some install things. But this is configuration, not installation, and you can't assume that default configuration. For example, enabling that and using Docker for development in local machine with that option would make it to fail in other ways.

cgarnier commented 5 years ago

Yes ofcource but this kind of options should be settable via some env var to not have to edit any conf files. -e ODOO_PROXY_MODE=True

pedrobaeza commented 5 years ago

Well, for that, you should:

alexandregodard commented 5 years ago

Hi, In my config Proxy_mode=True, web.base.url = https://... and web.base.url.freeze =True weren't enough

Need to fixe my nginx proxy too with : _proxy_setheader X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr;