Commit aa102f28 authored by Jérome Perrin's avatar Jérome Perrin

erp5testnode: use newer shellinabox, with a caddy frontend

also use a real bash and not busybox
parent ee707dc7
...@@ -18,4 +18,4 @@ md5sum = 307663d73ef3ef94b02567ecd322252e ...@@ -18,4 +18,4 @@ md5sum = 307663d73ef3ef94b02567ecd322252e
[template-default] [template-default]
filename = instance-default.cfg filename = instance-default.cfg
md5sum = 555700e5d216ff32a981f4066791bdab md5sum = 6e263ceafff581031d9d7aa2e001c43e
...@@ -9,8 +9,6 @@ extends = ${monitor2-template:rendered} ...@@ -9,8 +9,6 @@ extends = ${monitor2-template:rendered}
parts = parts =
testnode testnode
shell
shellinabox
certificate-authority certificate-authority
ca-shellinabox ca-shellinabox
ca-httpd-testnode ca-httpd-testnode
...@@ -18,11 +16,12 @@ parts = ...@@ -18,11 +16,12 @@ parts =
monitor-publish monitor-publish
testnode-frontend testnode-frontend
resiliency-exclude-file resiliency-exclude-file
shellinabox-frontend-reload
promises
[monitor-publish] [monitor-publish]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
url = https://[$${shellinabox:ipv6}]:$${shellinabox:port}/ url = $${shellinabox-frontend:url}
password = $${pwgen:passwd}
frontend-url = $${testnode-frontend:connection-secure_access} frontend-url = $${testnode-frontend:connection-secure_access}
[pwgen] [pwgen]
...@@ -73,34 +72,70 @@ apache-modules-dir = ${apache:location}/modules ...@@ -73,34 +72,70 @@ apache-modules-dir = ${apache:location}/modules
apache-mime-file = ${apache:location}/conf/mime.types apache-mime-file = ${apache:location}/conf/mime.types
apache-htpasswd = ${apache:location}/bin/htpasswd apache-htpasswd = ${apache:location}/bin/htpasswd
[shell]
recipe = slapos.cookbook:shell [shell-environment]
wrapper = $${rootdirectory:bin}/sh shell = ${bash:location}/bin/bash
shell = ${busybox:location}/bin/sh
home = $${buildout:directory}
ps1 = "\\w> "
path =
${busybox:location}/bin/
${busybox:location}/usr/bin/
${git:location}/bin/
${python2.7:location}/bin/
${buildout:bin-directory}/
${busybox:location}/sbin/
${busybox:location}/usr/sbin/
[shellinabox] [shellinabox]
recipe = slapos.cookbook:shellinabox recipe = slapos.recipe.template:jinja2
# We cannot use slapos.cookbook:wrapper here because this recipe escapes too much
socket = $${directory:run}/siab.sock
mode = 0700
rendered = $${basedirectory:services}/shellinaboxd
template = inline:
#!/bin/sh
exec ${shellinabox-github:location}/bin/shellinaboxd \
--disable-ssl \
--disable-ssl-menu \
--unixdomain-only=$${:socket}:$(id -u):$(id -g):0600 \
--service "/:$(id -u):$(id -g):HOME:$${shell-environment:shell} -l"
[shellinabox-frontend-config]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/$${:_buildout_section_name_}
template = inline:
https://$${:hostname}:$${:port} {
bind $${:ipv6}
tls $${:cert-file} $${:key-file}
gzip
log stdout
errors stderr
proxy / unix:$${shellinabox:socket}
basicauth $${:username} $${:passwd} {
realm "Test Node $${testnode:test-node-title}"
/
}
}
ipv6 = $${slap-network-information:global-ipv6} ipv6 = $${slap-network-information:global-ipv6}
hostname = [$${:ipv6}]
port = 8080 port = 8080
shell = $${shell:wrapper} username = testnode
wrapper = $${rootdirectory:bin}/shellinaboxd passwd = $${pwgen:passwd}
shellinabox-binary = ${shellinabox:location}/bin/shellinaboxd
password-file = $${pwgen:storage-path}
directory = $${buildout:directory}/
login-shell = $${rootdirectory:bin}/login
certificate-directory = $${directory:shellinabox}
cert-file = $${directory:shellinabox}/public.crt cert-file = $${directory:shellinabox}/public.crt
key-file = $${directory:shellinabox}/private.key key-file = $${directory:shellinabox}/private.key
url = https://$${:username}:$${:passwd}@$${:hostname}:$${:port}
[shellinabox-frontend]
recipe = slapos.cookbook:wrapper
wrapper-path = $${rootdirectory:bin}/$${:_buildout_section_name_}
command-line =
${caddy:output} -conf $${shellinabox-frontend-config:rendered} -pidfile $${:pidfile}
url = $${shellinabox-frontend-config:url}
hostname = $${shellinabox-frontend-config:ipv6}
port = $${shellinabox-frontend-config:port}
pidfile = $${basedirectory:run}/$${:_buildout_section_name_}.pid
[shellinabox-frontend-reload]
recipe = slapos.cookbook:wrapper
wrapper-path = $${basedirectory:services}/$${:_buildout_section_name_}
command-line =
${bash:location}/bin/bash -c
"kill -s USR1 $$(${coreutils:location}/bin/cat $${shellinabox-frontend:pidfile}) \
&& ${coreutils:location}/bin/sleep infinity"
hash-files =
$${shellinabox-frontend-config:rendered}
$${shellinabox-frontend:wrapper-path}
[certificate-authority] [certificate-authority]
recipe = slapos.cookbook:certificate_authority recipe = slapos.cookbook:certificate_authority
...@@ -124,10 +159,10 @@ crl = $${directory:ca-dir}/crl/ ...@@ -124,10 +159,10 @@ crl = $${directory:ca-dir}/crl/
[ca-shellinabox] [ca-shellinabox]
<= certificate-authority <= certificate-authority
recipe = slapos.cookbook:certificate_authority.request recipe = slapos.cookbook:certificate_authority.request
executable = $${shellinabox:wrapper} executable = $${shellinabox-frontend:wrapper-path}
wrapper = $${basedirectory:services}/shellinaboxd wrapper = $${basedirectory:services}/shellinabox-frontend
key-file = $${shellinabox:key-file} key-file = $${shellinabox-frontend-config:key-file}
cert-file = $${shellinabox:cert-file} cert-file = $${shellinabox-frontend-config:cert-file}
[ca-httpd-testnode] [ca-httpd-testnode]
<= certificate-authority <= certificate-authority
...@@ -181,6 +216,21 @@ config-https-only = true ...@@ -181,6 +216,21 @@ config-https-only = true
#software-type = custom-personal #software-type = custom-personal
return = domain secure_access return = domain secure_access
[promises]
recipe =
instance-promises =
$${shellinabox-frontend-listen-promise:path}
[check-port-listening-promise]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promises}/$${:_buildout_section_name_}
[shellinabox-frontend-listen-promise]
<= check-port-listening-promise
hostname= $${shellinabox-frontend:hostname}
port = $${shellinabox-frontend:port}
[slap-parameter] [slap-parameter]
node-quantity = 1 node-quantity = 1
test-suite-master-url = test-suite-master-url =
......
...@@ -5,7 +5,9 @@ extends = ...@@ -5,7 +5,9 @@ extends =
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/zip/buildout.cfg ../../component/zip/buildout.cfg
../../component/busybox/buildout.cfg ../../component/bash/buildout.cfg
../../component/caddy/buildout.cfg
../../component/coreutils/buildout.cfg
../../component/shellinabox/buildout.cfg ../../component/shellinabox/buildout.cfg
../../component/pwgen/buildout.cfg ../../component/pwgen/buildout.cfg
../../component/apache/buildout.cfg ../../component/apache/buildout.cfg
...@@ -27,6 +29,7 @@ eggs = ...@@ -27,6 +29,7 @@ eggs =
zc.buildout zc.buildout
slapos.libnetworkcache slapos.libnetworkcache
slapos.core slapos.core
slapos.recipe.template
supervisor supervisor
jsonschema jsonschema
hexagonit.recipe.download hexagonit.recipe.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