15357 Commits

Author SHA1 Message Date
Franco Fichtner
81fa5fd332 firmware: disable until we have updated opnsense-update 2023-06-07 10:22:34 +02:00
Franco Fichtner
c6cf3312ad firmware: style 2023-06-06 11:00:49 +02:00
Franco Fichtner
41b5e641cf firmware: let opnsense-update -u stage the kernel as well
And only replace kernel if the pre-upgrade hook went ok.
2023-06-06 09:36:36 +02:00
Franco Fichtner
ea8338767d firmware: if the kernel hasn't been applied do it now
"opnsense-update -u" changes to not apply the kernel and the upgrade
script will handle it.  But in case this is going to be scripted by
the user we should just make sure this still needs to be taken care of
adding an extra reboot but that's ok.
2023-06-06 09:12:36 +02:00
Franco Fichtner
afcb402aae firmware: shift key extract to "-x" option
We need "-K" for deferred kernel install.
2023-06-06 08:44:29 +02:00
Franco Fichtner
38772514fa firmware: make a note about future work (FreeBSD 14) 2023-06-06 08:13:28 +02:00
Franco Fichtner
428bc2f4a2 system: propagate error in rc.syshook scripts #6594
We could stop on first problem but that woul likely break a number
of setups that use boot early/start hooks with sloppy coding.

Instead make the full run as an error and report it at the end.
2023-06-05 13:52:56 +02:00
Franco Fichtner
72cae559d7 firmware: refactor for clarity 2023-06-05 13:34:02 +02:00
Franco Fichtner
5f60391b63 firmware: handle script errors by aborting the upgrade #6594
The individual scripts should return an error and clean up
their state in case they aborted (which isn't too easy but
in most cases moving the relevant files to the final location
is a good way of dealing with this problem).
2023-06-05 13:32:19 +02:00
Franco Fichtner
cea3afd44c firmware: pre-upgrade hook #6594
Make sure we are ready for reboot with kernel replaced but
not yet booted.  This way we can run the migration in the
last possible correct spot.  We might even abort on errors
here which might be handy to catch issues... to be discussed.
2023-06-05 12:38:48 +02:00
Franco Fichtner
af5834600c system: do a full transition on gateway group apply 2023-06-05 09:04:09 +02:00
Franco Fichtner
6607268a23 interfaces: adjust this for moving it to stable safely
While this should work let's try not to assume how the interface
names look like and just match until the next known delimiter by
excluding it and accepting all other characters.
2023-06-05 08:39:29 +02:00
Franco Fichtner
a0f2e8fac8 openvpn: widget style tweaks 2023-06-05 08:24:59 +02:00
William Desportes
a7b1a70533
Fix some typos (#6598)
* src: fix a typo in a translation string

* src: fix typos in comments and SECURITY.md
2023-06-04 10:38:04 +02:00
agh1467
a337d62008
ipsec: Check ipsec config exists before using, closes #6411 (#6412)
* ipsec: Check ipsec config exists before using, closes #6411
2023-06-04 10:26:14 +02:00
William Desportes
d82396db4f
src: fix phpdocs (#6599) 2023-06-04 10:21:24 +02:00
Ad Schellevis
6b40db6c2a Services: Monit: Settings - fix typo in validation message 2023-06-03 13:51:23 +02:00
Franco Fichtner
0200f79a19 system: dealing with "sleep 60" and signals in scripts is hard...
PR: https://forum.opnsense.org/index.php?topic=34241.0
2023-06-03 12:30:57 +02:00
Ad Schellevis
7273bba2c1 Services: Monit: Settings - fix "not on" validation. closes https://github.com/opnsense/core/issues/6591 2023-06-03 09:45:57 +02:00
Franco Fichtner
fdf46f317c system: improve RRD collector PID/service handling
PR: https://forum.opnsense.org/index.php?topic=34241.0
2023-06-03 09:26:55 +02:00
Ad Schellevis
038d5b9bcf Services: Web Proxy: Access Log - syslog parsing cleanup. closes https://github.com/opnsense/core/issues/6588 2023-06-01 08:34:15 +02:00
Franco Fichtner
962c388c58 src: style sweep 2023-05-31 16:29:30 +02:00
Ad Schellevis
e9edb11535
VPN: OpenVPN: Instances (MVC) (#6584)
* VPN: OpenVPN: Instances - add new module using the same approach as introduced for IPsec in 23.1. Since we likely can't easily migrate the old cruft, we better focus on offering the correct options for openvpn following upstream documentation.

o add boilerplate
o implement a solution to keep vpnid's unique so device creation for legacy and mvc can function in similar ways.
o add some of the main "helper" options for clients and servers
o Implement certificate logic, selecting a certificate also implies an authority (which we validate)
o hook CRL generation into the exising openvpn_refresh_crls() event
o attach already refactored authentication to new MVC as well, OpenVPN->getInstanceById() is responsible for feeding the data needed during authentication and overwrite generation.
o when in client mode and in need for a username+password combination, flush these to file and link in "auth-user-pass"
o routes (remote) and push routes (local), combine IPv4 and IPv6 for ease of administration,
o keep alive [push] ping-[restart] defined as seperate fields for validation
o add various "push" to client options in Miscellaneous section
o add "auth-gen-token" lifetime for https://github.com/opnsense/core/issues/6135
o allow selection of redirect-gateway type for https://github.com/opnsense/core/issues/6220
o move tls-auth/crypt into separate static keys objects (tab in instances page)
o hook existing events (ovpn_event.py) and make sure they locate the server using getServerById() when needed
o use getInstanceById in openvpn_prepare() to return both legacy as MVC device configuration
o add ovpn_service_control.php for service control [stop|start|restart|configure] and glue this in openvpn_services() via configd
o change openvpn_interfaces() to use isEnabled() method on the model to query if any (legacy/mvc) instances are enabled
o move openvpn_config() from openvpn.inc to widget and extend with MVC instances
o extend ovpn_status.py to parse "instance-" sockets as well, since the filename doesn't explain the role, we're using the status call to figure out the use. uuid's are keys in this case
o server_id type to str in kill_session.py so we can match either legacy or mvc sockets
o hook ExportController to OpenVPN model using getInstanceById() to glue the Client Export utility to both components
o extend connection status with mvc sessions (descriptions)

---------

Co-authored-by: Franco Fichtner <franco@opnsense.org>
2023-05-31 16:04:43 +02:00
Ad Schellevis
f5868fd0f1 Daskboard/OpenVPN widget - fix typo 2023-05-31 16:00:12 +02:00
Ad Schellevis
5d29d382c2 Filter - remove duplicate table defintions as these are already added via src/opnsense/mvc/app/models/OPNsense/Firewall/static_aliases/core.json 2023-05-31 12:46:55 +02:00
Franco Fichtner
74c3125e0d system: do not delete pid file
PR: https://forum.opnsense.org/index.php?topic=34241.0
2023-05-31 10:05:23 +02:00
Ad Schellevis
1c9677c82a VPN: IPsec: Connections - Support the default selector ([dynamic]) when local_ts or remote_ts are left empty. closes https://github.com/opnsense/core/issues/6579 2023-05-30 18:01:27 +02:00
Franco Fichtner
efcc7fcffa system: pluginctl -s batch mode like -S #6582
Refactor the code to take advantage of the -S behaviour and
also ditch the extra service_control_status() since already
fetched the status ourselves and it's used nowhere else.
2023-05-30 15:09:54 +02:00
Franco Fichtner
e454ed03bf interfaces: cleanups for #6583 2023-05-30 08:25:02 +02:00
Ad Schellevis
7d22775702 VPN: OpenVPN: Client Export - fix regression in 3a6c79d4bc 2023-05-29 16:12:03 +02:00
Franco Fichtner
03519568aa interfaces: RENEW and REBIND report partial PDINFO #6583
Previously it was thought that RENEW/REBIND do not reload properly but
this was eventually about another bug for when the server returns "no
binding" message and subsequently fixed in dhcp6c but not yet released
up to 23.1.8.

Ignore PD RENEW/REBIND as it will be the same value as REQUEST anyway.
2023-05-29 13:52:43 +02:00
Franco Fichtner
cebd68b299 src: style sweep 2023-05-28 17:00:28 +02:00
Ad Schellevis
9c31412e46 System: Diagnostics: Services - fix minor bug in service control where 'id' field was being ignored (name --> id). While here, also remove an access space in the service controller 2023-05-28 16:02:33 +02:00
Franco Fichtner
07f07fff3b system: improve static routes error handling
3c7fb657e14dfc muted "delete" operations but also "add" which makes
it impossible to see failures like the latest regression fixed in
25e2c0a301e1.  Since system_default_route() handles this accordingly
use the same approach here.
2023-05-28 13:05:53 +02:00
Daniel Mason
25e2c0a301 Fix issue with route add command 2023-05-28 12:51:21 +02:00
Franco Fichtner
3166ac7eb2 backend: fix regression in defactor missing description
No jobs showed up in the cron GUI for development which was a
bit suspicious.  The old default seemed to be empty string so
keep that behaviour instead of setting "None".
2023-05-26 08:39:39 +02:00
Franco Fichtner
5d5e957941 interfaces: fix regression causing rc.linkup stop to disappear the link-local 2023-05-25 07:37:19 +02:00
Franco Fichtner
95315b5ee2 src: style sweep 2023-05-24 10:45:02 +02:00
Franco Fichtner
c586bdb1a5 system: allow "." DNS search domain override; closes #6529
While here refactor get_searchdomain() a little to avoid complexity
in system_resolvconf_generate().
2023-05-24 09:30:38 +02:00
Ad Schellevis
33667b8bea VPN: OpenvPN : Client Specific Overrides - regression in https://github.com/opnsense/core/issues/6381 missed new redirect-gateway implementation. 2023-05-23 17:01:02 +02:00
Franco Fichtner
eca82994c3 interfaces: make this shorter 2023-05-22 13:31:23 +02:00
Franco Fichtner
236a3a7e7f interfaces: the presentation of values and extraction isn't ideal as all overlaps
Simplify for now and revisit this later in MVC.
2023-05-22 13:13:30 +02:00
Franco Fichtner
e581f82e6e interfaces: fix parsing our cryptic devices names 2023-05-22 13:09:43 +02:00
Franco Fichtner
41e5d0b79f interfaces: fix origin of bad read
'track6' might be shown as IPv6 address.
2023-05-22 13:00:22 +02:00
Franco Fichtner
4d9b8f0f4e interfaces: status page minor fixes 2023-05-22 12:43:03 +02:00
Franco Fichtner
c12e77519f interfaces: do not flush nameserver routes we do not add
Cleanup would be better but ifctl is not the place for it (no symmetry).

Maybe in the future we can use output from

    # pluginctl -r host_routes

to remove the routes safelty as they don't show if not used.

PR: https://forum.opnsense.org/index.php?topic=33831.0
2023-05-22 08:34:19 +02:00
Franco Fichtner
92d14dd4cd interfaces: parse driver name from ifinfo, add pluginctl magic 2023-05-18 11:29:12 +02:00
Franco Fichtner
78940da396 interfaces: avoid null route on fragile /64 and fix typo
PR: https://forum.opnsense.org/index.php?topic=33999.0
2023-05-17 21:22:39 +02:00
Franco Fichtner
9a1adab6c8 src: style sweep 2023-05-17 21:08:47 +02:00
Ad Schellevis
4d0eb9d323 MVC/Config - change exclusive to shared lock as discussed in https://github.com/opnsense/core/issues/6565 (minor rework on bebf3a2a7c)
Also replace copy() with a locked version for restoreBackup().
2023-05-17 20:15:38 +02:00