From 63ded57b1a7a25296fd6a799f633d605d8a1e63c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 28 Apr 2020 10:57:45 +0200
Subject: [PATCH] software/theia: promise to wait for frontend to be available

This is required, otherwise published URL in slapos master is `"None"`
---
 software/theia/buildout.hash.cfg | 2 +-
 software/theia/instance.cfg.in   | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/software/theia/buildout.hash.cfg b/software/theia/buildout.hash.cfg
index f3afe0cf7..866fa4a01 100644
--- a/software/theia/buildout.hash.cfg
+++ b/software/theia/buildout.hash.cfg
@@ -15,7 +15,7 @@
 
 [instance]
 filename = instance.cfg.in
-md5sum = 1d495ab97a865b31ac7f2287cb76aed0
+md5sum = 99dfaa031e58518326b731e9218aa425
 
 [yarn.lock]
 filename = yarn.lock
diff --git a/software/theia/instance.cfg.in b/software/theia/instance.cfg.in
index c1e88ad6c..85743eb36 100644
--- a/software/theia/instance.cfg.in
+++ b/software/theia/instance.cfg.in
@@ -161,6 +161,7 @@ recipe =
 instance-promises =
   $${theia-listen-promise:name}
   $${frontend-listen-promise:name}
+  $${apache-frontend-url-available-promise:name}
 
 [theia-listen-promise]
 <= monitor-promise-base
@@ -176,6 +177,13 @@ name = $${:_buildout_section_name_}.py
 config-hostname = $${frontend-instance:ip}
 config-port = $${frontend-instance:port}
 
+[apache-frontend-url-available-promise]
+<= monitor-promise-base
+module = check_url_available
+name = $${:_buildout_section_name_}.py
+config-url = $${apache-frontend:connection-secure_access}
+config-check-secure = 1
+
 [apache-frontend]
 <= slap-connection
 recipe = slapos.cookbook:requestoptional
-- 
2.30.9