querysub 0.591.0 → 0.592.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.
Files changed (37) hide show
  1. package/bin/stop-machine.js +4 -0
  2. package/package.json +5 -2
  3. package/src/-a-archives/archiveCache.ts +28 -7
  4. package/src/-a-archives/archiveCache2.ts +4 -1
  5. package/src/-a-archives/archives.ts +2 -63
  6. package/src/-a-archives/archivesDisk.ts +2 -13
  7. package/src/-a-archives/archivesMemoryCache.ts +27 -17
  8. package/src/-a-archives/archivesMemoryCache2.ts +23 -0
  9. package/src/-d-trust/NetworkTrust2.ts +2 -2
  10. package/src/-e-certs/certAuthority.ts +2 -2
  11. package/src/-f-node-discovery/NodeDiscovery.ts +2 -2
  12. package/src/0-path-value-core/AuthorityLookup.ts +0 -4
  13. package/src/0-path-value-core/ShardPrefixes.ts +2 -4
  14. package/src/0-path-value-core/archiveLocks/ArchiveLocks2.ts +23 -10
  15. package/src/0-path-value-core/archiveLocks/archiveSnapshots.ts +0 -1
  16. package/src/0-path-value-core/pathValueArchives.ts +1 -0
  17. package/src/4-deploy/edgeBootstrap.ts +50 -11
  18. package/src/4-deploy/edgeNodes.ts +7 -13
  19. package/src/4-querysub/Querysub.ts +2 -2
  20. package/src/config2.ts +1 -7
  21. package/src/deployManager/components/ServicesListPage.tsx +27 -8
  22. package/src/deployManager/machineDaemonShared.ts +2 -0
  23. package/src/deployManager/machineSchema.ts +5 -6
  24. package/src/deployManager/setupMachineMain.ts +1 -2
  25. package/src/deployManager/stopMachineMain.ts +45 -0
  26. package/src/diagnostics/logs/IndexedLogs/IndexedLogs.ts +34 -21
  27. package/src/diagnostics/logs/IndexedLogs/MCPIndexedLogs.ts +3 -3
  28. package/src/diagnostics/logs/IndexedLogs/TimeFileTree.ts +11 -2
  29. package/src/diagnostics/logs/IndexedLogs/moveIndexLogsToPublic.ts +3 -4
  30. package/src/diagnostics/logs/errorTickets/tickets.ts +3 -4
  31. package/src/diagnostics/logs/lifeCycleAnalysis/lifeCycles.tsx +2 -4
  32. package/src/-a-archives/archivesBackBlaze.ts +0 -156
  33. package/src/-a-archives/archivesCborT.ts +0 -52
  34. package/src/-a-archives/archivesLimitedCache.ts +0 -307
  35. package/src/-a-archives/archivesPrivateFileSystem.ts +0 -326
  36. package/src/-a-archives/copyLocalToBackblaze.ts +0 -24
  37. package/src/-b-authorities/cdnAuthority.ts +0 -53
@@ -1,24 +0,0 @@
1
- import { formatNumber } from "socket-function/src/formatting/format";
2
- import { getDomain } from "../config";
3
- import { getArchivesBackblaze } from "./archivesBackBlaze";
4
- import { getArchivesLocal } from "./archivesDisk";
5
-
6
- async function main() {
7
- const domain = getDomain();
8
- let local = getArchivesLocal(domain);
9
- let remote = getArchivesBackblaze(domain);
10
-
11
- let files = await local.find("");
12
- let allRemoteFiles = new Set(await remote.find(""));
13
- for (let file of files) {
14
- if (allRemoteFiles.has(file)) continue;
15
- let buffer = await local.get(file);
16
- if (!buffer) continue;
17
- console.log(`Copying ${file} size ${formatNumber(buffer.length)}B`);
18
- await remote.set(file, buffer);
19
- }
20
- }
21
- main().catch(console.error).finally(() => process.exit(0));
22
-
23
- // archives = getArchivesLocal(domain);
24
- // archives = getArchivesBackblaze(domain);
@@ -1,53 +0,0 @@
1
- import { Archives } from "../-a-archives/archives";
2
- import { ArchivesBackblaze } from "../-a-archives/archivesBackBlaze";
3
- import { cloudflareGETCall, cloudflarePOSTCall } from "sliftutils/misc/https/cloudflareHelpers";
4
- import { setRecord, getZoneId } from "./dnsAuthority";
5
- import debugbreak from "debugbreak";
6
-
7
- // servicestest.querysub.com/servicesIndex.json
8
-
9
- export async function hostArchives(config: {
10
- archives: Archives;
11
- // Ex, "archives"
12
- subdomain: string;
13
- // Ex, "example.com"
14
- domain: string;
15
- }): Promise<{
16
- getURL: (path: string) => Promise<string>;
17
- }> {
18
- let { archives, subdomain, domain } = config;
19
-
20
- let base = archives.getBaseArchives?.();
21
- let parentPath = base?.parentPath ?? "";
22
- archives = base?.archives ?? archives;
23
- if (parentPath && !parentPath.endsWith("/")) {
24
- parentPath += "/";
25
- }
26
-
27
- if (!(archives instanceof ArchivesBackblaze)) {
28
- throw new Error(`hostArchives not implemented for ${archives.constructor.name}, only "ArchivesBackblaze" is implemented at the moment`);
29
- }
30
-
31
- let archiveT = archives as ArchivesBackblaze;
32
- let baseURL = await archiveT.getURL!("");
33
- // Remove the trailing slash if it exists
34
- if (baseURL.endsWith("/")) {
35
- baseURL = baseURL.slice(0, -1);
36
- }
37
- let backblazeHost = new URL(baseURL).hostname;
38
-
39
- // HACK: Assuming cloudflare is still our DNS provider. If it isn't... this won't work.
40
- await setRecord("CNAME", subdomain + "." + domain, backblazeHost, "proxied");
41
-
42
- async function getURL(path: string) {
43
- if (path.startsWith("/")) {
44
- path = path.slice(1);
45
- }
46
- let targetPath = await archiveT.getURL!(parentPath + path);
47
- let url = new URL(targetPath);
48
- url.hostname = subdomain + "." + domain;
49
- return url.toString();
50
- }
51
-
52
- return { getURL };
53
- }