12834 Commits

Author SHA1 Message Date
Franco Fichtner
2d2b025a5f dhcp: fix weirdness in prefix crawler
PHP complains about unknown access, but the script is
even weirder with unused $active, storing null values
etc.
2022-06-16 13:23:01 +02:00
Franco Fichtner
23894aa370 system: link-local check using empty() to avoid warning 2022-06-15 07:55:58 +02:00
Franco Fichtner
bec615f6f7 system: possible undefined read 2022-06-15 07:50:54 +02:00
Franco Fichtner
90f471cb19 interfaces: remove /var/run/booting side effect #5637
interfaces_configure() is unaffected.  While looking at the code
decided to make all callers except newwanip and vxlan hook use
$reload to request a full reconfiguration as that is most likely
what the user would expect in these cases in the first place.
2022-06-14 14:20:12 +02:00
Franco Fichtner
d8553a0e7f firewall: allow NPT logging; closes #5228
We will be adding NPT logging support because the infrastructure
already supports it.  1:1 is a bit harder to deal with so hands
off for now and see how this works out.
2022-06-14 13:43:46 +02:00
Franco Fichtner
22e376a9a8 ui: remove IE workarounds; closes #5351
Some libraries may still hold compatible JS code but we will update
these as we come to work on them or they are in need of updates.
2022-06-14 12:43:24 +02:00
Franco Fichtner
b724e2e434 firmware: disable crash reporter submission on non-production deployment
Just fiddling with the soon to be replaced functionality.  Remove the
pedantic check so we can see everything even from the dashboard hint.
2022-06-10 14:35:05 +02:00
Franco Fichtner
0819c4232b system: handle "production" mode without introducing a new type
Store debug and deployment and keep production as the implied default
if we want to change this later we can't get out of it without a migration
which we don't have for legacy configuration storage at the moment.
2022-06-10 14:05:49 +02:00
Franco Fichtner
3a5484dcd5 system: if no temperature sysctls are exposed do nothing
Likely cause for syntax error in user report.

PR: https://forum.opnsense.org/index.php?topic=28684.0
2022-06-10 13:50:01 +02:00
Franco Fichtner
552f86f9ea dhcp: small cleanup for previous 2022-06-10 10:51:03 +02:00
Franco Fichtner
3f98dc83c4 dhcp: stop obsessing over bridges
It's really not nice to fudge a link-local in dhcp code as the
bridge has a separate setting for it since 2019.

While here remove the restriction for bridge members on relay
that seems to originate from m0n0wall and abandoned by pfSense
in 2020.
2022-06-10 10:42:24 +02:00
Franco Fichtner
98bb8ba6f6 plugins: protect opportunistic explode()
This is to silence warnings on PHP 8.  Notices also exist on PHP 7.
2022-06-10 09:07:21 +02:00
Franco Fichtner
03fb3d71cd certs: rename constants for revocation reasons
Discussed with @swhite2 conceptually before and upon further
inspection we do not rely on the correct naming as long as the
number mapping remains correct.

This makes debug mode work on PHP 7.4 as well.  PHP 8 is unaffected.
2022-06-10 08:43:40 +02:00
Franco Fichtner
49ccb4ee56 Revert "Pass current IP address to static lease creation. (#5318)"
This reverts commit f83a74d4961c2a0c0b3500d8092590fdb17f534f.

The problem here is that people assign dynamic IP pool range address
to static device but dhcpd doesn't care about the static assignment
and will just hand out the IP again for a second device.

Also see: #5810
2022-06-09 14:25:43 +02:00
Franco Fichtner
228e74cd5f system: allow to adjust default of 50% RAM usage for MFS options; closes #5727
Add a maximum for /tmp MFS as well and make it adjustable while we still
know what we are doing.  ;)
2022-06-09 11:44:01 +02:00
Franco Fichtner
5d468642c4 system: post 22.7 we will be able to tighten /root permission #5475
This needs to boot 22.7 once and then we can introduce a base update
with the 750 permission and adjust the chmod accordingly.
2022-06-09 10:47:15 +02:00
Franco Fichtner
dc33b3ab4e system: narrow /var MFS down to /var/log and cap to 50% of physical memory #5727
Here we remove all persistently stored data from /root/var as configured
by the *_var_mfs rc variable.  The cap should be able to be adjusted in
the GUI but will follow in a separate commit.

Eventually this also helps us with #5475.
2022-06-09 10:36:54 +02:00
Franco Fichtner
4cff32c75b captive portal: oops 2022-06-09 09:52:40 +02:00
Franco Fichtner
4b880d1d94 captive portal: nitpicking on validation message
"x or y" can be confusing so try to avoid it.
2022-06-09 09:47:32 +02:00
Ad Schellevis
b9a25d9685 MVC - model: leave a note in BaseModel about performance. There is still something to gain, but likely not without adding more complexity.
Currently we will call parseOptionData() for each field method in the list, which shouldn't be needed as the underlying model can't change while parsing. Ideally we would extend SimpleXMLElement to offer a sticky/cached version of the parser or cache results for model targets, the latter has the disadvantage that parseXml() should keep track of the path in the model in order to know what it already did.

As this is one of the last "hotspots" according to the profiler. it feels like a good idea to at least document the opportunity for future reference.
2022-06-08 18:25:27 +02:00
Franco Fichtner
ab2cd48c13 interfaces: appease PHP 8.0 2022-06-08 15:14:57 +02:00
Franco Fichtner
5dd573b6e4 src: style sweep 2022-06-08 13:53:58 +02:00
Stephan
09d782f8f5 php80 / AutoNumberField: set minimum value to 1
Turns out the upgrade to php80 probably increased strictness of 0 == null, revealing a flaw in the AutoNumberField implementation. Easy fix is to never start at 0 unless explicitly set, in which case it's not an issue.
2022-06-08 11:31:19 +02:00
Stephan
fb32dc7fa0 php80: make sure recovery adheres to production settings as well 2022-06-08 11:31:08 +02:00
Stephan
2e6f1e2e77 php80: disable display_startup_errors except when debugging
while we're at it, PHP8 decided to enable display_startup_errors by default. Let's keep this
disabled except when in debug deployment mode.
2022-06-08 11:31:00 +02:00
Stephan
38c8927b7c php80: phalcon workaround and remove final keyword from private function 2022-06-08 11:30:40 +02:00
Stephan
0488d3669a PHP80: Add deployment options
Since PHP80 decided to turn certain notices into warnings, a way to silence these is necessary, which also presents us with the opportunity to make this configurable.
2022-06-08 11:30:22 +02:00
Stephan
a9211efbfc php80: remove $errcontext parameter from APIErrorHandler
This parameter was deprecated since 7.2.0, but is now removed. https://www.php.net/manual/en/function.set-error-handler.php
2022-06-08 11:30:02 +02:00
Stephan
e2accfdbdb php80: separator after array is nog longer supported 2022-06-08 11:29:40 +02:00
Stephan
36f8fcd0b2 Captive Portal: specify validation message for aesthetic reasons 2022-06-08 11:20:21 +02:00
Ad Schellevis
7a6e9f7642 OpenVPN / [Server:CSO] : Add domain search option 2022-06-08 10:18:17 +02:00
Ad Schellevis
81a355b5c0 Firewall: Rules: LAN - Move Inspect action into it's own async api action to prevent long page loads on large setups. 2022-06-05 15:55:57 +02:00
Ad Schellevis
3dac44b77a Firewall: Aliases - minor regression, rowToggle button missing 2022-06-05 15:39:17 +02:00
Ad Schellevis
570309c457 Interfaces: Other Types: VLAN - add unique constraint for tag+if, closes https://github.com/opnsense/core/issues/5806 2022-06-05 15:31:43 +02:00
Ad Schellevis
84b6d07558 Firewall / Aliases: fix alias removal, closes https://github.com/opnsense/core/issues/5807
as the previous version already build files in /var/db/aliastables and therefor future cleanup work, there might be some noise when patching this without a reboot (empty bogons or other external aliases). Without this patch the issue is only that aliases aren't removed, which doesn't make this a super high priority in my humble opinion.
2022-06-05 14:26:47 +02:00
Ad Schellevis
9db6ca2fad Firewall / Rules, Livelog : performance improvements
o Since our filterlog does contain labels nowaydays (https://github.com/opnsense/core/issues/5014), we can stop parsing pfctl which can be quite time consuming
o Rate limit "filter rule stats" configd action to prevent excessive pfctl access on filter pages
2022-06-03 21:05:05 +02:00
Ad Schellevis
22166fc896 Lobby / Dashboard / Carp status - reset $status_i18n when not found, even though this shouldn't happen, a broken config might show faulty status codes 2022-06-03 19:12:40 +02:00
Ad Schellevis
3645e58241 VPN/IPsec - remember phase 1 setting for next action. closes https://github.com/opnsense/core/issues/5803 2022-06-03 18:28:55 +02:00
Franco Fichtner
2a23f2dc14 interfaces: move lo0 interface registration to loopback 2022-06-03 12:24:38 +02:00
Ad Schellevis
df2fb88bf6 Firewall: Aliases - performance improvement for large numbers of (port type) aliases.
o cache getservbyname() results when validating a port in isPort() and use the same static object in is_port() for legacy code
o move isAlias() to use getByName() in the alias model so we can add a simple caching mechanism there

To invalidate the cache for isAlias() one could either hook a new instance of the model using attachAliasObject() or attach an empty one attachAliasObject(null).
2022-06-02 19:00:08 +02:00
Franco Fichtner
7018b7b3e0 firmware: update repository silently on remote list if needed
PR: https://forum.opnsense.org/index.php?topic=28537.0
2022-06-02 10:11:20 +02:00
Franco Fichtner
c99cebb409 src: style sweep 2022-06-02 08:50:41 +02:00
Ad Schellevis
0d336c0348 VPN/OpenVPN - small regression in 657265a410 , when no tunnels are actually reconfigured, a filter reload event will be fired for each interface... which will take ages on large setups. 2022-06-01 18:23:02 +02:00
Ad Schellevis
cdcf22e80d Unbound: disabling the first DNS override entry invalides config. closes https://github.com/opnsense/core/issues/5798 2022-05-31 19:17:32 +02:00
David Mora
03f43d6c5b
Fix for Unbound Stats: zero_ttl is no longer a valid statistic (#5793)
* Update Unbound Stats to fix zero_ttl name and add additional stats

* Unbound stats - change to custom sort order
2022-05-29 18:35:06 +02:00
Ad Schellevis
77e3794081 Firewall / Aliases - exclude internal aliases on import. 2022-05-28 13:09:27 +02:00
Paul Kelso
37a1b761d7
Fix grammar. Missing period. (#5791)
Grammatical error - period missing.
2022-05-28 09:25:06 +02:00
Ad Schellevis
021786612c Firewall / Alias - when reading current alias content using pfctl, make sure to ignore empty lines. closes https://github.com/opnsense/core/issues/5788 2022-05-26 10:53:44 +02:00
Franco Fichtner
11e8c26079 firewall: remove file_notice() in filter HA sync 2022-05-24 14:07:20 +02:00
Franco Fichtner
079f1fa914 system: style sweep 2022-05-24 13:36:37 +02:00