instance-tidstorage.cfg.in 21.1 KB
Newer Older
1
{% if software_type == slap_software_type -%}
2 3 4 5 6
{#
Note: all port counters are pre-incremented. No idea why base port is skipped.
-#}
{% set current_zeo_port = zeo_port_base | int -%}
{% set zope_port_base = zope_port_base | int -%}
7
{% set zope_dummy_list = [] -%}
8 9
{% set current_apache_port = apache_port_base | int -%}
{% set current_haproxy_port = haproxy_port_base | int -%}
10
{% set current_squid_port = squid_port_base | int -%}
11 12 13
{% set json = json_module.loads(slapparameter_dict['json']) -%}
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
{#
14 15 16 17 18 19
XXX: This template only supports exactly one IPv4 and one IPv6 per
partition. No more (undefined result), no less (IndexError).
-#}
{% set ipv4 = (ipv4_set | list)[0] -%}
{% set ipv6 = (ipv6_set | list)[0] -%}
{#
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
BBB: erp5-ca['state'] has been configured as string by mistake. Keep this for
backward compatibility with existing automatically setup CAs.
-#}
{% set erp5_ca = json.get('erp5-ca', {
  'country-code': 'ZZ',
  'email': 'nobody@example.com',
  'state': "('State',)",
  'city': 'City',
  'company': 'Company',
}) -%}
{% set site_id = json['site-id'] -%}
{% set part_list = [] -%}
{% set known_tid_storage_identifier_dict = {} -%}
{% set zodb_connection_list = [] -%}
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
{% macro zope(
  name,
  thread_amount=1,
38
  timerserver_interval=0,
39 40 41 42
  longrequest_logger_file='',
  longrequest_logger_timeout='',
  longrequest_logger_interval=''
) -%}
43
{% set conf_name = name ~ '-conf' -%}
44
{% set conf_parameter_name = conf_name ~ '-param' -%}
45 46
[{{ conf_parameter_name }}]
< = zope-conf-parameter-base
47 48
pid-file = ${directory:run}/{{ name }}.pid
lock-file = ${directory:run}/{{ name }}.lock
49 50
{% do zope_dummy_list.append(None) -%}
{% set offset = zope_dummy_list | length -%}
51 52
port = {{ zope_port_base + offset }}
thread-amount = {{ thread_amount }}
53 54 55
{% if timerserver_interval -%}
timerserver-interval = {{ timerserver_interval }}
{% endif -%}
56 57
event-log = ${directory:log}/{{ name }}-event.log
z2-log = ${directory:log}/{{ name }}-Z2.log
58 59 60

[{{ conf_name }}]
< = zope-conf-base
61
rendered = ${directory:etc}/{{ name }}.conf
62 63 64 65 66
extra-context =
  section parameter_dict {{ conf_parameter_name }}

[{{ section(name) }}]
< = zope-base
67 68 69
longrequest-logger-file = {{ longrequest_logger_file }}
longrequest-logger-timeout = {{ longrequest_logger_timeout }}
longrequest-logger-interval = {{ longrequest_logger_interval }}
70
wrapper = ${directory:services}/{{ name }}
71 72
configuration-file = {{ '${' ~ conf_name ~ ':rendered}' }}
port = {{ '${' ~ conf_parameter_name ~ ':port}' }}
73

74
[{{ section('logrotate-entry-' ~ name) }}]
75 76 77
< = logrotate-base
recipe = slapos.cookbook:logrotate.d
name = {{ name }}
78 79
log = {{ '${' ~ conf_parameter_name ~ ':event-log}' }} {{ '${' ~ conf_parameter_name ~ ':z2-log}' }}
post = {{ bin_directory }}/killpidfromfile {{ '${' ~ conf_parameter_name ~ ':pid-file}' }} SIGUSR2
80 81 82 83 84 85
{% endmacro -%}
#############################
# Directory creation
#############################
[directory]
recipe = slapos.cookbook:mkdirectory
86 87 88 89 90 91 92 93 94 95 96 97
apache-conf = ${:etc}/apache
backup = ${:srv}/backup
bin = ${buildout:directory}/bin
ca-dir = ${:srv}/ssl
cron-entries = ${:etc}/cron.d
cronstamps = ${:etc}/cronstamps
crontabs = ${:etc}/crontabs
erp5-ca-dir = ${:srv}/erp5-ssl
etc = ${buildout:directory}/etc
instance = ${:srv}/erp5shared
instance-constraint = ${:instance}/Constraint
instance-document = ${:instance}/Document
98 99 100 101 102
instance-etc = ${:instance}/etc
instance-etc-package-include = ${:instance}/etc/package-include
instance-extensions = ${:instance}/Extensions
instance-import = ${:instance}/import
instance-lib = ${:instance}/lib
103 104
instance-products = ${:instance}/Products
instance-propertysheet = ${:instance}/PropertySheet
105
instance-tests = ${:instance}/tests
106 107 108 109 110 111 112 113 114 115 116
log = ${:var}/log
logrotate-backup = ${:backup}/logrotate
logrotate-entries = ${:etc}/logrotate.d
run = ${:var}/run
services = ${:etc}/run
srv = ${buildout:directory}/srv
tidstorage = ${:srv}/tidstorage
tmp = ${buildout:directory}/tmp
var = ${buildout:directory}/var
zodb = ${:srv}/zodb
zodb-backup = ${:backup}/zodb
117
erp5-ca-dir-backup = ${:backup}/erp5-ca-dir
118 119 120 121 122 123

#############################
# Binary symlinking
#############################
[binary-link]
recipe = slapos.cookbook:symbolic.link
124
target-directory = ${directory:bin}
125
link-binary =
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
  {{ parameter_dict['coreutils'] }}/bin/basename
  {{ parameter_dict['coreutils'] }}/bin/cat
  {{ parameter_dict['coreutils'] }}/bin/cp
  {{ parameter_dict['coreutils'] }}/bin/ls
  {{ parameter_dict['coreutils'] }}/bin/tr
  {{ parameter_dict['coreutils'] }}/bin/uname
  {{ parameter_dict['git'] }}/bin/git
  {{ parameter_dict['graphviz'] }}/bin/dot
  {{ parameter_dict['grep'] }}/bin/grep
  {{ parameter_dict['imagemagick'] }}/bin/convert
  {{ parameter_dict['imagemagick'] }}/bin/identify
  {{ parameter_dict['mariadb'] }}/bin/mysql
  {{ parameter_dict['mariadb'] }}/bin/mysqldump
  {{ parameter_dict['pdftk'] }}/bin/pdftk
  {{ parameter_dict['sed'] }}/bin/sed
  {{ parameter_dict['tesseract'] }}/bin/tesseract
  {{ parameter_dict['w3m'] }}/bin/w3m
  {{ parameter_dict['poppler'] }}/bin/pdfinfo
144
  {{ parameter_dict['poppler'] }}/bin/pdfseparate
145 146
  {{ parameter_dict['poppler'] }}/bin/pdftotext
  {{ parameter_dict['poppler'] }}/bin/pdftohtml
147
  {{ parameter_dict['poppler'] }}/bin/pdfunite
148
  {{ parameter_dict['dmtx-utils'] }}/bin/dmtxwrite
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165

#############################
# CA
#############################
[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

[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = {{ parameter_dict['openssl'] }}/bin/openssl
ca-dir = ${directory:ca-dir}
requests-directory = ${cadirectory:requests}
166
wrapper = ${directory:services}/ca
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
ca-private = ${cadirectory:private}
ca-certs = ${cadirectory:certs}
ca-newcerts = ${cadirectory:newcerts}
ca-crl = ${cadirectory:crl}

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

[erp5-certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = {{ parameter_dict['openssl'] }}/bin/openssl
ca-dir = ${directory:erp5-ca-dir}
requests-directory = ${erp5-cadirectory:requests}
188
wrapper = ${directory:services}/erp5-ca
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
ca-private = ${erp5-cadirectory:private}
ca-certs = ${erp5-cadirectory:certs}
ca-newcerts = ${erp5-cadirectory:newcerts}
ca-crl = ${erp5-cadirectory:crl}
country-code = {{ erp5_ca['country-code'] }}
email = {{ erp5_ca['email'] }}
state = {{ erp5_ca['state'] }}
city = {{ erp5_ca['city'] }}
company = {{ erp5_ca['company'] }}

#############################
# CRON
#############################
[cron-base]
cron-entries = ${directory:cron-entries}

[cron]
< = cron-base
recipe = slapos.cookbook:cron
dcrond-binary = {{ parameter_dict['dcron'] }}/sbin/crond
crontabs = ${directory:crontabs}
cronstamps = ${directory:cronstamps}
catcher = ${cron-simplelogger:wrapper}
212
binary = ${directory:services}/crond
213 214 215

[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
216 217
wrapper = ${directory:bin}/cron_simplelogger
log = ${directory:log}/cron.log
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233

#############################
# Logrotate
#############################
[logrotate-base]
logrotate-entries = ${directory:logrotate-entries}
backup = ${directory:logrotate-backup}

[logrotate]
< = logrotate-base
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = {{ parameter_dict['logrotate'] }}/usr/sbin/logrotate
gzip-binary = {{ parameter_dict['gzip'] }}/bin/gzip
gunzip-binary = {{ parameter_dict['gzip'] }}/bin/gunzip
# Directories
234 235 236
wrapper = ${directory:bin}/logrotate
conf = ${directory:etc}/logrotate.conf
state-file = ${directory:srv}/logrotate.status
237 238 239 240 241 242 243 244 245 246 247 248 249

[cron-entry-logrotate]
< = cron-base
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 0 0 * * *
command = ${logrotate:wrapper}

#############################
# ERP5 bootstrap
#############################
[erp5-bootstrap]
recipe = slapos.cookbook:erp5.bootstrap
250
runner-path = ${directory:services}/erp5-bootstrap
251 252 253 254 255 256 257 258
mysql-url = {{ slapparameter_dict['mysql-url'] }}
zope-url = http://${zope-admin:user}:${zope-admin:password}@${zope-admin:ip}:${zope-admin:port}/{{ site_id }}

#############################
# ERP5 promise
#############################
[erp5-promise]
recipe = slapos.cookbook:erp5.promise
259
promise-path = ${directory:etc}/erp5promise.cfg
260 261 262 263 264 265 266 267 268 269 270 271
kumofs-url = {{ slapparameter_dict['kumofs-url'] }}
memcached-url = {{ slapparameter_dict['memcached-url'] }}
cloudooo-url = {{ slapparameter_dict['cloudooo-url'] }}
smtp-url = ${slap-parameter:smtp-url}
bt5 = ${slap-parameter:bt5}
bt5-repository-url = ${slap-parameter:bt5-repository-url}

#############################
# ZEO
#############################
[zeo-instance-entry-common]
recipe = slapos.cookbook:zeo
272
ip = {{ ipv4 }}
273 274 275
binary-path = {{ bin_directory }}/runzeo

{% for zeo_id, zeo_configuration_list in json['zeo'].iteritems() -%}
276
{%   set current_zeo_port = current_zeo_port + 1 -%}
277 278
{%   set storage_list = [] -%}
{%   for zeo_slave in zeo_configuration_list -%}
279 280 281 282 283 284 285 286 287 288 289 290
{%     do zodb_connection_list.append((
         zeo_slave['storage-name'],
         zeo_slave['mount-point'] % {'site-id': site_id},
         zeo_slave['zope-cache-size'],
         'zeoclient',
         {
           'cache-size': zeo_slave['zeo-cache-size'],
           'server': ipv4 ~ ':' ~ current_zeo_port,
           'storage': zeo_slave['storage-name'],
           'name': zeo_slave['storage-name'],
         },
       )) -%}
291
{%     set zodb_path = '${directory:zodb}/' ~ zeo_slave['storage-name'] ~ '.fs' -%}
292
{%     do storage_list.append('storage-name=%(storage-name)s zodb-path=%(zodb-path)s' % {'zodb-path': zodb_path, 'storage-name': zeo_slave['storage-name']}) -%}
293 294 295 296
{%     do known_tid_storage_identifier_dict.__setitem__("((('${zeo-instance-%(zeo_id)s:ip}', ${zeo-instance-%(zeo_id)s:port}),), '%(storage_name)s')" % {
         'zeo_id': zeo_id,
         'storage_name': zeo_slave['storage-name']
       }, (zodb_path, '${directory:zodb-backup}/%s/' % zeo_slave['storage-name'], zeo_slave['serialize-path'] % {'site-id': site_id})) -%}
297 298 299
{%   endfor -%}
[{{ section('zeo-instance-%s' % zeo_id) }}]
< = zeo-instance-entry-common
300 301 302
log-path = ${directory:log}/zeo-{{ zeo_id }}.log
pid-path = ${directory:run}/zeo-{{ zeo_id }}.pid
conf-path = ${directory:etc}/zeo-{{ zeo_id }}.conf
303 304 305
port = {{ current_zeo_port }}
storage =
  {{ storage_list | join('\n  ') }}
306
wrapper-path = ${directory:services}/zeo-{{ zeo_id }}
307 308 309 310 311 312 313

[{{ section('logrotate-entry-zeo-%s' % zeo_id) }}]
< = logrotate-base
recipe = slapos.cookbook:logrotate.d
name = zeo-{{ zeo_id }}
log = ${zeo-instance-{{ zeo_id }}:log-path}
post = {{ bin_directory }}/killpidfromfile ${zeo-instance-{{ zeo_id }}:pid-path} SIGUSR2
314 315

{% endfor -%}
316 317 318
#############################
# Zope
#############################
319 320 321
[zope-base]
recipe = slapos.cookbook:generic.zope.zeo.client
user = zope
322
ip = {{ ipv4 }}
323 324 325 326
timezone = {{ json['timezone'] }}
tidstorage-ip = ${tidstorage:ip}
tidstorage-port = ${tidstorage:port}
instance-etc = ${directory:instance-etc}
327 328 329
bt5-repository = ${directory:var}/bt5_repository
tmp-path = ${directory:tmp}
bin-path = ${directory:bin}
330
site-zcml = ${:instance-etc}/site.zcml
331
inituser = ${directory:instance}/inituser
332 333
runzope-binary = {{ bin_directory }}/runzope
bt5-repository-list =
334 335 336 337 338 339

[deadlock-debugger-password]
recipe = slapos.cookbook:pwgen.stable

[zope-conf-parameter-base]
ip = {{ ipv4 }}
340
site-id = {{ site_id }}
341
zodb-list = {{ dumps(zodb_connection_list) }}
342 343 344 345 346 347 348 349 350 351 352 353 354 355

[zope-conf-base]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['zope-conf-template'] }}
extra-context =
context =
  key instance directory:instance
  key instance_products directory:instance-products
  raw deadlock_path /manage_debug_threads
  key deadlock_debugger_password deadlock-debugger-password:password
  key tidstorage_ip tidstorage:ip
  key tidstorage_port tidstorage:port
  key promise_path erp5-promise:promise-path
  ${:extra-context}
356

357
# Distribution node
358
{{ zope('zope-distribution', timerserver_interval=1) }}
359 360 361 362
# Admin node
{{ zope('zope-admin') }}
# Activity nodes
{% for q in range(1, json['activity']['zopecount'] + 1) -%}
363
{{   zope('zope-activity-%s' % q, timerserver_interval=1) }}
364
{%- endfor %}
365 366 367 368 369
# Other zopes, apaches and haproxies
{% set publish_url_list =  [] -%}
{% for backend_name, backend_configuration in json['backend'].iteritems() -%}
{%   set haproxy_backend_list = [] -%}
{%   set longrequest_logger = backend_configuration.get('longrequest-logger') -%}
370
{%   set http_cache = backend_configuration.get('http-cache', False) -%}
371 372 373
{%   for q in range(1, backend_configuration['zopecount'] + 1) -%}
{%     set part_name = 'zope-%s-%s' % (backend_name, q) -%}
{%     if longrequest_logger != None -%}
374
{%       set longrequest_logger_file = '${directory:log}/%s-longrequest.log' % (part_name, ) -%}
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
{%       set longrequest_logger_timeout = longrequest_logger.get('timeout', '4') -%}
{%       set longrequest_logger_interval = longrequest_logger.get('interval', '2') -%}
{%     else -%}
{%       set longrequest_logger_file = '' -%}
{%       set longrequest_logger_timeout = '' -%}
{%       set longrequest_logger_interval = '' -%}
{%     endif -%}
{{     zope(
         part_name,
         thread_amount=backend_configuration['thread-amount'],
         longrequest_logger_file=longrequest_logger_file,
         longrequest_logger_timeout=longrequest_logger_timeout,
         longrequest_logger_interval=longrequest_logger_interval,
       ) }}
{%     do haproxy_backend_list.append('${%(part_name)s:ip}:${%(part_name)s:port}' % {'part_name': part_name}) -%}
390
{%  endfor -%}
391 392 393
{%   set scheme = backend_configuration.get('scheme', ['https']) -%}
{%   set current_apache_port = current_apache_port + 2 -%}
{%   set current_haproxy_port = current_haproxy_port + 1 -%}
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
{%   set current_squid_port = current_squid_port + 1 -%}

{%   set apache_rewrite_to = 'haproxy' -%}
{%     if http_cache -%}
{%   set apache_rewrite_to = 'squid' -%}
[{{ 'squid-' ~ backend_name ~ '-directory' }}]
recipe = slapos.cookbook:mkdirectory
cache-path = ${directory:var}/squid-{{ backend_name }}

[{{ section('squid-' ~ backend_name) }}]
recipe = slapos.cookbook:squid
prepare-path = ${directory:services}/squid-{{ backend_name }}-prepare
wrapper-path = ${directory:services}/squid-{{ backend_name }}
binary-path = {{ parameter_dict['squid'] }}/sbin/squid
conf-path = ${directory:etc}/squid-{{ backend_name }}.cfg
cache-path = ${squid-{{ backend_name }}-directory:cache-path}
ip = {{ ipv4 }}
port = {{ current_squid_port }}
backend-ip = ${haproxy-{{ backend_name }}:ip}
backend-port = ${haproxy-{{ backend_name }}:port}
access-log-path = ${directory:log}/squid-{{ backend_name }}-access.log
cache-log-path = ${directory:log}/squid-{{ backend_name }}-cache.log
pid-filename-path = ${directory:run}/squid-{{ backend_name }}.pid
{%     endif -%}

419 420 421 422 423 424 425 426 427
{%   if 'http' in scheme -%}
{%     set section_name = 'apache-public-' ~ backend_name -%}
{%     do publish_url_list.append(
         'url-public-%(backend_name)s = http://[${%(section_name)s:ip}]:${%(section_name)s:port}' % {
         'backend_name': backend_name,
         'section_name': section_name,
       }) -%}
[{{ section(section_name) }}]
recipe = slapos.cookbook:apache.zope.backend
428
backend = http://{{ '${' ~ apache_rewrite_to }}-{{ backend_name }}:ip}:{{ '${' ~ apache_rewrite_to }}-{{ backend_name }}:port}
429
ip = {{ ipv6 }}
430 431
port = {{ current_apache_port }}
scheme = http
432
wrapper = ${directory:services}/apache-public-{{ backend_name }}
433 434
configuration-file = ${directory:apache-conf}/apache-public-{{ backend_name }}.conf
access-control-string = {{ backend_configuration['access-control-string'] }}
435 436 437 438
pid-file = ${directory:run}/apache-public-{{ backend_name }}.pid
lock-file = ${directory:run}/apache-public-{{ backend_name }}.lock
error-log = ${directory:log}/apache-public-{{ backend_name }}-error.log
access-log = ${directory:log}/apache-public-{{ backend_name }}-access.log
439 440 441 442 443 444 445 446
apache-binary = {{ parameter_dict['apache'] }}/bin/httpd

[{{ section('logrotate-entry-apache-public-' ~ backend_name) }}]
< = logrotate-base
recipe = slapos.cookbook:logrotate.d
name = apache-public-{{ backend_name }}
log = ${apache-public-{{ backend_name }}:error-log} ${apache-public-{{ backend_name }}:access-log}
post = {{ bin_directory }}/killpidfromfile ${apache-public-{{ backend_name }}:pid-file} SIGUSR1
447
{%   endif -%}
448 449


450 451 452 453 454 455 456 457 458
{%   if 'https' in scheme -%}
{%     set section_name = 'apache-' ~ backend_name -%}
{%     do publish_url_list.append(
         'url-%(backend_name)s = https://[${%(section_name)s:ip}]:${%(section_name)s:port}' % {
         'backend_name': backend_name,
         'section_name': section_name,
       }) -%}
[{{ section(section_name) }}]
recipe = slapos.cookbook:apache.zope.backend
459
backend = http://{{ '${' ~ apache_rewrite_to }}-{{ backend_name }}:ip}:{{ '${' ~ apache_rewrite_to }}-{{ backend_name }}:port}
460
ip = {{ ipv6 }}
461
port = {{ current_apache_port - 1 }}
462
wrapper = ${directory:bin}/apache-{{ backend_name }}
463 464 465 466 467
scheme = https
key-file = ${directory:apache-conf}/apache-{{ backend_name }}.key
cert-file = ${directory:apache-conf}/apache-{{ backend_name }}.crt
configuration-file = ${directory:apache-conf}/apache-{{ backend_name }}.conf
access-control-string = {{ backend_configuration['access-control-string'] }}
468 469 470 471 472
pid-file = ${directory:run}/apache-{{ backend_name }}.pid
lock-file = ${directory:run}/apache-{{ backend_name }}.lock
ssl-session-cache = $${directory:log}/apache-ssl-session-cache
error-log = ${directory:log}/apache-{{ backend_name }}-error.log
access-log = ${directory:log}/apache-{{ backend_name }}-access.log
473 474 475 476 477 478 479 480 481 482 483 484 485
apache-binary = {{ parameter_dict['apache'] }}/bin/httpd
ssl-authentication = {{ backend_configuration.get('ssl-authentication', False) }}
backend-path = {{ backend_configuration.get('backend-path', '/') % {'site-id': site_id} }}
# Note: Without erp5-certificate-authority main certificate have to be hardcoded
ssl-authentication-certificate = ${erp5-certificate-authority:ca-dir}/cacert.pem
ssl-authentication-crl = ${erp5-certificate-authority:ca-crl}

[{{ section('ca-apache-' ~ backend_name) }}]
< = certificate-authority
recipe = slapos.cookbook:certificate_authority.request
key-file = ${apache-{{ backend_name }}:key-file}
cert-file = ${apache-{{ backend_name }}:cert-file}
executable = ${apache-{{ backend_name }}:wrapper}
486
wrapper = ${directory:services}/apache-{{ backend_name }}
487 488 489 490 491 492 493 494 495 496 497

[{{ section('logrotate-entry-apache-' ~ backend_name) }}]
< = logrotate-base
recipe = slapos.cookbook:logrotate.d
name = apache-{{ backend_name }}
log = ${apache-{{ backend_name }}:error-log} ${apache-{{ backend_name }}:access-log}
post = {{ bin_directory }}/killpidfromfile ${apache-{{ backend_name }}:pid-file} SIGUSR1

[{{ section('haproxy-' ~ backend_name) }}]
recipe = slapos.cookbook:haproxy
name = {{ backend_name }}
498
conf-path = ${directory:etc}/haproxy-{{ backend_name }}.cfg
499
ip = {{ ipv4 }}
500 501 502
port = {{ current_haproxy_port }}
maxconn = {{ backend_configuration['maxconn'] }}
server-check-path = /{{ site_id }}/getId
503
wrapper-path = ${directory:services}/haproxy-{{ backend_name }}
504 505
binary-path = {{ parameter_dict['haproxy'] }}/sbin/haproxy
backend-list = {{ haproxy_backend_list | join(' ')}}
506 507
{%-  endif %}
{% endfor -%}
508 509 510 511 512 513 514 515 516 517 518
[{{ section('publish-apache-backend-list') }}]
recipe = slapos.cookbook:publish
{{ publish_url_list | join('\n') }}

#############################
# tidstorage
#############################
[tidstorage]
recipe = slapos.cookbook:tidstorage
known-tid-storage-identifier-dict = {{ known_tid_storage_identifier_dict }}
base-url = http://${zope-admin:ip}:${zope-admin:port}/%s/serialize
519
configuration-path = ${directory:etc}/tidstorage.py
520
ip = {{ ipv4 }}
521 522
port = 6001
timestamp-file-path = ${directory:tidstorage}/repozo_tidstorage_timestamp.log
523 524
logfile-name = ${directory:log}/tidstorage.log
pidfile-name = ${directory:run}/tidstorage.pid
525 526 527 528
status-file = ${directory:tidstorage}/tidstorage.tid
tidstorage-repozo-binary = {{ bin_directory }}/tidstorage_repozo
tidstoraged-binary = {{ bin_directory }}/tidstoraged
repozo-binary = {{ bin_directory }}/repozo
529
tidstorage-wrapper = ${directory:services}/tidstoraged
530 531
repozo-wrapper = ${buildout:bin-directory}/tidstorage-repozo

532 533 534 535 536 537 538
[cron-entry-erp5-ca-backup]
< = cron-base
recipe = slapos.cookbook:cron.d
name = erp5-ca-backup
frequency = 0 0 * * *
command = ${buildout:bin-directory}/cp -a ${directory:erp5-ca-dir}/* ${directory:erp5-ca-dir-backup}

539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564
[cron-entry-tidstorage-backup]
< = cron-base
recipe = slapos.cookbook:cron.d
name = tidstorage
frequency = 0 0 * * *
command = ${tidstorage:repozo-wrapper}

[logrotate-entry-tidstorage]
< = logrotate-base
recipe = slapos.cookbook:logrotate.d
name = tidstorage
log = ${tidstorage:logfile-name}
post = {{ bin_directory }}/killpidfromfile ${tidstorage:pidfile-name} SIGHUP

#############################
# buildout main section
#############################
[buildout]
parts =
  logrotate
  cron
  cron-entry-logrotate
  certificate-authority
  erp5-certificate-authority
  tidstorage
  cron-entry-tidstorage-backup
565
  cron-entry-erp5-ca-backup
566 567 568 569 570 571 572 573 574
  logrotate-entry-tidstorage
  binary-link
  erp5-promise
  erp5-bootstrap
  {{ part_list | join('\n  ') }}

eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
575
{%- endif %}