17389 Commits

Author SHA1 Message Date
Franco Fichtner
a0b4e35ea4 make: restyle 2024-10-13 14:18:05 +02:00
Ad Schellevis
84437b3812 mvc - rename PHPunit.xml to phpunit.xml so phpunit will pick it up automatically. 2024-10-12 17:10:17 +02:00
kumy
85721719af
fix: UpdateOnlyTextField incompatibility with DependConstraint (#7879)
* fix: UpdateOnlyTextField incompatibility with DependConstraint

Closes: #7878

* fix: UpdateOnlyTextField incompatibility with other Constraints

* fix: Introduce asFloat in BaseConstraint

* refactor: move isNumeric/asFloat to BaseField

* refactor: Move isEmpty() to BaseField class

* chore: Reformat to PSR-12

* refactor: Simplify isEmptyAndRequired()

* refactor: Drop isEmpty() from BaseField class

* refactor: Switch to isEmpty()

* chore: Drop unuseful comment

* revert: Restore previous check

* fix: Fix condition for SingleSelectConstraint

* revert: Remove trim() from getCurrentValue()

* chore: drop empty line

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


---------

Co-authored-by: Franco Fichtner <franco@lastsummer.de>
2024-10-12 17:08:54 +02:00
Ad Schellevis
416b6ee144 MVC - move explicit cast in BaseModel when calling field->setValue() to offer the posibility to read structures in custom field types.
This is a requirement for https://github.com/opnsense/core/issues/7904

To avoid moving config items around, we need some way to handle <priv/> and <apikeys/> for example. When `setValue()` receives the `SimpleXMLElement`, we can parse the data into a flattened structure on initial read. All current callers either use an implicit string cast or an explicit one, only the BaseField and LinkAddressField types seem to need an explicit one.
2024-10-12 16:49:36 +02:00
Ad Schellevis
c345e01de2 VPN: OpenVPN: Instances - support case insensitive strictusercn matching for instances, closes https://github.com/opnsense/core/pull/7862 2024-10-11 19:49:26 +02:00
richierg
a3b6d90291
Fix crt condition in setCRL (#7961) 2024-10-11 14:33:36 +02:00
Franco Fichtner
c26e9ee6f1 firmware: move CRL verification to config.sh
We still have to deal with output issues/errors but that's
for later.
2024-10-10 09:31:15 +02:00
Franco Fichtner
c42def9fa3 firmware: clean up code duplication using config.sh
Also provide an env_init() call for internal launcher commands
to set up relevant things.We do this to move the special libfetch
handling into the locked spot underneath the launcher.sh invoke.
2024-10-10 09:19:42 +02:00
Franco Fichtner
73bc8b6d12 firmware: refine edge case 2024-10-10 08:38:21 +02:00
Franco Fichtner
ffec0034b9 firmware: fix a typo 2024-10-10 08:33:21 +02:00
Ad Schellevis
d8255a015e configd - forgot temp file cleanup in 06d507704e after expiry 2024-10-09 18:54:44 +02:00
Monviech
238d53b190
ipsec: Fix advanced option max_ikev1_exchanges, changed checkbox to text and general to charon. (#7957) 2024-10-09 18:23:42 +02:00
Ad Schellevis
d172f15ceb System/Trust - minor compat fix in certctl.py 2024-10-09 13:40:43 +02:00
Stephan de Wit
04f9e5cfc2
OpenVPN: Instances: add Require Client Provisioning option (#7956) 2024-10-09 10:46:43 +02:00
Franco Fichtner
a890e5f6e2 firmware: add other pkg mirrors to CRL check and connectivity audit 2024-10-09 10:28:52 +02:00
Franco Fichtner
d3a655f76b firmware: add CRL validation for business mirror 2024-10-08 14:39:04 +02:00
Ad Schellevis
bf6ce7a34c System: Trust - add crl bundle collector for updates 2024-10-08 13:43:23 +02:00
Franco Fichtner
954fc82f24 firmware: collect TLS hostnames to check
We will reuse this for CRL verification in a bit.
2024-10-08 13:35:47 +02:00
Franco Fichtner
a383331f57 system: improve context of changed/modified message in certctl.py 2024-10-08 08:41:20 +02:00
Franco Fichtner
2adda3edd1 system: copyright header style 2024-10-08 08:08:40 +02:00
Ad Schellevis
9a33aeb07e system/trust - link location could be a file or link, but when it exists, it should be removed. fixes:
Scanning /usr/share/certs/trusted for certificates...
Scanning /usr/local/share/certs for certificates...
Traceback (most recent call last):
  File "/usr/local/opnsense/scripts/system/certctl.py", line 195, in <module>
    cmds[sys.argv[1]]()
  File "/usr/local/opnsense/scripts/system/certctl.py", line 152, in cmd_rehash
    os.symlink(src_filename, dst_filename)
FileExistsError: [Errno 17] File exists:
2024-10-07 19:47:25 +02:00
Mathieu
96a37c2763 tests: Add failing unit tests for ComparedToFieldConstraintTest 2024-10-07 09:36:24 +02:00
Ad Schellevis
e648aefb76 Firewall: Automation: Filter - add gateway groups to the list, closes https://github.com/opnsense/core/issues/7625 2024-10-05 18:22:30 +02:00
Ad Schellevis
0cae921340 Services: Kea DHCP: Kea DHCPv4 - add editAlert message for grid edits, closes https://github.com/opnsense/core/issues/7937 2024-10-05 17:47:40 +02:00
Ad Schellevis
9ce4add4db System: Trust: Certificates - show user icon when not otherwise used, but commonname matches any of our registered usernames. closes https://github.com/opnsense/core/issues/7920 2024-10-05 17:34:43 +02:00
Ad Schellevis
1a048805d7 VPN: OpenVPN: Instances - add "interface invoke registration" event to reconfigure action, closes https://github.com/opnsense/core/issues/7869 2024-10-05 17:09:04 +02:00
Ad Schellevis
415b280959 Services: Kea DHCP: Kea DHCPv4 / Reservations - add missing constraint on ip address, closes https://github.com/opnsense/core/issues/7944 2024-10-05 11:06:29 +02:00
Stephan de Wit
b49b935bb9 system: general: handle picture deletion via hidden input 2024-10-03 09:39:27 +02:00
Stephan de Wit
b9b2a10ba2 plugins: invert volatile check 2024-10-02 15:26:15 +02:00
Ad Schellevis
58dee6f789 System: Trust - add descriptions on download, closes https://github.com/opnsense/core/pull/7932 2024-10-02 11:30:48 +02:00
Franco Fichtner
b5ca261e18 interface: fix typo in menu 2024-10-01 09:30:45 +02:00
Franco Fichtner
3cee5afa61 system: fix ACLs redirecting to API page by default (mea culpa) 2024-10-01 09:02:17 +02:00
Franco Fichtner
ce1fae3913 interfaces: go full circle on newwanip even handler
The use of plugins_argument_map() makes it fully backwards
compatible now although external callers need to cope with
the new reality of handling arrays (maps) going forward with
25.1 to avoid having two events one of which slows down the
processing.
2024-10-01 08:15:27 +02:00
Franco Fichtner
f4e13c2a6a interfaces: refactor previous slightly 2024-10-01 07:41:15 +02:00
Monviech
f8d0ca5e1c
vxlan: fix interface being busy when vxlanlocal or vxlanremote is changed (#7872)
* vxlan: fix interface being busy when vxlanlocal or vxlanremote is changed.
2024-09-30 17:19:52 +02:00
Franco Fichtner
a94b31f0f8 system: small cleanup after the fact
Discussed with: @adschellevis
2024-09-30 17:16:54 +02:00
Franco Fichtner
6b70fcf113 system: remove page-dashboard-all, move remnants to page-login-logout; closes #7907
All the endpoints added here have no other reference and merely
exist as dashboard core additions.  Rename the visible ACL name
to hint at users that this is needed although it would be good to
offer this in the documentation for clarity.

Reusing this for maximum effect and least impact since it already
tried to create a dashboard minimal setup and here we also add the
license page and scrub the extra privilege as it does not seem to
be high profile and required.
2024-09-30 16:04:03 +02:00
Franco Fichtner
3fe3591f6b system: put picture link back and fix type conversion issue #7907 2024-09-30 16:03:05 +02:00
Stephan de Wit
3d1cac71ce dashboard: exclude non-reachable links from being rendered 2024-09-30 15:46:00 +02:00
Franco Fichtner
eb7b2daa38 system: make picture widget available for non-root users #7907
Do not point to a location the user may not have access to.
It's not ideal, but this way we avoid future complaints and
perhaps need to document where to set the picture in the docs.
2024-09-30 15:35:49 +02:00
Franco Fichtner
43e3be8248 system: remove unreachable page-getstats #7907
The license is only visible due to 1fd55b121142.  Scrub unreachable
and annotate the other one as that may still be reachable.
2024-09-30 15:21:22 +02:00
Franco Fichtner
30d46892c4 mvc: remove closelog() plainly for now
Fixing this fully is probably quite some work as the API isn't
tailored for multi-log-location.
2024-09-30 13:55:37 +02:00
Franco Fichtner
b563c223bf system: closelog() has timing issues
Not sure where this comes from but the concensus is that
closelog() is relatively useless and testing verifies that
it works as expected without it.

Now we just have to make sure that each component using
openlog() will reopen the actual GUI log so that it can
keep logging correctly.
2024-09-30 13:19:26 +02:00
Franco Fichtner
3612583d58 system: adjust a bit of ACL confusion and drop separate entities from dashboard-all #7907 2024-09-30 09:26:37 +02:00
Franco Fichtner
ff73ec9c90 make: do not waste development time by clearing caches on install 2024-09-30 09:26:37 +02:00
Franco Fichtner
a5579cf3d7 monit: fix ACL metadata loosely related to #7907 2024-09-30 09:26:37 +02:00
Ad Schellevis
f454a2d335 VPN: OpenVPN: Instances - fix "auth-gen-token" being supplied in server mode introduced by ec23ffc0ef, closes https://github.com/opnsense/core/issues/7919
auth-gen-token should only be offered (and validated) in server mode, move the validation into the server block and split the patameter handling into generic and specific mode specific types.
2024-09-30 08:54:39 +02:00
Franco Fichtner
1d8e5fec36 plugins: improve the pattern handling in devices
Always bootstrap (an impossible) pattern to match devices.  On the
console end try the implied method now.
2024-09-30 07:46:21 +02:00
kumy
f81c2e864a
fix: Correct template helper exists() return type (#7918)
Closes #7917
2024-09-29 19:18:20 +02:00
Ad Schellevis
66e62f4a89 System: Settings: Logging - configure proper CA and CRL directories conform standards.
Although the ca-file directive works, it's better to use the hashed values in /etc/ssl/certs/ as deployed by certctl.
While here, also make sure we do not trust revoked certificates when a CRL was deployed.
2024-09-29 13:35:36 +02:00