{
/* {# Our JSON parser allows comments. #}
Placeholders allowed:
// These match (but don't capture) an optional / prefix:
'{_any}'
'{_id}'
'{_year}'
'{_month}'
'{_day}'
'{_isodate}'
'{_lower}'
'{_upper}'
'{_page}'
'{_slug}'
'{_uslug}'
'{_lslug}'
'{_string}'
'{_hex}',
// Without the / prefix:
'{any}'
'{id}'
'{year}'
'{month}'
'{day}'
'{isodate}'
'{lower}'
'{upper}'
'{slug}'
'{uslug}'
'{lslug}'
'{string}'
'{hex}'
*/
{% for route, cabin in cabins %}
{{ route|je }}: {
"enabled": {{ cabin['enabled'] ? 'true' : 'false' }},
// Used in cross-cabin hyperlinks:
"canon_url": {{ cabin['canon_url']|default('//')|je }},
// Only respond over HTTPS (recommended!):
"https": {{ cabin.https ? 'true' : 'false' }},
"language": {{ cabin.language|default('en-us')|je }},
{% if supplier %}
"supplier": {{ cabin.supplier|je }},
{% endif %}
// HTTP Public-Key-Pinning:
"hpkp": {
"enabled": {{ cabin['hpkp']['enabled'] ? 'true' : 'false' }},
"hashes": {% if cabin['hpkp']['hashes'] %}[
{% for h in cabin['hpkp']['hashes'] %}{
"algo": {{ h.algo|default('sha256')|je }},
"hash": {{ h.hash|je }}
}{% if not loop.last %},{% endif %} {% endfor %}
]{% else %}[]{% endif %},
"include-subdomains": {{ cabin['hpkp']['include-subdomains'] ? 'true' : 'false' }},
"max-age": {{ cabin['hpkp']['max-age']|je }},
"report-only": {{ cabin['hpkp']['report-only'] ? 'true' : 'false' }},
"report-uri": {{ cabin['hpkp']['report-uri']|je }}
},
// Must be unique:
"name": {{ cabin.name|default('UnnamedCabin' ~ loop.index)|je }}
}{% if not loop.last %},{% endif %}
{% endfor %}
}
|