Skip to content
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

reverse-proxy: T6454: Set default value of http for haproxy mode #3598

Merged
merged 1 commit into from
Jun 9, 2024

Conversation

Embezzle
Copy link
Contributor

@Embezzle Embezzle commented Jun 7, 2024

Change Summary

Set a default value of http for reverse-proxy service/backend mode.
HAProxy defaults to using http mode if unset - adding a default value in VyOS will avoid ambiguity without any logic change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe): Improvement on existing functionality

Related Task(s)

https://vyos.dev/T6454

Related PR(s)

Component(s) name

  • load-balancing -> reverse-proxy

Proposed changes

How to test

Whilst in configuration mode, check VyOS is displaying a default value for mode

[edit]
vyos@vyos# set load-balancing reverse-proxy service fe-01 ?
Possible completions:
+  backend              Backend member
   description          Description
+> http-response-headers
						Headers to include in HTTP response
+  listen-address       Local IP addresses to listen on
   mode                 Proxy mode (default: http)
   port                 Port number used by connection
   redirect-http-to-https
						Redirect HTTP to HTTPS
+> rule                 Proxy rule number
 > ssl                  SSL Certificate, SSL Key and CA
 > tcp-request          TCP request directive
 
 [edit]
vyos@vyos# set load-balancing reverse-proxy backend bk-01 ?
Possible completions:
   balance              Load-balancing algorithm (default: round-robin)
   description          Description
   health-check         Non HTTP health check options
 > http-check           HTTP check configuration
+> http-response-headers
                        Headers to include in HTTP response
   mode                 Proxy mode (default: http)
+> rule                 Proxy rule number
+> server               Backend server name
 > ssl                  SSL Certificate, SSL Key and CA
 > timeout              Timeout options

Smoketest result

vyos@vyos:~$ python3 /usr/libexec/vyos/tests/smoke/cli/test_load-balancing_reverse-proxy.py
test_01_lb_reverse_proxy_domain (__main__.TestLoadBalancingReverseProxy.test_01_lb_reverse_proxy_domain) ... ok
test_02_lb_reverse_proxy_cert_not_exists (__main__.TestLoadBalancingReverseProxy.test_02_lb_reverse_proxy_cert_not_exists) ...
PKI does not contain any certificates!


Certificate "cert" not found in configuration!

ok
test_03_lb_reverse_proxy_ca_not_exists (__main__.TestLoadBalancingReverseProxy.test_03_lb_reverse_proxy_ca_not_exists) ...
PKI does not contain any CA certificates!


CA Certificate "ca-test" not found in configuration!

ok
test_04_lb_reverse_proxy_backend_ssl_no_verify (__main__.TestLoadBalancingReverseProxy.test_04_lb_reverse_proxy_backend_ssl_no_verify) ...
backend bk-01 cannot have both ssl options no-verify and ca-certificate
set!

ok
test_05_lb_reverse_proxy_backend_http_check (__main__.TestLoadBalancingReverseProxy.test_05_lb_reverse_proxy_backend_http_check) ...
backend "bk-01" can only be configured with ldap health-check whilst in
TCP mode!

ok
test_06_lb_reverse_proxy_tcp_mode (__main__.TestLoadBalancingReverseProxy.test_06_lb_reverse_proxy_tcp_mode) ... ok
test_07_lb_reverse_proxy_http_response_headers (__main__.TestLoadBalancingReverseProxy.test_07_lb_reverse_proxy_http_response_headers) ...
service https_front must be set to http mode to use
http_response_headers!

ok
test_08_lb_reverse_proxy_tcp_health_checks (__main__.TestLoadBalancingReverseProxy.test_08_lb_reverse_proxy_tcp_health_checks) ... ok

----------------------------------------------------------------------
Ran 8 tests in 37.224s

OK

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@c-po c-po merged commit bd80160 into vyos:current Jun 9, 2024
7 of 9 checks passed
@c-po
Copy link
Member

c-po commented Jun 9, 2024

@Mergifyio backport sagitta

Copy link
Contributor

mergify bot commented Jun 9, 2024

backport sagitta

✅ Backports have been created

@Embezzle Embezzle deleted the T6454 branch June 9, 2024 09:39
c-po added a commit that referenced this pull request Jun 9, 2024
reverse-proxy: T6454: Set default value of http for haproxy mode (backport #3598)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants