From c4081b2f78cc01f54c0347f0c1646c867b5823c2 Mon Sep 17 00:00:00 2001 From: default Date: Sun, 6 Aug 2023 12:58:27 +0200 Subject: [PATCH] [FIX] longpolling is replace by websocket since 16.0 version of odoo in reverse proxy --- odoo-tecnativa/hooks/init | 1 + odoo-tecnativa/metadata.yml | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/odoo-tecnativa/hooks/init b/odoo-tecnativa/hooks/init index 4b75993..564c577 100755 --- a/odoo-tecnativa/hooks/init +++ b/odoo-tecnativa/hooks/init @@ -28,6 +28,7 @@ done ## workers management workers=$(options-get workers 2>/dev/null) || true workers=${workers:-1} +version=$(options-get version 2>/dev/null) || true modules=$(options-get modules 2>/dev/null | yaml_get_values ,) || true if [ -z "$modules" ]; then diff --git a/odoo-tecnativa/metadata.yml b/odoo-tecnativa/metadata.yml index ee13bf5..21130dc 100644 --- a/odoo-tecnativa/metadata.yml +++ b/odoo-tecnativa/metadata.yml @@ -14,7 +14,7 @@ docker-compose: tty: true environment: INITIAL_LANG: fr_FR - LIST_DB: 'true' + LIST_DB: "true" default-options: workers: 1 @@ -63,10 +63,15 @@ uses: - !bash-stdout | workers=$(relation-base-compose-get workers 2>/dev/null) workers=${workers:-1} - if [ "$workers" -gt 1 ]; then + version=$(relation-base-compose-get version 2>/dev/null) + if [ "$workers" -gt 1 ] && [ $version -lt 16]; then echo "ProxyPass /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/" echo "ProxyPassReverse /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/" fi + if [ "$workers" -gt 1 ] && [ $version -ge 16]; then + echo "ProxyPass /websocket/ http://${MASTER_BASE_SERVICE_NAME}:8072/websocket/" + echo "ProxyPassReverse /websocket/ http://${MASTER_BASE_SERVICE_NAME}:8072/websocket/" + fi backup: constraint: recommended auto: pair @@ -81,7 +86,6 @@ uses: ## - must start with a '/', will start from $SERVICE_DATASTORE exclude-patterns: - "/var/lib/odoo/sessions/" - # network-isolation: # whitelist: ## required external services used by this service # - www.google.com