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

@@ -21,18 +21,13 @@ const fsSync = require('fs');
const path = require('path');
const https = require('https');
const readline = require('readline');
const { loadToolsConfig } = require('./lib/config');
const ROOT = process.cwd();
const LEGO_ROOT = path.join(ROOT, 'content', 'collections', 'lego');
const CONFIG_PATH = path.join(ROOT, 'tools', 'config.json');
const CACHE_ROOT = path.join(ROOT, 'tools', 'cache', 'rebrickable');
const ONE_WEEK_MS = 7 * 24 * 60 * 60 * 1000;
function loadConfig() {
const raw = fsSync.readFileSync(CONFIG_PATH, 'utf8');
return JSON.parse(raw);
}
function slugify(input) {
return input
.normalize('NFD')
@@ -222,7 +217,7 @@ async function main() {
process.exit(1);
}
const config = loadConfig();
const config = await loadToolsConfig();
const apiKey = config.rebrickable.apiKey;
const host = 'rebrickable.com';