383 Commits

Author SHA1 Message Date
Franco Fichtner
b9da60d15b pkg: simplify 2022-06-28 12:39:17 +02:00
Franco Fichtner
2b2da5f23d make: omit pkg-create -f default in case it changes later 2022-06-08 11:15:59 +02:00
Franco Fichtner
60c447f590 make: pkg 1.17 has a "unified suffix" 2022-05-09 08:31:31 +02:00
Stephan de Wit
cfd4b7635f
Phalcon5 migration: provide compatibility layer between v4 and v5 (#5711)
* 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>
2022-04-20 10:05:26 +02:00
Franco Fichtner
6d1d52b3db pkg: add glue to change phalcon version
Switch to version 5:

    make upgrade CORE_PHALCON=

Version 4 is used by default on PHP 7.4 and only version 5 can be
used with PHP 8.0.
2022-04-06 07:55:31 +02:00
Franco Fichtner
0aa6a10a21 make: compare hash as well on "upgrade"
Helps with development and git commit --amend.
2022-04-05 07:45:22 +02:00
Franco Fichtner
c0fdff1427 pkg: phalcon 5 test as well 2022-04-04 15:02:22 +02:00
Franco Fichtner
c3ae8435b7 pkg: dependency glue for PHP 8
json/openssl extensions moved to core package php80
2022-04-04 13:30:58 +02:00
Franco Fichtner
79df42229b make: convenience target to test migrations 2022-03-25 07:45:29 +01:00
Franco Fichtner
5205dd9da7 make: create dir before mfc 2022-03-22 11:20:01 +01:00
Franco Fichtner
b5619fef39 pkg: after having dnspython break our initial 21.7.8 builds
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.
2022-03-10 19:50:49 +01:00
Franco Fichtner
94db2d45eb make: softcode the use of branches to ease backporting 2022-03-02 10:48:28 +01:00
Franco Fichtner
2790f3ee63 make: dependency, not target 2022-03-01 08:40:07 +01:00
Franco Fichtner
07a012bb55 make: diff for tag if requested 2022-02-28 10:56:06 +01:00
Franco Fichtner
35c53f1010 make: also add a push helper 2022-02-28 10:35:31 +01:00
Franco Fichtner
2e7a8e438d make: add "log" target 2022-02-24 09:09:02 +01:00
Franco Fichtner
c139e03be7 pkg: allow alpha versioning for development 2022-02-02 07:55:48 +01:00
Franco Fichtner
b6ca1be13a firmware: no need to hint at upgrades anymore 2022-02-01 14:22:58 +01:00
Franco Fichtner
208be46ce2 pkg: happy new year! 2022-01-03 11:21:26 +01:00
Franco Fichtner
e4d5478662 pkg: avoid upgrades if already done, use VERSIONBIN 2021-12-21 12:07:37 +01:00
Franco Fichtner
8250ad50c3 Revert "pkg: suricata is now the same as suricata-devel"
This reverts commit d29b652cc01186b6b8d05aac998cfe3053bfb4af.

pkg-upgrade ignores this and upgrading the core package which
is suboptimal at the very least.
2021-11-23 15:25:47 +01:00
Franco Fichtner
ebfdeecdfe make: populate CORE_MAKE command with proper env on stepping stones
`make upgrade' could forget what version it was running in the first place.
2021-11-15 19:37:01 +01:00
Franco Fichtner
d29b652cc0 pkg: suricata is now the same as suricata-devel
We keep the port in order to test upcoming version 7 but for now
steer away from pulling it as a core dependency so we don't have
to update both.
2021-11-15 14:23:57 +01:00
Franco Fichtner
c4918b4c99 firmware: change CORE_ALTABI to taret ABI detection for #5144 2021-11-09 09:12:24 +01:00
Ad Schellevis
b3e3391943 Syslog - remove clog support
remove all remnants from syslogd and circular log support excluding support from the log readers. When a user upgrades and was using clog, the old files remain and are still readable from the ui, new entries are generated into our syslog-ng directory structure.

for https://github.com/opnsense/core/issues/5337
2021-11-05 21:17:35 +01:00
Franco Fichtner
14b46feee2 make: use slight modify for checking all potential files 2021-10-05 08:45:43 +02:00
Ad Schellevis
76b8ae4490 Firewall / Aliases - improve resolve performance by implementing async dns lookups. ref https://github.com/opnsense/core/issues/5117
This will need a new version of py-dnspython (py-dnspython2 in ports) for dns.asyncresolver support. Some additional log messages have been added to gain more insights into the resolving process via the general log.
Intermediate results aren't saved to disk anymore, which also simplifies the resolve() function in the Alias class. An address parser can queue hostname lookups for later retrieval (see _parse_address()) so we can batch process the list of hostnames to be collected.
2021-08-19 15:53:25 +02:00
Franco Fichtner
b91f9077f6 make: fix plist check on FreeBSD 13 2021-08-19 12:57:06 +02:00
Franco Fichtner
ac1cd84485 make: add a product_altabi setting if we want to split abis #5144
This way we can keep track of the underlying ABI in case a business
version needs to find its way back to community ABI.

In general ALTABI is just the derived ABI version, i.e. the one that
shares the same build settings/packages/OS version.
2021-08-17 08:53:22 +02:00
Franco Fichtner
b322ba9cf9 make: patch in business version numbers for CORE_NEXT #5144 2021-08-17 08:39:41 +02:00
Franco Fichtner
6abd2f2ac1 Framework: name and depends targets are no longer needed
use -v CORE_NAME and -v CORE_DEPENDS to read them...
2021-08-10 16:50:28 +02:00
Franco Fichtner
f331061387 firmware: changes for EoL of 21.1
o Remove revoked business fingerprints that were never used
o Revoke fingerprint for 21.1 as it is no longer needed
o Remove upgrade hint file to avoid development version upgrade loops
2021-07-27 16:04:57 +02:00
Franco Fichtner
5028c93393 pkg: actually demote to warning 2021-07-21 09:20:29 +02:00
Franco Fichtner
ed4ffa894c pkg: give CORE_ABI hint anyway, remove safety belt
Just let it crash and burn worst case.

PR: https://forum.opnsense.org/index.php?topic=23996.0
2021-07-21 08:53:16 +02:00
Franco Fichtner
10a5313b47 make: shorten magic variable for common use with plugins 2021-07-06 09:05:44 +02:00
Franco Fichtner
9735174eac make: tiptoe around restriction when using dev tools such as "diff" 2021-06-30 12:11:11 +02:00
Franco Fichtner
656c5ada7e pkg: fix version number derivation and missing replacement 2021-06-29 15:18:12 +02:00
Franco Fichtner
aa0affc7e7 pkg: like plugins now try to error on missing replacements 2021-06-29 15:00:10 +02:00
Franco Fichtner
15935e415a pkg: default to 7.4 now 2021-06-18 08:19:54 +02:00
Franco Fichtner
60087b5f83 Revert "pkg: default to 7.4 now"
This reverts commit 5457e046d833668a1d567669232e32b34e58759c.

Temporary revert for hotfix.
2021-06-17 16:03:31 +02:00
Franco Fichtner
5457e046d8 pkg: default to 7.4 now 2021-06-16 11:22:34 +02:00
Franco Fichtner
7c1f2659b0 pkg: PHP 7.4 does not have a separate hash module 2021-05-28 10:05:12 +02:00
Franco Fichtner
3a98ebb22f
Phalcon 4 migration (#4921)
phalcon 4 migration  #4012

o replace Phalcon\Session\Adapter\Files with new Phalcon\Session\Adapter\Stream adapter
o replace router->setUriSource() with handle() parameter
o combining sessions between phalcon and legacy php seems to be a bit problematic, first issue seems to be the legacy csrf check. refactor to use phalcon's method and legacy session
o Fix Phalcon Syslog usage in ControllerRoot (wrap in Logger class)
o session seems to miss standard prefix.
o also Gettext seems to like being wrapped...
o Gettext inheritance
o another handle()
o Volt: handle registerEngines / VoltEngine changes
o volt templates - missing session reference, bootstrap in ControllerBase
o router getRewriteUri() deprecated
o another handle() in index.php
o  Phalcon\Dispatcher::EXCEPTION_* moved to  Phalcon\Dispatcher\Exception::EXCEPTION_*
o changes in filter handling.
o fix plist
o Syslog usage changes
o refactor Validation changes
o FILTER_ALNUM - replaced FILTER_ALPHANUM
2021-04-15 11:36:57 +02:00
Franco Fichtner
a08b8ec72b installer: switch installer package 2021-04-13 09:35:28 +02:00
Franco Fichtner
61ca8a7b68 pkg: add series and nickname to metadata 2021-04-09 08:56:46 +02:00
Franco Fichtner
af587e812a make: also whitespace issue 2021-04-01 14:27:17 +02:00
Franco Fichtner
8220814034 pkg: verbatim match on business tag 2021-03-31 15:48:09 +02:00
Franco Fichtner
9d9f9c42f8 pkg: pin development version to suricata 6 2021-03-26 11:52:10 +01:00
Franco Fichtner
4e65be31b0 make: add rebase target for stable branch 2021-03-26 08:50:20 +01:00
Franco Fichtner
af2736d45c make: when mfc aborts clear it and switch back 2021-03-26 08:39:54 +01:00