Add support for multiple consoles

This drop adds support for multiple consoles. The following changes are
made to achieve this.
- Kept the "/console0" route for backward compatibility
- Added a new route "/console/<str>" to support multiple consoles. All
  new consoles must use this route string.

Testing:
- Make sure that old console path /console0 is working.
 [INFO "http_connection.hpp":209] Request:  0x1bc2e60 HTTP/1.1
     GET /console0 ::ffff:x.x.xx.xxx
 [DEBUG "routing.hpp":1240] Matched rule (upgrade) '/console0' 1 / 2
 [DEBUG "obmc_console.hpp":212] Connection 0x1bdb67c opened
 [DEBUG "obmc_console.hpp":241] Console Object path =
    /xyz/openbmc_project/console/default service =
    xyz.openbmc_project.Console.default Request target = /console0
 [DEBUG "obmc_console.hpp":198] Console web socket path: /console0
    Console unix FD: 12 duped FD: 13
 [DEBUG "obmc_console.hpp":82] Reading from socket
 [DEBUG "obmc_console.hpp":162] Remove connection 0x1bdb67c from
    obmc console

- Make sure that new path for default console working
 [INFO "http_connection.hpp":209] Request:  0x1bd76a8 HTTP/1.1
    GET /console/default ::ffff:x.x.xx.xxx
 [DEBUG "routing.hpp":1240] Matched rule (upgrade) '/console/<str>'
     1 / 2
 [DEBUG "obmc_console.hpp":212] Connection 0x1baf82c opened
 [DEBUG "obmc_console.hpp":241] Console Object path =
    /xyz/openbmc_project/console/default service =
    xyz.openbmc_project.Console.default Request
    target = /console/default
 [DEBUG "obmc_console.hpp":198] Console web socket path:
    /console/default Console unix FD: 12 duped FD: 13
 [DEBUG "obmc_console.hpp":82] Reading from socket
 [INFO "obmc_console.hpp":154] Closing websocket. Reason:
 [DEBUG "obmc_console.hpp":162] Remove connection 0x1baf82c from
    obmc console

- Make sure that path for hypervisor console is working.
 [INFO "http_connection.hpp":209] Request:  0x1bc2e60 HTTP/1.1
    GET /console/hypervisor ::ffff:x.x.xx.xxx
 [DEBUG "routing.hpp":1240] Matched rule (upgrade) '/console/<str>'
     1 / 2
 [DEBUG "obmc_console.hpp":212] Connection 0x1bc5234 opened
 [DEBUG "obmc_console.hpp":241] Console Object path =
    /xyz/openbmc_project/console/hypervisor service =
    xyz.openbmc_project.Console.hypervisor Request
    target = /console/hypervisor
 [DEBUG "obmc_console.hpp":198] Console web socket path:
    /console/hypervisor Console unix FD: 12 duped FD: 13
 [DEBUG "obmc_console.hpp":82] Reading from socket
 [INFO "obmc_console.hpp":154] Closing websocket. Reason:
 [DEBUG "obmc_console.hpp":162] Remove connection 0x1bc5234 from
    obmc console

- Make sure that bad console path is failing properly due to DBUS error.
 [INFO "http_connection.hpp":209] Request:  0x1bd76a8 HTTP/1.1
    GET /console/badconsoleid ::ffff:x.x.xx.xxx
 [DEBUG "routing.hpp":1240] Matched rule (upgrade) '/console/<str>'
     1 / 2
 [DEBUG "obmc_console.hpp":212] Connection 0x1bdb67c opened
 [DEBUG "obmc_console.hpp":241] Console Object path =
    /xyz/openbmc_project/console/badconsoleid service =
    xyz.openbmc_project.Console.badconsoleid Request
    target = /console/badconsoleid
 [ERROR "obmc_console.hpp":174] Failed to call console Connect()
    method DBUS error: No route to host

Change-Id: I9b617bc51e3ddc605dd7f4d213c805d05d2cfead
Signed-off-by: Ninad Palsule <ninad@linux.ibm.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
3 files changed
tree: 3a49a0c10880036e6082e1d90d715dfa73ad484f
  1. .github/
  2. config/
  3. http/
  4. include/
  5. redfish-core/
  6. scripts/
  7. src/
  8. static/
  9. subprojects/
  10. test/
  11. .clang-format
  12. .clang-tidy
  13. .dockerignore
  14. .gitignore
  15. .markdownlint.yaml
  16. .openbmc-enforce-gitlint
  17. .prettierignore
  18. .shellcheck
  19. AGGREGATION.md
  20. CLIENTS.md
  21. COMMON_ERRORS.md
  22. DBUS_USAGE.md
  23. DEVELOPING.md
  24. HEADERS.md
  25. LICENSE
  26. meson.build
  27. meson_options.txt
  28. OEM_SCHEMAS.md
  29. OWNERS
  30. README.md
  31. Redfish.md
  32. run-ci
  33. setup.cfg
  34. TESTING.md
README.md

OpenBMC webserver

This component attempts to be a "do everything" embedded webserver for OpenBMC.

Features

The webserver implements a few distinct interfaces:

  • DBus event websocket. Allows registering on changes to specific dbus paths, properties, and will send an event from the websocket if those filters match.
  • OpenBMC DBus REST api. Allows direct, low interference, high fidelity access to dbus and the objects it represents.
  • Serial: A serial websocket for interacting with the host serial console through websockets.
  • Redfish: A protocol compliant, DBus to Redfish translator.
  • KVM: A websocket based implementation of the RFB (VNC) frame buffer protocol intended to mate to webui-vue to provide a complete KVM implementation.

Protocols

bmcweb at a protocol level supports http and https. TLS is supported through OpenSSL.

AuthX

Authentication

Bmcweb supports multiple authentication protocols:

  • Basic authentication per RFC7617
  • Cookie based authentication for authenticating against webui-vue
  • Mutual TLS authentication based on OpenSSL
  • Session authentication through webui-vue
  • XToken based authentication conformant to Redfish DSP0266

Each of these types of authentication is able to be enabled or disabled both via runtime policy changes (through the relevant Redfish APIs) or via configure time options. All authentication mechanisms supporting username/password are routed to libpam, to allow for customization in authentication implementations.

Authorization

All authorization in bmcweb is determined at routing time, and per route, and conform to the Redfish PrivilegeRegistry.

*Note: Non-Redfish functions are mapped to the closest equivalent Redfish privilege level.

Configuration

bmcweb is configured per the meson build files. Available options are documented in meson_options.txt

Compile bmcweb with default options

meson setup builddir
ninja -C builddir

If any of the dependencies are not found on the host system during configuration, meson will automatically download them via its wrap dependencies mentioned in bmcweb/subprojects.

Use of persistent data

bmcweb relies on some on-system data for storage of persistent data that is internal to the process. Details on the exact data stored and when it is read/written can seen from the persistent_data namespace.

TLS certificate generation

When SSL support is enabled and a usable certificate is not found, bmcweb will generate a self-signed a certificate before launching the server. Please see the bmcweb source code for details on the parameters this certificate is built with.

Redfish Aggregation

bmcweb is capable of aggregating resources from satellite BMCs. Refer to AGGREGATION.md for more information on how to enable and use this feature.