fix: render nc01 frp public exposure

This commit is contained in:
root
2026-07-09 10:46:51 +02:00
parent 3cf119e382
commit 07d7af8b56
2 changed files with 25 additions and 5 deletions
+8 -5
View File
@@ -1148,10 +1148,13 @@ function runtimePrometheusOperatorResourcesEnabled(deploy, profile) {
return enabled !== false;
}
function runtimeFrpConfigForProfile(deploy, profile) {
function runtimeFrpConfigForProfile(deploy, profile, args = {}) {
const fallbackWebRemotePort = isRuntimeLane(profile) ? defaultPortForRuntimeLane(profile) : profile === "prod" ? 18666 : 17666;
const fallbackEdgeRemotePort = isRuntimeLane(profile) ? fallbackWebRemotePort + 1 : profile === "prod" ? 18667 : 17667;
const frp = isRuntimeLane(profile) ? runtimeLaneConfig(deploy, profile)?.frp : deploy?.frp;
const baseFrp = isRuntimeLane(profile) ? runtimeLaneConfig(deploy, profile)?.frp : deploy?.frp;
const nodeId = effectiveSecretPlaneNodeId(args);
const nodeFrp = nodeId ? baseFrp?.nodes?.[nodeId] : null;
const frp = nodeFrp && typeof nodeFrp === "object" && !Array.isArray(nodeFrp) ? { ...baseFrp, ...nodeFrp } : baseFrp;
const server = frp && typeof frp === "object" && !Array.isArray(frp) ? frp.server : null;
const proxies = Array.isArray(frp?.proxies) ? frp.proxies : [];
const proxyByEndpoint = new Map(proxies
@@ -4529,13 +4532,13 @@ function argoApplication(args, profile = "dev") {
};
}
function nodeFrpcManifest({ profile = "dev", source = null, deploy = null } = {}) {
function nodeFrpcManifest({ profile = "dev", source = null, deploy = null, args = {} } = {}) {
const namespace = namespaceNameForProfile(profile);
const profileLabel = runtimeLabelForProfile(profile);
const deploymentName = isRuntimeLane(profile) ? `hwlab-${profile}-frpc` : profile === "prod" ? "hwlab-node-prod-frpc" : "hwlab-node-frpc";
const configName = `${deploymentName}-config`;
const proxyPrefix = isRuntimeLane(profile) ? `hwlab-${profile}` : profile === "prod" ? "hwlab-node-prod" : "hwlab-node";
const frpConfig = runtimeFrpConfigForProfile(deploy, profile);
const frpConfig = runtimeFrpConfigForProfile(deploy, profile, args);
const webProxyName = frpConfig.webProxyName || `${proxyPrefix}-cloud-web`;
const edgeProxyName = frpConfig.edgeProxyName || `${proxyPrefix}-edge-proxy`;
const labels = {
@@ -5990,7 +5993,7 @@ async function plannedFiles(args) {
if (isRuntimeLane(profile)) putJson(`${runtimePath}/observability.yaml`, observabilityManifest({ deploy, profile, namespace, labels: profileLabels, annotations, metricsSidecarScript }));
if (isRuntimeLane(profile)) putJson(`${runtimePath}/opencode.yaml`, opencodeServerManifest({ profile, source, deploy, catalog: artifactCatalog, registryPrefix: args.registryPrefix, useDeployImages: args.useDeployImages, sourceBranch: args.sourceBranch, gitReadUrl: args.gitReadUrl, sourceRepo: args.sourceRepo }));
if (includeDeviceAgent) putJson(`${runtimePath}/device-agent-71-freq.yaml`, deviceAgent71FreqManifest({ profile, source, registryPrefix: args.registryPrefix, catalog: artifactCatalog, useDeployImages: args.useDeployImages }));
putJson(`${runtimePath}/node-frpc.yaml`, nodeFrpcManifest({ profile, source, deploy }));
putJson(`${runtimePath}/node-frpc.yaml`, nodeFrpcManifest({ profile, source, deploy, args }));
}
return { files, source };
}