Hardened systemd deployment contract for read-only Monero observer
This commit is contained in:
@@ -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/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user