From 31e8c11d6c68b83d6e822d2badace3d971bddb4a Mon Sep 17 00:00:00 2001 From: MickLesk Date: Wed, 20 May 2026 15:20:03 +0200 Subject: [PATCH] matterjs --- ct/matterjs-server.sh | 61 ++++++++++++++++++++++++++++++ install/matterjs-server-install.sh | 44 +++++++++++++++++++++ json/matterjs-server.json | 44 +++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 ct/matterjs-server.sh create mode 100644 install/matterjs-server-install.sh create mode 100644 json/matterjs-server.json diff --git a/ct/matterjs-server.sh b/ct/matterjs-server.sh new file mode 100644 index 00000000..0abb8e0b --- /dev/null +++ b/ct/matterjs-server.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: community-scripts +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/matter-js/matterjs-server + +APP="MatterJS-Server" +var_tags="${var_tags:-matter;iot;smarthome;homeassistant}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -f /usr/local/bin/matter-server ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + CURRENT=$(npm list -g matter-server --depth=0 2>/dev/null | grep matter-server | sed 's/.*@//') + LATEST=$(npm show matter-server version 2>/dev/null) + if [[ "$CURRENT" == "$LATEST" ]]; then + msg_ok "No update required. ${APP} is already at v${LATEST}" + exit + 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 +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5580${CL}" diff --git a/install/matterjs-server-install.sh b/install/matterjs-server-install.sh new file mode 100644 index 00000000..b3e39987 --- /dev/null +++ b/install/matterjs-server-install.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: community-scripts +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/matter-js/matterjs-server + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +NODE_VERSION="22" setup_nodejs + +msg_info "Installing MatterJS-Server" +$STD npm install -g matter-server +mkdir -p /var/lib/matterjs-server +msg_ok "Installed MatterJS-Server" + +msg_info "Creating Service" +cat </etc/systemd/system/matterjs-server.service +[Unit] +Description=MatterJS Server +After=network.target + +[Service] +Type=simple +User=root +ExecStart=/usr/local/bin/matter-server --storage-path /var/lib/matterjs-server +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now matterjs-server +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc diff --git a/json/matterjs-server.json b/json/matterjs-server.json new file mode 100644 index 00000000..467cf31a --- /dev/null +++ b/json/matterjs-server.json @@ -0,0 +1,44 @@ +{ + "name": "MatterJS-Server", + "slug": "matterjs-server", + "categories": [ + 16 + ], + "date_created": "2026-05-20", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 5580, + "documentation": "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", + "description": "JavaScript-based Matter controller server (successor to Python Matter Server). Provides a WebSocket API compatible with the Home Assistant Matter integration.", + "install_methods": [ + { + "type": "default", + "script": "ct/matterjs-server.sh", + "config_path": null, + "resources": { + "cpu": 2, + "ram": 1024, + "hdd": 4, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "This is a Beta version. Not yet officially CSA-certified.", + "type": "warning" + }, + { + "text": "For Matter-over-Thread (Thread Border Router), IPv6 must be enabled in the LXC container.", + "type": "info" + } + ] +}