17752 Commits

Author SHA1 Message Date
Franco Fichtner
c6e700fbae network time: take IPv6 addresses into account; closes #7934
Adhere to standard binding behaviour of other components:

Use the address read to get all addresses and binding ok instead
of using the arcane "interface name" bind option.  CARP VIPs are
ignored although allowed to be selected... something we should just
remove since interfaces_addresses() will load all aliases as well.

We also will not get tentative or otherwise unusable addresses.
Next stop for this code is probaby MVC conversion.
2025-01-09 08:48:23 +01:00
Franco Fichtner
e628c48968 interfaces: fix value lookup in LinkAddressField #8161
Do not use internalValue since it is only the default.
2025-01-09 08:13:19 +01:00
Franco Fichtner
d40a4dcc5a system: historic quirk 2025-01-09 08:13:19 +01:00
Franco Fichtner
031ca59591 make: clean up after tests so I don't have to
It has the downside of losing changes to config.xml but
we are far more likely to run the tests than to change
the file.  Ideally, the UUIDs should not shift.
2025-01-09 08:08:57 +01:00
Ad Schellevis
793d925e71 mvc:model - support lazy loading (skip_dynamic_info) on alias models and use it in NetworkAliasField to improve performance by ignoring fields we're not going to use anyway.
The configd call "filter diag table_size" is quite convenient when inspecting the aliases grid, but if we're only interested in the names and descriptions, it adds quite some overhead.
We can skip the collection of this information by constructing with $skip_dynamic_info set to "true" now, which increases performance quite a bit.
2025-01-08 21:30:26 +01:00
Ad Schellevis
d4d59f3010 Firewall: Automation: Filter - add (experimental) shaper support in rules
pf in FreeBSD 14.x supports dnpipe and dnqueue targets which hook dummynet, in theory we should be able to use these as well although our solution uses ipfw
for the shaper.

There might be some risks involved when using shapers in pf and configuring rules in ipfw, which is also why this feature is marked experimental.

Benefits of offering shaper targets in our standard firewall are increased flexibility (use of large aliases for example) and cleaner rulesets for example.

A quick test of a rule to shape iperf3 traffic does seem to work as expected.
2025-01-08 20:32:52 +01:00
Ad Schellevis
37808340a6 ui: bootgrid - minor style fix, remove fa-square-* before adding spinner 2025-01-08 19:41:52 +01:00
Franco Fichtner
f1a7b401ad mvc: fields should implement getCurrentValue() rather than __toString() 2025-01-08 17:44:40 +01:00
Franco Fichtner
a0bb178c65 system: fix previous while test driving it 2025-01-08 16:12:27 +01:00
Ben Smithurst
77ad6a0de8
reporting: add daemon -f parameter to close FDs during samplicate run (#8194)
While testing some changes I ran configctl service reload all and got a timeout error. After doing some digging I found that this relates to netflow data collection and doesn't happen if netflow collection is disabled.

After a bit of poking around it is due to the daemon/samplicate processes keeping a pipe open shared with the reload_all script, which then never termintes. Adding the daemon -f parameter fixes.
2025-01-08 14:21:00 +01:00
Ad Schellevis
084ac9489b mvc: implement reusable grid template using form definitions. for https://github.com/opnsense/core/issues/8187 [3]
skip empty field definitions
2025-01-08 13:23:33 +01:00
Franco Fichtner
dd3a47ca34 pkg: it's 2025 :D 2025-01-08 13:15:00 +01:00
Franco Fichtner
0dd857bf03 system: refactor route creation for exec_safe() use
While here ignore all return values consistently.  Most of them are
ignored, some of them already on the add case.  Makes little sense
to report errors on a fraction of operations and adding the same route
will unfortunately yield an error anyway so it's not helpful in the
bulk of cases either.
2025-01-08 11:56:12 +01:00
Ad Schellevis
7c1caf1a11 Interfaces: Devices: Bridge - remove non-functional cruft for https://github.com/opnsense/core/issues/8193 2025-01-08 11:55:08 +01:00
Franco Fichtner
5159fc9641 system: refactor for less indent 2025-01-08 11:41:42 +01:00
Franco Fichtner
8258239148 system: move argument to where it matters 2025-01-08 11:39:14 +01:00
Franco Fichtner
99b2480dd5 dhcp: appreciate the details but better for a commit message here 2025-01-08 11:19:20 +01:00
Franco Fichtner
d1965a5cdd mvc: style issue 2025-01-08 09:42:29 +01:00
Ad Schellevis
b476529142 System: Trust: Certificates - minor form cleanup, remove some duplicate classes 2025-01-08 09:37:20 +01:00
Franco Fichtner
b7d0187285 dhcp: Kea is no longer new ;) 2025-01-07 17:47:43 +01:00
Ad Schellevis
834c42fc1e mvc: implement reusable grid template using form definitions. for https://github.com/opnsense/core/issues/8187 [2]
minor bugfix, make sure grid_view exists before iterating over it.
2025-01-07 17:45:25 +01:00
Franco Fichtner
27517b950f src: sweep 2025-01-07 17:27:14 +01:00
Ad Schellevis
0e91c2ec81 System: Settings: Tunables - refactor using base_bootgrid_table partial implemented in https://github.com/opnsense/core/commit/a7a99fcdfe972dacc1a6beada7607e73 2025-01-07 17:20:11 +01:00
Ad Schellevis
50a461ec9b System: Trust: Certificates - re-enable support for subjectAltName when creating CSR's, closes https://github.com/opnsense/core/issues/8190 2025-01-07 17:16:38 +01:00
Ad Schellevis
a7a99fcdfe mvc: implement reusable grid template using form definitions. for https://github.com/opnsense/core/issues/8187
Although this might not be the final version, it adds the relevant metadata to the form definitions and offers a very simple template which can be used as a partial().

Example input field:

    <field>
        <id>sysctl.tunable</id>
        <label>Tunable</label>
        <type>text</type>
        <grid_view>
            <sequence>1</sequence>
        </grid_view>
    </field>

grid_view entries contain a sequence which may overwrite the default order and can overwrite any data-* attribute available, e.g. <sortable>false</sortable> would remove the sortable option from the field.
2025-01-07 17:16:38 +01:00
Ad Schellevis
970977f5bf ui:themes - unhide mobile menu button (navbar-toggle) 2025-01-07 13:37:36 +01:00
Ad Schellevis
bff8cf2be8 mvc: move Volt template from Mvc\Controller to Base\ControllerBase which is only used for ui pages. [2]
fix a comment
2025-01-07 13:00:40 +01:00
Franco Fichtner
2e4b522c3f src: style sweep 2025-01-07 12:56:54 +01:00
Ad Schellevis
a1e8429ace System: Trust: Certificates - hide "Alternative Names" for CSRs, for https://github.com/opnsense/core/issues/8190 2025-01-07 11:50:27 +01:00
Ad Schellevis
88d4203976 mvc: move Volt template from Mvc\Controller to Base\ControllerBase which is only used for ui pages. 2025-01-07 11:43:56 +01:00
Ad Schellevis
9723717fbd System: Configuration: History - add classes to diff content so theme's can overwrite colors. 2025-01-07 10:11:11 +01:00
Ad Schellevis
094804f1f0 ui: official OPNsense dark theme, make default diff font color white in System: Configuration: History 2025-01-07 10:08:29 +01:00
Franco Fichtner
c20a9ae2d5 system: remove spurious backup() so we only back up once 2025-01-07 09:11:31 +01:00
Ad Schellevis
9d592be68a System: Settings: Tunables - typo in description fieldname, ref https://github.com/opnsense/core/issues/7249 2025-01-07 08:51:21 +01:00
Franco Fichtner
75b03b4b38 mvc: description can be empty too 2025-01-07 08:29:35 +01:00
Franco Fichtner
2fef2a80b0 src: style sweep 2025-01-07 08:20:25 +01:00
Ad Schellevis
a6b0827716 mvc: extract grid field data from form definition file, for https://github.com/opnsense/core/issues/8187
Perform some small cleanups in ControllerBase and add method to extract grid fields, sample config data:

     <field>
         <id>sysctl.value</id>
         <label>Value</label>
         <type>text</type>
         <grid_view>
             <sequence>2</sequence>
         </grid_view>
     </field>

Which results in the following output:

        (
            [sequence] => 2
            [visible] => false
            [ignore] => false
            [sortable] => false
            [width] =>
            [label] => Value
            [id] => sysctl.value
            [type] => text
            [fieldname] => value
        )
2025-01-06 21:46:08 +01:00
Nikita Uvarov
4c8fee08f7
monit: wrap exec in double quotes to allow arguments (#8085) 2025-01-06 15:34:55 +01:00
Ad Schellevis
77a6b14ce6 Services: Kea DHCP: Kea DHCPv4 - add 'match-client-id' in subnet definitions, closes https://github.com/opnsense/core/issues/8183 2025-01-06 10:09:06 +01:00
Ad Schellevis
f72e066e4d Trust: add serialNumber and issuer in Store::parseX509(), requested in https://github.com/opnsense/core/issues/8141#issuecomment-2571771937
Since we map subjects, we should do the same when adding an issuer if it exists. serialNumber is just a plain simple field.
2025-01-06 09:44:57 +01:00
Ad Schellevis
e150a571de mvc:JsonKeyValueStoreField - restore support for json input data without configd callout, closes https://github.com/opnsense/core/issues/8180
partially reverts 525481c15b
2025-01-06 09:27:50 +01:00
Ben Smithurst
b962ccd3ed
dhcpd6 prefixes script can fail to restart (#8109)
* redirect sleep output to avoid it holding the pipe to daemon process open

* add comment explaining the sleep

* use daemon -m0 parameter to prevent restart failures

This was changed from a simple redirect of the sleep command after
discussion with Franco on https://github.com/opnsense/core/pull/8109
2025-01-04 20:28:31 +01:00
Ad Schellevis
4836083503 Firewall: Aliases - minor code cleanup, use volatile fields in stead of generating fields in actionPostLoadingEvent(), less code and has the advantage of being able to inspect metadata for used fields. 2025-01-04 14:47:50 +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
b694c81be2 mvc:model - add Default() method to reset a model to it's factory defaults, required for https://github.com/opnsense/core/issues/7249
Sometimes its practical to be able to reset model settings to their defaults, in which case it makes sense to have a simple handle on the base model to flush all for a specific model.
Although this is a "hammer" (unable to validate referential constraints on its own), there is practical use when trying to reset a component to its factory state.
If useful, we could add a factory reset handle to the ApiMutableModelControllerBase class at some point as well to facility a "flush" in a more generic way.
2025-01-04 11:39:53 +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
75144ff498 Firewall: Automation: Filter - add "Max new connections", closes https://github.com/opnsense/core/issues/8143 2025-01-01 17:59:09 +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
37a32842fd System: Routes: Configuration - add support for rfc5549, missing implementation part for https://github.com/opnsense/core/issues/8157
When specifying different protocols for target network and gateway address, add protocol prefixes to both.
2024-12-30 16:03:59 +01:00