feat: make WebRTC media service self-contained

This commit is contained in:
illusia committed 2026-09-03 10:56:39 +08:00
1 parent d6c8ccb73f
commit c7def28a8f
14 files changed
+160 -121

No files matched your search

+3 -8
View File
@@ -24,9 +24,6 @@ test("SQLite persistence initializes schema and stores the single admin/settings
tsPort: 9988,
tsPasswordEncrypted: "v1:ciphertext",
webRtcEnabled: true,
webRtcPublicHost: "voice.example.com",
webRtcUdpStart: 40000,
webRtcUdpEnd: 40099,
});
assert.equal(database.hasAdmin(), true);
assert.equal(database.getAdminCredential()?.hash, credential.hash);
@@ -42,9 +39,6 @@ test("SQLite persistence initializes schema and stores the single admin/settings
lastTestLatencyMs: null,
lastTestError: null,
webRtcEnabled: true,
webRtcPublicHost: "voice.example.com",
webRtcUdpStart: 40000,
webRtcUdpEnd: 40099,
updatedAt: database.getSettings().updatedAt,
});
assert.equal(database.recentAudit()[0]?.event, "ADMIN_INITIALIZED");
@@ -78,8 +72,9 @@ test("SQLite schema v1 upgrades to v3 with a migration copy", () => {
const upgraded = new WebSpeakDatabase(dbPath);
assert.equal(upgraded.schemaVersion, 3);
assert.equal(upgraded.getSettings().webRtcEnabled, false);
assert.equal(upgraded.getSettings().webRtcUdpStart, 40000);
assert.equal(upgraded.getSettings().webRtcUdpEnd, 40099);
assert.equal("webRtcPublicHost" in upgraded.getSettings(), false);
assert.equal("webRtcUdpStart" in upgraded.getSettings(), false);
assert.equal("webRtcUdpEnd" in upgraded.getSettings(), false);
assert.equal(upgraded.listManagedInvites().length, 0);
assert.equal(existsSync(`${dbPath}.schema-1.bak`), true);
upgraded.close();