Commit 3afea6b3 authored by Eric Zheng's avatar Eric Zheng

software/headless-chromium: add frontend monitoring promise

parent c7c594e6
[template-cfg]
filename = instance.cfg.in
md5sum = cf56bcbabe4dfc8eed62d9687c06925f
md5sum = aadc99d22fc3bcb38c852810370ceaac
[instance-headless-chromium]
_update_hash_filename_ = instance-headless-chromium.cfg.in
md5sum = fec4df50959e9c8c6cd25f5e4e905b63
md5sum = 5e7f9536c2ca28435dccb1fd0bff5bc9
[template-nginx-conf]
_update_hash_filename_ = templates/nginx.conf.in
......
......@@ -7,6 +7,7 @@ parts =
nginx-config
nginx-launcher
publish-connection-information
frontend-promise
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
......@@ -45,7 +46,7 @@ nginx-cert-file = ${frontend-instance-certificate:cert-file}
# TODO: change --remote-debugging-address to actual IP address?
[chromium-launcher]
recipe = slapos.cookbook:wrapper
command-line = {{ parameter_list['chromium-wrapper'] }} --remote-debugging-address=${headless-chromium:ipv4} --remote-debugging-port=${headless-chromium:remote-debugging-port} --no-sandbox ${headless-chromium:url}
command-line = {{ parameter_list['chromium-wrapper'] }} --remote-debugging-address=${headless-chromium:ipv4} --remote-debugging-port=${headless-chromium:remote-debugging-port} --no-sandbox ${headless-chromium:url}
wrapper-path = ${directory:service}/chromium
environment =
FONTCONFIG_FILE=${font-config:rendered}
......@@ -119,6 +120,7 @@ environment =
[publish-connection-information]
recipe = slapos.cookbook:publish
<= monitor-publish
remote-debug-url = http://${headless-chromium:remote-debugging-address}
proxy-url = https://${headless-chromium:proxy-address}
frontend-url = ${remote-debugging-frontend:connection-secure_access}
......@@ -137,3 +139,36 @@ config-https-only = true
config-type = websocket
config-websocket-path-list = /devtools
return = domain secure_access
# Old-style promise to make sure that the CDN is properly configured.
[frontend-promise]
<= monitor-promise-base
module = check_url_available
name = headless-chromium-frontend.py
config-url = ${remote-debugging-frontend:connection-secure_access}
config-check-secure = 1
# The following is the new-style promise, for when
# https://lab.nexedi.com/nexedi/slapos.toolbox/merge_requests/98 gets
# merged.
# Promise to make sure the remote debugging frontend returns 200 when
# queried with the correct credentials.
# [frontend-200-promise]
# <= monitor-promise-base
# module = check_url_available
# name = headless-chromium-frontend-ok.py
# url = ${remote-debugging-frontend:connection-secure_access}
# config-url = ${:url}
# config-username = ${frontend-instance-password:username}
# config-password = ${frontend-instance-password:passwd}
# Promise to make sure that the remote debugging frontend returns 401
# when queried with no credentials.
# [frontend-401-promise]
# <= monitor-promise-base
# module = check_url_available
# name = headless-chromium-frontend-secure.py
# url = ${remote-debugging-frontend:connection-secure_access}
# config-url = ${:url}
# config-http-code = 401
......@@ -14,6 +14,7 @@ fontconfig-location = {{ fontconfig_location }}
chromium-wrapper = {{ chromium_wrapper }}
template-nginx-config = {{ template_nginx_config_target }}
template-fonts-conf = {{ template_fonts_conf_target }}
template-monitor = {{ template_monitor }}
[instance-headless-chromium]
recipe = slapos.recipe.template:jinja2
......
......@@ -2,6 +2,7 @@
extends =
buildout.hash.cfg
../../stack/slapos.cfg
../../stack/monitor/buildout.cfg
# TODO: remove "test" once everything is ready
../../component/headless-chromium-test/buildout.cfg
../../component/openssl/buildout.cfg
......@@ -28,6 +29,7 @@ context =
key template_nginx_config_target template-nginx-conf:target
key template_fonts_conf_target template-fonts-conf:output
key template_instance_headless_chromium_target instance-headless-chromium:target
key template_monitor monitor2-template:rendered
[download-base]
recipe = slapos.recipe.build:download
......
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