14078 Commits

Author SHA1 Message Date
Franco Fichtner
1ca149fdcc dhcp: remove ddnsupdate static mapping switch
From a top-down perspective it only makes sense if ddns is enabled
globally, but in this case someone went copy+paste a bit too much.

Since now we force ddns-hostname from global state it makes sense
to tie the static override to this as well instead of making a sub-
switch for global functionality for an optional field to smoothen
the expected result.

If this override is actually useful is another question entirely.
2022-06-28 14:21:07 +02:00
rfc4711
37eae60b22 dhcp: inlcude ddns-hostname and other cleanups; closes #4452 2022-06-28 14:20:27 +02:00
Franco Fichtner
2006ead955 interfaces: small updates on previous 2022-06-28 13:40:14 +02:00
Manuel Faux
06fa8c7d2e
Wireless: Add WPA Enterprise Configuration for Infrastructure Mode (#4566)
* Wireless: Add EAP support for infrastructure mode

Add configuration for WPA2 Enterprise authentication for Wireless
infrastructure mode:

* EAP modes TLS, TTLS and PEAP
* Phase 2 modes MD5 and MSCHAPv2
* CA certificate for server verification
* Certificate for client authentication

* Wireless: dynamically show/hide relevant properties

For wireless interface configuration show/hide only currently
relevant settings to facilitate configuration.

* Show WEP settings only when WEP is enabled
* Show WPA settings only when WPA is enabled
* Show EAP settings only when EAP is enabled
* Show IEEE 802.1X settings only when relevant
* Hide AP-only/Adhoc-only settings when infrastructure mode
  is selected
2022-06-28 13:12:25 +02:00
Franco Fichtner
b9da60d15b pkg: simplify 2022-06-28 12:39:17 +02:00
Franco Fichtner
be50228e5c ipsec: style sweep 2022-06-28 11:16:41 +02:00
NOYB
79f8168b37
Firewall Log Widget Header Tweak (#5462)
Reduce line wrap:
Remove "Dest " from the destination port header.  Provides little value at the expense of increase line wrap.  In this context and column position (to right of destination address) it is obvious to be the destination port.  Source port in this context and column position would make no sense.
2022-06-28 11:16:01 +02:00
Franco Fichtner
d09fd3cce5 ipsec: cleanup for previous 2022-06-28 11:10:49 +02:00
vnxme
6d3bd41ab0
VPN / IPsec / Tunnel Settings: Add IPv4+6 protocol for mobile phase1 entries (#5436)
* VPN / IPsec / Tunnel Settings: Add IPv4+6 protocol for mobile phase1 entries
2022-06-28 11:10:34 +02:00
agh1467
59c2059eb2
MVC - model: throw when no mount found (#5830)
* Return a useful message to the UI if no mount is found in the model XML.
  Otherwise this condition results in a SimpleXMLElement error, trying to
  parse an empty string in toXml(), `$xml = new SimpleXMLElement($xml_root_node);`
2022-06-26 16:49:09 +02:00
agh1467
a3a54623a8
ui: bootgrid, correct required api for command-info #5478 (#5829)
* command-info uses this.command_info method, which expects
  params['info'] to be populated, not 'get'.
2022-06-25 22:02:39 +02:00
Franco Fichtner
91b840d5d2 interfaces: inconsistencies in wireless handling #5825 2022-06-24 13:17:02 +02:00
Franco Fichtner
09ff74b774 dpinger: prefer primary IPv6 to fix #5824 2022-06-24 08:26:03 +02:00
Franco Fichtner
7fdc163bf2 interfaces: style sweep 2022-06-20 11:51:18 +02:00
Franco Fichtner
d4a65e26e1 ui: boostrap-select ignored header height
Make sure selectpicker doesn't expand up underneath
the header making the first item not selectible under
certain conditions during expansion (scroll at 0).
2022-06-20 11:42:39 +02:00
Franco Fichtner
3c8efbc5f6 interfaces: typo in previous #5637 2022-06-17 09:32:09 +02:00
Franco Fichtner
2862eaf0cc interfaces: for specific device edit pages avoid reloading device again #5637
The device reconfigure is done unconditionally before configuring the attached
interface.  If we use reload we will configure the interface again, but if the
interface is disabled we wouldn't trigger the device creation.  So go back to
the former code which didn't exhibit any real issue before we used $reload.
2022-06-17 09:29:23 +02:00
Franco Fichtner
7aecb367c8 interfaces: upon reload request also generate the $realhwif; closes #5819
This goes for all "known" devices.  We need to be careful of reload loops
that create a device and then reload it which could trigger another interface
configure, but at the moment at least all $reload consumers are outside of
the plugin device code / single action driggers.

Also see: 90f471cb19
2022-06-17 09:24:43 +02:00
Franco Fichtner
82b11d3b5f interfaces: fix most common undefined access messages
ipaddr(v6) is not set when not configured which makes sense
but PHP wants us to acknowlege that we really want nothing
when the value doesn't exist.  Stuffing it through the parse_config()
was another idea but in practice in legacy code null equals
<sometag/> and '' equals <sometag></sometag> so if we prime both
fields using null we write them back as empty which isn't bad per
se but also best avoided.
2022-06-16 14:55:07 +02:00
Franco Fichtner
26ef1b0438 system: fix syntax error
Non-debug mode doesn't print "php -l" errors anymore.  Need to adjust to this.
2022-06-16 13:55:10 +02:00
Franco Fichtner
f5327b755a system: reduce $pwread scope to stop PHP from being silly
On failure of "pw" command the explode would split
"pw: no such user `foobar'" and then later check it.
If the user name was "pw" that would be suboptimal
for eligbility.

Instead ignore stderr and do not fill $userattrs which
is already handled by the if below but make it more
explicit using === null comparision.
2022-06-16 13:44:20 +02:00
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
1a053334c2 php80: transition for simplepie
php80: curly brace array access deprecated & removed

dac5a3cb80

php80: fix implode argument order

38b504969e

php80: required parameters are no longer allowed after optional parameters

d18f05c9ed

php80: prevent ValueError for invalid encoding

deddccdb1a
2022-06-08 11:30:51 +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