Darkwing's queue-162 packet for sage-1004/1006/1008: the two scratch --plan runs on blob4b16e848and the load checks of the usage-source file under5fa9cc8f2and8e7ea89a1(mos-0845 D3, mos-0847). Secrets scan clean. Both plans cite the files. W3 notes that the scratch store line reads the pointer, since the scratch root has no store.
23 lines
1.1 KiB
JavaScript
23 lines
1.1 KiB
JavaScript
// Scratch business file for sage-1004/1006: the committed example, made loadable, with the given plug-ins.
|
|
// Bot ids become distinct positive integers, date placeholders become 2027-01-01, every credential file
|
|
// points at a path under NOSECRET that does not exist, and both base URLs go to 127.0.0.1:9 (discard),
|
|
// so a scratch bus never reaches the live tracker or Gitea. usage: node mkbiz.mjs EXAMPLE NOSECRET PLUGINS_JSON
|
|
import { readFileSync } from 'node:fs';
|
|
import { basename } from 'node:path';
|
|
const [example, nosecret, plugins] = process.argv.slice(2);
|
|
const b = JSON.parse(readFileSync(example, 'utf8'));
|
|
let id = 0;
|
|
const walk = (o) => {
|
|
for (const [k, v] of Object.entries(o)) {
|
|
if (k === 'botId') o[k] = ++id;
|
|
else if (v === 'YYYY-MM-DD') o[k] = '2027-01-01';
|
|
else if (k === 'file' && typeof v === 'string') o[k] = `${nosecret}/${basename(v)}`;
|
|
else if (v && typeof v === 'object') walk(v);
|
|
}
|
|
};
|
|
walk(b);
|
|
b.vars['tracker.baseUrl'] = 'http://127.0.0.1:9';
|
|
b.vars['gitea.baseUrl'] = 'http://127.0.0.1:9';
|
|
b.plugins = JSON.parse(plugins);
|
|
process.stdout.write(JSON.stringify(b, null, 2) + '\n');
|