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

Need link to docs, or info for docker image & SSL #502

Open
dtsoden opened this issue Apr 26, 2024 · 9 comments
Open

Need link to docs, or info for docker image & SSL #502

dtsoden opened this issue Apr 26, 2024 · 9 comments

Comments

@dtsoden
Copy link

dtsoden commented Apr 26, 2024

I am looking for help.

I need instructions or docs on how to install SSL on the OFFICIAL DOCKER IMAGE
https://hub.docker.com/_/odoo/

@lathama
Copy link

lathama commented Apr 26, 2024

Typically there is a proxy used for this you can read more at:

I some times use caddy for this eg https://hub.docker.com/_/caddy

@dtsoden
Copy link
Author

dtsoden commented Apr 26, 2024

Typically there is a proxy used for this you can read more at:

I some times use caddy for this eg https://hub.docker.com/_/caddy

I did something similar and reconstructed the entire docker compose

version: '3.8'
services:
  web:
    image: odoo:17.0
    depends_on:
      - mydb
    ports:
      - "8069:8069"
    volumes:
      - web-data:/var/lib/odoo
      - addons:/mnt/extra-addons
    environment:
      - HOST=mydb
      - USER=odoo
      - PASSWORD=myodoo
  mydb:
    image: postgres:15
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=myodoo
      - POSTGRES_USER=odoo
    volumes:
      - db-data:/var/lib/postgresql/data
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - data:/data
      - letsencrypt:/etc/letsencrypt

volumes:
  web-data:
  db-data:
  addons:
  data:
  letsencrypt:

https://nginxproxymanager.com

@lathama
Copy link

lathama commented Apr 26, 2024

If you are interested you can do a PR to https://github.com/docker-library/docs/blob/master/odoo/content.md but I have been waiting a while on one of mine so traction may be slow.

@dtsoden
Copy link
Author

dtsoden commented Apr 26, 2024

perhaps you can help with this core and ROOT issue I am having. The website module and this version refuse to work normally with cloudflare tunnels or this nginx proxy manager. I have omitted proxy_mode, I have included it proxy_mode = True and turned it off proxy_mode = False and that setting in any state including missing has ZERO impact (each change I stop/start the container)

the problem is the website when you load up or pick the template from the initial setup or any time you go into edit mode to edit the site you get this error

Mixed Content: The page at 'https://xxxx.com/web#action=184&cids=1&menu_id=116' was loaded over HTTPS, but requested an insecure frame 'http://xxxx.com/'. This request has been blocked; the content must be served over HTTPS.

I also notice PARAMETERS > SYSTEM PARAMETERS > web.base.url = http://xxx and NOT https://xxx and I can change this... log out and come back in and it resets itself back to HTTP

the app in the container seams busted I can not resolve this mixed error and no one on the forums at Odoo seams to know what going on either. Opening a support ticket sends me to the fourms. I am about to toss in the white towel on Odoo and never look back.

@amh-mw
Copy link

amh-mw commented Apr 26, 2024

I also notice PARAMETERS > SYSTEM PARAMETERS > web.base.url = http://xxx and NOT https://xxx and I can change this... log out and come back in and it resets itself back to HTTP

Odoo automatically sets web.base.url unless you also set web.base.url.freeze. 1

Footnotes

  1. https://www.odoo.com/forum/help-1/system-parameters-web-base-url-143575

@dtsoden
Copy link
Author

dtsoden commented Apr 26, 2024

I deleted the containers for the web and the DB, set it all back up and set the flag "web.base.url.freeze" value = "True" which now locks the URL but seems now unrelated to the underlying core issue in the setting up the web app / website after installing the website module

Mixed Content: The page at 'https://xxxx.com/web#action=184&cids=1&menu_id=116' was loaded over HTTPS, but requested an insecure frame 'http://xxxx.com/'. This request has been blocked; the content must be served over HTTPS.

I am missing something else? Is this normal to have so much trouble setting this system up?

@amh-mw
Copy link

amh-mw commented Apr 26, 2024

I don't use nginx in production, but I use it locally for testing Odoo 15 with docker-compose similar to yours above and /etc/nginx/conf.d/default.conf set to

# https://linuxize.com/post/configure-odoo-with-nginx-as-a-reverse-proxy/

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;

    ssl_certificate /etc/ssl/certs/nginx.pem;
    ssl_certificate_key /etc/ssl/private/nginx.key;

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;

    location / {
        client_max_body_size 128M;
        proxy_pass http://web:8069;
    }

    location /longpolling {
        proxy_pass http://web:8072;
    }
}

Please note that /longpolling is renamed to /websocket in more recent versions.

@dtsoden
Copy link
Author

dtsoden commented Apr 26, 2024

really do appreciate the post and attempts to help sort this.

https://nginxproxymanager.com is what I am using in a local home lab

https://hub.docker.com/r/jc21/nginx-proxy-manager is the container and its all GUI
then I am using https://hub.docker.com/_/odoo

the code you have not sure where something like that may go but I keep seeing similar posted all over the net. I can not for the life of me find that nginx is installed on the odoo web container (is this even docker at all or a from source install or something else). Seams there is no Apachee either which is normal for the underlying OS of the web container 22.04.4 LTS (Jammy Jellyfish). I think odoo has its only built-in webserver/service hence all the switches - but again this seams to be for source installs as the entrypoint.sh file in docker does all this heavy lifting

thats above is all a tangent rant - is there some reason why only a select functions is broken like editing the website where http is being FORCED and causing the MIXED CONTENT error? if this were related to cloudflare the https://nginxproxymanager.com it would be boolean right? like broken or not broken fully... it would not break partially - there must be some internal mechanism causing this?

any odoo 17 folks that can verify this is busted or tell me what I am likely ignorantly missing?

@amh-mw
Copy link

amh-mw commented Apr 26, 2024

I can not for the life of me find that nginx is installed on the odoo web container (is this even docker at all or a from source install or something else).

nginx gets its own container, which appears to be represented in your docker-compose.yaml above as app, in contrast to the odoo web container.

Seams there is no Apachee either which is normal for the underlying OS of the web container 22.04.4 LTS (Jammy Jellyfish). I think odoo has its only built-in webserver/service hence all the switches

odoo uses python Werkzeug; Apache is not involved.

if this were related to cloudflare the https://nginxproxymanager.com it would be boolean right? like broken or not broken fully... it would not break partially - there must be some internal mechanism causing this?

I am unfamiliar with both cloudflare and nginxproxymanager. Temporarily exclude them? Use a stock nginx container locally with a self-signed certificate, i.e.:

  app:
    image: nginx:1
    depends_on:
      - web
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
      - ./nginx.key:/etc/ssl/private/nginx.key
      - ./nginx.pem:/etc/ssl/certs/nginx.pem

Simplify until a configuration works, then add complexity back one piece at a time.

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

No branches or pull requests

3 participants