querysub 0.71.0 → 0.72.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.71.0",
3
+ "version": "0.72.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",
@@ -193,11 +193,16 @@ async function removeDeadARecords() {
193
193
  // and it will be removed when we leave development
194
194
  ips = ips.filter(ip => ip !== "127.0.0.1");
195
195
 
196
+ console.log(`Checking for dead records ${JSON.stringify(ips)}`);
197
+
196
198
  let results = await Promise.all(ips.map(async ip => {
197
199
  return await testTCPIsListening(ip, publicPort);
198
200
  }));
199
201
 
200
202
  let deadIPs = ips.filter((ip, i) => !results[i]);
203
+ if (deadIPs.length > 0) {
204
+ console.log(`Found dead IPs for ${edgeDomain}:${publicPort}, removing their A records: ${JSON.stringify(deadIPs)}`);
205
+ }
201
206
  for (let deadIP of deadIPs) {
202
207
  await deleteRecord("A", edgeDomain, deadIP);
203
208
  }
@@ -209,7 +214,7 @@ async function getHTTPSKeyCertInner(callerIP: string) {
209
214
  try {
210
215
  let promises: Promise<void>[] = [];
211
216
  let existingIPs = await getRecords("A", edgeDomain);
212
- if (callerIP === "127.0.0.1") {
217
+ if (!isPublic()) {
213
218
  if (existingIPs.length === 0) {
214
219
  promises.push(addRecord("A", edgeDomain, callerIP));
215
220
  } else if (existingIPs.length === 1 && existingIPs[0] === "127.0.0.1") {