From bfaa8aa59997327ae99e2b96f6389d65dc83b599 Mon Sep 17 00:00:00 2001 From: coodos Date: Mon, 16 Mar 2026 00:28:23 +0530 Subject: [PATCH 1/2] chore: normalize env vars --- infrastructure/control-panel/.env.example | 8 ++++++++ .../src/lib/services/notificationService.ts | 12 ++++-------- .../src/routes/api/references/+server.ts | 5 +++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/infrastructure/control-panel/.env.example b/infrastructure/control-panel/.env.example index 27d04289a..c53c9ae18 100644 --- a/infrastructure/control-panel/.env.example +++ b/infrastructure/control-panel/.env.example @@ -7,8 +7,16 @@ LOKI_PASSWORD=admin PUBLIC_REGISTRY_URL=https://registry.staging.metastate.foundation PUBLIC_CONTROL_PANEL_URL=http://localhost:5173 +# Provisioner +PUBLIC_PROVISIONER_URL=http://localhost:3001 + # Notification Trigger (for Notifications tab proxy) NOTIFICATION_TRIGGER_URL=http://localhost:3998 +NOTIFICATION_TRIGGER_PORT=3998 + +# eReputation / Visualizer +PUBLIC_EREPUTATION_BASE_URL=http://localhost:8765 +VISUALIZER_API_KEY= # W3DS Auth Configuration CONTROL_PANEL_JWT_SECRET=replace-with-a-strong-secret diff --git a/infrastructure/control-panel/src/lib/services/notificationService.ts b/infrastructure/control-panel/src/lib/services/notificationService.ts index 7ee0f9ac5..dd4e6add2 100644 --- a/infrastructure/control-panel/src/lib/services/notificationService.ts +++ b/infrastructure/control-panel/src/lib/services/notificationService.ts @@ -1,9 +1,5 @@ -import { - NOTIFICATION_TRIGGER_PORT, - NOTIFICATION_TRIGGER_URL, - PROVISIONER_URL, - PUBLIC_PROVISIONER_URL -} from '$env/static/private'; +import { PUBLIC_PROVISIONER_URL } from '$env/static/public'; +import { NOTIFICATION_TRIGGER_PORT, NOTIFICATION_TRIGGER_URL } from '$env/static/private'; export interface NotificationPayload { title: string; @@ -54,7 +50,7 @@ export async function sendNotification(request: SendNotificationRequest): Promis } export async function getDevicesWithTokens(): Promise<{ token: string; eName: string }[]> { - const provisionerUrl = PUBLIC_PROVISIONER_URL || PROVISIONER_URL || 'http://localhost:3001'; + const provisionerUrl = PUBLIC_PROVISIONER_URL || 'http://localhost:3001'; try { const response = await fetch(`${provisionerUrl}/api/devices/list`, { signal: AbortSignal.timeout(10000) @@ -71,7 +67,7 @@ export async function getDevicesWithTokens(): Promise<{ token: string; eName: st export async function getDevicesByEName( eName: string ): Promise<{ token: string; eName: string }[]> { - const provisionerUrl = PUBLIC_PROVISIONER_URL || PROVISIONER_URL || 'http://localhost:3001'; + const provisionerUrl = PUBLIC_PROVISIONER_URL || 'http://localhost:3001'; try { const response = await fetch( `${provisionerUrl}/api/devices/by-ename/${encodeURIComponent(eName)}`, diff --git a/infrastructure/control-panel/src/routes/api/references/+server.ts b/infrastructure/control-panel/src/routes/api/references/+server.ts index 93245a208..5342d006d 100644 --- a/infrastructure/control-panel/src/routes/api/references/+server.ts +++ b/infrastructure/control-panel/src/routes/api/references/+server.ts @@ -1,9 +1,10 @@ import { json } from '@sveltejs/kit'; import type { RequestHandler } from '@sveltejs/kit'; -import { EREPUTATION_BASE_URL, VISUALIZER_API_KEY } from '$env/static/private'; +import { PUBLIC_EREPUTATION_BASE_URL } from '$env/static/public'; +import { VISUALIZER_API_KEY } from '$env/static/private'; export const GET: RequestHandler = async () => { - const baseUrl = EREPUTATION_BASE_URL || 'http://localhost:8765'; + const baseUrl = PUBLIC_EREPUTATION_BASE_URL || 'http://localhost:8765'; try { const controller = new AbortController(); From b0ba75fbd252fd670d06d8a7547739e7ad7489e7 Mon Sep 17 00:00:00 2001 From: coodos Date: Mon, 16 Mar 2026 00:43:35 +0530 Subject: [PATCH 2/2] chore: fix missing example values --- .env.example | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 5d1f5c702..68051e031 100644 --- a/.env.example +++ b/.env.example @@ -99,6 +99,7 @@ VITE_DREAMSYNC_BASE_URL="http://localhost:8888" EREPUTATION_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/ereputation EREPUTATION_MAPPING_DB_PATH="/path/to/erep/mapping/db" VITE_EREPUTATION_BASE_URL=http://localhost:8765 +PUBLIC_EREPUTATION_BASE_URL=http://localhost:8765 LOAD_TEST_USER_COUNT=6 @@ -108,9 +109,11 @@ LOKI_URL=http://localhost:3100 LOKI_USERNAME=admin LOKI_PASSWORD=admin -LOKI_URL=http://146.190.29.56:3100 -LOKI_USERNAME=admin -LOKI_PASSWORD=admin +# Control Panel +PUBLIC_CONTROL_PANEL_URL=http://localhost:5173 +CONTROL_PANEL_JWT_SECRET=replace-with-a-strong-secret +CONTROL_PANEL_ADMIN_ENAMES_FILE=config/admin-enames.json +VISUALIZER_API_KEY= DREAMSYNC_JWT_SECRET="secret" ECURRENCY_JWT_SECRET="secret"