instance-default.cfg 7.54 KB
Newer Older
1 2
[buildout]

3

4 5 6 7
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true

8 9
extends = ${monitor2-template:rendered}

10 11 12 13
parts =
  testnode
  certificate-authority
  ca-shellinabox
14
  ca-httpd-testnode
15 16
  monitor-base
  monitor-publish
17
  testnode-frontend
18
  resiliency-exclude-file
19 20
  shellinabox-frontend-reload
  promises
21 22
  
[monitor-publish]
23
recipe = slapos.cookbook:publish
24
url = $${shellinabox-frontend:url}
Ivan Tyagov's avatar
Ivan Tyagov committed
25
frontend-url = $${testnode-frontend:connection-secure_access}
26 27

[pwgen]
28 29
recipe = slapos.cookbook:generate.password
storage-path = $${buildout:directory}/.password
30 31 32 33 34 35

[testnode]
recipe = slapos.cookbook:erp5testnode
slapos-directory = $${directory:slapos}
working-directory = $${directory:testnode}
test-suite-directory = $${directory:test-suite}
36
proxy-host = $${slap-network-information:local-ipv4}
37 38
proxy-port = 5000
log-directory = $${directory:log}
39 40
srv-directory = $${rootdirectory:srv}
software-directory = $${directory:software}
41 42 43 44 45 46 47
run-directory = $${directory:run}
test-node-title = $${slap-parameter:test-node-title}
node-quantity = $${slap-parameter:node-quantity}
ipv4-address = $${slap-network-information:local-ipv4}
ipv6-address = $${slap-network-information:global-ipv6}
test-suite-master-url = $${slap-parameter:test-suite-master-url}
instance-dict = $${slap-parameter:instance-dict}
48
software-path-list = $${slap-parameter:software-path-list}
49
git-binary = ${git:location}/bin/git
50
slapos-binary = ${buildout:bin-directory}/slapos
51 52
testnode = ${buildout:bin-directory}/testnode
zip-binary = ${zip:location}/bin/zip
53 54 55
httpd-pid-file = $${basedirectory:run}/httpd.pid
httpd-lock-file = $${basedirectory:run}/httpd.lock
httpd-conf-file = $${rootdirectory:etc}/httpd.conf
56
httpd-wrapper = $${rootdirectory:bin}/httpd
57
httpd-port = 9080
58
httpd-software-access-port = 9081
59
httpd-ip = $${slap-network-information:global-ipv6}
60
httpd-log-directory = $${basedirectory:log}
61
httpd-software-directory = $${directory:software}
62 63
httpd-cert-file = $${rootdirectory:etc}/httpd-public.crt
httpd-key-file = $${rootdirectory:etc}/httpd-private.key
64 65 66 67 68

configuration-file = $${rootdirectory:etc}/erp5testnode.cfg
log-file = $${basedirectory:log}/erp5testnode.log
wrapper = $${basedirectory:services}/erp5testnode

69 70
# Binaries
apache-binary = ${apache:location}/bin/httpd
71
apache-modules-dir = ${apache:location}/modules
72 73 74
apache-mime-file = ${apache:location}/conf/mime.types
apache-htpasswd = ${apache:location}/bin/htpasswd

75 76 77

[shell-environment]
shell = ${bash:location}/bin/bash
78 79

[shellinabox]
80 81 82 83 84 85 86
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
87
  exec ${shellinabox:location}/bin/shellinaboxd \
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
    --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}"
      /
    }
  }
107
ipv6 = $${slap-network-information:global-ipv6}
108
hostname = [$${:ipv6}]
109
port = 8080
110 111
username = testnode
passwd = $${pwgen:passwd}
112 113
cert-file = $${directory:shellinabox}/public.crt
key-file = $${directory:shellinabox}/private.key
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
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}
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159

[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:ca-dir}
requests-directory = $${cadirectory:requests}
wrapper = $${basedirectory:services}/ca
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}

[cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:ca-dir}/requests/
private = $${directory:ca-dir}/private/
certs = $${directory:ca-dir}/certs/
newcerts = $${directory:ca-dir}/newcerts/
crl = $${directory:ca-dir}/crl/

[ca-shellinabox]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
160 161 162 163
executable = $${shellinabox-frontend:wrapper-path}
wrapper = $${basedirectory:services}/shellinabox-frontend
key-file = $${shellinabox-frontend-config:key-file}
cert-file = $${shellinabox-frontend-config:cert-file}
164

165
[ca-httpd-testnode]
166 167 168 169 170 171 172
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
executable = $${testnode:httpd-wrapper}
wrapper = $${basedirectory:services}/httpd
key-file = $${testnode:httpd-key-file}
cert-file = $${testnode:httpd-cert-file}

173 174
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
175 176 177 178 179
etc = $${buildout:directory}/etc
var = $${buildout:directory}/var
srv = $${buildout:directory}/srv
bin = $${buildout:directory}/bin
tmp = $${buildout:directory}/tmp
180 181 182

[basedirectory]
recipe = slapos.cookbook:mkdirectory
183
log = $${rootdirectory:var}/log
184
services = $${rootdirectory:etc}/service
185 186
run = $${rootdirectory:var}/run
promises = $${rootdirectory:etc}/promise
187 188 189

[directory]
recipe = slapos.cookbook:mkdirectory
190 191 192 193 194
slapos = $${rootdirectory:srv}/slapos
testnode = $${rootdirectory:srv}/testnode
test-suite = $${rootdirectory:srv}/test_suite
log = $${basedirectory:log}/testnode
run = $${basedirectory:run}/testnode
195
software = $${rootdirectory:srv}/software
196 197
shellinabox = $${rootdirectory:srv}/shellinabox
ca-dir = $${rootdirectory:srv}/ca
198

199 200 201 202 203 204
[resiliency-exclude-file]
# Generate rdiff exclude file in case of resiliency
recipe = collective.recipe.template
input = inline: **
output = $${directory:srv}/exporter.exclude

205 206 207 208 209 210 211 212 213 214 215 216
[testnode-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Test Node Frontend $${testnode:test-node-title}
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config-url = https://[$${testnode:httpd-ip}]:$${testnode:httpd-software-access-port}
config-https-only = true
#software-type = custom-personal
return = domain secure_access

217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
[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}


232 233 234 235
[slap-parameter]
node-quantity = 1
test-suite-master-url =
instance-dict =
236
software-path-list = ["https://lab.nexedi.com/nexedi/slapos/raw/master/software/seleniumrunner/software.cfg"]