Skip to content

Commit

Permalink
Merge pull request #136 from Luligu/dev
Browse files Browse the repository at this point in the history
Release 1.5.8
  • Loading branch information
Luligu authored Sep 21, 2024
2 parents 9ac134c + c9fc6a2 commit 2cfe2ec
Show file tree
Hide file tree
Showing 14 changed files with 395 additions and 724 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/docker-buildx-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ jobs:
run: |
echo "Extracted version is: $VERSION ${{ env.VERSION }}"
- name: Run Docker Buildx on shelly
run: |
docker buildx build \
--platform linux/arm64 \
-f docker/Dockerfile.shelly \
-t luligu/matterbridge:shelly \
--push .
docker manifest inspect luligu/matterbridge:shelly
timeout-minutes: 60

- name: Run Docker Buildx on dev_shelly
run: |
docker buildx build \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-buildx-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
-f docker/Dockerfile.main \
-f docker/Dockerfile.latest \
-t luligu/matterbridge:latest \
-t luligu/matterbridge:${{ env.VERSION }} \
--push .
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@ If you like this project and find it useful, please consider giving it a star on

The Home Assistant Community Add-ons and plugins are not verified to work with Matterbridge. I strongly advise against using them. If you do use them and encounter an issue (which is likely because some do not meet the Matterbridge guidelines), please do not open an issue in the Matterbridge repository.

### New Apple firmware v. 18.0

Please read this: https://github.com/Luligu/matterbridge/discussions/135

## [1.5.8] - 2024-09-21

### Added

- [readme]: Added podman guidelines to the README.md
- [readme]: Added instructions for setting permanent journalctl settings in service mode to prevent journal to grow
- [readme]: Added instructions for removing sudo password for npm install in service mode
- [readme]: Refactor systemd instructions for Matterbridge service
- [readme]: Added link to install matterbridge like ha addon https://github.com/Luligu/matterbridge-home-assistant-addon

### Changed

- [package]: Update matter-node.js to 0.10.5.
- [package]: Update matter-history to 1.1.15.
- [package]: Update dependencies.
- [matterbridge]: Reset session informations when the controllers are not connected.

<a href="https://www.buymeacoffee.com/luligugithub">
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
</a>

## [1.5.7] - 2024-09-17

### Added
Expand Down
105 changes: 105 additions & 0 deletions README-PODMAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# <img src="https://github.com/Luligu/matterbridge/blob/main/frontend/public/matterbridge%2064x64.png" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge

[![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
[![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
[![Docker Version](https://img.shields.io/docker/v/luligu/matterbridge?label=docker%20version&sort=semver)](https://hub.docker.com/r/luligu/matterbridge)
[![Docker Pulls](https://img.shields.io/docker/pulls/luligu/matterbridge.svg)](https://hub.docker.com/r/luligu/matterbridge)
![Node.js CI](https://github.com/Luligu/matterbridge/actions/workflows/build.yml/badge.svg)

[![power by](https://img.shields.io/badge/powered%20by-matter--history-blue)](https://www.npmjs.com/package/matter-history)
[![power by](https://img.shields.io/badge/powered%20by-node--ansi--logger-blue)](https://www.npmjs.com/package/node-ansi-logger)
[![power by](https://img.shields.io/badge/powered%20by-node--persist--manager-blue)](https://www.npmjs.com/package/node-persist-manager)

---

# Advanced configuration

## Install Podman if it is not already installed

```
cd ~
sudo apt update
sudo apt install podman -y
podman --version
```

## Run matterbridge with podman

The Matterbridge Docker image, which includes a manifest list for the linux/amd64, linux/arm64 and linux/arm/v7 architectures, is published on Docker Hub and can be used with podman.

Podman handles container restarts a little differently than Docker. The --restart always flag doesn’t work exactly the same. If you want the container to automatically restart when the system reboots or if it crashes, you can create a systemd unit for the Podman container.

### First create the Matterbridge directories

This will create the required directories if they don't exist

```
cd ~
mkdir -p ./Matterbridge
mkdir -p ./.matterbridge
sudo chown -R $USER:$USER ./Matterbridge ./.matterbridge
```

You may need to adapt the script to your setup:
- ./Matterbridge is the position outside of the container of your matterbridge plugin directory (inside your home directory).
- ./.matterbridge is the position outside of the container of your matterbridge storage directory (inside your home directory).

### Run the Podman container (root mode) and start it

The container must have full access to the host network (needed for matter mdns).

```
podman run --name matterbridge \
-v ~/Matterbridge:/root/Matterbridge \
-v ~/.matterbridge:/root/.matterbridge \
--network host --restart always -d docker.io/luligu/matterbridge:latest
```

You may need to adapt the script to your setup:
- ~/Matterbridge is the position outside of the container of your matterbridge plugin directory.
- ~/.matterbridge is the position outside of the container of your matterbridge storage directory.

### Integrate the mattebridge podman container with systemd for automatic startup after reboots

```
podman generate systemd --name matterbridge --files --new
sudo mv container-matterbridge.service /etc/systemd/system/
sudo systemctl enable container-matterbridge
sudo systemctl start container-matterbridge
```

### Start the Podman container

```
podman start matterbridge
```

### Stop the Podman container

```
podman stop matterbridge
```

### Restart the Podman container

```
podman restart matterbridge
```

### Remove the Podman container

```
podman rm matterbridge
```

### Shows the logs

```
podman logs matterbridge
```

### Shows the logs real time (tail)

```
podman logs --tail 1000 -f matterbridge
```
50 changes: 46 additions & 4 deletions README-SERVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ sudo systemctl stop matterbridge
sudo systemctl status matterbridge.service
```

### Enable Matterbridge to start automatically on boot

```
sudo systemctl enable matterbridge.service
```

### Disable Matterbridge from starting automatically on boot

```
sudo systemctl disable matterbridge.service
```

### View the log of Matterbridge in real time (this will show the log with colors)

```
Expand All @@ -84,14 +96,44 @@ sudo journalctl -u matterbridge.service -f --output cat
sudo journalctl --vacuum-time=3d
```

### Enable Matterbridge to start automatically on boot
If you want to make the setting permanent edit
```
sudo nano /etc/systemd/journald.conf
```
add
```
SystemMaxUse=3d
```
save it and run
```
sudo systemctl restart systemd-journald
```

### Verify that with your distro you can run sudo npm install -g matterbridge without the password

Run the following command to verify if you can install Matterbridge globally without being prompted for a password:

```
sudo systemctl enable matterbridge.service
sudo npm install -g matterbridge
```
If you are not prompted for a password, no further action is required.

### Disable Matterbridge from starting automatically on boot
If that is not the case open the sudoers file for editing using visudo
```
sudo visudo
```

add this line replacing USER with your user name (e.g. radxa ALL=(ALL) NOPASSWD: ALL)

```
sudo systemctl disable matterbridge.service
<USER> ALL=(ALL) NOPASSWD: ALL
```

or if you prefers to only give access to npm without password try (e.g. radxa ALL=(ALL) NOPASSWD: /usr/bin/npm)

```
<USER> ALL=(ALL) NOPASSWD: /usr/bin/npm
```

save the file and restart the system.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ Config editor:

[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-DOCKER.md)

### Run matterbridge with podman

[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-PODMAN.md)

### Run matterbridge as an home assistant add-on with the official add-on

[Advanced configurations](https://github.com/Luligu/matterbridge-home-assistant-addon)
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22-bullseye-slim AS base
FROM node:22-bookworm-slim AS base

WORKDIR /app
RUN apt-get update && \
Expand Down Expand Up @@ -69,7 +69,7 @@ RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack



FROM node:22-bullseye-slim AS release
FROM node:22-bookworm-slim AS release
WORKDIR /app

COPY --from=builder /app/*.tgz .
Expand Down
61 changes: 61 additions & 0 deletions docker/Dockerfile.latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM node:22-bookworm-slim AS builder
WORKDIR /app
COPY ./package.json ./
COPY ./tsconfig.json ./
COPY ./src ./src
COPY ./frontend/build ./frontend/build
RUN npm ci && npm run build && npm link


FROM builder AS release
WORKDIR /app
COPY --from=builder /app/package.json ./
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/frontend/build ./frontend/build
RUN npm link

# Install Matterbridge plugins
RUN npm install -g npm@latest && \
npm install -g matterbridge-zigbee2mqtt && \
npm install -g matterbridge-somfy-tahoma && \
npm install -g matterbridge-shelly && \
npm install -g matterbridge-example-accessory-platform && \
npm install -g matterbridge-example-dynamic-platform && \
npm install -g matterbridge-eve-door && \
npm install -g matterbridge-eve-motion && \
npm install -g matterbridge-eve-energy && \
npm install -g matterbridge-eve-room && \
npm install -g matterbridge-eve-weather && \
node -v && \
npm -v && \
npm list -g

WORKDIR /app
CMD ["matterbridge", "-docker"]








FROM node:22-bookworm-slim
WORKDIR /app
RUN npm install -g npm@latest && \
npm install -g matterbridge && \
npm install -g matterbridge-zigbee2mqtt && \
npm install -g matterbridge-somfy-tahoma && \
npm install -g matterbridge-shelly && \
npm install -g matterbridge-example-accessory-platform && \
npm install -g matterbridge-example-dynamic-platform && \
npm install -g matterbridge-eve-door && \
npm install -g matterbridge-eve-motion && \
npm install -g matterbridge-eve-energy && \
npm install -g matterbridge-eve-room && \
npm install -g matterbridge-eve-weather && \
node -v && \
npm -v && \
npm list -g
CMD ["matterbridge", "-docker"]
36 changes: 0 additions & 36 deletions docker/Dockerfile.main

This file was deleted.

12 changes: 12 additions & 0 deletions docker/Dockerfile.shelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:22-bookworm-slim
WORKDIR /app
COPY ./docker/shellyEntrypoint.sh ./
RUN chmod +x ./shellyEntrypoint.sh && \
npm install -g npm@latest && \
npm install -g matterbridge && \
npm install -g matterbridge-shelly && \
node -v && \
npm -v && \
npm list -g
ENTRYPOINT ["./shellyEntrypoint.sh"]
CMD ["matterbridge", "-docker"]
Loading

0 comments on commit 2cfe2ec

Please sign in to comment.