diagnostics: more domain checks

This commit is contained in:
Koushik Dutta
2026-03-05 08:41:22 -08:00
parent 0aa4118828
commit f62976b979
3 changed files with 24 additions and 3 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -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();