server: fix plugin volume. remove old wrtc.

This commit is contained in:
Koushik Dutta
2021-12-26 19:02:44 -08:00
parent d0afe3ce55
commit 80eb7be3fe
5 changed files with 57 additions and 2093 deletions

View File

@@ -57,51 +57,5 @@
"DEBUG": "/scrypted/*",
}
},
{
// "autoAttachChildProcesses": false,
"type": "pwa-node",
"request": "launch",
"name": "Launch Test Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/src/test.ts",
"runtimeArgs": [
"--expose-gc",
"--nolazy",
"-r",
"ts-node/register"
],
"sourceMaps": true,
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/**"
],
"outFiles": [
"${workspaceFolder}/**/*.js"
],
"env": {
"DEBUG": "/scrypted/*",
}
},
// {
// "type": "pwa-node",
// "request": "launch",
// "name": "Launch Tests",
// "skipFiles": [
// "<node_internals>/**"
// ],
// "program": "${workspaceFolder}/test/test-main.ts",
// "runtimeArgs": [
// "--expose-gc",
// "--nolazy",
// "-r",
// "ts-node/register"
// ],
// "sourceMaps": true,
// "outFiles": [
// "${workspaceFolder}/**/*.js"
// ]
// }
]
}

2085
server/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/server",
"version": "0.0.112",
"version": "0.0.113",
"description": "",
"dependencies": {
"@scrypted/sdk": "^0.0.131",
@@ -30,11 +30,9 @@
"ws": "^8.2.3"
},
"optionalDependencies": {
"@koush/wrtc": "^0.5.0",
"@koush/wrtc": "^0.5.2",
"ffmpeg-for-homebridge": "^0.0.9",
"mdns": "^2.7.2",
"ts-node": "^10.2.1",
"wrtc": "^0.4.7"
"mdns": "^2.7.2"
},
"devDependencies": {
"@mapbox/node-pre-gyp": "^1.0.5",
@@ -64,7 +62,6 @@
"preserve": "npm run build",
"serve": "node --expose-gc dist/scrypted-main.js",
"serve-no-build": "node --expose-gc dist/scrypted-main.js",
"ts-serve": "ts-node --expose-gc src/scrypted-main.ts",
"prebuild": "rimraf dist",
"build": "tsc --outDir dist",
"postbuild": "node test/check-build-output.js",

View File

@@ -1,8 +1,13 @@
import path from 'path';
import mkdirp from 'mkdirp';
export function getScryptedVolume() {
const volumeDir = process.env.SCRYPTED_VOLUME || path.join(process.cwd(), 'volume');
return volumeDir;
}
export function getPluginVolume(pluginId: string) {
const volume = path.join(process.cwd(), 'volume');
const volume = getScryptedVolume();
const pluginVolume = path.join(volume, 'plugins', pluginId);
return pluginVolume;
}

View File

@@ -25,6 +25,7 @@ import { getAddresses } from './addresses';
import { sleep } from './sleep';
import { createSelfSignedCertificate, CURRENT_SELF_SIGNED_CERTIFICATE_VERSION } from './cert';
import { PluginError } from './plugin/plugin-error';
import { getScryptedVolume } from './plugin/plugin-volume';
if (!semver.gte(process.version, '16.0.0')) {
throw new Error('"node" version out of date. Please update node to v16 or higher.')
@@ -105,7 +106,7 @@ else {
app.use(bodyParser.raw({ type: 'application/zip', limit: 100000000 }) as any)
async function start() {
const volumeDir = process.env.SCRYPTED_VOLUME || path.join(process.cwd(), 'volume');
const volumeDir = getScryptedVolume();
mkdirp.sync(volumeDir);
const dbPath = path.join(volumeDir, 'scrypted.db');
const oldDbPath = path.join(process.cwd(), 'scrypted.db');