Skip to content

Commit

Permalink
Merge pull request #147 from Luligu/dev
Browse files Browse the repository at this point in the history
Release 1.5.10
  • Loading branch information
Luligu authored Oct 1, 2024
2 parents 4581c31 + 901b90d commit 4ce3a4d
Show file tree
Hide file tree
Showing 25 changed files with 403 additions and 280 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/docker-buildx-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
docker buildx build \
--platform linux/arm64 \
-f docker/Dockerfile.shelly.bookworm \
-f docker/Dockerfile.dev_shelly.bookworm \
-t luligu/matterbridge:dev_shelly \
--push .
docker manifest inspect luligu/matterbridge:dev_shelly
Expand All @@ -73,3 +73,13 @@ jobs:
docker manifest inspect luligu/matterbridge:dev
timeout-minutes: 60

- name: Run Docker Buildx on test
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
-f docker/Dockerfile.latest \
-t luligu/matterbridge:test \
--push .
docker manifest inspect luligu/matterbridge:test
timeout-minutes: 60

3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,5 @@ test

migrationV8.txt
migrationV8-answered.txt
TODO.md
TODO.md
CODEOWNERS
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ If you like this project and find it useful, please consider giving it a star on
### Home Assistant Community Add-ons

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.

If you want to run Matterbridge in Home Assistant please use the official add-on https://github.com/Luligu/matterbridge-home-assistant-addon.

### New Apple firmware v. 18.0
Expand All @@ -19,6 +20,18 @@ Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord

Feel free to join!

## [1.5.10] - 2024-10-01

### Changed

- [matterbridge]: Added '--omit=dev' to all install commands to save space and time on low powered devices.
- [matterbridge]: Integrated the DeviceManager class and removed the old array.
- [package]: Update dependencies.

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

## [1.5.9] - 2024-09-23

### Fixed
Expand Down
16 changes: 10 additions & 6 deletions README-DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,27 @@ Matterbridge exports from:

- NodeStorage classes.

# ****\*\*****
# \***\*\*\*\*\***

A plugin must never install or import from `matter-node.js` or `matter.js` directly, as this leads to a second instance of `matter.js`, causing instability and unpredictable errors such as "The only instance is Endpoint". Additionally, when Matterbridge updates the `matter.js` version, it should be consistent across all plugins.
A plugin must never install or import from `matter-node.js` or `matter.js` directly (neither as a dependency, devDependency, nor peerDependency), as this leads to a second instance of `matter.js`, causing instability and unpredictable errors such as "The only instance is Endpoint".

# ****\*\*****
Additionally, when Matterbridge updates the `matter.js` version, it should be consistent across all plugins.

A plugin must never install Matterbridge (neither as dependencies nor as devDependencies). Matterbridge must be linked to the plugin:
# \***\*\*\*\*\***

A plugin must never install Matterbridge (neither as a dependency, devDependency, nor peerDependency).

Matterbridge must be linked to the plugin in development only.

```json
"scripts": {
'''
"install": "node link-matterbridge-script.js",
"dev:link": "npm link matterbridge",
'''
}
```

# ****\*\*****
# \***\*\*\*\*\***

In the next releases I will remove the duplicated exports so please update your plugins.

Expand Down
2 changes: 2 additions & 0 deletions README-PODMAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ 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).

Expand All @@ -56,6 +57,7 @@ podman run --name matterbridge \
```

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.

Expand Down
48 changes: 43 additions & 5 deletions README-SERVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,48 +105,86 @@ sudo journalctl -u matterbridge.service -f --output cat

### Delete the logs older then 3 days (all of them not only the ones of Matterbridge!)

Check the space used

```
sudo journalctl --disk-usage
```

remove all log older then 3 days

```
sudo journalctl --rotate
sudo journalctl --vacuum-time=3d
```

If you want to make the setting permanent edit
## Prevent the journal logs to grow

If you want to make the setting permanent to prevent the journal logs to grow too much, run

```
sudo nano /etc/systemd/journald.conf
```

add

```
SystemMaxUse=3d
Compress=yes # Compress logs
MaxRetentionSec=3days # Keep logs for a maximum of 3 days.
MaxFileSec=1day # Rotate logs daily within the 3-day retention period.
ForwardToSyslog=no # Disable forwarding to syslog to prevent duplicate logging.
SystemMaxUse=100M # Limit persistent logs in /var/log/journal to 100 MB.
RuntimeMaxUse=100M # Limit runtime logs in /run/log/journal to 100 MB.
```

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
## 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 npm install -g matterbridge
```

If you are not prompted for a password, no further action is required.

If that is not the case, open the sudoers file for editing using visudo

```
sudo visudo
```

verify the presence of of a line

```
@includedir /etc/sudoers.d
```

exit and create a configuration file for sudoers

```
sudo nano /etc/sudoers.d/matterbridge
```

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

```
<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)
or if you prefers to only give access to npm without password try with (e.g. radxa ALL=(ALL) NOPASSWD: /usr/bin/npm)

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

save the file and restart the system.
save the file and reload the settings with:

```
sudo visudo -c
```
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,52 @@ matterbridge -factoryreset

This will reset the internal storages. All commissioning informations will be lost. All plugins will be unregistered.

# Frequently asked questions

## How to enable HTTPS for the frontend

### Provide your own certificates

Place your own certificates in the `.matterbridge/cert` directory:

- `cert.pem`
- `key.pem`
- `ca.pem` (optional)

![image](https://github.com/user-attachments/assets/846785ca-6f5c-458b-b786-a6417a4da319)

### Change the command line

Add the **-ssl** parameter to the command line. If desired, you can also change the frontend port with **-frontend 443**.

```sh
matterbridge -ssl -frontend 443
```

### Restart

If the certificate are correctly configured, you will be able to connect with https to the frontend.

![image](https://github.com/user-attachments/assets/9c38776d-064f-4d91-9359-a2cd3319b1ff)

## How to send the debug log files

### Enable debug and log on file

In the frontend, go to settings and enable debug mode as shown below:

![Debug Matterbridge Settings](https://github.com/user-attachments/assets/83181dc2-969a-4b71-aff4-f1498fa1d665)

![Debug Matter Settings](https://github.com/user-attachments/assets/617961a9-7cb0-46cf-9878-981f61738f8c)

### Restart

Wait a few minutes to allow the logs to to accumulate.

Then, from the dots menu in the frontend, download the `matterbridge.log` and `matter.log` files.

![image](https://github.com/user-attachments/assets/04ba65f6-594a-4ff8-9732-3df049f5a33e)

# Known general issues

## Session XYZ does not exist
Expand Down
30 changes: 15 additions & 15 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -12,68 +12,68 @@ RUN apt-get update && \

FROM base AS builder
WORKDIR /app
COPY ./package.json ./package-lock.json ./tsconfig.json ./
COPY ./package.json ./package-lock.json ./tsconfig.json ./.npmignore ./
COPY ./src ./src
COPY ./frontend/build ./frontend/build
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack && npm link
RUN npm ci && npm run build && npm link && npm shrinkwrap && npm pack

WORKDIR /matterbridge-zigbee2mqtt
RUN GIT_SSL_NO_VERIFY=true git clone -b dev https://github.com/Luligu/matterbridge-zigbee2mqtt.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
RUN npm ci && npm run build && npm shrinkwrap && npm pack

WORKDIR /matterbridge-somfy-tahoma
RUN GIT_SSL_NO_VERIFY=true git clone -b dev https://github.com/Luligu/matterbridge-somfy-tahoma.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
RUN npm ci && npm run build && npm shrinkwrap && npm pack

WORKDIR /matterbridge-shelly
RUN GIT_SSL_NO_VERIFY=true git clone -b dev https://github.com/Luligu/matterbridge-shelly.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
# COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm link matterbridge && npm run build && npm shrinkwrap && npm pack

WORKDIR /matterbridge-example-accessory-platform
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-example-accessory-platform.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
RUN npm ci && npm run build && npm shrinkwrap && npm pack

WORKDIR /matterbridge-example-dynamic-platform
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-example-dynamic-platform.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
RUN npm ci && npm run build && npm shrinkwrap && npm pack

WORKDIR /matterbridge-eve-door
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-door.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
RUN npm ci && npm run build && npm shrinkwrap && npm pack

WORKDIR /matterbridge-eve-motion
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-motion.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
RUN npm ci && npm run build && npm shrinkwrap && npm pack

WORKDIR /matterbridge-eve-energy
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-energy.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
RUN npm ci && npm run build && npm shrinkwrap && npm pack

WORKDIR /matterbridge-eve-room
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-room.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
RUN npm ci && npm run build && npm shrinkwrap && npm pack

WORKDIR /matterbridge-eve-weather
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-weather.git .
COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && npm run build && npm shrinkwrap --omit=dev && npm pack
RUN npm ci && npm run build && npm shrinkwrap && npm pack



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

COPY --from=builder /app/*.tgz .
RUN npm install -g npm@latest && npm -g install *.tgz && rm *.tgz
RUN npm install -g npm@latest && npm install -g --omit=dev *.tgz && rm *.tgz

COPY --from=builder /matterbridge-zigbee2mqtt/*.tgz .
COPY --from=builder /matterbridge-somfy-tahoma/*.tgz .
Expand All @@ -85,6 +85,6 @@ COPY --from=builder /matterbridge-eve-motion/*.tgz .
COPY --from=builder /matterbridge-eve-energy/*.tgz .
COPY --from=builder /matterbridge-eve-room/*.tgz .
COPY --from=builder /matterbridge-eve-weather/*.tgz .
RUN npm install -g *.tgz && rm *.tgz && node -v && npm -v && npm list -g
RUN npm install -g --omit=dev *.tgz && rm *.tgz && node -v && npm -v && npm list -g

CMD ["matterbridge", "-docker"]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,34 @@ RUN apt-get update && \

# Build Matterbridge
WORKDIR /matterbridge
COPY ./package.json ./package-lock.json ./tsconfig.json ./
COPY ./package.json ./package-lock.json ./tsconfig.json ./.npmignore ./
COPY ./src ./src
COPY ./frontend/build ./frontend/build
RUN npm ci && \
npm run build && \
npm shrinkwrap --omit=dev && \
npm link && \
npm shrinkwrap && \
npm pack

# Build shelly plugin
WORKDIR /matterbridge-shelly
RUN GIT_SSL_NO_VERIFY=true git clone -b dev https://github.com/Luligu/matterbridge-shelly.git .
COPY ./docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
# COPY ./docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js
RUN npm ci && \
npm link matterbridge && \
npm run build && \
npm shrinkwrap --omit=dev && \
npm shrinkwrap && \
npm pack


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

COPY --from=base /matterbridge/*.tgz .
RUN npm install -g npm@latest && npm -g install *.tgz && rm *.tgz
RUN npm install -g npm@latest && npm install -g --omit=dev *.tgz && rm *.tgz

COPY --from=base /matterbridge-shelly/*.tgz .
RUN npm -g install *.tgz && rm *.tgz
RUN npm install -g --omit=dev *.tgz && rm *.tgz

# Copy and execute the entrypoint script
COPY ./docker/shellyEntrypoint.sh ./
Expand Down
File renamed without changes.
Loading

0 comments on commit 4ce3a4d

Please sign in to comment.