P7 r9: probes isolated (DATA_DIR tmp), self-authenticating (git stamp + asserts), try/finally cleanup, explicit exit

This commit is contained in:
Hermes committed 2026-10-03 23:47:43 -07:00
1 parent af0d6b2fe5
commit 51ba85fc69
2 files changed
+120 -78

No files matched your search

+4 -2
View File
@@ -31,6 +31,8 @@ async function main() {
await new Promise((r) => server.on('listening', r));
const port = server.address().port;
const { execSync } = require('child_process');
console.log(`# git HEAD: ${execSync('git -C .. rev-parse HEAD', { encoding: 'utf8' }).trim()}`);
const show = (label, method, path, headers, res) => {
console.log(`### ${label}`);
console.log(`> ${method} http://127.0.0.1:${port}${path}`);
@@ -66,9 +68,9 @@ async function main() {
res = await req(port, 'GET', '/api/v1/network/wg/redeem/nonexistent-token');
show('wg redeem, bogus token (public route) → redeem outcome (route mounted)', 'GET', '/api/v1/network/wg/redeem/nonexistent-token', {}, res);
server.close();
await new Promise((r) => server.close(r));
console.log('LIVE-PROBE-DONE');
process.exit(0);
process.exit(0); // background timers would hold the loop open
}
main().catch((e) => { console.error('FATAL', e && e.message); process.exit(1); });