16612 Commits

Author SHA1 Message Date
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
Ad Schellevis
caf83e598d VPN: IPsec: Tunnel Settings [legacy] - fix typo in cnofig generation. closes https://github.com/opnsense/core/issues/7344 2024-03-25 11:30:42 +01:00
Ad Schellevis
550dacfe92 VPN: WireGuard / Peer config builder - typo in previous. 2024-03-25 09:32:18 +01:00
Franco Fichtner
768d900e8b pkg: fix plist 2024-03-24 21:13:48 +01:00
Ad Schellevis
13b685a0a7 VPN: WireGuard / Peer config builder - add a new option to generate client configs and store their public parts on this firewall. closes https://github.com/opnsense/core/issues/7308
Endpoints are stored in the instance option as these are only relevant for the client (e.g. servers fqdn:port). Default allowed ip's for clients are all, we might consider storing these in the instance at some point as well, but lets avoid toggles nobody asked for yet.
2024-03-24 17:14:14 +01:00
Stephan de Wit
1d593fe984 dashboard: add CPU Usage widget
Also allow for each widget to override the resize handles in case
they should be more restrictive in terms of dimensions.
2024-03-22 15:59:40 +01:00
Franco Fichtner
af459fff31 mvc: style sweep 2024-03-22 15:21:24 +01:00
Stephan de Wit
89d4af5a52 configd: extend streaming support for blocking processes
This allows for hooking into the EventSource mechanism on the client side,
enabling server-sent events without busylooping on the backend.
This will reduce stateless network chatter and eliminates the need for
polling and many other benefits.

Continuation of f25e1214dc,
which disables buffering on the webserver side. This change in particular also
removes implicit buffering on the configd side.

As an example, the polling of CPU usage is included with a backend script here.
Granted, this could easily be replaced by `iostat -w 1 cpu | egrep -v "tty|tin" --line-buffered`,
but the client will eventually need some form of per-event formatting which is already
being handled in this example. When implementing these types of scripts, make sure
that all output that encapsulates a single event is flushed at all times to prevent
OS buffering. A new controller (without any consumers) is also implemented to showcase
the passthrough mechanism on the controller side.
2024-03-22 10:29:44 +01:00
Stephan de Wit
d27eb4261c webui: fix previous
configuration requires forward slashes here
2024-03-22 10:25:20 +01:00
Ad Schellevis
f25e1214dc webui - In order to allow streaming to the client, we like to prevent Lighttpd buffering our responses. This commit is a proposal to only enable streaming responses on api endpoints, as we do need to wait for the script to exit anyway. In theory we could do the same for /ui, but that's less important at the moment.
Documented in https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_stream-response-bodyDetails
2024-03-21 14:42:29 +01:00
Ad Schellevis
ff1991cdee Interfaces - change help text to reflect reality. closes https://github.com/opnsense/core/issues/7339
For dhcp type interfaces, gateways are being pushed by the server and we automatically assume these are "external". For static ones you can configure similar behavior, but only explicit. When selecting a gateway, both reply-to and source nat rules are affected.
When nothing is chosen (now default, earlier "auto-detect"), normal routing rules apply and nothing special happens.
2024-03-21 14:09:12 +01:00
Stephan de Wit
fd35aee95d dashboard: use 'super' for clarity, also minor cleanup 2024-03-20 16:11:55 +01:00