fix(tools): read the live secrets from the home directory
The measuring tool had /root/.filius-test.env written into it. The development environment is moving to a user of its own, so the path now comes from os.homedir() and follows whoever runs the tool. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+3
-2
@@ -1,8 +1,9 @@
|
|||||||
// Measuring on test-filius: projects through the service, people through
|
// Measuring on test-filius: projects through the service, people through
|
||||||
// tickets, the shared document through /sync, rooms through /sim. The
|
// tickets, the shared document through /sync, rooms through /sim. The
|
||||||
// secrets come from /root/.filius-test.env and are never printed.
|
// secrets come from ~/.filius-test.env and are never printed.
|
||||||
import { readFileSync } from 'node:fs';
|
import { readFileSync } from 'node:fs';
|
||||||
import { randomUUID } from 'node:crypto';
|
import { randomUUID } from 'node:crypto';
|
||||||
|
import { homedir } from 'node:os';
|
||||||
import * as Y from 'yjs';
|
import * as Y from 'yjs';
|
||||||
import { openProjectArchive } from '@mdg-filius/fls';
|
import { openProjectArchive } from '@mdg-filius/fls';
|
||||||
import { writeProject } from '@mdg-filius/doc';
|
import { writeProject } from '@mdg-filius/doc';
|
||||||
@@ -11,7 +12,7 @@ import { HocuspocusProvider, HocuspocusProviderWebsocket } from '@hocuspocus/pro
|
|||||||
import WebSocket from 'ws';
|
import WebSocket from 'ws';
|
||||||
|
|
||||||
const env = Object.fromEntries(
|
const env = Object.fromEntries(
|
||||||
readFileSync('/root/.filius-test.env', 'utf8')
|
readFileSync(`${homedir()}/.filius-test.env`, 'utf8')
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.filter((l) => l.includes('='))
|
.filter((l) => l.includes('='))
|
||||||
.map((l) => [l.slice(0, l.indexOf('=')).trim(), l.slice(l.indexOf('=') + 1).trim()]),
|
.map((l) => [l.slice(0, l.indexOf('=')).trim(), l.slice(l.indexOf('=') + 1).trim()]),
|
||||||
|
|||||||
Reference in New Issue
Block a user