15904 Commits

Author SHA1 Message Date
Franco Fichtner
be87fa7f4d firmware: adjust boilerplate text a little 2023-10-17 08:33:30 +02:00
Franco Fichtner
a224ff4a2b dhcp: sort this a little better, loosely refs #6942 2023-10-17 08:15:46 +02:00
Ad Schellevis
854043daa1 Firewall: Log Files: Live View - change cleanup a bit so it keeps filtered items longer available. The trick in this case is relatively simple, by splitting the cleanup in visible and invisible items, we keep visible items longer on screen at the (small) cost of using a little more memory.
might solve part of the problem https://github.com/opnsense/core/issues/6833 tries to solve.
2023-10-16 20:46:16 +02:00
Franco Fichtner
788f857a40 mvc: style sweep 2023-10-16 15:10:10 +02:00
Franco Fichtner
e0e1401f87 interfaces: add no_dad to staticv6; closes #6913 2023-10-16 15:10:03 +02:00
Franco Fichtner
0785e337e9 wireguard: different approach to bootup handling
Since we used to allow IP configuration ands VIPs are
a possibility we can avoid checking for missing IPs
and simply delete the status hash file which will
force an eventual reconfiguration.

While here avoid wireguard_prepare() from creating spurious
devices when there is no need for it as it happens with
manual invoke through "pluginctl -d wgX".  wg-service-control
uses the same logic.
2023-10-16 13:40:10 +02:00
Ad Schellevis
c3c9beaebe pluginctl - minor change to previous, only show plugin name instead of origin of the call. 2023-10-16 11:42:59 +02:00
Ad Schellevis
df54b2d0f6 pluginctl - improve listing plugins of selected type, this contains two modifications:
1] bugfix to show services on -s
2] when showing event hooks, also display the functions attached to it.
2023-10-16 11:19:42 +02:00
Franco Fichtner
bef67b3e5d mvc: copyright header style 2023-10-16 08:31:32 +02:00
Ad Schellevis
967767591b VPN: IPsec: Connections - simplify optgroup as a result of changes in bc195308be 2023-10-15 14:51:48 +02:00
Ad Schellevis
bc195308be mvc: OptionField - add support for the optgroup in a one level deep nesting construction. This offers the ability to use the optgroup frontend glue added in 9206823d60 using an OptionField definition like:
<field type="OptionField">
    <OptionValues>
        <opt1 value='option group 1'>
           <opt1 value='option1'>option 1</opt1>
        </opt1>
        <option_group2>
           <opt2>option 2</option2>
        </option_group2>
    </OptionValues>
</field>
2023-10-15 14:35:31 +02:00
Ad Schellevis
09cabd9877 Core/Config - add hasChanged() to detect changes to the config file from other processes in a lightweight mannner. closes https://github.com/opnsense/core/issues/6798 2023-10-15 14:12:28 +02:00
Ad Schellevis
0c2c3b0c79 mvc: UnqiueIdField - enforce uniqueness and remove validation message. closes https://github.com/opnsense/core/issues/6877
This field type is hardly used, but the intention was to generate a new uniqueid on creation and make it stick. Trying to remember the last know stored value is rather tricky (certainly when it comes to cloning), but making sure we ignore values saved isn't that hard.

Although this doesn't win the beauty contest, at least it does make sure uniqid() is called for every new field. Either when cloning the field or calling a set on an empty entry.
2023-10-15 13:13:22 +02:00
Ad Schellevis
67f7d7ff46 VPN: IPsec: Connections - reorganise cipher proposal choices, making room for explicit unsafe choices. for https://github.com/opnsense/core/issues/6928 , https://github.com/opnsense/core/issues/6279 2023-10-14 19:05:37 +02:00
Ad Schellevis
6d79f3c44d Firewall: Rules: LAN - sort auto generated rules by priority set, closes https://github.com/opnsense/core/issues/6933 2023-10-13 16:00:40 +02:00
Franco Fichtner
f0f7f6de78 system: make our certs easier to find 2023-10-13 15:06:13 +02:00
Franco Fichtner
55204f9d77 src: style sweep 2023-10-13 08:42:08 +02:00
Franco Fichtner
5a125dcb83 system: bootstrap an empty string to theme to squelch a warning
The rest of the system knows to use "opnsense" already.  The page
throws the warning here but instead of hardcoding the theme name
just give it an empty string so the first one is selected even
though it might not be the right one.  Hardcoding this doesn't
feel right...
2023-10-13 08:35:04 +02:00
Ad Schellevis
9206823d60 MVC / form handling (opnsense.js) -- Support optgroup atributes for select boxes, when a fieldtype offers an "optgroup" attribute on an element the items will be put into <optgroup> containers.
<optgroup label='my_group'>
  <option value='1'>option 1</option>
</optgroup>

Required for https://github.com/opnsense/core/issues/6928
2023-10-12 19:44:28 +02:00
Ad Schellevis
1bec000c1e Interfaces/neighbor - implement new neighbor configuration for arp/ndp entries closes https://github.com/opnsense/core/issues/6917
This commit adds a new component linked in Interfaces/Neighbors which offers the ability to manually register static leases and provides application control from other modules such as dhcpd. To minimize the risk, we're reusing the existing interfaces_staticarp_configure() hooks while only adjusting how static arp entries are being attached to the interface (match on addresses assigned when triggering with an interface).

Entries registered via dhcp will be visible from the ui as well together with its origin.
The previous version didn't cleanup old static entries, this version triggers a cleanup when executed for all interfaces using all earlier modifications processed via the same function (interfaces_neighbors_configure()).
2023-10-12 16:23:57 +02:00
Ad Schellevis
2ae4308a03 VPN: IPsec: Connections - limit visible range for searchable selectboxes 2023-10-11 21:43:11 +02:00
Franco Fichtner
061c43b4aa src: style sweep and plist fix 2023-10-11 20:55:14 +02:00
Ad Schellevis
8d42d8c663 Interfaces: Virtual IPs: Settings - move address and vhid_txt fields to model and make them sortable and searchable. closes https://github.com/opnsense/core/issues/6926 2023-10-11 20:07:47 +02:00
Michael
4c7c4de1ef
ipsec: make Description in Connections Required (#6927)
* Update Swanctl.xml

* Update src/opnsense/mvc/app/models/OPNsense/IPsec/Swanctl.xml

Co-authored-by: Franco Fichtner <franco@lastsummer.de>

---------

Co-authored-by: Franco Fichtner <franco@lastsummer.de>
2023-10-11 18:28:02 +02:00
Stephan de Wit
22520e969c Revert "MVC: ModelException import missing in BaseModel"
This reverts commit 16886f38e1582a117e8d4adf0cfad40388a2ea14.
2023-10-11 09:48:58 +02:00
Stephan de Wit
16886f38e1 MVC: ModelException import missing in BaseModel 2023-10-11 09:32:16 +02:00
Franco Fichtner
88f09eaa57 system: improve backup restore area selection; closes #6901
Make the restore area a multi-select since the xmlrpc_sync data
is already allowing merging separate sections and accomodate for
path traversal which also allows fine-grained restore of the
former "OPNsense addtions" selection.

Remove duplicated sections, hardcoded plugin sections or sections
not pertaining to interfaces/devices. rrddata is a special case
that can stay as well.

Handroll the configuration merge as it is easy enough to traverse
through the arrays without restructuring other files and functions.
This page will go away eventually anyway.

While here make sure the user knows that partial restores are
dangerous.
2023-10-10 20:34:25 +02:00
Franco Fichtner
02b6085023 interfaces: enable IPv6 early on trackers for #6855
This seems to be required nowadays to prevent missing link-local
address until an IPv6 is assigned, then it magically works anyway.
2023-10-10 13:42:23 +02:00
Franco Fichtner
22650b7184 system: copyright header style 2023-10-10 10:14:47 +02:00
Franco Fichtner
fe0bbadbcf openvpn: tweak validation messages 2023-10-10 10:04:59 +02:00
Franco Fichtner
e2524388c4 system: only call dpinger defaults once
Since we iterate over all and store the result as it is found
we can just use an empty array as a starting point.
2023-10-10 09:21:23 +02:00
Franco Fichtner
abb24e1c86 system: rewrite trust integration for certctl use
Since OPNsense 22.1 we are using FreeBSD 13 and it comes with a
base trust store which is also maintained there.  In order to be
user-configurable there is also a tool called certctl which will
manage blocking and filling the OpenSSL trust store location
/etc/ssl/certs.  The idea is to make this implicit and faster.

This, however, pseudo-obsoletes the trust bundle handling which
we mainly operate through /etc/ssl/cert.pem.  By pseudo I mean
that ports will still want the real bundles and/or know/guess
this location at complile time.  curl has such overrides for
example.

ca_root_nss's bundle is also pulled in thorough certctl so we
are going to have to jump through a few hoops now in order to
add our certificates cleanly and "prevent" breakage of the
resulting trust store.

Therefore now we write our CA content into separate files because
certctl only hashes the first certificate found in the file.
This is already a bit problematic for ca_root_nss having a
larage number of files in it...  And against all odds the
first certificate I wrote for our bundle is blacklisted by
FreeBSD which made certctl discard all OPNsense authorities
added from the GUI.

To avoid further issues with certclt as a broker here I have
added it in passthru() mode to see eventual errors clearly.

Now when certcl is done all the files are linked in the
/etc/ssl/certs directory but we actually have to build the
full bundle for compatibility with old ports requiring one
of the locations that ca_root_nss ETCSYMLINK option provides.

A shortcoming of certctl is the lack of a bundle mode for
compatibility's sake which is causing a number of problems in
the ports tree at the moment (which is why we do this work now
and take a closer look before this is rolled out in full in
FreeBSD ports).

The bundle is created by iterating over all files in /etc/ssl/certs
and putting them in the expected locations.  One caveat is that
this bloats the bundles to 1.5MB from previously 750KB.  The whole
process is a lot slower, especially certctl doing the rehash.

Long story short: this is going to cause issues in the long run,
but for now we know how it is supposed to work and are ready
for FreeBSD ports to drop support for bundles in individual ports.
But that being said we will probably drag the bundles on for
a few years anyway.
2023-10-10 08:53:46 +02:00
Franco Fichtner
f4a37d9455 interfaces: prevent sleep on pending development release
This can slow down reconfiguration of a system with many
VLAN children on a single interface down/up.  We likely
have to refactor rc.linkup to coalesce the interface
reload into a safer reload facility.
2023-10-09 19:16:39 +02:00
Ad Schellevis
8d71ea0f64 ervices: Unbound DNS: Overrides - Make selected row "sticky" when there are items available, always make sure one is selected and reload the aliases grid when hosts are loaded. closes https://github.com/opnsense/core/issues/6920 2023-10-09 17:43:46 +02:00
Ad Schellevis
5003ce8f05 System: High Availability: Settings - move services to sync in its own pane and add [de]select all buttons. closes https://github.com/opnsense/core/issues/6890 2023-10-09 17:27:10 +02:00
Franco Fichtner
6657404d93 interfaces: prevent array data from being passed 2023-10-09 12:12:03 +02:00
Franco Fichtner
4fff50b4aa interfaces: fix warning, variable not assigned 2023-10-09 11:55:11 +02:00
Franco Fichtner
fb336e334a interfaces: DAD sleep on $reload; closes #6913
This is called through rc.linkup exhibiting the issue.
Sidestep the complexity of the situation by fixing the
issue first making it testable and easy to ship in a
stable relese.

For anyone not liking this net.inet6.ip6.dad_count can
be set to "0" to disable the sleep behaviour.  This
needs to be extended one way or another.  More soon.
2023-10-09 11:47:53 +02:00
Franco Fichtner
703b071b5d src: style sweep 2023-10-09 10:01:21 +02:00
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