15833 Commits

Author SHA1 Message Date
Ad Schellevis
a91bc81aaf DHCPv6 Leases - fix "ends never" parsing for https://github.com/opnsense/core/issues/6891 2023-09-28 22:30:29 +02:00
Franco Fichtner
40955ddaee dhcp: looks like a refactor gone wrong #6853 2023-09-28 17:42:24 +02:00
Franco Fichtner
77caf21778 openvpn: nitpicking on wording 2023-09-28 17:05:49 +02:00
Franco Fichtner
b66e24c755 interfaces: purge unused parts of the dhclient-script #6869
Once upon a time we tried to treat this script as an external one
since it's still maintained somewhat in FreeBSD but the approach
of integration is much different so the script ends up with half
of its code not doing anything and perhaps more than it should.
Upstream fixes are also not full applicable anymore.

* Clear the writing of the host name.  The system does that.  Simply
  keep the logging aspect of it (if given).
* Remove the $ARP flush on TIMEOUT/EXPIRE as it seems misplaced.
* Remove exit_with_hooks() and is_default_interface() as these are
  tools that are not needed in our integration approach.
* While trailing TIMEOUT/EXPIRE failure case make sure to run
  newwanip in optional mode in order to pick up missing configuration.
* Copyright the changes from 2021 onwards that offer substantial
  changes to the way the script integration works or cooperates with
  the rest of the system.
* Inline the one-time use of functions.
* Remove tip-toeing around $resolvconf_enable.
* Ignore dhclient-enter-hooks.
* Remove commented-out code.
2023-09-28 16:49:30 +02:00
Ad Schellevis
2e90f1cb5b VPN: OpenVPN: Instances - missing selectpicker on vhid selector 2023-09-28 15:45:18 +02:00
Franco Fichtner
ca2609efbd mvc: add "make validate" target and script 2023-09-27 16:29:35 +02:00
Franco Fichtner
10e726113b mvc: introduce isVolatile() for BaseModel
Needed for running batch validation as memory models have
do data so their validation fails.
2023-09-27 16:29:35 +02:00
Stephan de Wit
7a2f3f62d9 interfaces: drop PPP default route handling
the relevant route is configured later in the chain using getDefaultGW(),
no need to instruct mpd5 to set it for us.
2023-09-27 15:59:17 +02:00
Franco Fichtner
42cfb664f7 ipsec: model update 2023-09-27 14:36:48 +02:00
Franco Fichtner
7e3c63a3ab firewall: do not reference automatic rule that is hardcoded 2023-09-27 14:01:49 +02:00
Franco Fichtner
881610cfe8 system: reverse diff to show newer as green, less table markup for diff 2023-09-27 13:50:24 +02:00
Franco Fichtner
8ac86cc577 src: style sweep 2023-09-26 17:19:23 +02:00
Ad Schellevis
f75ec9688a System: Configuration: History - refactor using MVC components.
When \Deciso\OPNcentral\Central exists, there might be multiple providers to select from, so we can easily reuse the same component in both versions.

closes https://github.com/opnsense/core/issues/6828
2023-09-26 16:12:49 +02:00
Franco Fichtner
d9fcc0bbbf firewall: wrong link to VIP page 2023-09-26 08:41:16 +02:00
Ad Schellevis
dd40f71523 System: Configuration: History - move "backupcount" setting to "System: Configuration: Backups" for https://github.com/opnsense/core/issues/6828
Local backup configuration would be best stored in the backup configuration for consistency. Eventually we should refactor the backup configuration as well, but while refactoring the history page and adding a host selection (when used in conjunction with OPNcentral), this setting is a bit out of place.
2023-09-25 21:38:37 +02:00
Ad Schellevis
56e2940430 System: Access: Groups|Users - when adding the "user-config-readonly" privilege via "Select all", make sure to trigger the warning as well and note the name of the warning. In rare cases people select all and save finding out that nothing else is being stored anymore.
The future removal clause remains, although I don't expect it to go away any time soon as alternatives are hard to find.
2023-09-25 16:20:44 +02:00
Franco Fichtner
2bd3fb5d9f
interfaces: make link-local vips unique per interface #6775 (#6876) 2023-09-25 16:15:53 +02:00
Franco Fichtner
3a0b929386 system: fix stray char in help text 2023-09-25 16:09:16 +02:00
Franco Fichtner
bb6d69cc98 mvc: inline one time use of $parentKey 2023-09-25 14:58:58 +02:00
Franco Fichtner
f23f455bc4 firewall: improve previous by reusing a class constant #6880 2023-09-25 10:42:16 +02:00
Franco Fichtner
f8ff476cff firewall: quote a/n protocol; closes #6880 2023-09-25 10:13:19 +02:00
Franco Fichtner
f63fd66472 interfaces: for consistency bootstrap the implicit 'none' value 2023-09-25 09:09:25 +02:00
Franco Fichtner
0bd1280a45 interfaces: prevent reading config.xml garbage
The no prefix is only applicable when 'dhcp6' IPv6 mode is set.

PR: https://forum.opnsense.org/index.php?topic=35848.0
2023-09-24 20:54:31 +02:00
Franco Fichtner
633399de85 interfaces: improve logging in dhclient-script 2023-09-24 20:25:06 +02:00
Ad Schellevis
d971257fd9 Authentication / LDAP [+totp] - In cases where the user is able to influence their group membership according to the memberOf attribute, offer the ability to only match on those being selected ib the container section. Although cases like these are likely misconfigurations elsewhere, it may help to improve security in some cases (although likely one should still fix the issue in the identity provider as well).
mentioned in https://github.com/opnsense/core/issues/6871
2023-09-23 10:58:16 +02:00
Franco Fichtner
7fcbb22094 dhcp: merge_ipv6_address() was too intrusive
Testing 3582242d0fe10 it appeared that link-local addresses were
rewritten as GUAs in the dhcpd configuration.  The static map part
does this right, but all the other callers are not.  Flip this
around as it was intended.  The DHCPv6 page will now throw an out
of range error when it previously adjusted the explit prefix anyway.

dhcpd config with link local seems fine too, but more testing is
always good.
2023-09-22 14:22:56 +02:00
Alejandro Criado-Pérez
066d836afb
Multiple text corrections (#6867) 2023-09-22 13:46:11 +02:00
Franco Fichtner
11bbafed6e ipsec: improve new help texts 2023-09-22 13:38:30 +02:00
Daggolin
f53a60c911
openvpn: add up and down scripts to vpn instance configs (#6879) 2023-09-22 13:31:34 +02:00
Franco Fichtner
45c940fa26 mvc: style update 2023-09-22 13:27:59 +02:00
Franco Fichtner
a4b9e92769 mvc: IntegerField validation message update 2023-09-22 13:23:48 +02:00
Franco Fichtner
8d340ff5c8 mvc: NetworkField validation message update 2023-09-22 13:10:44 +02:00
Franco Fichtner
b3005955c1 mvc: HostnameField validation message 2023-09-22 13:08:13 +02:00
Franco Fichtner
7fab0249f7 mvc: EmailField validation msg 2023-09-22 13:05:54 +02:00
Franco Fichtner
90c5db7687 mvc: CSVListField validation message update
MaskPerItem=Y needs work and the preg_match() shoudldn't be used
to look inside the match which creates the initial problem:

/usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php:176:
Error at /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CSVListField.php:162 - Undefined array key 0 (errno=2)
2023-09-22 12:58:24 +02:00
Franco Fichtner
5d89666946 mvc: AutoNumberField validation message update 2023-09-22 12:37:58 +02:00
Franco Fichtner
cf80131910 mvc: BooleanField validation message and faulty regex fix 2023-09-22 12:32:09 +02:00
Franco Fichtner
3363fa9d2d mvc: Base64Field validation message update 2023-09-22 12:30:15 +02:00
Franco Fichtner
8aff5a9c81 mvc: NumericField validation message update 2023-09-22 12:17:41 +02:00
Franco Fichtner
2cd5fcac5c mvc: UnqiueIdField special validation message
If we ever derive from UnqiueIdField we would end up overwriting
this message and there is no data validation involved which the
message would be for so it can be null as per BaseField.
2023-09-22 11:29:32 +02:00
Franco Fichtner
8d8cc03ac3 mvc: UrlField validation message cleanup 2023-09-22 11:23:21 +02:00
Franco Fichtner
465f7fa8bb mvc: set Required=Y for GroupNameField
The validation message is never seen anymore and can't be overridden.
While the field made sure to emit a message on empty the result is
that if we ever have to use this group field as optional we would have
to pivot to this approach anyway.
2023-09-22 10:54:31 +02:00
Franco Fichtner
ac0fcaa406 mvc: remove special validation messages likely never seen
We could use defaultValidationMessage() but the BaseListField message
is fitting enough and the GUI itself cannot cause this to happen.
The reason for stripping is also that the variable is not handled by
the field so there is no special validation meaning attached either.

For BaseField derivates the idea was to set a custom required validation
message which is no longer possible or possibly not even reachable.
2023-09-22 10:54:09 +02:00
Franco Fichtner
9cb123ce7f interfaces: fix a PHP warning and make a comment about floating rules 2023-09-22 10:25:21 +02:00
Franco Fichtner
896ade7698 src: sweep 2023-09-22 10:21:42 +02:00
Franco Fichtner
7dcb31c024
mvc: improve field validation message handling (#6872)
* provide defaultValidationMessage() to inject gettext-supported string
* assume $internalValidationMessage can only be set by XML now
* the goal here is to translate and improve all the field validation messages
2023-09-22 10:17:18 +02:00
Stephan de Wit
d2eb2fcc91
UniqueConstraint: add test cases (#6875)
Since UniqueConstraint was worked on recently, some test cases to accomodate all scenarios
2023-09-22 10:12:21 +02:00
Franco Fichtner
ce189cb4ee interfaces: redirect after successful interface add
Otherwise reloading may repost the data which is unnecessary.
2023-09-22 09:54:06 +02:00
Franco Fichtner
c4682b5536 interfaces: improve UX and simplify bridge validation
To be honest the page was horrible.  Originally I wanted to reduce
the bridge validation code using interface_parent_devices() but
ended up renaming a lot of variables from "port" to "dev(ice)" and
started renaming the table headers for clarity which ended up in
splitting the add interface section from the list/modify section
which ended up restyling the whole table for better mobile use and
clear separation of functionality.  Also added a note to the add
section when no devices are available for assignment.

This should in theory prevent a number of support questions and
mistakes seen over the years WRT using this page.
2023-09-22 09:49:02 +02:00
Franco Fichtner
2d36853da4 interfaces: add interface return feature for use on bridges/assignment page 2023-09-22 09:49:00 +02:00