16623 Commits

Author SHA1 Message Date
Ad Schellevis
ed1d8a6260 Config - fix locking issue when already owning the lock.
In most cases we use config locking, the lock is acquired only once, in which case all works as expected.
When a controller fetches a lock and passes it on to one of the core controller wrappers which then re-acquires the same lock, the default is to load the config again.
Pending data in other models will be flushed in these cases, which is unexpected if we're updating the same config, but a different section.

This change only executes the reload when not yet locked by this process.
2024-04-07 12:56:20 +02:00
Ad Schellevis
3f5d7f0779 VPN: OpenVPN: Instances - only complain about a missing linked CA when none is being offered otherwise, if we're not going to use the attached CA, it should also be safe to ignore it. 2024-04-05 19:05:45 +02:00
Franco Fichtner
b53fe7c1d9 dhcpd: make private consumers actually private where it matters 2024-04-05 12:06:31 +02:00
Franco Fichtner
14cc9a1c2f plugins: add globbing for run tasks as well 2024-04-05 11:52:17 +02:00
Stephan de Wit
aebd4aa83c dashboard: missing copyright notice 2024-04-05 11:10:30 +02:00
Ad Schellevis
0d7b9fd34f Reporting: Traffic - fix netaddr incompatibility (AttributeError: 'IPAddress' object has no attribute 'is_private') 2024-04-05 10:24:01 +02:00
Franco Fichtner
ce71a40b03 interfaces: unused return value 2024-04-05 10:22:41 +02:00
Stephan de Wit
5220c4a1a6 dashboard: widgets are draggable, adjust cursor accordingly 2024-04-05 09:30:47 +02:00
Ad Schellevis
899b41a576 VPN: WireGuard: Peer generator - Add DNS field and store previous used values in Instance. closes https://github.com/opnsense/core/issues/7357 2024-04-04 22:00:07 +02:00
Ad Schellevis
966bda3c96 mvc: minor regression in 10c81a4eea, if getNodeData() does not return an array, just pass the data. 2024-04-04 20:41:24 +02:00
Ad Schellevis
5d70d873c1 interfaces: convert GIF configuration to MVC/API , closes https://github.com/opnsense/core/issues/7241
for consistency, when removing a legacy role, keep the -edit one.
2024-04-04 20:10:56 +02:00
Franco Fichtner
b36b8edf87 src: style sweep 2024-04-04 19:25:04 +02:00
Ad Schellevis
07a051fd7d interfaces: GIF/GRE configuration - format local addresses by using the new option introduced in 10c81a4eea
ref:
  https://github.com/opnsense/core/issues/7241
  https://github.com/opnsense/core/issues/7242
2024-04-04 18:21:47 +02:00
Ad Schellevis
10c81a4eea mvc: refactor grid search to fetch descriptive values from the model instead of trying to reconstruct them.
This makes it easier for special model field types to translate values into human readable formats, also when not being presented to the user like that in a selector.
2024-04-04 18:19:12 +02:00
Ad Schellevis
4b647fc3f3 interfaces: convert GRE configuration to MVC/API, closes https://github.com/opnsense/core/issues/7242
Final bits and pieces to move GRE tunnels to MVC, ACL, menu registration and align reconfigure action with GIF tunnels.
2024-04-04 18:16:59 +02:00
Ad Schellevis
9cc991194d VPN: WireGuard: Peer generator - forgot to store attached instance (server), closes https://github.com/opnsense/core/issues/7356 2024-04-04 17:34:29 +02:00
Franco Fichtner
b71c42b9c5 src: style sweep 2024-04-04 17:33:47 +02:00
Stephan de Wit
4449a26ad2 dashboard: include CPU type in usage widget 2024-04-04 17:02:56 +02:00
Stephan de Wit
d267e33de4 dashboard: system information widget
Minor restructuring of the BaseTableWidget as well
2024-04-04 16:48:11 +02:00
Ad Schellevis
dbd1800584 interfaces: convert GIF configuration to MVC/API , closes https://github.com/opnsense/core/issues/7241
minor modification in reconfigure_gifs.php to prevent ipv6 addresses to be left behind after a change.
When the interface already exists, flush all addresses in the same way Wireguard is doing on our end and link virtual ips and routes back after configuration.

For IPv4 this seems to be less problematic as additional addresses are aliases and changing the address leads to an update instead of an "insert".
2024-04-04 15:43:17 +02:00
Franco Fichtner
22e6befe7c system: fix legacy language handing
gettext 0.22.5 broke legacy translation but MVC kept working so
digging through the code this is the additional env vars and
setting that Phalcon does.
2024-04-04 11:18:32 +02:00
Franco Fichtner
faf6ab7f21 make: add a small 'feed' helper for compiling release notes 2024-04-04 08:59:36 +02:00
Ad Schellevis
52f16eba40 plist 2024-04-03 21:53:17 +02:00
Ad Schellevis
84a5b5bd9f interfaces: convert GRE configuration to MVC/API (https://github.com/opnsense/core/issues/7242)
Add boilerplate, quite similar to GIF interfaces
2024-04-03 21:50:53 +02:00
Ad Schellevis
e652d8a1b3 interfaces: convert GIF configuration to MVC/API (https://github.com/opnsense/core/issues/7241)
minor naming issue
2024-04-03 21:22:45 +02:00
Franco Fichtner
fa73618177 wireguard: this too 2024-04-03 12:11:20 +02:00
Franco Fichtner
e53da1f339 wireguard: rename as discussed 2024-04-03 09:57:21 +02:00
Ad Schellevis
c4867a400b interfaces: convert GIF configuration to MVC/API , closes https://github.com/opnsense/core/issues/7241
cleanup _interfaces_gif_configure() a bit and mark the sections that should be removed in 24.7, the idea is to make sure routing is consistent between all interface types, which means the routing parts should go away. Existing configurations should stay functional, only when adding an aliasip no interface would be connected (which after final cleanup would be the default behavior anyway).

Ditch legacy pages and change menu registrations and acl's. This state should be safe for a minor release, so we can push the behavioral change in 24.7 by only removing the marked sections.
2024-04-02 17:12:12 +02:00
Franco Fichtner
12f6732c2f mvc: style sweep 2024-04-02 15:32:12 +02:00
Ad Schellevis
3079d5acc5 interfaces: convert GIF configuration to MVC/API (https://github.com/opnsense/core/issues/7241)
some minor cleanups and validation improvements.
2024-04-02 14:39:25 +02:00
Franco Fichtner
f7ac887d90 system: move authgui.inc to appropriate location
Auth and gui were already split but stored side by side but it makes
no sense for authgui to be used anywhere other than the legacy GUI.
2024-04-02 08:33:30 +02:00
Franco Fichtner
5302f4b772 src: whitespace 2024-04-02 08:21:07 +02:00
Franco Fichtner
5e83352e45 mvc: style sweep 2024-04-02 07:46:56 +02:00
Franco Fichtner
a2aa49c04b src: style sweep 2024-04-02 07:41:29 +02:00
Ad Schellevis
d86da4dc47 plist-fix 2024-04-01 19:50:10 +02:00
Ad Schellevis
769fc1d87e interfaces: convert GIF configuration to MVC/API (https://github.com/opnsense/core/issues/7241)
First batch of changes for this migration, the data underneath should be left mostly unchanged. The model overlays the existing data, only new entries will be slightly different.
When an interface is offered, it will be stored in the <if> field, an address will be moved to the <ipaddr> field, one of these values will be used instead of both for ipalias entries.

The reconfigure action is similar to the one in laggs, and will only apply the records changed by the user. Dropping gif interfaces before creation shouldn't be needed, so that's removed as well.

Using the LinkAddressField type we can either offer an (existing) address or an interface/carp vhid, to keep things backwards compatible. With the replaceInputWithSelector() javascript helper we can offer the choice between an address or a known entity from the list.
2024-04-01 19:40:18 +02:00
Stephan de Wit
7f6f55814f system: allow (multiple) sysctl calls over configd
Often many related sysctls are queried in sequence, but since the
binary allows for multiple params we can save the overhead and
simply push the result in a parseable structure. Include the original
OID so the caller can deal with missing sysctls or empty values.
2024-03-29 16:54:05 +01:00
Stephan de Wit
8e8adeca9a dashboard: clean up previous slightly 2024-03-29 10:39:43 +01:00
Stephan de Wit
ea410547e3 dashboard: handle translations on controller layer 2024-03-29 10:12:56 +01:00
Stephan de Wit
0ec8d7d471 dashboard: update ACLs 2024-03-29 09:42:16 +01:00
Ad Schellevis
64ec6dec9a Services: Unbound DNS: Blocklist - duckduckgo.com fix, closes https://github.com/opnsense/core/issues/7301 2024-03-29 09:24:09 +01:00
Stephan de Wit
fe1a8ecfa6 ui: prevent vertical modal overflows and instead present a scrollbar 2024-03-28 17:00:49 +01:00
Ad Schellevis
0739a2ab16 Firewall: Automation: Filter - remove unused code to support input+select entry and start using the new $.replaceInputWithSelector() for source/destination networks. 2024-03-28 14:52:02 +01:00
Ad Schellevis
1247297679 System: Trust: Certificates - accidentally broke template in bc2ca23c93 , revert this change. 2024-03-28 14:48:59 +01:00
Ad Schellevis
0a7a7ff2ab mvc / frontend - Javascript code: add $.replaceInputWithSelector() action to easily replace single inputs for (grouped) selects. In some cases a set of options is available which we do want the user to choose from, but also manual input is an option. (for example known networks vs manual netblocks)
Using this commit you can fetch the options from a different source and replace <input> tags for a combination of <input>/<select>, example usage:

ajaxGet('/api/my/endpoint', [], function(data, status){
   $(".net_selector").replaceInputWithSelector(data);
});
2024-03-28 14:44:42 +01:00
Ad Schellevis
9b981b7e03 mvc/views - minor regression in c8adc29212, allownew needs a default 2024-03-28 11:29:32 +01:00
Stephan de Wit
489b5d6c2e mvc: configdStream: poll_timeout should be configurable on controller layer
The default of 2 is fine for predictable processes or direct data
passthrough, but any event-based mechanism might need to change this.
2024-03-28 10:35:48 +01:00
Ad Schellevis
14ea1b96e8 mvc - change exception handling in runMigrations() to avoid mismatches in attributes being silently ignored.
When a migration tries to address an non existing attribute, a InvalidArgumentException is thrown, but only partially noted in the log.
It's likely safer to abort the migration if steps fail and send the error to the log for further inspection.
2024-03-25 21:17:14 +01:00
Stephan de Wit
e23fee9ec7 mvc: configdStream: actually, ob_end_flush() is still necessary
Turns out there is still implicit buffering happening, the exception
thrown is due to a lack of error handling on the Phalcon side. Even
the PHP docs suggest silencing this with '@'.

This reverts commit 7c05e524b047e6d915b80994855a4e69d365645c.
2024-03-25 16:44:11 +01:00
Stephan de Wit
7c05e524b0 mvc: configdStream: remove ob_end_flush()
Our default PHP configuration already has output buffering set to 0,
and since there is no explicit buffering start, the ob_end_flush()
will throw two exceptions on development mode when streaming a log
file. We likely don't need this anymore so removing it here.
2024-03-25 16:17:23 +01:00