summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)AuthorFilesLines
2020-05-08Redfish: Log service implementation for system dumpraviteja-b1-0/+8
Dump is the debug data collected at any point of time from the system and is stored in a file Currently, Redfish doesn't have schema for operations on debug data(dump). This commit implements logService for system dump. we have a DMTF proposal to extend existing LogService schema for this purpose but its still work in progress, so moved to oem schema. below commit has changes to move properties to OEM https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/30352 Tested By: GET https://${IP}/redfish/v1/Systems/system/LogServices/SystemDump DELETE https://${IP}/redfish/v1/Systems/system/LogServices/SystemDump/Entries/<id> Redfish validator passed. (above mentioned commit required to pass validator). Change-Id: I4a4a4083be4556bc46a4335d31ce56f834bd4f5a Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
2020-04-24EventService: Manager and subscriptions supportAppaRao Puli1-0/+7
Add EventService Manager which will manage all the EventService configuration and subscriptions. This includes API for add or update or delete subscriptions along with other supported API support. Also includes http connection open and send event code using "push style eventing". Added BMCWEB_INSECURE_HTTP_PUSH_STYLE_EVENTING build flag to enable/disable http push style eventing which is not a secure channel. Tested: - Tested along with other patches such as http client and Event log support, SubmitTestEvent and its works. - Ran Redfish validation successfully. Change-Id: Ie4687e4cbfabd525b7a8ad4e615510f034edc6e9 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-04-08Rest service root implementationRatan Gupta1-0/+9
This commit introduces the following => Service root implementation => compiler option for the IBM management console specific functionalities TestedBy: curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/ibm/v1 Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com> Change-Id: I2dcb8eee0b69b1723e0cc3d980a5846b3519e7d9
2020-03-14Allow unrestricted sensor override through flagjayaprakash Mutyala1-4/+12
Allow overriding sensor values without any restriction based on BMCWEB_INSECURE_UNRESTRICTED_SENSOR_OVERRIDE flag Tested: 1. Redfish validator - passed for this new change 2. Verified for BMCWEB_ENABLE_VALIDATION_UNSECURE_FEATURE is OFF and BMCWEB_INSECURE_UNRESTRICTED_SENSOR_OVERRIDE is ON Case 1: 1. Enable manufacturing mode by pressing power button while bmc booting 2. Patch sensor values from Redfish. Redfish URI: PATCH https://<BMC-IP>/redfish/v1/Chassis/WC_Baseboard/Thermal Body: { "Temperatures": [ { "MemberId": "SSB_Temp", "ReadingCelsius":112 } ] } Response: { "@odata.id": "/redfish/v1/Chassis/WC_Baseboard/Thermal", "@odata.type": "#Thermal.v1_4_0.Thermal", "Fans": [], "Id": "Thermal", "Name": "Thermal", "Temperatures": [] } 3. Sensor value Overridden successfully Case 2: Verified for ValidationUnsecure mode. Case 3: Tested without SpecialMode mode 1. Stop the specialmodemgr.service service 2. Patch sensor values from Redfish. 3. Sensor value Overridden successfully Case 4: 1. Disable manufacturing mode Command: ipmitool raw 0x30 0xB4 3 0 Response: //Success 2. Patch sensor values from Redfish. 3. Sensor value Overridden successfully Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I0557cc88d2aceebade4b78e4478e17feecb6e088
2020-03-09Allow sensor value override in mfg mode onlyjayaprakash Mutyala1-0/+7
Issue: User is able to override sensor value even though system is not in manufacturing mode Fix: Code changes are done to patch sensor values when system is only in manufacturing Mode. Tested: 1. Redfish validator - passed for this new change Case 1: 1. Enable manufacturing mode by pressing power button while bmc booting 2. Patch sensor values from Redfish. Redfish URI: PATCH https://<BMC-IP>/redfish/v1/Chassis/WC_Baseboard/Thermal Body: { "Temperatures": [ { "MemberId": "SSB_Temp", "ReadingCelsius":112 } ] } Response: { "@odata.id": "/redfish/v1/Chassis/WC_Baseboard/Thermal", "@odata.type": "#Thermal.v1_4_0.Thermal", "Fans": [], "Id": "Thermal", "Name": "Thermal", "Temperatures": [] } 3. Sensor value Overridden successfully Case 2: Varified for ValidationUnsecure mode. Case 3: Tested without SpecialMode mode 1. Stop the specialmodemgr.service service 2. Patch sensor values from Redfish. 3. Sensor value Overridden successfully Case 4: 1. Disable manufacturing mode Command: ipmitool raw 0x30 0xB4 3 0 Response: //Success 2. Patch sensor values from Redfish. Redfish URI: PATCH https://<BMC-IP>/redfish/v1/Chassis/WC_Baseboard/Thermal Body: { "Temperatures": [ { "MemberId": "SSB_Temp", "ReadingCelsius":112 } ] } 3. Returning proper error. Response : { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The action Overriding of Sensor Value for non manufacturing mode is not supported by the resource.", "MessageArgs": [ "Overriding of Sensor Value for non manufacturing mode" ], "MessageId": "Base.1.4.0.ActionNotSupported", "Resolution": "The action supplied cannot be resubmitted to the implementation. Perhaps the action was invalid, the wrong resource was the target or the implementation documentation may be of assistance.", "Severity": "Critical" } ], "code": "Base.1.4.0.ActionNotSupported", "message": "The action Overriding of Sensor Value for non manufacturing mode is not supported by the resource." } } Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I34cd53fba939fb367310c531a050792ef749dd70
2020-01-27InsertMedia and EjectMedia actions added to VirtualMedia schemaPrzemyslaw Czarnowski1-0/+1
As continuation for VirtualMedia Redfish support, this patch adds insertion and eject actions into existing VirtualMedia code base. Testing: * Manual tests together with nbd proxy and virtual media app - For requests: Postman and/or HTTPie, with logs enabled and Valgrind) - Manual result validation * Tests run: - GET on collection with manual validation - PUT/POST/DELETE on collection - GET on item/nonexistent item - PUT/POST/DELETE on item - GET/PUT/DELETE on action - POST on action - EjectMedia/InsertMedia, legacy mode - POST on action - InsertMedia, proxy mode - POST on action - input validation (empty, invalid URL), legacy mode * Redfish Service Validator tested, no new issues found. Change-Id: Icccc433c1e84bc2ac37d9c295fe72749187fb735 Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2019-12-19Make the max http request body size configurableAdriana Kobylak1-0/+3
OpenBMC supports "System" or "bundled" images that contain two or more firmware images, such as BMC and Host or PSU firmware, making the resulting image file greater than the current limit of 30MB. Make the http request body size configurable to allow bigger files to be uploaded. Tested: - Upload a regular BMC image still works. - Uploading a 50MB firmware image that contains the host fw fails: $ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T obmc-phosphor-image-witherspoon-128.ubi.mtd.tar https://${bmc}/upload/image curl: (52) Empty reply from server - With the "-DBMCWEB_HTTP_REQ_BODY_LIMIT_MB=128" compile option works: $ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T obmc-phosphor-image-witherspoon-128.ubi.mtd.tar https://${bmc}/upload/image { "data": "19e6fe13", "message": "200 OK", "status": "ok" } Change-Id: I0b0e1032c9daf00a01e42ac5ee1c0d979f857d5e Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2019-12-19Turning ON the mutual TLSZbigniew Kurzynski1-1/+1
This commit sets the mutual TLS option to ON by default. Core mTLS implementation was accepted under this commit: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/23588 where by default the mTLS was disabled. Tested: Manual tests were made to verify if this option turns the mTLS ON. Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com> Change-Id: I3bc5f5453d4c4df1cd7ecb0b8868423285b6ab83
2019-11-21Implement nbd-proxy as a part of bmcwebIwona Klimaszewska1-0/+6
Nbd-proxy is responsible for exposing websocket endpoint in bmcweb. It matches WS endpoints with unix socket paths using configuration exposed on D-Bus by Virtual-Media. Virtual-Media is then notified about unix socket availability through mount/unmount D-Bus methods. Currently, this feature is disabled by default. Tested: Integrated with initial version of Virtual-Media. Change-Id: I9c572e9841b16785727e5676fea1bb63b0311c63 Signed-off-by: Iwona Klimaszewska <iwona.klimaszewska@intel.com> Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2019-11-11Fix tabbing in CMakeLists.txtEd Tanous1-22/+22
In a recent format, the tabbing was made strange tabbing decisions. Luckily, cmake-format doesn't change them after the fact when re-run, so fix it. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I95f21f47f84a917a1104d92f8f55603c70cd927c
2019-11-08TLS based user auth implementationKowalski, Kamil1-0/+15
Implemented TLS based user auth. It utilizes certificates stored by Phosphor Certificate Manager in storage mode, to verify that user that tries to log in, has a certificate signed by a trusted CA. More about this can be read in redfish-tls-user-authentication.md design document. Tested that it does not break current authentication methods, when not using TLS Auth - user should not see difference between versions. TLS Auth itself allows user in when certificate is signed by trusted CA and valid, and stops working immediatley after it is removed. User is not let in when provided certificate is not between notBefore and notAfter dates. Session is tested to not be created when user does not exist in the system (courtesy of earlier UserManagement usage commits). Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com> Change-Id: I6bcaff018fe3105f77d3c10f69765e0011af8dab Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com>
2019-11-06Update required version of boost to 1.71Ed Tanous1-1/+1
Considering that we use some of the latest features of boost, the code no longer compiles with older versions. Update the CMakeLists.txt to reflect that. Tested: Code compiles. No functional change. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I583234523e29087b95bf3e4ca70c4f7dcfed36f6
2019-10-30Added OemComputerSystems and properties for provisioningAppaRao Puli1-0/+8
- Added OemComputerSystems Schema for provisioning properties - Added "ProvisioningStatus" Oem property with EnumType 1) NotProvisioned 2) ProvisionedButNotLocked 3) ProvisionedAndLocked Intel secures platform firmware components using Intel PFR mechanism. This may differ for other Oem's(non-intel platforms) but the properties like Provisioned, Locked states should be of generic as per NIST SP 800-193. Added build time flag to enable/disable PFR supported platforms. Tested: - By default provisioning feature is OFF, using GET method on below URI verified Oem Property and observed no such property. This is default behaviour on upstream. URI: /redfish/v1/Systems/system Response: No "Oem" property. - Enabled provisioning feature in Intel platforms and Verified using Systems URI. Ran the redfish validator tool and no new issues found due to this change. URI: /redfish/v1/Systems/system RESPONSE: ..... "Oem": { "OpenBmc": { "FirmwareProvisioning": { "ProvisioningStatus": "NotProvisioned" } } } ..... Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Change-Id: I674e6075263f4fa2962637d3add47393a1ff0c0b
2019-10-21rerun cmake-formatJames Feist1-116/+155
This file has gotten pretty un-formatted. Change-Id: I227bf5a7cf4fa38f28d7147fc1b210d5a22ed2a2 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-10-18Make references to crow less obviousEd Tanous1-1/+1
Recently, a number of people in the community have made the (admittedly easy) mistake that we use a significant portion of crow. Today, we use crow for the router, and the "app" structure, and even those have been significantly modified to meet the bmc needs. All other components have been replaced with Boost beast. This commit removes the crow mentions from the Readme, and moves the crow folder to "http" to camouflage it a little. No code content has changed. Tested: Code compiles. No functional change made to any executable code. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iceb57b26306cc8bdcfc77f3874246338864fd118
2019-10-11Fix a bunch of warningsEd Tanous1-11/+49
using the list of warnings from here: https://github.com/lefticus/cppbestpractices/blob/e73393f25a85f83fed7399d8b65cb117d00b2231/02-Use_the_Tools_Available.md#L100 Seems like a good place to start, and would improve things a bit type-wise. This patchset attempts to correct all the issues in one shot. Tested: It builds. Will test various subsystems that have been touched Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I588c26440e5a97f718a0f0ea74cc84107d53aa1e
2019-06-26simpleupdate: Basic support of SimpleUpdateAndrew Geissler1-0/+5
This is TFTP only since that is all the OpenBMC back end currently supports Design Doc Ref: https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/20700 Tested: 1) Verified BMC image update via new SimpleUpdate interface worked curl -k -H "X-Auth-Token: $TOKEN" -d '{"ImageURI":"XXX.XX.X.X/obmc-phosphor-image-witherspoon.ubi.mtd.tar","TransferProtocol":"TFTP"}' -X POST https://${BMC_IP}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.4.0.Success", "Resolution": "None", "Severity": "OK" } ] } 2) Verified encoding the protocol in ImageURI worked curl -k -H "X-Auth-Token: $TOKEN" -X POST https://${BMC_IP}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate -d '{"ImageURI":"tftp://${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar"}' { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.4.0.Success", "Resolution": "None", "Severity": "OK" } ] } Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Enter UpdateService.SimpleUpdate doPost Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Encoded transfer protocol tftp Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Adjusted imageUri ${BMC_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Server: ${TFTP_IP} File: obmc-phosphor-image-witherspoon.ubi.mtd.tar Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Exit UpdateService.SimpleUpdate doPost 3) Verified if no transfer protocol, error returned curl -k -H "X-Auth-Token: $TOKEN" -X POST https://${BMC_IP}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate -d '{"ImageURI":”${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar"}' { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The value ${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar for the parameter ImageURI in the action UpdateService.SimpleUpdate is of a different type than the parameter can accept.", "MessageArgs": [ “${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar", "ImageURI", "UpdateService.SimpleUpdate" ], "MessageId": "Base.1.4.0.ActionParameterValueTypeError", "Resolution": "Correct the value for the parameter in the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ], "code": "Base.1.4.0.ActionParameterValueTypeError", "message": "The value ${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar for the parameter ImageURI in the action UpdateService.SimpleUpdate is of a different type than the parameter can accept." } } 4) Verified no new error in Redfish Validator 5) Verified error return when parameter missing: curl -k -H "X-Auth-Token: $TOKEN" -d '{"TransferProtocol":"TFTP"}' -X POST https://${BMC_IP}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate { "ImageURI@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The property ImageURI is a required property and must be included in the request.", "MessageArgs": [ "ImageURI" ], "MessageId": "Base.1.4.0.PropertyMissing", "Resolution": "Ensure that the property is in the request body and has a valid value and resubmit the request if the operation failed.", "Severity": "Warning" } ] } 6) Verified that by default, the new Action is not available Change-Id: I67ea91e181380e6da7ff63a37f02408a318602b7 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2019-05-21vm_websocket: Add websocket handlerAdriana Kobylak1-0/+4
On receiving a websocket request on endpoint /vm/0/0, connect to the nbd-proxy app and send/receive stdio. Tested: Verified that the host could see the virtual media usb device, mounted it manually and checked the contents of the iso file used for the test were there. To test, used the html and js script: https://github.com/openbmc/jsnbd/tree/master/web and an Ubuntu iso image file. Verified that it worked after closing the websocket (using the stop function from the html file), to check that the processes were cleaned up and freed up for a subsequent request. Change-Id: I0b070310b070c086d67d0ae3e2c165551d6b87cc Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2019-05-09Redfish: Remove BMCWEB_ENABLE_REDFISH_ONE_CHASSISShawn McCarney1-4/+0
Removed the BMCWEB_ENABLE_REDFISH_ONE_CHASSIS #define. The new support for finding chassis sensors via associations is now used on all systems. Test Plan: https://gist.github.com/smccarney/f5b4783d8cf41a486ceff9b941b1ba9a Tested: Verified the Chassis, Power, and Thermal output was valid on a Witherspoon system. Verified sensor associations on Witherspoon work with bmcweb implementation. Ran Redfish Service Validator. Change-Id: I975f79da2c9de63e4ddd155d39ea872ca9fbffa9 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
2019-04-24CMakeLists.txt: Remove BOOST_ASIO_NO_DEPRECATEDAdriana Kobylak1-1/+2
Comment out the BOOST_ASIO_NO_DEPRECATED flag until Yocto moves to Boost 1.70 (currently at 1.69), since it breaks boost/process.hpp which is used for the Virtual Media enpoint. Reference: - https://github.com/boostorg/process/issues/29 - https://github.com/boostorg/process/pull/67 Tested: Verified that the virtual media commit that includes boost/process.hpp compiles and the interface still works as expected. Change-Id: Iffc53c260a44947a0891822ec00a1562849e7ae2 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2019-04-22Change application and interface names to CrashdumpJason M. Bills1-1/+1
Crashdump is the preferred name, so replace all uses of CPU Log with Crashdump. Tested: On-demand crashdump functions correctly Change-Id: I6cf8fb81bc8f2e85dd4a3561835f3fafbff764e5 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-04-22Add systemd unit filesBrad Bishop1-0/+13
Add bmcweb.socket, a systemd unit file that enables systemd socket activation of bmcweb. Systemd socket activation defers startup of socket listening applications until something connects to the socket. There are presently no configurable parameters in bmcweb.socket. Add bmcweb.service, a systemd unit file for starting bmcweb. bmcweb.service has one configurable parameter, the installation prefix. Prior these unit files were hosted in the meta-phosphor repository but OpenBMC is moving away from unit-files-in-metadata and trying to do it the way the rest of the world does it - unit files are provided by the projects that contain the application source. The unit files were copied mostly verbatim (minor update for installation prefix in bmcweb.service template) so the only new logic here is in the cmake logic. Tested by: 1 - devtool add bmcweb. 2 - apply this diff to bmcweb_git.bb: -inherit obmc-phosphor-systemd +inherit systemd 3 - bitbake bmcweb. 4 - manual inspection of the image dir in the yocto build tree. Change-Id: I61b49d519f5b4eb06e97a14d4f6707344e544434 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2019-04-05Initial redfish logging supportAndrew Geissler1-0/+5
This was imported from a fork: https://github.com/ampere-openbmc/bmcweb/commits/ampere-next/redfish-core/lib/logservices.hpp Which had a series of commits from TungVuX and hyche The initial patch is that code verbatim. Follow up patches on top of this make the necessary changes for current bmcweb: - Move to sdbusplus - C++ naming convention changes - Clang format - Some refactoring Tested: Verified new services work correctly when queried e.g. curl -k -H "X-Auth-Token: $bmc_token" -X GET \ https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/Entries displays the entries properly. RedfishServiceValidator results: /redfish/v1/Systems/system/LogServices pass: 3 passGet: 1 skipOptional: 1 /redfish/v1/Systems/system/LogServices/EventLog pass: 5 passGet: 1 skipOptional: 8 /redfish/v1/Systems/system/LogServices/EventLog/Entries pass: 3 passGet: 1 skipOptional: 1 /redfish/v1/Systems/system/LogServices/EventLog/<str> pass: 6 passGet: 1 skipOptional: 16 Sample Output: curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/Entries { "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCollection", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries", "@odata.type": "#LogEntryCollection.LogEntryCollection", "Description": "Collection of System Event Log Entries", "Members": [ { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2019-02-22T17:11:00+00:00", "EntryType": "Event", "Id": "1", "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", "Name": "System DBus Event Log Entry", "Severity": "Critical" } ], "Members@odata.count": 1, "Name": "System Event Log Entries" } Change-Id: I422b0d0ec577ea734fecfb6f49101ec5ff45a556 Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Signed-off-by: Anthony Wilson <wilsonan@us.ibm.com>
2019-03-29update ASIO interfacesEd Tanous1-0/+1
This commit does 2 things. 1. Upgrades and prepares bmcweb for boost 1.70. 2. Allows us to compile with BOOST_AIO_NO_DEPRECATED Tested: Compiled against 1.69 and 1.70. All changes should be no-op. Change-Id: I557ecd840fe2b88c0fa01978a1b666b40ccccca4 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2019-03-25Revert "bmcweb: Fix a bunch of warnings"Ed Tanous1-1/+1
This reverts commit 6ea007a2faec52ad62680015d2a3f00371a1e351. Reason for revert: Reports of bmcweb seg faults. Change-Id: I408f1bb29c2f8e427a6621cdaac8c31b847ebf06
2019-03-23bmcweb: Fix a bunch of warningsEd Tanous1-1/+1
bmcweb classically has not taken a strong opinion on warnings. With this commit, that policy is changing, and bmcweb will invoke the best warnings we are able to enable, and turn on -Werror for all builds. This is intended to reduce the likelihood of hard-to-debug situations that the compiler coulve caught early on. Change-Id: I57474410821e82666b3a108cfd0db7d070e8900a Signed-off-by: Ed Tanous <ed@tanous.net>
2019-03-13Add BMCWEB_ENABLE_REDFISH_ONE_CHASSIS build optionGunnar Mills1-0/+4
Define a new build option named BMCWEB_ENABLE_REDFISH_ONE_CHASSIS that is not set by default. When this build option is set, bmcweb will always return a single chassis named "chassis". Setting this option will also cause all sensors to be shown under this chassis. This is a short-term solution. Long term, inventory-manager needs to be enhanced to allow sensors to be under a chassis, or the rest of the project needs to move to EntityManager. Currently IBM does not use EntityManager, but EntityManager is called directly in sensors.hpp. This results in an HTTP 500 Internal Server Error. Tested: The URLs /redfish/v1/Chassis/ and /redfish/v1/Chassis/chassis show correct data on a Witherspoon. /redfish/v1/Managers/bmc/ now has a link to the single chassis. /redfish/v1/Chassis/chassis/Power and /redfish/v1/Chassis/chassis/Thermal no longer result in an HTTP 500 Internal Server Error. Ran Redfish Service Validator. Change-Id: Iec8f4da333946f19330f37ab084cd9787c52c8ea Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
2019-03-07bmcweb: /s/boost::string_view/std::string_view/gEd Tanous1-0/+1
With boost 1.69, we get the new option, BOOST_BEAST_USE_STD_STRING_VIEW which allows us to use std::string for all beast interfaces, instead of boost string_view. This was originally intended to try to reduce the binary size, but the comparison shows only a minor improvement. boost::string_view: 7420780 bytes std::string_view: 7419948 bytes 832 bytes saved ! ! ! ! ! So instead, we will use the argument that it's more standard and easier for people to grok. Tested By: Pulled down some bmcweb endpoints, and observed no change. Because the two objects are essentially drop in replacements for one another, there should be no change. Change-Id: I001e8cf2a0124de4792a7154bf246e3c35ef3f97 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2019-02-21Implement KVM websocket proxy in bmcwebEd Tanous1-4/+1
This patchset implements a KVM websocket proxy designed to interoperate with phosphor-webui and KVM. in short, IP address 127.0.0.1:5900 is proxied to the websocket. This allows someone to connect from a browser session. Requires patchset here for the phosphor-webui side: https://gerrit.openbmc-project.xyz/#/c/openbmc/phosphor-webui/+/10268/ and requires the kvm patches here: https://gerrit.openbmc-project.xyz/#/c/openbmc/meta-phosphor/+/13536/ Tested By: Launched webui, observed KVM. Moved mouse, and typed on keyboard, changes appeared on host system. Change-Id: I407488f4b16be208b188a0abc19954a0243af173 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2019-02-20Move the CPU LogService to SystemsJason M. Bills1-2/+2
The CPU LogService doesn't belong under BMC LogServices, so moving it to Systems LogServices. Tested: Verified that the CPU LogService shows up under Systems and passed the Redfish Service Validator. Change-Id: Ic04157b966dc0395db94046f37c33590a4e20553 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2018-12-11Add details to BMCWEB config option help stringsJoseph Reynolds1-21/+26
Added URL paths and links to option documentation. Fixed spelling error. Tested: compiles Change-Id: I25c2a2756e46843a19425163bca0d99011423ce2 Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
2018-12-01build: prepare for boost 1.68Brad Bishop1-0/+1
Beast seems to have picked up a dependency on libatomic somewhere between 1.66 and 1.68: : in function `boost::beast::websocket::detail::stream_prng::create_mask() [clone .isra.3482] [clone .lto_priv.2208]': <artificial>:(.text+0x50c): undefined reference to `__atomic_fetch_add_8' collect2: error: ld returned 1 exit status Change-Id: I1b02ea6c3f0babb4e4cba297f0f8d8e8a2efe3ad Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2018-11-30build: add eof newline to CMakeLists.txtBrad Bishop1-1/+1
There was no newline at the end of the file. Add one. Change-Id: If1f4befaae9c950865c0ca87bf510fd6b644455f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2018-11-16Change the BMC LogService to only display from the message registryJason M. Bills1-0/+6
This change renames the existing BMC LogService that displays all entries in the journal to a BMC Journal LogService. The new standard BMC LogService is modified to only display messages from the registry. The registry MessageId and MessageArgs must be included in the journal metadata as "REDFISH_MESSAGE_ID" and "REDFISH_MESSAGE_ARG_<x>" respectively, where <x> is the arg number from the registry. Change-Id: I4556cbea5032ec639ad1fda084571144defe23dc Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2018-11-16Use target_compile_definitions() for build flagsJason M. Bills1-1/+14
This change moves the bmcweb build flags out of settings.hpp and into the CMakeLists.txt file as target_compile_definitions(). This makes it so it is no longer required to #include settings.hpp to use build flags in the source. Tested: Enabled and disabled some Redfish flags and confirmed that the desired components were added and removed. Change-Id: Ibeedb4fc8f3dcc286c73843823693a04c55c0615 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2018-10-22bmcweb: remove warning about coroutinesEd Tanous1-0/+1
Boost coroutines seems to be in use in sdbusplus asio, despite its depcrecation in boost. Silence the warning. Change-Id: Ic72545604f597a7ce937710068b040362ab0d224 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-10-18bmcweb: Move to C++17Ed Tanous1-1/+1
Move to c++ 17 to use some of the new features like std::variant, std::optional, ect Change-Id: I6d1d4a3ceb863256309641d29a2eb99ce44bef32 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-10-16Fix a minor spacing issue in CMakeLists.txtEd Tanous1-1/+1
Spaces got messed up in one spot in a comment. This resolves it. Tested By: Looking at the comment, and observing that it was now easier to read. Change-Id: I92393e61d61df3ea7c064d7bba35083939655fbf
2018-10-09Implement redfish LogServiceEd Tanous1-2/+10
This commit implements an optional LogService endpoint for debugging CPUs over Redish. It exposes both the ability to create a new log with the LogImmediate action, as well as to pull a stored log using the LogCollection schema. This feature is disabled by default, and should be enabled in the meta-x86 layer. Change-Id: Ied1d5e263a0857e09cd9a24fddec9c11a4066cd2 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-09-05Implement /console0 websocketEd Tanous1-0/+1
This commit ipmlements the serial console websocket in a way that is compatible with phosphor-rest. This allows the webui serial console to function. Latency doesn't appear improved, but I suspect that the obmc-console server has issues. Tested By: Booted phosphor-webui serial console. Serial console works as expected. Also implemented a serial console in python using python websocket, and it appears to send and receive data correctly. Change-Id: I0e571beb70a51923d6d7d148779a1154432c45c9 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-08-15Remove VScode specific scriptEd Tanous1-16/+0
Latest version of vscode CMake plugin does this automatically, so this script has no reason to exist anymore. Change-Id: I917822c4359b85bd7afca610b25145377a07606b Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-08-15Disable threadingEd Tanous1-1/+1
This commit disables threads from bmcweb. They weren't really used, but bmcweb linked against pthread regardless because of history. This commit, while small, makes some pretty important changes. 1. libstdc++ shared_ptr now becomes cheaper to increment and decrement ref counts, as it knows that we only have a single thread. 2. We save about 8k on our compiled size, most likely due to optimizations the compiler can do around threading assumptions. Change-Id: Ib9c20aaa2489952728de2ba8b93b24532e7b8c18 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-08-15Change _PHOSPHOR_WEBUI to _STATIC_HOSTINGAndrew Geissler1-2/+2
Changing this config option to better represent what it does, which is to host the static files from /usr/share/www/ Change-Id: Iaf785666f59f937567b6d0319c884c8ed29d2844 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2018-08-13Make out of tree builds work againJames Feist1-14/+2
Build sdbusplus and link correctly out of tree. Closes openbmc/bmcweb#2 Closes openbmc/bmcweb#3 Tested: cmake built out of tree Change-Id: I7eecb19209a7dace857ffa5eb9498441dfb570e9 Signed-off-by: James Feist <james.feist@linux.intel.com>
2018-08-13Don't build unit tests by defaultEd Tanous1-1/+1
The unit tests are currently in a sorry state, and are very dependent on the system being run. This has confused several people, so disable them for now until someone (probably me) has a chance to get the quality up on them. We will most likely leave them disabled by default even when they are passing. Change-Id: I6ad522dc0320f05b3ece3532f81bcb14b5d5de4f Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-08-09Fix merge conflictEd Tanous1-1/+1
Got a couple patches that collided in air, and now builds are broken. This resolves the collision by moving the new patches forward to the latest #defines Change-Id: I1fe35d17a68c61ad90752ae73000e2579131bf5d Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-07-27cmake-format the filesEd Tanous1-73/+78
cmake-format allows more consistency in our cmake files, and allows automatic reformatting of all our patches. In some cases it does make the files look worse, but overall having something that's automatic is a much improved quality of life. Change-Id: Ifd147c7d7de931cb149724aa3e36b6cb3b71436e Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-07-27Move over to upstream c++ styleEd Tanous1-5/+5
This patchset moves bmcweb over to the upstream style naming conventions for variables, classes, and functions, as well as imposes the latest clang-format file. This changeset was mostly built automatically by the included .clang-tidy file, which has the ability to autoformat and auto rename variables. At some point in the future I would like to see this in greater use, but for now, we will impose it on bmcweb, and see how it goes. Tested: Code still compiles, and appears to run, although other issues are possible and likely. Change-Id: If422a2e36df924e897736b3feffa89f411d9dac1 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-07-27Reimplement UUID based on systemd UUIDEd Tanous1-0/+1
...rather than a randomly generated one Change-Id: I85493ac29d21f5fa9f347edc21129901f9d0d911 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
2018-07-25Make SessionStore a proper singletonBorawski.Lukasz1-0/+1
- SessionStore class now has a proper singleton structure - session_storage_singleton.hpp is removed - from_json(..) function for SessionStore is changed to a specialized template - minor cosmetic fixes added - Move the template class usages of Crow App over to a non-template parameter Change-Id: Ic9effd5b7bac089a84c80a0caa97bd46d4984416 Signed-off-by: Borawski.Lukasz <lukasz.borawski@intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>