Settings: the servers settings (install defaults, port range, central IP) are saved

Found in the VM test: they were never added to the known settings, so
saving them was silently ignored and every install got the template's
defaults. A test now saves and reads them back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 15:44:27 +02:00
co-authored by Claude Opus 5.5
parent 016d1ea17e
commit 674a691d85
2 changed files with 16 additions and 0 deletions
+9
View File
@@ -285,3 +285,12 @@ describe('reusing a short name (found in the VM test)', () => {
await expect(jobs.newInstall({ customerId: 'cust-1', serverId: server.id, shortName: 'hope', domain: 'events.other.co.za' }, admin, NOW)).rejects.toMatchObject({ code: 'SHORT_NAME_TAKEN' });
});
});
describe('settings for servers (found in the VM test)', () => {
test('install defaults, the port range and the central IP are saved', async () => {
const { setSettings } = require('../src/utils/settings');
await setSettings({ install_defaults: '{"HUB_URL":"https://hub.test","SENTRY_DSN":"x"}', port_range_start: '21000', port_range_end: '21100', central_server_ip: '203.0.113.10' });
expect(await servers.installDefaults()).toEqual({ HUB_URL: 'https://hub.test', SENTRY_DSN: 'x' });
expect(await servers.portRange()).toEqual({ from: 21000, to: 21100 });
});
});