Merge ~hloeung/content-cache-charm:cleanup into content-cache-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: 51c5baff7265d57177de0966bfa8d0c9f89e0e11
Merged at revision: 3774c254f111422a5f61c2b592af906be9da33dc
Proposed branch: ~hloeung/content-cache-charm:cleanup
Merge into: content-cache-charm:master
Prerequisite: ~hloeung/content-cache-charm:request-unique-id
Diff against target: 1889 lines (+832/-832)
13 files modified
lib/haproxy.py (+1/-1)
templates/haproxy_cfg.tmpl (+67/-67)
tests/unit/files/content_cache_rendered_haproxy_test_output.txt (+71/-71)
tests/unit/files/content_cache_rendered_haproxy_test_output2.txt (+66/-66)
tests/unit/files/content_cache_rendered_haproxy_test_output3.txt (+66/-66)
tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt (+71/-71)
tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt (+66/-66)
tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt (+71/-71)
tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt (+72/-72)
tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt (+71/-71)
tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt (+66/-66)
tests/unit/files/haproxy_config_rendered_test_output.txt (+72/-72)
tests/unit/files/haproxy_config_rendered_test_output2.txt (+72/-72)
Reviewer Review Type Date Requested Status
Barry Price Approve
Canonical IS Reviewers Pending
Review via email: mp+396636@code.launchpad.net

Commit message

Fix indentation so it's consistent

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Barry Price (barryprice) wrote :

LGTM +1

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 3774c254f111422a5f61c2b592af906be9da33dc

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/haproxy.py b/lib/haproxy.py
index 7c0eabf..f76e083 100644
--- a/lib/haproxy.py
+++ b/lib/haproxy.py
@@ -116,7 +116,7 @@ class HAProxyConf:
116 listen_stanza = """116 listen_stanza = """
117listen {name}117listen {name}
118{bind_config}118{bind_config}
119 capture request header X-Cache-Request-ID len 60119{indent}capture request header X-Cache-Request-ID len 60
120{redirect_config}{backend_config}{default_backend}"""120{redirect_config}{backend_config}{default_backend}"""
121 backend_conf = '{indent}use_backend backend-{backend} if {{ hdr(Host) -i {site_name} }}\n'121 backend_conf = '{indent}use_backend backend-{backend} if {{ hdr(Host) -i {site_name} }}\n'
122 redirect_conf = '{indent}redirect scheme https code 301 if {{ hdr(Host) -i {site_name} }} !{{ ssl_fc }}\n'122 redirect_conf = '{indent}redirect scheme https code 301 if {{ hdr(Host) -i {site_name} }} !{{ ssl_fc }}\n'
diff --git a/templates/haproxy_cfg.tmpl b/templates/haproxy_cfg.tmpl
index c59938c..4b8bdcd 100644
--- a/templates/haproxy_cfg.tmpl
+++ b/templates/haproxy_cfg.tmpl
@@ -1,91 +1,91 @@
1global1global
2{%- if num_procs %}2{%- if num_procs %}
3 nbproc {{num_procs}}3 nbproc {{num_procs}}
4{%- endif %}4{%- endif %}
5{%- if num_threads %}5{%- if num_threads %}
6 nbthread {{num_threads}}6 nbthread {{num_threads}}
7{%- endif %}7{%- endif %}
8 maxconn {{global_max_connections}}8 maxconn {{global_max_connections}}
9 log /dev/log local09 log /dev/log local0
10 log /dev/log local1 notice10 log /dev/log local1 notice
11 chroot /var/lib/haproxy11 chroot /var/lib/haproxy
12 stats socket {{socket_path}} mode 660 level admin expose-fd listeners12 stats socket {{socket_path}} mode 660 level admin expose-fd listeners
13 stats timeout 30s13 stats timeout 30s
14 server-state-file {{saved_server_state_path}}14 server-state-file {{saved_server_state_path}}
15 user haproxy15 user haproxy
16 group haproxy16 group haproxy
17 daemon17 daemon
1818
19 # LP#1874386: Work around lingering HAProxy processes as per LP:187438619 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
20 # and kill them off.20 # and kill them off.
21 hard-stop-after {{hard_stop_after}}21 hard-stop-after {{hard_stop_after}}
2222
23 # Default SSL material locations23 # Default SSL material locations
24 ca-base /etc/ssl/certs24 ca-base /etc/ssl/certs
25 crt-base /etc/ssl/private25 crt-base /etc/ssl/private
2626
27 # Default ciphers to use on SSL-enabled listening sockets.27 # Default ciphers to use on SSL-enabled listening sockets.
28 # For more information, see ciphers(1SSL). This list is from:28 # For more information, see ciphers(1SSL). This list is from:
29 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/29 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
30 # An alternative list with additional directives can be obtained from30 # An alternative list with additional directives can be obtained from
31 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy31 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
32 ssl-default-bind-ciphers {{tls_cipher_suites}}32 ssl-default-bind-ciphers {{tls_cipher_suites}}
33 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1133 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
34 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params34 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
35 tune.ssl.default-dh-param 204835 tune.ssl.default-dh-param 2048
3636
37 # Increase the SSL/TLS session cache from the default 20k. But37 # Increase the SSL/TLS session cache from the default 20k. But
38 # rather than hardcode values, let's just set it to match38 # rather than hardcode values, let's just set it to match
39 # global_max_connections (which by default is calculated using39 # global_max_connections (which by default is calculated using
40 # num. of CPU cores and num. of configured sites). Each entry40 # num. of CPU cores and num. of configured sites). Each entry
41 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,41 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
42 # each with 2000 max conns will only consume around 122 Mbytes42 # each with 2000 max conns will only consume around 122 Mbytes
43 # (32 * 10 * 2000 * 200), which is not much.43 # (32 * 10 * 2000 * 200), which is not much.
44 tune.ssl.cachesize {{global_max_connections}}44 tune.ssl.cachesize {{global_max_connections}}
4545
46defaults46defaults
47 log global47 log global
48 maxconn {{max_connections}}48 maxconn {{max_connections}}
49 mode http49 mode http
50 option dontlognull50 option dontlognull
51 timeout connect 5s51 timeout connect 5s
52 timeout client 50s52 timeout client 50s
53 timeout server 50s53 timeout server 50s
54 errorfile 400 /etc/haproxy/errors/400.http54 errorfile 400 /etc/haproxy/errors/400.http
55 errorfile 403 /etc/haproxy/errors/403.http55 errorfile 403 /etc/haproxy/errors/403.http
56 errorfile 408 /etc/haproxy/errors/408.http56 errorfile 408 /etc/haproxy/errors/408.http
57 errorfile 500 /etc/haproxy/errors/500.http57 errorfile 500 /etc/haproxy/errors/500.http
58 errorfile 502 /etc/haproxy/errors/502.http58 errorfile 502 /etc/haproxy/errors/502.http
59 errorfile 503 /etc/haproxy/errors/503.http59 errorfile 503 /etc/haproxy/errors/503.http
60 errorfile 504 /etc/haproxy/errors/504.http60 errorfile 504 /etc/haproxy/errors/504.http
61 load-server-state-from-file global61 load-server-state-from-file global
62 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid62 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
63 unique-id-header X-Cache-Request-ID63 unique-id-header X-Cache-Request-ID
64 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"64 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6565
66{%- if dns_servers %}66{%- if dns_servers %}
6767
68resolvers dns68resolvers dns
69{%- for resolver in dns_servers %}69{%- for resolver in dns_servers %}
70 nameserver dns{{loop.index}} {{resolver}}:5370 nameserver dns{{loop.index}} {{resolver}}:53
71{%- endfor %}71{%- endfor %}
72 resolve_retries 372 resolve_retries 3
73 timeout resolve 3s73 timeout resolve 3s
74 timeout retry 3s74 timeout retry 3s
75 accepted_payload_size 819275 accepted_payload_size 8192
76{%- endif %}76{%- endif %}
7777
78listen stats78listen stats
79 bind 127.0.0.1:1000079 bind 127.0.0.1:10000
80 acl allowed_cidr src 127.0.0.0/880 acl allowed_cidr src 127.0.0.0/8
81 http-request deny unless allowed_cidr81 http-request deny unless allowed_cidr
8282
83 mode http83 mode http
84 stats enable84 stats enable
85 stats uri /85 stats uri /
86 stats realm Haproxy\ Statistics86 stats realm Haproxy\ Statistics
87 stats auth haproxy:{{monitoring_password}}87 stats auth haproxy:{{monitoring_password}}
88 stats refresh 388 stats refresh 3
8989
90{% for stanza in listen -%}90{% for stanza in listen -%}
91{{stanza}}91{{stanza}}
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
index d187ca5..72bc2d3 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
@@ -1,81 +1,81 @@
1global1global
2 nbthread 42 nbthread 4
3 maxconn 1064963 maxconn 106496
4 log /dev/log local04 log /dev/log local0
5 log /dev/log local1 notice5 log /dev/log local1 notice
6 chroot /var/lib/haproxy6 chroot /var/lib/haproxy
7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
8 stats timeout 30s8 stats timeout 30s
9 server-state-file /run/haproxy/saved-server-state9 server-state-file /run/haproxy/saved-server-state
10 user haproxy10 user haproxy
11 group haproxy11 group haproxy
12 daemon12 daemon
1313
14 # LP#1874386: Work around lingering HAProxy processes as per LP:187438614 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
15 # and kill them off.15 # and kill them off.
16 hard-stop-after 15m16 hard-stop-after 15m
1717
18 # Default SSL material locations18 # Default SSL material locations
19 ca-base /etc/ssl/certs19 ca-base /etc/ssl/certs
20 crt-base /etc/ssl/private20 crt-base /etc/ssl/private
2121
22 # Default ciphers to use on SSL-enabled listening sockets.22 # Default ciphers to use on SSL-enabled listening sockets.
23 # For more information, see ciphers(1SSL). This list is from:23 # For more information, see ciphers(1SSL). This list is from:
24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
25 # An alternative list with additional directives can be obtained from25 # An alternative list with additional directives can be obtained from
26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
27 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv127 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv1
28 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1128 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
30 tune.ssl.default-dh-param 204830 tune.ssl.default-dh-param 2048
3131
32 # Increase the SSL/TLS session cache from the default 20k. But32 # Increase the SSL/TLS session cache from the default 20k. But
33 # rather than hardcode values, let's just set it to match33 # rather than hardcode values, let's just set it to match
34 # global_max_connections (which by default is calculated using34 # global_max_connections (which by default is calculated using
35 # num. of CPU cores and num. of configured sites). Each entry35 # num. of CPU cores and num. of configured sites). Each entry
36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
37 # each with 2000 max conns will only consume around 122 Mbytes37 # each with 2000 max conns will only consume around 122 Mbytes
38 # (32 * 10 * 2000 * 200), which is not much.38 # (32 * 10 * 2000 * 200), which is not much.
39 tune.ssl.cachesize 10649639 tune.ssl.cachesize 106496
4040
41defaults41defaults
42 log global42 log global
43 maxconn 819243 maxconn 8192
44 mode http44 mode http
45 option dontlognull45 option dontlognull
46 timeout connect 5s46 timeout connect 5s
47 timeout client 50s47 timeout client 50s
48 timeout server 50s48 timeout server 50s
49 errorfile 400 /etc/haproxy/errors/400.http49 errorfile 400 /etc/haproxy/errors/400.http
50 errorfile 403 /etc/haproxy/errors/403.http50 errorfile 403 /etc/haproxy/errors/403.http
51 errorfile 408 /etc/haproxy/errors/408.http51 errorfile 408 /etc/haproxy/errors/408.http
52 errorfile 500 /etc/haproxy/errors/500.http52 errorfile 500 /etc/haproxy/errors/500.http
53 errorfile 502 /etc/haproxy/errors/502.http53 errorfile 502 /etc/haproxy/errors/502.http
54 errorfile 503 /etc/haproxy/errors/503.http54 errorfile 503 /etc/haproxy/errors/503.http
55 errorfile 504 /etc/haproxy/errors/504.http55 errorfile 504 /etc/haproxy/errors/504.http
56 load-server-state-from-file global56 load-server-state-from-file global
57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
58 unique-id-header X-Cache-Request-ID58 unique-id-header X-Cache-Request-ID
59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6060
61resolvers dns61resolvers dns
62 nameserver dns1 127.0.0.53:5362 nameserver dns1 127.0.0.53:53
63 resolve_retries 363 resolve_retries 3
64 timeout resolve 3s64 timeout resolve 3s
65 timeout retry 3s65 timeout retry 3s
66 accepted_payload_size 819266 accepted_payload_size 8192
6767
68listen stats68listen stats
69 bind 127.0.0.1:1000069 bind 127.0.0.1:10000
70 acl allowed_cidr src 127.0.0.0/870 acl allowed_cidr src 127.0.0.0/8
71 http-request deny unless allowed_cidr71 http-request deny unless allowed_cidr
7272
73 mode http73 mode http
74 stats enable74 stats enable
75 stats uri /75 stats uri /
76 stats realm Haproxy\ Statistics76 stats realm Haproxy\ Statistics
77 stats auth haproxy:biometricsarenotsecret77 stats auth haproxy:biometricsarenotsecret
78 stats refresh 378 stats refresh 3
7979
8080
81listen combined-8081listen combined-80
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output2.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output2.txt
index 15403b6..a618ceb 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output2.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output2.txt
@@ -1,81 +1,81 @@
1global1global
2 nbthread 42 nbthread 4
3 maxconn 163843 maxconn 16384
4 log /dev/log local04 log /dev/log local0
5 log /dev/log local1 notice5 log /dev/log local1 notice
6 chroot /var/lib/haproxy6 chroot /var/lib/haproxy
7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
8 stats timeout 30s8 stats timeout 30s
9 server-state-file /run/haproxy/saved-server-state9 server-state-file /run/haproxy/saved-server-state
10 user haproxy10 user haproxy
11 group haproxy11 group haproxy
12 daemon12 daemon
1313
14 # LP#1874386: Work around lingering HAProxy processes as per LP:187438614 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
15 # and kill them off.15 # and kill them off.
16 hard-stop-after 15m16 hard-stop-after 15m
1717
18 # Default SSL material locations18 # Default SSL material locations
19 ca-base /etc/ssl/certs19 ca-base /etc/ssl/certs
20 crt-base /etc/ssl/private20 crt-base /etc/ssl/private
2121
22 # Default ciphers to use on SSL-enabled listening sockets.22 # Default ciphers to use on SSL-enabled listening sockets.
23 # For more information, see ciphers(1SSL). This list is from:23 # For more information, see ciphers(1SSL). This list is from:
24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
25 # An alternative list with additional directives can be obtained from25 # An alternative list with additional directives can be obtained from
26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
27 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv127 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv1
28 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1128 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
30 tune.ssl.default-dh-param 204830 tune.ssl.default-dh-param 2048
3131
32 # Increase the SSL/TLS session cache from the default 20k. But32 # Increase the SSL/TLS session cache from the default 20k. But
33 # rather than hardcode values, let's just set it to match33 # rather than hardcode values, let's just set it to match
34 # global_max_connections (which by default is calculated using34 # global_max_connections (which by default is calculated using
35 # num. of CPU cores and num. of configured sites). Each entry35 # num. of CPU cores and num. of configured sites). Each entry
36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
37 # each with 2000 max conns will only consume around 122 Mbytes37 # each with 2000 max conns will only consume around 122 Mbytes
38 # (32 * 10 * 2000 * 200), which is not much.38 # (32 * 10 * 2000 * 200), which is not much.
39 tune.ssl.cachesize 1638439 tune.ssl.cachesize 16384
4040
41defaults41defaults
42 log global42 log global
43 maxconn 819243 maxconn 8192
44 mode http44 mode http
45 option dontlognull45 option dontlognull
46 timeout connect 5s46 timeout connect 5s
47 timeout client 50s47 timeout client 50s
48 timeout server 50s48 timeout server 50s
49 errorfile 400 /etc/haproxy/errors/400.http49 errorfile 400 /etc/haproxy/errors/400.http
50 errorfile 403 /etc/haproxy/errors/403.http50 errorfile 403 /etc/haproxy/errors/403.http
51 errorfile 408 /etc/haproxy/errors/408.http51 errorfile 408 /etc/haproxy/errors/408.http
52 errorfile 500 /etc/haproxy/errors/500.http52 errorfile 500 /etc/haproxy/errors/500.http
53 errorfile 502 /etc/haproxy/errors/502.http53 errorfile 502 /etc/haproxy/errors/502.http
54 errorfile 503 /etc/haproxy/errors/503.http54 errorfile 503 /etc/haproxy/errors/503.http
55 errorfile 504 /etc/haproxy/errors/504.http55 errorfile 504 /etc/haproxy/errors/504.http
56 load-server-state-from-file global56 load-server-state-from-file global
57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
58 unique-id-header X-Cache-Request-ID58 unique-id-header X-Cache-Request-ID
59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6060
61resolvers dns61resolvers dns
62 nameserver dns1 127.0.0.53:5362 nameserver dns1 127.0.0.53:53
63 resolve_retries 363 resolve_retries 3
64 timeout resolve 3s64 timeout resolve 3s
65 timeout retry 3s65 timeout retry 3s
66 accepted_payload_size 819266 accepted_payload_size 8192
6767
68listen stats68listen stats
69 bind 127.0.0.1:1000069 bind 127.0.0.1:10000
70 acl allowed_cidr src 127.0.0.0/870 acl allowed_cidr src 127.0.0.0/8
71 http-request deny unless allowed_cidr71 http-request deny unless allowed_cidr
7272
73 mode http73 mode http
74 stats enable74 stats enable
75 stats uri /75 stats uri /
76 stats realm Haproxy\ Statistics76 stats realm Haproxy\ Statistics
77 stats auth haproxy:biometricsarenotsecret77 stats auth haproxy:biometricsarenotsecret
78 stats refresh 378 stats refresh 3
7979
8080
81listen cached-site1-local81listen cached-site1-local
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output3.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output3.txt
index d87592f..af75f2c 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output3.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output3.txt
@@ -1,81 +1,81 @@
1global1global
2 nbthread 42 nbthread 4
3 maxconn 245763 maxconn 24576
4 log /dev/log local04 log /dev/log local0
5 log /dev/log local1 notice5 log /dev/log local1 notice
6 chroot /var/lib/haproxy6 chroot /var/lib/haproxy
7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
8 stats timeout 30s8 stats timeout 30s
9 server-state-file /run/haproxy/saved-server-state9 server-state-file /run/haproxy/saved-server-state
10 user haproxy10 user haproxy
11 group haproxy11 group haproxy
12 daemon12 daemon
1313
14 # LP#1874386: Work around lingering HAProxy processes as per LP:187438614 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
15 # and kill them off.15 # and kill them off.
16 hard-stop-after 15m16 hard-stop-after 15m
1717
18 # Default SSL material locations18 # Default SSL material locations
19 ca-base /etc/ssl/certs19 ca-base /etc/ssl/certs
20 crt-base /etc/ssl/private20 crt-base /etc/ssl/private
2121
22 # Default ciphers to use on SSL-enabled listening sockets.22 # Default ciphers to use on SSL-enabled listening sockets.
23 # For more information, see ciphers(1SSL). This list is from:23 # For more information, see ciphers(1SSL). This list is from:
24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
25 # An alternative list with additional directives can be obtained from25 # An alternative list with additional directives can be obtained from
26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
27 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv127 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv1
28 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1128 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
30 tune.ssl.default-dh-param 204830 tune.ssl.default-dh-param 2048
3131
32 # Increase the SSL/TLS session cache from the default 20k. But32 # Increase the SSL/TLS session cache from the default 20k. But
33 # rather than hardcode values, let's just set it to match33 # rather than hardcode values, let's just set it to match
34 # global_max_connections (which by default is calculated using34 # global_max_connections (which by default is calculated using
35 # num. of CPU cores and num. of configured sites). Each entry35 # num. of CPU cores and num. of configured sites). Each entry
36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
37 # each with 2000 max conns will only consume around 122 Mbytes37 # each with 2000 max conns will only consume around 122 Mbytes
38 # (32 * 10 * 2000 * 200), which is not much.38 # (32 * 10 * 2000 * 200), which is not much.
39 tune.ssl.cachesize 2457639 tune.ssl.cachesize 24576
4040
41defaults41defaults
42 log global42 log global
43 maxconn 819243 maxconn 8192
44 mode http44 mode http
45 option dontlognull45 option dontlognull
46 timeout connect 5s46 timeout connect 5s
47 timeout client 50s47 timeout client 50s
48 timeout server 50s48 timeout server 50s
49 errorfile 400 /etc/haproxy/errors/400.http49 errorfile 400 /etc/haproxy/errors/400.http
50 errorfile 403 /etc/haproxy/errors/403.http50 errorfile 403 /etc/haproxy/errors/403.http
51 errorfile 408 /etc/haproxy/errors/408.http51 errorfile 408 /etc/haproxy/errors/408.http
52 errorfile 500 /etc/haproxy/errors/500.http52 errorfile 500 /etc/haproxy/errors/500.http
53 errorfile 502 /etc/haproxy/errors/502.http53 errorfile 502 /etc/haproxy/errors/502.http
54 errorfile 503 /etc/haproxy/errors/503.http54 errorfile 503 /etc/haproxy/errors/503.http
55 errorfile 504 /etc/haproxy/errors/504.http55 errorfile 504 /etc/haproxy/errors/504.http
56 load-server-state-from-file global56 load-server-state-from-file global
57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
58 unique-id-header X-Cache-Request-ID58 unique-id-header X-Cache-Request-ID
59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6060
61resolvers dns61resolvers dns
62 nameserver dns1 127.0.0.53:5362 nameserver dns1 127.0.0.53:53
63 resolve_retries 363 resolve_retries 3
64 timeout resolve 3s64 timeout resolve 3s
65 timeout retry 3s65 timeout retry 3s
66 accepted_payload_size 819266 accepted_payload_size 8192
6767
68listen stats68listen stats
69 bind 127.0.0.1:1000069 bind 127.0.0.1:10000
70 acl allowed_cidr src 127.0.0.0/870 acl allowed_cidr src 127.0.0.0/8
71 http-request deny unless allowed_cidr71 http-request deny unless allowed_cidr
7272
73 mode http73 mode http
74 stats enable74 stats enable
75 stats uri /75 stats uri /
76 stats realm Haproxy\ Statistics76 stats realm Haproxy\ Statistics
77 stats auth haproxy:biometricsarenotsecret77 stats auth haproxy:biometricsarenotsecret
78 stats refresh 378 stats refresh 3
7979
8080
81listen redirect-site1-local81listen redirect-site1-local
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
index 070f1b7..25b27e5 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
@@ -1,81 +1,81 @@
1global1global
2 nbthread 42 nbthread 4
3 maxconn 1040003 maxconn 104000
4 log /dev/log local04 log /dev/log local0
5 log /dev/log local1 notice5 log /dev/log local1 notice
6 chroot /var/lib/haproxy6 chroot /var/lib/haproxy
7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
8 stats timeout 30s8 stats timeout 30s
9 server-state-file /run/haproxy/saved-server-state9 server-state-file /run/haproxy/saved-server-state
10 user haproxy10 user haproxy
11 group haproxy11 group haproxy
12 daemon12 daemon
1313
14 # LP#1874386: Work around lingering HAProxy processes as per LP:187438614 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
15 # and kill them off.15 # and kill them off.
16 hard-stop-after 15m16 hard-stop-after 15m
1717
18 # Default SSL material locations18 # Default SSL material locations
19 ca-base /etc/ssl/certs19 ca-base /etc/ssl/certs
20 crt-base /etc/ssl/private20 crt-base /etc/ssl/private
2121
22 # Default ciphers to use on SSL-enabled listening sockets.22 # Default ciphers to use on SSL-enabled listening sockets.
23 # For more information, see ciphers(1SSL). This list is from:23 # For more information, see ciphers(1SSL). This list is from:
24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
25 # An alternative list with additional directives can be obtained from25 # An alternative list with additional directives can be obtained from
26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
27 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv127 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv1
28 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1128 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
30 tune.ssl.default-dh-param 204830 tune.ssl.default-dh-param 2048
3131
32 # Increase the SSL/TLS session cache from the default 20k. But32 # Increase the SSL/TLS session cache from the default 20k. But
33 # rather than hardcode values, let's just set it to match33 # rather than hardcode values, let's just set it to match
34 # global_max_connections (which by default is calculated using34 # global_max_connections (which by default is calculated using
35 # num. of CPU cores and num. of configured sites). Each entry35 # num. of CPU cores and num. of configured sites). Each entry
36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
37 # each with 2000 max conns will only consume around 122 Mbytes37 # each with 2000 max conns will only consume around 122 Mbytes
38 # (32 * 10 * 2000 * 200), which is not much.38 # (32 * 10 * 2000 * 200), which is not much.
39 tune.ssl.cachesize 10400039 tune.ssl.cachesize 104000
4040
41defaults41defaults
42 log global42 log global
43 maxconn 800043 maxconn 8000
44 mode http44 mode http
45 option dontlognull45 option dontlognull
46 timeout connect 5s46 timeout connect 5s
47 timeout client 50s47 timeout client 50s
48 timeout server 50s48 timeout server 50s
49 errorfile 400 /etc/haproxy/errors/400.http49 errorfile 400 /etc/haproxy/errors/400.http
50 errorfile 403 /etc/haproxy/errors/403.http50 errorfile 403 /etc/haproxy/errors/403.http
51 errorfile 408 /etc/haproxy/errors/408.http51 errorfile 408 /etc/haproxy/errors/408.http
52 errorfile 500 /etc/haproxy/errors/500.http52 errorfile 500 /etc/haproxy/errors/500.http
53 errorfile 502 /etc/haproxy/errors/502.http53 errorfile 502 /etc/haproxy/errors/502.http
54 errorfile 503 /etc/haproxy/errors/503.http54 errorfile 503 /etc/haproxy/errors/503.http
55 errorfile 504 /etc/haproxy/errors/504.http55 errorfile 504 /etc/haproxy/errors/504.http
56 load-server-state-from-file global56 load-server-state-from-file global
57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
58 unique-id-header X-Cache-Request-ID58 unique-id-header X-Cache-Request-ID
59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6060
61resolvers dns61resolvers dns
62 nameserver dns1 127.0.0.53:5362 nameserver dns1 127.0.0.53:53
63 resolve_retries 363 resolve_retries 3
64 timeout resolve 3s64 timeout resolve 3s
65 timeout retry 3s65 timeout retry 3s
66 accepted_payload_size 819266 accepted_payload_size 8192
6767
68listen stats68listen stats
69 bind 127.0.0.1:1000069 bind 127.0.0.1:10000
70 acl allowed_cidr src 127.0.0.0/870 acl allowed_cidr src 127.0.0.0/8
71 http-request deny unless allowed_cidr71 http-request deny unless allowed_cidr
7272
73 mode http73 mode http
74 stats enable74 stats enable
75 stats uri /75 stats uri /
76 stats realm Haproxy\ Statistics76 stats realm Haproxy\ Statistics
77 stats auth haproxy:biometricsarenotsecret77 stats auth haproxy:biometricsarenotsecret
78 stats refresh 378 stats refresh 3
7979
8080
81listen combined-8081listen combined-80
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt
index 4ad1982..d42878a 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt
@@ -1,81 +1,81 @@
1global1global
2 nbthread 42 nbthread 4
3 maxconn 245763 maxconn 24576
4 log /dev/log local04 log /dev/log local0
5 log /dev/log local1 notice5 log /dev/log local1 notice
6 chroot /var/lib/haproxy6 chroot /var/lib/haproxy
7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
8 stats timeout 30s8 stats timeout 30s
9 server-state-file /run/haproxy/saved-server-state9 server-state-file /run/haproxy/saved-server-state
10 user haproxy10 user haproxy
11 group haproxy11 group haproxy
12 daemon12 daemon
1313
14 # LP#1874386: Work around lingering HAProxy processes as per LP:187438614 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
15 # and kill them off.15 # and kill them off.
16 hard-stop-after 15m16 hard-stop-after 15m
1717
18 # Default SSL material locations18 # Default SSL material locations
19 ca-base /etc/ssl/certs19 ca-base /etc/ssl/certs
20 crt-base /etc/ssl/private20 crt-base /etc/ssl/private
2121
22 # Default ciphers to use on SSL-enabled listening sockets.22 # Default ciphers to use on SSL-enabled listening sockets.
23 # For more information, see ciphers(1SSL). This list is from:23 # For more information, see ciphers(1SSL). This list is from:
24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
25 # An alternative list with additional directives can be obtained from25 # An alternative list with additional directives can be obtained from
26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
27 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv127 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv1
28 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1128 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
30 tune.ssl.default-dh-param 204830 tune.ssl.default-dh-param 2048
3131
32 # Increase the SSL/TLS session cache from the default 20k. But32 # Increase the SSL/TLS session cache from the default 20k. But
33 # rather than hardcode values, let's just set it to match33 # rather than hardcode values, let's just set it to match
34 # global_max_connections (which by default is calculated using34 # global_max_connections (which by default is calculated using
35 # num. of CPU cores and num. of configured sites). Each entry35 # num. of CPU cores and num. of configured sites). Each entry
36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
37 # each with 2000 max conns will only consume around 122 Mbytes37 # each with 2000 max conns will only consume around 122 Mbytes
38 # (32 * 10 * 2000 * 200), which is not much.38 # (32 * 10 * 2000 * 200), which is not much.
39 tune.ssl.cachesize 2457639 tune.ssl.cachesize 24576
4040
41defaults41defaults
42 log global42 log global
43 maxconn 819243 maxconn 8192
44 mode http44 mode http
45 option dontlognull45 option dontlognull
46 timeout connect 5s46 timeout connect 5s
47 timeout client 50s47 timeout client 50s
48 timeout server 50s48 timeout server 50s
49 errorfile 400 /etc/haproxy/errors/400.http49 errorfile 400 /etc/haproxy/errors/400.http
50 errorfile 403 /etc/haproxy/errors/403.http50 errorfile 403 /etc/haproxy/errors/403.http
51 errorfile 408 /etc/haproxy/errors/408.http51 errorfile 408 /etc/haproxy/errors/408.http
52 errorfile 500 /etc/haproxy/errors/500.http52 errorfile 500 /etc/haproxy/errors/500.http
53 errorfile 502 /etc/haproxy/errors/502.http53 errorfile 502 /etc/haproxy/errors/502.http
54 errorfile 503 /etc/haproxy/errors/503.http54 errorfile 503 /etc/haproxy/errors/503.http
55 errorfile 504 /etc/haproxy/errors/504.http55 errorfile 504 /etc/haproxy/errors/504.http
56 load-server-state-from-file global56 load-server-state-from-file global
57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
58 unique-id-header X-Cache-Request-ID58 unique-id-header X-Cache-Request-ID
59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6060
61resolvers dns61resolvers dns
62 nameserver dns1 127.0.0.53:5362 nameserver dns1 127.0.0.53:53
63 resolve_retries 363 resolve_retries 3
64 timeout resolve 3s64 timeout resolve 3s
65 timeout retry 3s65 timeout retry 3s
66 accepted_payload_size 819266 accepted_payload_size 8192
6767
68listen stats68listen stats
69 bind 127.0.0.1:1000069 bind 127.0.0.1:10000
70 acl allowed_cidr src 127.0.0.0/870 acl allowed_cidr src 127.0.0.0/8
71 http-request deny unless allowed_cidr71 http-request deny unless allowed_cidr
7272
73 mode http73 mode http
74 stats enable74 stats enable
75 stats uri /75 stats uri /
76 stats realm Haproxy\ Statistics76 stats realm Haproxy\ Statistics
77 stats auth haproxy:biometricsarenotsecret77 stats auth haproxy:biometricsarenotsecret
78 stats refresh 378 stats refresh 3
7979
8080
81listen cached-site1-local81listen cached-site1-local
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
index 14380ea..c17ee47 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
@@ -1,81 +1,81 @@
1global1global
2 nbthread 42 nbthread 4
3 maxconn 1064963 maxconn 106496
4 log /dev/log local04 log /dev/log local0
5 log /dev/log local1 notice5 log /dev/log local1 notice
6 chroot /var/lib/haproxy6 chroot /var/lib/haproxy
7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
8 stats timeout 30s8 stats timeout 30s
9 server-state-file /run/haproxy/saved-server-state9 server-state-file /run/haproxy/saved-server-state
10 user haproxy10 user haproxy
11 group haproxy11 group haproxy
12 daemon12 daemon
1313
14 # LP#1874386: Work around lingering HAProxy processes as per LP:187438614 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
15 # and kill them off.15 # and kill them off.
16 hard-stop-after 15m16 hard-stop-after 15m
1717
18 # Default SSL material locations18 # Default SSL material locations
19 ca-base /etc/ssl/certs19 ca-base /etc/ssl/certs
20 crt-base /etc/ssl/private20 crt-base /etc/ssl/private
2121
22 # Default ciphers to use on SSL-enabled listening sockets.22 # Default ciphers to use on SSL-enabled listening sockets.
23 # For more information, see ciphers(1SSL). This list is from:23 # For more information, see ciphers(1SSL). This list is from:
24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
25 # An alternative list with additional directives can be obtained from25 # An alternative list with additional directives can be obtained from
26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
27 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv127 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv1
28 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1128 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
30 tune.ssl.default-dh-param 204830 tune.ssl.default-dh-param 2048
3131
32 # Increase the SSL/TLS session cache from the default 20k. But32 # Increase the SSL/TLS session cache from the default 20k. But
33 # rather than hardcode values, let's just set it to match33 # rather than hardcode values, let's just set it to match
34 # global_max_connections (which by default is calculated using34 # global_max_connections (which by default is calculated using
35 # num. of CPU cores and num. of configured sites). Each entry35 # num. of CPU cores and num. of configured sites). Each entry
36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
37 # each with 2000 max conns will only consume around 122 Mbytes37 # each with 2000 max conns will only consume around 122 Mbytes
38 # (32 * 10 * 2000 * 200), which is not much.38 # (32 * 10 * 2000 * 200), which is not much.
39 tune.ssl.cachesize 10649639 tune.ssl.cachesize 106496
4040
41defaults41defaults
42 log global42 log global
43 maxconn 819243 maxconn 8192
44 mode http44 mode http
45 option dontlognull45 option dontlognull
46 timeout connect 5s46 timeout connect 5s
47 timeout client 50s47 timeout client 50s
48 timeout server 50s48 timeout server 50s
49 errorfile 400 /etc/haproxy/errors/400.http49 errorfile 400 /etc/haproxy/errors/400.http
50 errorfile 403 /etc/haproxy/errors/403.http50 errorfile 403 /etc/haproxy/errors/403.http
51 errorfile 408 /etc/haproxy/errors/408.http51 errorfile 408 /etc/haproxy/errors/408.http
52 errorfile 500 /etc/haproxy/errors/500.http52 errorfile 500 /etc/haproxy/errors/500.http
53 errorfile 502 /etc/haproxy/errors/502.http53 errorfile 502 /etc/haproxy/errors/502.http
54 errorfile 503 /etc/haproxy/errors/503.http54 errorfile 503 /etc/haproxy/errors/503.http
55 errorfile 504 /etc/haproxy/errors/504.http55 errorfile 504 /etc/haproxy/errors/504.http
56 load-server-state-from-file global56 load-server-state-from-file global
57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
58 unique-id-header X-Cache-Request-ID58 unique-id-header X-Cache-Request-ID
59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6060
61resolvers dns61resolvers dns
62 nameserver dns1 127.0.0.53:5362 nameserver dns1 127.0.0.53:53
63 resolve_retries 363 resolve_retries 3
64 timeout resolve 3s64 timeout resolve 3s
65 timeout retry 3s65 timeout retry 3s
66 accepted_payload_size 819266 accepted_payload_size 8192
6767
68listen stats68listen stats
69 bind 127.0.0.1:1000069 bind 127.0.0.1:10000
70 acl allowed_cidr src 127.0.0.0/870 acl allowed_cidr src 127.0.0.0/8
71 http-request deny unless allowed_cidr71 http-request deny unless allowed_cidr
7272
73 mode http73 mode http
74 stats enable74 stats enable
75 stats uri /75 stats uri /
76 stats realm Haproxy\ Statistics76 stats realm Haproxy\ Statistics
77 stats auth haproxy:biometricsarenotsecret77 stats auth haproxy:biometricsarenotsecret
78 stats refresh 378 stats refresh 3
7979
8080
81listen combined-8081listen combined-80
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
index 72d1109..a27ff31 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
@@ -1,82 +1,82 @@
1global1global
2 nbproc 32 nbproc 3
3 nbthread 103 nbthread 10
4 maxconn 2600004 maxconn 260000
5 log /dev/log local05 log /dev/log local0
6 log /dev/log local1 notice6 log /dev/log local1 notice
7 chroot /var/lib/haproxy7 chroot /var/lib/haproxy
8 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners8 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
9 stats timeout 30s9 stats timeout 30s
10 server-state-file /run/haproxy/saved-server-state10 server-state-file /run/haproxy/saved-server-state
11 user haproxy11 user haproxy
12 group haproxy12 group haproxy
13 daemon13 daemon
1414
15 # LP#1874386: Work around lingering HAProxy processes as per LP:187438615 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
16 # and kill them off.16 # and kill them off.
17 hard-stop-after 15m17 hard-stop-after 15m
1818
19 # Default SSL material locations19 # Default SSL material locations
20 ca-base /etc/ssl/certs20 ca-base /etc/ssl/certs
21 crt-base /etc/ssl/private21 crt-base /etc/ssl/private
2222
23 # Default ciphers to use on SSL-enabled listening sockets.23 # Default ciphers to use on SSL-enabled listening sockets.
24 # For more information, see ciphers(1SSL). This list is from:24 # For more information, see ciphers(1SSL). This list is from:
25 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/25 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
26 # An alternative list with additional directives can be obtained from26 # An alternative list with additional directives can be obtained from
27 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy27 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
28 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv128 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv1
29 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1129 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
30 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params30 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
31 tune.ssl.default-dh-param 204831 tune.ssl.default-dh-param 2048
3232
33 # Increase the SSL/TLS session cache from the default 20k. But33 # Increase the SSL/TLS session cache from the default 20k. But
34 # rather than hardcode values, let's just set it to match34 # rather than hardcode values, let's just set it to match
35 # global_max_connections (which by default is calculated using35 # global_max_connections (which by default is calculated using
36 # num. of CPU cores and num. of configured sites). Each entry36 # num. of CPU cores and num. of configured sites). Each entry
37 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,37 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
38 # each with 2000 max conns will only consume around 122 Mbytes38 # each with 2000 max conns will only consume around 122 Mbytes
39 # (32 * 10 * 2000 * 200), which is not much.39 # (32 * 10 * 2000 * 200), which is not much.
40 tune.ssl.cachesize 26000040 tune.ssl.cachesize 260000
4141
42defaults42defaults
43 log global43 log global
44 maxconn 2000044 maxconn 20000
45 mode http45 mode http
46 option dontlognull46 option dontlognull
47 timeout connect 5s47 timeout connect 5s
48 timeout client 50s48 timeout client 50s
49 timeout server 50s49 timeout server 50s
50 errorfile 400 /etc/haproxy/errors/400.http50 errorfile 400 /etc/haproxy/errors/400.http
51 errorfile 403 /etc/haproxy/errors/403.http51 errorfile 403 /etc/haproxy/errors/403.http
52 errorfile 408 /etc/haproxy/errors/408.http52 errorfile 408 /etc/haproxy/errors/408.http
53 errorfile 500 /etc/haproxy/errors/500.http53 errorfile 500 /etc/haproxy/errors/500.http
54 errorfile 502 /etc/haproxy/errors/502.http54 errorfile 502 /etc/haproxy/errors/502.http
55 errorfile 503 /etc/haproxy/errors/503.http55 errorfile 503 /etc/haproxy/errors/503.http
56 errorfile 504 /etc/haproxy/errors/504.http56 errorfile 504 /etc/haproxy/errors/504.http
57 load-server-state-from-file global57 load-server-state-from-file global
58 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid58 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
59 unique-id-header X-Cache-Request-ID59 unique-id-header X-Cache-Request-ID
60 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"60 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6161
62resolvers dns62resolvers dns
63 nameserver dns1 127.0.0.53:5363 nameserver dns1 127.0.0.53:53
64 resolve_retries 364 resolve_retries 3
65 timeout resolve 3s65 timeout resolve 3s
66 timeout retry 3s66 timeout retry 3s
67 accepted_payload_size 819267 accepted_payload_size 8192
6868
69listen stats69listen stats
70 bind 127.0.0.1:1000070 bind 127.0.0.1:10000
71 acl allowed_cidr src 127.0.0.0/871 acl allowed_cidr src 127.0.0.0/8
72 http-request deny unless allowed_cidr72 http-request deny unless allowed_cidr
7373
74 mode http74 mode http
75 stats enable75 stats enable
76 stats uri /76 stats uri /
77 stats realm Haproxy\ Statistics77 stats realm Haproxy\ Statistics
78 stats auth haproxy:biometricsarenotsecret78 stats auth haproxy:biometricsarenotsecret
79 stats refresh 379 stats refresh 3
8080
8181
82listen combined-8082listen combined-80
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt
index 015bc9c..2a6ee1a 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt
@@ -1,81 +1,81 @@
1global1global
2 nbthread 302 nbthread 30
3 maxconn 5242883 maxconn 524288
4 log /dev/log local04 log /dev/log local0
5 log /dev/log local1 notice5 log /dev/log local1 notice
6 chroot /var/lib/haproxy6 chroot /var/lib/haproxy
7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
8 stats timeout 30s8 stats timeout 30s
9 server-state-file /run/haproxy/saved-server-state9 server-state-file /run/haproxy/saved-server-state
10 user haproxy10 user haproxy
11 group haproxy11 group haproxy
12 daemon12 daemon
1313
14 # LP#1874386: Work around lingering HAProxy processes as per LP:187438614 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
15 # and kill them off.15 # and kill them off.
16 hard-stop-after 15m16 hard-stop-after 15m
1717
18 # Default SSL material locations18 # Default SSL material locations
19 ca-base /etc/ssl/certs19 ca-base /etc/ssl/certs
20 crt-base /etc/ssl/private20 crt-base /etc/ssl/private
2121
22 # Default ciphers to use on SSL-enabled listening sockets.22 # Default ciphers to use on SSL-enabled listening sockets.
23 # For more information, see ciphers(1SSL). This list is from:23 # For more information, see ciphers(1SSL). This list is from:
24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
25 # An alternative list with additional directives can be obtained from25 # An alternative list with additional directives can be obtained from
26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
27 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv127 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv1
28 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1128 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
30 tune.ssl.default-dh-param 204830 tune.ssl.default-dh-param 2048
3131
32 # Increase the SSL/TLS session cache from the default 20k. But32 # Increase the SSL/TLS session cache from the default 20k. But
33 # rather than hardcode values, let's just set it to match33 # rather than hardcode values, let's just set it to match
34 # global_max_connections (which by default is calculated using34 # global_max_connections (which by default is calculated using
35 # num. of CPU cores and num. of configured sites). Each entry35 # num. of CPU cores and num. of configured sites). Each entry
36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
37 # each with 2000 max conns will only consume around 122 Mbytes37 # each with 2000 max conns will only consume around 122 Mbytes
38 # (32 * 10 * 2000 * 200), which is not much.38 # (32 * 10 * 2000 * 200), which is not much.
39 tune.ssl.cachesize 52428839 tune.ssl.cachesize 524288
4040
41defaults41defaults
42 log global42 log global
43 maxconn 6000043 maxconn 60000
44 mode http44 mode http
45 option dontlognull45 option dontlognull
46 timeout connect 5s46 timeout connect 5s
47 timeout client 50s47 timeout client 50s
48 timeout server 50s48 timeout server 50s
49 errorfile 400 /etc/haproxy/errors/400.http49 errorfile 400 /etc/haproxy/errors/400.http
50 errorfile 403 /etc/haproxy/errors/403.http50 errorfile 403 /etc/haproxy/errors/403.http
51 errorfile 408 /etc/haproxy/errors/408.http51 errorfile 408 /etc/haproxy/errors/408.http
52 errorfile 500 /etc/haproxy/errors/500.http52 errorfile 500 /etc/haproxy/errors/500.http
53 errorfile 502 /etc/haproxy/errors/502.http53 errorfile 502 /etc/haproxy/errors/502.http
54 errorfile 503 /etc/haproxy/errors/503.http54 errorfile 503 /etc/haproxy/errors/503.http
55 errorfile 504 /etc/haproxy/errors/504.http55 errorfile 504 /etc/haproxy/errors/504.http
56 load-server-state-from-file global56 load-server-state-from-file global
57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
58 unique-id-header X-Cache-Request-ID58 unique-id-header X-Cache-Request-ID
59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6060
61resolvers dns61resolvers dns
62 nameserver dns1 127.0.0.53:5362 nameserver dns1 127.0.0.53:53
63 resolve_retries 363 resolve_retries 3
64 timeout resolve 3s64 timeout resolve 3s
65 timeout retry 3s65 timeout retry 3s
66 accepted_payload_size 819266 accepted_payload_size 8192
6767
68listen stats68listen stats
69 bind 127.0.0.1:1000069 bind 127.0.0.1:10000
70 acl allowed_cidr src 127.0.0.0/870 acl allowed_cidr src 127.0.0.0/8
71 http-request deny unless allowed_cidr71 http-request deny unless allowed_cidr
7272
73 mode http73 mode http
74 stats enable74 stats enable
75 stats uri /75 stats uri /
76 stats realm Haproxy\ Statistics76 stats realm Haproxy\ Statistics
77 stats auth haproxy:biometricsarenotsecret77 stats auth haproxy:biometricsarenotsecret
78 stats refresh 378 stats refresh 3
7979
8080
81listen combined-8081listen combined-80
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt
index bc80f29..8a219b5 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt
@@ -1,81 +1,81 @@
1global1global
2 nbthread 42 nbthread 4
3 maxconn 163843 maxconn 16384
4 log /dev/log local04 log /dev/log local0
5 log /dev/log local1 notice5 log /dev/log local1 notice
6 chroot /var/lib/haproxy6 chroot /var/lib/haproxy
7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners7 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
8 stats timeout 30s8 stats timeout 30s
9 server-state-file /run/haproxy/saved-server-state9 server-state-file /run/haproxy/saved-server-state
10 user haproxy10 user haproxy
11 group haproxy11 group haproxy
12 daemon12 daemon
1313
14 # LP#1874386: Work around lingering HAProxy processes as per LP:187438614 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
15 # and kill them off.15 # and kill them off.
16 hard-stop-after 15m16 hard-stop-after 15m
1717
18 # Default SSL material locations18 # Default SSL material locations
19 ca-base /etc/ssl/certs19 ca-base /etc/ssl/certs
20 crt-base /etc/ssl/private20 crt-base /etc/ssl/private
2121
22 # Default ciphers to use on SSL-enabled listening sockets.22 # Default ciphers to use on SSL-enabled listening sockets.
23 # For more information, see ciphers(1SSL). This list is from:23 # For more information, see ciphers(1SSL). This list is from:
24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/24 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
25 # An alternative list with additional directives can be obtained from25 # An alternative list with additional directives can be obtained from
26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy26 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
27 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv127 ssl-default-bind-ciphers ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:!SSLv3:!TLSv1
28 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1128 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params29 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
30 tune.ssl.default-dh-param 204830 tune.ssl.default-dh-param 2048
3131
32 # Increase the SSL/TLS session cache from the default 20k. But32 # Increase the SSL/TLS session cache from the default 20k. But
33 # rather than hardcode values, let's just set it to match33 # rather than hardcode values, let's just set it to match
34 # global_max_connections (which by default is calculated using34 # global_max_connections (which by default is calculated using
35 # num. of CPU cores and num. of configured sites). Each entry35 # num. of CPU cores and num. of configured sites). Each entry
36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,36 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
37 # each with 2000 max conns will only consume around 122 Mbytes37 # each with 2000 max conns will only consume around 122 Mbytes
38 # (32 * 10 * 2000 * 200), which is not much.38 # (32 * 10 * 2000 * 200), which is not much.
39 tune.ssl.cachesize 1638439 tune.ssl.cachesize 16384
4040
41defaults41defaults
42 log global42 log global
43 maxconn 819243 maxconn 8192
44 mode http44 mode http
45 option dontlognull45 option dontlognull
46 timeout connect 5s46 timeout connect 5s
47 timeout client 50s47 timeout client 50s
48 timeout server 50s48 timeout server 50s
49 errorfile 400 /etc/haproxy/errors/400.http49 errorfile 400 /etc/haproxy/errors/400.http
50 errorfile 403 /etc/haproxy/errors/403.http50 errorfile 403 /etc/haproxy/errors/403.http
51 errorfile 408 /etc/haproxy/errors/408.http51 errorfile 408 /etc/haproxy/errors/408.http
52 errorfile 500 /etc/haproxy/errors/500.http52 errorfile 500 /etc/haproxy/errors/500.http
53 errorfile 502 /etc/haproxy/errors/502.http53 errorfile 502 /etc/haproxy/errors/502.http
54 errorfile 503 /etc/haproxy/errors/503.http54 errorfile 503 /etc/haproxy/errors/503.http
55 errorfile 504 /etc/haproxy/errors/504.http55 errorfile 504 /etc/haproxy/errors/504.http
56 load-server-state-from-file global56 load-server-state-from-file global
57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid57 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
58 unique-id-header X-Cache-Request-ID58 unique-id-header X-Cache-Request-ID
59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"59 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6060
61resolvers dns61resolvers dns
62 nameserver dns1 127.0.0.53:5362 nameserver dns1 127.0.0.53:53
63 resolve_retries 363 resolve_retries 3
64 timeout resolve 3s64 timeout resolve 3s
65 timeout retry 3s65 timeout retry 3s
66 accepted_payload_size 819266 accepted_payload_size 8192
6767
68listen stats68listen stats
69 bind 127.0.0.1:1000069 bind 127.0.0.1:10000
70 acl allowed_cidr src 127.0.0.0/870 acl allowed_cidr src 127.0.0.0/8
71 http-request deny unless allowed_cidr71 http-request deny unless allowed_cidr
7272
73 mode http73 mode http
74 stats enable74 stats enable
75 stats uri /75 stats uri /
76 stats realm Haproxy\ Statistics76 stats realm Haproxy\ Statistics
77 stats auth haproxy:biometricsarenotsecret77 stats auth haproxy:biometricsarenotsecret
78 stats refresh 378 stats refresh 3
7979
8080
81listen cached-site1-local81listen cached-site1-local
diff --git a/tests/unit/files/haproxy_config_rendered_test_output.txt b/tests/unit/files/haproxy_config_rendered_test_output.txt
index 8badf52..dd6b279 100644
--- a/tests/unit/files/haproxy_config_rendered_test_output.txt
+++ b/tests/unit/files/haproxy_config_rendered_test_output.txt
@@ -1,82 +1,82 @@
1global1global
2 nbproc 22 nbproc 2
3 nbthread 43 nbthread 4
4 maxconn 150004 maxconn 15000
5 log /dev/log local05 log /dev/log local0
6 log /dev/log local1 notice6 log /dev/log local1 notice
7 chroot /var/lib/haproxy7 chroot /var/lib/haproxy
8 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners8 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
9 stats timeout 30s9 stats timeout 30s
10 server-state-file /run/haproxy/saved-server-state10 server-state-file /run/haproxy/saved-server-state
11 user haproxy11 user haproxy
12 group haproxy12 group haproxy
13 daemon13 daemon
1414
15 # LP#1874386: Work around lingering HAProxy processes as per LP:187438615 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
16 # and kill them off.16 # and kill them off.
17 hard-stop-after 5m17 hard-stop-after 5m
1818
19 # Default SSL material locations19 # Default SSL material locations
20 ca-base /etc/ssl/certs20 ca-base /etc/ssl/certs
21 crt-base /etc/ssl/private21 crt-base /etc/ssl/private
2222
23 # Default ciphers to use on SSL-enabled listening sockets.23 # Default ciphers to use on SSL-enabled listening sockets.
24 # For more information, see ciphers(1SSL). This list is from:24 # For more information, see ciphers(1SSL). This list is from:
25 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/25 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
26 # An alternative list with additional directives can be obtained from26 # An alternative list with additional directives can be obtained from
27 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy27 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
28 ssl-default-bind-ciphers ECDH+AESGCM:!aNULL:!MD5:!DSS28 ssl-default-bind-ciphers ECDH+AESGCM:!aNULL:!MD5:!DSS
29 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1129 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
30 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params30 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
31 tune.ssl.default-dh-param 204831 tune.ssl.default-dh-param 2048
3232
33 # Increase the SSL/TLS session cache from the default 20k. But33 # Increase the SSL/TLS session cache from the default 20k. But
34 # rather than hardcode values, let's just set it to match34 # rather than hardcode values, let's just set it to match
35 # global_max_connections (which by default is calculated using35 # global_max_connections (which by default is calculated using
36 # num. of CPU cores and num. of configured sites). Each entry36 # num. of CPU cores and num. of configured sites). Each entry
37 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,37 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
38 # each with 2000 max conns will only consume around 122 Mbytes38 # each with 2000 max conns will only consume around 122 Mbytes
39 # (32 * 10 * 2000 * 200), which is not much.39 # (32 * 10 * 2000 * 200), which is not much.
40 tune.ssl.cachesize 1500040 tune.ssl.cachesize 15000
4141
42defaults42defaults
43 log global43 log global
44 maxconn 500044 maxconn 5000
45 mode http45 mode http
46 option dontlognull46 option dontlognull
47 timeout connect 5s47 timeout connect 5s
48 timeout client 50s48 timeout client 50s
49 timeout server 50s49 timeout server 50s
50 errorfile 400 /etc/haproxy/errors/400.http50 errorfile 400 /etc/haproxy/errors/400.http
51 errorfile 403 /etc/haproxy/errors/403.http51 errorfile 403 /etc/haproxy/errors/403.http
52 errorfile 408 /etc/haproxy/errors/408.http52 errorfile 408 /etc/haproxy/errors/408.http
53 errorfile 500 /etc/haproxy/errors/500.http53 errorfile 500 /etc/haproxy/errors/500.http
54 errorfile 502 /etc/haproxy/errors/502.http54 errorfile 502 /etc/haproxy/errors/502.http
55 errorfile 503 /etc/haproxy/errors/503.http55 errorfile 503 /etc/haproxy/errors/503.http
56 errorfile 504 /etc/haproxy/errors/504.http56 errorfile 504 /etc/haproxy/errors/504.http
57 load-server-state-from-file global57 load-server-state-from-file global
58 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid58 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
59 unique-id-header X-Cache-Request-ID59 unique-id-header X-Cache-Request-ID
60 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"60 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6161
62resolvers dns62resolvers dns
63 nameserver dns1 127.0.0.53:5363 nameserver dns1 127.0.0.53:53
64 resolve_retries 364 resolve_retries 3
65 timeout resolve 3s65 timeout resolve 3s
66 timeout retry 3s66 timeout retry 3s
67 accepted_payload_size 819267 accepted_payload_size 8192
6868
69listen stats69listen stats
70 bind 127.0.0.1:1000070 bind 127.0.0.1:10000
71 acl allowed_cidr src 127.0.0.0/871 acl allowed_cidr src 127.0.0.0/8
72 http-request deny unless allowed_cidr72 http-request deny unless allowed_cidr
7373
74 mode http74 mode http
75 stats enable75 stats enable
76 stats uri /76 stats uri /
77 stats realm Haproxy\ Statistics77 stats realm Haproxy\ Statistics
78 stats auth haproxy:biometricsarenotsecret78 stats auth haproxy:biometricsarenotsecret
79 stats refresh 379 stats refresh 3
8080
8181
82listen combined-8082listen combined-80
diff --git a/tests/unit/files/haproxy_config_rendered_test_output2.txt b/tests/unit/files/haproxy_config_rendered_test_output2.txt
index 61a329c..4620899 100644
--- a/tests/unit/files/haproxy_config_rendered_test_output2.txt
+++ b/tests/unit/files/haproxy_config_rendered_test_output2.txt
@@ -1,82 +1,82 @@
1global1global
2 nbproc 22 nbproc 2
3 nbthread 43 nbthread 4
4 maxconn 81924 maxconn 8192
5 log /dev/log local05 log /dev/log local0
6 log /dev/log local1 notice6 log /dev/log local1 notice
7 chroot /var/lib/haproxy7 chroot /var/lib/haproxy
8 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners8 stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
9 stats timeout 30s9 stats timeout 30s
10 server-state-file /run/haproxy/saved-server-state10 server-state-file /run/haproxy/saved-server-state
11 user haproxy11 user haproxy
12 group haproxy12 group haproxy
13 daemon13 daemon
1414
15 # LP#1874386: Work around lingering HAProxy processes as per LP:187438615 # LP#1874386: Work around lingering HAProxy processes as per LP:1874386
16 # and kill them off.16 # and kill them off.
17 hard-stop-after 5m17 hard-stop-after 5m
1818
19 # Default SSL material locations19 # Default SSL material locations
20 ca-base /etc/ssl/certs20 ca-base /etc/ssl/certs
21 crt-base /etc/ssl/private21 crt-base /etc/ssl/private
2222
23 # Default ciphers to use on SSL-enabled listening sockets.23 # Default ciphers to use on SSL-enabled listening sockets.
24 # For more information, see ciphers(1SSL). This list is from:24 # For more information, see ciphers(1SSL). This list is from:
25 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/25 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
26 # An alternative list with additional directives can be obtained from26 # An alternative list with additional directives can be obtained from
27 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy27 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
28 ssl-default-bind-ciphers ECDH+AESGCM:!aNULL:!MD5:!DSS28 ssl-default-bind-ciphers ECDH+AESGCM:!aNULL:!MD5:!DSS
29 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv1129 ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
30 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params30 # We'll eventually disable DHE (LP#1825321), but for now, bump DH params
31 tune.ssl.default-dh-param 204831 tune.ssl.default-dh-param 2048
3232
33 # Increase the SSL/TLS session cache from the default 20k. But33 # Increase the SSL/TLS session cache from the default 20k. But
34 # rather than hardcode values, let's just set it to match34 # rather than hardcode values, let's just set it to match
35 # global_max_connections (which by default is calculated using35 # global_max_connections (which by default is calculated using
36 # num. of CPU cores and num. of configured sites). Each entry36 # num. of CPU cores and num. of configured sites). Each entry
37 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,37 # requires ~200 bytes so on a host with say 32 CPUs, 10 sites,
38 # each with 2000 max conns will only consume around 122 Mbytes38 # each with 2000 max conns will only consume around 122 Mbytes
39 # (32 * 10 * 2000 * 200), which is not much.39 # (32 * 10 * 2000 * 200), which is not much.
40 tune.ssl.cachesize 819240 tune.ssl.cachesize 8192
4141
42defaults42defaults
43 log global43 log global
44 maxconn 500044 maxconn 5000
45 mode http45 mode http
46 option dontlognull46 option dontlognull
47 timeout connect 5s47 timeout connect 5s
48 timeout client 50s48 timeout client 50s
49 timeout server 50s49 timeout server 50s
50 errorfile 400 /etc/haproxy/errors/400.http50 errorfile 400 /etc/haproxy/errors/400.http
51 errorfile 403 /etc/haproxy/errors/403.http51 errorfile 403 /etc/haproxy/errors/403.http
52 errorfile 408 /etc/haproxy/errors/408.http52 errorfile 408 /etc/haproxy/errors/408.http
53 errorfile 500 /etc/haproxy/errors/500.http53 errorfile 500 /etc/haproxy/errors/500.http
54 errorfile 502 /etc/haproxy/errors/502.http54 errorfile 502 /etc/haproxy/errors/502.http
55 errorfile 503 /etc/haproxy/errors/503.http55 errorfile 503 /etc/haproxy/errors/503.http
56 errorfile 504 /etc/haproxy/errors/504.http56 errorfile 504 /etc/haproxy/errors/504.http
57 load-server-state-from-file global57 load-server-state-from-file global
58 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid58 unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
59 unique-id-header X-Cache-Request-ID59 unique-id-header X-Cache-Request-ID
60 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"60 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %ID"
6161
62resolvers dns62resolvers dns
63 nameserver dns1 127.0.0.53:5363 nameserver dns1 127.0.0.53:53
64 resolve_retries 364 resolve_retries 3
65 timeout resolve 3s65 timeout resolve 3s
66 timeout retry 3s66 timeout retry 3s
67 accepted_payload_size 819267 accepted_payload_size 8192
6868
69listen stats69listen stats
70 bind 127.0.0.1:1000070 bind 127.0.0.1:10000
71 acl allowed_cidr src 127.0.0.0/871 acl allowed_cidr src 127.0.0.0/8
72 http-request deny unless allowed_cidr72 http-request deny unless allowed_cidr
7373
74 mode http74 mode http
75 stats enable75 stats enable
76 stats uri /76 stats uri /
77 stats realm Haproxy\ Statistics77 stats realm Haproxy\ Statistics
78 stats auth haproxy:biometricsarenotsecret78 stats auth haproxy:biometricsarenotsecret
79 stats refresh 379 stats refresh 3
8080
8181
82listen combined-8082listen combined-80

Subscribers

People subscribed via source and target branches