From f48d5631e7e4442b7a6f1b3f1b64631a8b8d8000 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 23 Mar 2026 21:35:36 +0100 Subject: [PATCH] Consolidate to single .env file in project root --- backend/.env | 13 ------------- backend/internal/config/config.go | 7 +------ 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 backend/.env diff --git a/backend/.env b/backend/.env deleted file mode 100644 index 6be6a33..0000000 --- a/backend/.env +++ /dev/null @@ -1,13 +0,0 @@ -DB_HOST=localhost -DB_PORT=3306 -DB_USER=mailadmin -DB_PASSWORD=your-db-password -DB_NAME=mailserver -JWT_SECRET=change-this-secret-in-production - -SMTP_HOST=localhost -SMTP_PORT=587 -SMTP_USER= -SMTP_PASSWORD= -SMTP_FROM=noreply@localhost -BASE_URL=http://localhost:8080 diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go index d02ab0f..fca5c25 100644 --- a/backend/internal/config/config.go +++ b/backend/internal/config/config.go @@ -62,12 +62,7 @@ func Load() *Config { // Load .env file if it exists. // This is for local development convenience. // In production, use environment variables directly. - // Try multiple locations: current dir, backend/.env, ../backend/.env - if err := godotenv.Load(".env"); err != nil { - if err := godotenv.Load("backend/.env"); err != nil { - godotenv.Load("../backend/.env") - } - } + godotenv.Load(".env") // Return a new Config struct with all values. // getEnv(key, default) returns the environment variable value,