Add bmcweb to meta-ibm layer for redfish support
Put behind nginx and only activate when /redfish is
queried via https.
Testing: Verified that with this change in bmcweb:
https://gerrit.openbmc-project.xyz/#/c/openbmc/bmcweb/+/11518/
that redfish commands can successfully be sent via nginx
on the witherspoon qemu model.
Change-Id: I97509dc3484deffd06c3d60db710eb3b17dfccb5
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf
index 74010f9..89e575a 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf
@@ -87,6 +87,10 @@
proxy_pass http://127.0.0.1:8081;
}
+ location /redfish {
+ proxy_pass http://127.0.0.1:8082;
+ proxy_http_version 1.1;
+ }
include /etc/nginx/sites-enabled/443_*.conf;
}
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/bmcweb/bmcweb.bbappend b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/bmcweb/bmcweb.bbappend
new file mode 100644
index 0000000..b41a1b0
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/bmcweb/bmcweb.bbappend
@@ -0,0 +1,10 @@
+SUMMARY = "Modifications to support Nginx"
+
+# Behind NGINX so disable SSL in bmcweb
+EXTRA_OECMAKE += "-DBMCWEB_INSECURE_DISABLE_SSL=ON"
+
+# Only need redfish support
+EXTRA_OECMAKE += "-DBMCWEB_ENABLE_KVM=OFF -DBMCWEB_ENABLE_DBUS_REST=OFF -DBMCWEB_ENABLE_PHOSPHOR_WEBUI=OFF"
+
+# override service and socket file to use nginx
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/bmcweb/bmcweb/bmcweb.service b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/bmcweb/bmcweb/bmcweb.service
new file mode 100644
index 0000000..832eb04
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/bmcweb/bmcweb/bmcweb.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=BMC Redfish Server (bmcweb)
+After=network.target
+After=obmc-webserver-pre.target
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/env bmcweb
+SyslogIdentifier=bmcweb
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/bmcweb/bmcweb/bmcweb.socket b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/bmcweb/bmcweb/bmcweb.socket
new file mode 100644
index 0000000..40e6897
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/bmcweb/bmcweb/bmcweb.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=Phosphor redfish socket (bmcweb)
+
+[Socket]
+ListenStream=127.0.0.1:8082
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
index 7b61d8c..0b0a9c9 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
@@ -1,2 +1,2 @@
RDEPENDS_${PN}-logging += "ibm-logging"
-RDEPENDS_${PN}-extras += "nginx"
+RDEPENDS_${PN}-extras += "nginx bmcweb"