diff --git a/plugins/diagnostics/package-lock.json b/plugins/diagnostics/package-lock.json index e1c2372bf..900a8bcd6 100644 --- a/plugins/diagnostics/package-lock.json +++ b/plugins/diagnostics/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/diagnostics", - "version": "0.0.29", + "version": "0.0.30", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/diagnostics", - "version": "0.0.29", + "version": "0.0.30", "dependencies": { "@scrypted/common": "file:../../common", "@scrypted/sdk": "file:../../sdk", diff --git a/plugins/diagnostics/package.json b/plugins/diagnostics/package.json index d21bd52df..db5df03cf 100644 --- a/plugins/diagnostics/package.json +++ b/plugins/diagnostics/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/diagnostics", - "version": "0.0.29", + "version": "0.0.30", "scripts": { "scrypted-setup-project": "scrypted-setup-project", "prescrypted-setup-project": "scrypted-package-json", diff --git a/plugins/diagnostics/src/main.ts b/plugins/diagnostics/src/main.ts index 2ddbaa306..9ee784329 100644 --- a/plugins/diagnostics/src/main.ts +++ b/plugins/diagnostics/src/main.ts @@ -406,6 +406,11 @@ class DiagnosticsPlugin extends ScryptedDeviceBase implements Settings { throw new Error('Unrecognized Linux installation. Installation via Docker image or the official Proxmox LXC script (not tteck) is recommended: https://docs.scrypted.app/installation'); }); + await this.validate(this.console, 'Host OS', async () => { + const installEnv = process.env.SCRYPTED_INSTALL_ENVIRONMENT || 'unknown'; + return `${os.type()} ${os.release()} (${os.platform()}/${os.arch()}) [${installEnv}]`; + }); + await this.validate(this.console, 'IPv4 (jsonip.com)', httpFetch({ url: 'https://jsonip.com', family: 4, @@ -630,6 +635,22 @@ class DiagnosticsPlugin extends ScryptedDeviceBase implements Settings { } }); + await this.validate(this.console, 'External Resource Access (DNS)', async () => { + const domains = [ + 'cdn-lfs-us-1.hf.co', + 'cdn-lfs-eu-1.hf.co', + 'cdn-lfs.hf.co', + 'cas-bridge.xethub.hf.co' + ]; + + for (const domain of domains) { + const addresses = await dns.promises.resolve4(domain); + if (addresses.some(ip => ip === '0.0.0.0')) { + throw new Error(`${domain} resolves to 0.0.0.0 (DNS blocking detected)`); + } + } + }); + if (nvrPlugin) { await this.validate(this.console, "GPU Decode", async () => { const ffmpegPath = await sdk.mediaManager.getFFmpegPath();