@scrypted/server 0.68.0 → 0.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cert.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export declare const CURRENT_SELF_SIGNED_CERTIFICATE_VERSION = "v2";
2
- export declare function createSelfSignedCertificate(): {
2
+ export declare function createSelfSignedCertificate(serviceKey?: string): {
3
3
  serviceKey: string;
4
4
  certificate: string;
5
5
  version: string;
package/dist/cert.js CHANGED
@@ -9,11 +9,19 @@ const node_forge_1 = __importDefault(require("node-forge"));
9
9
  const crypto_1 = __importDefault(require("crypto"));
10
10
  const { pki } = node_forge_1.default;
11
11
  exports.CURRENT_SELF_SIGNED_CERTIFICATE_VERSION = 'v2';
12
- function createSelfSignedCertificate() {
13
- // generate a keypair and create an X.509v3 certificate
14
- const keys = pki.rsa.generateKeyPair(2048);
12
+ function createSelfSignedCertificate(serviceKey) {
13
+ let privateKey;
15
14
  const cert = pki.createCertificate();
16
- cert.publicKey = keys.publicKey;
15
+ if (serviceKey) {
16
+ privateKey = pki.privateKeyFromPem(serviceKey);
17
+ cert.publicKey = pki.rsa.setPublicKey(privateKey.n, privateKey.e);
18
+ }
19
+ else {
20
+ // generate a keypair and create an X.509v3 certificate
21
+ const keys = pki.rsa.generateKeyPair(2048);
22
+ privateKey = keys.privateKey;
23
+ cert.publicKey = keys.publicKey;
24
+ }
17
25
  // NOTE: serialNumber is the hex encoded value of an ASN.1 INTEGER.
18
26
  // Conforming CAs should ensure serialNumber is:
19
27
  // - no more than 20 octets
@@ -64,9 +72,9 @@ function createSelfSignedCertificate() {
64
72
  name: 'subjectKeyIdentifier'
65
73
  }]);
66
74
  // self-sign certificate
67
- cert.sign(keys.privateKey);
75
+ cert.sign(privateKey);
68
76
  return {
69
- serviceKey: pki.privateKeyToPem(keys.privateKey),
77
+ serviceKey: pki.privateKeyToPem(privateKey),
70
78
  certificate: pki.certificateToPem(cert),
71
79
  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,CAAC,CAAC;YAChB,IAAI,EAAE,kBAAkB;YACxB,EAAE,EAAE,IAAI;SACX,EAAE;YACC,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,IAAI;YACjB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,IAAI;YACpB,eAAe,EAAE,IAAI;YACrB,gBAAgB,EAAE,IAAI;SACzB,EAAE;YACC,IAAI,EAAE,aAAa;YACnB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,IAAI;YACrB,YAAY,EAAE,IAAI;SACrB,EAAE;YACC,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,IAAI;YACX,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;YACX,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;SACd,EAAE;YACC,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE,CAAC;oBACP,IAAI,EAAE,CAAC,EAAE,KAAK;oBACd,EAAE,EAAE,WAAW;iBAClB,CAAC;SACL,EAAE;YACC,IAAI,EAAE,sBAAsB;SAC/B,CAAC,CAAC,CAAC;IAEJ,wBAAwB;IACxB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtB,OAAO;QACH,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC;QAC3C,WAAW,EAAE,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC;QACvC,OAAO,EAAE,+CAAuC;KACnD,CAAC;AACN,CAAC;AAxED,kEAwEC"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
2
  import { ChildProcess } from "child_process";
3
- export declare function safeKillFFmpeg(cp: ChildProcess): void;
3
+ export declare function safeKillFFmpeg(cp: ChildProcess): Promise<void>;
4
4
  export declare function ffmpegLogInitialOutput(console: Console, cp: ChildProcess, forever?: boolean, storage?: Storage): void;
5
5
  export declare function safePrintFFmpegArguments(console: Console, args: string[]): void;
@@ -5,22 +5,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.safePrintFFmpegArguments = exports.ffmpegLogInitialOutput = exports.safeKillFFmpeg = void 0;
7
7
  const process_1 = __importDefault(require("process"));
8
+ const sleep_1 = require("./sleep");
8
9
  const filtered = [
9
10
  'decode_slice_header error',
10
11
  'no frame!',
11
12
  'non-existing PPS',
12
13
  ];
13
- function safeKillFFmpeg(cp) {
14
+ async function safeKillFFmpeg(cp) {
14
15
  if (!cp)
15
16
  return;
16
- // this will allow ffmpeg to send rtsp TEARDOWN etc
17
- try {
18
- cp.stdin.on('error', () => { });
19
- cp.stdin.write('q\n');
20
- }
21
- catch (e) {
22
- }
23
- setTimeout(() => {
17
+ if (cp.exitCode != null)
18
+ return;
19
+ await new Promise(async (resolve) => {
20
+ cp.on('exit', resolve);
21
+ // this will allow ffmpeg to send rtsp TEARDOWN etc
22
+ try {
23
+ cp.stdin.on('error', () => { });
24
+ cp.stdin.write('q\n');
25
+ }
26
+ catch (e) {
27
+ }
28
+ await (0, sleep_1.sleep)(2000);
24
29
  for (const f of cp.stdio) {
25
30
  try {
26
31
  f?.destroy();
@@ -28,11 +33,9 @@ function safeKillFFmpeg(cp) {
28
33
  catch (e) {
29
34
  }
30
35
  }
31
- cp.kill();
32
- setTimeout(() => {
33
- cp.kill('SIGKILL');
34
- }, 2000);
35
- }, 2000);
36
+ await (0, sleep_1.sleep)(2000);
37
+ cp.kill('SIGKILL');
38
+ });
36
39
  }
37
40
  exports.safeKillFFmpeg = safeKillFFmpeg;
38
41
  function ffmpegLogInitialOutput(console, cp, forever, storage) {
@@ -1 +1 @@
1
- {"version":3,"file":"media-helpers.js","sourceRoot":"","sources":["../src/media-helpers.ts"],"names":[],"mappings":";;;;;;AACA,sDAA8B;AAE9B,MAAM,QAAQ,GAAG;IACb,2BAA2B;IAC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,CAAC,CAAA;QAED,OAAO,GAAG,CAAC;IACf,CAAC;IAAA,CAAC;IACF,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;AACtD,CAAC;AA/BD,wDA+BC;AAED,SAAgB,wBAAwB,CAAC,OAAgB,EAAE,IAAc;IACrE,IAAI,CAAC,OAAO;QACR,OAAO;IACX,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC;YACD,IAAI,UAAU,EAAE,CAAC;gBACb,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;gBACzB,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,QAAQ,YAAY,CAAC,CAAA;YACzC,CAAC;iBACI,CAAC;gBACF,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAClB,CAAC;QACL,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QAED,yCAAyC;QACzC,UAAU,GAAG,GAAG,KAAK,IAAI,CAAC;IAC9B,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC;AAxBD,4DAwBC"}
@@ -131,13 +131,17 @@ async function start(mainFilename, options) {
131
131
  const db = new level_1.default(dbPath);
132
132
  await db.open();
133
133
  let certSetting = await db.tryGet(db_types_1.Settings, 'certificate');
134
+ let keyPair = certSetting?.value;
134
135
  if (certSetting?.value?.version !== cert_1.CURRENT_SELF_SIGNED_CERTIFICATE_VERSION) {
135
- const cert = (0, cert_1.createSelfSignedCertificate)();
136
+ keyPair = (0, cert_1.createSelfSignedCertificate)();
136
137
  certSetting = new db_types_1.Settings();
137
138
  certSetting._id = 'certificate';
138
- certSetting.value = cert;
139
+ certSetting.value = keyPair;
139
140
  certSetting = await db.upsert(certSetting);
140
141
  }
142
+ else {
143
+ keyPair = (0, cert_1.createSelfSignedCertificate)(keyPair.serviceKey);
144
+ }
141
145
  const basicAuth = http_auth_1.default.basic({
142
146
  realm: 'Scrypted',
143
147
  }, async (username, password, callback) => {
@@ -148,13 +152,12 @@ async function start(mainFilename, options) {
148
152
  const sha = hash.digest().toString('hex');
149
153
  callback(sha === user.passwordHash || password === user.token);
150
154
  });
151
- const keys = certSetting.value;
152
155
  const httpsServerOptions = process_1.default.env.SCRYPTED_HTTPS_OPTIONS_FILE
153
156
  ? JSON.parse(fs_1.default.readFileSync(process_1.default.env.SCRYPTED_HTTPS_OPTIONS_FILE).toString())
154
157
  : {};
155
158
  const mergedHttpsServerOptions = Object.assign({
156
- key: keys.serviceKey,
157
- cert: keys.certificate
159
+ key: keyPair.serviceKey,
160
+ cert: keyPair.certificate
158
161
  }, httpsServerOptions);
159
162
  const secure = https_1.default.createServer(mergedHttpsServerOptions, app);
160
163
  const insecure = http_1.default.createServer(app);
@@ -1 +1 @@
1
- {"version":3,"file":"scrypted-server-main.js","sourceRoot":"","sources":["../src/scrypted-server-main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;AACpC,8DAAqC;AACrC,kEAAyC;AACzC,oDAA4B;AAC5B,sDAA2C;AAC3C,4CAAoB;AACpB,gDAAwB;AACxB,0DAAiC;AACjC,kDAA0B;AAC1B,8CAAsB;AACtB,4CAAoB;AACpB,gDAAwB;AACxB,sDAA8B;AAC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,QAAQ,CAAC;AACpB,CAAC;AAED,kBAAe,KAAK,CAAC"}
@@ -34,6 +34,9 @@ export declare class PluginComponent {
34
34
  rpcObjects: number;
35
35
  packageJson: any;
36
36
  pendingResults: number;
37
+ pendingResultCounts: {
38
+ [method: string]: number;
39
+ };
37
40
  id: string;
38
41
  }>;
39
42
  installNpm(pkg: string, version?: string): Promise<void>;
@@ -92,9 +92,13 @@ class PluginComponent {
92
92
  const host = this.scrypted.plugins[pluginId];
93
93
  let rpcObjects = 0;
94
94
  let pendingResults = 0;
95
+ const pendingResultMethods = {};
95
96
  if (host.peer) {
96
97
  rpcObjects = host.peer.localProxied.size + Object.keys(host.peer.remoteWeakProxies).length;
97
98
  pendingResults = Object.keys(host.peer.pendingResults).length;
99
+ for (const deferred of Object.values(host.peer.pendingResults)) {
100
+ pendingResultMethods[deferred.method] = (pendingResultMethods[deferred.method] || 0) + 1;
101
+ }
98
102
  }
99
103
  return {
100
104
  pid: host?.worker?.pid,
@@ -102,6 +106,7 @@ class PluginComponent {
102
106
  rpcObjects,
103
107
  packageJson,
104
108
  pendingResults,
109
+ pendingResultCounts: pendingResultMethods,
105
110
  id: this.scrypted.findPluginDevice(pluginId)._id,
106
111
  };
107
112
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/services/plugin.ts"],"names":[],"mappings":";;;;;;AAAA,2CAA8E;AAC9E,oDAA4B;AAC5B,0CAAqC;AACrC,8DAA0D;AAC1D,sDAAqD;AAErD,oCAAiC;AACjC,oCAAoC;AAEpC,MAAa,eAAe;IACxB,QAAQ,CAAkB;IAC1B,YAAY,QAAyB;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,EAAU,EAAE,KAAa;QAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;QAC5D,MAAM,IAAI,CAAC,IAA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,QAAgB,EAAE,IAAY,EAAE,KAAW;QAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI;YACL,OAAO;QAEX,MAAM,GAAG,GAAG,aAAa,IAAI,EAAE,CAAC;QAChC,IAAI,KAAK,KAAK,SAAS;YACnB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;;YAE7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,IAAY;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,GAAG,GAAG,aAAa,IAAI,EAAE,CAAC;QAChC,OAAO,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;CACJ;AA/KD,0CA+KC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrypted/server",
3
- "version": "0.68.0",
3
+ "version": "0.70.0",
4
4
  "description": "",
5
5
  "dependencies": {
6
6
  "@mapbox/node-pre-gyp": "^1.0.11",
@@ -56,12 +56,10 @@ class SystemDeviceState(TypedDict):
56
56
 
57
57
 
58
58
  class DeviceProxy(object):
59
- device: asyncio.Future[rpc.RpcPeer]
60
-
61
59
  def __init__(self, systemManager: SystemManager, id: str):
62
60
  self.systemManager = systemManager
63
61
  self.id = id
64
- self.device = None
62
+ self.device: asyncio.Future[rpc.RpcPeer] = None
65
63
 
66
64
  def __getattr__(self, name):
67
65
  if name == 'id':
@@ -95,13 +93,11 @@ class DeviceProxy(object):
95
93
 
96
94
 
97
95
  class SystemManager(scrypted_python.scrypted_sdk.types.SystemManager):
98
- deviceProxies: Mapping[str, DeviceProxy]
99
-
100
96
  def __init__(self, api: Any, systemState: Mapping[str, Mapping[str, SystemDeviceState]]) -> None:
101
97
  super().__init__()
102
98
  self.api = api
103
99
  self.systemState = systemState
104
- self.deviceProxies = {}
100
+ self.deviceProxies: Mapping[str, DeviceProxy] = {}
105
101
 
106
102
  async def getComponent(self, id: str) -> Any:
107
103
  return await self.api.getComponent(id)
@@ -329,16 +325,12 @@ class DeviceManager(scrypted_python.scrypted_sdk.types.DeviceManager):
329
325
 
330
326
 
331
327
  class PluginRemote:
332
- systemState: Mapping[str, Mapping[str, SystemDeviceState]] = {}
333
- nativeIds: Mapping[str, DeviceStorage] = {}
334
- pluginId: str
335
- hostInfo: Any
336
- mediaManager: MediaManager
337
- loop: AbstractEventLoop
338
- consoles: Mapping[str, Future[Tuple[StreamReader, StreamWriter]]] = {}
339
- ptimeSum = 0
340
-
341
- def __init__(self, peer: rpc.RpcPeer, api, pluginId, hostInfo, loop: AbstractEventLoop):
328
+ def __init__(self, peer: rpc.RpcPeer, api, pluginId: str, hostInfo, loop: AbstractEventLoop):
329
+ self.systemState: Mapping[str, Mapping[str, SystemDeviceState]] = {}
330
+ self.nativeIds: Mapping[str, DeviceStorage] = {}
331
+ self.mediaManager: MediaManager
332
+ self.consoles: Mapping[str, Future[Tuple[StreamReader, StreamWriter]]] = {}
333
+ self.ptimeSum = 0
342
334
  self.allMemoryStats = {}
343
335
  self.peer = peer
344
336
  self.api = api
@@ -52,8 +52,6 @@ class RpcTransport:
52
52
 
53
53
 
54
54
  class RpcFileTransport(RpcTransport):
55
- executor: ThreadPoolExecutor
56
-
57
55
  def __init__(self, readFd: int, writeFd: int) -> None:
58
56
  super().__init__()
59
57
  self.readFd = readFd
package/src/cert.ts CHANGED
@@ -7,12 +7,20 @@ const { pki } = forge;
7
7
 
8
8
  export const CURRENT_SELF_SIGNED_CERTIFICATE_VERSION = 'v2';
9
9
 
10
- export function createSelfSignedCertificate() {
11
-
12
- // generate a keypair and create an X.509v3 certificate
13
- const keys = pki.rsa.generateKeyPair(2048);
10
+ export function createSelfSignedCertificate(serviceKey?: string) {
11
+ let privateKey: ReturnType<typeof pki.privateKeyFromPem>;
14
12
  const cert = pki.createCertificate();
15
- cert.publicKey = keys.publicKey;
13
+
14
+ if (serviceKey) {
15
+ privateKey = pki.privateKeyFromPem(serviceKey);
16
+ cert.publicKey = pki.rsa.setPublicKey(privateKey.n, privateKey.e);
17
+ }
18
+ else {
19
+ // generate a keypair and create an X.509v3 certificate
20
+ const keys = pki.rsa.generateKeyPair(2048);
21
+ privateKey = keys.privateKey;
22
+ cert.publicKey = keys.publicKey;
23
+ }
16
24
 
17
25
  // NOTE: serialNumber is the hex encoded value of an ASN.1 INTEGER.
18
26
  // Conforming CAs should ensure serialNumber is:
@@ -65,9 +73,9 @@ export function createSelfSignedCertificate() {
65
73
  }]);
66
74
 
67
75
  // self-sign certificate
68
- cert.sign(keys.privateKey);
76
+ cert.sign(privateKey);
69
77
  return {
70
- serviceKey: pki.privateKeyToPem(keys.privateKey),
78
+ serviceKey: pki.privateKeyToPem(privateKey),
71
79
  certificate: pki.certificateToPem(cert),
72
80
  version: CURRENT_SELF_SIGNED_CERTIFICATE_VERSION,
73
81
  };
@@ -1,5 +1,6 @@
1
1
  import { ChildProcess } from "child_process";
2
2
  import process from 'process';
3
+ import { sleep } from "./sleep";
3
4
 
4
5
  const filtered = [
5
6
  'decode_slice_header error',
@@ -7,17 +8,22 @@ const filtered = [
7
8
  'non-existing PPS',
8
9
  ];
9
10
 
10
- export function safeKillFFmpeg(cp: ChildProcess) {
11
+ export async function safeKillFFmpeg(cp: ChildProcess) {
11
12
  if (!cp)
12
13
  return;
13
- // this will allow ffmpeg to send rtsp TEARDOWN etc
14
- try {
15
- cp.stdin.on('error', () => {});
16
- cp.stdin.write('q\n');
17
- }
18
- catch (e) {
19
- }
20
- setTimeout(() => {
14
+ if (cp.exitCode != null)
15
+ return;
16
+ await new Promise(async resolve => {
17
+ cp.on('exit', resolve);
18
+ // this will allow ffmpeg to send rtsp TEARDOWN etc
19
+ try {
20
+ cp.stdin.on('error', () => { });
21
+ cp.stdin.write('q\n');
22
+ }
23
+ catch (e) {
24
+ }
25
+
26
+ await sleep(2000);
21
27
  for (const f of cp.stdio) {
22
28
  try {
23
29
  f?.destroy();
@@ -25,11 +31,9 @@ export function safeKillFFmpeg(cp: ChildProcess) {
25
31
  catch (e) {
26
32
  }
27
33
  }
28
- cp.kill();
29
- setTimeout(() => {
30
- cp.kill('SIGKILL');
31
- }, 2000);
32
- }, 2000);
34
+ await sleep(2000);
35
+ cp.kill('SIGKILL');
36
+ });
33
37
  }
34
38
 
35
39
  export function ffmpegLogInitialOutput(console: Console, cp: ChildProcess, forever?: boolean, storage?: Storage) {
@@ -124,15 +124,19 @@ async function start(mainFilename: string, options?: {
124
124
  await db.open();
125
125
 
126
126
  let certSetting = await db.tryGet(Settings, 'certificate') as Settings;
127
+ let keyPair: ReturnType<typeof createSelfSignedCertificate> = certSetting?.value;
127
128
 
128
129
  if (certSetting?.value?.version !== CURRENT_SELF_SIGNED_CERTIFICATE_VERSION) {
129
- const cert = createSelfSignedCertificate();
130
+ keyPair = createSelfSignedCertificate();
130
131
 
131
132
  certSetting = new Settings();
132
133
  certSetting._id = 'certificate';
133
- certSetting.value = cert;
134
+ certSetting.value = keyPair;
134
135
  certSetting = await db.upsert(certSetting);
135
136
  }
137
+ else {
138
+ keyPair = createSelfSignedCertificate(keyPair.serviceKey);
139
+ }
136
140
 
137
141
  const basicAuth = httpAuth.basic({
138
142
  realm: 'Scrypted',
@@ -147,15 +151,13 @@ async function start(mainFilename: string, options?: {
147
151
  callback(sha === user.passwordHash || password === user.token);
148
152
  });
149
153
 
150
- const keys = certSetting.value;
151
-
152
154
  const httpsServerOptions = process.env.SCRYPTED_HTTPS_OPTIONS_FILE
153
155
  ? JSON.parse(fs.readFileSync(process.env.SCRYPTED_HTTPS_OPTIONS_FILE).toString())
154
156
  : {};
155
157
 
156
158
  const mergedHttpsServerOptions = Object.assign({
157
- key: keys.serviceKey,
158
- cert: keys.certificate
159
+ key: keyPair.serviceKey,
160
+ cert: keyPair.certificate
159
161
  }, httpsServerOptions);
160
162
  const secure = https.createServer(mergedHttpsServerOptions, app);
161
163
  const insecure = http.createServer(app);
@@ -91,9 +91,15 @@ export class PluginComponent {
91
91
  const host = this.scrypted.plugins[pluginId];
92
92
  let rpcObjects = 0;
93
93
  let pendingResults = 0;
94
+ const pendingResultMethods: {
95
+ [method: string]: number,
96
+ } = {};
94
97
  if (host.peer) {
95
98
  rpcObjects = host.peer.localProxied.size + Object.keys(host.peer.remoteWeakProxies).length;
96
99
  pendingResults = Object.keys(host.peer.pendingResults).length;
100
+ for (const deferred of Object.values(host.peer.pendingResults)) {
101
+ pendingResultMethods[deferred.method] = (pendingResultMethods[deferred.method] || 0) + 1;
102
+ }
97
103
  }
98
104
  return {
99
105
  pid: host?.worker?.pid,
@@ -101,6 +107,7 @@ export class PluginComponent {
101
107
  rpcObjects,
102
108
  packageJson,
103
109
  pendingResults,
110
+ pendingResultCounts: pendingResultMethods,
104
111
  id: this.scrypted.findPluginDevice(pluginId)._id,
105
112
  }
106
113
  }