From 42675e43241b7d7b0887d50c5e789c76c1505084 Mon Sep 17 00:00:00 2001
From: Nicolas Wavrant <nicolas.wavrant@tiolive.com>
Date: Wed, 27 Nov 2013 10:13:01 +0100
Subject: [PATCH] slaprunner: jinja part for frontend is now correct

---
 software/slaprunner/instance-runner.cfg | 30 ++++++++++++-------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/software/slaprunner/instance-runner.cfg b/software/slaprunner/instance-runner.cfg
index 7370a1bb1..b7e549ef7 100644
--- a/software/slaprunner/instance-runner.cfg
+++ b/software/slaprunner/instance-runner.cfg
@@ -46,35 +46,33 @@ software-type = {{ slapparameter_dict.get('custom-frontend-software-type', 'Root
 slave = true
 name = Custom Web Frontend
 
-server-url = ${slap-connection:server-url}
-key-file = ${slap-connection:key-file}
-cert-file = ${slap-connection:cert-file}
-computer-id = ${slap-connection:computer-id}
-partition-id = ${slap-connection:partition-id}
+server-url = $${slap-connection:server-url}
+key-file = $${slap-connection:key-file}
+cert-file = $${slap-connection:cert-file}
+computer-id = $${slap-connection:computer-id}
+partition-id = $${slap-connection:partition-id}
 
 {% if slapparameter_dict.get('custom-frontend-instance-guid') -%}
 sla = instance_guid
-sla-instance_guid = ${slap-parameter:frontend-instance-guid}
+sla-instance_guid = $${slap-parameter:frontend-instance-guid}
 {% endif -%}
 
-config = url type custom-domain
-# XXX: allow http/https configuration
+config = url
 config-url = {{ slapparameter_dict.get('custom-frontend-backend-url') }}
-config-custom-domain = {% if slapparameter_dict.get('custom-frontend-domain') -%} {{ slapparameter_dict.get('custom-frontend-domain') }} {% endif %}
-config-type = {% if slapparameter_dict.get('custom-frontend-type') -%} {{ slapparameter_dict.get('custom-frontend-type') }} {% endif %}
-config-path = {% if slapparameter_dict.get('custom-frontend-path') -%} {{ slapparameter_dict.get('custom-frontend-path') }} {% endif %}
-return = frontend_ipv4_address site_url
+return = site_url domain
 
 [custom-frontend-promise]
 recipe = slapos.cookbook:check_url_available
-path = ${directory:promises}/custom_frontend_promise
-url = ${request-custom-frontend:connection-site_url}
+path = $${directory:promises}/custom_frontend_promise
+url = https://$${request-custom-frontend:connection-domain}
+{% if slapparameter_dict.get('custom-frontend-basic-auth') -%}
+check-secure = 1
+{% endif -%}
 dash_path = {{ dash_executable_location }}
 curl_path = {{ curl_executable_location }}
 
 [publish-connection-informations]
-custom-frontend-url = ${request-custom-frontend:connection-site_url}
-custom-frontend-ipv4 = ${request-custom-frontend:connection-frontend_ipv4_address}
+custom-frontend-url = https://$${request-custom-frontend:connection-domain}
 
 [buildout]
 # XXX: hardcoded and duplicated list of parts.
-- 
2.30.9