diff --git a/_traefik1_labels.yml.jinja b/_traefik1_labels.yml.jinja index fff2019d..f2df7dc2 100644 --- a/_traefik1_labels.yml.jinja +++ b/_traefik1_labels.yml.jinja @@ -43,7 +43,7 @@ {%- endif %} {%- endmacro %} -{%- macro odoo(domain_groups_list, paths_without_crawlers) %} +{%- macro odoo(domain_groups_list, paths_without_crawlers, odoo_version) %} traefik.domain: {{ macros.first_main_domain(domain_groups_list)|tojson }} {%- call(domain_group) macros.domains_loop_grouped(domain_groups_list) %} @@ -87,11 +87,12 @@ }} {%- endif %} {%- if not domain_group.path_prefixes %} + {%- set longpolling_route = "/longpolling/" if odoo_version < 16 else "/websocket" -%} {{- router( prefix="longpolling", index0=domain_group.loop.index0, - rule=domains_rule(domain_group.hosts, ["/longpolling/"]), + rule=domains_rule(domain_group.hosts, [longpolling_route]), entrypoints=domain_group.entrypoints, port=8072, ) diff --git a/_traefik2_labels.yml.jinja b/_traefik2_labels.yml.jinja index ee9774ec..bcd6ce0e 100644 --- a/_traefik2_labels.yml.jinja +++ b/_traefik2_labels.yml.jinja @@ -154,12 +154,13 @@ {#- Longpolling router #} {%- if not domain_group.path_prefixes %} + {%- set longpolling_route = "PathPrefix(`/longpolling/`)" if odoo_version < 16 else "Path(`/websocket`)" -%} {{- router( domain_group=domain_group, key=key, suffix="longpolling", - rule="%s && PathPrefix(`/longpolling/`)" % domains_rule(domain_group), + rule="%s && %s" % (domains_rule(domain_group), longpolling_route), service="longpolling", middlewares=_ns.basic_middlewares, ) diff --git a/devel.yaml.jinja b/devel.yaml.jinja index 9f6428fc..a7ca099b 100644 --- a/devel.yaml.jinja +++ b/devel.yaml.jinja @@ -20,8 +20,9 @@ services: ports: - "127.0.0.1:{{ macros.version_major(odoo_version) }}899:6899" - "127.0.0.1:{{ macros.version_major(odoo_version) }}069:8069" + - "127.0.0.1:{{ macros.version_major(odoo_version) }}072:8072" environment: - PORT: "6899 8069" + PORT: "6899 8069 8072" TARGET: odoo odoo: diff --git a/prod.yaml.jinja b/prod.yaml.jinja index fd1d73bf..10bd461c 100644 --- a/prod.yaml.jinja +++ b/prod.yaml.jinja @@ -37,7 +37,7 @@ services: doodba.domain.main: {{ macros.first_main_domain(domains_prod)|tojson }} {%- if odoo_proxy == "traefik" and domains_prod %} traefik.enable: "true" - {{- traefik1_labels.odoo(domains_prod, paths_without_crawlers) }} + {{- traefik1_labels.odoo(domains_prod, paths_without_crawlers, odoo_version) }} {{- traefik2_labels.common_middlewares(_key, cidr_whitelist) }} {{- traefik2_labels.odoo( domains_prod, diff --git a/test.yaml.jinja b/test.yaml.jinja index a03c840b..3c746f59 100644 --- a/test.yaml.jinja +++ b/test.yaml.jinja @@ -35,7 +35,7 @@ services: doodba.domain.main: {{ macros.first_main_domain(domains_test)|tojson }} {%- if odoo_proxy == "traefik" and domains_test %} traefik.enable: "true" - {{- traefik1_labels.odoo(domains_test, ["/"]) }} + {{- traefik1_labels.odoo(domains_test, ["/"], odoo_version) }} {{- traefik2_labels.odoo( domains_test, cidr_whitelist,