diff --git a/src/config/runtime-service-config.base.yaml b/src/config/runtime-service-config.base.yaml index 837e5c7..4658f97 100644 --- a/src/config/runtime-service-config.base.yaml +++ b/src/config/runtime-service-config.base.yaml @@ -2,5 +2,4 @@ apiBaseUrl: https://rag-server-svc-plus-266500572462.asia-northeast1.run.app authUrl: https://accounts-svc-plus-266500572462.asia-northeast1.run.app dashboardUrl: https://console.svc.plus -internalApiBaseUrl: http://127.0.0.1:8090 logLevel: info diff --git a/src/config/runtime-service-config.prod.yaml b/src/config/runtime-service-config.prod.yaml index 3660fa7..21ea10b 100644 --- a/src/config/runtime-service-config.prod.yaml +++ b/src/config/runtime-service-config.prod.yaml @@ -5,9 +5,7 @@ regions: apiBaseUrl: https://rag-server-svc-plus-266500572462.asia-northeast1.run.app authUrl: https://accounts-svc-plus-266500572462.asia-northeast1.run.app dashboardUrl: https://console.svc.plus - internalApiBaseUrl: https://rag-server-svc-plus-266500572462.asia-northeast1.run.app global: apiBaseUrl: https://rag-server-svc-plus-266500572462.asia-northeast1.run.app authUrl: https://accounts-svc-plus-266500572462.asia-northeast1.run.app dashboardUrl: https://console.svc.plus - internalApiBaseUrl: https://rag-server-svc-plus-266500572462.asia-northeast1.run.app diff --git a/src/server/serviceConfig.ts b/src/server/serviceConfig.ts index d4e5de1..7e5d147 100644 --- a/src/server/serviceConfig.ts +++ b/src/server/serviceConfig.ts @@ -4,7 +4,6 @@ import { loadRuntimeConfig } from './runtime-loader' const FALLBACK_ACCOUNT_SERVICE_URL = 'https://accounts.svc.plus' const FALLBACK_SERVER_SERVICE_URL = 'https://api.svc.plus' -const FALLBACK_SERVER_SERVICE_INTERNAL_URL = 'http://127.0.0.1:8090' const LOCAL_HOSTNAMES = new Set(['localhost', '127.0.0.1', '[::1]']) @@ -20,12 +19,7 @@ function getRuntimeDefaultServerServiceUrl(): string { return candidate ?? FALLBACK_SERVER_SERVICE_URL } -function getRuntimeDefaultInternalServerServiceUrl(): string { - const runtime = loadRuntimeConfig() - const candidate = - typeof runtime.internalApiBaseUrl === 'string' ? runtime.internalApiBaseUrl : undefined - return candidate ?? FALLBACK_SERVER_SERVICE_INTERNAL_URL -} + function readEnvValue(...keys: string[]): string | undefined { for (const key of keys) { @@ -120,27 +114,8 @@ export function getInternalServerServiceBaseUrl(): string { return normalizeBaseUrl(configured) } - const external = getServerServiceBaseUrl() - const runtimeInternalDefault = normalizeBaseUrl(getRuntimeDefaultInternalServerServiceUrl()) - - try { - const parsed = new URL(external) - if (LOCAL_HOSTNAMES.has(parsed.hostname)) { - if (parsed.hostname !== '127.0.0.1') { - parsed.hostname = '127.0.0.1' - } - - if (parsed.protocol === 'https:') { - parsed.protocol = 'http:' - } - - return normalizeBaseUrl(parsed.toString()) - } - } catch { - // Ignore parsing errors and fall back to the internal default below. - } - - return runtimeInternalDefault + // For distributed architecture, internal and external URLs are the same + return getServerServiceBaseUrl() } export const serviceConfig = {