querysub 0.517.0 → 0.518.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
|
@@ -556,7 +556,8 @@ export class QuerysubControllerBase {
|
|
|
556
556
|
throw new Error(`Call has no network, so it would never run (no FunctionRunner would pick it up). Call ${debugCallSpec(call)}`);
|
|
557
557
|
}
|
|
558
558
|
// Networks where every function runner is non-public are only usable by super users (they were never meant to receive public traffic, ex, a dev network).
|
|
559
|
-
|
|
559
|
+
// ALSO, We have to allow calls on the same machine as us, otherwise developers can't log in!
|
|
560
|
+
if (!isNetworkPublic(call.network) && !(await isManagementUser() || call.callerIP === "127.0.0.1")) {
|
|
560
561
|
throw new Error(`Caller is not a super user, and so cannot add calls on the non-public network "${call.network}". Call ${debugCallSpec(call)}`);
|
|
561
562
|
}
|
|
562
563
|
|
|
@@ -11,7 +11,7 @@ const EDGE_NODE_URL_PARAM = "edgenode";
|
|
|
11
11
|
/** A dropdown showing all the edge nodes the bootstrapper had to pick from (with their probed latencies), which one we booted from, and allowing forcing a specific edge node. Forcing sets a url parameter and refreshes the page, as the edge node is used by the bootstrapper, so it can only apply on a fresh page load. Super users only. */
|
|
12
12
|
export class EdgeNodeSelector extends qreact.Component<{}> {
|
|
13
13
|
render() {
|
|
14
|
-
if (!isCurrentUserSuperUser()) return undefined;
|
|
14
|
+
if (!(isCurrentUserSuperUser() || location.hostname.startsWith("127-0-0-1"))) return undefined;
|
|
15
15
|
// The stats are a plain global the bootstrapper updates as its probes finish, so we re-read them every second
|
|
16
16
|
Querysub.nowDelayed(timeInSecond);
|
|
17
17
|
let stats = globalThis.EDGE_NODE_STATS;
|
|
@@ -7,7 +7,7 @@ import { forcedNetworkURL, getAutoSelectedNetwork, getNetworkSelectionInfos, get
|
|
|
7
7
|
/** A dropdown showing all the function runner networks, which one our function calls are being put on, and allowing forcing a specific network (and unforcing it, going back to the automatic selection). Super users only. */
|
|
8
8
|
export class NetworkSelector extends qreact.Component<{}> {
|
|
9
9
|
render() {
|
|
10
|
-
if (!isCurrentUserSuperUser()) return undefined;
|
|
10
|
+
if (!(isCurrentUserSuperUser() || location.hostname.startsWith("127-0-0-1"))) return undefined;
|
|
11
11
|
let infos = getNetworkSelectionInfos();
|
|
12
12
|
let forced = forcedNetworkURL.value;
|
|
13
13
|
let selected = getSelectedNetwork({ noThrow: true });
|