1

Extraction des secrets

This commit is contained in:
2025-11-28 13:40:20 +01:00
parent fd27dc7fb6
commit 8908c7f6cf
11 changed files with 148 additions and 26 deletions

View File

@@ -1,5 +1,7 @@
const fs = require("fs");
const path = require("path");
const { applyEnvOverrides } = require("../config");
const { loadEnv } = require("../env");
const DEFAULT_WEATHER_CONFIG = {
timezone: "Europe/Paris",
@@ -20,6 +22,8 @@ const DEFAULT_WEATHER_CONFIG = {
};
function loadWeatherConfig(configPath = path.resolve(__dirname, "..", "..", "config.json")) {
loadEnv();
let raw = {};
if (fs.existsSync(configPath)) {
@@ -30,7 +34,8 @@ function loadWeatherConfig(configPath = path.resolve(__dirname, "..", "..", "con
}
}
const weather = raw.weather || {};
const withEnv = applyEnvOverrides(raw);
const weather = withEnv.weather || {};
const providers = {
...DEFAULT_WEATHER_CONFIG.providers,