summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Update whitelistEd Tanous2018-08-151-1/+3
| | | | | | | | | As part of the redfish spec, both /redfish and /redfish/v1/odata need to be allowed without credentials. This adds them to the whitelist, and improves our compliance with the specification. Change-Id: I89d7c20ed497b77cdea83560087c9085747872bf Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* cmake-format the CmakeLists.txt.inEd Tanous2018-08-151-9/+10
| | | | | Change-Id: If7f8c034bc72b2ee0af6e1438eb7bb88779ce8a1 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Remove VScode specific scriptEd Tanous2018-08-152-45/+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>
* Last round of variable renamesEd Tanous2018-08-156-116/+111
| | | | | | | | A few patches were in flight when we did the great variable renaming. This catches all the patches that have been merged since Change-Id: Ie9642a4812b2a679ffa01ce540f5c4515a4c710b Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Cleanups to update service schemaEd Tanous2018-08-151-224/+137
| | | | | | | | This commit moves update service to a number of better practices, and avoids a few copies along the way. Change-Id: I3cea25a8f804b8e1109a1e5bb8becf69a4b77e71 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Cleanups to network protocolEd Tanous2018-08-151-103/+69
| | | | | | | | | | 1. remove providers interface 2. Move the static structures to globals, and make them const char* to avoid construction on startup. 3. Explicitly capture all variables Change-Id: I4a79d6f94e38c1a0ea0002b584c30ca02f5a930f Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* minor cleanups to dbus-restEd Tanous2018-08-151-21/+17
| | | | | | | | | A few minor housekeeping things to dbus-rest. Avoids a few extra string copies, and moves the dbus type behavior to a range based loop rather than a for index loop Change-Id: Ic9e1284905d480763e57058a0cb4798c15c2bd58 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Refactor Manager Network Protocol to use D-BusKowalski, Kamil2018-08-151-37/+157
| | | | | | | | | | | | | | ManagerNetworkProtocol schema now operates on data fetched from D-Bus instead of netstat. This also prepares it for PATCH implementation that will allow services ports & state manipulation. Does not break other components. ManagerNetworkProtocol however will display only services available on D-Bus. Tested on platform and x86 machine. Change-Id: Id693dfbdd870801feb06d08833a261bdbb4285e6 Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Disable threadingEd Tanous2018-08-152-2/+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>
* Implement POST for redfish UpdateServiceJennifer Lee2018-08-152-94/+278
| | | | | | | | | | | | - POST an image file to /redfish/v1/UpdateServer uri will upload the image and activate it - Modified SoftwareInventoryCollection to list items with xyz.openbmc_project.Software.Activation/Activation property as "xyz.openbmc_project.Software.Activation.Activations.Active" - SoftwareInventory odata.id is identified with DBus generated uuid Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Change-Id: I48c3e6d868d1c27420cab5a706e4205f06713923
* Implement XSS overrideEd Tanous2018-08-152-4/+20
| | | | | | | | | | | | | | | | | | | | There are a number of situations that come up in developement, where it is very useful to launch phosphor-webui from a remote host. Currently this is disallowed based on the bmcweb security posture. This commit makes the BMCWEB_INSECURE_DISABLE_XSS_PREVENTION much more useful, by actually applying the headers that would allow one to launch the webui from a remote system successfully. Tested by: Adding BMCWEB_INSECURE_DISABLE_XSS_PREVENTION=ON to the cmake options in the bitbake file, then launching phosphor-webui using npm run-script server WebUI logged in without issue Change-Id: I2b7fe53aab611536b4b27b2704e20d098507a5e7 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implement odata endpointEd Tanous2018-08-151-0/+55
| | | | | | | | | | | | | | As part of the Redfish standard, the /redfish/v1/odata endpoint is required to be implemented, to provide intial provisioning. At one point it was thought to be optional. Tested By: Reading /redfish/v1/odata and verifying the correct response is returned, as well as attempting running the interop tool from the DMTF website, which originally exposed the issue. Change-Id: I4775e4f23be0d6e76bc5da503f455f23f10d1364 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Change _PHOSPHOR_WEBUI to _STATIC_HOSTINGAndrew Geissler2018-08-143-4/+4
| | | | | | | | 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>
* Implement Location header for session authEd Tanous2018-08-131-0/+3
| | | | | | | | | | | | | | | | | | | | From the redfish specification 1.5.0, page 98: """ The response to the POST request to create a session shall include the following: ... A Location header that contains a hyperlink to the newly created session resource """ This implements the location header properly, per specification. Tested by: Attempting POST on the Sessions resource, and observing a "Location" header be set. Change-Id: Ia62c385bedf67e6267d573771b04a211ba332f21 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Clang-format cleanupEd Tanous2018-08-136-280/+901
| | | | | | | | | | | | | | | | | | | | | | It looks like some of the code reviews in progress contain clang-format fixes as well. This squashes all of the clang-format fixes into a single commit, that hopefully can go through the process a little faster, as it should only be whitespace changes. In the past, clang-formatting the naughty strings file proved to return inconsistent results, and even formatted files would still be detected as unformatted. Aparently the solution was to run clang-format-5.0 approximately 20 times in a loop, until it decided on a code layout that it was ok with iteration to iteration. This is a bit of a corner case, so I don't think we need to get CI running multiple runs in the future, and can just handle this on a case by case basis. I'd be surprised if anyone else had this issue. Change-Id: I57e2a03676bce20dc376fd9cea724732b2dc7010 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Make out of tree builds work againJames Feist2018-08-132-25/+12
| | | | | | | | | | | 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>
* Don't build unit tests by defaultEd Tanous2018-08-131-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>
* Fix merge conflictEd Tanous2018-08-0910-225/+218
| | | | | | | | | 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>
* Move websocket implementation to boost beastEd Tanous2018-08-075-395/+135
| | | | | | | | | | | Boost beast is already in much better use, and gives more confidence in the security model. This change keeps the existing crow interfaces, and simply replaces the backend with beast. Calling code remains largely unchanged, with the exception of having to explicitly cast to string (to obtain a string view) when sending messages. Change-Id: I90edad505faf2d4465b4888f1f2c4b12cc9e77d0 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Fix crash issue with Managers schemaEd Tanous2018-08-061-4/+1
| | | | | | | | | | | | | | The bmc was initing two copies of the managers route, which was causing the route handler to crash at startup. Remove the extra one. Jul 26 20:39:50 wolfpass systemd[1]: Started Start bmcweb server. Jul 26 20:39:50 wolfpass bmcweb[3279]: terminate called after throwing an instance of 'std::runtime_error' Jul 26 20:39:50 wolfpass bmcweb[3279]: what(): handler already exists for /redfish/v1/Managers/openbmc Change-Id: Id2c469b5e82bddc68987f89f0eff23072b16854c Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* cmake-format the filesEd Tanous2018-07-272-112/+115
| | | | | | | | | | 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>
* Move over to upstream c++ styleEd Tanous2018-07-2673-3923/+3875
| | | | | | | | | | | | | | | | | | 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>
* Remove CImg from treeEd Tanous2018-07-261-60168/+0
| | | | | | | It was only used for kvm debug. Change-Id: I833970c4c2d54a7405130798221fd13e8334747f Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Reimplement UUID based on systemd UUIDEd Tanous2018-07-262-10/+33
| | | | | | | ...rather than a randomly generated one Change-Id: I85493ac29d21f5fa9f347edc21129901f9d0d911 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Make doGet implementations optionalEd Tanous2018-07-261-1/+4
| | | | | | | | | There are cases in redfish where one may want to support ONLY a POST/PATCH interface, and not support GET. This patchset provides default behavior for that case. Change-Id: Ibd46c5dda2af543c491c1d6fba3d0adb65699db2 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implement debug logging for responsesEd Tanous2018-07-261-6/+11
| | | | | | | | | | In production code, we should never call end() on a response twice. In practice there are a lot of cases where this happens, and while it's handled gracefully, it's incorrect. This adds error logging for this case. Change-Id: Iffb1dd26bfc656e9ca8cf1f179b90e501f3da949 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Make Ethernet/VLAN Interfaces handle "404 Not Found" properlyKowalski, Kamil2018-07-261-6/+134
| | | | | | | | | | | | | | Ethernet and VLAN Interfaces lacked detection whether interface actually existed. So this detection had to be added. Additionally there was slight inconsistency with error messages and statuses, this is fixed now. Tested on x86 development machine and dedicated platform. Does not introduce any regression. Change-Id: Ic9e2a98c748ac0dd1cf412b6a54a14f3f53eb9fa Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Avoid an extra move when returning 404Ed Tanous2018-07-261-1/+1
| | | | | | | | In this case, we can simply handle the response cases in place, rather than moving from a newly constructed object. Change-Id: I95c7a4f3e302700a750f9c0f575b88ae4150fa15 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Refactor session storageEd Tanous2018-07-262-59/+72
| | | | | | | | | | Session storage had a few bugs, and a number of old practices. This moves the session storage closer to the best practices. It enforces the use of a factory function for generating new sessions, as well as using get_ptr when reading the sessions out. Change-Id: Ia252076f21e47b99f8057190349355838fdd787d Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Make SessionStore a proper singletonBorawski.Lukasz2018-07-2513-87/+115
| | | | | | | | | | | | | | | - 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>
* Implement VlanNetworkInterface and VlanNetworkInterfaceCollection SchemaKowalski, Kamil2018-07-241-126/+23
| | | | | | | | | | Implemented GET for both schemas and POST in collection for VLAN creation. PATCH and DELETE for interface schema will be introduced later. Does not introduce regression. Tested on HW platform and x86 dev system. Change-Id: If7b11c42a9382030ab1f0712422e310f192055ca Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com>
* Remove some critical debug printsEd Tanous2018-07-241-2/+2
| | | | | | | | | These prints are causing a lot of excess logs, and for the current archittecture, the error isn't a concern. This could use some cleanup in the future, but for now, comment out so we get more useful logs. Change-Id: I3113f985745e5c0286e25abbd7ccdef3a3094269 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Move Sensors path to sensorsJames Feist2018-07-202-6/+6
| | | | | | | Upstream uses lowercase paths, fix it. Change-Id: Ia8dc522fdd59cbbde015049ca772347fb9d2c991 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Prevent ssl key generation when disabledAndrew Geissler2018-07-171-1/+3
| | | | | | | | | | | | | The BMCWEB_INSECURE_DISABLE_SSL option was provided in CMakeLists.txt but not used anywhere. Look at it when determining whether to enable crow SSL (CROW_ENABLE_SSL). Testing: Verified default image still compiles and verified when BMCWEB_INSECURE_DISABLE_SSL is set to ON, bmcweb can be put behind nginx and respond to redfish commands. Change-Id: Ic1c2cf52df99923706bffac9553e258542b0ff7d Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Update sensors to reflect changes after switching to sdbusplusLewanczyk, Dawid2018-06-294-16/+37
| | | | | | | | - GetManagedObjects should be call only on service root path - additional fixes for RSV Change-Id: I4e345e57b081d7683fd8f3f4efa23fe4091ce41e Signed-off-by: Lewanczyk, Dawid <dawid.lewanczyk@intel.com>
* Fix for empty string in IPv4 PATCH.Kowalski, Kamil2018-06-291-2/+6
| | | | | | | | Unfortunately current implementation handles empty string as 0, so format verification is OK, but IPs like XXX...XXX should not be accepted. Change-Id: Ibdc526a7118bffdc6a028343a32711d1ad6e2d62 Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com>
* Update Redfish Schema to 2018.1Jason M. Bills2018-06-29107-9613/+20428
| | | | Change-Id: I4e5d5d49b4524c8a4d73ae0117fcf7e9aedfbb79
* Introduce ComputerSystem schemaLewanczyk, Dawid2018-06-299-598/+1581
| | | | | | | | | | | | | | Initial commit which adds: - ComputerSchemaCollection GET method - ComputerSchema GET, PATCH methods Tested on x86 and aspeed - RSV pass for ComputerSchema - bmcweb interface no regression - smbios interface tested with demo app Change-Id: Ib64084c5888bc511a24f954a6bc062ca920addbe Signed-off-by: Lewanczyk, Dawid <dawid.lewanczyk@intel.com>
* Fixed the Software Inventory schema Object Mapper callsJennifer Lee2018-06-291-128/+145
| | | | | Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Change-Id: I41c374ba0a37bf8ff17577dbef17a6d952315a1b
* Create separate pam config for webserver instead of using dropbear'sJennifer Lee2018-06-293-2/+8
| | | | | Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Change-Id: I18850e82e116683b1c56e3a0eb23511b09aeed51
* Implement VlanNetworkInterface Schema DELETE and PATCH methodsKowalski, Kamil2018-06-291-71/+478
| | | | | | | Does not introduce regression. Tested on HW platform and x86 dev system. Change-Id: I1e8894367e664de4900f7a528d1ce8ee4d66ac1c Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com>
* Implement actions interfaceEd Tanous2018-06-293-210/+806
| | | | | | | | | | | This commit implements the actions interface, and cleans up some compatibility issues between phosphor rest and bmcweb. This should be considered WIP, as it requires patches to some of the dependent libraries to build (mostly sdbuspplus). Change-Id: Ida91461b0a0aff5d2d962e9e4053f056f4732af6 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Pull in nlohmann json as a dependency rather than checking in.Ed Tanous2018-06-295-14795/+38
| | | | | | | | This should allow keeping closer to the upstream yocto recipes, and avoid excess code in the repo Change-Id: Ib66f7cf69b68bb23f9789580beadf8344cb68cfa Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implement feature selection in bmcwebEd Tanous2018-06-2912-261/+346
| | | | | | | | | This patchsets implements feature selection in BMCWEB using compile time macros. This allows certain features, security implementations, and other things to be selected at compile time. Change-Id: Ic14343d36d82830e6cf51311ca886a90749ae6a7 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implemented PATCH for EthernetInterface IPv4Addresses arrayKowalski, Kamil2018-06-291-65/+600
| | | | | | | | | | | Implemented PATCH request handling in EthernetInterface schema. Allows creation, modification and deletion of IPv4Addresses according to DMTF's Redfish specification. This code does not change existing functionality - only expands it. Tested on real hardware and x86 VM. Works fine, passes RedfishSchemaValidator. Change-Id: Iff485b969e87d51b65a63c84a9199d44189131d0 Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com>
* Implemented PATCH for EthernetInterface VLAN and HostName fieldsKowalski, Kamil2018-06-294-155/+475
| | | | | | | | | | | | Implemented PATCH request handling in EthernetInterface schema. Currently only VLAN and HostName patching is implemented - IP changes will be introduced in further patchsets. This code does not change existing functionality - only expands it. Tested on real hardware and x86 VM. Works fine, passes RedfishSchemaValidator. Change-Id: I8de4ee5e859218823b07cc11845f7ef6782d7171 Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com>
* Move bmcweb to mozilla compatibility ciphersEd Tanous2018-06-291-1/+1
| | | | | | | | | | | | Problems were found in compatibility with older versions of curl and wget. At some point, this option needs to be made runtime configurable. Tested by: Using curl to log into rest API. Logging into webui. Change-Id: I29620cbae73735e846efc1cc22df6899dbe595df Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Make bmcweb image upload compatible with upstream.Ed Tanous2018-06-293-41/+107
| | | | | | | | This change moves the image upload logic out of the intel oem namespace, and makes it 1:1 compatible with phosphor rest dbus. This is to allow a seamless transition in the future. Change-Id: I243237357a672934c05bf072e7ff1a5955af0f5e
* Added UpdateService to RedfishJennifer Lee2018-06-292-3/+295
| | | | | | | | | | | - Implemented SoftwareInventoryCollection - Implemented SoftwareInventory Currently DBus supports BMC FW version only, so only BMC is listed in the invetory. Change-Id: I28a151b2b1cd98573ec93234717eae5eaf95058c Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com>
* Fix issue with dbus interfaces and compatibilityEd Tanous2018-06-291-32/+53
| | | | | Change-Id: I3fb40defd978e87aad8c7294d5aab1aa72561fa2 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
OpenPOWER on IntegriCloud