querysub 0.263.0 → 0.265.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.263.0",
3
+ "version": "0.265.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",
@@ -379,8 +379,10 @@ async function getModuleFromSpecBase(
379
379
  throw new Error(`Module not found: ${moduleId} (for ${spec.FunctionId})`);
380
380
  }
381
381
 
382
- if (hotReloadPackagePath) {
383
- hotReloadUnderPath(hotReloadPackagePath);
382
+ if (!isPublic()) {
383
+ if (hotReloadPackagePath) {
384
+ hotReloadUnderPath(hotReloadPackagePath);
385
+ }
384
386
  }
385
387
 
386
388
  return moduleImported;
@@ -136,11 +136,14 @@ const loadEntryPointsByHash = runInSerial(async function loadEntryPointsByHash(c
136
136
  let gitHash = config.hash;
137
137
  let entryPaths = config.entryPaths;
138
138
 
139
+ let gitURL = await getGitURLLive();
140
+ let filePath = entryPaths[0];
141
+ console.log(magenta(`Loading entry point from ${gitHash}, path: ${filePath}`));
139
142
 
140
143
  let module = await getModuleFromConfig({
141
- gitURL: await getGitURLLive(),
144
+ gitURL,
142
145
  gitRef: gitHash,
143
- FilePath: entryPaths[0],
146
+ FilePath: filePath,
144
147
  FunctionId: "entryPoint",
145
148
  });
146
149
 
@@ -165,7 +168,7 @@ const loadEntryPointsByHash = runInSerial(async function loadEntryPointsByHash(c
165
168
  };
166
169
 
167
170
  await edgeNodeStorage.set(getNextNodePath(), Buffer.from(JSON.stringify(edgeNodeConfig)));
168
- console.log(magenta(`Deployed edge node`), edgeNodeConfig);
171
+ console.log(magenta(`Registered edge node`), edgeNodeConfig);
169
172
 
170
173
  await updateEdgeNodesFile();
171
174
 
@@ -714,7 +714,8 @@ export class Querysub {
714
714
  Querysub.trustedDomains.add(domain);
715
715
  }
716
716
 
717
- if (config.hotReload) {
717
+ // Hot reloading on public servers breaks things when we update (as the git pull triggers a hot reload), so... don't do that.
718
+ if (config.hotReload && !isPublic()) {
718
719
  watchFilesAndTriggerHotReloading();
719
720
  }
720
721
 
@@ -134,6 +134,9 @@ export class MachineDetailPage extends qreact.Component {
134
134
  <div>
135
135
  Launches: {serviceInfo.totalTimesLaunched}
136
136
  </div>
137
+ <div>
138
+ Guessed Node ID: {serviceInfo.nodeId}
139
+ </div>
137
140
  {hasError && (
138
141
  <div className={css.colorhsl(0, 80, 50)}>
139
142
  ⚠️ Has Error
@@ -28,7 +28,7 @@ export class RenderGitRefInfo extends qreact.Component<{
28
28
  });
29
29
  if (!gitRefInfo) return undefined;
30
30
  return <div className={css.fontWeight("normal")}>
31
- {formatDateJSX(gitRefInfo.time)} AGO <span className={css.hsl(0, 0, 80).pad2(5, 2).italic}>{gitRefInfo.description}</span>
31
+ {formatDateJSX(gitRefInfo.time)} AGO <span className={css.hsl(0, 0, 80).pad2(5, 2).italic}>{gitRefInfo.description}</span> ({this.props.gitRef.slice(0, 6)})
32
32
  </div>;
33
33
  }
34
34
  }
@@ -481,6 +481,7 @@ const resyncServicesBase = runInSerial(measureWrap(async function resyncServices
481
481
  lastLaunchedTime,
482
482
  errorFromLastRun: "",
483
483
  totalTimesLaunched: launchCount,
484
+ nodeId: "",
484
485
  };
485
486
  try {
486
487
  let folder = root + screenName + "/";
@@ -523,6 +524,12 @@ const resyncServicesBase = runInSerial(measureWrap(async function resyncServices
523
524
 
524
525
  await fs.promises.writeFile(parameterPath, newParametersString);
525
526
 
527
+ let nodePathId = folder + SERVICE_NODE_FILE_NAME;
528
+ if (fs.existsSync(nodePathId)) {
529
+ let nodeId = await fs.promises.readFile(nodePathId, "utf8");
530
+ machineInfo.services[config.serviceId].nodeId = nodeId;
531
+ }
532
+
526
533
  await runScreenCommand({
527
534
  screenName,
528
535
  command: config.parameters.command,
@@ -52,6 +52,8 @@ export type MachineInfo = {
52
52
  errorFromLastRun: string;
53
53
  // Only times launched for the current applyNodeId, but... still very useful.
54
54
  totalTimesLaunched: number;
55
+ // Might take a while to set (15 minutes or more). It's better to look in the nodes list and find the one that seems to match (maybe looking at the startup path to find it?)
56
+ nodeId: string;
55
57
  }>;
56
58
  };
57
59
 
@@ -1,21 +1,28 @@
1
+ 7) Broken loading of CYOA
2
+ 1) Deploy (database functions)
3
+ 2) deploy the CYOA service
4
+ 3) Refresh the main page
5
+ RESULT: It tries to access the specific hash, but it wasn't loaded serverside, so permissions are refused
1
6
 
2
7
  8) Fix deploy user notification issue, where the refresh button doesn't work?
3
8
  - For application level updates
4
9
  - Just an application commit, then deploy the service, then the refresh button should show up, and work
5
10
 
6
11
 
7
- What about cloudflare registration?
8
12
  8) Use a special service for the HTTP bootstrapper, and then have 2 others that are on other ports
9
- - Find a way to prevent the bootstrapper from being picked as the backend as well, so we don't need to update it!
10
-
11
13
  --bootstraponly is added, and should work?
12
14
 
15
+ 9) Verify the bootstrap server can't be picked as the endpoint server
16
+
17
+
13
18
  9) Rolling service updates
14
19
  - Add rollingWindow to the definition
15
20
  - Set for public facing services (but not for scripts)
16
21
  - PathValueServer - 10 minutes
17
22
  - FunctionRunner - 10 minutes
18
23
  - HTTP - 4 hours
24
+ - Boostrapper - NO rolling
25
+ - gc/join - NO rolling
19
26
  - Show the rolling time in the update buttons (both list and the save button on the details page), so we know it will be a rolling update
20
27
  - Keep the oldest service alive when we update
21
28
  - Tracked per serviceId
@@ -30,3 +37,6 @@ What about cloudflare registration?
30
37
  - Filled, but the total size will also depend on the maximum (to a degree), so it's very nice.
31
38
  - A bar, with a label, or something. The AI can give us a few options
32
39
  (Yes, it overlaps with node metrics, but that's okay, sometimes we want to look at machines, other times services, and the types of errors that show up in either changes).
40
+
41
+
42
+ 11) Restart the server and verify everything starts up nicely on reboot!