-
Notifications
You must be signed in to change notification settings - Fork 133
NE-2116: Update haproxy-config.template to use HTTPS/TCP log formats #667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -227,6 +227,12 @@ listen stats | |
|
|
||
| {{ if .BindPorts -}} | ||
| frontend public | ||
| {{- if ne (env "ROUTER_SYSLOG_ADDRESS") "" }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider defining
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the way, the {{- $httpLogFormat := env "ROUTER_HTTP_LOG_FORMAT" (env "ROUTER_SYSLOG_FORMAT") }}
{{- $httpsLogFormat := env "ROUTER_HTTPS_LOG_FORMAT" $httpLogFormat }}
{{- $tcpLogFormat := env "ROUTER_TCP_LOG_FORMAT" $httpLogFormat }}This also makes the defaulting behavior more explicit and clear, in my opinion. |
||
| {{- if ne (env "ROUTER_HTTP_LOG_FORMAT") "" }} | ||
| log-format {{ env "ROUTER_HTTP_LOG_FORMAT" }} | ||
| {{- else }} | ||
| option httplog | ||
| {{- end }} | ||
|
Comment on lines
+230
to
+235
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not look syntactically correct: You add two |
||
| {{ if eq "v4v6" $router_ip_v4_v6_mode }} | ||
| bind :{{ env "ROUTER_SERVICE_HTTP_PORT" "80" }}{{ if isTrue (env "ROUTER_USE_PROXY_PROTOCOL") }} accept-proxy{{ end }} | ||
| bind :::{{ env "ROUTER_SERVICE_HTTP_PORT" "80" }} v6only{{ if isTrue (env "ROUTER_USE_PROXY_PROTOCOL") }} accept-proxy{{ end }} | ||
|
|
@@ -302,6 +308,9 @@ frontend public | |
| # that terminates encryption in this router (edge) | ||
| frontend public_ssl | ||
| {{- if ne (env "ROUTER_SYSLOG_ADDRESS") "" }} | ||
| {{- if ne (env "ROUTER_TCP_LOG_FORMAT") "" }} | ||
| log-format {{ env "ROUTER_TCP_LOG_FORMAT" }} | ||
| {{- else }} | ||
|
Comment on lines
+311
to
+313
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here, you add |
||
| option tcplog | ||
| {{- end }} | ||
| {{ if eq "v4v6" $router_ip_v4_v6_mode }} | ||
|
|
@@ -343,6 +352,12 @@ backend be_sni | |
| server fe_sni unix@/var/lib/haproxy/run/haproxy-sni.sock weight 1 send-proxy | ||
|
|
||
| frontend fe_sni | ||
| {{- if ne (env "ROUTER_SYSLOG_ADDRESS") "" }} | ||
| {{- if ne (env "ROUTER_HTTPS_LOG_FORMAT") "" }} | ||
| log-format {{ env "ROUTER_HTTPS_LOG_FORMAT" }} | ||
| {{- else }} | ||
| option httpslog | ||
| {{- end }} | ||
|
Comment on lines
+355
to
+360
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
| # terminate ssl on edge | ||
| bind unix@/var/lib/haproxy/run/haproxy-sni.sock ssl | ||
| {{- if isTrue (env "ROUTER_STRICT_SNI") }} strict-sni {{ end }} | ||
|
|
@@ -461,6 +476,12 @@ backend be_no_sni | |
| server fe_no_sni unix@/var/lib/haproxy/run/haproxy-no-sni.sock weight 1 send-proxy | ||
|
|
||
| frontend fe_no_sni | ||
| {{- if ne (env "ROUTER_SYSLOG_ADDRESS") "" }} | ||
| {{- if ne (env "ROUTER_HTTPS_LOG_FORMAT") "" }} | ||
| log-format {{ env "ROUTER_HTTPS_LOG_FORMAT" }} | ||
| {{- else }} | ||
| option httsplog | ||
| {{- end }} | ||
|
Comment on lines
+479
to
+484
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. httsplog should be httpslog? Thanks. |
||
| # terminate ssl on edge | ||
| bind unix@/var/lib/haproxy/run/haproxy-no-sni.sock ssl crt {{ firstMatch ".+" .DefaultCertificate "/var/lib/haproxy/conf/default_pub_keys.pem" }} accept-proxy | ||
| {{- with (env "ROUTER_MUTUAL_TLS_AUTH") }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't obvious why you keep
log-format/option httplogindefaults. Is that intentional, to preserveROUTER_SYSLOG_FORMATas the default for frontends that (implicitly) usemode tcpwhenROUTER_TCP_LOG_FORMATorROUTER_HTTPS_LOG_FORMATis not specified? It would be helpful to explain this in the commit message.