From 810ec40ce1f3f074532effeee94a5028ae92e8e6 Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Thu, 4 Sep 2025 15:00:14 +0000 Subject: [PATCH] chore: remove dev build tag and add auth debugging --- frontend-modern/vite.config.dev.ts | 31 ------------------------------ internal/config/config.go | 9 +++++++-- scripts/hot-dev.sh | 2 +- 3 files changed, 8 insertions(+), 34 deletions(-) delete mode 100644 frontend-modern/vite.config.dev.ts diff --git a/frontend-modern/vite.config.dev.ts b/frontend-modern/vite.config.dev.ts deleted file mode 100644 index f697aeb4b..000000000 --- a/frontend-modern/vite.config.dev.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { defineConfig } from 'vite'; -import solid from 'vite-plugin-solid'; -import path from 'path'; - -export default defineConfig({ - plugins: [solid()], - resolve: { - alias: { - '@': path.resolve(__dirname, './src'), - }, - }, - server: { - port: 7655, - host: '0.0.0.0', - strictPort: true, // FAIL if port 7655 is not available - proxy: { - '/api': { - target: 'http://127.0.0.1:7656', - changeOrigin: true, - }, - '/ws': { - target: 'ws://127.0.0.1:7656', - ws: true, - changeOrigin: true, - }, - }, - }, - build: { - target: 'esnext', - }, -}); diff --git a/internal/config/config.go b/internal/config/config.go index ff9daba37..e7eb0d3b1 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -359,11 +359,16 @@ func Load() (*Config, error) { log.Debug().Msg("API token exists without explicit enabled flag, assuming enabled for backwards compatibility") } // Check if auth is disabled - if disableAuth := os.Getenv("DISABLE_AUTH"); disableAuth != "" { - cfg.DisableAuth = disableAuth == "true" || disableAuth == "1" + disableAuthEnv := os.Getenv("DISABLE_AUTH") + log.Debug().Str("DISABLE_AUTH_ENV", disableAuthEnv).Msg("Checking DISABLE_AUTH environment variable") + if disableAuthEnv != "" { + cfg.DisableAuth = disableAuthEnv == "true" || disableAuthEnv == "1" + log.Debug().Bool("DisableAuth", cfg.DisableAuth).Msg("DisableAuth set from environment") if cfg.DisableAuth { log.Warn().Msg("⚠️ AUTHENTICATION DISABLED - Pulse is running without authentication!") } + } else { + log.Debug().Bool("DisableAuth", cfg.DisableAuth).Msg("DISABLE_AUTH not set, DisableAuth remains") } // Load proxy authentication settings diff --git a/scripts/hot-dev.sh b/scripts/hot-dev.sh index b1fe207b5..3cf99b771 100755 --- a/scripts/hot-dev.sh +++ b/scripts/hot-dev.sh @@ -99,7 +99,7 @@ cd /opt/pulse echo "Building backend (API-only mode for development)..." # Always rebuild in dev mode to ensure we have the right build echo "Building with PULSE_MOCK_MODE=${PULSE_MOCK_MODE}" -go build -tags "dev" -o pulse ./cmd/pulse +go build -o pulse ./cmd/pulse # Export all PULSE_MOCK_* variables for the backend export PULSE_MOCK_MODE PULSE_MOCK_NODES PULSE_MOCK_VMS_PER_NODE PULSE_MOCK_LXCS_PER_NODE PULSE_MOCK_RANDOM_METRICS PULSE_MOCK_STOPPED_PERCENT # Export auth variables if set