Request for comments: C++ embedded webserver
Michael.E.Brown at dell.com
Michael.E.Brown at dell.com
Fri Dec 22 04:25:16 AEDT 2017
I'm new around here, so I didn't want to be the first to bring this up without doing my research on any older threads, so thank you for bringing this up.
My strong opinion is that golang is likely the best candidate for this specific type of programming environment (ie. OpenBMC).
- Low runtime memory usage
- Automatic Memory Management
- Clean cross compile for ARMv5 and above
- strongly typed
- Cleanly handles threading/async
- Nice standard library
I had prototyped a redfish server in golang enough to get to the point where I believe that it's the best solution. I have great things to say internally about the existing openbmc design: I love the use of DBUS, the more I look at it the more clearly the advantages seem to me. The nice thing about this is that golang has a DBUS library and we ought to be able to write different components in different languages freely, especially if we have the underlying dbus apis correct.
From: openbmc [mailto:openbmc-bounces+michael.e.brown=dell.com at lists.ozlabs.org] On Behalf Of Benjamin Herrenschmidt
Sent: Wednesday, December 20, 2017 6:34 PM
To: Tanous, Ed <ed.tanous at intel.com>; OpenBMC Maillist <openbmc at lists.ozlabs.org>
Subject: Re: Request for comments: C++ embedded webserver
On Tue, 2017-12-19 at 04:07 +0000, Tanous, Ed wrote:
> I’m looking for comments on a code review that’s been outstanding.
> One of the large pushes we’ve made is to attempt to make the web
> server more efficient, and add capabilities that comprehend long term
> needs of OpenBmc. One key that wasn’t made clear in the commit
> message is that it includes the basic redfish implementation that (we
> hope) should be extensible to the full redfish specification in the
> short term future.
There are plenty of existing HTTP server implementations out there that are well maintained, any reason why we should invent another one here ?
Also, do we really think perpetuating the use of that monstruosity masquerading as a programming language that is C++ is a good idea ?
> We would very much appreciate comments to see if we can move this forward.
> The following description is pulled from the readme.
> # OpenBMC webserver #
> This component attempts to be a "do everything" embedded webserver for openbmc.
> ## Capabilities ##
> At this time, the webserver implements a few interfaces:
> + Authentication middleware that supports cookie and token based authentication, as well as CSRF prevention backed by linux PAM authentication credentials.
> + An (incomplete) attempt at replicating phosphor-dbus-rest interfaces in C++. Right now, a few of the endpoint definitions work as expected, but there is still a lot of work to be done. The portions of the interface that are functional are designed to work correctly for phosphor-webui, but may not yet be complete.
> + Replication of the rest-dbus backend interfaces to allow bmc debug to logged in users.
> + An initial attempt at a read-only redfish interface. Currently the redfish interface targets ServiceRoot, SessionService, AccountService, Roles, and ManagersService. Some functionality here has been shimmed to make development possible. For example, there exists only a single user role.
> + SSL key generation at runtime. If an RSA key and cert pair are not available to the server at runtime, keys are generated using the openssl routines, and written to disk.
> + Static file hosting. Currently, static files are hosted from the fixed location at /usr/share/www. This is intended to allow loose coupling with yocto projects, and allow overriding static files at build time.
> + Dbus-monitor over websocket. A generic endpoint that allows UIs to
> + open a websocket and register for notification of events to avoid
> + polling in single page applications. (this interface may be
> + modified in the future due to security concerns.)
More information about the openbmc