Merge pull request #1840 from tomfrenzel/matterjs-fixes
fix(matterjs-server): use local install
This commit is contained in:
@@ -24,30 +24,30 @@ function update_script() {
|
|||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -f /usr/local/bin/matter-server ]]; then
|
if [[ ! -d /opt/matter-server ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CURRENT=$(npm list -g matter-server --depth=0 2>/dev/null | grep matter-server | sed 's/.*@//')
|
CURRENT=$(cat /opt/matter-server/node_modules/matter-server/package.json | grep '"version"' | head -1 | sed 's/.*"\([^"]*\)".*/\1/')
|
||||||
LATEST=$(npm show matter-server version 2>/dev/null)
|
LATEST=$(npm view matter-server version 2>/dev/null)
|
||||||
if [[ "$CURRENT" == "$LATEST" ]]; then
|
if [[ "$CURRENT" != "$LATEST" ]]; then
|
||||||
|
msg_info "Stopping Service"
|
||||||
|
systemctl stop matterjs-server
|
||||||
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
|
msg_info "Updating ${APP} from v${CURRENT} to v${LATEST}"
|
||||||
|
cd /opt/matter-server
|
||||||
|
$STD npm install matter-server@latest
|
||||||
|
msg_ok "Updated ${APP}"
|
||||||
|
|
||||||
|
msg_info "Starting Service"
|
||||||
|
systemctl start matterjs-server
|
||||||
|
msg_ok "Started Service"
|
||||||
|
msg_ok "Updated successfully!"
|
||||||
|
else
|
||||||
msg_ok "No update required. ${APP} is already at v${LATEST}"
|
msg_ok "No update required. ${APP} is already at v${LATEST}"
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "Stopping Service"
|
|
||||||
systemctl stop matterjs-server
|
|
||||||
msg_ok "Stopped Service"
|
|
||||||
|
|
||||||
msg_info "Updating ${APP} to v${LATEST}"
|
|
||||||
$STD npm install -g matter-server
|
|
||||||
msg_ok "Updated ${APP} to v${LATEST}"
|
|
||||||
|
|
||||||
msg_info "Starting Service"
|
|
||||||
systemctl start matterjs-server
|
|
||||||
msg_ok "Started Service"
|
|
||||||
msg_ok "Updated successfully!"
|
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ update_os
|
|||||||
NODE_VERSION="22" setup_nodejs
|
NODE_VERSION="22" setup_nodejs
|
||||||
|
|
||||||
msg_info "Installing MatterJS-Server"
|
msg_info "Installing MatterJS-Server"
|
||||||
$STD npm install -g matter-server
|
mkdir -p /opt/matter-server
|
||||||
|
cd /opt/matter-server
|
||||||
|
$STD npm install matter-server
|
||||||
mkdir -p /var/lib/matterjs-server
|
mkdir -p /var/lib/matterjs-server
|
||||||
msg_ok "Installed MatterJS-Server"
|
msg_ok "Installed MatterJS-Server"
|
||||||
|
|
||||||
@@ -29,7 +31,7 @@ After=network.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=root
|
User=root
|
||||||
ExecStart=/usr/local/bin/matter-server --storage-path /var/lib/matterjs-server
|
ExecStart=/usr/bin/node /opt/matter-server/node_modules/matter-server/dist/esm/MatterServer.js --storage-path /var/lib/matterjs-server
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"interface_port": 5580,
|
"interface_port": 5580,
|
||||||
"documentation": "https://github.com/matter-js/matterjs-server",
|
"documentation": "https://github.com/matter-js/matterjs-server",
|
||||||
"website": "https://github.com/matter-js/matterjs-server",
|
"website": "https://github.com/matter-js/matterjs-server",
|
||||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/home-assistant.webp",
|
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/matter.webp",
|
||||||
"description": "JavaScript-based Matter controller server (successor to Python Matter Server). Provides a WebSocket API compatible with the Home Assistant Matter integration.",
|
"description": "JavaScript-based Matter controller server (successor to Python Matter Server). Provides a WebSocket API compatible with the Home Assistant Matter integration.",
|
||||||
"install_methods": [
|
"install_methods": [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user