querysub 0.591.0 → 0.593.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 (44) hide show
  1. package/.claude/settings.local.json +5 -1
  2. package/bin/stop-machine.js +4 -0
  3. package/package.json +6 -3
  4. package/spec.txt +12 -0
  5. package/src/-a-archives/archiveCache.ts +28 -7
  6. package/src/-a-archives/archiveCache2.ts +4 -1
  7. package/src/-a-archives/archives.ts +2 -63
  8. package/src/-a-archives/archives2.ts +21 -17
  9. package/src/-a-archives/archivesDisk.ts +2 -13
  10. package/src/-a-archives/archivesMemoryCache.ts +27 -17
  11. package/src/-a-archives/archivesMemoryCache2.ts +23 -0
  12. package/src/-d-trust/NetworkTrust2.ts +3 -3
  13. package/src/-e-certs/certAuthority.ts +2 -2
  14. package/src/-f-node-discovery/NodeDiscovery.ts +3 -3
  15. package/src/0-path-value-core/AuthorityLookup.ts +0 -4
  16. package/src/0-path-value-core/PathRouter.ts +17 -16
  17. package/src/0-path-value-core/ShardPrefixes.ts +2 -4
  18. package/src/0-path-value-core/archiveLocks/ArchiveLocks2.ts +133 -38
  19. package/src/0-path-value-core/archiveLocks/archiveSnapshots.ts +0 -1
  20. package/src/0-path-value-core/pathValueArchives.ts +9 -5
  21. package/src/2-proxy/archiveMoveHarness.ts +1 -1
  22. package/src/4-deploy/edgeBootstrap.ts +50 -11
  23. package/src/4-deploy/edgeNodes.ts +7 -13
  24. package/src/4-querysub/Querysub.ts +2 -2
  25. package/src/archiveapps/archiveJoinEntry.ts +1 -1
  26. package/src/config2.ts +1 -7
  27. package/src/deployManager/components/ServicesListPage.tsx +27 -8
  28. package/src/deployManager/machineDaemonShared.ts +2 -0
  29. package/src/deployManager/machineSchema.ts +5 -6
  30. package/src/deployManager/setupMachineMain.ts +1 -2
  31. package/src/deployManager/stopMachineMain.ts +45 -0
  32. package/src/diagnostics/logs/IndexedLogs/IndexedLogs.ts +34 -21
  33. package/src/diagnostics/logs/IndexedLogs/MCPIndexedLogs.ts +3 -3
  34. package/src/diagnostics/logs/IndexedLogs/TimeFileTree.ts +11 -2
  35. package/src/diagnostics/logs/IndexedLogs/moveIndexLogsToPublic.ts +3 -4
  36. package/src/diagnostics/logs/errorTickets/tickets.ts +3 -4
  37. package/src/diagnostics/logs/lifeCycleAnalysis/lifeCycles.tsx +2 -4
  38. package/src/storageSetup.ts +1 -1
  39. package/src/-a-archives/archivesBackBlaze.ts +0 -156
  40. package/src/-a-archives/archivesCborT.ts +0 -52
  41. package/src/-a-archives/archivesLimitedCache.ts +0 -307
  42. package/src/-a-archives/archivesPrivateFileSystem.ts +0 -326
  43. package/src/-a-archives/copyLocalToBackblaze.ts +0 -24
  44. package/src/-b-authorities/cdnAuthority.ts +0 -53
@@ -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
- }