Déplacement de la configuration des outils
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user