|
|
@ -63,14 +63,16 @@ uses: |
|
|
|
- !bash-stdout | |
|
|
|
workers=$(relation-base-compose-get workers 2>/dev/null) |
|
|
|
workers=${workers:-1} |
|
|
|
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/" |
|
|
|
version=$(cached_cmd_on_base_image "$MASTER_BASE_SERVICE_NAME" \ |
|
|
|
"python -c 'import odoo; print(odoo.cli.server.__version__)'") || exit 1 |
|
|
|
if [ "$workers" -gt 1 ]; then |
|
|
|
if [ "${version%.*}" -lt 15 ]; then |
|
|
|
echo "ProxyPass /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/" |
|
|
|
echo "ProxyPassReverse /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/" |
|
|
|
else |
|
|
|
echo "ProxyPass /websocket ws://${MASTER_BASE_SERVICE_NAME}:8072/websocket" |
|
|
|
echo "ProxyPassReverse /websocket ws://${MASTER_BASE_SERVICE_NAME}:8072/websocket" |
|
|
|
fi |
|
|
|
fi |
|
|
|
backup: |
|
|
|
constraint: recommended |
|
|
|