13298 Commits

Author SHA1 Message Date
Franco Fichtner
edb286cf6a mvc: translate base field error
Without gettext() wrapping we never produce a string in the
translation for it.  It gets passed to gettext() twice then
but that is matters not as the target string cannot be translated
again when called a second time.
2022-10-10 20:23:53 +02:00
Franco Fichtner
f70b71ce12 ipsec: style sweep 2022-10-10 20:23:26 +02:00
Ad Schellevis
0adf843ff6
VPN / IPsec - migrate ipsec.conf to swanctl.conf (#6076)
* VPN/IPsec - work in progress refactoring ipsec.conf to swanctl.conf for https://github.com/opnsense/core/issues/5636

Wrap the following blocks in functions:

o generation of strongswan.conf
o write and cleanup IPsec's CA database
o write certificates used by IPsec
o write RSA Key Pairs
o construct ipsec.secrets for swanctl, combining different sources, phase1 PSK's, certificates, keypairs
o replace VPN: IPsec: Lease Status with new mvc version that uses swanctl underneath

Remap ipsec.conf to swanctl.conf attributes using https://wiki.strongswan.org/projects/strongswan/wiki/Fromipsecconf

Remove lifetime defaults from phase 1 and 2 so new connections will use Strongswan's defaults and move the option in phase above Margintime/Rekeyfuzz as these combined are being migrated (see margintime in Fromipsecconf doc).

Restructure used path directives so we can use the default structure as descried in https://docs.strongswan.org/docs/5.9/swanctl/swanctlDir.html and installed via ports.

IPsec status overview needs a small fix as well (passthrough network seems to be returned by vici, but doesn't contain a class (which crashes list_status.py).)

While here, also remove some php warnings.
2022-10-10 19:52:36 +02:00
Ad Schellevis
385d182798 Firewall: Aliases - support Maxmind's unclassified EU (region, country unknown) as country selector EU
6255148,en,EU,Europe,,,0

Although the same applies for Asia, we can't use AS as country code here, so we do have to skip this for now until we find a better alternative.

6255147,en,AS,Asia,,,0

closes https://github.com/opnsense/core/issues/6063
2022-10-10 18:24:32 +02:00
Franco Fichtner
6a2190695d ipsec: ACL fix for sessions users #6067 2022-10-09 09:28:07 +02:00
Ad Schellevis
6f53ca0b22 MVC / form validation handling - when multiple messages are returned, wrap each message in a div. closes https://github.com/opnsense/core/issues/6073 2022-10-08 08:47:17 +02:00
Ad Schellevis
a31a21bd93 Interfaces: Other Types: VLAN - show attached interface on device, for https://github.com/opnsense/core/pull/6074 2022-10-07 19:55:50 +02:00
Franco Fichtner
26a0bf2337 interfaces: fix validation the way it was intended 2022-10-07 13:44:10 +02:00
Ad Schellevis
054a7ee834 Interfaces: Other Types: VLAN - setItemAction() loop variable issue, overlapping with requested node leading to faulty validation results. 2022-10-07 11:05:08 +02:00
Franco Fichtner
6798d9a438 interfaces: also fix the help text 2022-10-07 10:44:44 +02:00
Franco Fichtner
46657fcc67 interfaces: simplify and tighten the matching 2022-10-07 10:31:40 +02:00
Franco Fichtner
6f83fd8eff interfaces: tweak device name validation messages 2022-10-07 10:01:45 +02:00
Ad Schellevis
91d8b7f8bf MVC - ApiControllerBase.php / fix typo in searchRecordsetBase() 2022-10-06 22:16:28 +02:00
Franco Fichtner
7fec5111bd system: contain abysmal CRL code in crlmanager page
Also try to reconfigure after write_config() which is the sensible
thing to do...
2022-10-06 12:00:57 +02:00
Ad Schellevis
9a77be0040 System/Trust/Revocation - Fix inconsistent is_crl_internal() implementation and make sure we always generate a crl when saved 2022-10-06 11:26:38 +02:00
Franco Fichtner
26ccc7839f system: remove _defaultgw(v6) file handling; closes #5900
Try to avoid touching default routes in dhclient-script which we
already partially do now.  PPPoE linkdown certainly doesn't need
to handle the file as well to remove the default route then.
2022-10-06 09:29:12 +02:00
Stephan de Wit
37fc19bfed unbound: move the removal of pluggable files above the configuration check
if bad input files are given, the root.key repair is triggered, which doesn't
make a lot of sense so just let unbound fail when this happens.

also remove the redirect to /dev/null to prevent possible file permission issues.
2022-10-04 12:10:00 +02:00
Franco Fichtner
b4979dc5eb unbound: stop testing staged changes
Not a lot of users for this manual testing script.  Only print
errors for current configuration.
2022-10-04 11:58:04 +02:00
Ad Schellevis
a9d81e3fd8 IPSec: move user PSK and legacy PSK items to new PSK mvc module. (https://github.com/opnsense/core/issues/4614)
o prevent migration issues when empty <mobilekey/> tags exists.
2022-10-04 11:33:33 +02:00
Stephan de Wit
9c9a15b9ec unbound: relocate preloading of blocklist cache to start.sh
It doesn't really make sense to let unbound.inc handle this, instead it should
be part of the staging script.
2022-10-04 11:27:23 +02:00
Franco Fichtner
f65d40f4bc interfaces: fix message, reserve last char for \0 2022-10-04 09:59:49 +02:00
Ad Schellevis
df6f7484a7 Revert "PSec: move user PSK and legacy PSK items to new PSK mvc module. (https://github.com/opnsense/core/issues/4614)"
This reverts commit eddb9128f72686e2222fe55109165f79560cf31c.
2022-10-04 09:41:23 +02:00
Ad Schellevis
eddb9128f7 PSec: move user PSK and legacy PSK items to new PSK mvc module. (https://github.com/opnsense/core/issues/4614)
Drop input mask as the legacy one allowed all characters.
2022-10-03 15:48:49 +02:00
Ad Schellevis
77569c29fb Firewall: NAT: Port Forward - php8 error when using any-{port} or {port}-any in destinations. fix local-port calculation 2022-10-03 15:27:00 +02:00
Stephan de Wit
e101c6040d unbound: maintain a consistent dnsbl cache state
In situations where a cache does not exist (mainly boot), a start/stop/restart of unbound
should make the system aware of the current dnsbl configuration in order to properly diff
on it. This includes unbound starting on boot.
2022-10-03 14:17:37 +02:00
Franco Fichtner
00bb9e273b src: style sweep 2022-10-02 21:08:34 +02:00
Ad Schellevis
9448b0cacc IPSec: move user PSK and legacy PSK items to new PSK mvc module. closes https://github.com/opnsense/core/issues/4614
There is some overlap in https://github.com/opnsense/core/issues/5636 as this cleans-up ipsec.conf further.
2022-10-02 19:49:21 +02:00
Ad Schellevis
7d672da990 Interfaces/Other Types/VLAN - constraint user input further for https://github.com/opnsense/core/issues/6038 to avoid future naming collisions. missed a spot in previous commit. 2022-10-02 16:27:47 +02:00
Ad Schellevis
2d74c6b641 Interfaces/Other Types/VLAN - constraint user input further for https://github.com/opnsense/core/issues/6038 to avoid future naming collisions. 2022-10-01 09:42:01 +02:00
Franco Fichtner
4f9e12c999 src: style sweep 2022-09-30 17:11:50 +02:00
Stephan de Wit
346cc08c99
Unbound: addition to advanced rework (#6053)
Small addition to https://github.com/opnsense/core/pull/6050:

- Move private/insecure domains to advanced as its intended use has a larger scope than DNSBLs only. Fixes https://github.com/opnsense/core/issues/5256
- Extends the migration to also include these domains.
- leftover cleanup of legacy settings in migration.
- Adds the `serve-expired-reply-ttl`, `serve-expired-ttl`, `serve-expired-ttl-reset`, `serve-expired-client-timeout` options. These options are hidden until the `serve-expired` checkbox is checked, and indented to signify a relationship.
- Removes all dropdowns and instead provides numeric fields to input raw values for more control and less "guessing" of what is acceptable.
- Removes default settings to prevent mismatches with upstream in the future. It's probably best to refer to the Unbound documentation in our own documentation.
- Previously, `rrset-cache-size` and `outgoing-range` were implicitly set. These are now input fields. The migration code will take care of legacy setting assumptions.

Fixes https://github.com/opnsense/core/issues/5978
Fixes https://github.com/opnsense/core/issues/5795
2022-09-30 17:08:34 +02:00
Franco Fichtner
9cf0b30348 system: redirect spurious error #6059 2022-09-30 10:11:12 +02:00
Franco Fichtner
e48fa6539f system: for recovery reasons can't depend on mwexec() #6059 2022-09-30 10:02:49 +02:00
Franco Fichtner
74238dec17 system: remove stray installer account since ba2da34854a
PR: https://github.com/opnsense/core/issues/6059
2022-09-30 09:27:03 +02:00
kulikov-a
e5bace2969
support setting type value via api call (#6054)
Closes https://github.com/opnsense/core/issues/6047
2022-09-30 09:22:32 +02:00
Franco Fichtner
073dd2ec6d system: avoid error on installer user creation
pw: no such user 'installer'
2022-09-30 09:07:37 +02:00
Franco Fichtner
c626b96117 src: style sweep 2022-09-29 15:37:37 +02:00
Ad Schellevis
e395da80b2 VPN: IPsec: Key Pairs : add generate button and support ECDSA type certificates.
closes https://github.com/opnsense/core/pull/5457 , https://github.com/opnsense/core/pull/5449
2022-09-29 15:33:22 +02:00
Franco Fichtner
c10cb5b0eb src: style sweep 2022-09-29 10:10:16 +02:00
Ad Schellevis
9d3364e718 VPN: IPsec: RSA Key Pairs: prevent model validation to change actual input contents as this can be highly confusing (and unexpected).
While here, simplify code as well, only store validation output (size, fingerprint) in model itself, although it would be cleaner to send this information via the controller (as overlay), it would mean duplicate work here.

Found while testing https://github.com/opnsense/core/issues/5636
2022-09-29 09:23:16 +02:00
Franco Fichtner
58f81a2064 firmware: clear license file if no subscription key is set
Tweak the external wording and position.  Seems convenient to
append to version, but ideally we add dynamic elements to the
bottom.
2022-09-29 08:39:50 +02:00
Franco Fichtner
6c43407860 system: structurally improve boot sequence #6052
In some cases early DNS works with direct upstream queries for
fixed DNS servers.  For DHCP or other dynamic connectivity it
will likely never work as expected with interface-related host
lookup requests.

At least try to load /etc/resolv.conf along with /etc/hosts and
refresh when all interface configuration is active.  This needs
to rely on running configuration to pick up DHCP and the like
as said before.
2022-09-28 15:03:28 +02:00
Franco Fichtner
65be7fb0a8 system: remove legacy syslog file 2022-09-28 14:47:49 +02:00
Ad Schellevis
dbba3223f7 Interfaces: Diagnostics: Packet Capture - don't pass 0 to tcp dump (zero equals no limit) 2022-09-27 19:21:25 +02:00
Franco Fichtner
6af75dd122 src: whitespace sweep 2022-09-27 14:48:46 +02:00
Stephan de Wit
f3e0e067ec fix file permissions 2022-09-27 14:34:02 +02:00
Stephan de Wit
33a253a748 unbound: finish up unbound/advanced MVC conversion 2022-09-27 14:34:02 +02:00
Stephan de Wit
d2b18299b4 unbound: advanced page MVC migration prep 2022-09-27 14:34:02 +02:00
Franco Fichtner
af9e9b48b7 system: wrap $g handling into a singleton
Adds a bit of code on the initialization but allows to trace the
information without magic globals.

Has been on the wishlist forever, but nowadays it's simple enough
to replace the few instances using it.
2022-09-27 11:07:49 +02:00
Franco Fichtner
15ac360559 system: avoid $g use if we have data already
Still don't like the appended line here but we will see how
this works in practice.
2022-09-27 11:06:14 +02:00