15730 Commits

Author SHA1 Message Date
Franco Fichtner
3dae3b507a unbound: scrub model, no functional changes 2023-09-14 21:40:25 +02:00
Ad Schellevis
9fb7c048d7
VPN/OpenVPN/Instances - Update dialogCSO.xml and fix route gateways title 2023-09-14 18:11:05 +02:00
Franco Fichtner
1aa5848847
unbound: migrate active/outgoing interfaces discarding invalid values (#6851) 2023-09-14 17:45:22 +02:00
Franco Fichtner
15ee80908f unbound: remove spurious <hr/> as __mt does the job and looks cleaner 2023-09-14 14:06:10 +02:00
Franco Fichtner
a086f40b0a unbound: bring back 4a1bc9f8b5e to avoid dynamic reloads when possible; closes #6802 2023-09-14 14:00:29 +02:00
Franco Fichtner
fe17f4ff48 unbound: allow disabled interfaces in interface field
While we are not concerned with interfaces that have disappeared
we should keep track of disabled interfaces since there is no strict
link between this field and the interface (or OpenVPN) configuration
which would make validation fail for the wrong reasons and/or force
the user to deselect the interface in order to proceed.

Also exclude lo0 because it is always added to ensure local resolving
which had no complaints since 2018 when this was reworked.  The abilty
to select it would cause the question of why it's not adhered to if
anyone started looking.
2023-09-14 10:51:51 +02:00
Franco Fichtner
2306449329 interfaces: fix typo 2023-09-13 13:00:47 +02:00
Franco Fichtner
c4285c9937 interfaces: if members for bridge could not be added change return code 2023-09-13 11:26:55 +02:00
Franco Fichtner
189e3af29e interfaces: improve bridge code a bit
* Allow the bridge to come up without members.  While the GUI made sure
  to avoid empty bridges there is no reason for it and underneath if the
  interface was disabled the GUI made the interface disappear from the
  selection.  So now allow an empty bridge (may be nice for migration)
  and show disabled interfaces in the edit page.  Fix all callers to not
  assume the member property is always set.  Can probably go away once
  bridges are moved to MVC.
* Inline interface_bridge_add_member() since link_interface_to_bridge()
  is the only caller.  Improve the parameter passing a bit too.
* Add bridge interface return code to (_)interfaces_bridge_configure().
* Improve device resolution and a few mwexecf() replacements.
* Log the reason why a device could not be attached to bridge when one
  device is not there as expected.
2023-09-13 10:39:49 +02:00
Franco Fichtner
818f729379 system: avoid picking up an empty default route
GIF/GRE might do this when assigned so extend the check.
2023-09-12 11:38:58 +02:00
Franco Fichtner
da4144180b interfaces: refactor link_interface_to_bridge() slightly 2023-09-12 11:15:17 +02:00
Franco Fichtner
58b45cd533 interfaces: kill the ancient OpenVPN-tap-on-a-bridge magic on IPv4 reload
This brings IPv4 and IPv6 closer together as both now support GIF/GRE
exclusively.  OpenVPN devices are created on boot since 44cd7aee8e.
2023-09-12 11:01:53 +02:00
Franco Fichtner
a744327574 interfaces: improve GIF/GRE configuration robustness
Now that we fail if we can't get the tunnel up improve this a bit more:

1. First order of business is adding removing/adding the device.

2. Return the device name when configuration was successful.

3. Use device name return to avoid "linking" failed devices.  This
   helps us to bring it up later when it is likely ready.

4. Remove the system_routing_configure() madness from device creation.

5. We may have static routes which were not adhered to previously.  So now
   use the same interfaces_restart_by_device() hook but omit the
   interface_configure() to void unwantend recusion in that function.
   This has the addded benefit of system_routing_configure() only being
   called once for that interface by rc.newwanip(v6).
2023-09-12 10:41:17 +02:00
Franco Fichtner
cfff4f2482 interfaces: split IPv4/IPv6 for GRE 2023-09-12 09:52:49 +02:00
Franco Fichtner
315153a07b interfaces: restructure GIF for split IPv4/IPv6 use
Formerly devices like GIF only worked on IPv4 dynamic links,
but with DS-Lite IPv6 is the only dynamic link so split the
execution on dynamic events according to what remote address
the tunnel requires.  This should allow DS-Lite to work out
of the box (functional after bootup).

While here restructure link_interface_to_gif() to better fit
the caller's needs.  Also feeling lucky about the stray
interfaces_bring_up() because if we check if the local address
is there we can be pretty sure the parent device is up.

PR: https://forum.opnsense.org/index.php?topic=35876.0
2023-09-12 09:01:29 +02:00
Qhilm
8d3d648035 Corrected link to IANA DHCPv6 Options documentation 2023-09-11 14:59:00 +02:00
Franco Fichtner
a8c348cfa4 system: cron parameters are escaped properly nowadays
This is allowed nowadays with the proper escaping in the
template employed.  However...

1. The parameter"s" are enforced by doing white-space
separated passing of individiual parts, but that breaks
backend scripts expecting either spaces to be part of
the parmeter or discarding additional parameters.

This matters, because...

2. https://docs.opnsense.org/manual/settingsmenu.html#cron
does not state any two parameter value of interest to
users apart from custom Cron glue.

I'd rather have "parameters" treated as a single first
parameter which can be passed with a %s to the shell, but
I'm unsure if configd will treat it that way?  At least
the crontab part would not be the issue.

Let's test this theory:

  # cat src/opnsense/service/conf/actions.d/actions_test.conf
  [shell]
  command:/bin/csh -c
  parameters:%s
  message:Running %s
  type:script_output
  description:Shell execution (use with care)

  # configctl test shell "echo foo"
  Parameter mismatch

  # configctl test shell "echo\ foo"
  foo

  # configctl test shell "echo\ foo;echo\ bar"
  foo
  bar

So there seems to be a mishandling of spaces in general
which is probably why the parameters are treated as such
in the crontab file.  Perhaps we need to discuss this.
2023-09-11 11:56:08 +02:00
Franco Fichtner
36d250f929 mvc: style 2023-09-11 09:32:46 +02:00
Franco Fichtner
b020480ee7 mvc: fix blankdesc test 2023-09-11 09:19:56 +02:00
Franco Fichtner
e79898bcbd ipsec: pet the translation, remove local/remote to only have one string to translate 2023-09-11 08:38:36 +02:00
Monviech
fcc266107d
VPN/IPSec - Add local_port and remote_port to VPN: IPsec: Connections [new] (#6835) 2023-09-09 22:58:52 +02:00
Franco Fichtner
252870b6c0 dhcp: style 2023-09-08 13:36:08 +02:00
Franco Fichtner
4b69625a4a pluginctl: allow -f mode to drop config properties; closes #6834 2023-09-08 09:26:30 +02:00
Franco Fichtner
b3c3b7a0c2 pluginctl: improve the print behavour for #6834
Now an empty node name '' will stay on the same node allowing to
dump the full config.xml for whatever reason.  Also change the
empty print behaviour to omit the spurious newline as that looks
better.  Last but not least pretty-print JSON for better UX.
2023-09-08 08:06:29 +02:00
Franco Fichtner
ff0b85f7e5 dhcp: clean up the messages in the radvd config header #6819 2023-09-07 20:32:49 +02:00
Franco Fichtner
6fbe6ca189 src: sweep over bootstrap update
Windows line endings...
2023-09-07 16:58:16 +02:00
Franco Fichtner
2e0f00b603 system: style change 2023-09-07 16:55:47 +02:00
Ad Schellevis
dd9854f111 core/css - upgrade bootstrap-select to v1.13.18, remove the version number from the css file as well (needs changes in the plugins as well).
source https://github.com/snapappointments/bootstrap-select/tree/v1.13.18/dist
2023-09-07 15:03:20 +02:00
Franco Fichtner
2f87d58f9a system: /usr/sbin/nologin seems to be the authoritative one 2023-09-07 14:31:12 +02:00
Ad Schellevis
8a8b6ff2d6 System: Settings: Logging / targets - simplify tls handling and handle rfc5424 consistently. closes https://github.com/opnsense/core/issues/6813 2023-09-07 14:14:05 +02:00
Franco Fichtner
73b6e048ac openvpn: help text styling 2023-09-07 10:10:32 +02:00
Franco Fichtner
31593b1e6f system: small refactor for clarity 2023-09-07 09:36:04 +02:00
Franco Fichtner
97b08eec0c system: kill the unused "alert" "interval"
The terminology is confusing -- it's just a poll interval in
dpinger's alert thread like we have in gateway watcher (also
defaulting to 1 second).  Since we do not want to expose
such values to the GUI without a pressing reason we better
do it this way than add more knobs that make support harder
and expectations less clear (reaction time suffers quickly when
increasing this value).

While here disable the alert thread completely in dpinger which
seems to be steered by passing the loss and delay.  Also adjust
the default for the loss interval which is calculated by dpinger
as 4 times the probe interval, so the default was wrong also.
2023-09-07 09:28:04 +02:00
Franco Fichtner
ea2f63bddd system: fix pid kill regression in #6825 2023-09-07 09:24:09 +02:00
Franco Fichtner
4b153a375a system: performance part 2; closes #6825
Under ideal circumstances (non-SIGKILL) the PID file and socket
are removed cleanly so they don't show up as readabe sockets in
dpinger_status().  When we kill the process the socket is there
but the open fails immediately.  That only leaves a stuck process
not reacting to open, but we can deal with that by decreating the
timeout a bit more (from 3 to 1 seconds per socket).  We still
want a sort of sensible timeout here that isn't too short and
assume that a system not being able to respond in time is having
other (and more criticial) issues to cope with.
2023-09-07 08:56:55 +02:00
Franco Fichtner
cb584cc171 system: gateway bindings cleanup
return_gateway_groups_array() is not used anymore, but leave it
in 23.7 so that 24.1 picks this up automatically.
2023-09-07 08:45:44 +02:00
Franco Fichtner
a2ab96833d system: avoid plugin system for native dpinger scripts fetching dpinger_status() #6825 2023-09-07 08:45:44 +02:00
Franco Fichtner
943b3fcf2c system: tweak previous also skipping unusable gateways 2023-09-07 08:45:44 +02:00
Ad Schellevis
2207bd2634 VPN: IPsec: Connections [new] - Allow the use of eap_id = %any . closes https://github.com/opnsense/core/issues/6824 (missed a spot) 2023-09-07 08:26:25 +02:00
Franco Fichtner
25e0a41fc7 ipsec: small help text update 2023-09-07 07:44:48 +02:00
Ad Schellevis
e6da85918d VPN: IPsec: Connections [new] - Allow the use of eap_id = %any . closes https://github.com/opnsense/core/issues/6824 2023-09-06 21:01:15 +02:00
Franco Fichtner
5e9f114ea0 dhcp: make dhcrelay code use the Gateways class
Stop using the opportunistic "wan" gateway and emit a
log entry on failing to derive a viable interface name.
It's already somewhat questionable if we should use a
default gateway, but the code is what it is.
2023-09-06 16:10:27 +02:00
Franco Fichtner
bf9cf03dc8 dhcp: 'if' from Gateways class returns the device
Which seems to be required. Fix the brokenness.
2023-09-06 14:55:20 +02:00
Franco Fichtner
dea3644296 dhcp: remove unused Gateways class 2023-09-06 14:33:23 +02:00
Franco Fichtner
3786caf568 system: do not mark defunct gw as disabled as well
gatewaysIndexedByName() -> do not omit when defunct
getDefaultGW() -> omit when defunct
getInterfaceGateway() -> omit when defunct (debatable)

Otherwise strip gatewaysIndexedByName(true) where the behaviour
was likely to try and get defunct gateways as well and fix the
dpinger code accordingly to get rid of raw config access.
2023-09-06 13:55:23 +02:00
Franco Fichtner
d417603918 make: ...and actually include it in a commit ;) 2023-09-06 13:46:53 +02:00
Franco Fichtner
f6b3beba40 make: move version info out of the way
Make merging easier for the main makefile.
2023-09-06 13:45:47 +02:00
Franco Fichtner
e7f19e43da openvpn: style 2023-09-06 13:16:58 +02:00
Franco Fichtner
673634970c system: kill hasGateways(), write DHCP router option unconditionally
It can be disabled and it might take some indeterministic behaviour
out of the situation.
2023-09-06 10:48:16 +02:00
Franco Fichtner
9ddfa876d5 system: small style update
groups, master.passwd and shells do not need updates.
2023-09-06 09:19:42 +02:00