76 Commits

Author SHA1 Message Date
Franco Fichtner
ed6cd638ac system: create system_resolver_configure() to simplify callers
Replace a few easy spots.  Eventually we want to call both
functions for each spot instead of doing both (in switching order)
or only one of them.  They are both cheap operations since they
don't (re)start DNS processes any longer.
2023-03-01 08:56:16 +01:00
Franco Fichtner
0b04cc5efc system: deal with shell_exec() vs. trim() by wrapping all into shell_safe() 2023-01-31 09:01:12 +01:00
Franco Fichtner
20a60050ee system: run monitor reload inside system_routing_configure() #5956
Some call flows require this, others don't and on 22.7 we seem to miss
one that did.  Instead of adding more monitor reloads in the possible
spots move the ones that are shared into the general routing reload since
the two are almost always clustered together.

Also use the $interface argument to figure out which monitors require
reloading.  This will avoid quite a few spurious reloads on larger
setups.

Boot is a little special, but easy enough to ensure we don't call monitor
reload twice.
2022-08-19 11:03:31 +02:00
Franco Fichtner
85b223d00c interfaces: improve banner address return
primary will move to tracking interfaces or pick up any
SLAAC related address even though that is not being
actively configured.  Similar to the dashboard only print
the scoped address without the need to do the logic in
the caller.

Maybe we could even return the assigned prefix here for
clarity, but then the prefix isn't a reachable address.
2022-08-12 10:07:14 +02:00
Josh Soref
20a3c3da38
Spelling (#5885) 2022-07-18 13:59:03 +02:00
Franco Fichtner
8edb37042c interfaces: remove inconsistencies regarding ping utility 2022-07-18 09:16:11 +02:00
Franco Fichtner
b6167bfd90 system: move add_user script out of shell scripts
Shell scripts are for opnsense-shell.
2022-07-05 08:54:45 +02:00
Franco Fichtner
16042fe283 firmware: missing echo in previous 2022-07-01 10:40:51 +02:00
Franco Fichtner
b79153342c firmware: make sure to use the right approach #5537 2022-07-01 09:52:09 +02:00
Franco Fichtner
7d81b8ff16 firmare: first make sure we can grab an update version for #5537
Displaying changelogs requires a different menu flow but for now focus
on providing a changelog opportunistically before performing the update,
but intentionally after starting it to keep previous flow for now.
2022-07-01 09:50:15 +02:00
Franco Fichtner
789b777d46 system: try to boot without kernel message mute relics
They don't seem to work in some cases and aren't used a lot.
2022-02-15 09:48:48 +01:00
Franco Fichtner
00a86f74db interfaces: shorten list() action where we can 2022-02-02 22:58:39 +01:00
Franco Fichtner
18e87a510b interfaces: forgot these support returning the bits as well
Avoids having to do the split afterwards.
2022-02-02 22:43:11 +01:00
Franco Fichtner
76bb8b7d39 firmware: fix launcher invoke from shell menu 2021-12-08 08:28:18 +01:00
Franco Fichtner
f0aeb0eff1 interfaces: add all sorts of stuff to interfaces_addresses() #5086
It allows us to do post-processing on returned addresses for
e.g. #5086 alias parsing for unwanted automatic bind mode.
2021-09-22 11:12:12 +02:00
Franco Fichtner
9e44d9a1a9 ipsec: rewrite netmask calculation #5201
We need to make sure both the local and the remote IP belong to
the same CIDR range, which might not be the case if we just
calculate the subnet size required by their direct distance.

Rewrite find_smallest_cidr() to take an array of IPs to calculate
their smallest shared subnet mask.  Code is actually pretty simple
and fast.  However, we are not going to account for network and
broadcast address reservation unless that turns out to be an issue.

In the IPv6 case assume that /64 is a good approximation of the
result.

Remove code cruft in utilities while at it also replacing a simple
function only called once in setaddr.sh.
2021-09-16 09:54:33 +02:00
Ad Schellevis
4414ffd81b Authentication / LDAP (+TOTP), allow automatic user creation when configured. closes https://github.com/opnsense/core/issues/5116
o add "Automatic user creation" option in System/Access/Servers (for ldap + derivatives)
o simple detached flow, updatePolicies() calculates differences between local and remote group membership, when there is something to sync (remote groups exists) and a local user doesn't exist a configd signal is send to create a new empty user without rights and a random password.

The user_dn field isn't populated, although this will cost additional queries to the remote host, it might be worth the flexibility of allowing to move users to different auth scopes.
2021-08-17 19:33:25 +02:00
Franco Fichtner
b1241aeb74 shell: fix IPv4 /31 assignment
PR: https://forum.opnsense.org/index.php?topic=23878.0
2021-07-13 13:56:44 +02:00
Franco Fichtner
28fa452a47 firmware: fix comment on previous 2021-06-29 14:42:43 +02:00
Franco Fichtner
38578176e4 firmware: comment on compexity avoidance in shell menu
Fix plist while here.
2021-06-29 14:39:14 +02:00
Franco Fichtner
f845a4286a shell: fix restore copy; closes #5011 2021-05-26 10:16:54 +02:00
rawtaz
408ef03b6a
shell: Clarify revert to HTTP for web GUI question (#4992) 2021-05-17 18:42:36 +02:00
Franco Fichtner
6368a2bb6d firmware: that wasn't complete but now it is #4718 2021-02-23 09:10:43 +01:00
Franco Fichtner
a4ae9b3918 firmware: use launcher trick for these as well; closes #4718
So we get a message that the system is doing something else instead
of no message at all.
2021-02-23 08:49:12 +01:00
Franco Fichtner
eb6cbc0164 firmware: single spot for update/upgrade code #4718 2021-02-19 11:29:38 +01:00
Franco Fichtner
dc883ebbba firmware: moving ahead with opnsense-update change for 21.1.2 2021-02-19 11:05:06 +01:00
Franco Fichtner
c05c0411cb firmware: small refactor for neatness 2021-02-18 09:02:52 +01:00
Franco Fichtner
2ecd584c9a firmware: firmware-* files private to check.sh #4500
Remove unused JS while here.
2021-02-15 13:07:00 +01:00
Franco Fichtner
37664543e1 firmware: extent connectivity script, add to shell #4500
We can actually get rid of PIPEFILE if we do not need the
return value of the command.  More simplification on the
way.
2021-02-12 11:53:04 +01:00
Franco Fichtner
d91e308001 firmware: allow to run audits from firmware upgrade console option #4500
Type "s" for security audit, or "h" for health audit.

We don't add it to the option prompt to not clutter the menu flow.
This is mostly for debug and development purposes.
2021-01-16 16:25:33 +01:00
Franco Fichtner
62948343fe console: ignore first backup, same as current 2021-01-16 13:14:35 +01:00
Franco Fichtner
952637011e console: makes more sense #4572 2021-01-08 09:54:47 +01:00
Franco Fichtner
fb49c70e10 console: more questions, more recovery #4572
I see no easy way to untangle this for now.  At least make sure
the user is asked for the defaults to be restored making this
a little better than before.
2021-01-08 09:50:34 +01:00
Franco Fichtner
7216e3a241 system: allow self-signed renew for web GUI; closes #4567
The command to issue a reset is:

  # configctl webgui restart renew
2021-01-04 11:28:30 +01:00
Franco Fichtner
c8ad3c8b54 system: use different shell gateway name to appease wizard
PR: https://github.com/opnsense/core/issues/4347
2020-09-14 11:31:45 +02:00
Franco Fichtner
6323cb793f shell: use interfaces_primary_address6() for correct IPv6 display 2020-04-01 09:10:32 +02:00
Franco Fichtner
6db615b5bb shell: one isset() is enough 2020-02-18 10:10:57 +01:00
Ad Schellevis
1f1776260d setaddr.php: improve type checks. closes https://github.com/opnsense/core/issues/3939 2020-02-17 20:50:11 +01:00
Franco Fichtner
9f10421ac6 scripts: PSR12 style fixes test drive
Mostly spacing around = , + - etc with a dash of conditional
formatting madness, but rules are rules.
2019-10-07 16:17:37 +02:00
Ad Schellevis
e250b14ba7 console: banner, don't call ifconfig for each interface. one of the usability issues in https://github.com/opnsense/core/issues/3567
When there are a lot of interfaces, these calls consume quite some time and eventually the output of legacy_interfaces_details() is what matters to all of them.
2019-07-11 11:26:17 +02:00
Franco Fichtner
a8c82ea748 firmware: requirements grew unfortunately 2019-07-02 10:09:38 +02:00
Franco Fichtner
6018681623 dhcpd: more conversion, only services_dhcpd_configure() left 2019-04-29 08:05:15 +02:00
Franco Fichtner
ba0c82dd54 dhcpd: naming convention, plugins_configure() use 2019-04-29 07:49:26 +02:00
Franco Fichtner
04d4f50cca interfaces: separate dhcpd from services.inc 2019-04-28 15:07:10 +02:00
Franco Fichtner
8d0072e775 system: only use rrd where needed 2019-04-23 17:18:53 +02:00
Franco Fichtner
f3b5c0e8f7 system: hide dpinger configuration inside new plugins_configure() call
Some back and forth between explicit and implicit requires while here.
The code is helplessly glued together and no plugin facility to get
data from a function call currently exists.
2019-04-21 19:04:15 +02:00
Michael Steenbeek
5689dc8048 Port reboot and shutdown pages to MVC (#3133) 2019-01-15 09:25:52 +01:00
Michael Steenbeek
dbd1729595 Remove unreachable, unnecessary statements 2019-01-03 14:58:19 +01:00
Michael Steenbeek
d27cc83642 Change foreach loops that don't use values to use array_keys() 2018-12-18 14:37:11 +01:00
Michael Steenbeek
afcae6226a Clean up incorrect/unused variable assignments 2018-11-29 17:29:58 +01:00