This should considerably lower CPU usage as reported a few times.
We do need to bring in pcntl PHP module in order to get that done
easily in the script.
PR: https://forum.opnsense.org/index.php?topic=35219.0
Gets rid of package dependency which for dhcpleases6 simply
listens on the DHCPD lease file and runs the prefix.php command
unconditionally.
For now emulate this by issuing the command every 60 seconds
which can be adjusted later if someone complains, but seeing
how many bugs this script has had vs. how many people noticed
it (basically none) I doult this will have much impact overall.
This brings it in line with migrations although both hinge on
the idea that rc.configure_firmware is called to execute this
code. Both need a better integration but bringing them to the
same level seems to make the most sense.
After reboot the config is in a consistent state now too...
Remove previous plugins_interfaces() call and always use full
path to pluginctl like most spots already do.
This allows us to remove all DH handling remnants. If people
want to use a separate content they will have to let us know,
but it seems unlikely. The only impact seems to be a security
bump from 2k to 4k default.
* phalcon5: update namespaces
* phalcon5 Autoload: rename registerDirs() to setDirectories()
* phalcon5: remove trailing slash
* phalcon5: default to php74-phalcon
* phalcon5: provide 4/5 compatibility layer except for AbstractValidator
* MVC - Phalcon 5 migration and options to lose dependency of phalcon validation classes.
Since Validation() in 5 moves to Filter\Validation (https://docs.phalcon.io/5.0/en/upgrade#general-notes) and the class is used in strict parameter passing,
it will be difficult to import a situation which works both on 4 and 5.
To prevent future issues, but keep the current situation functional with minimal changes, we wrapped Validation() into a class of our own. When validators inherit from BaseValidator, these are assumed to
be less strict and bound to our own handling. Phalcon validations will follow the old path for now.
Migrating existing validations on our end, should be as simple as changing the following lines:
-use Phalcon\Validation\AbstractValidator;
-use Phalcon\Validation\ValidatorInterface;
-use Phalcon\Validation;
+use OPNsense\Base\BaseValidator;
-class CallbackValidator extends AbstractValidator implements ValidatorInterface
+class CallbackValidator extends BaseValidator
- public function validate(Validation $validator, $attribute): bool
+ public function validate($validator, $attribute): bool
Todo: choose the "correct" Validation() based on phalcon version.
* phalcon5: complete migration to compatibility layer.
uses bc881b9c11 to remove the need
for AbstractValidator and Validator(Interface).
This commit changes the relevant includes and provides some changes to make the unit tests
run correctly.
* MVC - Phalcon 5 migration and options to lose dependency of phalcon validation classes. part duex
Although our previous strategy should work according to how bind() and validation() are being implemented (https://github.com/phalcon/cphalcon/blob/4.2.x/phalcon/Validation.zep),
in reality it seems they aren't the same. Our previous attempt failed some validations (such as booleans) for no valid reasons.
Long term we should remove the phalcon dependency as these effects are highly unpredictable.
phalcon5: update Validation class to now pick the right Phalcon Validation based on version
* MVC - Phalcon 5 migration and options to lose dependency of phalcon validation classes.
Minor regression in previous commit, performValidation()'s return type didn't match. Ideally we would rather switch to plain array's, but since performValidation()
is used in multiple areas (including plugins) we better opt for compatiblity now.
ref https://github.com/opnsense/core/pull/5711
* phalcon5: switch back to using count() on Messages object, adjust unit tests as needed
See 6814f32755 as to why
this is the case.
* phalcon5: remove PhalconGenerator and references, use checked-in files instead
* Update Makefile
Co-authored-by: Franco Fichtner <franco@opnsense.org>
Co-authored-by: Ad Schellevis <ad@opnsense.org>
Co-authored-by: Franco Fichtner <franco@opnsense.org>
Now we circle back from dnspython2 to dnspython "just because".
This is too tedious to even complain about. All it does is
wreck opnsense-revert usage... congrats to all involved.