]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Merge branch 'master' of github.com-perso:bastienwirtz/homer 20.06.1
authorBastien Wirtz <bastien.wirtz@gmail.com>
Fri, 19 Jun 2020 15:03:55 +0000 (08:03 -0700)
committerBastien Wirtz <bastien.wirtz@gmail.com>
Fri, 19 Jun 2020 15:03:55 +0000 (08:03 -0700)
Dockerfile
Dockerfile.arm32v7
Dockerfile.arm64v8
docs/tips-and-tricks.md
entrypoint.sh [new file with mode: 0644]

index 205d759fe2c02e463e07455ff86d09bfa85d800d..cd3ab118cc5e32906aef57a14312b63745b7af7a 100644 (file)
@@ -16,12 +16,15 @@ 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
 
-USER ${USER}
-
 COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
+COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh
 
-ENTRYPOINT ["darkhttpd","/www/", "--no-listing"]
\ No newline at end of file
+USER ${USER}
+EXPOSE ${PORT}
+VOLUME [ "/www/config.yml", "/www/assets" ]
+ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
index 7664f6611252a472bdeae8a9224a764b66d7654e..ef01d1fb2dbf1dc3ba5a21e0c30a743990d7a0fc 100644 (file)
@@ -25,13 +25,16 @@ 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
 
-USER ${USER}
-
 COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
+COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh
 
-ENTRYPOINT ["darkhttpd","/www/","--no-listing"]
+USER ${USER}
+EXPOSE ${PORT}
+VOLUME [ "/www/config.yml", "/www/assets" ]
+ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
index 0175341d9ed490bd6603cdf7b213fd5558608ca0..7899027743a20f9b55751457b98bf8d4c9a9742b 100644 (file)
@@ -25,13 +25,16 @@ 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
 
-USER ${USER}
-
 COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
+COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh
 
-ENTRYPOINT ["darkhttpd","/www/","--no-listing"]
+USER ${USER}
+EXPOSE ${PORT}
+VOLUME [ "/www/config.yml", "/www/assets" ]
+ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
index 63dbde76263d40ceeffc9b88aaf4c3689b36cfee..632b62dec6e4b79d651ed42eddcc0812790cb3f2 100644 (file)
@@ -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!
diff --git a/entrypoint.sh b/entrypoint.sh
new file mode 100644 (file)
index 0000000..7623322
--- /dev/null
@@ -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