fix: move sub2api runtime to PK01 host docker
This commit is contained in:
@@ -284,9 +284,20 @@ export function readManualBindingSources(value: unknown, key: string): CodexPool
|
||||
kind: readManualBindingKind(rawSource.kind, `${path}.kind`),
|
||||
provider: readManualBindingProvider(rawSource.provider, `${path}.provider`),
|
||||
description: readManualAccountReason(rawSource.description, `${path}.description`),
|
||||
fixedProxy: null,
|
||||
};
|
||||
if (source.kind === "proxy" && source.provider !== "target-egress-proxy") {
|
||||
throw new Error(`${codexPoolConfigPath}.${path}.provider must be target-egress-proxy for kind=proxy`);
|
||||
if (source.kind === "proxy" && source.provider === "fixed-http-proxy") {
|
||||
const fixedProxy = requiredRecordConfigField(rawSource, "fixedProxy", path);
|
||||
const protocol = requiredStringConfigField(fixedProxy, "protocol", `${path}.fixedProxy`);
|
||||
if (protocol !== "http") throw new Error(`${codexPoolConfigPath}.${path}.fixedProxy.protocol must be http`);
|
||||
const host = requiredStringConfigField(fixedProxy, "host", `${path}.fixedProxy`);
|
||||
if (!/^[A-Za-z0-9._:-]+$/u.test(host)) throw new Error(`${codexPoolConfigPath}.${path}.fixedProxy.host has an unsupported format`);
|
||||
const port = integerConfigField(fixedProxy, "port", `${path}.fixedProxy`);
|
||||
validatePort(port, `${path}.fixedProxy.port`);
|
||||
source.fixedProxy = { protocol, host, port };
|
||||
}
|
||||
if (source.kind === "proxy" && source.provider !== "target-egress-proxy" && source.provider !== "fixed-http-proxy") {
|
||||
throw new Error(`${codexPoolConfigPath}.${path}.provider must be target-egress-proxy or fixed-http-proxy for kind=proxy`);
|
||||
}
|
||||
if (source.kind === "group" && source.provider !== "pool-group") {
|
||||
throw new Error(`${codexPoolConfigPath}.${path}.provider must be pool-group for kind=group`);
|
||||
@@ -343,7 +354,7 @@ export function readManualBindingKind(value: unknown, key: string): CodexPoolMan
|
||||
|
||||
export function readManualBindingProvider(value: unknown, key: string): CodexPoolManualBindingProvider {
|
||||
const text = stringValue(value);
|
||||
if (text !== "target-egress-proxy" && text !== "pool-group") throw new Error(`${codexPoolConfigPath}.${key} must be target-egress-proxy or pool-group`);
|
||||
if (text !== "target-egress-proxy" && text !== "fixed-http-proxy" && text !== "pool-group") throw new Error(`${codexPoolConfigPath}.${key} must be target-egress-proxy, fixed-http-proxy, or pool-group`);
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user