fa2d6ae7 | 26-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Upgrade select alpn callback
nghttp2 has added a new callback[1] which solves the issue we were seeing previously with const. This cleans up some NOLINT markers, but should have no functional chang
Upgrade select alpn callback
nghttp2 has added a new callback[1] which solves the issue we were seeing previously with const. This cleans up some NOLINT markers, but should have no functional changes
[1] https://nghttp2.org/documentation/nghttp2_select_alpn.html#c.nghttp2_select_alpn
Tested:
Curl shows HTTP2 upgrade works properly.
* ALPN, offering h2 * ALPN, offering http/1.1 * ALPN, server accepted to use h2 * Using HTTP2, server supports multiplexing * Connection state changed (HTTP/2 confirmed)
Change-Id: Ic41754c58e6166aac22ed5afca5371661db959da Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
9ed3f90a | 15-Jul-2024 |
Ed Tanous <ed@tanous.net> |
Fix crash on subscriptions
When the subscription limit is hit, there is Subscription events generated when Subscription objects are constructed. Unfortunately, we make an accidental copy of the Sub
Fix crash on subscriptions
When the subscription limit is hit, there is Subscription events generated when Subscription objects are constructed. Unfortunately, we make an accidental copy of the Subscription object in include/persistent_data.hpp
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/72670
Is lined up to fix that issue, but we need to fix the underlying problem where we have memory safety issues in global variables.
This commit is something to fix the issue, by simply destroying the object causing the problem before more events can be received.
Tested: Followed instructions on the aforementioned commit to create the max number of subscriptions. Called systemctl restart bmcweb
Observed no more crash on shutdown.
Change-Id: Ie52545f5cb8a044c186d0e9db47362e170b1fdb5 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
b7f3a82b | 05-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Break out random ID methods
The method of creating a random ID from an openssl random generator of a particular length is something that is generally useful, and something we can write unit tests fo
Break out random ID methods
The method of creating a random ID from an openssl random generator of a particular length is something that is generally useful, and something we can write unit tests for. Add it.
Tested: Redfish service validator login flows work correctly in redfish service validator.
Change-Id: Ic3b58d33f1421f3eb39e2d57585958f87f6fb8ea Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
25b54dba | 17-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Bring consistency to config options
The configuration options that exist in bmcweb are an amalgimation of CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms and meson options usi
Bring consistency to config options
The configuration options that exist in bmcweb are an amalgimation of CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms and meson options using a config file. This history has led to a lot of different ways to configure code in the codebase itself, which has led to problems, and issues in consistency.
ifdef options do no compile time checking of code not within the branch. This is good when you have optional dependencies, but not great when you're trying to ensure both options compile.
This commit moves all internal configuration options to: 1. A namespace called bmcweb 2. A naming scheme matching the meson option. hyphens are replaced with underscores, and the option is uppercased. This consistent transform allows matching up option keys with their code counterparts, without naming changes. 3. All options are bool true = enabled, and any options with _ENABLED or _DISABLED postfixes have those postfixes removed. (note, there are still some options with disable in the name, those are left as-is) 4. All options are now constexpr booleans, without an explicit compare.
To accomplish this, unfortunately an option list in config/meson.build is required, given that meson doesn't provide a way to dump all options, as is a manual entry in bmcweb_config.h.in, in addition to the meson_options. This obsoletes the map in the main meson.build, which helps some of the complexity.
Now that we've done this, we have some rules that will be documented. 1. Runtime behavior changes should be added as a constexpr bool to bmcweb_config.h 2. Options that require optionally pulling in a dependency shall use an ifdef, defined in the primary meson.build. (note, there are no options that currently meet this class, but it's included for completeness.)
Note, that this consolidation means that at configure time, all options are printed. This is a good thing and allows direct comparison of configs in log files.
Tested: Code compiles Server boots, and shows options configured in the default build. (HTTPS, log level, etc)
Change-Id: I94e79a56bcdc01755036e4e7278c7e69e25809ce Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
36c0f2a3 | 09-Feb-2024 |
Ed Tanous <ed@tanous.net> |
Consolidate Vm implementations
As much as the two vm implementations SEEM different, the differences largely lie in how we're getting the nbd proxy socket. One is relying on launching a process (nb
Consolidate Vm implementations
As much as the two vm implementations SEEM different, the differences largely lie in how we're getting the nbd proxy socket. One is relying on launching a process (nbd-proxy), the other is getting the fd from dbus. Given [1] exists and is in process, we need to have a plan for getting these two VM implementations into one, once that patchset is complete.
This commit: Splits the vm-websocket option into vm-websocket-provider, providing two options, nbd-proxy, and virtual-media (the names of the respective apps). To accomplish this, it moves the contents of nbd-proxy into include/vm-websocket, so we can compare the similarities and start consolidating.
The longer term intent is that the nbd-proxy option will be completely removed, and the code deleted. This has the additional advantage that we will no longer require the boost::process dependency, as all info will be available on dbus.
As part of this, the nbd proxy websocket is also registered at /vm/0/0, to be backward compatible with the old interfaces.
Tested: Code compiles. Need some help here.
[1] https://gerrit.openbmc.org/c/openbmc/jsnbd/+/49944
Change-Id: Iedbca169ea40d45a8775f843792b874a248bb594 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
788fe748 | 22-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Remove XSS prevention code
This feature was created for a time before webpack had a built in proxy, and to debug the UI required setting specific flags. The webpack proxy solves this problem in a m
Remove XSS prevention code
This feature was created for a time before webpack had a built in proxy, and to debug the UI required setting specific flags. The webpack proxy solves this problem in a much better way, by proxying everything.
This commit is one piece in the solving a use after free bug. Removing this allows us to no longer have to cache the origin header [1], which is only used in this mode.
Tested: Code compiles.
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/70850
Change-Id: I01d67006e217c0c9fd2db7526c0ec34b0da068f3 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|