Commit 82d8ba1b authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Fix http2 enable/disable implementation

Transmit default setting to each slave, as there the decision
about serving or not HTTP2 happens.

As Caddy might always serve HTTP2 sites force it to always being able to
serve such sites using HTTP2.

Then per site check what is the default, and enable/disable HTTP2.
parent 66742874
...@@ -19,7 +19,7 @@ md5sum = f686f765e55d1dce2e55a400f0714b3e ...@@ -19,7 +19,7 @@ md5sum = f686f765e55d1dce2e55a400f0714b3e
[template-apache-frontend] [template-apache-frontend]
filename = instance-apache-frontend.cfg filename = instance-apache-frontend.cfg
md5sum = 6a2a0ada0bf281a725712b9c29a12b34 md5sum = 441ebd011cd33f17b48590cc6969970a
[template-apache-replicate] [template-apache-replicate]
filename = instance-apache-replicate.cfg.in filename = instance-apache-replicate.cfg.in
...@@ -27,7 +27,7 @@ md5sum = 9e76028df7e93d3e32982884d5dc0913 ...@@ -27,7 +27,7 @@ md5sum = 9e76028df7e93d3e32982884d5dc0913
[template-slave-list] [template-slave-list]
filename = templates/apache-custom-slave-list.cfg.in filename = templates/apache-custom-slave-list.cfg.in
md5sum = 3e7350f9f27cddc63ee9711b548790fa md5sum = 1867c268830af61bcc245d0c88b634fb
[template-slave-configuration] [template-slave-configuration]
filename = templates/custom-virtualhost.conf.in filename = templates/custom-virtualhost.conf.in
...@@ -43,7 +43,7 @@ md5sum = edfdd21d712f4ba4c2e1fcb9ea096554 ...@@ -43,7 +43,7 @@ md5sum = edfdd21d712f4ba4c2e1fcb9ea096554
[template-custom-slave-list] [template-custom-slave-list]
filename = templates/apache-custom-slave-list.cfg.in filename = templates/apache-custom-slave-list.cfg.in
md5sum = 3e7350f9f27cddc63ee9711b548790fa md5sum = 1867c268830af61bcc245d0c88b634fb
[template-not-found-html] [template-not-found-html]
filename = templates/notfound.html filename = templates/notfound.html
...@@ -55,7 +55,7 @@ md5sum = 88a31d5a26c26408443fa5c2550ff8ac ...@@ -55,7 +55,7 @@ md5sum = 88a31d5a26c26408443fa5c2550ff8ac
[template-default-slave-virtualhost] [template-default-slave-virtualhost]
filename = templates/default-virtualhost.conf.in filename = templates/default-virtualhost.conf.in
md5sum = 831d2eb5a0489b340dcf244025e579b0 md5sum = bb80ef5a195b841a071c7104544ae776
[template-cached-slave-virtualhost] [template-cached-slave-virtualhost]
filename = templates/cached-virtualhost.conf.in filename = templates/cached-virtualhost.conf.in
...@@ -75,7 +75,7 @@ md5sum = 8cde04bfd0c0e9bd56744b988275cfd8 ...@@ -75,7 +75,7 @@ md5sum = 8cde04bfd0c0e9bd56744b988275cfd8
[template-caddy-wrapper] [template-caddy-wrapper]
filename = templates/caddy-wrapper.in filename = templates/caddy-wrapper.in
md5sum = 30921eb4be1dc867f9f6749688e6098a md5sum = 688d06546a12aa74ff4eea59fee624b8
[template-trafficserver-records-config] [template-trafficserver-records-config]
filename = templates/trafficserver/records.config.jinja2 filename = templates/trafficserver/records.config.jinja2
......
...@@ -212,6 +212,8 @@ extra-context = ...@@ -212,6 +212,8 @@ extra-context =
key login_ca_crt ca-custom-frontend:rendered key login_ca_crt ca-custom-frontend:rendered
raw sixtunnel_executable ${6tunnel:location}/bin/6tunnel raw sixtunnel_executable ${6tunnel:location}/bin/6tunnel
raw service_directory $${directory:service} raw service_directory $${directory:service}
key enable_http2_by_default instance-parameter:configuration.enable-http2-by-default
[dynamic-virtualhost-template-slave] [dynamic-virtualhost-template-slave]
<= jinja2-template-base <= jinja2-template-base
template = ${template-slave-configuration:target} template = ${template-slave-configuration:target}
...@@ -263,7 +265,6 @@ extra-context = ...@@ -263,7 +265,6 @@ extra-context =
key https_port instance-parameter:configuration.port key https_port instance-parameter:configuration.port
key content apache-configuration:frontend-graceful-command key content apache-configuration:frontend-graceful-command
key log apache-configuration:error-log key log apache-configuration:error-log
key http2 instance-parameter:configuration.enable-http2-by-default
key grace instance-parameter:configuration.mpm-graceful-shutdown-timeout key grace instance-parameter:configuration.mpm-graceful-shutdown-timeout
key pidfile apache-configuration:pid-file key pidfile apache-configuration:pid-file
...@@ -711,7 +712,6 @@ extra-context = ...@@ -711,7 +712,6 @@ extra-context =
key http_port nginx-configuration:plain_port key http_port nginx-configuration:plain_port
key https_port nginx-configuration:port key https_port nginx-configuration:port
key log nginx-configuration:error_log key log nginx-configuration:error_log
key http2 instance-parameter:configuration.enable-http2-by-default
key grace instance-parameter:configuration.mpm-graceful-shutdown-timeout key grace instance-parameter:configuration.mpm-graceful-shutdown-timeout
key pidfile nginx-configuration:pid-file key pidfile nginx-configuration:pid-file
......
...@@ -161,6 +161,7 @@ value = {{ dumps(slave_instance.get(cert_name)) }} ...@@ -161,6 +161,7 @@ value = {{ dumps(slave_instance.get(cert_name)) }}
{%- do slave_instance.__setitem__('login_certificate', login_certificate) %} {%- do slave_instance.__setitem__('login_certificate', login_certificate) %}
{%- do slave_instance.__setitem__('login_key', login_key) %} {%- do slave_instance.__setitem__('login_key', login_key) %}
{%- do slave_instance.__setitem__('login_ca_crt', login_ca_crt) %} {%- do slave_instance.__setitem__('login_ca_crt', login_ca_crt) %}
{%- do slave_instance.__setitem__('enable_http2_by_default', enable_http2_by_default) %}
{%- do slave_parameter_dict.__setitem__('ssl_crt', login_certificate) %} {%- do slave_parameter_dict.__setitem__('ssl_crt', login_certificate) %}
{%- do slave_parameter_dict.__setitem__('ssl_key', login_key) %} {%- do slave_parameter_dict.__setitem__('ssl_key', login_key) %}
{% if 'ssl_key' in slave_instance and 'ssl_crt' in slave_instance -%} {% if 'ssl_key' in slave_instance and 'ssl_crt' in slave_instance -%}
......
...@@ -7,7 +7,7 @@ exec {{ caddy }} \ ...@@ -7,7 +7,7 @@ exec {{ caddy }} \
-http-port {{ http_port }} \ -http-port {{ http_port }} \
-https-port {{ https_port }} \ -https-port {{ https_port }} \
-log {{ log }} \ -log {{ log }} \
-http2={{ http2 }} \ -http2=true \
-grace {{ grace }}s \ -grace {{ grace }}s \
-pidfile {{ pidfile }} \ -pidfile {{ pidfile }} \
-disable-http-challenge \ -disable-http-challenge \
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{%- set disable_via_header = ('' ~ slave_parameter.get('disable-via-header', '')).lower() in TRUE_VALUES -%} {%- set disable_via_header = ('' ~ slave_parameter.get('disable-via-header', '')).lower() in TRUE_VALUES -%}
{%- set prefer_gzip = ('' ~ slave_parameter.get('prefer-gzip-encoding-to-backend', '')).lower() in TRUE_VALUES -%} {%- set prefer_gzip = ('' ~ slave_parameter.get('prefer-gzip-encoding-to-backend', '')).lower() in TRUE_VALUES -%}
{%- set server_alias_list = slave_parameter.get('server-alias', '').split() -%} {%- set server_alias_list = slave_parameter.get('server-alias', '').split() -%}
{%- set enable_h2 = ('' ~ slave_parameter.get('enable-http2', 'true')).lower() in TRUE_VALUES -%} {%- set enable_h2 = ('' ~ slave_parameter.get('enable-http2', slave_parameter['enable_http2_by_default'])).lower() in TRUE_VALUES -%}
{%- set ssl_proxy_verify = ('' ~ slave_parameter.get('ssl-proxy-verify', '')).lower() in TRUE_VALUES -%} {%- set ssl_proxy_verify = ('' ~ slave_parameter.get('ssl-proxy-verify', '')).lower() in TRUE_VALUES -%}
{%- set disabled_cookie_list = slave_parameter.get('disabled-cookie-list', '').split() -%} {%- set disabled_cookie_list = slave_parameter.get('disabled-cookie-list', '').split() -%}
{%- set https_only = ('' ~ slave_parameter.get('https-only', '')).lower() in TRUE_VALUES -%} {%- set https_only = ('' ~ slave_parameter.get('https-only', '')).lower() in TRUE_VALUES -%}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment