mirror of
https://github.com/koush/scrypted.git
synced 2026-03-06 19:22:00 +00:00
diagnostics: more domain checks
This commit is contained in:
4
plugins/diagnostics/package-lock.json
generated
4
plugins/diagnostics/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user