diff --git a/tools/add_weather.js b/tools/add_weather.js index 9a8a0372..23bf08ee 100644 --- a/tools/add_weather.js +++ b/tools/add_weather.js @@ -69,7 +69,7 @@ async function main() { const config = loadWeatherConfig(); if (!hasConfiguredProvider(config)) { - console.error("No weather provider configured. Update tools/config.json (weather.providers) before running this script."); + console.error("No weather provider configured. Update tools/config/config.json (weather.providers) before running this script."); process.exit(1); } const files = await resolveMarkdownTargets(pathArgs, { rootDir: CONTENT_ROOT }); diff --git a/tools/check_external_links.js b/tools/check_external_links.js index 3eea5116..66049655 100644 --- a/tools/check_external_links.js +++ b/tools/check_external_links.js @@ -15,7 +15,7 @@ const execFileAsync = util.promisify(execFile); const SITE_ROOT = path.resolve(__dirname, ".."); const CONTENT_DIR = path.join(SITE_ROOT, "content"); -const CONFIG_PATH = path.join(__dirname, "config.json"); +const CONFIG_PATH = path.join(__dirname, "config", "config.json"); const DAY_MS = 24 * 60 * 60 * 1000; const DEFAULT_CONFIG = { diff --git a/tools/config.json b/tools/config/config.json similarity index 100% rename from tools/config.json rename to tools/config/config.json diff --git a/tools/stats.json b/tools/config/stats.json similarity index 100% rename from tools/stats.json rename to tools/config/stats.json diff --git a/tools/generate_stats.js b/tools/generate_stats.js index d4854c69..b830b82f 100644 --- a/tools/generate_stats.js +++ b/tools/generate_stats.js @@ -6,7 +6,7 @@ const { loadEnv } = require("./lib/env"); loadEnv(); -const DEFAULT_CONFIG_PATH = "tools/stats.json"; +const DEFAULT_CONFIG_PATH = "tools/config/stats.json"; const DEFAULT_DATA_OUTPUT = "content/stats/data/stats.json"; const DEFAULT_IMAGE_DIR = "content/stats/images"; diff --git a/tools/lib/config.js b/tools/lib/config.js index c6a5e8f5..a050439e 100644 --- a/tools/lib/config.js +++ b/tools/lib/config.js @@ -49,7 +49,7 @@ function applyEnvOverrides(config = {}) { return merged; } -async function loadToolsConfig(configPath = "tools/config.json") { +async function loadToolsConfig(configPath = "tools/config/config.json") { const resolved = path.resolve(configPath); if (cached && cached.path === resolved) { return cached.data; diff --git a/tools/lib/weather/config.js b/tools/lib/weather/config.js index 0e7cc37a..3cf58441 100644 --- a/tools/lib/weather/config.js +++ b/tools/lib/weather/config.js @@ -21,7 +21,7 @@ const DEFAULT_WEATHER_CONFIG = { }, }; -function loadWeatherConfig(configPath = path.resolve(__dirname, "..", "..", "config.json")) { +function loadWeatherConfig(configPath = path.resolve(__dirname, "..", "..", "config", "config.json")) { loadEnv(); let raw = {}; diff --git a/tools/stats/goaccess_monthly.js b/tools/stats/goaccess_monthly.js index f48d954e..6e210aa7 100644 --- a/tools/stats/goaccess_monthly.js +++ b/tools/stats/goaccess_monthly.js @@ -21,7 +21,7 @@ async function run({ stat }) { const toolsConfig = await loadToolsConfig(); const url = stat.url || toolsConfig.goaccess?.url; if (!url) { - throw new Error("URL GoAccess manquante (GOACCESS_URL ou goaccess.url dans tools/config.json)"); + throw new Error("URL GoAccess manquante (GOACCESS_URL ou goaccess.url dans tools/config/config.json)"); } const metric = stat.metric || "hits"; const windowDays = Number.isFinite(stat.days) ? stat.days : 30; diff --git a/tools/stats/top_requests.py b/tools/stats/top_requests.py index eced5d04..123aaf7e 100644 --- a/tools/stats/top_requests.py +++ b/tools/stats/top_requests.py @@ -34,7 +34,7 @@ def load_env(env_path=None): def load_config(): - cfg_path = os.path.join(ROOT_DIR, "tools", "config.json") + cfg_path = os.path.join(ROOT_DIR, "tools", "config", "config.json") try: with open(cfg_path, "r", encoding="utf-8") as handle: return json.load(handle) @@ -87,7 +87,7 @@ def main(): goaccess_url = url or os.environ.get("GOACCESS_URL") or (cfg.get("goaccess") or {}).get("url") if not goaccess_url: - print("Missing GoAccess URL (set GOACCESS_URL or goaccess.url in tools/config.json)", file=sys.stderr) + print("Missing GoAccess URL (set GOACCESS_URL or goaccess.url in tools/config/config.json)", file=sys.stderr) sys.exit(1) try: