17975 Commits

Author SHA1 Message Date
Ad Schellevis
8c63dad2f3 xmlrpc: stop pushing nextuid and nextgid as these don't exist anymore. 2025-03-04 09:45:05 +01:00
Ad Schellevis
03577ba3ca Services: Unbound DNS - fix model migration, between versions the "domain" container was moved to "dots", which means we can only move items into the new spot during migrations of old configurations. closes https://github.com/opnsense/core/issues/8395
This is certainly a downside of data migrations in general, when looking at the actual target, we don't have all the versions in between available. which means breakage is possible when skipping a lot of versions on our end.
2025-03-04 09:32:24 +01:00
Ad Schellevis
64c55b7afb dnsmasq: fix typo in previous for https://github.com/opnsense/core/issues/8329 2025-03-04 09:06:01 +01:00
Franco Fichtner
190131ed75 src: style sweep 2025-03-04 08:31:06 +01:00
Ad Schellevis
968e5f9d9a dnsmasq: Backend migration and add dhcp support for https://github.com/opnsense/core/issues/8329
missed a couple of spots, options specified but not implemented.
Also add dhcp-reply-delay for dhcp scope splits.
2025-03-03 21:25:48 +01:00
Franco Fichtner
16b23493f0 wizard: menu flipping 2025-03-03 16:50:05 +01:00
Franco Fichtner
4c8fc82a1d mvc: wizard style sweep 2025-03-03 16:46:25 +01:00
Ad Schellevis
eb2af7f2fd Services: Dnsmasq / add dhcp option 114 for captive portal (https://github.com/opnsense/core/issues/8329) 2025-03-03 16:11:35 +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
Franco Fichtner
d32ec31f79 mvc: reformat header 2025-03-03 12:20:27 +01:00
Franco Fichtner
ffc5d4ae65 src: style sweep for cp changes 2025-03-03 12:04:58 +01:00
Ad Schellevis
9a250a26f3 Services: Dnsmasq DNS & DHCP - misinterpreted mode tag, for flexibility reasons best implement 'static' within 'mode' selection so we have room to add the ipv6 ones ( https://github.com/opnsense/core/issues/8329)
For ipv4 there only appears to be a static mode type, ipv6 will extend the options. If we don't want to risk needing a checkbox for each of them, it's better to implement this as a mode dropdown.
2025-03-03 11:44:38 +01:00
Monviech
2c3482e774
interface/vip: Adjust help text for nosync option for https://github.com/opnsense/core/issues/8387, due to fix of behavior in 03f96eb008 (#8392) 2025-03-03 10:58:59 +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
03f96eb008 Interfaces: Virtual IPs / xmlrpc - skip nosync processing on vips, for https://github.com/opnsense/core/issues/8387 2025-03-02 17:05:33 +01:00
Gavin Chappell
1498728e47
feat: switch CLI MOTD to the new-style logo (#8382)
* feat: switch CLI MOTD to the new-style logo

* update bootloader logo

* better quality MOTD
2025-03-01 09:53:06 +01:00
Franco Fichtner
0b1b0cb932 src: sync 2025-02-28 15:27:13 +01:00
Ad Schellevis
a253e05da5 mvc: decode html tags in menu items to prevent ampersand (&) being rendered as & 2025-02-28 14:07:17 +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
Monviech
387c381300
mvc/view: Ensure fields stay aligned relatively to another when headers are used in forms (#8364)
* mvc/view: Ensure fields stay aligned relatively to another when headers are used in forms.

* mvc/view: Add style that forces consistency in smaller viewport sizes in base forms.

* mvc/view: Make classes more selective so the style does not leak when modal-dialog and form-inline exist in the same view (e.g. dnsmasq).

* mvc/view: Ensure the change in base_dialog is backwards compatible when msgzone_width is defined (e.g. in Intrusion Detection)
2025-02-28 13:45:51 +01:00
Ad Schellevis
81ec98007d Firewall: Aliases - performance improvement by using pf's overal table stats instead of dumping them.
This commit changes PF.list_tables() to yield both the name of the aliases as well as (limited) stats, in places where we only check for totals, these are faster to collect than counting them in python.

There should be no functional impact.
2025-02-27 17:46:10 +01:00
Ad Schellevis
8524771f52 dnsmasq: Backend migration and add dhcp support for https://github.com/opnsense/core/issues/8329
When dnsmasq is not used for dns services, no default dns is being send to the client for dhcp.
Add a non specific option, which can be overwritten using tags.
2025-02-27 13:08:03 +01:00
Ad Schellevis
98e7a16dce mvc: templates - implement <type>ignore</type> in forms.
In some cases it's practical to document the field so grids may use them, but skip them on input processing as the information is not that relevant to ask (or show using an info type)
2025-02-27 12:35:11 +01:00
Ad Schellevis
c91903fccd theme/fontawesome - include "all" instead of "solid" and "brands" 2025-02-27 11:11:17 +01:00
Franco Fichtner
a722c36552 plugins: style 2025-02-27 10:11:32 +01:00
Monviech
f64be4a3ca dhcrelay: Add missing status column, regression from a556e10d06 2025-02-27 09:29:46 +01:00
Franco Fichtner
3a68aac583 plugins: treat empty string like null on argument map
The backend will turn optional parameters into empty string
arguments which should mean all was selected and not one that
has a blank name.
2025-02-27 09:28:08 +01:00
Ad Schellevis
3e299b29b9 dnsmasq/unbound - mark 'template reload' action as cleanup.
Ideally these spots should not be needed as the frontend generates the configuration and on boot these are flushed as well, ... but, when interfaces change during boot or triggered by the wizard, these parts are not aware of these facts.

as discussed with @fichtner
2025-02-26 16:56:38 +01:00
Franco Fichtner
b50a9eec0f src: style sweep 2025-02-26 15:00:01 +01:00
Ad Schellevis
128536b778 mvc: move "lazy loading" option to base model implementation and force usage on run_migrations.php.
In rare cases it is possible to lock the system during boot while drivers are loaded and tunables try to fetch all information from sysctl.
Since we already implemented a lazy loading pattern on the Alias model, it seems to make sense to push this up the chain and reuse it.

For consistency reasons, we should also push the "lazy" attribute when constructing new ModelRelationField types.
2025-02-26 14:33:53 +01:00
Monviech
dd999d732c
vpn/openvpn: Implement base_bootgrid_table and base_apply_button (#8332)
* vpn/openvpn: Implement base_bootgrid_table and base_apply_button for https://github.com/opnsense/core/issues/8318

* vpn/openvpn: overflow-y in column dropdown due to amount of items in grid
2025-02-25 15:15:56 +01:00
Franco Fichtner
b94578935f dnsmasq: migrate to rc.d scripting 2025-02-25 00:11:04 +01:00
Ad Schellevis
d1b4277047 filter: add missing "persist" on bogonsv6, closes https://github.com/opnsense/core/issues/8376 2025-02-24 18:20:45 +01:00
Ad Schellevis
1a18ff50d7 Mvc/Security - safeguard checkToken() to prevent fetching an non existing POST item (which produces a warning in development mode). 2025-02-24 18:10:44 +01:00
Monviech
3caf9e182d
dnsmasq: Correct typo in label (#8362) 2025-02-20 11:51:26 +01:00
Monviech
169019649c
dns/unbound: Integrate layout_partials/base_apply_button (#8315) 2025-02-20 10:52:54 +01:00
Monviech
a0e3e0a28f
dnsmasq: implement base_apply_button (#8359) 2025-02-20 10:49:30 +01:00
Franco Fichtner
1581bcd87c dnsmasq: repair the dns_ports validation 2025-02-20 10:34:27 +01:00
Franco Fichtner
ef39fdde85 dnsmasq: more style 2025-02-20 10:34:12 +01:00
Franco Fichtner
333cd9c25e unbound: style reorder 2025-02-20 10:20:28 +01:00
Franco Fichtner
a3b78775d8 dnsmasq: uppercase 'Leases' menu, whitespace 2025-02-20 09:33:48 +01:00
Ad Schellevis
5ea401df84 Services: Dnsmasq DNS & DHCP - extend model with a dns_port property which reflects the current listening port (for dns) 2025-02-20 08:54:51 +01:00
Franco Fichtner
17b5859872 dnsmasq: add port hint 2025-02-20 07:49:18 +01:00
Franco Fichtner
655c74255a firewall: reformat, no change in file so dail back to previous year state 2025-02-20 07:47:20 +01:00
Ad Schellevis
48ec3b9850 ipsec/openvpn: add deprecation notices for legacy components, closes https://github.com/opnsense/core/issues/8350
Add a note on top of the legacy pages about the end of maintenance, depending on version, this will be version 26.1 ot 26.4 [BE].
In the meantime components will move to plugins. When maintenance ends, it will still be possible to install the component, but may break unexpectedly.
2025-02-19 20:04:57 +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
Franco Fichtner
c3994d14c6 mvc: style sweep 2025-02-19 17:12:46 +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
Monviech
2cc36105da
vpn/wireguard: Change tracking of wg peer status, improve widget and diagnostics (#8337)
* vpn/wireguard: Introduce latest-handshake-age to calculate if tunnel is online in backend. Implement it in wireguard.js widget and diagnostics.volt

* vpn/wireguard: expose peer-connected via API to approximate state of wireguard peers online/offline status, change status formatter to show statos of interfaces and peers, improve diagnostic grid

* vpn/wireguard: Move epoch calculation from frontend to controller

* vpn/wireguard: Track 3 different status instead of a boolean offline/online. Online means a handshake happened recently, Stale means a handshake happened in the past above a threshold of 300s, Offline means there was never a handshake yet. The same icons are implemented in the widget and the wireguard diagnostics page.

* vpn/wireguard: Remote peer disconnected translation since this is tracked by the icon now. Add stale translation.

* vpn/wireguard: Compact widget information for better readability
2025-02-19 08:58:54 +01:00
Franco Fichtner
82b36deee3 interfaces: exclude automatic radvd like we do for manual #8295 2025-02-19 07:27:40 +01:00