Move sed replacements to separate file

This commit is contained in:
Wyrrrd
2022-01-25 21:52:13 +01:00
parent f26556f059
commit 2fdcb506c5
2 changed files with 17 additions and 4 deletions
+9 -4
View File
@@ -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/<title>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
+8
View File
@@ -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">