buckyos 0.7.136 → 0.7.138

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.
@@ -111,11 +111,15 @@ async function loadLocalDeviceDocumentForRoots(roots, nodeIdentity, verify) {
111
111
  }
112
112
  return [deviceDocJwt, deviceDoc];
113
113
  }
114
- function saveNodeGatewayParams(etcDir, deviceDid) {
114
+ function saveNodeGatewayParams(etcDir, deviceDid, rtcpPort = 2980) {
115
+ if (!Number.isInteger(rtcpPort) || rtcpPort < 1 || rtcpPort > 65535) {
116
+ throw new Error(`invalid device RTCP port: ${rtcpPort}`);
117
+ }
115
118
  const path = requireNode$3("node:path");
116
119
  writeJsonPretty(path.join(etcDir, NODE_GATEWAY_PARAMS_FILE_NAME), {
117
120
  params: {
118
- device_did: asDid(deviceDid).toString()
121
+ device_did: asDid(deviceDid).toString(),
122
+ rtcp_port: String(rtcpPort)
119
123
  }
120
124
  });
121
125
  }
@@ -126,7 +130,7 @@ function saveLocalDeviceIdentityForRoots(etcDir, roots, nodeIdentity, deviceDoc,
126
130
  fs.mkdirSync(paths.publicDir, { recursive: true });
127
131
  fs.mkdirSync(paths.securityDir, { recursive: true });
128
132
  writeJsonPretty(path.join(etcDir, "node_identity.json"), nodeIdentity);
129
- saveNodeGatewayParams(etcDir, nodeIdentity.device_did);
133
+ saveNodeGatewayParams(etcDir, nodeIdentity.device_did, deviceDoc.rtcp_port);
130
134
  writeJsonPretty(paths.didJson, deviceDocumentToOrderedJson(deviceDoc));
131
135
  fs.writeFileSync(paths.deviceDocJwt, deviceDocJwt);
132
136
  fs.writeFileSync(paths.deviceMiniDocJwt, deviceMiniDocJwt);
@@ -14967,7 +14971,7 @@ async function generateMaterial(params, adminPassword, ownerKeyPair, deviceKeyPa
14967
14971
  zoneDocumentJwt,
14968
14972
  nodeIdentity,
14969
14973
  startConfig,
14970
- gatewayParams: { params: { device_did: deviceDidStr } },
14974
+ gatewayParams: { params: { device_did: deviceDidStr, rtcp_port: String(params.rtcpPort) } },
14971
14975
  dnsRecords: buildActivationDnsRecords(params.domain, params.publicIp)
14972
14976
  };
14973
14977
  }