From 2fdcb506c51794cb5681ce8c439f71a0c4589bec Mon Sep 17 00:00:00 2001 From: Wyrrrd Date: Tue, 25 Jan 2022 21:52:13 +0100 Subject: [PATCH] Move sed replacements to separate file --- Dockerfile | 13 +++++++++---- replacements.sed | 8 ++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 replacements.sed diff --git a/Dockerfile b/Dockerfile index d4dd876..99d3623 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,15 +18,20 @@ RUN apt-get update -y && \ rm -rf /var/lib/apt/lists/* RUN useradd -md /app -s /bin/bash bot -RUN cd /app && git clone https://github.com/novnc/noVNC.git && \ - cd noVNC/ && cp vnc_lite.html index.html && sed -i -e 's/noVNC<\/title>/<title>Wohnungsbot<\/title>\n\n <link rel="icon" type="image\/x-icon" href="favicon.ico">/' -e "s/document\.getElementById('sendCtrlAltDelButton')//" -e 's/\.onclick = sendCtrlAltDel\;//' -e 's/<div id="sendCtrlAltDelButton">Send CtrlAltDel<\/div>//' index.html && \ - cd utils && git clone https://github.com/novnc/websockify websockify && \ - mkdir /data && mkdir /app/.config && ln -s /data /app/.config/Wohnungsbot + ADD startup.sh /app/startup.sh +ADD replacements.sed /app/replacements.sed ADD openbox/* /app/.config/openbox/ + +RUN cd /app && git clone https://github.com/novnc/noVNC.git && \ + cd noVNC/ && cp vnc_lite.html index.html && chmod +x /app/replacements.sed && /app/replacements.sed -i index.html && \ + cd utils && git clone https://github.com/novnc/websockify websockify && \ + mkdir /data && ln -s /data /app/.config/Wohnungsbot + COPY --from=builder /root/wohnungsbot/release/Wohnungsbot-$WB_VERSION.AppImage /app/Wohnungsbot.AppImage COPY --from=builder /root/wohnungsbot/resources/icon.ico /app/noVNC/favicon.ico COPY --from=builder /root/wohnungsbot/resources/icons/512x512.png /app/background.png + RUN chmod 0755 /app/startup.sh && chown -R bot /app && chown -R bot /data HEALTHCHECK CMD pidof Wohnungsbot.AppImage && curl --fail http://localhost:6080/ || exit 1 diff --git a/replacements.sed b/replacements.sed new file mode 100644 index 0000000..a1a5fb1 --- /dev/null +++ b/replacements.sed @@ -0,0 +1,8 @@ +#!/bin/sed -f + +# Remove CtrlAltDelButton +/getElementById('sendCtrlAltDelButton')/,+1d +/<div id="sendCtrlAltDelButton.*$/d + +# Replace window title, append favicon +s/\(<title>\)noVNC/\1Wohnungsbot/;T;a <link rel="icon" type="image\/x-icon" href="favicon.ico"> \ No newline at end of file