From 8dbf751cd9fe1be0b894b099d3013bfae45ca817 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Thu, 21 Mar 2024 22:22:38 -0700 Subject: [PATCH] core: update lxc with avahi support --- plugins/core/fs/{ => lxc}/scrypted.service | 3 +++ plugins/core/package-lock.json | 4 ++-- plugins/core/package.json | 2 +- plugins/core/src/platform/lxc.ts | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) rename plugins/core/fs/{ => lxc}/scrypted.service (68%) diff --git a/plugins/core/fs/scrypted.service b/plugins/core/fs/lxc/scrypted.service similarity index 68% rename from plugins/core/fs/scrypted.service rename to plugins/core/fs/lxc/scrypted.service index 73cc39df4..fe46a3967 100644 --- a/plugins/core/fs/scrypted.service +++ b/plugins/core/fs/lxc/scrypted.service @@ -10,6 +10,9 @@ ExecStart=/usr/bin/npx -y scrypted serve Restart=on-failure RestartSec=3 Environment="NODE_OPTIONS=--dns-result-order=ipv4first" +Environment="SCRYPTED_PYTHON_PATH=/usr/bin/python3" +Environment="SCRYPTED_PYTHON39_PATH=/usr/bin/python3.9" +Environment="SCRYPTED_PYTHON310_PATH=/usr/bin/python3.10" Environment="SCRYPTED_FFMPEG_PATH=/usr/bin/ffmpeg" Environment="SCRYPTED_INSTALL_ENVIRONMENT=lxc" diff --git a/plugins/core/package-lock.json b/plugins/core/package-lock.json index 4691886c6..42320c152 100644 --- a/plugins/core/package-lock.json +++ b/plugins/core/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/core", - "version": "0.3.15", + "version": "0.3.16", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/core", - "version": "0.3.15", + "version": "0.3.16", "license": "Apache-2.0", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/core/package.json b/plugins/core/package.json index b9c34de96..c38d38d29 100644 --- a/plugins/core/package.json +++ b/plugins/core/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/core", - "version": "0.3.15", + "version": "0.3.16", "description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.", "author": "Scrypted", "license": "Apache-2.0", diff --git a/plugins/core/src/platform/lxc.ts b/plugins/core/src/platform/lxc.ts index a2ed9fb73..a39f61d63 100644 --- a/plugins/core/src/platform/lxc.ts +++ b/plugins/core/src/platform/lxc.ts @@ -20,7 +20,7 @@ export async function checkLxcDependencies() { } if (!fs.existsSync('/var/run/avahi-daemon/socket')) { - const cp = child_process.spawn('sh', ['-c', 'apt install avahi-daemon']); + const cp = child_process.spawn('sh', ['-c', 'apt update && apt install avahi-daemon && apt upgrade']); const [exitCode] = await once(cp, 'exit'); if (exitCode !== 0) sdk.log.a('Failed to install avahi-daemon.'); @@ -28,7 +28,7 @@ export async function checkLxcDependencies() { needRestart = true; } - const scryptedService = fs.readFileSync('scrypted.service').toString(); + const scryptedService = fs.readFileSync('lxc/scrypted.service').toString(); const installedScryptedService = fs.readFileSync('/etc/systemd/system/scrypted.service').toString(); if (installedScryptedService !== scryptedService) {