fix: harden M3 simulator identities and wiring
This commit is contained in:
@@ -8,12 +8,22 @@ import {
|
||||
import { createHealth, createBoxState, selectInstanceValue } from "../../internal/sim/model.mjs";
|
||||
import { createJsonServer, listen, parsePort, readJson } from "../../internal/sim/http.mjs";
|
||||
|
||||
const boxId = selectInstanceValue(process.env.HWLAB_BOX_ID, "boxsim_alpha");
|
||||
const boxId = selectInstanceValue(process.env.HWLAB_BOX_ID, "boxsim_alpha", {
|
||||
requireIndexForMultiple: true,
|
||||
label: "HWLAB_BOX_ID"
|
||||
});
|
||||
const gatewaySessionId = selectInstanceValue(
|
||||
process.env.HWLAB_GATEWAY_SESSION_ID,
|
||||
"gws_mvp_simu"
|
||||
"gws_mvp_simu",
|
||||
{
|
||||
requireIndexForMultiple: true,
|
||||
label: "HWLAB_GATEWAY_SESSION_ID"
|
||||
}
|
||||
);
|
||||
const resourceId = selectInstanceValue(process.env.HWLAB_BOX_RESOURCE_ID, "");
|
||||
const resourceId = selectInstanceValue(process.env.HWLAB_BOX_RESOURCE_ID, "", {
|
||||
requireIndexForMultiple: true,
|
||||
label: "HWLAB_BOX_RESOURCE_ID"
|
||||
});
|
||||
const port = parsePort(process.env.PORT, 7201);
|
||||
const state = createBoxState({ boxId, gatewaySessionId });
|
||||
if (resourceId) {
|
||||
|
||||
Reference in New Issue
Block a user