diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/extra-utils/mock-servers/mock-instances-index.ts | 10 | ||||
-rw-r--r-- | shared/models/server/server-config.model.ts | 9 |
2 files changed, 17 insertions, 2 deletions
diff --git a/shared/extra-utils/mock-servers/mock-instances-index.ts b/shared/extra-utils/mock-servers/mock-instances-index.ts index 5baec00de..43c2e9f6e 100644 --- a/shared/extra-utils/mock-servers/mock-instances-index.ts +++ b/shared/extra-utils/mock-servers/mock-instances-index.ts | |||
@@ -1,7 +1,11 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { Server } from 'http' | ||
2 | import { randomInt } from '@shared/core-utils' | 3 | import { randomInt } from '@shared/core-utils' |
4 | import { terminateServer } from './utils' | ||
3 | 5 | ||
4 | export class MockInstancesIndex { | 6 | export class MockInstancesIndex { |
7 | private server: Server | ||
8 | |||
5 | private readonly indexInstances: { host: string, createdAt: string }[] = [] | 9 | private readonly indexInstances: { host: string, createdAt: string }[] = [] |
6 | 10 | ||
7 | initialize () { | 11 | initialize () { |
@@ -30,11 +34,15 @@ export class MockInstancesIndex { | |||
30 | }) | 34 | }) |
31 | 35 | ||
32 | const port = 42000 + randomInt(1, 1000) | 36 | const port = 42000 + randomInt(1, 1000) |
33 | app.listen(port, () => res(port)) | 37 | this.server = app.listen(port, () => res(port)) |
34 | }) | 38 | }) |
35 | } | 39 | } |
36 | 40 | ||
37 | addInstance (host: string) { | 41 | addInstance (host: string) { |
38 | this.indexInstances.push({ host, createdAt: new Date().toISOString() }) | 42 | this.indexInstances.push({ host, createdAt: new Date().toISOString() }) |
39 | } | 43 | } |
44 | |||
45 | terminate () { | ||
46 | return terminateServer(this.server) | ||
47 | } | ||
40 | } | 48 | } |
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index 4bd4b0cb4..5bbb61252 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts | |||
@@ -30,7 +30,6 @@ export interface RegisteredIdAndPassAuthConfig { | |||
30 | } | 30 | } |
31 | 31 | ||
32 | export interface ServerConfig { | 32 | export interface ServerConfig { |
33 | allowEdits: boolean | ||
34 | serverVersion: string | 33 | serverVersion: string |
35 | serverCommit?: string | 34 | serverCommit?: string |
36 | 35 | ||
@@ -42,6 +41,14 @@ export interface ServerConfig { | |||
42 | } | 41 | } |
43 | } | 42 | } |
44 | 43 | ||
44 | webadmin: { | ||
45 | configuration: { | ||
46 | edition: { | ||
47 | allowed: boolean | ||
48 | } | ||
49 | } | ||
50 | }, | ||
51 | |||
45 | instance: { | 52 | instance: { |
46 | name: string | 53 | name: string |
47 | shortDescription: string | 54 | shortDescription: string |