59 Commits

Author SHA1 Message Date
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
Franco Fichtner
45bd265180 shell: print(f) to echo where possible
Spotted by: @fabianfrz
2018-07-06 21:01:29 +00:00
Franco Fichtner
81e50abd0a shell: when in live mode ssh, also show SSH fingerpints 2018-07-06 20:38:53 +00:00
Franco Fichtner
00f9b21cb7 shell: pretty-print the SHA256 sums for the banner 2018-07-06 20:31:49 +00:00
Robin Schneider
d1e90d3cee Print SSH and X.509 fingerprints in console banner without need to login (#2481)
Example output:

```
$ /usr/local/etc/rc.initial.banner

*** test-fw.localdomain: OPNsense 18.1.10 (amd64/OpenSSL) ***

 WAN (vtnet0)    -> v4/DHCP4: 172.30.23.2/24

 SSH: 256 SHA256:fcMIAgT/vZR/TWP0j8AFROTNnudkU1tP9sRhbsIa8vM (ECDSA)
 SSH: 256 SHA256:lDenOc5wy2WU0e6sSz2hR9nEFnMqx5c3u1F/pHxgJlY (ED25519)
 SSH: 2048 SHA256:dsw9srlQHL0hPJlEdR9rL769N30BTZgXG9gXbdZGOkU (RSA)
 HTTPS X.509 cert: SHA256 Fingerprint=F0:E6:EB:31:E8:87:AF:52:16:4E:84:05:3B:6C:03:2C:C1:DF:5A:E7:36:F4:32:44:3B:B5:57:63:97:45:C3:77
```

The list of fingerprints is appended after the interface list because
the interface list might be pretty long and thus would move the
fingerprints out of the screen which we don’t want.

Previously (#2427) I suggested to extract the X.509 certificate from the
xml config but the difficult part for me who is not so familiar with the
implementation of OPNsense is to find the certificate which is actually
used by the local web server. I found that `/var/etc/cert.pem` is used
in the configuration of the local web server and assume that this is the
easier way to implement this in the expectation that the file name does
not change without being also changed in this script and that the file
exists. If it does not exist, OpenSSL would complain with a useful error
message.

This commit is one piece to make fully trusted bootstrapping easier.
Related to: https://github.com/opnsense/core/issues/2427
Tested on: OPNsense 18.1.10-amd64
2018-07-06 21:55:15 +02:00