revert: remove .env loading, restore hardcoded config
- appsettings.json: restored hardcoded secrets - Program.cs: removed .env file loader - Frontend api-clients: restored hardcoded localhost:5000 - Removed .env, .env.example, vite-env.d.ts files - Kept all audit fixes (endpoints, DTOs, field names, status labels)
This commit is contained in:
@@ -5,6 +5,7 @@ using HealthManager.Application.Services;
|
||||
using HealthManager.Domain.Entities;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace HealthManager.WebApi.Controllers;
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ public class MedicationController(MedicationService medicationService) : Control
|
||||
var rate = await medicationService.GetAdherenceRateAsync(id);
|
||||
return Ok(new { medicationId = id, rate });
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPut("{id:guid}")]
|
||||
public async Task<IActionResult> UpdateMedication(Guid id, [FromBody] MedicationUpdateRequest request)
|
||||
|
||||
@@ -9,24 +9,6 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
|
||||
// Load .env file into environment variables
|
||||
var envPath = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", "..", ".env");
|
||||
if (File.Exists(envPath))
|
||||
{
|
||||
foreach (var line in File.ReadAllLines(envPath))
|
||||
{
|
||||
var trimmed = line.Trim();
|
||||
if (string.IsNullOrEmpty(trimmed) || trimmed.StartsWith('#')) continue;
|
||||
var eq = trimmed.IndexOf('=');
|
||||
if (eq > 0)
|
||||
{
|
||||
var key = trimmed[..eq].Trim();
|
||||
var value = trimmed[(eq + 1)..].Trim();
|
||||
Environment.SetEnvironmentVariable(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Database
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"Default": ""
|
||||
"Default": "Host=localhost;Port=5432;Database=health_manager;Username=postgres;Password=postgres123"
|
||||
},
|
||||
"Jwt": {
|
||||
"Secret": "",
|
||||
"Secret": "health-manager-jwt-secret-key-2026-super-secure-long-enough!",
|
||||
"Issuer": "HealthManager",
|
||||
"Audience": "HealthManagerApp"
|
||||
},
|
||||
"Redis": {
|
||||
"Connection": ""
|
||||
"Connection": "localhost:6379"
|
||||
},
|
||||
"MinIO": {
|
||||
"Endpoint": "",
|
||||
"AccessKey": "",
|
||||
"SecretKey": ""
|
||||
"Endpoint": "localhost:9000",
|
||||
"AccessKey": "minioadmin",
|
||||
"SecretKey": "minioadmin"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user