From 8e278ba3751f54b4c1cc2c136c28b22a32915f60 Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Thu, 1 Aug 2019 13:12:31 +0200 Subject: [PATCH 01/11] My first commit to make ProxyRequests a variable to set in hiera. Default is Off. By setting proxy_requests to 'true' it will become 'ProxyRequests On' --- manifests/vhost.pp | 1 + templates/vhost/_proxy.erb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 3f93e6a480..0ee366f2ad 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -1705,6 +1705,7 @@ $proxy_dest_reverse_match = undef, $proxy_pass = undef, $proxy_pass_match = undef, + $proxy_requests = false, $suphp_addhandler = $::apache::params::suphp_addhandler, Enum['on', 'off'] $suphp_engine = $::apache::params::suphp_engine, $suphp_configpath = $::apache::params::suphp_configpath, diff --git a/templates/vhost/_proxy.erb b/templates/vhost/_proxy.erb index 79f36cf047..8585363dac 100644 --- a/templates/vhost/_proxy.erb +++ b/templates/vhost/_proxy.erb @@ -1,7 +1,11 @@ <% if @proxy_dest or @proxy_pass or @proxy_pass_match or @proxy_dest_match -%> ## Proxy rules - ProxyRequests Off + <% if @proxy_requests -%> + ProxyRequests On + <% else -%> + ProxyRequests Off + <%- end -%> <%- end -%> <% if @proxy_preserve_host -%> ProxyPreserveHost On From f5c77978a3664746328d0a9031b2107ad70e80dd Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Thu, 1 Aug 2019 13:20:55 +0200 Subject: [PATCH 02/11] probably have to add it it spec/defines/vhost_spec.rb as well --- spec/defines/vhost_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index dcefbd1ba0..796c980056 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -279,6 +279,7 @@ 'setenv' => ['proxy-nokeepalive 1', 'force-proxy-request-1.0 1'], }, ], + 'proxy_requests' => false, 'suphp_addhandler' => 'foo', 'suphp_engine' => 'on', 'suphp_configpath' => '/var/www/html', From 6fe56f23a03c4f6e2577067169560519b7b50e3c Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Thu, 1 Aug 2019 13:53:19 +0200 Subject: [PATCH 03/11] fixed indentation. this is a template, not code... ;-) --- templates/vhost/_proxy.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/_proxy.erb b/templates/vhost/_proxy.erb index 8585363dac..7523b2e1f2 100644 --- a/templates/vhost/_proxy.erb +++ b/templates/vhost/_proxy.erb @@ -2,9 +2,9 @@ ## Proxy rules <% if @proxy_requests -%> - ProxyRequests On + ProxyRequests On <% else -%> - ProxyRequests Off + ProxyRequests Off <%- end -%> <%- end -%> <% if @proxy_preserve_host -%> From 96ebbb31619ec3ace84521b09219379feae374b2 Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Thu, 1 Aug 2019 15:17:37 +0200 Subject: [PATCH 04/11] Indentation not quite right, this should fix it --- templates/vhost/_proxy.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/vhost/_proxy.erb b/templates/vhost/_proxy.erb index 7523b2e1f2..feee7d8e1c 100644 --- a/templates/vhost/_proxy.erb +++ b/templates/vhost/_proxy.erb @@ -1,11 +1,11 @@ <% if @proxy_dest or @proxy_pass or @proxy_pass_match or @proxy_dest_match -%> ## Proxy rules - <% if @proxy_requests -%> +<% if @proxy_requests -%> ProxyRequests On - <% else -%> +<% else -%> ProxyRequests Off - <%- end -%> +<%- end -%> <%- end -%> <% if @proxy_preserve_host -%> ProxyPreserveHost On From e557419fdbaac39151c1eb59b3159818376aa013 Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Thu, 1 Aug 2019 15:28:22 +0200 Subject: [PATCH 05/11] added comments about the proxy_requests variable in CHANGELOG.md, HISTORY.md and REFERENCE.md --- CHANGELOG.md | 1 + HISTORY.md | 1 + REFERENCE.md | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5528df9bdd..9d8978c950 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -808,6 +808,7 @@ This release features many improvements and bugfixes, including several new defi - passenger_ruby - passenger_start_timeout - proxy_preserve_host + - proxy_requests - redirectmatch_dest - ssl_crl_check - wsgi_chunked_request diff --git a/HISTORY.md b/HISTORY.md index 90e65f6584..3d6897f091 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -698,6 +698,7 @@ This release features many improvements and bugfixes, including several new defi - passenger_ruby - passenger_start_timeout - proxy_preserve_host + - proxy_requests - redirectmatch_dest - ssl_crl_check - wsgi_chunked_request diff --git a/REFERENCE.md b/REFERENCE.md index b22046568e..90e1431c9f 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -7369,6 +7369,16 @@ X-Forwarded-Host and X-Forwarded-Server) get sent to the backend server. Default value: `undef` +##### `proxy_requests` + +Data type: `Any` + +Sets the [ProxyErrorOverride Directive](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyrequests). +This prarmeter allows or prevents Apache httpd from functioning as a forward proxy server. +(Setting ProxyRequests to Off does not disable use of the ProxyPass directive.) + +Default value: `false` + ##### `proxy_error_override` Data type: `Any` From 1240de9b3dc713575d17910f64ffde8eb61cd825 Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Thu, 1 Aug 2019 15:28:22 +0200 Subject: [PATCH 06/11] created a ticket in Jira: MODULES-9668 --- CHANGELOG.md | 1 + HISTORY.md | 1 + REFERENCE.md | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5528df9bdd..9d8978c950 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -808,6 +808,7 @@ This release features many improvements and bugfixes, including several new defi - passenger_ruby - passenger_start_timeout - proxy_preserve_host + - proxy_requests - redirectmatch_dest - ssl_crl_check - wsgi_chunked_request diff --git a/HISTORY.md b/HISTORY.md index 90e65f6584..3d6897f091 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -698,6 +698,7 @@ This release features many improvements and bugfixes, including several new defi - passenger_ruby - passenger_start_timeout - proxy_preserve_host + - proxy_requests - redirectmatch_dest - ssl_crl_check - wsgi_chunked_request diff --git a/REFERENCE.md b/REFERENCE.md index b22046568e..90e1431c9f 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -7369,6 +7369,16 @@ X-Forwarded-Host and X-Forwarded-Server) get sent to the backend server. Default value: `undef` +##### `proxy_requests` + +Data type: `Any` + +Sets the [ProxyErrorOverride Directive](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyrequests). +This prarmeter allows or prevents Apache httpd from functioning as a forward proxy server. +(Setting ProxyRequests to Off does not disable use of the ProxyPass directive.) + +Default value: `false` + ##### `proxy_error_override` Data type: `Any` From 3adaa9e186316e3bb81f83fd62e53a6cacc61365 Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Mon, 5 Aug 2019 14:14:27 +0200 Subject: [PATCH 07/11] Explicitly added 'Optional[Boolean]' as data type for proxy_requests variable --- manifests/vhost.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 0ee366f2ad..7002dfcec7 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -1705,7 +1705,7 @@ $proxy_dest_reverse_match = undef, $proxy_pass = undef, $proxy_pass_match = undef, - $proxy_requests = false, + Optional[Boolean] $proxy_requests = false, $suphp_addhandler = $::apache::params::suphp_addhandler, Enum['on', 'off'] $suphp_engine = $::apache::params::suphp_engine, $suphp_configpath = $::apache::params::suphp_configpath, From cbea60728a4dd71331cea8d686b1e877fb22db01 Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Mon, 5 Aug 2019 14:21:52 +0200 Subject: [PATCH 08/11] This shouldn't be Optional --- manifests/vhost.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 7002dfcec7..5d4e6498c8 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -1705,7 +1705,7 @@ $proxy_dest_reverse_match = undef, $proxy_pass = undef, $proxy_pass_match = undef, - Optional[Boolean] $proxy_requests = false, + Boolean $proxy_requests = false, $suphp_addhandler = $::apache::params::suphp_addhandler, Enum['on', 'off'] $suphp_engine = $::apache::params::suphp_engine, $suphp_configpath = $::apache::params::suphp_configpath, From d292e94cb323e168e1c489efa451a5c1c9ee617d Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Mon, 5 Aug 2019 17:03:30 +0200 Subject: [PATCH 09/11] Corrected data type for proxy_requests to Boolean instead of Any --- REFERENCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REFERENCE.md b/REFERENCE.md index 90e1431c9f..c7cf8cf4ad 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -4657,7 +4657,7 @@ The following parameters are available in the `apache::mod::proxy` class. ##### `proxy_requests` -Data type: `Any` +Data type: `Boolean` Enables forward (standard) proxy requests. From 86d65493c2be9486076f419cb029e0a87588689e Mon Sep 17 00:00:00 2001 From: dev_jasper Date: Tue, 13 Aug 2019 16:02:50 +0200 Subject: [PATCH 10/11] fixed data type of proxy_requests to Boolean --- REFERENCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REFERENCE.md b/REFERENCE.md index c7cf8cf4ad..61f46f3430 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -7371,7 +7371,7 @@ Default value: `undef` ##### `proxy_requests` -Data type: `Any` +Data type: `Boolean` Sets the [ProxyErrorOverride Directive](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyrequests). This prarmeter allows or prevents Apache httpd from functioning as a forward proxy server. From cd38f18fd5654ebb23e7f6a98cc73bdfdfdefbaa Mon Sep 17 00:00:00 2001 From: puppet_puppetmaster Date: Sat, 17 Aug 2019 11:06:12 +0200 Subject: [PATCH 11/11] changed 'ProxyErrorOverride Directive' to 'ProxyRequests Directive' in REFERENCE.md --- REFERENCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REFERENCE.md b/REFERENCE.md index 61f46f3430..19badde107 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -7373,7 +7373,7 @@ Default value: `undef` Data type: `Boolean` -Sets the [ProxyErrorOverride Directive](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyrequests). +Sets the [ProxyRequests Directive](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyrequests). This prarmeter allows or prevents Apache httpd from functioning as a forward proxy server. (Setting ProxyRequests to Off does not disable use of the ProxyPass directive.)