Apply Node-RED dashboard patch at build time (#1579)

This commit is contained in:
Stefan Agner 2023-03-28 16:10:38 +02:00 committed by GitHub
parent 84313f5818
commit ac346d4c8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -4,6 +4,7 @@ FROM ${BUILD_FROM}
# Copy Node-RED package.json
COPY package.json /opt/
COPY node-red-dashboard-show-dashboard.patch /tmp/
# Set workdir
WORKDIR /opt
@ -26,7 +27,7 @@ RUN \
nodejs=18.14.2-r0 \
npm=9.1.2-r0 \
openssh-client=9.1_p1-r2 \
patch=2.7.6-r8 \
patch=2.7.6-r9 \
\
&& npm install \
--no-audit \
@ -40,6 +41,9 @@ RUN \
\
&& echo -e "StrictHostKeyChecking no" >> /etc/ssh/ssh_config \
\
&& patch -d /opt/node_modules/node-red-dashboard -p1 \
-i /tmp/node-red-dashboard-show-dashboard.patch \
\
&& apk del --no-cache --purge .build-dependencies \
&& rm -fr \
/etc/nginx \

View file

@ -38,10 +38,6 @@ if ! bashio::fs.directory_exists '/config/node-red/'; then
sed -i "s/%%ID%%/${id}/" "/config/node-red/flows.json"
fi
# Patch Node-RED Dashboard
cd /opt/node_modules/node-red-dashboard || bashio.exit.nok 'Failed cd'
patch -p1 < /etc/node-red/patches/node-red-dashboard-show-dashboard.patch
# Pass in port & SSL settings
port=$(bashio::addon.port 80)
sed -i "s/%%PORT%%/${port:-80}/" "/opt/node_modules/node-red-dashboard/nodes/ui_base.html"