From af8f50135925436310bda6f106559477eade77a3 Mon Sep 17 00:00:00 2001
From: Alain Takoudjou <alain.takoudjou@nexedi.com>
Date: Thu, 2 Feb 2023 11:10:54 +0100
Subject: [PATCH] Beremiz-ide: set default host for OPCUA and beremiz internal
 services

Compile xdpyinfo for use, in case of debug.
---
 software/beremiz-ide/buildout.hash.cfg              | 2 +-
 software/beremiz-ide/instance-beremiz.cfg.jinja2.in | 2 ++
 software/beremiz-ide/software.cfg                   | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/software/beremiz-ide/buildout.hash.cfg b/software/beremiz-ide/buildout.hash.cfg
index b7b41717e..c99c1edcd 100644
--- a/software/beremiz-ide/buildout.hash.cfg
+++ b/software/beremiz-ide/buildout.hash.cfg
@@ -19,7 +19,7 @@ md5sum = ed2bd38b78f2a66f474205249f6e6f2c
 
 [template-instance-beremiz]
 filename = instance-beremiz.cfg.jinja2.in
-md5sum = 200de2b44431c0e4154227b333f27342
+md5sum = bca63fc8943e7c5fa7dd43841e49bf95
 
 [template-instance-beremiz-test]
 filename = instance-beremiz-test.cfg.jinja2.in
diff --git a/software/beremiz-ide/instance-beremiz.cfg.jinja2.in b/software/beremiz-ide/instance-beremiz.cfg.jinja2.in
index 90deee3c1..792edf7ed 100644
--- a/software/beremiz-ide/instance-beremiz.cfg.jinja2.in
+++ b/software/beremiz-ide/instance-beremiz.cfg.jinja2.in
@@ -227,6 +227,8 @@ inline =
   export LANG=C.UTF-8
   export LC_ALL=C.UTF-8
   export BEREMIZPYTHONPATH={{ python_bin }}
+  export OPCUA_DEFAULT_HOST={{ ipv4 }}
+  export BEREMIZ_LOCAL_HOST={{ ipv4 }}
 
 output = ${directory:bin}/beremiz-env.sh
 
diff --git a/software/beremiz-ide/software.cfg b/software/beremiz-ide/software.cfg
index 81b039ed0..408e17ab7 100644
--- a/software/beremiz-ide/software.cfg
+++ b/software/beremiz-ide/software.cfg
@@ -35,6 +35,7 @@ parts +=
   Modbus
   xterm
   instance
+  xdpyinfo
 
 [gcc]
 # Always build GCC for Fortran (see openblas).
-- 
2.30.9