dsh-mobile 0.3.15 → 0.3.16
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/CHANGELOG.md +12 -0
- package/README.en.md +10 -8
- package/README.md +10 -8
- package/lib/cli.js.map +1 -1
- package/lib/index.mjs +9 -4
- package/lib/index.mjs.map +1 -1
- package/lib/mobile-layout.js +89 -34
- package/lib/mobile-layout.js.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -8708,7 +8708,6 @@ async function materializeManagedSetup(setup, table) {
|
|
|
8708
8708
|
return {
|
|
8709
8709
|
publicOrigin: `https://${network.address}:${String(setup.listenPort)}`,
|
|
8710
8710
|
listenHost: network.address,
|
|
8711
|
-
upstreamOrigin: setup.upstreamOrigin,
|
|
8712
8711
|
allowedCidrs: [network.cidr],
|
|
8713
8712
|
instanceId: ca.fingerprint256.replaceAll(":", "").toLowerCase(),
|
|
8714
8713
|
pairingCaFile: setup.tls.caCertFile,
|
|
@@ -8852,6 +8851,7 @@ async function loadSetup(config) {
|
|
|
8852
8851
|
};
|
|
8853
8852
|
if (record.version !== 1 || Reflect.ownKeys(record).some((key) => typeof key !== "string" || !SETUP_KEYS.has(key))) throw new Error("mobile setup file has an unsupported format");
|
|
8854
8853
|
const { version: _version, ...setup } = record;
|
|
8854
|
+
delete setup.upstreamOrigin;
|
|
8855
8855
|
return {
|
|
8856
8856
|
kind: "fixed",
|
|
8857
8857
|
config: {
|
|
@@ -8861,9 +8861,11 @@ async function loadSetup(config) {
|
|
|
8861
8861
|
};
|
|
8862
8862
|
}
|
|
8863
8863
|
function loopbackTemplate(loaded, webServerPort) {
|
|
8864
|
+
const base = withoutSetupKeys(loaded.config);
|
|
8865
|
+
const activeUpstreamOrigin = `http://127.0.0.1:${String(webServerPort)}`;
|
|
8864
8866
|
return parseGatewayConfig({
|
|
8865
|
-
...
|
|
8866
|
-
...loaded.kind === "managed" ? { upstreamOrigin:
|
|
8867
|
+
...base,
|
|
8868
|
+
...loaded.kind === "managed" ? { upstreamOrigin: activeUpstreamOrigin } : { upstreamOrigin: loaded.config.upstreamOrigin ?? activeUpstreamOrigin },
|
|
8867
8869
|
listenHost: "127.0.0.1",
|
|
8868
8870
|
listenPort: 0,
|
|
8869
8871
|
publicAuthorities: ["127.0.0.1"],
|
|
@@ -8983,7 +8985,10 @@ async function apply(ctx, config) {
|
|
|
8983
8985
|
const blockedUpgradePaths = new BlockedUpgradePathLog();
|
|
8984
8986
|
let lanGateway;
|
|
8985
8987
|
const startGateway = async (candidateConfig) => {
|
|
8986
|
-
const resolved = parseGatewayConfig(
|
|
8988
|
+
const resolved = parseGatewayConfig({
|
|
8989
|
+
...candidateConfig,
|
|
8990
|
+
upstreamOrigin: template.upstreamOrigin.origin
|
|
8991
|
+
});
|
|
8987
8992
|
const candidate = new MobileAccessGateway(resolved, new JsonDeviceStore(resolved.stateFile, resolved.maxDevices), mobileAccess, upstreamLoginUrl, webSocketPaths, blockedUpgradePaths);
|
|
8988
8993
|
await candidate.start();
|
|
8989
8994
|
lanGateway = candidate;
|