From cca59e7e4ac1611030473d75c5f07e3b1042f0f8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 16 Apr 2024 16:54:23 +0200 Subject: [PATCH] plugins: style sweep --- .../OPNsense/Quagga/Api/StaticController.php | 13 +++++++------ .../OPNsense/Quagga/StaticController.php | 1 + .../mvc/app/models/OPNsense/Quagga/STATICd.php | 2 ++ .../mvc/app/models/OPNsense/Relayd/Relayd.php | 6 +++--- www/OPNProxy/pkg-descr | 1 - www/caddy/pkg-descr | 2 +- .../OPNsense/Caddy/Api/ReverseProxyController.php | 12 ++++++------ .../OPNsense/Caddy/Api/ServiceController.php | 2 +- .../mvc/app/models/OPNsense/Caddy/Caddy.xml | 4 ++-- .../service/templates/OPNsense/Caddy/Caddyfile | 12 ++++++------ 10 files changed, 29 insertions(+), 26 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php index 802d27983..9a616cdb5 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php @@ -1,4 +1,5 @@ searchBase('routes.route'); + return $this->searchBase('routes.route'); } public function getRouteAction($uuid = null) { - return $this->getBase('route', 'routes.route', $uuid); + return $this->getBase('route', 'routes.route', $uuid); } public function setRouteAction($uuid) { - return $this->setBase('route', 'routes.route', $uuid); + return $this->setBase('route', 'routes.route', $uuid); } public function addRouteAction() { - return $this->addBase('route', 'routes.route'); + return $this->addBase('route', 'routes.route'); } public function delRouteAction($uuid) { - return $this->delBase('routes.route', $uuid); + return $this->delBase('routes.route', $uuid); } public function toggleRouteAction($uuid) { - return $this->toggleBase('routes.route', $uuid); + return $this->toggleBase('routes.route', $uuid); } } diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php index 5798e168e..a6888d469 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php @@ -1,4 +1,5 @@ expect)) { $messages->appendMessage( - new Message(gettext('Expect Pattern cannot be empty.'), $key . ".expect") + new Message(gettext('Expect Pattern cannot be empty.'), $key . ".expect") ); } break; case 'script': if (empty((string)$node->path)) { $messages->appendMessage( - new Message(gettext('Script path cannot be empty.'), $key . ".path") + new Message(gettext('Script path cannot be empty.'), $key . ".path") ); } break; case 'http': if (empty((string)$node->path)) { $messages->appendMessage( - new Message(gettext('Path cannot be empty.'), $key . ".path") + new Message(gettext('Path cannot be empty.'), $key . ".path") ); } if (empty((string)$node->code) && empty((string)$node->digest)) { diff --git a/www/OPNProxy/pkg-descr b/www/OPNProxy/pkg-descr index c731c51c9..c5033a435 100644 --- a/www/OPNProxy/pkg-descr +++ b/www/OPNProxy/pkg-descr @@ -7,4 +7,3 @@ OPNsense proxy additions to support more fine grained access management 1.0.4: * Remove ident support as by default it is denied anyway nowadays - diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index c3c9030dc..e59ec8075 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -34,7 +34,7 @@ Plugin Changelog * Add: HTTP response code and HTTP response message can be set per access list in advanced mode. * Add: Header functionality added. Multiple header manipulations can be set per handler. * Cleanup: Update searchBase() in ReverseProxyController.php for easier maintainability. -* Fix: Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS. +* Fix: Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS. * Add: Simple Load Balancing support with the default random policy, by allowing to add multiple Upstream Domains in Handlers. * Add: Passive Health check for load balancing (Upstream Fail Duration) in Handlers. * Fix: Input validation so a base domain like "example.com" and a wildcard domain like "*.example.com" can now be created at the same time in domains. diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php index 140330a06..4dcd01ce6 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php @@ -41,7 +41,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase /*ReverseProxy Section*/ - public function searchReverseProxyAction($add_empty='0') + public function searchReverseProxyAction($add_empty = '0') { return $this->searchBase("reverseproxy.reverse", null, 'description'); } @@ -74,7 +74,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase /*Subdomain Section*/ - public function searchSubdomainAction($add_empty='0') + public function searchSubdomainAction($add_empty = '0') { return $this->searchBase("reverseproxy.subdomain", null, 'description'); } @@ -107,7 +107,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase /*Handler Section*/ - public function searchHandleAction($add_empty='0') + public function searchHandleAction($add_empty = '0') { return $this->searchBase("reverseproxy.handle", null, 'description'); } @@ -140,7 +140,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase /* AccessList Section */ - public function searchAccessListAction($add_empty='0') + public function searchAccessListAction($add_empty = '0') { return $this->searchBase("reverseproxy.accesslist", null, 'description'); } @@ -168,7 +168,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase /* BasicAuth Section */ - public function searchBasicAuthAction($add_empty='0') + public function searchBasicAuthAction($add_empty = '0') { return $this->searchBase("reverseproxy.basicauth", null, 'description'); } @@ -216,7 +216,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase /* Header Section */ - public function searchHeaderAction($add_empty='0') + public function searchHeaderAction($add_empty = '0') { return $this->searchBase("reverseproxy.header", null, 'description'); } diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php index f719a74d9..e522dc52d 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php @@ -46,7 +46,7 @@ class ServiceController extends ApiMutableServiceControllerBase // Caddy can use a reload action instead return 0; } - + public function validateAction() { $backend = new Backend(); diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index acfc075d9..843e60d75 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -60,7 +60,7 @@ OPNsense.Caddy.Caddy reverseproxy.accesslist accesslistName,description - %s - %s + %s - %s @@ -124,7 +124,7 @@ OPNsense.Caddy.Caddy reverseproxy.accesslist accesslistName,description - %s - %s + %s - %s diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile index 178c3ea78..2e7e7f37e 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile @@ -85,7 +85,7 @@ {# # Section: Dynamic DNS Global Configuration - # Purpose: Sets up global configuration for Dynamic DNS. Caddy needs to be compiled with + # Purpose: Sets up global configuration for Dynamic DNS. Caddy needs to be compiled with # https://github.com/mholt/caddy-dynamicdns and https://github.com/caddy-dns. Otherwise the # generated Caddyfile won't run. Each DNS Provider that is added below has to be compiled in. # Some Providers don't support setting A and AAAA-Records, like acmedns. @@ -284,7 +284,7 @@ {# # Section: HTTP-01 Challenge Redirection -# Purpose: A small premade reverse_proxy section +# Purpose: A small premade reverse_proxy section # that can redirect the HTTP-01 challenge to a different webserver. #} {% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} @@ -442,7 +442,7 @@ {# # Macro: header_manipulation -# Purpose: Customizes HTTP headers for requests or responses; to add, remove, or modify headers. +# Purpose: Customizes HTTP headers for requests or responses; to add, remove, or modify headers. # It uses a 'handle' object that specifies which headers to manipulate based on their @UUIDs. # Each handle can have multiple of these HTTP headers assigned. # Parameters: @@ -574,7 +574,7 @@ # Macro: basicauth_configuration # Purpose: Implements basic authentication with a username and password for access. # Parameters: -# @param basicauth_uuids (@string): A comma-separated list of UUIDs, each UUID corresponding to +# @param basicauth_uuids (@string): A comma-separated list of UUIDs, each UUID corresponding to # a specific user credentials (username and password). # - @uuid (@string) # - basicauthuser (@string): The username required for authentication. @@ -595,7 +595,7 @@ {# # Section: Reverse Proxy Configurations -# Purpose: Assembles reverse proxy configurations using predefined macros. +# Purpose: Assembles reverse proxy configurations using predefined macros. # This is the main logic of the whole template, handle with care. # Macros Used: # - tls_configuration @@ -603,7 +603,7 @@ # - access_list_configuration # - reverse_proxy_configuration # - indirect: header_manipulation -# Important Details: +# Important Details: # - Order of Path specific Handles - Prioritizes order of specific path handles over catch-all handles. # - Order of Wildcard Domains and Subdomains: Handles for wildcard domains come after all subdomains. #}