Commit 668d6ff3 authored by Joanne Hugé's avatar Joanne Hugé

simpleran: use urlparse to get frontend hostname

During tests a hostname and port is provided instead
of an URL, so hostname needs to be retrieved
parent 4c82b7cf
...@@ -36,7 +36,7 @@ md5sum = 3b6c08d7685e7c93ab451bec25e4815f ...@@ -36,7 +36,7 @@ md5sum = 3b6c08d7685e7c93ab451bec25e4815f
[ru_libinstance.jinja2.cfg] [ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg _update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = eb3f43791b494c3d586e2717cdd6f660 md5sum = 349b02e6993409361176a865b780b871
[ru_sdr_libinstance.jinja2.cfg] [ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg _update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
...@@ -60,7 +60,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e ...@@ -60,7 +60,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb] [template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = e89ee67dcee89923aace67759b3a7867 md5sum = 04b723fc2a3d5555243921823b0e087b
[template-ors-enb] [template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg _update_hash_filename_ = instance-ors-enb.jinja2.cfg
...@@ -76,7 +76,7 @@ md5sum = 92fd8377819ae6e844f77937cecfa605 ...@@ -76,7 +76,7 @@ md5sum = 92fd8377819ae6e844f77937cecfa605
[template-ue] [template-ue]
_update_hash_filename_ = instance-ue.jinja2.cfg _update_hash_filename_ = instance-ue.jinja2.cfg
md5sum = 17b3324ed8554782456d30c888683f25 md5sum = 7b6196d92e6988a52a78660c2b6a8b50
[template-obsolete] [template-obsolete]
_update_hash_filename_ = instance-obsolete.jinja2.cfg _update_hash_filename_ = instance-obsolete.jinja2.cfg
......
...@@ -346,8 +346,8 @@ ipeercell_dict = {{ dumps(ipeercell_dict) }} ...@@ -346,8 +346,8 @@ ipeercell_dict = {{ dumps(ipeercell_dict) }}
[publish-connection-information] [publish-connection-information]
<= monitor-publish <= monitor-publish
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
websocket-address = ${request-slave-frontend:connection-domain}/${nginx-params:websocket-path} websocket-hostname = ${frontend-urlparse:hostname}
websocket-port = 443 websocket-port = ${frontend-urlparse:port}
websocket-password = ${websocket-password:passwd} websocket-password = ${websocket-password:passwd}
enb-ipv6 = {{ my_ipv6 }} enb-ipv6 = {{ my_ipv6 }}
enb-ipv4 = {{ lan_ipv4 }} enb-ipv4 = {{ lan_ipv4 }}
......
...@@ -141,8 +141,8 @@ recipe = slapos.cookbook:publish.serialised ...@@ -141,8 +141,8 @@ recipe = slapos.cookbook:publish.serialised
rue_bind_addr = {{my_ipv6}} rue_bind_addr = {{my_ipv6}}
ue-ipv4 = {{ lan_ipv4 }} ue-ipv4 = {{ lan_ipv4 }}
ue-mac = {{ mac }} ue-mac = {{ mac }}
websocket-address = ${request-slave-frontend:connection-domain}/${nginx-params:websocket-path} websocket-hostname = ${frontend-urlparse:hostname}
websocket-port = 443 websocket-port = ${frontend-urlparse:port}
websocket-password = ${websocket-password:passwd} websocket-password = ${websocket-password:passwd}
monitor-gadget-url = ${:monitor-base-url}/gadget/software.cfg.html monitor-gadget-url = ${:monitor-base-url}/gadget/software.cfg.html
......
...@@ -459,12 +459,21 @@ cert-file = ${directory:etc}/websocket.crt ...@@ -459,12 +459,21 @@ cert-file = ${directory:etc}/websocket.crt
executable = {{ nginx_executable }} executable = {{ nginx_executable }}
wrapper = ${directory:bin}/nginx-with-ca wrapper = ${directory:bin}/nginx-with-ca
[frontend-urlparse]
recipe = slapos.recipe.build
domain = ${request-slave-frontend:connection-domain}
init =
import six.moves.urllib.parse as urlparse
parsed_url = urlparse.urlparse('wss://' + options['domain'])
options['hostname'] = parsed_url.hostname
options['port'] = parsed_url.port if parsed_url.port else 443
{{ part('websocket-promise') }} {{ part('websocket-promise') }}
<= monitor-promise-base <= monitor-promise-base
promise = check_socket_listening promise = check_socket_listening
name = websocket_promise.py name = websocket_promise.py
config-host = ${request-slave-frontend:connection-domain} config-host = ${frontend-urlparse:hostname}
config-port = 443 config-port = ${frontend-urlparse:port}
{{ part('amarisoft-stats-service') }} {{ part('amarisoft-stats-service') }}
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment