From 481ab9a01bdbe44ca64e5b065f2b81e41bee3ea0 Mon Sep 17 00:00:00 2001 From: Glenn Toms Date: Fri, 12 Jun 2020 17:50:07 +0100 Subject: Added ENV PORT options and EXPORT PORT --- Dockerfile | 7 ++++++- Dockerfile.arm32v7 | 7 ++++++- Dockerfile.arm64v8 | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 205d759..73519e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,12 +16,17 @@ ENV USER darkhttpd ENV GROUP darkhttpd ENV GID 911 ENV UID 911 +ENV PORT 8080 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ apk add -U darkhttpd +RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh +RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh + USER ${USER} COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ -ENTRYPOINT ["darkhttpd","/www/", "--no-listing"] \ No newline at end of file +EXPOSE ${PORT} +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index 7664f66..952ecb7 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -25,13 +25,18 @@ ENV USER darkhttpd ENV GROUP darkhttpd ENV GID 911 ENV UID 911 +ENV PORT 8080 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ apk add -U darkhttpd && \ rm /usr/bin/qemu-arm-static +RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh +RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh + USER ${USER} COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ -ENTRYPOINT ["darkhttpd","/www/","--no-listing"] +EXPOSE ${PORT} +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index 0175341..d9c8aab 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 @@ -25,13 +25,18 @@ ENV USER darkhttpd ENV GROUP darkhttpd ENV GID 911 ENV UID 911 +ENV PORT 8080 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ apk add -U darkhttpd && \ rm /usr/bin/qemu-aarch64-static +RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh +RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh + USER ${USER} COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ -ENTRYPOINT ["darkhttpd","/www/","--no-listing"] +EXPOSE ${PORT} +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] -- cgit v1.2.3 From af663d3376f6615d98be380f8a4327a6db5485eb Mon Sep 17 00:00:00 2001 From: James Date: Sun, 14 Jun 2020 21:05:51 +0100 Subject: Add news as dynamic message Adds a method to dynamically replace the "message" in homer with a news item from a chosen RSS feed! --- docs/tips-and-tricks.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/tips-and-tricks.md b/docs/tips-and-tricks.md index 63dbde7..632b62d 100644 --- a/docs/tips-and-tricks.md +++ b/docs/tips-and-tricks.md @@ -110,3 +110,17 @@ docker create \ --restart unless-stopped \ linuxserver/code-server ``` + + +## Get the news headlines in Homer +#### `by @JamiePhonic` + +Homer allows you to set a "message" that will appear at the top of the page, however, you can also supply a `url:`. + +If the URL you specified returns a JSON object that defines a `title` and `content` item, homer will replace these values from your `config.yml` with the ones in the returned object. + +So, using [Node-Red](https://nodered.org/docs/getting-started/) and a quick flow, you can process an RSS feed to replace the message with a news item! + +To get started, simply import [this flow](https://flows.nodered.org/flow/4b6406c9a684c26ace0430dd1826e95d) into your Node-Red instance and change the RSS feed in the "Get News RSS Feed" node to one of your choosing! + +So far, the flow has been tested with BBC News and Sky News, however it should be easy to modify the flow to work with other RSS feeds if they dont work out of the box! -- cgit v1.2.3 From 29d6b359abd243e9b4c026020bfc5d82bee88b12 Mon Sep 17 00:00:00 2001 From: Glenn Toms Date: Thu, 18 Jun 2020 15:46:33 +0100 Subject: Added entrypoint script and Dockerfile port&volume --- Dockerfile | 8 +++----- Dockerfile.arm32v7 | 8 +++----- Dockerfile.arm64v8 | 8 +++----- entrypoint.sh | 6 ++++++ 4 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 73519e0..cd3ab11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,12 +21,10 @@ ENV PORT 8080 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ apk add -U darkhttpd -RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh -RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh - -USER ${USER} - COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ +COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh +USER ${USER} EXPOSE ${PORT} +VOLUME [ "/www/config.yml", "/www/assets" ] ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index 952ecb7..ef01d1f 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -31,12 +31,10 @@ RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} & apk add -U darkhttpd && \ rm /usr/bin/qemu-arm-static -RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh -RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh - -USER ${USER} - COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ +COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh +USER ${USER} EXPOSE ${PORT} +VOLUME [ "/www/config.yml", "/www/assets" ] ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index d9c8aab..7899027 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 @@ -31,12 +31,10 @@ RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} & apk add -U darkhttpd && \ rm /usr/bin/qemu-aarch64-static -RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh -RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh - -USER ${USER} - COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ +COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh +USER ${USER} EXPOSE ${PORT} +VOLUME [ "/www/config.yml", "/www/assets" ] ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..7623322 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +yes n | cp -i /www/config.yml.dist /www/config.yml +while true; do echo n; done | cp -Ri /app/dist/www/assets /www/assets 2>/dev/null + +darkhttpd /www/ --no-listing --port $PORT -- cgit v1.2.3