querysub 0.312.0 → 0.314.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/.cursorrules +1 -1
- package/costsBenefits.txt +4 -1
- package/package.json +3 -2
- package/spec.txt +23 -18
- package/src/-0-hooks/hooks.ts +1 -1
- package/src/-a-archives/archives.ts +16 -3
- package/src/-a-archives/archivesBackBlaze.ts +51 -3
- package/src/-a-archives/archivesLimitedCache.ts +175 -0
- package/src/-a-archives/archivesPrivateFileSystem.ts +299 -0
- package/src/-a-auth/certs.ts +58 -31
- package/src/-b-authorities/cdnAuthority.ts +2 -2
- package/src/-b-authorities/dnsAuthority.ts +3 -2
- package/src/-c-identity/IdentityController.ts +3 -2
- package/src/-d-trust/NetworkTrust2.ts +17 -19
- package/src/-e-certs/EdgeCertController.ts +19 -81
- package/src/-e-certs/certAuthority.ts +7 -2
- package/src/-f-node-discovery/NodeDiscovery.ts +9 -7
- package/src/-g-core-values/NodeCapabilities.ts +6 -1
- package/src/0-path-value-core/NodePathAuthorities.ts +1 -1
- package/src/0-path-value-core/PathValueCommitter.ts +3 -3
- package/src/0-path-value-core/PathValueController.ts +3 -3
- package/src/0-path-value-core/archiveLocks/ArchiveLocks2.ts +15 -37
- package/src/0-path-value-core/pathValueCore.ts +4 -3
- package/src/3-path-functions/PathFunctionRunner.ts +2 -2
- package/src/4-dom/qreact.tsx +4 -3
- package/src/4-querysub/Querysub.ts +2 -2
- package/src/4-querysub/QuerysubController.ts +2 -2
- package/src/5-diagnostics/GenericFormat.tsx +1 -0
- package/src/5-diagnostics/Table.tsx +3 -0
- package/src/5-diagnostics/diskValueAudit.ts +2 -1
- package/src/5-diagnostics/nodeMetadata.ts +0 -1
- package/src/deployManager/components/MachineDetailPage.tsx +9 -1
- package/src/deployManager/components/ServiceDetailPage.tsx +10 -1
- package/src/deployManager/setupMachineMain.ts +8 -1
- package/src/diagnostics/NodeViewer.tsx +5 -6
- package/src/diagnostics/logs/FastArchiveAppendable.ts +757 -0
- package/src/diagnostics/logs/FastArchiveController.ts +524 -0
- package/src/diagnostics/logs/FastArchiveViewer.tsx +863 -0
- package/src/diagnostics/logs/LogViewer2.tsx +349 -0
- package/src/diagnostics/logs/TimeRangeSelector.tsx +94 -0
- package/src/diagnostics/logs/diskLogger.ts +135 -305
- package/src/diagnostics/logs/diskShimConsoleLogs.ts +6 -29
- package/src/diagnostics/logs/errorNotifications/ErrorNotificationController.ts +577 -0
- package/src/diagnostics/logs/errorNotifications/ErrorSuppressionUI.tsx +225 -0
- package/src/diagnostics/logs/errorNotifications/ErrorWarning.tsx +207 -0
- package/src/diagnostics/logs/importLogsEntry.ts +38 -0
- package/src/diagnostics/logs/injectFileLocationToConsole.ts +7 -17
- package/src/diagnostics/logs/lifeCycleAnalysis/lifeCycles.tsx +0 -0
- package/src/diagnostics/logs/lifeCycleAnalysis/spec.md +153 -0
- package/src/diagnostics/managementPages.tsx +7 -16
- package/src/diagnostics/misc-pages/ComponentSyncStats.tsx +0 -1
- package/src/diagnostics/periodic.ts +5 -0
- package/src/diagnostics/watchdog.ts +2 -2
- package/src/functional/SocketChannel.ts +67 -0
- package/src/library-components/Input.tsx +1 -1
- package/src/library-components/InputLabel.tsx +5 -2
- package/src/misc.ts +111 -0
- package/src/src.d.ts +34 -1
- package/src/user-implementation/userData.ts +4 -3
- package/test.ts +13 -0
- package/testEntry2.ts +29 -0
- package/src/diagnostics/errorLogs/ErrorLogController.ts +0 -535
- package/src/diagnostics/errorLogs/ErrorLogCore.ts +0 -274
- package/src/diagnostics/errorLogs/LogClassifiers.tsx +0 -308
- package/src/diagnostics/errorLogs/LogFilterUI.tsx +0 -84
- package/src/diagnostics/errorLogs/LogNotify.tsx +0 -101
- package/src/diagnostics/errorLogs/LogTimeSelector.tsx +0 -723
- package/src/diagnostics/errorLogs/LogViewer.tsx +0 -757
- package/src/diagnostics/errorLogs/logFiltering.tsx +0 -149
- package/src/diagnostics/logs/DiskLoggerPage.tsx +0 -613
|
@@ -33,6 +33,8 @@ export class Table<RowT extends RowType> extends qreact.Component<TableType<RowT
|
|
|
33
33
|
lineLimit?: number;
|
|
34
34
|
characterLimit?: number;
|
|
35
35
|
dark?: boolean;
|
|
36
|
+
|
|
37
|
+
getRowAttributes?: (row: RowT, index: number) => preact.JSX.HTMLAttributes<HTMLTableRowElement>;
|
|
36
38
|
}> {
|
|
37
39
|
state = {
|
|
38
40
|
limit: this.props.initialLimit || 100,
|
|
@@ -67,6 +69,7 @@ export class Table<RowT extends RowType> extends qreact.Component<TableType<RowT
|
|
|
67
69
|
// be able to above our siblings, which breaks palettes).
|
|
68
70
|
+ css.relative
|
|
69
71
|
}
|
|
72
|
+
{...this.props.getRowAttributes?.(row, index)}
|
|
70
73
|
>
|
|
71
74
|
<td class={css.center}>{index + 1}</td>
|
|
72
75
|
{Object.entries(columns).filter(x => x[1] !== null).map(([columnName, column]) => {
|
|
@@ -11,6 +11,7 @@ import { isDevDebugbreak } from "../config";
|
|
|
11
11
|
import { DebugLog, auditLog, getLogHistoryEquals } from "../0-path-value-core/auditLogs";
|
|
12
12
|
import { getOwnNodeId } from "../-f-node-discovery/NodeDiscovery";
|
|
13
13
|
import { sort } from "socket-function/src/misc";
|
|
14
|
+
import { logDisk } from "../diagnostics/logs/diskLogger";
|
|
14
15
|
|
|
15
16
|
const AUDIT_INTERVAL = ARCHIVE_FLUSH_LIMIT;
|
|
16
17
|
const AUDIT_THRESHOLD = ARCHIVE_FLUSH_LIMIT;
|
|
@@ -187,7 +188,7 @@ async function checkAuthority(authority: AuthorityPath, threshold: number) {
|
|
|
187
188
|
console.error(`Value mismatch between disk and memory for ${formatNumber(changedValues.size)} values. Ex: ${firstValue.path}`);
|
|
188
189
|
}
|
|
189
190
|
if (removedValues.size > 0) {
|
|
190
|
-
|
|
191
|
+
logDisk("log", green(`Removing ${formatNumber(removedValues.size)} paths from memory which have been GCed on the disk.`));
|
|
191
192
|
}
|
|
192
193
|
if (changedValues.size > 0 || removedValues.size > 0) {
|
|
193
194
|
let allValues = new Set([...changedValues, ...removedValues]);
|
|
@@ -10,7 +10,6 @@ import { sort, throttleFunction, timeInMinute } from "socket-function/src/misc";
|
|
|
10
10
|
import { formatNumber, formatPercent, formatTime } from "socket-function/src/formatting/format";
|
|
11
11
|
import os from "os";
|
|
12
12
|
import { isNode } from "typesafecss";
|
|
13
|
-
import { diskLog } from "../diagnostics/logs/diskLogger";
|
|
14
13
|
import { devDebugbreak } from "../config";
|
|
15
14
|
import { addStatPeriodic, addStatSumPeriodic, addTimeProfileDistribution, onTimeProfile, logNodeStats, logNodeStateStats, registerNodeMetadata } from "../-0-hooks/hooks";
|
|
16
15
|
import { magenta } from "socket-function/src/formatting/logColors";
|
|
@@ -5,8 +5,10 @@ import { css } from "typesafecss";
|
|
|
5
5
|
import { currentViewParam, selectedMachineIdParam, selectedServiceIdParam } from "../urlParams";
|
|
6
6
|
import { formatNumber, formatVeryNiceDateTime } from "socket-function/src/formatting/format";
|
|
7
7
|
import { sort } from "socket-function/src/misc";
|
|
8
|
-
import { Anchor } from "../../library-components/ATag";
|
|
8
|
+
import { ATag, Anchor } from "../../library-components/ATag";
|
|
9
9
|
import { ShowMore } from "../../library-components/ShowMore";
|
|
10
|
+
import { filterParam } from "../../diagnostics/logs/FastArchiveViewer";
|
|
11
|
+
import { managementPageURL } from "../../diagnostics/managementPages";
|
|
10
12
|
|
|
11
13
|
export class MachineDetailPage extends qreact.Component {
|
|
12
14
|
render() {
|
|
@@ -62,6 +64,12 @@ export class MachineDetailPage extends qreact.Component {
|
|
|
62
64
|
<div>
|
|
63
65
|
Apply Node ID: {machine.applyNodeId}
|
|
64
66
|
</div>
|
|
67
|
+
<ATag values={[
|
|
68
|
+
managementPageURL.getOverride("LogViewer2"),
|
|
69
|
+
filterParam.getOverride(`__machineId = ${machineInfo.machineId}`),
|
|
70
|
+
]}>
|
|
71
|
+
Machine Logs
|
|
72
|
+
</ATag>
|
|
65
73
|
</div>
|
|
66
74
|
|
|
67
75
|
<div>
|
|
@@ -13,13 +13,15 @@ import { Button } from "../../library-components/Button";
|
|
|
13
13
|
import { isDefined } from "../../misc";
|
|
14
14
|
import { watchScreenOutput, stopWatchingScreenOutput } from "../machineController";
|
|
15
15
|
import { getPathStr2 } from "../../path";
|
|
16
|
-
import { Anchor } from "../../library-components/ATag";
|
|
16
|
+
import { ATag, Anchor } from "../../library-components/ATag";
|
|
17
17
|
import { ScrollOnMount } from "../../library-components/ScrollOnMount";
|
|
18
18
|
import { StickyBottomScroll } from "../../library-components/StickyBottomScroll";
|
|
19
19
|
import { PrimitiveDisplay } from "../../diagnostics/logs/ObjectDisplay";
|
|
20
20
|
import { parseAnsiColors, rgbToHsl } from "../../diagnostics/logs/ansiFormat";
|
|
21
21
|
import { RenderGitRefInfo, UpdateServiceButtons, bigEmoji, buttonStyle } from "./deployButtons";
|
|
22
22
|
import { TypedConfigEditor } from "../../library-components/TypedConfigEditor";
|
|
23
|
+
import { filterParam } from "../../diagnostics/logs/FastArchiveViewer";
|
|
24
|
+
import { managementPageURL } from "../../diagnostics/managementPages";
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
|
|
@@ -333,6 +335,13 @@ export class ServiceDetailPage extends qreact.Component {
|
|
|
333
335
|
>
|
|
334
336
|
{isWatching ? "Stop Watching Output" : "Watch Screen Output"}
|
|
335
337
|
</div>
|
|
338
|
+
|
|
339
|
+
<ATag values={[
|
|
340
|
+
managementPageURL.getOverride("LogViewer2"),
|
|
341
|
+
filterParam.getOverride(`__machineId = ${machineId}`),
|
|
342
|
+
]}>
|
|
343
|
+
Machine Logs
|
|
344
|
+
</ATag>
|
|
336
345
|
</div>
|
|
337
346
|
{hasError && (
|
|
338
347
|
<div
|
|
@@ -171,7 +171,9 @@ async function main() {
|
|
|
171
171
|
// Get RAM amount to calculate appropriate swap size
|
|
172
172
|
const memInfo = await runPromise(`ssh ${sshRemote} "free -m | grep Mem"`);
|
|
173
173
|
const ramMB = parseInt(memInfo.split(/\s+/)[1]);
|
|
174
|
-
if (swapTotal
|
|
174
|
+
if (Number.isNaN(swapTotal) || Number.isNaN(ramMB)) {
|
|
175
|
+
console.error(`Error getting swap or memory info, swapInfo: ${swapInfo}, memInfo: ${memInfo}`);
|
|
176
|
+
} else if (swapTotal > 0) {
|
|
175
177
|
console.log(`✅ Swap already configured: ${swapTotal}MB SWAP vs ${ramMB}MB REAL MEMORY`);
|
|
176
178
|
} else {
|
|
177
179
|
// Calculate swap size based on RAM:
|
|
@@ -213,6 +215,11 @@ async function main() {
|
|
|
213
215
|
|
|
214
216
|
console.log("Setting up machine:", sshRemote);
|
|
215
217
|
|
|
218
|
+
// 0. Update apt
|
|
219
|
+
console.log("Updating apt...");
|
|
220
|
+
await runPromise(`ssh ${sshRemote} "sudo apt update"`);
|
|
221
|
+
console.log("✅ Apt updated");
|
|
222
|
+
|
|
216
223
|
// 1. Copy backblaze file to remote server (~/backblaze.json)
|
|
217
224
|
console.log("Copying backblaze credentials...");
|
|
218
225
|
if (fs.existsSync(backblazePath)) {
|
|
@@ -23,7 +23,6 @@ import { ValueAuditController } from "../../src/5-diagnostics/memoryValueAudit";
|
|
|
23
23
|
import { getExternalIP } from "../../src/misc/networking";
|
|
24
24
|
import dns from "dns";
|
|
25
25
|
import { getNodeIdDomain, getNodeIdIP } from "socket-function/src/nodeCache";
|
|
26
|
-
import { debugGetRawEdgeCert } from "../../src/-e-certs/EdgeCertController";
|
|
27
26
|
import ws from "ws";
|
|
28
27
|
import https from "https";
|
|
29
28
|
import debugbreak from "debugbreak";
|
|
@@ -35,9 +34,10 @@ import { ButtonSelector } from "../library-components/ButtonSelector";
|
|
|
35
34
|
import { assertIsManagementUser, managementPageURL } from "./managementPages";
|
|
36
35
|
import { SocketRegistered } from "socket-function/SocketFunctionTypes";
|
|
37
36
|
import { ATag } from "../library-components/ATag";
|
|
38
|
-
import { filterURL, selectedNodeId } from "./logs/DiskLoggerPage";
|
|
39
37
|
import { getSyncedController } from "../library-components/SyncedController";
|
|
40
38
|
import child_process from "child_process";
|
|
39
|
+
import { filterParam } from "./logs/FastArchiveViewer";
|
|
40
|
+
import { getHTTPSKeyCert } from "../-e-certs/certAuthority";
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
type NodeData = {
|
|
@@ -296,9 +296,8 @@ export class NodeViewer extends qreact.Component {
|
|
|
296
296
|
|
|
297
297
|
return (
|
|
298
298
|
<ATag values={[
|
|
299
|
-
managementPageURL.getOverride("
|
|
300
|
-
|
|
301
|
-
filterURL.getOverride(`"__nodeId":"${str}"`),
|
|
299
|
+
managementPageURL.getOverride("LogViewer2"),
|
|
300
|
+
filterParam.getOverride(`__nodeId = ${str}`),
|
|
302
301
|
]}>
|
|
303
302
|
Logs
|
|
304
303
|
</ATag>
|
|
@@ -432,7 +431,7 @@ class NodeViewerControllerBase {
|
|
|
432
431
|
});
|
|
433
432
|
|
|
434
433
|
let baseNodeIP = getNodeIdIP(nodeId);
|
|
435
|
-
let cert = await
|
|
434
|
+
let cert = await getHTTPSKeyCert(getDomain());
|
|
436
435
|
|
|
437
436
|
const child = child_process.spawn("node", [
|
|
438
437
|
"-e",
|