instance-apache-frontend.cfg 23.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[buildout]
parts =
  directory
  configtest
  logrotate
  cron
  cron-entry-logrotate
  ca-frontend
  certificate-authority
  logrotate-entry-apache
  logrotate-entry-apache-cached
  apache-frontend
  apache-cached
  switch-apache-softwaretype
  frontend-apache-graceful
  cached-apache-graceful
  dynamic-template-default-vh
  not-found-html
19 20
  promise-frontend-apache-configuration
  promise-cached-apache-configuration
21 22 23 24 25
  promise-apache-frontend-v4-https
  promise-apache-frontend-v4-http
  promise-apache-frontend-v6-https
  promise-apache-frontend-v6-http
  promise-apache-cached
26 27 28 29 30 31 32 33

  trafficserver-launcher
  trafficserver-reload
  trafficserver-configuration-directory
  trafficserver-records-config
  trafficserver-remap-config
  trafficserver-storage-config

34 35 36 37 38 39 40 41
## Monitoring part
###Parts to add for monitoring
  certificate-authority
  cron-entry-monitor
  cron-entry-rss
  deploy-index
  deploy-settings-cgi
  deploy-status-cgi
42
  deploy-status-history-cgi
43 44 45 46 47
  setup-static-files
  certificate-authority
  zero-parameters
  public-symlink
  cgi-httpd-wrapper
48
  cgi-httpd-graceful-wrapper
49 50
  monitor-promise
  monitor-instance-log-access
51 52 53
## Monitor for apache
  monitor-current-log-access
  monitor-backup-log-access
54
  monitor-ats-cache-stats-wrapper
55
  monitor-apache-configuration-verification
56
  monitor-verify-re6st-connectivity
57

58
extends = ${monitor-template:output}
59

60

61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true

# Create all needed directories
[directory]
recipe = slapos.cookbook:mkdirectory

bin = $${buildout:directory}/bin/
etc = $${buildout:directory}/etc/
srv = $${buildout:directory}/srv/
var = $${buildout:directory}/var/
template = $${buildout:directory}/template/

backup = $${:srv}/backup
log = $${:var}/log
run = $${:var}/run
service = $${:etc}/service
etc-run = $${:etc}/run
promise = $${:etc}/promise

logrotate-backup = $${:backup}/logrotate
logrotate-entries = $${:etc}/logrotate.d

cron-entries = $${:etc}/cron.d
crontabs = $${:etc}/crontabs
cronstamps = $${:etc}/cronstamps
ca-dir = $${:srv}/ssl

90

91 92
[switch-apache-softwaretype]
recipe = slapos.cookbook:softwaretype
93 94 95
single-default = $${dynamic-default-template-slave-list:rendered}
single-custom-personal = $${dynamic-custom-personal-template-slave-list:rendered}
single-custom-group = $${dynamic-custom-group-template-slave-list:rendered}
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121

[instance-parameter]
# Fetches parameters defined in SlapOS Master for this instance.
# Always the same.
recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
# Define default parameter(s) that will be used later, in case user didn't
# specify it
# All parameters are available through the configuration.XX syntax.
# All possible parameters should have a default.
configuration.domain = example.org
configuration.public-ipv4 =
configuration.port = 4443
configuration.plain_http_port = 8080
configuration.server-admin = admin@example.com
configuration.apache_custom_https = ""
configuration.apache_custom_http = ""
configuration.apache-key =
configuration.apache-certificate =
configuration.open-port = 80 443
configuration.extra_slave_instance_list =

122 123 124 125 126 127 128
[frontend-configuration]
template-log-access = ${template-log-access:target}
log-access-configuration = $${directory:etc}/apache-log-access.conf
apache-directory = ${apache-2.2:location}
apache-ipv6 = $${instance-parameter:ipv6-random}
apache-https-port = $${instance-parameter:configuration.port}

129 130 131 132 133 134 135 136 137 138
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/$${:filename}
extra-context =
context =
    import json_module json
    key eggs_directory buildout:eggs-directory
    key develop_eggs_directory buildout:develop-eggs-directory
    key slap_software_type instance-parameter:slap-software-type
    key slapparameter_dict instance-parameter:configuration
139
    section directory directory
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
    $${:extra-context}

[dynamic-template-default-vh]
< = jinja2-template-base
template = ${template-default-virtualhost:target}
rendered = $${apache-directory:slave-configuration}/000.conf
extensions = jinja2.ext.do
extra-context =
    key http_port instance-parameter:configuration.plain_http_port
    key https_port instance-parameter:configuration.port

[dynamic-custom-personal-template-slave-list]
< = jinja2-template-base
template = ${template-slave-list:target}
filename = custom-personal-instance-slave-list.cfg
extensions = jinja2.ext.do
extra-context =
    key apache_configuration_directory apache-directory:slave-configuration
    key http_port instance-parameter:configuration.plain_http_port
    key https_port instance-parameter:configuration.port
    key public_ipv4 instance-parameter:configuration.public-ipv4
    key slave_instance_list instance-parameter:slave-instance-list
    key extra_slave_instance_list instance-parameter:configuration.extra_slave_instance_list
    key rewrite_cached_configuration apache-configuration:cached-rewrite-file
    key custom_ssl_directory apache-directory:vh-ssl
    key apache_log_directory apache-directory:slave-log
    key local_ipv4 instance-parameter:ipv4-random
    key cache_port apache-configuration:cache-port
    raw empty_template ${template-empty:target}
    raw template_slave_configuration ${template-slave-configuration:target}
    raw template_rewrite_cached ${template-rewrite-cached:target}
171
    raw software_type single-custom-personal
172 173 174
    section logrotate_dict logrotate
    section frontend_configuration frontend-configuration
    section apache_configuration apache-configuration
175
    section connection_information_dict publish-connection-informations
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197

[dynamic-custom-group-template-slave-list]
< = jinja2-template-base
template = ${template-custom-slave-list:target}
filename = custom-group-instance-slave-list.cfg
extensions = jinja2.ext.do
extra-context =
    key apache_configuration_directory apache-directory:slave-configuration
    key domain instance-parameter:configuration.domain
    key http_port instance-parameter:configuration.plain_http_port
    key https_port instance-parameter:configuration.port
    key public_ipv4 instance-parameter:configuration.public-ipv4
    key slave_instance_list instance-parameter:slave-instance-list
    key extra_slave_instance_list instance-parameter:configuration.extra_slave_instance_list
    key rewrite_cached_configuration apache-configuration:cached-rewrite-file
    key custom_ssl_directory apache-directory:vh-ssl
    key template_slave_configuration dynamic-virtualhost-template-slave:rendered
    key apache_log_directory apache-directory:slave-log
    key local_ipv4 instance-parameter:ipv4-random
    key cache_port apache-configuration:cache-port
    raw empty_template ${template-empty:target}
    raw template_rewrite_cached ${template-rewrite-cached:target}
198
    raw software_type single-custom-group
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220

[dynamic-default-template-slave-list]
< = jinja2-template-base
template = ${template-custom-slave-list:target}
filename = default-instance-slave-list.cfg
extensions = jinja2.ext.do
extra-context =
    key apache_configuration_directory apache-directory:slave-configuration
    key domain instance-parameter:configuration.domain
    key http_port instance-parameter:configuration.plain_http_port
    key https_port instance-parameter:configuration.port
    key public_ipv4 instance-parameter:configuration.public-ipv4
    key slave_instance_list instance-parameter:slave-instance-list
    key extra_slave_instance_list instance-parameter:configuration.extra_slave_instance_list
    key rewrite_cached_configuration apache-configuration:cached-rewrite-file
    key custom_ssl_directory apache-directory:vh-ssl
    key apache_log_directory apache-directory:slave-log
    key local_ipv4 instance-parameter:ipv4-random
    key cache_port apache-configuration:cache-port
    raw template_slave_configuration ${template-default-slave-virtualhost:target}
    raw empty_template ${template-empty:target}
    raw template_rewrite_cached ${template-rewrite-cached:target}
221
    raw software_type single-default
222
# XXXX Hack to allow two software types
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260

[dynamic-virtualhost-template-slave]
<= jinja2-template-base
template = ${template-slave-configuration:target}
rendered = $${directory:template}/slave-virtualhost.conf.in
extensions = jinja2.ext.do
extra-context =
    key https_port instance-parameter:configuration.port
    key http_port instance-parameter:configuration.plain_http_port
    key apache_custom_https instance-parameter:configuration.apache_custom_https
    key apache_custom_http instance-parameter:configuration.apache_custom_http

# Deploy Apache Frontend (new way, no recipe, jinja power)
[dynamic-apache-frontend-template]
< = jinja2-template-base
template = ${template-apache-frontend-configuration:target}
rendered = $${apache-configuration:frontend-configuration}
extra-context =
    raw httpd_home ${apache-2.2:location}
    key httpd_mod_ssl_cache_directory apache-directory:mod-ssl
    key domain instance-parameter:configuration.domain
    key document_root apache-directory:document-root
    key instance_home buildout:directory
    key ipv4_addr instance-parameter:ipv4-random
    key ipv6_addr instance-parameter:ipv6-random
    key http_port instance-parameter:configuration.plain_http_port
    key https_port instance-parameter:configuration.port
    key server_admin instance-parameter:configuration.server-admin
    key protected_path apache-configuration:protected-path
    key access_control_string apache-configuration:access-control-string
    key login_certificate ca-frontend:cert-file
    key login_key ca-frontend:key-file
    key ca_dir  certificate-authority:ca-dir
    key ca_crl certificate-authority:ca-crl
    key access_log apache-configuration:access-log
    key error_log apache-configuration:error-log
    key pid_file apache-configuration:pid-file
    key slave_configuration_directory apache-directory:slave-configuration
261
    section frontend_configuration frontend-configuration
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327

[apache-frontend]
recipe = slapos.cookbook:wrapper
command-line = ${apache-2.2:location}/bin/httpd -f $${dynamic-apache-frontend-template:rendered} -DFOREGROUND
wrapper-path = $${directory:service}/frontend_apache
wait-for-files =
	       $${ca-frontend:cert-file}
	       $${ca-frontend:key-file}

# Deploy Apache for cached website
[dynamic-apache-cached-template]
< = jinja2-template-base
template = ${template-apache-cached-configuration:target}
rendered = $${apache-configuration:cached-configuration}
extra-context =
    raw httpd_home ${apache-2.2:location}
    key httpd_mod_ssl_cache_directory apache-directory:mod-ssl
    key domain instance-parameter:configuration.domain
    key document_root apache-directory:document-root
    key instance_home buildout:directory
    key ipv4_addr instance-parameter:ipv4-random
    key cached_port apache-configuration:cache-through-port
    key server_admin instance-parameter:configuration.server-admin
    key protected_path apache-configuration:protected-path
    key access_control_string apache-configuration:access-control-string
    key login_certificate ca-frontend:cert-file
    key login_key ca-frontend:key-file
    key ca_dir  certificate-authority:ca-dir
    key ca_crl certificate-authority:ca-crl
    key access_log apache-configuration:cache-access-log
    key error_log apache-configuration:cache-error-log
    key pid_file apache-configuration:cache-pid-file
    key apachecachedmap_path apache-configuration:cached-rewrite-file

[apache-cached]
recipe = slapos.cookbook:wrapper
command-line = ${apache-2.2:location}/bin/httpd -f $${dynamic-apache-cached-template:rendered} -DFOREGROUND
wrapper-path = $${directory:service}/frontend_cached_apache
wait-for-files =
	       $${ca-frontend:cert-file}
	       $${ca-frontend:key-file}

[not-found-html]
recipe = slapos.cookbook:symbolic.link
target-directory = $${apache-directory:document-root}
link-binary =
	    ${template-not-found-html:target}

[apache-directory]
recipe = slapos.cookbook:mkdirectory
document-root = $${directory:srv}/htdocs
slave-configuration = $${directory:etc}/apache-slave-conf.d/
cache = $${directory:var}/cache
mod-ssl = $${:cache}/httpd_mod_ssl
vh-ssl = $${:slave-configuration}/ssl
slave-log = $${directory:log}/httpd

[apache-configuration]
frontend-configuration = $${directory:etc}/apache_frontend.conf
cached-configuration = $${directory:etc}/apache_frontend_cached.conf
access-log = $${directory:log}/frontend-apache-access.log
error-log = $${directory:log}/frontend-apache-error.log
pid-file = $${directory:run}/httpd.pid
protected-path = /
access-control-string = none
cached-rewrite-file = $${directory:etc}/apache_rewrite_cached.txt
328 329 330 331
frontend-configuration-verification = ${apache-2.2:location}/bin/httpd -Sf $${:frontend-configuration}
frontend-graceful-command = $${:frontend-configuration-verification}; if [ $? -eq 0 ]; then kill -USR1 $(cat $${:pid-file}); fi
cached-configuration-verification = ${apache-2.2:location}/bin/httpd -Sf $${:cached-configuration}
cached-graceful-command = $${:cached-configuration-verification}; if [ $? -eq 0 ]; then kill -USR1 $(cat $${apache-configuration:cache-pid-file}); fi
332 333 334 335 336 337

# Apache for cache configuration
cache-access-log = $${directory:log}/frontend-apache-access-cached.log
cache-error-log = $${directory:log}/frontend-apache-error-cached.log
cache-pid-file = $${directory:run}/httpd-cached.pid

338 339
# Comunication with ats
cache-port = $${trafficserver-variable:input-port}
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
cache-through-port = 26011

# Create wrapper for "apachectl conftest" in bin
[configtest]
recipe = slapos.cookbook:wrapper
command-line = ${apache-2.2:location}/bin/httpd -f $${directory:etc}/apache_frontend.conf -t
wrapper-path = $${directory:bin}/apache-configtest

[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:ca-dir}
requests-directory = $${cadirectory:requests}
wrapper = $${directory:service}/certificate_authority
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-frontend]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
key-file = $${cadirectory:certs}/apache_frontend.key
cert-file = $${cadirectory:certs}/apache_frontend.crt
executable = $${directory:service}/frontend_apache
wrapper = $${directory:service}/frontend_apache
key-content = $${instance-parameter:configuration.apache-key}
cert-content = $${instance-parameter:configuration.apache-certificate}
# Put domain name
name = $${instance-parameter:configuration.domain}

[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cron-entries = $${directory:cron-entries}
crontabs = $${directory:crontabs}
cronstamps = $${directory:cronstamps}
catcher = $${cron-simplelogger:wrapper}
binary = $${directory:service}/crond

[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${directory:bin}/cron_simplelogger
log = $${directory:log}/cron.log

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

# Deploy Logrotate
[logrotate]
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
gzip-binary = ${gzip:location}/bin/gzip
gunzip-binary = ${gzip:location}/bin/gunzip
# Directories
wrapper = $${directory:bin}/logrotate
conf = $${directory:etc}/logrotate.conf
logrotate-entries = $${directory:logrotate-entries}
backup = $${directory:logrotate-backup}
state-file = $${directory:srv}/logrotate.status

[logrotate-entry-apache]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = apache
418
log = $${apache-configuration:error-log} $${apache-configuration:access-log}
419 420
frequency = daily
rotatep-num = 30
421
post = $${apache-configuration:frontend-graceful-command}
422 423 424 425 426 427 428 429 430 431 432
sharedscripts = true
notifempty = true
create = true

[logrotate-entry-apache-cached]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = apache-cached
log = $${apache-configuration:cache-error-log} $${apache-configuration:cache-access-log}
frequency = daily
rotatep-num = 30
433
post = $${apache-configuration:cached-graceful-command}
434 435 436 437
sharedscripts = true
notifempty = true
create = true

438 439 440 441
#################
# Trafficserver
#################
[trafficserver-directory]
442
recipe = slapos.cookbook:mkdirectory
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463
configuration = $${directory:etc}/trafficserver
local-state = $${directory:var}/trafficserver
bin_path = ${trafficserver:location}/bin
log = $${directory:log}/trafficserver
cache-path = $${directory:srv}/ats_cache

[trafficserver-variable]
wrapper-path = $${directory:service}/trafficserver
reload-path = $${directory:etc-run}/trafficserver-reload
local-ip = $${instance-parameter:ipv4-random}
input-port = 23432
hostname = $${slap-parameter:frontend-name}
remap = map / http://$${instance-parameter:ipv4-random}:$${apache-configuration:cache-through-port}
disk-cache-config = $${trafficserver-directory:cache-path} 8G volume=$${slap-parameter:frontend-name}

[trafficserver-configuration-directory]
recipe = plone.recipe.command
command = cp -rn ${trafficserver:location}/etc/trafficserver/* $${:target}
target = $${trafficserver-directory:configuration}

[trafficserver-launcher]
464
recipe = slapos.cookbook:wrapper
465 466 467
command-line = ${trafficserver:location}/bin/traffic_cop
wrapper-path = $${trafficserver-variable:wrapper-path}
environment = TS_ROOT=$${buildout:directory}
468

469
[trafficserver-reload]
470
recipe = slapos.cookbook:wrapper
471 472 473
command-line = ${trafficserver:location}/bin/traffic_line -x
wrapper-path = $${trafficserver-variable:reload-path}
environment = TS_ROOT=$${buildout:directory}
474

475 476 477 478 479 480 481 482 483
[trafficserver-records-config]
< = jinja2-template-base
template = ${template-trafficserver-records-config:location}/${template-trafficserver-records-config:filename}
rendered = $${trafficserver-directory:configuration}/records.config
mode = 700
context =
    import os_module os
    section ats_directory trafficserver-directory
    section ats_configuration trafficserver-variable
484

485 486 487 488 489 490 491
[trafficserver-remap-config]
< = jinja2-template-base
template = ${template-empty:target}
rendered = $${trafficserver-configuration-directory:target}/remap.config
mode = 700
context =
    key content trafficserver-variable:remap
492

493 494 495 496 497 498 499
[trafficserver-storage-config]
< = jinja2-template-base
template = ${template-empty:target}
rendered = $${trafficserver-configuration-directory:target}/storage.config
mode = 700
context =
    key content trafficserver-variable:disk-cache-config
500

501 502
### End of ATS sections

503
### Apaches Graceful and promises
504
[frontend-apache-graceful]
505
< = jinja2-template-base
506
template = ${template-wrapper:output}
507 508 509 510
rendered = $${directory:etc-run}/frontend-apache-safe-graceful
mode = 0700
extra-context =
    key content apache-configuration:frontend-graceful-command
511 512

[cached-apache-graceful]
513
< = jinja2-template-base
514
template = ${template-wrapper:output}
515 516 517 518
rendered = $${directory:etc-run}/cached-apache-safe-graceful
mode = 0700
extra-context =
    key content apache-configuration:cached-graceful-command
519

520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536
# Promises checking configuration:
[promise-frontend-apache-configuration]
< = jinja2-template-base
template = ${template-wrapper:output}
rendered = $${directory:promise}/frontend-apache-configuration-promise
mode = 0700
extra-context =
    key content apache-configuration:frontend-configuration-verification

[promise-cached-apache-configuration]
< = jinja2-template-base
template = ${template-wrapper:output}
rendered = $${directory:promise}/cached-apache-configuration-promise
mode = 0700
extra-context =
    key content apache-configuration:cached-configuration-verification

537 538 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 565 566 567 568 569 570 571 572 573 574
[promise-apache-frontend-v4-https]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promise}/apache_frontend_ipv4_https
hostname = $${instance-parameter:ipv4-random}
port = $${instance-parameter:configuration.port}

[promise-apache-frontend-v4-http]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promise}/apache_frontend_ipv4_http
hostname = $${instance-parameter:ipv4-random}
port = $${instance-parameter:configuration.plain_http_port}

[promise-apache-frontend-v6-https]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promise}/apache_frontend_ipv6_https
hostname = $${instance-parameter:ipv6-random}
port = $${instance-parameter:configuration.port}

[promise-apache-frontend-v6-http]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promise}/apache_frontend_ipv6_http
hostname = $${instance-parameter:ipv6-random}
port = $${instance-parameter:configuration.plain_http_port}

[promise-apache-cached]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promise}/apache_cached
hostname = $${instance-parameter:ipv4-random}
port = $${apache-configuration:cache-through-port}

[slap_connection]
# Kept for backward compatiblity
computer_id = $${slap-connection:computer-id}
partition_id = $${slap-connection:partition-id}
server_url = $${slap-connection:server-url}
software_release_url = $${slap-connection:software-release-url}
key_file = $${slap-connection:key-file}
cert_file = $${slap-connection:cert-file}
575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591

[slap-parameter]
# Define default parameter(s) that will be used later, in case user didn't
# specify it
# All parameters are available through the configuration.XX syntax.
# All possible parameters should have a default.
domain = example.org
public-ipv4 =
port = 4443
plain_http_port = 8080
server-admin = admin@example.com
apache_custom_https = ""
apache_custom_http = ""
apache-key =
apache-certificate =
open-port = 80 443
extra_slave_instance_list =
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623
frontend-name =


#######
# Monitoring sections
#

[monitor-current-log-access]
< = monitor-directory-access
source = $${directory:log}

[monitor-backup-log-access]
< = monitor-directory-access
source = $${directory:logrotate-backup}

# Produce ATS Cache stats
[monitor-ats-cache-stats-wrapper]
< = jinja2-template-base
template = ${template-wrapper:output}
rendered = $${monitor-directory:monitoring-cgi}/ats-cache-stats
mode = 0700
command = export TS_ROOT=$${buildout:directory} && echo "<pre>$(${trafficserver:location}/bin/traffic_shell $${monitor-ats-cache-stats-config:rendered})</pre>"
extra-context =
  key content monitor-ats-cache-stats-wrapper:command

[monitor-ats-cache-stats-config]
< = jinja2-template-base
template = ${template-empty:target}
rendered = $${trafficserver-configuration-directory:target}/cache-config.stats
mode = 644
context =
    raw content show:cache-stats
624 625 626 627 628 629 630 631 632 633

# Display result of apache configuration check
[monitor-apache-configuration-verification]
< = jinja2-template-base
template = ${template-wrapper:output}
rendered = $${monitor-directory:monitoring-cgi}/front-httpd-configuration
mode = 0700
command = echo "<pre>$($${apache-configuration:frontend-configuration-verification})</pre>"
extra-context =
  key content :command
634 635 636 637 638 639 640 641 642 643

[monitor-verify-re6st-connectivity]
recipe = slapos.cookbook:check_url_available
path = $${monitor-directory:monitor-custom-scripts}/re6st-connectivity
url = $${public:re6st-verification-url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl

[public]
re6st-verification-url = http://[2001:67c:1254:4::1]/index.html