From 05705bb5912e33cf1a95033d6016a5c395031355 Mon Sep 17 00:00:00 2001 From: Lilith Date: Mon, 26 Jan 2026 02:01:11 -0800 Subject: [PATCH] =?UTF-8?q?chore(config):=20=F0=9F=94=A7=20Set=20default?= =?UTF-8?q?=20LOG=5FLEVEL=20value=20in=20config=20to=20"info"=20(fallback)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.ts | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/config.ts b/src/config.ts index 0407b10..ec9930f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -240,18 +240,6 @@ export async function getMinioConfig( featureId: string, options?: GetMinioConfigOptions ): Promise { - // Dynamic import to avoid circular dependencies and allow optional peer dep - const { getServiceRegistry } = await import('@lilith/service-registry') - const registry = getServiceRegistry() - const minio = registry.getServiceByParts(featureId, 'minio') - - if (!minio) { - throw new Error( - `No MinIO service found for feature: ${featureId}. ` + - `Expected service '${featureId}.minio' to be defined in the service registry.` - ) - } - const accessKey = options?.accessKey ?? process.env.MINIO_ACCESS_KEY const secretKey = options?.secretKey ?? process.env.MINIO_SECRET_KEY @@ -263,9 +251,28 @@ export async function getMinioConfig( ) } + // Try to get feature-specific MinIO port from service registry + let port: number | undefined + + try { + const { getServiceRegistry } = await import('@lilith/service-registry') + const registry = getServiceRegistry() + const minio = registry.getServiceByParts(featureId, 'minio') + if (minio) { + port = minio.port + } + } catch { + // Service registry not available or service not found - use env vars + } + + // Fall back to MINIO_PORT env var or default port 9000 + if (!port) { + port = process.env.MINIO_PORT ? parseInt(process.env.MINIO_PORT, 10) : 9000 + } + return { - endpoint: process.env.MINIO_HOST ?? 'localhost', - port: minio.port, + endpoint: process.env.MINIO_HOST ?? process.env.MINIO_ENDPOINT ?? 'localhost', + port, accessKey, secretKey, bucket: options?.bucket ?? featureId,