634 Commits

Author SHA1 Message Date
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
Stephan de Wit
58387deddb fix plist 2023-07-06 10:01:55 +02:00
Stephan de Wit
4b7a1ce85b
dhcp: migrate leases page to MVC (#6643)
- reworks the get_leases.py script to accomodate the "last declaration is the current one" logic from dhcpd.leases(5). (neither core nor plugins is currently using this action)
- includes binding states for failover setups in dhcpd.py lease file parsing. These are included in the leases page if show inactive is selected.
- adds small utility function in Firewall/Utility to check wheter a given IP (4 or 6) is within the bounds of a given CIDR block. Needed to bind a lease declaration to an interface in the front end.
- remove dhcpleaseinlocaltime property from services_dhcp.php. dhcpd.py works with epochs, so we only need to convert to a sensible local date in the controller.
- implements multiselect lease deletion
- implements multiselect interface filtering
- does not yet hook into ApiMutableServiceControllerBase, since the legacy configuration makes it a bit tricky.
2023-07-05 10:02:13 +02:00
Franco Fichtner
5f9b8c70fe unbound: cleanup old files 2023-06-29 09:20:28 +02:00
Ad Schellevis
db9abc9276
VPN: OpenVPN: Instances (MVC) (#6636)
* VPN: OpenVPN: Instances (MVC)

bugfixes and additions:

o fix lookup in tls_verify.php
o add auth attribute
o fix connection status reporting non existing clients

* VPN: OpenVPN: Instances (MVC)

bugfixes and additions:

o add missing syshook for startup at boot
o show instances in connection states when not connected
2023-06-27 13:55:39 +02:00
Franco Fichtner
962c388c58 src: style sweep 2023-05-31 16:29:30 +02:00
Franco Fichtner
9a1adab6c8 src: style sweep 2023-05-17 21:08:47 +02:00
Franco Fichtner
a2bc2705ea system: move gateway monitor trigger to separate script #6231
1. The process runs forever to retain proper state, periodically
   syncing the configuration data in order to react correctly.
2. Missing gateways are not an issue.  They will not alert or stick
   to their last verified value.
3. We stop reacting unless a default gatway switch action will follow
   or the gateway is part of a gateway group.  Triggers are not refined
   for now so we just let it run in full processing if a candidate.
4. Emulate the strange monitor alarm output although I don't see the
   use for all of this cryptic goo.  The alarm state (0, 1) was changed
   to reflect the observed transition causing the alarm script to run.
5. Move the action for the script alarm to the script itself.  Requires
   a bit of backend shuffling as well.
6. Only create one script to watch all monitors.  Easier to manage and
   to present as service (which can be stopped and started if needed).
2023-05-17 10:36:37 +02:00
Franco Fichtner
58528970e0 pkg: fix plist 2023-05-08 15:17:56 +02:00
Franco Fichtner
80af1c5ae9 firmware: move sets.sh into more portable query.sh and add tiers fetch #6374 2023-04-26 09:36:58 +02:00
Franco Fichtner
a6268ecc27 firmware: revoke 22.7 fingerprint 2023-04-21 07:36:27 +02:00
Franco Fichtner
9a0da8d50b pkg: fix plist 2023-04-21 07:25:14 +02:00
Franco Fichtner
680ca88259 pkg: fix plist 2023-04-19 09:40:20 +02:00
Stephan de Wit
e6f806e240
Unbound: ACLs: Migrate to MVC (#6474)
- The "internally generated" ACL entries have been removed in favor of a wildcard (well, a wildcard and localhost)
- Users can now change the default action used by the wildcard: either allow, deny or refuse.
- The legacy implementation wasn't very strict (you could add an entry without any input), this does at least require a name and at least one network. To facilitate the migration, if the 'name' property was empty, it will be set to 'Unnamed ACL'. Entries without defined networks will be discarded without notice.
2023-04-17 11:17:39 +02:00
Franco Fichtner
6fd0bc54e2 pkg: fix plist 2023-04-17 07:56:30 +02:00
Ad Schellevis
059b55b7a4 plist 2023-04-15 19:04:23 +02:00
Franco Fichtner
947ed4925a interfaces: ensure PPP netgraph node has the proper name #4696 2023-04-14 11:06:47 +02:00
Ad Schellevis
011f1eebe4 VPN: OpenVPN: Client Specific Overrides: Migrate to MVC closes https://github.com/opnsense/core/issues/6381
o add new mvc module
o migrate existing data
o add getOverwrite() in OpenVPN model to retrieve data structured as legacy data to make this an easy drop-in
2023-04-11 21:42:36 +02:00