63 Commits

Author SHA1 Message Date
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
Franco Fichtner
9634dc64fc shell: make banner foreach a little more straight-forward 2018-11-13 11:19:45 +01:00
Franco Fichtner
01846ab2bb shell: use new network functions in banner 2018-11-12 14:58:23 +01:00
Franco Fichtner
6172beb8f4 src: useless globals 2018-11-12 14:44:44 +01:00
Franco Fichtner
05d1283508 dhcp: flip arguments for services_dhcpd_configure
Stop radvd in setport while there.
2018-10-31 15:07:53 +01:00
Franco Fichtner
a7dbe83957 version: improved crypto flavour reading
product_flavour is embedded in the release package but the
package itself does not insist on a particular flavour other
than having knowledge about the flavour the package was
built for originally.  This is ok and direct crypto deps
seem to have failed to produce reliable upgrade / sidegrade
results in recent tests anyway.

Long story short: find out the real crypto flavour installed
from the OpenSSL binary or fall back to the metadata if said
binary cannot be found.
2018-09-26 20:30:45 +02:00
Franco Fichtner
1fb52bace2 shell: obvious replacement for OPENSSL_VERSION_TEXT 2018-09-22 09:29:38 +02:00
Franco Fichtner
90296833f9 firmware: firmware-product, src/opnsense/version/opnsense, etc.
Now that we have metadata injection at build time read it instead
of its auxiliary files.  Allow live-mount to snoop the metadata and
afterwards we can start to marry the version and firmware-product
file.

Last puzzle piece will be a tool called "opnsense-version" to read
the JSON metadata and return it in a piecemeal fashion of a part
of the system requires that info, especially from the shell.
2018-09-16 20:38:15 +02:00
Franco Fichtner
574bd308be src: remove trailing dot workaround by removing trailing dots 2018-09-16 11:44:13 +02:00
Franco Fichtner
82d57c022c shell: mark iteration variable unused 2018-09-15 10:33:09 +02:00
Franco Fichtner
baa43590d7 src: remove get_configured_interface_with_descr()'s $withdisabled 2018-09-11 22:16:31 +02:00
Franco Fichtner
a35b40a4a7 src: remove unused $only_opt 2018-09-11 21:52:34 +02:00
Franco Fichtner
b8a651a931 shell: omit ":" from SSL fingerprint, asymmetry bugs me 2018-08-05 18:16:43 +02:00
Robin Schneider
3f86721ce3 Use openssh_enabled() in src/opnsense/scripts/shell/banner.php
This is only an improvement and unification of
`src/opnsense/scripts/shell/banner.php`.

Using `openssh_enabled()` both times in this file is preferred over one
time using `isset($config['system']['ssh']['enabled'])` and the other
time using `openssh_enabled()`.

Updates: 00f9b21cb78d9f76a8f94e8e62cbcefad65b7d99
Updates: 81e50abd0afba2d58ce487cdad60c7aedf899bbf
Updates: https://github.com/opnsense/core/pull/2481
2018-07-08 13:51:27 +02:00