Commit graph

19630 commits

Author SHA1 Message Date
Franco Fichtner
e6df79a16c mvc: Shell: rewrite exec_safe() to avoid vsprintf() complications #9703 2026-02-05 12:05:54 +01:00
Monviech
aa6a813617
Firewall: Rules [new]: Fix group rename in source_net, destination_net and SNAT/DNAT target fields (#9734)
* Firewall: Rules [new]: Fix group rename in source_net, destination_net and SNAT/DNAT target fields

* review comments @fichtner
2026-02-05 11:36:20 +01:00
Franco Fichtner
cbc09e7c5a firewall: well known ports added to filter rule selection; closes #9692 2026-02-05 09:12:17 +01:00
Franco Fichtner
700f590383 firewall: undefined is also "*" 2026-02-05 08:34:43 +01:00
Franco Fichtner
4912a671be interfaces: fix wlanmode usage part 2 #9727 2026-02-05 07:01:27 +01:00
Monviech
d4eb6235ae
Firewall: Rules [new]: Add tcpflags_any for parity with legacy rules (#9720) 2026-02-04 15:58:03 +01:00
Monviech
d43b14ef9b
Firewall: Rules [new]: Exclude loopback from interface selectpicker (#9723) 2026-02-04 14:13:25 +01:00
Monviech
6dce1de829
Firewall - Rules [new]: Add all rules option to interface selectpicker and make it default selection (#9713)
* Firewall - Rules [new]: Add all rules option to interface selectpicker and select it by default
* Interface select default only on null or no match, not on empty string
* To fix URL hash weirdness, it's best to special case __floating and __any in the frontend
* Lower diff in controller by folding null case into is_if
* firewall: tweak the interface selector

Show group name and description.  Could be inconvenient when
the description is long, but better for the auto-groups.
That also removes the hint at the end.  See note below.

Use fixed width logos for the interface groupings.

Remove muted from the any selection.

TODO/Remarks:

The groupings being shown as muted is a bit inconvenient also
as it muddies the perspective of what this does and how important
it is.  Would be nicer to not have it in this particular selector.

When an interface is selected it would be perfect if the grouping
icon would show so people see better what they selected.  Coloring
is nice so that would take it to the next level.

Badges with rule counts are not overly nice in front of the selection
and also don't update on rule delete.  While it's nice to have this
the question is if this is really needed.  A counter already exists
when clicking on them (Showing xxxx).

---------

Co-authored-by: Franco Fichtner <franco@opnsense.org>
2026-02-04 11:10:55 +01:00
Ad Schellevis
7a8f6bee11 mvc - ui: fix jquery glitch when using "options" instead of val(), closes https://github.com/opnsense/core/pull/9717 2026-02-04 10:01:07 +01:00
Ad Schellevis
cf0341f139 mvc - ui: move refresh of selectpicker types into setFormData() and improve type detection.
When we are using a selectpicker, the original one will be moved inside a div containing the "bootstrap-select" class.

If this fixes https://github.com/opnsense/core/pull/9717, we need to remove the console output as that is merely for debugging.
2026-02-04 08:51:16 +01:00
Ad Schellevis
40cb82128d mvc: BaseModel - improve legacy mapper support when parent item doesn't exist.
Fixes:

ErrorException: Undefined array key 0 in /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php:755
Stack trace:

If we can't find the specified root node, we should create one, which is similar to non legacy mapper nodes.
2026-02-03 16:28:06 +01:00
Monviech
5276f51dc0
dnsmasq: Compare lower case strings only in leases to fix edge cases in is_reserved detection (#9714) 2026-02-03 15:42:37 +01:00
Franco Fichtner
7ae42d9584 firmware: do not fail upgrade if new kernel is already booted
PR: https://forum.opnsense.org/index.php?topic=50654.0
2026-02-03 15:04:51 +01:00
Franco Fichtner
c3dd6d56f1 openssh: minor style tweak 2026-02-03 08:29:52 +01:00
Franco Fichtner
e771a800d5 ipsec: same same, switch class name not file name 2026-02-03 08:24:04 +01:00
Franco Fichtner
b95c81d08d interfaces: class name was wrong, fix UI page link 2026-02-03 08:18:31 +01:00
Franco Fichtner
e2d95ad672 firewall: double check the theory of 4c559a63d4
While here add the proper translation and safeguarding.
2026-02-03 07:59:05 +01:00
Franco Fichtner
45597a976c interfaces: fix wlan creation when $mode is empty
We don't currently have a way to specify if-empty-do-not-quote
since strict quoting is often much more effective in bubbling up
errors.  It could be useful to have it but the recent improvement
of mwexecf() and friends regarding array-based format strings can
account for this too.

PR: https://forum.opnsense.org/index.php?topic=50561.msg258926#msg258926
2026-02-02 21:17:15 +01:00
Ad Schellevis
39fcbddb05 mvc: ApiControllerBase->exportCsv(), mark content safe so escaping is disabled. closes https://github.com/opnsense/core/issues/9694 2026-02-02 21:11:36 +01:00
Monviech
ce432fa769
Firewall: Rules [new]: Remove schedule formatter from group and automatic rule rows (#9708) 2026-02-02 18:13:32 +01:00
Monviech
d260467553
Firewall: Rules [new]: Add link to states and put it first in list (#9707) 2026-02-02 17:16:40 +01:00
Monviech
0f6d82af34
Firewall: Rules [new]: Change toggle_log icon to help visibility of enabled/disabled status (#9704) 2026-02-02 16:14:33 +01:00
Monviech
9aaf675694
Firewall: Rules [new]: Statistics column is responsive now (#9679) 2026-02-02 11:14:39 +01:00
Stephan de Wit
7333fba07a bootgrid: cleanup previous 2026-02-02 11:02:01 +01:00
Stephan de Wit
3ce73ff043 bootgrid: searchable column selectors (fixes https://github.com/opnsense/core/issues/9698) 2026-02-02 11:00:14 +01:00
Stephan de Wit
b5cf3f7410 bootgrid: split toggle-selected into enable/disable-selected (https://github.com/opnsense/core/issues/9678) 2026-02-02 10:19:04 +01:00
Stephan de Wit
f7f0857ca9 bootgrid: introduce toggle-selected command (fixes https://github.com/opnsense/core/issues/9678)
This will only render if selection && multiSelect are true, and
stickySelect is disabled.
2026-02-02 09:23:02 +01:00
Franco Fichtner
4c559a63d4 firewall: ancient copy+paste error in scrub rules 2026-02-02 08:41:09 +01:00
Ad Schellevis
a5fed616a5 Firewall: Schedule - add missing schedules support in "Firewall: Rules [new]" and refactor existing usage to avoid duplication of logic. closes https://github.com/opnsense/core/issues/9690
This commit moves the schedule logic out of filter_core_rules_user() where it didn't belong in the first place.
Since we need legacy code to determine schedule behavior, we cannot move it to the plugin classes easily, instead sweep all registered rules after registration so we can process "sched" for all of them in the same way.

We can next add a simple action into the model to ask if there actually is a schedule, which pf_cron() needs to schedule the rule updates.

Finally add an icon and link into the mvc page to refer to the schedule itself.
2026-02-01 13:27:33 +01:00
Monviech
3bcdae70f7
radvd: When Base6Interface constructor is used, use its primary address for ifcfgipv6 (#9689) 2026-02-01 13:23:36 +01:00
Franco Fichtner
1727592311 firewall: style for previous 2026-02-01 12:15:04 +01:00
Ad Schellevis
c6540bf6fa Interfaces: Diagnostics: Ping - add optional interval (seconds), closes https://github.com/opnsense/core/issues/9695 2026-02-01 11:25:45 +01:00
Franco Fichtner
d31faf7f7c mvc: shield exec_safe() against "fatal" type errors
Allows the system to boot in the worst case and replaces the
command with a simple dummy command.

Formatters are still a work in progress as I'm not sure how
much preprocessing we should add here to fish for vsprintf()
doing type casts to int/float which is not something the command
line can/should support.
2026-02-01 11:11:29 +01:00
Franco Fichtner
70629923bb reporting: render as string instead for #9686
Revert ca06d54676.  A command line is a string and
don't offer exceptions to escaping.

We may consider replacing %[^s%] with %s in the format
string but there aren't many cases where it matters either.
Should just be part of the documentation we need to offer
soon.
2026-01-31 14:56:34 +01:00
Ad Schellevis
ca06d54676 backend: fix regression in 796a5c725b, when using %d or %f as formatters, we can't push them through escapeshellarg() as it will mangle the data unneeded. closes https://github.com/opnsense/core/issues/9686 2026-01-31 09:21:04 +01:00
Franco Fichtner
311184daa8 firewall: fix 2f60fcb062 removing anchor rendering
PR: https://forum.opnsense.org/index.php?topic=50520.0
2026-01-30 23:12:19 +01:00
Monviech
0f6cc03c69
Firewall: NAT: Destination NAT: The local-port field does not support range and well-known name (#9668)
* Make validation messages clearer
* Use selector in loop to determine where to replace the data (just the label is changed)
2026-01-30 14:53:54 +01:00
Franco Fichtner
c264c90504 interfaces: check dhcpdv6.enabled for -1 and add legacy config sections
PR: https://forum.opnsense.org/index.php?topic=50580.0
2026-01-30 12:43:48 +01:00
Monviech
ec20be4dd4
Firewall: Rules [new]: FilterBaseController requires Base\UserException (#9669) 2026-01-30 12:12:04 +01:00
Franco Fichtner
7a11458ea2 interfaces: fix migration for no-release option
This was introduced in d87ce014d9 storing the enabled value as "yes"
instead of true.  Threat it the same as the debug option.

PR: https://forum.opnsense.org/index.php?topic=50575.0 (and others)
2026-01-30 10:50:51 +01:00
Franco Fichtner
ffe3b40872 mvc: migration tweaks again for #9666 2026-01-30 10:07:29 +01:00
Franco Fichtner
5cc95f47a6 mvc: minor logging tweak for stdout 2026-01-30 10:00:13 +01:00
Franco Fichtner
be4900b112 pluginctl: use verbose migration mode #9666 2026-01-30 09:42:51 +01:00
Ad Schellevis
816fd574c9 mvc: support verbose logging in run_migrations.php, closes https://github.com/opnsense/core/issues/9666
This might be practical for some other system tools eventually too, since Syslog() is our own wrapper, we can echo output to stdout when requested. By making the callout static, each component can still have its own logger instance (and verbose log to stdout)

usage: /usr/local/opnsense/mvc/script/run_migrations.php -v
2026-01-30 09:28:25 +01:00
Franco Fichtner
9e70ee7508 mvc: use linter to find two wrong file names; closes #9638 2026-01-30 09:02:05 +01:00
Franco Fichtner
cff4c085d3 make: add a linter for PHP class name consistency #9638 2026-01-30 09:02:04 +01:00
Monviech
c827a02ef6
dhcp/kea: Use hostdiscovery service as ndp source in kea_prefix_watcher script (#9648)
* Use hostdiscovery service as ndp source in kea_prefix_watcher script via list_hosts.py, only request IPv6 addresses, fall back to ndp when hostdiscovery is not running
2026-01-30 08:36:16 +01:00
Monviech
5d571dcc89
Firewall: Rules [new]: normalize overload table between uuid and name (#9657)
* Firewall: Rules [new]: The mvc page stores the overload table as UUID, the legacy page as alias name. Turn UUID into alias name and vice versa during upload and download of rules, and then resolve it to a name before setting it in pf configuration.
* Firewall: Rules [new]: view, show translated value in the advanced field tooltip when possible, this will show the alias name instead of the UUID, fix upload bootgrid reload and hint the successful import with the change message
* Firewall: Rules [new]: There were error(s) loading the rules: /tmp/rules.debug:235: 'max-src-conn-rate' maximum rate must be < 4294967
2026-01-30 08:34:48 +01:00
Franco Fichtner
476ad93d6f firewall: fix typo with sprintf(); closes #9664 2026-01-29 21:19:39 +01:00
Ad Schellevis
1ddc63e402 Firewall: Aliases - set password input to autocomplete="new-password", closes https://github.com/opnsense/core/pull/9610
Similar as https://github.com/opnsense/core/pull/5311
2026-01-29 21:09:22 +01:00