diff --git a/eufy-ha-mqtt-bridge/CHANGELOG.md b/eufy-ha-mqtt-bridge/CHANGELOG.md index 60d0e7e..5106fd9 100644 --- a/eufy-ha-mqtt-bridge/CHANGELOG.md +++ b/eufy-ha-mqtt-bridge/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## [0.4.0] - 2021-01-02 +- Change base image to `hassioaddons/debian-base` + ## [0.3.0] - 2020-12-31 - Change name from **eufy-ha-mqtt-bridge** to **Eufy Home Assistant MQTT Bridge** diff --git a/eufy-ha-mqtt-bridge/Dockerfile b/eufy-ha-mqtt-bridge/Dockerfile index ae4e23c..1c80856 100644 --- a/eufy-ha-mqtt-bridge/Dockerfile +++ b/eufy-ha-mqtt-bridge/Dockerfile @@ -1,7 +1,17 @@ -FROM matijse/eufy-ha-mqtt-bridge +FROM hassioaddons/debian-base -RUN npm install json2yaml +ENV LANG C.UTF-8 -COPY docker-entrypoint.sh / -RUN chmod a+x /docker-entrypoint.sh -ENTRYPOINT ["/docker-entrypoint.sh"] +# install node and build tools (needed by node-pre-gy) +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt install -y nodejs g++ make python + +# ass source and unpack +RUN mkdir /src /app && curl -sL https://github.com/matijse/eufy-ha-mqtt-bridge/tarball/main | tar xvfz - -C /app --strip-components=1 + +# install all (and json2yaml for Cofiguration parsing) +WORKDIR /app +RUN npm install && npm install -g json2yaml + +COPY run.sh / +RUN chmod a+x /run.sh +CMD [ "/run.sh" ] diff --git a/eufy-ha-mqtt-bridge/README.md b/eufy-ha-mqtt-bridge/README.md index 6d1890c..b4caaac 100644 --- a/eufy-ha-mqtt-bridge/README.md +++ b/eufy-ha-mqtt-bridge/README.md @@ -4,6 +4,8 @@ ## 🚨 This is some experimental release! 🚨 --- +**As this add-on will be build locally it might take some time (8min on my rpi4). This will be solved by pre-build images soon.** + Quick wrapp around https://github.com/matijse/eufy-ha-mqtt-bridge. Application data will be written to `/share/eufy-ha-mqtt-bridge/` so log and other files can be accessed from other addons, e.g. the `Samba share` addon, or view it at the `Visual Studio Code` add-on. diff --git a/eufy-ha-mqtt-bridge/docker-entrypoint.sh b/eufy-ha-mqtt-bridge/run.sh similarity index 84% rename from eufy-ha-mqtt-bridge/docker-entrypoint.sh rename to eufy-ha-mqtt-bridge/run.sh index 8c27e1d..aa6bba6 100644 --- a/eufy-ha-mqtt-bridge/docker-entrypoint.sh +++ b/eufy-ha-mqtt-bridge/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/with-contenv bashio set -e echo "Symlinking data dir" @@ -9,10 +9,10 @@ ln -s /share/eufy-ha-mqtt-bridge/data /app # symlink data mount from share echo "exporting environment vars form options file" echo '# Generated by homeassistant, do not edit!' > /app/data/config.yml echo '# Edit configuration only at the add-on!' >> /app/data/config.yml -/app/node_modules/.bin/json2yml /data/options.json >> /app/data/config.yml +json2yml /data/options.json >> /app/data/config.yml echo 'patching console log level' sed -i "s/level: process.env.NODE_ENV === 'production' ? 'error' : 'debug'\,/level: 'info',/" /app/index.js echo "starting original stuff..." -exec npm run start \ No newline at end of file +npm run start \ No newline at end of file