651 Commits

Author SHA1 Message Date
Stephan de Wit
8846037d93
MVC: Add IPPortField type (#7134)
Useful for Netflow and plugins. Tests included.
2024-01-11 15:41:40 +01:00
Franco Fichtner
587375aaed unbound: move back to upgrade hook which requires the old duckdb version only found there 2024-01-11 15:28:58 +01:00
Ad Schellevis
13408c8206 Reporting: Unbound DNS - move duckdb export functionality to helper and always dump before system shutdown to be able to ship duckdb library upgrades on minor releases in the future.
In an attempt to keep the database clean and hopefully error prone, the logger will export/import now every ~24 hours. As these operations are rather quick it should help to minimize the footprint as well (duckdb files keep growing after deletes).

closes https://github.com/opnsense/core/issues/7049
2024-01-11 15:05:41 +01:00
Franco Fichtner
57312292ee firewall: remove last "pfplugin" use #6390 2024-01-11 10:19:48 +01:00
Franco Fichtner
2cfe2fdc1c firmware: allow os-squid install during major upgrade; closes #7030 2024-01-11 10:15:06 +01:00
Franco Fichtner
b339f21817 filter: remove pfplugin use from below backend #6390 2024-01-09 16:25:31 +01:00
Ad Schellevis
4d8c9d1c4f MVC: ditch phalcon's syslog implementation for a simple wrapper of our own. for https://github.com/opnsense/core/issues/6389 2024-01-09 14:23:01 +01:00
Ad Schellevis
84e43caf2d MVC - add a field type for descriptions and uniform description uses in core modules. 2024-01-08 16:24:25 +01:00
Franco Fichtner
dfc834dabb src: style sweep and plist fix 2024-01-07 21:03:04 +01:00
Ad Schellevis
3daff54655 Services: Intrusion Detection: Policy - show rule origin in rule adjustments grid. As we need to fetch all rule labels in order to link them and the number of installed rules may be quite large (>100k) we need a small work-around here to prevent other model callers from always having to wait for [msg, source] being populated.
closes https://github.com/opnsense/core/issues/7121
2024-01-07 16:22:17 +01:00
Stephan de Wit
a40e6ae0a6
MVC: remove Phalcon migration glue (#7117)
* MVC: remove phalcon migration glue

* fix plist

* remove commented out autoloader code
2024-01-05 18:29:05 +01:00
Franco Fichtner
ac61446b21 pkg: fix plist 2024-01-05 14:50:37 +01:00
Ad Schellevis
4d495ea6cc Interfaces: Overview - remove legacy version and its related functions and scripts. closes https://github.com/opnsense/core/issues/6832 2023-12-25 14:03:22 +01:00
Franco Fichtner
8226c84a2f web proxy: move all files to plugin #7030 2023-12-19 15:11:20 +01:00
Franco Fichtner
ebd5696f1c firmware: lock down FreeBSD repo and fix minor annoyance 2023-12-19 10:51:25 +01:00
Franco Fichtner
c770e7c953 firmware: make firmware scripts pluggable
For testing convenience you can run the scripts separately and
add standard output and only standard error will be reported
once included in system_firmware_configure() or

    # pluginctl firmware_reload
2023-12-19 10:38:36 +01:00
Franco Fichtner
60b262bcaf pkg: fix plist 2023-12-14 21:24:45 +01:00
Ad Schellevis
29377cecc4 Services: Unbound DNS - add manual restore function for easier db repair. (ref https://github.com/opnsense/core/issues/7049) 2023-12-12 11:18:45 +01:00
Franco Fichtner
5e785afe06 system: move helper script out of the way; closes #7063 2023-12-12 08:49:32 +01:00
Ad Schellevis
8c4b1636f8 fix plist 2023-12-11 18:12:07 +01:00
Ad Schellevis
b5d0ab2d91 plist-fix 2023-11-29 17:36:05 +01:00
Stephan de Wit
5da37a7fac
interfaces: revamp overview page (#7019)
This commit omits some of the link-specific information such as ppp uptime, disconnect/release mechanism, as well as wireless and bridge information. Since there is more of this type of information available than was originally being handled by get_interfaces_info(), perhaps it makes more sense to extend the backend script with the relevant bits in time.
2023-11-27 15:52:04 +01:00
Ad Schellevis
42fd27df77 configd - support streaming output using the "stream_output" handler.
This commit adds the connection to the action.execute() method which offers the ability to flush data back to the client instantly without having to wait for the call to end. As the existing types are only slighly modified, the impact of this change should be rather low. To demonstrate the streaming capability, also adjust configctl to flush output when received.

Example usage:

[find]
command:find / ; xxx
parameters:
type:stream_output
message:test stream output
2023-11-22 18:15:13 +01:00
Ad Schellevis
6cd5d2e67b dhcp: offer KEA as DHCPv4 alternative - high-availabilty and control agent (https://github.com/opnsense/core/issues/6971)
Offer configuration access for the kea control agent needed for high availabilty and basic peer setup.

o add Control Agent menu item with basic settings
o split dhcpv4 settings in general and ha
o add peer configuration
2023-11-21 21:38:54 +01:00
Ad Schellevis
53b8f0f8f0 plist-fix 2023-11-12 19:15:28 +01:00
Franco Fichtner
7f7bce2e54 src: style sweep 2023-11-10 07:38:00 +01:00
Ad Schellevis
b7945798c1 mvc - split treeview template and javascript and hook via controllers. frr uses roughly the same, eventually it would be practical to reuse the source. 2023-11-09 22:13:37 +01:00
Ad Schellevis
ebc8e34b15 Gateways: Single: Migrate to MVC - rework datastorage layer.
This commit moves the default logic into the model so we can reflect current values into virtual fields.
For all relevant "dpinger" fields, we reflect the current value in a field named current_$field, which means we can always query the active value without touching the stored one. Determination of current is as easy as `!empty(model_value) ? model_value : default`.

Refactor the dpinger process to use the current_ fields, since "dpinger_status()" retrieves all instances including the ones not stored, safeguard the config properties to exclude status determination (as loss and latency fields don't exist).

Previously the validation messages seemed to miss some gettext(), re-add these as well and cleanup validation. By calling isFieldChanged() on the array type, we know the gateway object has changed, but not exactly which field, this might lead to some noise, but if we implement a fix for https://github.com/opnsense/core/issues/6978 , we should be able to avoid real issues with the bonus of needing less code.

The calculateCurrent() on the GatewayField ensures we can insert/update the current values after an update as these are nog aware of modifications automatically.

Finally, respect the 120 character screen limit.
2023-11-04 17:47:58 +01:00
Stephan de Wit
f213bf2833
Gateways: Single: Migrate to MVC - part 2 (#6808)
Where the first stage primarily aims to keep the legacy handling of gateways intact, this stage does the conversion to MVC.

As part of the migration strategy, configured gateways will not be touched if the migration fails. This allows users to repair the gateways in the new situation.
2023-11-02 09:32:27 +01:00
Ad Schellevis
f90f16fc09 Kea / Dhcp - DHCPv4 replacement, initial minimal for https://github.com/opnsense/core/issues/6971
This commit contains the basic features of our new DHCPv4 server, it certainly needs additional testing as currently we only validated the configuration format is valid. The aim is to keep the json templates as simple as possible.

For now we keep the kea-control-agent disabled, we probably need it later, but we don't want to expose a listener without using it.
2023-11-01 21:24:34 +01:00
Ad Schellevis
1bec000c1e Interfaces/neighbor - implement new neighbor configuration for arp/ndp entries closes https://github.com/opnsense/core/issues/6917
This commit adds a new component linked in Interfaces/Neighbors which offers the ability to manually register static leases and provides application control from other modules such as dhcpd. To minimize the risk, we're reusing the existing interfaces_staticarp_configure() hooks while only adjusting how static arp entries are being attached to the interface (match on addresses assigned when triggering with an interface).

Entries registered via dhcp will be visible from the ui as well together with its origin.
The previous version didn't cleanup old static entries, this version triggers a cleanup when executed for all interfaces using all earlier modifications processed via the same function (interfaces_neighbors_configure()).
2023-10-12 16:23:57 +02:00
Franco Fichtner
061c43b4aa src: style sweep and plist fix 2023-10-11 20:55:14 +02:00
Ad Schellevis
1c890b8cce Gateways: Single: Migrate to MVC - Import first part of https://github.com/opnsense/core/pull/6808
This commit imports part of the changes from @swhite2 which will keep the legacy handling intact for the first stage of the migration. It should be backwards compatible with the previous (23.7.x) code.

Changes new in this commit which where not in the original PR:

1) dpinger_status() missed $gwitem which rendered gateways statusses down
2) Model version number set to 0.0.1 so we can use the migration later to step into 1.0.0
3) Gateways->gatewayIterator() do not yield MVC records ensuring we are still using legacy config data when being called.
2023-10-03 15:06:22 +02:00
Franco Fichtner
871182c4f2 wireguard: merge net/wireguard as of version 2.2 #6827
Omit the dependency on wireguard-kmod as we will be targeting the kernel
module with 24.1.  Some people may run into this but it's safer than
trying to rely on a package that won't be available going from 23.7 to
24.1.
2023-09-29 08:32:12 +02:00
Franco Fichtner
ca2609efbd mvc: add "make validate" target and script 2023-09-27 16:29:35 +02:00
Ad Schellevis
f75ec9688a System: Configuration: History - refactor using MVC components.
When \Deciso\OPNcentral\Central exists, there might be multiple providers to select from, so we can easily reuse the same component in both versions.

closes https://github.com/opnsense/core/issues/6828
2023-09-26 16:12:49 +02:00
Franco Fichtner
896ade7698 src: sweep 2023-09-22 10:21:42 +02:00
Franco Fichtner
1aa5848847
unbound: migrate active/outgoing interfaces discarding invalid values (#6851) 2023-09-14 17:45:22 +02:00
Franco Fichtner
6fbe6ca189 src: sweep over bootstrap update
Windows line endings...
2023-09-07 16:58:16 +02:00
Ad Schellevis
1af1a491f0 plist 2023-09-04 20:51:06 +02:00
Franco Fichtner
0ab708fb72 interfaces: avoid duplicating $vfaces array
The idea of list_interfaces.php was good so let's take it further
and inline the use into legacy_interfaces_details() and moving the
patterns to a shared function.  Also add a device name hint in case
the array key is not passed for some reason which can help when
inspecting debug data.  Since legacy_interfaces_details() is already
available in pluginctl -D replace the action command and drop the
obsolete script.
2023-09-01 09:45:31 +02:00
Franco Fichtner
48fedbd1f0 pkg: fix plist 2023-08-28 08:37:59 +02:00
Franco Fichtner
ad76fb312b firmware: revoke 23.1 fingerprint 2023-08-01 14:53:57 +02:00
Franco Fichtner
dad8bd7543 system: add opnsense-crypt utility #6133 2023-07-24 09:38:13 +02:00
Ad Schellevis
57077b83f5 Interfaces: LAGG: migrate to MVC closes https://github.com/opnsense/core/issues/6384
Migrate ui to MVC, wrap model around existing configuration area to remain backward compatibility.
To avoid laggs configured via console not being reachable from the gui, add a uuid to it.
2023-07-19 11:27:21 +02:00
Franco Fichtner
74b8f028f5 pkg: fix plist 2023-07-18 09:43:44 +02:00
Franco Fichtner
497e46956a pkg: fix plist 2023-07-18 07:38:28 +02:00
Stephan de Wit
4ea46ea21c
MVC: allow new services to hook into ApiMutableServiceController (#6663)
To allow legacy services without a model to hook into the `ApiMutableServiceController`, we define a protected `serviceEnabled` function that by default checks the given `internalServiceEnabled` property to see if a service is enabled, but allows derived classes to override the functionality. We loosen the property restrictions in `initialize()` by moving the checks to their runtime implementations.

DHCPv4/v6 is modified here to hook into this change, but since the `actions_services` requires the keyword `service`, which isn't used by the mutable service controller, we define start/stop/restart/status actions in the `actions_dhcpd.conf` and the new `actions_dhcpd6.conf` files.
2023-07-12 14:21:28 +02:00
Stephan de Wit
dba5d12324 dhcp4: adjust directory structure as with dhcpv6 2023-07-12 10:51:21 +02:00
Stephan de Wit
67c9c597e4 fix plist 2023-07-12 09:41:21 +02:00