14513 Commits

Author SHA1 Message Date
Ad Schellevis
2d74c6b641 Interfaces/Other Types/VLAN - constraint user input further for https://github.com/opnsense/core/issues/6038 to avoid future naming collisions. 2022-10-01 09:42:01 +02:00
Franco Fichtner
4f9e12c999 src: style sweep 2022-09-30 17:11:50 +02:00
Stephan de Wit
346cc08c99
Unbound: addition to advanced rework (#6053)
Small addition to https://github.com/opnsense/core/pull/6050:

- Move private/insecure domains to advanced as its intended use has a larger scope than DNSBLs only. Fixes https://github.com/opnsense/core/issues/5256
- Extends the migration to also include these domains.
- leftover cleanup of legacy settings in migration.
- Adds the `serve-expired-reply-ttl`, `serve-expired-ttl`, `serve-expired-ttl-reset`, `serve-expired-client-timeout` options. These options are hidden until the `serve-expired` checkbox is checked, and indented to signify a relationship.
- Removes all dropdowns and instead provides numeric fields to input raw values for more control and less "guessing" of what is acceptable.
- Removes default settings to prevent mismatches with upstream in the future. It's probably best to refer to the Unbound documentation in our own documentation.
- Previously, `rrset-cache-size` and `outgoing-range` were implicitly set. These are now input fields. The migration code will take care of legacy setting assumptions.

Fixes https://github.com/opnsense/core/issues/5978
Fixes https://github.com/opnsense/core/issues/5795
2022-09-30 17:08:34 +02:00
Franco Fichtner
9cf0b30348 system: redirect spurious error #6059 2022-09-30 10:11:12 +02:00
Franco Fichtner
e48fa6539f system: for recovery reasons can't depend on mwexec() #6059 2022-09-30 10:02:49 +02:00
Franco Fichtner
74238dec17 system: remove stray installer account since ba2da34854a
PR: https://github.com/opnsense/core/issues/6059
2022-09-30 09:27:03 +02:00
kulikov-a
e5bace2969
support setting type value via api call (#6054)
Closes https://github.com/opnsense/core/issues/6047
2022-09-30 09:22:32 +02:00
Franco Fichtner
073dd2ec6d system: avoid error on installer user creation
pw: no such user 'installer'
2022-09-30 09:07:37 +02:00
Franco Fichtner
c626b96117 src: style sweep 2022-09-29 15:37:37 +02:00
Ad Schellevis
e395da80b2 VPN: IPsec: Key Pairs : add generate button and support ECDSA type certificates.
closes https://github.com/opnsense/core/pull/5457 , https://github.com/opnsense/core/pull/5449
2022-09-29 15:33:22 +02:00
Franco Fichtner
c10cb5b0eb src: style sweep 2022-09-29 10:10:16 +02:00
Ad Schellevis
9d3364e718 VPN: IPsec: RSA Key Pairs: prevent model validation to change actual input contents as this can be highly confusing (and unexpected).
While here, simplify code as well, only store validation output (size, fingerprint) in model itself, although it would be cleaner to send this information via the controller (as overlay), it would mean duplicate work here.

Found while testing https://github.com/opnsense/core/issues/5636
2022-09-29 09:23:16 +02:00
Franco Fichtner
58f81a2064 firmware: clear license file if no subscription key is set
Tweak the external wording and position.  Seems convenient to
append to version, but ideally we add dynamic elements to the
bottom.
2022-09-29 08:39:50 +02:00
Franco Fichtner
6c43407860 system: structurally improve boot sequence #6052
In some cases early DNS works with direct upstream queries for
fixed DNS servers.  For DHCP or other dynamic connectivity it
will likely never work as expected with interface-related host
lookup requests.

At least try to load /etc/resolv.conf along with /etc/hosts and
refresh when all interface configuration is active.  This needs
to rely on running configuration to pick up DHCP and the like
as said before.
2022-09-28 15:03:28 +02:00
Franco Fichtner
65be7fb0a8 system: remove legacy syslog file 2022-09-28 14:47:49 +02:00
Ad Schellevis
dbba3223f7 Interfaces: Diagnostics: Packet Capture - don't pass 0 to tcp dump (zero equals no limit) 2022-09-27 19:21:25 +02:00
Franco Fichtner
6af75dd122 src: whitespace sweep 2022-09-27 14:48:46 +02:00
Stephan de Wit
f3e0e067ec fix file permissions 2022-09-27 14:34:02 +02:00
Stephan de Wit
33a253a748 unbound: finish up unbound/advanced MVC conversion 2022-09-27 14:34:02 +02:00
Stephan de Wit
d2b18299b4 unbound: advanced page MVC migration prep 2022-09-27 14:34:02 +02:00
Franco Fichtner
af9e9b48b7 system: wrap $g handling into a singleton
Adds a bit of code on the initialization but allows to trace the
information without magic globals.

Has been on the wishlist forever, but nowadays it's simple enough
to replace the few instances using it.
2022-09-27 11:07:49 +02:00
Franco Fichtner
15ac360559 system: avoid $g use if we have data already
Still don't like the appended line here but we will see how
this works in practice.
2022-09-27 11:06:14 +02:00
Franco Fichtner
dd42c8785a firmware: restructure license information handling
opnsense-update -K will handle subscription key return if found.
Fetch the license metadata if it exists, move it to core version
meta file and handle the contents dymanically if it exists.

The only issue for later is that changing the mirror away from
business we have a lingering license file until the next check
for updates is done.
2022-09-27 09:13:45 +02:00
Ad Schellevis
261c76d00d Firewall / Aliases - add os-firewall alias paths in getAliasSource() to prevent removal when being used. closes https://github.com/opnsense/plugins/issues/3140 2022-09-25 13:21:11 +02:00
Ad Schellevis
0210a42096 MVC / dropdown field presentation. remove "clear all", "copy" and "paste" options when only a single entry is allowed. 2022-09-24 17:26:11 +02:00
Franco Fichtner
0798b98a16 src: whitespace sweep 2022-09-23 20:31:42 +02:00
Stephan de Wit
2351f17c33 unbound: account for hostname during PTR creation, regression in 547c8b1 2022-09-23 08:54:17 +00:00
Ad Schellevis
7c0db67577 Firewall/Rules - support tos/dscp matching. validation issue in a002251146 for https://github.com/opnsense/core/issues/6045 2022-09-22 17:12:54 +02:00
Ad Schellevis
a002251146 Firewall/Rules - support tos/dscp matching. closes https://github.com/opnsense/core/issues/6045
Add the `tos` keyword to the filter rule edit page and render in pf.conf when set.
2022-09-22 11:45:40 +02:00
Ad Schellevis
5d59e86b4b IXR_Library.php - minor cleanups, partly borrowed from https://github.com/kissifrot/php-ixr. closes https://github.com/opnsense/core/issues/5911
At the moment it doesn't seem to make much sense replacing the IXR library, the latest release tag from https://github.com/kissifrot/php-ixr seems to be from a couple of years ago as well and most changes relate to splitting the file into separate class files.
2022-09-21 17:01:23 +02:00
Ad Schellevis
797764c10a Core/Firmware - display license validity when applicable
Extends check.sh to fetch license json file when a uuid is found and flush this to /usr/local/opnsense/license.json.
The firmware page adds a license validity row, which is hidden by default and only shown when product.php returns 'product_license_valid_to'.

For the dashboard widget we'll add the "licensed until" string to the core product string when available.
2022-09-21 15:37:17 +02:00
Ad Schellevis
67d22336fa Firewall/Log Files/Live View - various performance and usablility improvements. for https://github.com/opnsense/core/issues/6042
o bulk insert <tr/> objects to prevent overhead finding the top item in the list
o fetch with a minimum of 1000 records, so the browser has something to apply filtering too, this also prevents the issue of not being able to find results when > 25 records per second arrive. Processing 1000 visible records is a lot more effort for the browser than handling 1000 invisible ones.
o simplify table cleanup, as records over "max_rows" would be dropped anyway.
2022-09-20 18:34:43 +02:00
kulikov-a
a62bc31a36
simplepie: type cast (#6044) 2022-09-20 15:54:25 +02:00
Ad Schellevis
9a956d065a Lobby: Dashboard - RSS widget, catch Error to prevent dashboard breakage. for https://github.com/opnsense/core/issues/6043 2022-09-20 15:51:33 +02:00
Ad Schellevis
ffd64bcfd5 Firewall/Rules - simplify firewall_rule_lookup.php by reusing filter_core_rules_user(), add reference and rule sequence to filter_core_rules_user().
```
$fw = filter_core_get_initialized_plugin_system();
filter_core_bootstrap($fw);
plugins_firewall($fw);
filter_core_rules_user($fw);
```

Above block should offer a complete view on the firewall rules now, which we may use in the gui as well. There's still an idea to offer a full view on all firewall rules that apply to an interface (including floating and groups), a bit inspired by this request https://github.com/opnsense/core/issues/6024. In order to do this, we should likely be able to offer a single rule provider first so we can just query the object.
2022-09-20 13:08:47 +02:00
Ad Schellevis
cebea865c9 Firewall/Rules - extend legacy configuration with uuid's to align with mvc code.
Since filter_rules_sort() is only called via front end pages, it should be safe to check if rules already have a uuid assigned and assign them if they don't. This prevents a migration and increases the change of fast adoption of the rule uuid's.

This commit adds generate_uuid() to config.inc and mimics the same behaviour as mvc models will do, if at a later point in time we would like to hook uuid's to xml attributes in other areas as well, we can simply reuse this.

It is likely a good idea to start using the uuid's in filter_core_rules_user() as labels too as this would prevent the use of the rule hash calculation (saves time and is a more stable id in most cases).

Impact of this change should be rather low as nothing depends on the uuids yet.
2022-09-20 11:17:29 +02:00
Ad Schellevis
d20a9c8236 filter - refactor filter_configure_sync() to wrap user rule registration in a separate function called filter_core_rules_user()
This eases re-use of the rule database from other areas of the system.
2022-09-19 21:19:05 +02:00
kulikov-a
6c82c417be
Firewall:Util - php 8 fix (#6040) 2022-09-19 19:45:55 +02:00
Ad Schellevis
5bf6256367 Interfaces/Other Types/VLAN - user configurable device names. closes https://github.com/opnsense/core/issues/6038 2022-09-19 18:26:48 +02:00
Ad Schellevis
85bc68df66 Firewall/NAT/Port Forward - simplify logic for delete and toggle and make sure to toggle firewall rule as well. closes https://github.com/opnsense/core/issues/5548
while here, also remove the dblclick behaviour on <tr/> as we have removed that on firewall rules years ago (d52fc47acc)
2022-09-19 11:45:06 +02:00
Wagner Sartori Junior
3c59ce3b61
VPN/IPsec - Fix bug when tunnel isolation is disabled (#6033)
Fix #6022 that will add multiple phase 2 IPs to the same interface when tunnel isolation is disabled.
2022-09-19 10:15:41 +02:00
kulikov-a
98f21ed601
unbound: reduce blocklist read timeout (#6030) 2022-09-18 10:14:12 +02:00
Ad Schellevis
1ba8910df4 System/Trust/Revocation - remove unnecessary crl_update() calls in crl export and openvpn as the contents in the text field should be populated in earlier calls (e.g. cert_revoke(), cert_unrevoke()). closes https://github.com/opnsense/core/issues/6005 2022-09-17 20:04:36 +02:00
Ad Schellevis
67e4a1dd99 System / Trust / Revocation - only use withPadding() for RSA based public keys. regression in 9606957ef8 2022-09-16 10:34:35 +02:00
kulikov-a
24aa099509
Dashboard / widgets / OpenVPN - link event before scripts stripping (#6023) 2022-09-14 18:43:59 +02:00
Ad Schellevis
2aaffc372d Merge branch 'kulikov-a-pftop_formats' 2022-09-14 11:14:39 +02:00
Ad Schellevis
f22c05ec61 Firewall/Diagnostics/Sessions: parse pftop internal data conversion (minor cleanups for https://github.com/opnsense/core/pull/6020) 2022-09-14 11:13:55 +02:00
kulikov-a
0f84667e37 parse pftop internal data conversion 2022-09-13 17:53:24 +03:00
kulikov-a
f4f05f23d5
OpenSSL: follow RFC on basicConstraints too (#6018) 2022-09-13 13:24:54 +02:00
Ad Schellevis
e4be9320a9 Merge branch 'soif-arp_table_hostname' 2022-09-13 11:56:33 +02:00