Hardened systemd deployment contract for read-only Monero observer

This commit is contained in:
2026-10-22 10:08:15 -04:00
parent 158981e965
commit e835238d05
12 changed files with 170 additions and 7 deletions
+6 -1
View File
@@ -1,6 +1,6 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { mkdtemp, writeFile, rm } from 'node:fs/promises';
import { mkdtemp, writeFile, chmod, rm } from 'node:fs/promises';
import { join } from 'node:path';
import { tmpdir } from 'node:os';
import { postgresConfig } from '../server/market/postgres-config.ts';
@@ -18,6 +18,11 @@ test('PostgreSQL verified TLS remains the default and cannot be downgraded throu
for (const mode of ['', 'off', 'disable', 'false', 'mesh', 'TLS']) {
await assert.rejects(postgresConfig({ ...env, WIKIDECK_CUSTODY_PG_TRANSPORT: mode }), /configuration/);
}
if (process.platform !== 'win32') {
await chmod(file, 0o644);
await assert.rejects(postgresConfig(env), /configuration/);
await chmod(file, 0o600);
}
await writeFile(file, 'postgresql://fixture:fixture-only@database.cluster.example/custody?sslmode=disable');
await assert.rejects(postgresConfig(env), /configuration/);
});