1# OpenBMC webserver # 2 3This component attempts to be a "do everything" embedded webserver for openbmc. 4 5 6## Capabilities ## 7At this time, the webserver implements a few interfaces: 8+ Authentication middleware that supports cookie and token based authentication, as well as CSRF prevention backed by linux PAM authentication credentials. 9+ 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. 10+ Replication of the rest-dbus backend interfaces to allow bmc debug to logged in users. 11+ 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. 12+ SSL key generation at runtime. See the configuration section for details. 13+ 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. 14+ 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. 15 16## Configuration 17 18BMCWeb is configured by setting `-D` flags that correspond to options 19in `bmcweb/meson_options.txt` and then compiling. For example, `meson 20<builddir> -Dkvm=disabled ...` followed by `ninja` in build directory. 21The option names become C++ preprocessor symbols that control which code 22is compiled into the program. 23 24### Compile bmcweb with default options: 25```ascii 26meson builddir 27ninja -C builddir 28``` 29### Compile bmcweb with yocto defaults: 30```ascii 31meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled 32ninja -C buildir 33``` 34If any of the dependencies are not found on the host system during 35configuration, meson automatically gets them via its wrap dependencies 36mentioned in `bmcweb/subprojects`. 37 38### Enable/Disable meson wrap feature 39```ascii 40meson builddir -Dwrap_mode=nofallback 41ninja -C builddir 42``` 43### Generate test coverage report: 44```ascii 45meson builddir -Db_coverage=true -Dtests=enabled 46ninja coverage -C builddir test 47``` 48When BMCWeb starts running, it reads persistent configuration data 49(such as UUID and session data) from a local file. If this is not 50usable, it generates a new configuration. 51 52When BMCWeb SSL support is enabled and a usable certificate is not 53found, it will generate a self-sign a certificate before launching the 54server. The keys are generated by the `secp384r1` algorithm. The 55certificate 56 - is issued by `C=US, O=OpenBMC, CN=testhost`, 57 - is valid for 10 years, 58 - has a random serial number, and 59 - is signed using the `SHA-256` algorithm. 60 61