822 Commits

Author SHA1 Message Date
Ad Schellevis
9c50cbfcb8
Services: Kea DHCP: Kea DHCPv6 - add new option based on v4 (#8571)
This contains roughly the same configuration items as our current isc-dhcp6 alternative, with the exception of not trying to implement dynamic ranges based on data received from dhclient6.
In terms of target audience, dynamic environments (receiving their "wan" type addressess via dhcp), should logically use dnsmasq for client configuration. Large (enterprise) setups usually are static by nature and may require prefix deligation to routers behind the primary one. In these cases Kea will be the tool of choice.

Both v4 and v6 share the same rc scripts underneath, which means reconfiguration happens per package (eventhough two services are registered).
Existing hooks for v4 have been extended with v6 data (firewall rules and staticmaps).

Advanced configurations can still opt out of config file generation and supply their own json config, same as implemented for v4.

The lease view still needs to be implemented, but that's likely a minor addition.
2025-04-22 17:43:27 +02:00
Ad Schellevis
983a0663b0
Interfaces: Devices: Bridge - refactor to MVC closes https://github.com/opnsense/core/issues/8353 (#8534)
* Interfaces: Devices: Bridge - refactor to MVC for https://github.com/opnsense/core/issues/8353

* move existing properties to model which overlays existing config path
* add a simple wrapper script for [re]configuration which diffs and applies using the new _interfaces_bridge_configure() implementation

* Update src/opnsense/mvc/app/models/OPNsense/Interfaces/Bridge.xml

Co-authored-by: Franco Fichtner <franco@opnsense.org>

---------

Co-authored-by: Franco Fichtner <franco@opnsense.org>
2025-04-09 13:09:09 +02:00
Ad Schellevis
368598eafc plist 2025-04-03 15:12:35 +02:00
Monviech
732a393fb7
dnsmasq: Unify dhcp-option and dhcp-match in the same grid (#8516)
* dnsmasq: Unify dhcp-option and dhcp-match in the same grid

Both dhcp-option and dhcp-match use almost the same fields in the form and concern the same options.
Unifying them could make sense to remove some duplicate code and potentially improving the UX.

* make plist and remove console log debug statement
2025-04-03 08:10:48 +02:00
Franco Fichtner
3a9e9edefe pkg: fix plist 2025-03-28 12:20:04 +01:00
Franco Fichtner
b163c68bf9 backend: restore missing Python module
PR: https://forum.opnsense.org/index.php?topic=46556.0
2025-03-26 15:40:41 +01:00
Franco Fichtner
9fe8d18942 contrib: remove unused
Last seen in legacy RSS widget long gone, noticed by @AdSchellevis
2025-03-25 15:13:52 +01:00
Ad Schellevis
1afede2677 Reporting / Insight - minor code cleanups, remove final user of old parameter parser (params.py) as well. 2025-03-23 20:05:10 +01:00
Franco Fichtner
ec634601fe radvd: move plugin code to its own space #8351 2025-03-20 10:10:18 +01:00
Monviech
af5e9fcbf8
Firewall: Automation filter ui revamp (#8377)
This commit adds backwards compatible changes to the automation api and associated user interface. Although this is likely not the final state, it adds quite some improvements in making this a valid replacement for the current firewall user interface.
2025-03-18 19:47:24 +01:00
Franco Fichtner
d77bd0a8fb system: remove GDrive backup from core
Still needs migration glue, but mechanics are done.

PR: https://github.com/opnsense/core/issues/8343
2025-03-12 08:11:25 +01:00
Stephan de Wit
3bf818348c
shaper: move pipe & queue configuration to dnctl service (#8404)
if no shaper (ipfw) rules are present, or these rules are disabled, ipfw will be disabled as well (firewall_enable="NO" and rc.ipfw onestop).

Traffic shaped via pf will not show up in the stats output of dnctl pipe|queue|sched show. Also, there is currently no logic to associate pipes/queues with pf rules.
2025-03-06 10:32:13 +01:00
Ad Schellevis
d343bdf8ce Services: Dnsmasq DNS & DHCP - allow ipv6 dhcp leases as described in https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html for https://github.com/opnsense/core/issues/8329 2025-03-04 20:16:00 +01:00
Ad Schellevis
c93e0ac745 mvc: merge NetworkValidator into NetworkField to ease extensibility and add unit test
also needed for https://github.com/opnsense/core/issues/8329
2025-03-04 16:16:21 +01:00
Franco Fichtner
bf4c93f6b0 system: remove xmlparse.inc now since it's mostly unused
Keep the dreaded listtags() around, but it's already pretty
sparsely used.  A brave new world.
2025-03-04 11:40:12 +01:00
Ad Schellevis
592a62b0df
wizard: reimplement system setup (#8378)
* wizard: reimplement system setup, for https://github.com/opnsense/core/issues/8352

This commit implements our replacement for the setup wizard. The questions are roughly the same as in the legacy version.
Some less relevant options have been removed (pppoe ondemand for example) and isc-dhcpd has been replaced with dnsmasq.

Only standard tools have been used, a memory model to validate the data and simple input forms in tabs.

The in memory model acts as a wrapper around a legacy configuration data and a couple of component models to apply the requested settings.

Some legacy settings using isset() have been altered to use their empty() equivalent.

* wizard: as we're changing to dnsmasq as default, we need to make sure the console setup configures the same (https://github.com/opnsense/core/issues/8352)

Fix some small php arnings in the process, but further than that just rewrite the dhcpd console handling to use dnsmasq instead of isc.
Eventually we will need to rewrite the console tools as well, but let's try to keep this compatible with minimal impact.

* wizard: change other occurrences of isset($config['dnsallowoverride']) for https://github.com/opnsense/core/issues/8352

* wizard: sort listtags() and some other minor review comments for https://github.com/opnsense/core/issues/8352
2025-03-03 15:26:16 +01:00
Stephan de Wit
d08addc25c
Captive Portal: migrate to pf (#8368)
* Captive Portal: WIP for migration to pf (https://github.com/opnsense/core/issues/8326)

Captive Portal: cleanup references to ipfw

Captive Portal: move accounting deletion to get action, update references and descriptions

Captive Portal: remove note

Captive Portal: move accounting to pf match rules

Captive Portal: cleanup and shorten code

Captive Portal: parser issue after refactor

Captive Portal: update logo in default login page

* Captive Portal: internal alias should not be editable

* Captive Portal: move to periodic accounting sync

* Captive Portal: update lighttpd zone config

* Captive Portal: ether rules for accounting

* Captive Portal: safe accounting fetch

* Captive Portal: move counter calculation to bgprocess

* Captive Portal: remove nested anchors, match anchors on interfaces as well

* Captive Portal: move service logic to captiveportal.inc

* Captive Portal: leftover test statement

* Captive Portal: properly initialize accounting result

* Captive Portal: cleanup sql

* Captive Portal: Implement backend requirements for RFC 8908

While here, the zoneid is provided to the client, even though there
there is no need to do so. Instead let lighttpd forward the
request with an added header containing the zoneid of the client

* Captive Portal: review feedback

* Captive Portal: from_not case
2025-03-03 10:48:57 +01:00
Ad Schellevis
a893cdc7a5
VPN: IPsec: Mobile Clients - move charon attributes to "Advanced settings" for https://github.com/opnsense/core/issues/8349 (#8380)
Rename previous "advanced settings" to "mobile & advanced settings" to guide people into the right direction, strongswan.conf contains both sets of data.
Keep legacy page for settings that are only relevant for the old components.

Since our pam authenticator hooks into the configuration, refactor to use the model as well.

Cleanup code in the model that was only used in the legacy glue.
2025-02-28 13:53:25 +01:00
Franco Fichtner
b94578935f dnsmasq: migrate to rc.d scripting 2025-02-25 00:11:04 +01:00
Ad Schellevis
bcf8f9ae75
dnsmasq: Backend migration and add dhcp support for https://github.com/opnsense/core/issues/8329 (#8355)
This rather large commit implements most relevant dhcp options and rewrites dnsmasq's backend.

By default dnsmasq is disabled, eventually we do want dnsmasq enabled for dhcp services by default, but dns itself disabled. For this reason we support port "0" as implemented at dnsmasq (not listening for dns).

For cases where users want to integrate dns and dhcp services, the advise is to make dnsmasq listen on a non standard port and point unbound to the zones where dnsmasq is responsible for. This has the advantage of a direct connection between dhcp registered hosts and the requesting service. In these cases dnsmasq's dns service acts like a "connector".

In the long run we should deprecate `regdhcpstatic` and `regdhcp` as these either belong to legacy isc-dhcp or hook kea entries (which are better served via unbound).

The first mvc migration phase implemented IndexController.php, which we rename to SettingsController.php now as these results in more logical ui endpoints.

Since we don't bind to addresses directly (unless specifically configured and adviced only for static setups), we can skip the newwanip event which means we don't restart the service on interface changes. dnsmasq is able to filter the relevant networks on the fly, which is the advised scenario and can cope more easily with changes.

When different clients need to receive different options, we can use "tags" now. Requests can add tags to filter options which will be offered to the client, in the most simple scenario one would tag on a range or a host reservation, but more advanced choices can also be achieved using match statements (for example architecture [client-arch])
2025-02-19 17:40:55 +01:00
Ad Schellevis
fdded458e0 Firewall: Aliases - offer better pluggability for dynamic alias types and move current json static_aliases and interface networks into their own classes.
When services offer aliases which are less static, the current json option isn't very practical as we only want the package manager to ship files into these directories.
The new DynamicAliases namespace may contain simple php classes, which return a named set of aliases to merge into the set.

Since all of these classes are created on each alias query, it's highly advisable to keep their implementations as lightweight as possible.
2025-02-19 16:14:03 +01:00
Franco Fichtner
d7adee30a1 dnsmasq: call normalizeValue() during interface migration 2025-02-18 14:51:34 +01:00
Franco Fichtner
af235daa43 system: change the "monitor" syshook and de-deprecate; closese #8199
We move the gateway recovery into the hook as a user and users
can do their on similar scripts to fetch current status and
inspect and react accordingly.  We do so before filter reload
to avoid excessive reloads in the facility script(s).

What this loses is the ability to get the previous argments
for statistics, but OTOH it also reduces the risk for spurious
events as we only trigger on state transitions.
2025-02-14 11:10:42 +01:00
Franco Fichtner
11b7ca4d01 system: add an "import" syshook; closes #8325
Allow import hooks to be overwritten or manipulated.
No functional changes but it allows to bootstrap a
/conf/config.xml before opnsense-importer (making it
skip import) or modifying the imported /conf/config.xml
afterwards.
2025-02-14 10:46:20 +01:00
Stephan de Wit
08718088ba system: update Chart.js to 4.4.7 2025-02-14 10:27:41 +01:00
Franco Fichtner
f1f87d134b openvpn: remove the old wizard
As discussed the wizard will be removed and the legacy component
it is feeding moved to a plugin for 25.7 so it makes no sense to
drag this along any further.
2025-02-12 12:18:05 +01:00
Monviech
24a61420cf
mvc/view: Create layout_partials/base_apply_button to centralize design of the standard Apply button (#8297)
* mvc/view: Create layout_partials/base_apply_button to centralize design of the standard Apply button

* dhcp/kea: Example implementation of layout_partials/base_apply_button

* mvc/view: Change edit_alert_id to global static default, add data-grid-reload and dynamic ids to base_apply_button partial
2025-02-10 16:57:52 +01:00
Ad Schellevis
44eaf077b8 dnsmasq: migrate to MVC/API, dnsmasq supports custom includes as well, let's make sure to signal the user when they exist. for https://github.com/opnsense/core/issues/7905 2025-02-08 10:42:55 +01:00
Ad Schellevis
e93833258b
dnsmasq: migrate to MVC/API - phase 1 : frontend migration (#8260)
* dnsmasq: migrate to MVC/API, initial boilerplate for https://github.com/opnsense/core/issues/7905

* dnsmasq: migrate to MVC/API, work in progress for https://github.com/opnsense/core/issues/7905

* add general tab fields
* initial hosts tab with inline migration

* dnsmasq: migrate to MVC/API, replace current frontend for https://github.com/opnsense/core/issues/7905

More or less feature complete refactory of the current frontend, which should be a drop-in replacement for the legacy frontend.
The default migration will force an inline migration for aliases and domain ip addresses (which in legacy is a combined field).

* dnsmasq: migrate to MVC/API, missing isset() -> !empty() for  https://github.com/opnsense/core/issues/7905
2025-02-03 11:07:02 +01:00
Stephan de Wit
98464bab9a
System: Health: refactor to Chart.js (#8258) 2025-01-30 14:02:41 +01:00
Franco Fichtner
a08b79edbc firmware: switch to 25.7 development mode 2025-01-29 07:41:40 +01:00
Stephan de Wit
f37256980e system: fix plist 2025-01-23 14:57:27 +01:00
Ad Schellevis
18fc1f0797 Services: Monit - flag overwrites when they exist (https://docs.opnsense.org/manual/monit.html#advanced-configurations) 2025-01-23 14:43:26 +01:00
Ad Schellevis
e43bca743b Services: Unbound DNS - flag overwrites when they exists (https://docs.opnsense.org/manual/unbound.html#advanced-configurations) 2025-01-23 13:38:52 +01:00
Stephan de Wit
43e6bdb205 system: upgrade ChartJS to v4
A couple of notes:

- the streaming plugin is not officially supported with ChartJS v4. Instead, a fork
has been used (https://socket.dev/npm/package/@robloche/chartjs-plugin-streaming/overview/3.1.0).
This fork required a oneline-fix which has as of yet not been applied to the
minified or regular .js file, only to the .esm.js file
(see https://socket.dev/npm/package/@robloche/chartjs-plugin-streaming/diff/3.1.0).
- Only the .umd.js version of ChartJSv4 seems to work out of the box.
- The colorschemes plugin is also a fork (https://github.com/MaximBelov/chartjs-plugin-colorschemes)
- adapter-moment works out of the box.
- This commit has not been thoroughly tested across all usages of ChartJS in the UI.
- The responsive resizing nature of canvas elements using ChartJS don't seem to work
anymore when expanding a widget.
2025-01-22 14:40:43 +01:00
Ad Schellevis
5d596601d4 VPN: IPsec - add banner message when using custom configuration files. closes https://github.com/opnsense/core/issues/8093 2025-01-22 12:00:51 +01:00
Stephan de Wit
fd39bafe72 system: adjust for overrides banner
Introduces the isBanner property, which explicitly defines the message
as a banner, which doesn't necessarily have a relation to
the persistent property. While here, update the UI to remove
cursor events when the message doesn't have a location set.
2025-01-16 15:11:23 +01:00
Franco Fichtner
7235dd5e43 pkg: fix plist 2025-01-14 16:35:01 +01:00
Sebastian Pucilowski
e8f6a825b7 src: fix IKEAdressField -> IKEAddressField typo 2025-01-13 13:53:25 +01:00
Stephan de Wit
9e660d360b system: add disk space status check
above 95% usage triggers a persistent banner.

while here, fix a small issue that excluded persistent notification
types from counting towards the icon color used.
2025-01-13 10:38:21 +01:00
Franco Fichtner
27517b950f src: sweep 2025-01-07 17:27:14 +01:00
Ad Schellevis
071925da51 System: Settings: Tunables - refactor to MVC, closes https://github.com/opnsense/core/issues/7249 2025-01-04 12:42:10 +01:00
Ad Schellevis
af2730dd36 System: Settings: Tunables - refactor to MVC for https://github.com/opnsense/core/issues/7249 (work in progress) 2025-01-01 20:14:07 +01:00
Ad Schellevis
23e20aab3c Firewall: Automation: Filter - add TOS/DSCP for https://github.com/opnsense/core/issues/8143 2025-01-01 14:48:11 +01:00
Ad Schellevis
c49af7824a Firewall: Automation: Filter - add schedules for https://github.com/opnsense/core/issues/8143 2025-01-01 14:38:33 +01:00
Ad Schellevis
96a1145c3e System: Access: Users - add "system list shells" and hook to shell field, closes https://github.com/opnsense/core/issues/8155 2024-12-22 14:37:42 +01:00
Franco Fichtner
44f5964921 src: style sweep 2024-12-19 12:13:40 +01:00
Ad Schellevis
6a7352e528 authentication - remove expireaccounts script which has been disfunctional for some time, accounting for expirey is the responsibility of the authenticator.
ref: 252fd04811/src/opnsense/mvc/app/library/OPNsense/Auth/Local.php (L161-L162)
2024-12-19 10:09:26 +01:00
Franco Fichtner
3681807e24 plist: fix 2024-12-17 13:00:08 +01:00
Ad Schellevis
e7e91fca52 plist 2024-12-16 20:58:35 +01:00