Compare commits

..
Author SHA1 Message Date
MickLesk aa2628d270 PS5-MQTT: give the build 2 GB of RAM
Building the client and server bundles with rspack is killed by the OOM killer at 512 MB.
2026-10-31 19:02:56 +01:00
MickLesk 55fff9f8bd PS5-MQTT: build the yarn workspace and run the packaged server
v1.8.0 turned the repo into a yarn 4 workspace with Plug'n'Play: ps5-mqtt/package.json is gone and npm install there fails. The server now runs from the packaged tree with its own node_modules, as upstream's image does; updates move the unit's working directory.
2026-10-31 18:55:40 +01:00
3 changed files with 34 additions and 11 deletions

No files matched your search

+9 -5
View File
@@ -9,7 +9,7 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
APP="PS5-MQTT"
var_tags="${var_tags:-smarthome;automation}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-3}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
@@ -37,12 +37,16 @@ function update_script() {
systemctl stop ps5-mqtt
msg_ok "Stopped service"
fetch_and_deploy_gh_release "ps5-mqtt" "FunkeyFlo/ps5-mqtt" "tarball"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ps5-mqtt" "FunkeyFlo/ps5-mqtt" "tarball"
msg_info "Configuring ${APP}"
cd /opt/ps5-mqtt/ps5-mqtt/
$STD npm install
$STD npm run build
cd /opt/ps5-mqtt
$STD corepack yarn install --immutable
$STD env PREPARE_ONLY=1 corepack yarn workspace @ps5-mqtt/server run package
cd /opt/ps5-mqtt/ps5-mqtt/server/.packaged/server
$STD npm install --omit=dev --omit=optional
sed -i 's|^WorkingDirectory=.*|WorkingDirectory=/opt/ps5-mqtt/ps5-mqtt/server/.packaged|' /etc/systemd/system/ps5-mqtt.service
systemctl daemon-reload
msg_ok "Configured ${APP}"
msg_info "Starting service"
+6 -4
View File
@@ -23,9 +23,11 @@ NODE_VERSION="24" NODE_MODULE="playactor" setup_nodejs
fetch_and_deploy_gh_release "ps5-mqtt" "FunkeyFlo/ps5-mqtt" "tarball"
msg_info "Configuring PS5-MQTT"
cd /opt/ps5-mqtt/ps5-mqtt/
$STD npm install
$STD npm run build
cd /opt/ps5-mqtt
$STD corepack yarn install --immutable
$STD env PREPARE_ONLY=1 corepack yarn workspace @ps5-mqtt/server run package
cd /opt/ps5-mqtt/ps5-mqtt/server/.packaged/server
$STD npm install --omit=dev --omit=optional
mkdir -p /opt/.config/ps5-mqtt/
mkdir -p /opt/.config/ps5-mqtt/playactor
cat <<EOF >/opt/.config/ps5-mqtt/config.json
@@ -66,7 +68,7 @@ Description=PS5-MQTT Daemon
After=syslog.target network.target
[Service]
WorkingDirectory=/opt/ps5-mqtt/ps5-mqtt
WorkingDirectory=/opt/ps5-mqtt/ps5-mqtt/server/.packaged
Environment="CONFIG_PATH=/opt/.config/ps5-mqtt/config.json"
Environment="DEBUG='@ha:ps5:*'"
Restart=always
+19 -2
View File
@@ -391,7 +391,24 @@ msg_ok "Created VM shell"
# ==============================================================================
# DISK IMPORT
# ==============================================================================
vm_import_disk "$VMID" "$WORK_FILE" "$STORAGE" "${DISK_IMPORT#--format }" || exit 226
msg_info "Importing disk into storage ($STORAGE)"
if qm disk import --help >/dev/null 2>&1; then
IMPORT_CMD=(qm disk import)
else
IMPORT_CMD=(qm importdisk)
fi
IMPORT_OUT="$("${IMPORT_CMD[@]}" "$VMID" "$WORK_FILE" "$STORAGE" ${DISK_IMPORT:-} 2>&1 || true)"
DISK_REF_IMPORTED="$(printf '%s\n' "$IMPORT_OUT" | sed -n "s/.*successfully imported disk '\([^']\+\)'.*/\1/p" | tr -d "\r\"'")"
[[ -z "$DISK_REF_IMPORTED" ]] && DISK_REF_IMPORTED="$(pvesm list "$STORAGE" | awk -v id="$VMID" '$5 ~ ("vm-"id"-disk-") {print $1":"$5}' | sort | tail -n1)"
[[ -z "$DISK_REF_IMPORTED" ]] && {
msg_error "Unable to determine imported disk reference."
echo "$IMPORT_OUT"
exit 226
}
msg_ok "Imported disk (${CL}${BL}${DISK_REF_IMPORTED}${CL})"
# Clean up work file
rm -f "$WORK_FILE"
@@ -403,7 +420,7 @@ msg_info "Attaching EFI and root disk"
qm set "$VMID" \
--efidisk0 "${STORAGE}:0,efitype=4m" \
--scsi0 "${VM_IMPORTED_DISK},${DISK_CACHE}${THIN%,}" \
--scsi0 "${DISK_REF_IMPORTED},${DISK_CACHE}${THIN%,}" \
--boot order=scsi0 \
--serial0 socket >/dev/null