From 8e835b9468034e35196f342cccef656f36b874c3 Mon Sep 17 00:00:00 2001 From: ellwoodb Date: Fri, 23 Aug 2024 10:55:54 +0200 Subject: [PATCH 1/4] Added Docker install instructions --- README.md | 62 +++++++++++++++++++++++++++++++++++++++++---- config.example.yaml | 1 + docker-compose.yaml | 7 ++++- 3 files changed, 64 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2c765bd7..096d7e99 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,20 @@ might like to read the [comparison with DiyHue](doc/comparison-with-diyhue.md). ## Installation guide -To install Bifrost, you will need the following: +There are currently two ways you can install Bifrost. - 1. The rust language toolchain (https://rustup.rs/) - 2. At least one zigbee2mqtt server to connect to - 3. The MAC address of the network interface you want to run the server on +1. [Install manualy](#manual) from source (for now, this is the preferred method) +2. [Install it via Docker](#docker) (still WIP, some aspects may not be optimal for now) + +When you have these things available, you can download + +### Manual + +To install Bifrost from source, you will need the following: + +1. The rust language toolchain (https://rustup.rs/) +2. At least one zigbee2mqtt server to connect to +3. The MAC address of the network interface you want to run the server on When you have these things available, install bifrost: @@ -89,12 +98,55 @@ At this point, the server should start: (log timestamps omitted for clarity) ... ``` -The log output shows Bifrost talking with zigbee2mqtt, and finding some lights to control (office_{1,2,3}). +The log output shows Bifrost talking with zigbee2mqtt, and finding some lights to control (office\_{1,2,3}). At this point, you're running a Bifrost bridge. The Philips Hue app should be able to find it on your network! +### Docker + +> [!WARNING] +> Docker support just recently got [merged](https://github.com/chrivers/bifrost/pull/2) to this project. It is not optimal yet and there are no prebuilt images (yet). If you encounter any bugs or have suggestions, feel free to leave your feedback [here](#problems-questions-feedback). + +To install Bifrost with Docker, you will need the following: + +1. At least one zigbee2mqtt server to connect to +2. The MAC address of the network interface you want to run the server on +3. A running [Docker](https://docs.docker.com/engine/install/) instance with [Docker-Compose](https://docs.docker.com/compose/install/) installed +4. Have `git` installed to clone this repository + +When you have these things available, you can install Bifrost by running these commands: + +``` +git clone https://github.com/chrivers/bifrost +cd bifrost +``` + +Then rename or copy our `config.example.yaml`: + +``` +cp config.example.yaml config.yaml +``` + +And edit it with your favorite editor to your liking (see [configuration reference](doc/config-reference.md)). + +Also edit the mounts in the `docker-compose.yaml` to the paths you put your config.yaml (can also be relative, e.g., `./config.yaml`) and where you want to put the certificates, Bifrost creates. + +Now you are ready to run the app with: + +``` +docker compose up -d +``` + +This will build and then start the app on your Docker instance. + +To view the logs, use a tool like [Portainer](https://www.portainer.io/) or run the following command: + +``` +docker logs bifrost +``` + # Configuration See [configuration reference](doc/config-reference.md). diff --git a/config.example.yaml b/config.example.yaml index e41bc976..d663437b 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -1,4 +1,5 @@ bifrost: + # Optional but needed if using the Docker install method cert_file: "certs/cert.pem" bridge: diff --git a/docker-compose.yaml b/docker-compose.yaml index 592e9714..f31e8c92 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,12 @@ services: bifrost: build: . + container_name: bifrost + restart: unless-stopped + network_mode: host volumes: + # If you followed the guide on our readme, you could also use relative paths: + # - ./config.yaml:/app/config.yaml + # - ./certs:/app/certs - /path/to/app-data/config.yaml:/app/config.yaml - /path/to/app-data/certs:/app/certs - network_mode: host From b5167f2f0b99de52a753ce978ff3ca84b25fcef5 Mon Sep 17 00:00:00 2001 From: ellwoodb <73251578+ellwoodb@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:30:52 +0200 Subject: [PATCH 2/4] Improve Warning Co-authored-by: Christian Iversen Signed-off-by: ellwoodb <73251578+ellwoodb@users.noreply.github.com> --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 096d7e99..b0126379 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,8 @@ The Philips Hue app should be able to find it on your network! ### Docker > [!WARNING] -> Docker support just recently got [merged](https://github.com/chrivers/bifrost/pull/2) to this project. It is not optimal yet and there are no prebuilt images (yet). If you encounter any bugs or have suggestions, feel free to leave your feedback [here](#problems-questions-feedback). +> Docker support was [merged recently](https://github.com/chrivers/bifrost/pull/2). +> If you encounter any bugs, or have suggestions, feel free to leave your feedback [here](#problems-questions-feedback). To install Bifrost with Docker, you will need the following: From c4cafae2c7bbd99b2623b8fbd07f4eb3b86e8c04 Mon Sep 17 00:00:00 2001 From: ellwoodb <73251578+ellwoodb@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:31:26 +0200 Subject: [PATCH 3/4] Change config certs notice Co-authored-by: Christian Iversen Signed-off-by: ellwoodb <73251578+ellwoodb@users.noreply.github.com> --- config.example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.example.yaml b/config.example.yaml index d663437b..b8889729 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -1,5 +1,5 @@ bifrost: - # Optional but needed if using the Docker install method + # Override the default path to the one used in the docker image cert_file: "certs/cert.pem" bridge: From d1b5efe9313413904e7b2665fbb9a2716313493e Mon Sep 17 00:00:00 2001 From: ellwoodb Date: Fri, 23 Aug 2024 21:51:20 +0200 Subject: [PATCH 4/4] Use relative paths in compose; Fix some issues with readme --- README.md | 18 +++++++++++------- docker-compose.yaml | 8 +++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b0126379..32029358 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,6 @@ There are currently two ways you can install Bifrost. 1. [Install manualy](#manual) from source (for now, this is the preferred method) 2. [Install it via Docker](#docker) (still WIP, some aspects may not be optimal for now) -When you have these things available, you can download - ### Manual To install Bifrost from source, you will need the following: @@ -108,13 +106,15 @@ The Philips Hue app should be able to find it on your network! > [!WARNING] > Docker support was [merged recently](https://github.com/chrivers/bifrost/pull/2). -> If you encounter any bugs, or have suggestions, feel free to leave your feedback [here](#problems-questions-feedback). +> If you encounter any bugs, or have suggestions, feel free to leave your feedback +> [here](#problems-questions-feedback). To install Bifrost with Docker, you will need the following: 1. At least one zigbee2mqtt server to connect to 2. The MAC address of the network interface you want to run the server on -3. A running [Docker](https://docs.docker.com/engine/install/) instance with [Docker-Compose](https://docs.docker.com/compose/install/) installed +3. A running [Docker](https://docs.docker.com/engine/install/) instance + with [Docker-Compose](https://docs.docker.com/compose/install/) installed 4. Have `git` installed to clone this repository When you have these things available, you can install Bifrost by running these commands: @@ -130,9 +130,12 @@ Then rename or copy our `config.example.yaml`: cp config.example.yaml config.yaml ``` -And edit it with your favorite editor to your liking (see [configuration reference](doc/config-reference.md)). +And edit it with your favorite editor to your liking (see +[configuration reference](doc/config-reference.md)). -Also edit the mounts in the `docker-compose.yaml` to the paths you put your config.yaml (can also be relative, e.g., `./config.yaml`) and where you want to put the certificates, Bifrost creates. +If you want to put your configuration file or the certificates Bifrost creates somewhere +else, you also need to adjust the mount paths in the `docker-compose.yaml`. Otherwise, +just leave the default values. Now you are ready to run the app with: @@ -142,7 +145,8 @@ docker compose up -d This will build and then start the app on your Docker instance. -To view the logs, use a tool like [Portainer](https://www.portainer.io/) or run the following command: +To view the logs, use a tool like [Portainer](https://www.portainer.io/) or +run the following command: ``` docker logs bifrost diff --git a/docker-compose.yaml b/docker-compose.yaml index f31e8c92..c695944c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,8 +5,6 @@ services: restart: unless-stopped network_mode: host volumes: - # If you followed the guide on our readme, you could also use relative paths: - # - ./config.yaml:/app/config.yaml - # - ./certs:/app/certs - - /path/to/app-data/config.yaml:/app/config.yaml - - /path/to/app-data/certs:/app/certs + # If you followed the guide on our readme, these paths work out of the box + - ./config.yaml:/app/config.yaml + - ./certs:/app/certs