querysub 0.314.0 → 0.315.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
|
@@ -168,7 +168,7 @@ const runEdgeDomainAliveLoop = lazy(() => {
|
|
|
168
168
|
// NOTE: Our DNS TTL is 1 minute, which means no matter how fast we poll,
|
|
169
169
|
// we can't get below that. Of course the worst case is that + our poll rate,
|
|
170
170
|
// but still, this means there is less and less benefit the lower this value is.
|
|
171
|
-
runInfinitePoll(timeInMinute, checkEdgeDomainsAlive);
|
|
171
|
+
runInfinitePoll(timeInMinute * 3, checkEdgeDomainsAlive);
|
|
172
172
|
});
|
|
173
173
|
async function checkEdgeDomainsAlive() {
|
|
174
174
|
if (isNoNetwork()) return;
|
|
@@ -207,55 +207,57 @@ async function publishEdgeDomain() {
|
|
|
207
207
|
if (callerIP === "0.0.0.0") {
|
|
208
208
|
callerIP = await getExternalIP();
|
|
209
209
|
}
|
|
210
|
+
if (!callerIP) {
|
|
211
|
+
console.warn(`publishEdgeDomain called before SocketFunction.mount was called, so we don't know the public ip.`);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
210
214
|
// IMPORTANT! We have to set our A record AFTER we create our cert, otherwise we might wait a while
|
|
211
215
|
// with our A record public while we create our cert.
|
|
212
216
|
runEdgeDomainAliveLoop();
|
|
213
217
|
const edgeDomain = getDomain();
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if (
|
|
218
|
+
try {
|
|
219
|
+
let promises: Promise<void>[] = [];
|
|
220
|
+
let existingIPs = await getRecords("A", edgeDomain);
|
|
221
|
+
if (!isPublic()) {
|
|
222
|
+
if (existingIPs.length === 0) {
|
|
223
|
+
promises.push(addRecord("A", edgeDomain, callerIP));
|
|
224
|
+
} else if (existingIPs.length === 1 && existingIPs[0] === "127.0.0.1") {
|
|
225
|
+
// Good, do nothing
|
|
226
|
+
} else {
|
|
227
|
+
// Don't remove the public servers, this is probably just us accidentally running a
|
|
228
|
+
// test script for a public domain.
|
|
229
|
+
/*
|
|
230
|
+
// Maybe they took down all the public servers?
|
|
231
|
+
await removeDeadARecords();
|
|
232
|
+
existingIPs = await getRecords("A", edgeDomain);
|
|
219
233
|
if (existingIPs.length === 0) {
|
|
220
|
-
|
|
221
|
-
} else if (existingIPs.length === 1 && existingIPs[0] === "127.0.0.1") {
|
|
222
|
-
// Good, do nothing
|
|
234
|
+
await addRecord("A", edgeDomain, callerIP);
|
|
223
235
|
} else {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
/*
|
|
227
|
-
// Maybe they took down all the public servers?
|
|
228
|
-
await removeDeadARecords();
|
|
229
|
-
existingIPs = await getRecords("A", edgeDomain);
|
|
230
|
-
if (existingIPs.length === 0) {
|
|
231
|
-
await addRecord("A", edgeDomain, callerIP);
|
|
232
|
-
} else {
|
|
233
|
-
await addRecord("A", "127-0-0-1." + edgeDomain, "127.0.0.1");
|
|
234
|
-
console.warn(`Tried to serve an edge node on the local domain, but SocketFunction.mount did NOT specify a public ip (ex, { ip: "0.0.0.0" }) AND there are already existing public servers. You can't load balance between real ips and 127.0.0.1! ${existingIPs.join(", ")}. You will need to use 127-0-0-1.${edgeDomain} to access the local server (instead of just ${edgeDomain}).`);
|
|
235
|
-
}
|
|
236
|
-
*/
|
|
237
|
-
console.log(yellow(`Current process is not marked as public, but machine previous had public services. NOT setting ${edgeDomain} to 127.0.0.1, as this would make the public services inaccessible. Assuming the current process is for development, I recommend using 127-0-0-1.${edgeDomain} or 127-0-0-1.${edgeDomain} to access the server.`));
|
|
238
|
-
}
|
|
239
|
-
} else {
|
|
240
|
-
if (existingIPs.includes("127.0.0.1")) {
|
|
241
|
-
console.log(magenta(`Switching from local development to production development (removing A record for 127.0.0.1, and using a real ip)`));
|
|
242
|
-
promises.push(deleteRecord("A", edgeDomain, "127.0.0.1"));
|
|
236
|
+
await addRecord("A", "127-0-0-1." + edgeDomain, "127.0.0.1");
|
|
237
|
+
console.warn(`Tried to serve an edge node on the local domain, but SocketFunction.mount did NOT specify a public ip (ex, { ip: "0.0.0.0" }) AND there are already existing public servers. You can't load balance between real ips and 127.0.0.1! ${existingIPs.join(", ")}. You will need to use 127-0-0-1.${edgeDomain} to access the local server (instead of just ${edgeDomain}).`);
|
|
243
238
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
let ips = await getRecords("A", edgeDomain);
|
|
247
|
-
if (!ips.includes(callerIP)) {
|
|
248
|
-
console.error(`Our A record for ${edgeDomain} is no longer pointing to our ip (${callerIP}, as it is now pointing to ${JSON.stringify(ips)}). Terminating, hopefully when we restart we will fix it. This SHOULDN'T happen often!`);
|
|
249
|
-
await shutdown();
|
|
250
|
-
}
|
|
251
|
-
});
|
|
239
|
+
*/
|
|
240
|
+
console.log(yellow(`Current process is not marked as public, but machine previous had public services. NOT setting ${edgeDomain} to 127.0.0.1, as this would make the public services inaccessible. Assuming the current process is for development, I recommend using 127-0-0-1.${edgeDomain} or 127-0-0-1.${edgeDomain} to access the server.`));
|
|
252
241
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
242
|
+
} else {
|
|
243
|
+
if (existingIPs.includes("127.0.0.1")) {
|
|
244
|
+
console.log(magenta(`Switching from local development to production development (removing A record for 127.0.0.1, and using a real ip)`));
|
|
245
|
+
promises.push(deleteRecord("A", edgeDomain, "127.0.0.1"));
|
|
246
|
+
}
|
|
247
|
+
promises.push(addRecord("A", edgeDomain, callerIP, "proxied"));
|
|
248
|
+
runInfinitePoll(timeInMinute * 1, async () => {
|
|
249
|
+
let ips = await getRecords("A", edgeDomain);
|
|
250
|
+
if (!ips.includes(callerIP)) {
|
|
251
|
+
console.error(`Our A record for ${edgeDomain} is no longer pointing to our ip (${callerIP}, as it is now pointing to ${JSON.stringify(ips)}). Terminating, hopefully when we restart we will fix it. This SHOULDN'T happen often!`);
|
|
252
|
+
await shutdown();
|
|
253
|
+
}
|
|
254
|
+
});
|
|
258
255
|
}
|
|
256
|
+
promises.push(addRecord("A", "127-0-0-1." + edgeDomain, "127.0.0.1"));
|
|
257
|
+
// Add records in parallel, so we can wait for DNS propagation in parallel
|
|
258
|
+
await Promise.all(promises);
|
|
259
|
+
} catch (e) {
|
|
260
|
+
console.error(`Error updating DNS records, continuing without updating them`, e);
|
|
259
261
|
}
|
|
260
262
|
}
|
|
261
263
|
|
|
@@ -179,7 +179,6 @@ export class ErrorWarning extends qreact.Component {
|
|
|
179
179
|
}
|
|
180
180
|
}}
|
|
181
181
|
className={css.fontSize(12).pad2(4, 6)}
|
|
182
|
-
disabled={!this.state.suppressionInput.trim()}
|
|
183
182
|
>
|
|
184
183
|
Fixed
|
|
185
184
|
</Button>
|
|
@@ -196,7 +195,6 @@ export class ErrorWarning extends qreact.Component {
|
|
|
196
195
|
}
|
|
197
196
|
}}
|
|
198
197
|
className={css.fontSize(12).pad2(4, 6)}
|
|
199
|
-
disabled={!this.state.suppressionInput.trim()}
|
|
200
198
|
>
|
|
201
199
|
Not a bug
|
|
202
200
|
</Button>
|
|
@@ -21,6 +21,7 @@ yarn setup-machine 176.9.2.136
|
|
|
21
21
|
- Reset filter in FastArchiveViewer
|
|
22
22
|
- First observe the overlap with it and the BookOverview
|
|
23
23
|
- If we are actually on the book overview page and we close the management page then that shouldn't reset it. We just want to reset it when you change pages. Because we want you to be able to hide and show the management page quickly if you want to double check something. Generally speaking though, you won't be on a page with filter and then going back and forth. And if you are, whatever. That's just the management page. We just want to avoid the overall confusion and annoyance of having lots of pre-filled values (And mostly the confusion of having filter prefilled all the time because it's always going to be set because everyone uses it and no one resets it at the moment.
|
|
24
|
+
- DON'T reset tab. It's useful to remember the tab? Hmm... sometimes at least...
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
|