www/nginx: source code migration for Phalcon 4 (#2382)

This commit is contained in:
Fabian Franz BSc 2021-05-09 13:43:36 +02:00 committed by GitHub
parent 89d9ac097c
commit 264e739bf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 18 deletions

View File

@ -1,5 +1,5 @@
PLUGIN_NAME= nginx
PLUGIN_VERSION= 1.22
PLUGIN_VERSION= 1.23
PLUGIN_COMMENT= Nginx HTTP server and reverse proxy
PLUGIN_DEPENDS= nginx
PLUGIN_MAINTAINER= franz.fabian.94@gmail.com

View File

@ -10,6 +10,10 @@ WWW: https://nginx.org/
Plugin Changelog
================
1.23
* Migration for PHP Phalcon 4 (non breaking change for UI/API)
1.22
* Add X-Forwarded-Port and X-Forwarded-Host headers (contributed by Carlos Cesario)

View File

@ -615,7 +615,6 @@ class SettingsController extends ApiMutableModelControllerBase
/**
* @param null $uuid the uuid which should get cleared before
* @throws \ReflectionException if the model was not found
* @throws \Phalcon\Validation\Exception on validation errors
*/
private function regenerate_hostname_map($uuid = null)
{
@ -644,7 +643,6 @@ class SettingsController extends ApiMutableModelControllerBase
/**
* @param null $uuid the uuid which should get cleared before
* @throws \ReflectionException if the model was not found
* @throws \Phalcon\Validation\Exception on validation errors
*/
private function regenerate_ipacl($uuid = null)
{
@ -673,7 +671,6 @@ class SettingsController extends ApiMutableModelControllerBase
/**
* @param $uuids array list of UUIDs
* @param $path string the model prefix from the element to delete
* @throws \Phalcon\Validation\Exception
*/
private function delete_uuids($uuids, $path): void
{

View File

@ -28,7 +28,7 @@
namespace OPNsense\Base\Constraints;
use Phalcon\Validation\Message;
use Phalcon\Messages\Message;
/**
* a very specific nginx check for Naxsi rule IDs - not reusable
@ -38,7 +38,7 @@ use Phalcon\Validation\Message;
*/
class NaxsiIdentifierConstraint extends BaseConstraint
{
public function validate(\Phalcon\Validation $validator, $attribute)
public function validate(\Phalcon\Validation $validator, $attribute) : bool
{
$node = $this->getOption('node');
if ($node) {

View File

@ -28,7 +28,7 @@
namespace OPNsense\Base\Constraints;
use Phalcon\Validation\Message;
use Phalcon\Messages\Message;
/**
* a very specific nginx check - not reusable
@ -38,7 +38,7 @@ use Phalcon\Validation\Message;
*/
class NgxBusyBufferConstraint extends BaseConstraint
{
public function validate(\Phalcon\Validation $validator, $attribute)
public function validate(\Phalcon\Validation $validator, $attribute) : bool
{
$node = $this->getOption('node');
if ($node) {
@ -64,26 +64,22 @@ class NgxBusyBufferConstraint extends BaseConstraint
$proxy_buffer_size_int = intval((string) $proxy_buffer_size_node);
}
if (
isset($proxy_buffers_total_minus1_size) && isset($proxy_busy_buffers_size) &&
if (isset($proxy_buffers_total_minus1_size) && isset($proxy_busy_buffers_size) &&
$proxy_buffers_total_minus1_size < $proxy_busy_buffers_size
) {
$validator->appendMessage(new Message(
gettext("Proxy Buffer Size must be less than the size of all Proxy Buffers minus one buffer."),
$attribute,
$this->getOption('name')
$attribute
));
}
// nginx: [emerg] "proxy_busy_buffers_size" must be equal to or greater than the maximum of the value of "proxy_buffer_size" and one of the "proxy_buffers"
if (
isset($proxy_busy_buffers_size) && isset($proxy_buffers_size_int) &&
if (isset($proxy_busy_buffers_size) && isset($proxy_buffers_size_int) &&
$proxy_busy_buffers_size < $proxy_buffers_size_int
) {
$validator->appendMessage(new Message(
gettext("Proxy Busy Buffers Size must be equal to or greater than the maximum of one of the Proxy Buffers."),
$attribute,
$this->getOption('name')
$attribute
));
}
@ -94,8 +90,7 @@ class NgxBusyBufferConstraint extends BaseConstraint
) {
$validator->appendMessage(new Message(
gettext("Proxy Busy Buffers Size must be equal to or greater than the maximum of the value of Proxy Buffer Size."),
$attribute,
$this->getOption('name')
$attribute
));
}
}