diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9aa1db1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +config.json +plugins.txt +tags diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7f1e404 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM hypriot/rpi-node:7 +# FROM hypriot/rpi-node:6.9.1 +MAINTAINER ViViDboarder + +ENV LANG en_US.UTF-8 +ENV LC_ALL en_US.UTF-8 + +RUN apt-get update +RUN apt-get install -y --no-install-recommends \ + build-essential \ + avahi-daemon \ + avahi-discover \ + libnss-mdns \ + libavahi-compat-libdnssd-dev + +RUN npm install -g --unsafe-perm \ + homebridge \ + hap-nodejs \ + node-gyp && \ + cd /usr/local/lib/node_modules/homebridge/ && \ + npm install --unsafe-perm bignum && \ + cd /usr/local/lib/node_modules/hap-nodejs/node_modules/mdns && \ + node-gyp BUILDTYPE=Release rebuild + +USER root +RUN mkdir -p /root/.homebridge +VOLUME /root/.homebridge +WORKDIR /root/.homebridge + +EXPOSE 5353 51826 + +CMD cat /root/.homebridge/plugins.txt | xargs npm install -g --unsafe-perm && homebridge diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..221cf5e --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +build: + docker build -t rpi-homebridge . + +run: build + docker run --net=host --rm \ + -v "$(shell pwd)/config.json:/root/.homebridge/config.json" \ + -v "$(shell pwd)/plugins.txt:/root/.homebridge/plugins.txt" \ + rpi-homebridge + +shell: build + docker run --net=host --rm \ + -v "$(shell pwd)/config.json:/root/.homebridge/config.json" \ + -v "$(shell pwd)/plugins.txt:/root/.homebridge/plugins.txt" \ + -it rpi-homebridge bash diff --git a/config-sample.json b/config-sample.json new file mode 100644 index 0000000..c5b7bba --- /dev/null +++ b/config-sample.json @@ -0,0 +1,24 @@ +{ + "bridge": { + "name": "Homebridge", + "username": "CC:22:3D:E3:CE:30", + "port": 51826, + "pin": "031-45-154" + }, + + "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.", + + "accessories": [ + { + "accessory": "WeMo", + "name": "Coffee Maker" + } + ], + + "platforms": [ + { + "platform" : "PhilipsHue", + "name" : "Hue" + } + ] +} diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..49142b9 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,6 @@ +homebridge: + build: . + net: host + volumes: + - ./config.json:/root/.homebridge/config.json + - ./plugins.txt:/root/.homebridge/plugins.txt diff --git a/plugins-sample.txt b/plugins-sample.txt new file mode 100644 index 0000000..9df9764 --- /dev/null +++ b/plugins-sample.txt @@ -0,0 +1,2 @@ +homebridge-homeassistant +homebridge-wemo