instance.cfg.in 4.54 KB
Newer Older
1 2 3 4 5 6 7
[buildout]
extends = {{ common_profile }}

parts =
  dynamic-template-caddy-replicate
  switch-softwaretype

8 9 10
[caddyprofiledeps]
recipe = caddyprofiledeps

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
extra-context =
context =
    import json_module json
    key slap_software_type instance-parameter:slap-software-type
    key slapparameter_dict instance-parameter:configuration
    key slave_instance_list instance-parameter:slave-instance-list
    section instance_parameter instance-parameter
    ${:extra-context}

[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
default = ${dynamic-template-caddy-replicate:rendered}
RootSoftwareInstance = ${dynamic-template-caddy-replicate:rendered}
custom-personal = ${dynamic-template-caddy-replicate:rendered}
single-default = ${dynamic-template-caddy-frontend:rendered}
single-custom-personal = ${dynamic-template-caddy-frontend:rendered}
replicate = ${dynamic-template-caddy-replicate:rendered}
31
kedifa = ${dynamic-template-kedifa:rendered}
32 33 34 35 36 37 38 39 40 41 42 43 44

[dynamic-template-caddy-frontend-parameters]
{% for key,value in template_frontend_parameter_dict.iteritems() %}
{{ key }} = {{ dumps(value) }}
{% endfor -%}

[dynamic-template-caddy-frontend]
< = jinja2-template-base
template = {{ template_caddy_frontend }}
filename = instance-caddy-frontend.cfg
extensions = jinja2.ext.do
extra-context =
  section parameter_dict dynamic-template-caddy-frontend-parameters
45
  raw software_type single-custom-personal
46 47 48
caucase-jinja2-library = {{ caucase_jinja2_library }}
import-list =
  file caucase :caucase-jinja2-library
49 50 51

[dynamic-template-caddy-replicate]
< = jinja2-template-base
52
depends = ${caddyprofiledeps:recipe}
53 54 55 56 57
template = {{ template_caddy_replicate }}
filename = instance-caddy-replicate.cfg
extensions = jinja2.ext.do
extra-context =
    import subprocess_module subprocess
58
    import functools_module functools
59
    import validators validators
60
    key cluster_identification instance-parameter:root-instance-title
61
    raw caddy_backend_url_validator {{ caddy_backend_url_validator }}
62
    raw caddy_custom_http_validator {{ caddy_custom_http_validator }}
63 64 65 66 67
    raw template_publish_slave_information {{ template_replicate_publish_slave_information }}
# Must match the key id in [switch-softwaretype] which uses this section.
    raw software_type RootSoftwareInstance-default-custom-personal-replicate
    raw template_monitor {{ monitor2_template }}
    raw common_profile {{ common_profile }}
68
    section parameter_dict dynamic-template-caddy-frontend-parameters
69

70 71 72 73 74 75 76 77 78 79 80 81
[dynamic-template-kedifa]
< = jinja2-template-base
template = {{ template_kedifa }}
filename = instance-kedifa.cfg
extensions = jinja2.ext.do
extra-context =
  section parameter_dict dynamic-template-caddy-frontend-parameters
  raw software_type kedifa
caucase-jinja2-library = {{ caucase_jinja2_library }}
import-list =
  file caucase :caucase-jinja2-library

82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
[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.plain_nginx_port = 8081
configuration.nginx_port = 9443
101 102 103
configuration.kedifa_port = 7879
# Warning: Caucase takes also cacuase_port+1
configuration.caucase_port = 8890
104 105 106 107 108
# BBB: apache_custom_https and apache_custom_http
configuration.apache_custom_https = ""
configuration.apache_custom_http = ""
configuration.caddy_custom_https = ""
configuration.caddy_custom_http = ""
109 110
configuration.apache-key =
configuration.apache-certificate =
111 112 113
configuration.open-port = 80 443
configuration.disk-cache-size = 8G
configuration.ram-cache-size = 1G
114
configuration.trafficserver-synthetic-port = 8083
115 116 117
configuration.trafficserver-mgmt-port = 8084
configuration.re6st-verification-url = http://[2001:67c:1254:4::1]/index.html
configuration.enable-http2-by-default = true
118
configuration.global-disable-http2 = false
Łukasz Nowak's avatar
Łukasz Nowak committed
119
configuration.enable-quic = false
120 121
configuration.mpm-graceful-shutdown-timeout = 5
configuration.monitor-httpd-port = 8072
122
configuration.frontend-name =
123 124
configuration.proxy-try-duration = 5
configuration.proxy-try-interval = 250