Commit a209aa5c authored by Eric Zheng's avatar Eric Zheng

software/headless-chromium: make parameters configurable

parent 99335919
[template-cfg]
filename = instance.cfg.in
md5sum = 7dee90f9586279de6f6473a74fee8b45
md5sum = f6f78c811140a25521c3a1a6009b2c87
[instance-headless-chromium]
_update_hash_filename_ = instance_headless-chromium.cfg.in
md5sum = 35f843826ed1307845f1530cacebb1c7
md5sum = c009446e9081d76ba086d0fe5ff0723f
[template-nginx-conf]
_update_hash_filename_ = templates/nginx.conf.in
......
......@@ -23,6 +23,14 @@ context =
section buildout buildout
section parameter_list profile-common
key partition_ipv6 slap-configuration:ipv6-random
key slapparameter_dict slap-configuration:configuration
jsonkey default_parameter_dict :default-parameters
default-parameters =
{
"remote-debugging-port": 8081,
"nginx-proxy-port": 8082,
"target-url": "https://www.example.com"
}
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
......
{% set parameter_dict = dict(default_parameter_dict, **slapparameter_dict) %}
[buildout]
parts =
chromium-launcher
......@@ -20,11 +22,11 @@ service = ${:etc}/service
[headless-chromium]
ip = {{ partition_ipv6 }}
remote-debugging-port = 9222
url = https://example.com
remote-debugging-port = {{ parameter_dict['remote-debugging-port'] }}
url = {{ parameter_dict['target-url'] }}
remote-debug-url = http://[${:ip}]:${:remote-debugging-port}
nginx-port = 9345
nginx-port = {{ parameter_dict['nginx-proxy-port'] }}
proxy-url = http://[${:ip}]:${:nginx-port}
nginx-config-target = ${directory:etc}/nginx.conf
nginx-pid-path = ${directory:log}/nginx.pid
......@@ -33,9 +35,10 @@ nginx-error-log = ${directory:log}/nginx-error.log
nginx-access-log = ${directory:log}/nginx-access.log
# Create a launcher script for the headless shell executable.
# TODO: get rid of --no-sandbox after testing is done
[chromium-launcher]
recipe = slapos.cookbook:wrapper
command-line = {{ parameter_list['chromium-wrapper'] }} --remote-debugging-address=:: --remote-debugging-port=${headless-chromium:remote-debugging-port} ${headless-chromium:url}
command-line = {{ parameter_list['chromium-wrapper'] }} --remote-debugging-address=:: --remote-debugging-port=${headless-chromium:remote-debugging-port} --no-sandbox ${headless-chromium:url}
wrapper-path = ${directory:service}/chromium
environment =
FONTCONFIG_FILE=${font-config:rendered}
......
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