fix: move sub2api runtime to PK01 host docker
This commit is contained in:
@@ -30,7 +30,8 @@ export const codexPoolConfigPath = rootPath("config", "platform-infra", "sub2api
|
||||
export const legacySub2apiCaddyManagedMarker = "sub2api";
|
||||
|
||||
export function sub2apiCaddyManagedMarker(target: Sub2ApiTargetConfig): string {
|
||||
return target.id.toUpperCase() === "D601" ? legacySub2apiCaddyManagedMarker : `${legacySub2apiCaddyManagedMarker}-${target.id.toLowerCase()}`;
|
||||
const id = target.id.toUpperCase();
|
||||
return id === "D601" || id === "PK01" ? legacySub2apiCaddyManagedMarker : `${legacySub2apiCaddyManagedMarker}-${target.id.toLowerCase()}`;
|
||||
}
|
||||
|
||||
export const requiredSecretKeys = ["POSTGRES_PASSWORD", "ADMIN_PASSWORD", "JWT_SECRET", "TOTP_ENCRYPTION_KEY"] as const;
|
||||
@@ -39,6 +40,8 @@ export type DatabaseMode = "bundled" | "external-pending" | "external-active";
|
||||
|
||||
export type RedisMode = "bundled-persistent" | "local-ephemeral";
|
||||
|
||||
export type RuntimeMode = "k3s" | "host-docker";
|
||||
|
||||
export interface Sub2ApiConfig {
|
||||
version: number;
|
||||
kind: string;
|
||||
@@ -109,6 +112,7 @@ export interface Sub2ApiTargetConfig {
|
||||
id: string;
|
||||
route: string;
|
||||
namespace: string;
|
||||
runtimeMode: RuntimeMode;
|
||||
role: string;
|
||||
enabled: boolean;
|
||||
databaseMode: DatabaseMode;
|
||||
@@ -117,18 +121,37 @@ export interface Sub2ApiTargetConfig {
|
||||
redisReplicas: number;
|
||||
image: Partial<Sub2ApiConfig["image"]>;
|
||||
dependencyImages: Partial<Sub2ApiConfig["dependencyImages"]>;
|
||||
hostDocker: Sub2ApiHostDockerConfig | null;
|
||||
publicExposure: Sub2ApiPublicExposureConfig | null;
|
||||
egressProxy: Sub2ApiEgressProxyConfig | null;
|
||||
}
|
||||
|
||||
export interface Sub2ApiHostDockerConfig {
|
||||
projectName: string;
|
||||
workDir: string;
|
||||
composePath: string;
|
||||
envPath: string;
|
||||
appDataDir: string;
|
||||
appPort: number;
|
||||
redisPort: number;
|
||||
databaseHost: string;
|
||||
databaseSslMode: string;
|
||||
noProxy: string[];
|
||||
}
|
||||
|
||||
export interface Sub2ApiPublicExposureConfig {
|
||||
enabled: boolean;
|
||||
mode: "frp" | "pk01-local";
|
||||
publicBaseUrl: string;
|
||||
dns: {
|
||||
hostname: string;
|
||||
expectedA: string;
|
||||
resolvers: string[];
|
||||
};
|
||||
local: {
|
||||
upstreamHost: string;
|
||||
upstreamPort: number;
|
||||
} | null;
|
||||
frpc: {
|
||||
deploymentName: string;
|
||||
secretName: string;
|
||||
@@ -142,7 +165,7 @@ export interface Sub2ApiPublicExposureConfig {
|
||||
localPort: number;
|
||||
tokenSourceRef: string;
|
||||
tokenSourceKey: string;
|
||||
};
|
||||
} | null;
|
||||
pk01: {
|
||||
route: string;
|
||||
caddyBinaryPath: string;
|
||||
|
||||
Reference in New Issue
Block a user