14577 Commits

Author SHA1 Message Date
Ad Schellevis
972a7d60bf Reporting / Health - refactor rrd data retrieval and simplify usage
Most of this code is quite old and originates from the beginning of our project. At the time it seemed to be problematic to render the full rrd stats in a d3 graph, which required the "resolution" option for faster page loading. It looks like we can safely remove this toggle and ditch quite some code in the process. There's still room for improvements in the html/javascript part, but that's probably for another day.

This commit also simplifies the api usage as unused parameters are being removed from the callers (from, to, ..)
2023-10-06 19:09:16 +02:00
Cedrik Pischem
e5e8d003bd
Update ipsec.widget.php - Count user in "Overview" Tab and improve "Mobile Users" Tab (#6912)
* Update ipsec.widget.php

This change solves the problem of users having multiple IP addresses as leases and being counted per leased IP.
- Only "user" are counted now
- Each "user" can have several "lease"
- Each "lease" can have an individual online or offline status
- A user is online when at least one "lease" is "online = true"

* Update ipsec.widget.php

- Replaced multiple "array()" with "[]"
- Access keys "user", "address" and "online" directly from the $lease array without storping them first
- Merged two seperate foreach loops into one
2023-10-05 11:05:45 +02:00
Ad Schellevis
2bac4f10a5 Services: Intrusion Detection: Administration - Improve locking during sqlite db creation a bit.
If we remove the file, others will keep bashing the inode. Truncating should prevent that from happening.
2023-10-05 10:14:01 +02:00
Ad Schellevis
70df688a9b VPN: WireGuard - hook wireguard empty devices during bootup, using wireguard_devices() plugin system. This should make sure services and components, such as the firewall, are able to use the device before being setup. closes https://github.com/opnsense/core/issues/6909
A minor modification was needed in wg-service-control.php to make sure a configure would be executed if wgX exists without configuration
2023-10-04 18:13:15 +02:00
Ad Schellevis
a114d6df96 Gateways: Single: Migrate to MVC - Import first part of https://github.com/opnsense/core/pull/6808
o fix merge issue, as system_gateways_edit.php is not used in the new version, we do need to make sure it's hooked to the new code in master first. At a first glance dpinger_defaults() is the only missing part now.
2023-10-04 11:30:07 +02:00
Stephan de Wit
8a532bebba Gateways: exclusions is a no-op 2023-10-04 09:13:45 +02:00
Franco Fichtner
316f1c16b4 openvpn: deprecate servers/clients for 24.1 2023-10-04 07:36:07 +02:00
Franco Fichtner
78815fc096 openvpn: message style in new validation 2023-10-04 07:35:51 +02:00
Franco Fichtner
0942687097 system: fix monitor services disappearing after 1c890b8cce666 2023-10-04 07:26:02 +02:00
Franco Fichtner
1fe5395d6a system: refactor dpinger_status() 2023-10-03 21:46:51 +02:00
Ad Schellevis
9117277c60 VPN: OpenVPN: Instances - change verify-client-cert to a server only setting and fix validation. When no client certificate is provided and a CA is missing, make sure to raise an issue as well as this will not generate a usable configuration. Move "ca" inclusion as well so we also add it when no cert is provided.
might fix https://github.com/opnsense/core/issues/6886
2023-10-03 18:29:44 +02:00
Franco Fichtner
c7320df459 system: fix former mishap, better to copy required values for later 2023-10-03 16:29:26 +02:00
Franco Fichtner
d1fb944170 system: style sweep 2023-10-03 16:15:39 +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
9c15cf7157 mvc: style sweep 2023-10-03 09:07:09 +02:00
Ad Schellevis
33e497f808 Firewall: Aliases - fix help button in dialog for categories, closes https://github.com/opnsense/core/issues/6906 2023-10-03 08:50:50 +02:00
Ad Schellevis
997b4d6e00 VPN: OpenVPN: Instances - add role to proto for tcp sessions as required for tap type tunnels. While here, also validate if server[_ipv6] is provided for tun type tunnels. closes https://github.com/opnsense/core/issues/6904 2023-10-02 21:06:31 +02:00
Ad Schellevis
163a0796f7 MVC/Model/ArrayField - propagate isFieldChanged() from connected children, as this would ease validations when multiple fields in the record influence each other and we want to know if any of them changed. 2023-10-02 18:32:29 +02:00
Stephan de Wit
7249d0a57a ui: trigger change message on toggle and delete
also prevent excessive queueing of animations by preventing the slide
from triggering if it's already animated
2023-10-02 15:39:37 +02:00
Stephan de Wit
15757711a6
unbound: add support for wildcard domain lists (#6905)
Closes https://github.com/opnsense/core/issues/6888
2023-10-02 14:52:25 +02:00
Ad Schellevis
be0b18930f Firewall: Rules: Floating - add "Interface / Invert" to the list, which will invert the "on" clause of the rule. To prevent future tickets when selecting multiple interfaces and invert, we'll add a validation to only allow single inverts.
When multiple interfaces are selected, these will render into separate rules in which case it might not be clear what the outcome would be, specifically when choosing something else than "pass" (pass lan,wan would lead to two rules which match either lan or wan, block lan, wan would lead to random behavior for example).

For https://github.com/opnsense/core/issues/6902
2023-10-02 14:36:28 +02:00
Ad Schellevis
a10cf1c402 fix copyright in VxLan.php 2023-10-02 13:35:11 +02:00
Monviech
ef9c2b4df7
Update VxLan.php - Add input validations to model (#6899)
* Update VxLan.php - Add multiple input validations to model

* Update VxLan.php - add isFieldChanged and gettext function
2023-10-02 13:14:20 +02:00
Franco Fichtner
21bd623835 mvc: model <mask/> to <Mask/> for consistency 2023-09-30 19:44:59 +02:00
Franco Fichtner
3eeb1193ab wireguard: copyright header consolidation 2023-09-30 14:04:04 +02:00
Franco Fichtner
947543c7c6 interfaces: why is this called "alias" IP? 2023-09-30 13:40:00 +02:00
Csaba Kos
1f3311f5dd interfaces: allow multiple IP addresses in dhcp reject from; closes #6683 2023-09-30 13:34:28 +02:00
Franco Fichtner
af34db7077 wireguard: tweak 3 more labels #6827 2023-09-29 09:39:03 +02:00
Franco Fichtner
11f65055b3 wireguard: adjust the naming as per #6827
Before: server, client, local, endpoint, peer, interface, instance and
tunnel adapter were being used some times meaning the right thing but
often also displaced.

Now we try to stick to instance (a wireguard interface in its config),
device (pertaining to the actual network device in the system), peer
(a wireguard peer in its config) and endpoint (the actual "endpoint"
setting in a wireguard peer config).

But we can only rename the user facing GUI parts.  The API and config
structure will not change.

While here also update the model and tweak a few form labels and help
texts.
2023-09-29 09:26:39 +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
Ad Schellevis
a91bc81aaf DHCPv6 Leases - fix "ends never" parsing for https://github.com/opnsense/core/issues/6891 2023-09-28 22:30:29 +02:00
Franco Fichtner
40955ddaee dhcp: looks like a refactor gone wrong #6853 2023-09-28 17:42:24 +02:00
Franco Fichtner
77caf21778 openvpn: nitpicking on wording 2023-09-28 17:05:49 +02:00
Franco Fichtner
b66e24c755 interfaces: purge unused parts of the dhclient-script #6869
Once upon a time we tried to treat this script as an external one
since it's still maintained somewhat in FreeBSD but the approach
of integration is much different so the script ends up with half
of its code not doing anything and perhaps more than it should.
Upstream fixes are also not full applicable anymore.

* Clear the writing of the host name.  The system does that.  Simply
  keep the logging aspect of it (if given).
* Remove the $ARP flush on TIMEOUT/EXPIRE as it seems misplaced.
* Remove exit_with_hooks() and is_default_interface() as these are
  tools that are not needed in our integration approach.
* While trailing TIMEOUT/EXPIRE failure case make sure to run
  newwanip in optional mode in order to pick up missing configuration.
* Copyright the changes from 2021 onwards that offer substantial
  changes to the way the script integration works or cooperates with
  the rest of the system.
* Inline the one-time use of functions.
* Remove tip-toeing around $resolvconf_enable.
* Ignore dhclient-enter-hooks.
* Remove commented-out code.
2023-09-28 16:49:30 +02:00
Ad Schellevis
2e90f1cb5b VPN: OpenVPN: Instances - missing selectpicker on vhid selector 2023-09-28 15:45:18 +02:00
Franco Fichtner
ca2609efbd mvc: add "make validate" target and script 2023-09-27 16:29:35 +02:00
Franco Fichtner
10e726113b mvc: introduce isVolatile() for BaseModel
Needed for running batch validation as memory models have
do data so their validation fails.
2023-09-27 16:29:35 +02:00
Stephan de Wit
7a2f3f62d9 interfaces: drop PPP default route handling
the relevant route is configured later in the chain using getDefaultGW(),
no need to instruct mpd5 to set it for us.
2023-09-27 15:59:17 +02:00
Franco Fichtner
42cfb664f7 ipsec: model update 2023-09-27 14:36:48 +02:00
Franco Fichtner
7e3c63a3ab firewall: do not reference automatic rule that is hardcoded 2023-09-27 14:01:49 +02:00
Franco Fichtner
881610cfe8 system: reverse diff to show newer as green, less table markup for diff 2023-09-27 13:50:24 +02:00
Franco Fichtner
8ac86cc577 src: style sweep 2023-09-26 17:19:23 +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
d9fcc0bbbf firewall: wrong link to VIP page 2023-09-26 08:41:16 +02:00
Ad Schellevis
dd40f71523 System: Configuration: History - move "backupcount" setting to "System: Configuration: Backups" for https://github.com/opnsense/core/issues/6828
Local backup configuration would be best stored in the backup configuration for consistency. Eventually we should refactor the backup configuration as well, but while refactoring the history page and adding a host selection (when used in conjunction with OPNcentral), this setting is a bit out of place.
2023-09-25 21:38:37 +02:00
Ad Schellevis
56e2940430 System: Access: Groups|Users - when adding the "user-config-readonly" privilege via "Select all", make sure to trigger the warning as well and note the name of the warning. In rare cases people select all and save finding out that nothing else is being stored anymore.
The future removal clause remains, although I don't expect it to go away any time soon as alternatives are hard to find.
2023-09-25 16:20:44 +02:00
Franco Fichtner
2bd3fb5d9f
interfaces: make link-local vips unique per interface #6775 (#6876) 2023-09-25 16:15:53 +02:00
Franco Fichtner
3a0b929386 system: fix stray char in help text 2023-09-25 16:09:16 +02:00
Franco Fichtner
bb6d69cc98 mvc: inline one time use of $parentKey 2023-09-25 14:58:58 +02:00
Franco Fichtner
f23f455bc4 firewall: improve previous by reusing a class constant #6880 2023-09-25 10:42:16 +02:00