querysub 0.659.0 → 0.661.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "querysub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.661.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"node-forge": "https://github.com/sliftist/forge#e618181b469b07bdc70b968b0391beb8ef5fecd6",
|
|
80
80
|
"pako": "^2.1.0",
|
|
81
81
|
"peggy": "^5.0.6",
|
|
82
|
-
"sliftutils": "^1.7.
|
|
82
|
+
"sliftutils": "^1.7.132",
|
|
83
83
|
"socket-function": "^1.2.35",
|
|
84
84
|
"terser": "^5.31.0",
|
|
85
85
|
"typenode": "^6.6.1",
|
|
@@ -94,7 +94,7 @@ const archivesBuilderCache = cacheJSONArgsEqual((domain: string, overrides: Part
|
|
|
94
94
|
domain = domain.toLowerCase().replaceAll(/[^a-z0-9-]/g, "-");
|
|
95
95
|
return archiveBuilder(domain, overrides);
|
|
96
96
|
});
|
|
97
|
-
function nestBucket(folder: string, archives: ReturnType<typeof createArchives>) {
|
|
97
|
+
export function nestBucket(folder: string, archives: ReturnType<typeof createArchives>) {
|
|
98
98
|
if (!folder) return archives;
|
|
99
99
|
folder = folder.replaceAll("\\", "/");
|
|
100
100
|
if (!folder.endsWith("/")) {
|
|
@@ -136,7 +136,7 @@ function nestBucket(folder: string, archives: ReturnType<typeof createArchives>)
|
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
function getSafeDomain() {
|
|
139
|
+
export function getSafeDomain() {
|
|
140
140
|
return getDomain().toLowerCase().replaceAll(/[^a-z0-9-]/g, "-");
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createArchives } from "sliftutils/storage/remoteStorage/createArchives";
|
|
2
|
+
import { cache } from "socket-function/src/caching";
|
|
3
|
+
import { getSafeDomain, nestBucket } from "./archives2";
|
|
4
|
+
|
|
5
|
+
// The absolute-minimum archives: one private accessor, one backblaze source, no striping, no storage servers. For the values that have to be readable when none of our infrastructure is up (ex, the repo trust config machine deploy needs to bootstrap a machine).
|
|
6
|
+
|
|
7
|
+
const lowLevelBase = cache((bucket: string) => createArchives({
|
|
8
|
+
version: 1,
|
|
9
|
+
sources: [{
|
|
10
|
+
type: "backblaze",
|
|
11
|
+
url: `https://f002.backblazeb2.com/file/${bucket}/storage/storagerouting.json`,
|
|
12
|
+
name: "backblaze",
|
|
13
|
+
validWindow: [0, Number.MAX_SAFE_INTEGER],
|
|
14
|
+
}],
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
export function getArchivesLowLevel(folder: string) {
|
|
18
|
+
return nestBucket(folder, lowLevelBase(getSafeDomain() + "-low-level"));
|
|
19
|
+
}
|
|
@@ -345,8 +345,6 @@ class PathValueCommitter {
|
|
|
345
345
|
let valueWatchNode = remoteWatcher.getValueWatchRemoteNodeId(path);
|
|
346
346
|
if (!valueWatchNode || !areNodeIdsEqual(valueWatchNode, batch.sourceNodeId)) {
|
|
347
347
|
let candidates = PathRouter.getAllAuthorities(path);
|
|
348
|
-
require("debugbreak")(2);
|
|
349
|
-
debugger;
|
|
350
348
|
remoteWatcher.getExistingWatchRemoteNodeId(path);
|
|
351
349
|
console.warn(`Ignoring value from wrong authority. Should have been ${debugNodeId(watchingAuthorityId)}, but was received from ${debugNodeId(batch.sourceNodeId)}.`, {
|
|
352
350
|
path,
|
package/src/storageSetup.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
process.env.PRODUCTION = "true";
|
|
2
|
-
import { magenta } from "socket-function/src/formatting/logColors";
|
|
3
2
|
import "./inject";
|
|
4
3
|
process.argv.push("--nobreak");
|
|
5
4
|
|
|
6
|
-
// The storage server entry point (see bin/storageserve.js): sets up the CLI args the sliftutils storage server expects
|
|
5
|
+
// The storage server entry point (see bin/storageserve.js): sets up the CLI args the sliftutils storage server expects and runs its CLI. Trust is no longer synchronized here - the storage server reads it from the signed authorized_keys repo (security/machines) itself.
|
|
7
6
|
|
|
8
7
|
async function main() {
|
|
9
|
-
const { getTrustedMachineIds } = await import("./-d-trust/NetworkTrust2");
|
|
10
|
-
let trustedMachineIds = await getTrustedMachineIds();
|
|
11
|
-
let { setTrustedMachines } = await import("sliftutils/storage/remoteStorage/serverConfig");
|
|
12
|
-
await setTrustedMachines({ account: "root", machineIds: trustedMachineIds });
|
|
13
|
-
console.log(magenta(`Synchronized ${trustedMachineIds.length} trusted machines`));
|
|
14
|
-
|
|
15
8
|
await import("sliftutils/storage/remoteStorage/storageServerCli");
|
|
16
9
|
}
|
|
17
10
|
|