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:
|
||||
address: 82.156.23.220
|
||||
bindPort: 22000
|
||||
auth:
|
||||
secretName: hwlab-v03-frpc-secrets
|
||||
secretKey: token
|
||||
proxies:
|
||||
- name: hwlab-jd01-v03-cloud-web
|
||||
endpointId: frontend
|
||||
|
||||
@@ -1171,7 +1171,9 @@ function runtimeFrpConfigForProfile(deploy, profile) {
|
||||
webRemotePort: proxyPort("frontend", fallbackWebRemotePort),
|
||||
edgeRemotePort: proxyPort("api", fallbackEdgeRemotePort),
|
||||
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,
|
||||
dnsPolicy: "ClusterFirstWithHostNet"
|
||||
} : {};
|
||||
const authConfigText = frpConfig.authSecretName && frpConfig.authSecretKey ? `auth.token = "{{ .Envs.FRPC_AUTH_TOKEN }}"\n` : "";
|
||||
const configText = `serverAddr = "${frpConfig.serverAddr}"
|
||||
serverPort = ${frpConfig.serverPort}
|
||||
loginFailExit = true
|
||||
${authConfigText}
|
||||
|
||||
[[proxies]]
|
||||
name = "${webProxyName}"
|
||||
@@ -4599,6 +4603,7 @@ remotePort = ${frpConfig.edgeRemotePort}
|
||||
name: "frpc",
|
||||
image: "fatedier/frpc:v0.68.1",
|
||||
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"],
|
||||
volumeMounts: [{ name: "config", mountPath: "/etc/frp", readOnly: true }]
|
||||
}],
|
||||
|
||||
Reference in New Issue
Block a user