Hub 2.3.3: refuse server settings the apps can't start with

TRUST_PROXY=TRUE made an Events install build for minutes, then crash at
startup. Saving a server's configuration now refuses it, and installs and
updates are refused (CONFIG_INVALID) while an older saved configuration has
one. Contracts 1.6.0 vendored (agent.checkEnvValue / invalidValues).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 10:25:57 +02:00
co-authored by Claude Opus 5.5
parent 166ea451f4
commit 94230d0ba9
13 changed files with 55 additions and 15 deletions
+10
View File
@@ -118,6 +118,16 @@ describe('jobs', () => {
expect((await jobs.poll(server, { agentApiVersion: 1, agentVersion: '1.0.0', mode: 'church', runningJobId: null }, NOW)).jobs).toEqual([]);
});
test('a new install is refused while a server setting is one the apps can\'t start with (TRUST_PROXY=TRUE)', async () => {
const { server } = await joinServer();
// Saved before Hub 2.3.3, which refuses it on save.
await servers.setServerConfig(server.id, { TRUST_PROXY: 'TRUE' });
await expect(jobs.newInstall({ customerId: 'cust-1', serverId: server.id, shortName: 'hope', domain: 'events.hope.co.za' }, admin, NOW))
.rejects.toMatchObject({ code: 'CONFIG_INVALID', message: expect.stringContaining('loopback') });
await servers.setServerConfig(server.id, { TRUST_PROXY: 'loopback' });
await expect(jobs.newInstall({ customerId: 'cust-1', serverId: server.id, shortName: 'hope', domain: 'events.hope.co.za' }, admin, NOW)).resolves.toBeTruthy();
});
test('a new install is refused while required server settings are missing, or the agent is offline', async () => {
const { server } = await joinServer();
await expect(jobs.newInstall({ customerId: 'cust-1', serverId: server.id, shortName: 'hope', domain: 'events.hope.co.za' }, admin, NOW)).rejects.toMatchObject({ code: 'CONFIG_MISSING', message: expect.stringContaining('TRUST_PROXY') });