Merge pull request #2403 from pikasTech/fix/2393-jd01-frpc-token
fix: inject jd01 v03 frpc auth token
This commit is contained in:
@@ -330,6 +330,9 @@ lanes:
|
|||||||
server:
|
server:
|
||||||
address: 82.156.23.220
|
address: 82.156.23.220
|
||||||
bindPort: 22000
|
bindPort: 22000
|
||||||
|
auth:
|
||||||
|
secretName: hwlab-v03-frpc-secrets
|
||||||
|
secretKey: token
|
||||||
proxies:
|
proxies:
|
||||||
- name: hwlab-jd01-v03-cloud-web
|
- name: hwlab-jd01-v03-cloud-web
|
||||||
endpointId: frontend
|
endpointId: frontend
|
||||||
|
|||||||
@@ -1171,7 +1171,9 @@ function runtimeFrpConfigForProfile(deploy, profile) {
|
|||||||
webRemotePort: proxyPort("frontend", fallbackWebRemotePort),
|
webRemotePort: proxyPort("frontend", fallbackWebRemotePort),
|
||||||
edgeRemotePort: proxyPort("api", fallbackEdgeRemotePort),
|
edgeRemotePort: proxyPort("api", fallbackEdgeRemotePort),
|
||||||
webProxyName: proxyValue("frontend", "name", null),
|
webProxyName: proxyValue("frontend", "name", null),
|
||||||
edgeProxyName: proxyValue("api", "name", null)
|
edgeProxyName: proxyValue("api", "name", null),
|
||||||
|
authSecretName: typeof frp?.auth?.secretName === "string" && frp.auth.secretName.trim().length > 0 ? frp.auth.secretName.trim() : null,
|
||||||
|
authSecretKey: typeof frp?.auth?.secretKey === "string" && frp.auth.secretKey.trim().length > 0 ? frp.auth.secretKey.trim() : null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4543,9 +4545,11 @@ function nodeFrpcManifest({ profile = "dev", source = null, deploy = null } = {}
|
|||||||
hostNetwork: true,
|
hostNetwork: true,
|
||||||
dnsPolicy: "ClusterFirstWithHostNet"
|
dnsPolicy: "ClusterFirstWithHostNet"
|
||||||
} : {};
|
} : {};
|
||||||
|
const authConfigText = frpConfig.authSecretName && frpConfig.authSecretKey ? `auth.token = "{{ .Envs.FRPC_AUTH_TOKEN }}"\n` : "";
|
||||||
const configText = `serverAddr = "${frpConfig.serverAddr}"
|
const configText = `serverAddr = "${frpConfig.serverAddr}"
|
||||||
serverPort = ${frpConfig.serverPort}
|
serverPort = ${frpConfig.serverPort}
|
||||||
loginFailExit = true
|
loginFailExit = true
|
||||||
|
${authConfigText}
|
||||||
|
|
||||||
[[proxies]]
|
[[proxies]]
|
||||||
name = "${webProxyName}"
|
name = "${webProxyName}"
|
||||||
@@ -4599,6 +4603,7 @@ remotePort = ${frpConfig.edgeRemotePort}
|
|||||||
name: "frpc",
|
name: "frpc",
|
||||||
image: "fatedier/frpc:v0.68.1",
|
image: "fatedier/frpc:v0.68.1",
|
||||||
imagePullPolicy: "IfNotPresent",
|
imagePullPolicy: "IfNotPresent",
|
||||||
|
...(frpConfig.authSecretName && frpConfig.authSecretKey ? { env: [{ name: "FRPC_AUTH_TOKEN", valueFrom: { secretKeyRef: { name: frpConfig.authSecretName, key: frpConfig.authSecretKey } } }] } : {}),
|
||||||
args: ["-c", "/etc/frp/frpc.toml"],
|
args: ["-c", "/etc/frp/frpc.toml"],
|
||||||
volumeMounts: [{ name: "config", mountPath: "/etc/frp", readOnly: true }]
|
volumeMounts: [{ name: "config", mountPath: "/etc/frp", readOnly: true }]
|
||||||
}],
|
}],
|
||||||
|
|||||||
Reference in New Issue
Block a user