@milaboratories/pl-deployments 2.3.3 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +34 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +683 -585
- package/dist/index.mjs.map +1 -1
- package/dist/ssh/connection_info.d.ts +52 -1
- package/dist/ssh/connection_info.d.ts.map +1 -1
- package/dist/ssh/pl.d.ts +22 -7
- package/dist/ssh/pl.d.ts.map +1 -1
- package/dist/ssh/supervisord.d.ts +4 -2
- package/dist/ssh/supervisord.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/ssh/__tests__/pl-docker.test.ts +13 -10
- package/src/ssh/connection_info.ts +8 -0
- package/src/ssh/pl.ts +268 -138
- package/src/ssh/supervisord.ts +47 -8
|
@@ -22,6 +22,16 @@ export declare const SshPlPorts: z.ZodObject<{
|
|
|
22
22
|
local: number;
|
|
23
23
|
remote: number;
|
|
24
24
|
}>;
|
|
25
|
+
http: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
local: z.ZodNumber;
|
|
27
|
+
remote: z.ZodNumber;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
local: number;
|
|
30
|
+
remote: number;
|
|
31
|
+
}, {
|
|
32
|
+
local: number;
|
|
33
|
+
remote: number;
|
|
34
|
+
}>>;
|
|
25
35
|
monitoring: z.ZodObject<{
|
|
26
36
|
local: z.ZodNumber;
|
|
27
37
|
remote: z.ZodNumber;
|
|
@@ -42,6 +52,7 @@ export declare const SshPlPorts: z.ZodObject<{
|
|
|
42
52
|
local: number;
|
|
43
53
|
remote: number;
|
|
44
54
|
}>;
|
|
55
|
+
/** @deprecated */
|
|
45
56
|
minioPort: z.ZodObject<{
|
|
46
57
|
local: z.ZodNumber;
|
|
47
58
|
remote: z.ZodNumber;
|
|
@@ -52,6 +63,7 @@ export declare const SshPlPorts: z.ZodObject<{
|
|
|
52
63
|
local: number;
|
|
53
64
|
remote: number;
|
|
54
65
|
}>;
|
|
66
|
+
/** @deprecated */
|
|
55
67
|
minioConsolePort: z.ZodObject<{
|
|
56
68
|
local: z.ZodNumber;
|
|
57
69
|
remote: z.ZodNumber;
|
|
@@ -83,6 +95,10 @@ export declare const SshPlPorts: z.ZodObject<{
|
|
|
83
95
|
local: number;
|
|
84
96
|
remote: number;
|
|
85
97
|
};
|
|
98
|
+
http?: {
|
|
99
|
+
local: number;
|
|
100
|
+
remote: number;
|
|
101
|
+
} | undefined;
|
|
86
102
|
}, {
|
|
87
103
|
grpc: {
|
|
88
104
|
local: number;
|
|
@@ -104,6 +120,10 @@ export declare const SshPlPorts: z.ZodObject<{
|
|
|
104
120
|
local: number;
|
|
105
121
|
remote: number;
|
|
106
122
|
};
|
|
123
|
+
http?: {
|
|
124
|
+
local: number;
|
|
125
|
+
remote: number;
|
|
126
|
+
} | undefined;
|
|
107
127
|
}>;
|
|
108
128
|
/** All info about ports that are forwarded. */
|
|
109
129
|
export type SshPlPorts = z.infer<typeof SshPlPorts>;
|
|
@@ -121,6 +141,16 @@ export declare const ConnectionInfo: z.ZodObject<{
|
|
|
121
141
|
local: number;
|
|
122
142
|
remote: number;
|
|
123
143
|
}>;
|
|
144
|
+
http: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
local: z.ZodNumber;
|
|
146
|
+
remote: z.ZodNumber;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
local: number;
|
|
149
|
+
remote: number;
|
|
150
|
+
}, {
|
|
151
|
+
local: number;
|
|
152
|
+
remote: number;
|
|
153
|
+
}>>;
|
|
124
154
|
monitoring: z.ZodObject<{
|
|
125
155
|
local: z.ZodNumber;
|
|
126
156
|
remote: z.ZodNumber;
|
|
@@ -141,6 +171,7 @@ export declare const ConnectionInfo: z.ZodObject<{
|
|
|
141
171
|
local: number;
|
|
142
172
|
remote: number;
|
|
143
173
|
}>;
|
|
174
|
+
/** @deprecated */
|
|
144
175
|
minioPort: z.ZodObject<{
|
|
145
176
|
local: z.ZodNumber;
|
|
146
177
|
remote: z.ZodNumber;
|
|
@@ -151,6 +182,7 @@ export declare const ConnectionInfo: z.ZodObject<{
|
|
|
151
182
|
local: number;
|
|
152
183
|
remote: number;
|
|
153
184
|
}>;
|
|
185
|
+
/** @deprecated */
|
|
154
186
|
minioConsolePort: z.ZodObject<{
|
|
155
187
|
local: z.ZodNumber;
|
|
156
188
|
remote: z.ZodNumber;
|
|
@@ -182,6 +214,10 @@ export declare const ConnectionInfo: z.ZodObject<{
|
|
|
182
214
|
local: number;
|
|
183
215
|
remote: number;
|
|
184
216
|
};
|
|
217
|
+
http?: {
|
|
218
|
+
local: number;
|
|
219
|
+
remote: number;
|
|
220
|
+
} | undefined;
|
|
185
221
|
}, {
|
|
186
222
|
grpc: {
|
|
187
223
|
local: number;
|
|
@@ -203,9 +239,14 @@ export declare const ConnectionInfo: z.ZodObject<{
|
|
|
203
239
|
local: number;
|
|
204
240
|
remote: number;
|
|
205
241
|
};
|
|
242
|
+
http?: {
|
|
243
|
+
local: number;
|
|
244
|
+
remote: number;
|
|
245
|
+
} | undefined;
|
|
206
246
|
}>;
|
|
207
247
|
useGlobalAccess: z.ZodDefault<z.ZodBoolean>;
|
|
208
248
|
plVersion: z.ZodDefault<z.ZodString>;
|
|
249
|
+
minioIsUsed: z.ZodDefault<z.ZodBoolean>;
|
|
209
250
|
}, "strip", z.ZodTypeAny, {
|
|
210
251
|
plUser: string;
|
|
211
252
|
plPassword: string;
|
|
@@ -230,9 +271,14 @@ export declare const ConnectionInfo: z.ZodObject<{
|
|
|
230
271
|
local: number;
|
|
231
272
|
remote: number;
|
|
232
273
|
};
|
|
274
|
+
http?: {
|
|
275
|
+
local: number;
|
|
276
|
+
remote: number;
|
|
277
|
+
} | undefined;
|
|
233
278
|
};
|
|
234
279
|
useGlobalAccess: boolean;
|
|
235
280
|
plVersion: string;
|
|
281
|
+
minioIsUsed: boolean;
|
|
236
282
|
}, {
|
|
237
283
|
plUser: string;
|
|
238
284
|
plPassword: string;
|
|
@@ -257,13 +303,18 @@ export declare const ConnectionInfo: z.ZodObject<{
|
|
|
257
303
|
local: number;
|
|
258
304
|
remote: number;
|
|
259
305
|
};
|
|
306
|
+
http?: {
|
|
307
|
+
local: number;
|
|
308
|
+
remote: number;
|
|
309
|
+
} | undefined;
|
|
260
310
|
};
|
|
261
311
|
useGlobalAccess?: boolean | undefined;
|
|
262
312
|
plVersion?: string | undefined;
|
|
313
|
+
minioIsUsed?: boolean | undefined;
|
|
263
314
|
}>;
|
|
264
315
|
/** The content of the file that holds all the info about the connection on the remote server. */
|
|
265
316
|
export type ConnectionInfo = z.infer<typeof ConnectionInfo>;
|
|
266
|
-
export declare function newConnectionInfo(plUser: string, plPassword: string, ports: SshPlPorts, useGlobalAccess: boolean, plVersion: string): ConnectionInfo;
|
|
317
|
+
export declare function newConnectionInfo(plUser: string, plPassword: string, ports: SshPlPorts, useGlobalAccess: boolean, plVersion: string, minioIsUsed: boolean): ConnectionInfo;
|
|
267
318
|
export declare function parseConnectionInfo(content: string): ConnectionInfo;
|
|
268
319
|
export declare function stringifyConnectionInfo(conn: ConnectionInfo): string;
|
|
269
320
|
//# sourceMappingURL=connection_info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection_info.d.ts","sourceRoot":"","sources":["../../src/ssh/connection_info.ts"],"names":[],"mappings":"AAAA;kFACkF;AAClF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,QAAQ;;;;;;;;;EAGnB,CAAC;AACH,wCAAwC;AACxC,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"connection_info.d.ts","sourceRoot":"","sources":["../../src/ssh/connection_info.ts"],"names":[],"mappings":"AAAA;kFACkF;AAClF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,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isorStatus>;
|
|
23
23
|
/** Starts all the services on the server.
|
|
24
24
|
* Idempotent semantic: we could call it several times. */
|
|
25
|
-
start(): Promise<void>;
|
|
25
|
+
start(shouldUseMinio: boolean): Promise<void>;
|
|
26
26
|
/** Stops all the services on the server.
|
|
27
27
|
* Idempotent semantic: we could call it several times. */
|
|
28
28
|
stop(): Promise<void>;
|
|
@@ -34,9 +34,21 @@ export declare class SshPl {
|
|
|
34
34
|
* generates all the configs, creates necessary dirs,
|
|
35
35
|
* and finally starts all the services. */
|
|
36
36
|
platformaInit(options: SshPlConfig): Promise<ConnectionInfo>;
|
|
37
|
-
|
|
37
|
+
private doStepStopExistedPlatforma;
|
|
38
|
+
private removeSensitiveData;
|
|
39
|
+
private doStepStartPlatforma;
|
|
40
|
+
private doStepSaveNewConnectionInfo;
|
|
41
|
+
private doStepConfigureSupervisord;
|
|
42
|
+
private doStepCreateFoldersAndSaveFiles;
|
|
43
|
+
private doStepGenerateNewConfig;
|
|
44
|
+
private doStepFetchPorts;
|
|
45
|
+
private doStepDownloadBinaries;
|
|
46
|
+
private doStepDetectArch;
|
|
47
|
+
private doStepDetectHome;
|
|
48
|
+
private doStepReadExistedConfig;
|
|
49
|
+
downloadBinariesAndUploadToTheServer(localWorkdir: string, plBinary: PlBinarySourceDownload, remoteHome: string, arch: Arch, shouldUseMinio: boolean): Promise<{
|
|
38
50
|
history: DownloadAndUntarState[];
|
|
39
|
-
minioRelPath: string;
|
|
51
|
+
minioRelPath: string | undefined;
|
|
40
52
|
downloadedPl: string;
|
|
41
53
|
}>;
|
|
42
54
|
/** We have to extract pl in the remote server,
|
|
@@ -47,8 +59,8 @@ export declare class SshPl {
|
|
|
47
59
|
* (it's not installed for Rocky Linux for example). */
|
|
48
60
|
downloadAndUntar(localWorkdir: string, remoteHome: string, arch: Arch, softwareName: string, tgzName: string): Promise<DownloadAndUntarState>;
|
|
49
61
|
needDownload(remoteHome: string, arch: Arch): Promise<boolean>;
|
|
50
|
-
checkIsAliveWithInterval(interval?: number, count?: number, shouldStart?: boolean): Promise<void>;
|
|
51
|
-
|
|
62
|
+
checkIsAliveWithInterval(shouldUseMinio: boolean, interval?: number, count?: number, shouldStart?: boolean): Promise<void>;
|
|
63
|
+
readExistedConfig(remoteHome: string): Promise<ConnectionInfo>;
|
|
52
64
|
fetchPorts(remoteHome: string, arch: Arch): Promise<SshPlPorts>;
|
|
53
65
|
getLocalFreePort(): Promise<number>;
|
|
54
66
|
getFreePortForPlatformaOnServer(remoteHome: string, arch: Arch): Promise<number>;
|
|
@@ -69,7 +81,7 @@ export type SshPlConfig = {
|
|
|
69
81
|
};
|
|
70
82
|
type BinPaths = {
|
|
71
83
|
history?: DownloadAndUntarState[];
|
|
72
|
-
minioRelPath
|
|
84
|
+
minioRelPath?: string;
|
|
73
85
|
downloadedPl: string;
|
|
74
86
|
};
|
|
75
87
|
type DownloadAndUntarState = {
|
|
@@ -83,14 +95,17 @@ type DownloadAndUntarState = {
|
|
|
83
95
|
uploadDone?: boolean;
|
|
84
96
|
untarDone?: boolean;
|
|
85
97
|
};
|
|
98
|
+
type PlatformaInitStep = 'init' | 'detectArch' | 'detectHome' | 'checkAlive' | 'stopExistedPlatforma' | 'downloadBinaries' | 'fetchPorts' | 'generateNewConfig' | 'createFoldersAndSaveFiles' | 'configureSupervisord' | 'saveNewConnectionInfo' | 'startPlatforma';
|
|
86
99
|
type PlatformaInitState = {
|
|
100
|
+
step: PlatformaInitStep;
|
|
87
101
|
localWorkdir?: string;
|
|
88
102
|
plBinaryOps?: PlBinarySourceDownload;
|
|
89
103
|
arch?: Arch;
|
|
90
104
|
remoteHome?: string;
|
|
91
105
|
alive?: SupervisorStatus;
|
|
92
|
-
|
|
106
|
+
existedSettings?: ConnectionInfo;
|
|
93
107
|
needRestart?: boolean;
|
|
108
|
+
shouldUseMinio?: boolean;
|
|
94
109
|
downloadedBinaries?: DownloadAndUntarState[];
|
|
95
110
|
binPaths?: BinPaths;
|
|
96
111
|
ports?: SshPlPorts;
|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M,CAOxD"}
|
|
@@ -7,11 +7,13 @@ export declare function supervisorStop(sshClient: SshClient, remoteHome: string,
|
|
|
7
7
|
export type SupervisorStatus = {
|
|
8
8
|
platforma?: boolean;
|
|
9
9
|
minio?: boolean;
|
|
10
|
-
allAlive: boolean;
|
|
11
10
|
rawResult?: SshExecResult;
|
|
12
11
|
execError?: string;
|
|
13
12
|
};
|
|
13
|
+
export declare function isAllAlive(status: SupervisorStatus, shouldUseMinio: boolean): boolean | undefined;
|
|
14
|
+
export declare function isSupervisordRunning(status: SupervisorStatus): boolean;
|
|
14
15
|
export declare function supervisorStatus(logger: MiLogger, sshClient: SshClient, remoteHome: string, arch: string): Promise<SupervisorStatus>;
|
|
15
|
-
export declare function generateSupervisordConfig(
|
|
16
|
+
export declare function generateSupervisordConfig(supervisorRemotePort: number, remoteWorkDir: string, platformaConfigPath: string, plPath: string): string;
|
|
17
|
+
export declare function generateSupervisordConfigWithMinio(minioStorageDir: string, minioEnvs: Record<string, string>, supervisorRemotePort: number, remoteWorkDir: string, platformaConfigPath: string, minioPath: string, plPath: string): string;
|
|
16
18
|
export declare function supervisorExec(sshClient: SshClient, remoteHome: string, arch: string, command: string): Promise<SshExecResult>;
|
|
17
19
|
//# sourceMappingURL=supervisord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisord.d.ts","sourceRoot":"","sources":["../../src/ssh/supervisord.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtD,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAOjC;AAED,wBAAsB,cAAc,CAClC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iB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E,MAAM,EACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,oBAAoB,EAAE,MAAM,EAC5B,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,MAAM,EAE3B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,UAoCf;AAED,wBAAsB,cAAc,CAClC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAChC,OAAO,EAAE,MAAM,0BAOhB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-deployments",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"pl-version": "1.
|
|
3
|
+
"version": "2.4.1",
|
|
4
|
+
"pl-version": "1.34.2",
|
|
5
5
|
"description": "MiLaboratories Platforma Backend code service run wrapper",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.16.0"
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"undici": "~7.10.0",
|
|
54
54
|
"yaml": "^2.7.0",
|
|
55
55
|
"zod": "~3.23.8",
|
|
56
|
-
"@milaboratories/
|
|
57
|
-
"@milaboratories/
|
|
56
|
+
"@milaboratories/ts-helpers": "^1.4.1",
|
|
57
|
+
"@milaboratories/pl-config": "^1.6.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"type-check": "tsc --noEmit --composite false",
|
|
@@ -48,17 +48,17 @@ describe('SshPl', async () => {
|
|
|
48
48
|
localWorkdir: downloadDestination,
|
|
49
49
|
license: { type: 'env' },
|
|
50
50
|
});
|
|
51
|
-
expect((await sshPl.isAlive()).
|
|
51
|
+
expect((await sshPl.isAlive()).platforma).toBe(true);
|
|
52
52
|
|
|
53
53
|
await sshPl.stop();
|
|
54
|
-
expect((await sshPl.isAlive()).
|
|
54
|
+
expect((await sshPl.isAlive()).platforma).toBe(false);
|
|
55
55
|
|
|
56
56
|
// FIXME: it's not working in CI
|
|
57
57
|
// await sshPl.start();
|
|
58
58
|
// expect((await sshPl.isAlive()).allAlive).toBe(true);
|
|
59
59
|
|
|
60
60
|
await sshPl.stopAndClean();
|
|
61
|
-
expect((await sshPl.isAlive()).
|
|
61
|
+
expect((await sshPl.isAlive()).platforma).toBe(undefined);
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
it('downloadBinariesAndUploadToServer', async () => {
|
|
@@ -70,13 +70,16 @@ describe('SshPl', async () => {
|
|
|
70
70
|
{ type: 'Download', version: getDefaultPlVersion() },
|
|
71
71
|
remoteHome,
|
|
72
72
|
arch,
|
|
73
|
+
false,
|
|
73
74
|
);
|
|
74
75
|
|
|
75
76
|
const pathSupervisor = `${plpath.supervisorBinDir(remoteHome, arch.arch)}/supervisord`;
|
|
76
|
-
|
|
77
|
+
// NOTE: minio was removed from the test container
|
|
78
|
+
// const pathMinio = `${plpath.minioDir(remoteHome, arch.arch)}/minio`;
|
|
77
79
|
|
|
78
80
|
expect((await sshPl?.sshClient.checkPathExists(pathSupervisor))?.exists).toBe(true);
|
|
79
|
-
|
|
81
|
+
// NOTE: minio was removed from the test container
|
|
82
|
+
// expect((await sshPl?.sshClient.checkPathExists(pathMinio))?.exists).toBe(true);
|
|
80
83
|
});
|
|
81
84
|
|
|
82
85
|
it('platformaInit', async () => {
|
|
@@ -122,7 +125,7 @@ describe('SshPl', async () => {
|
|
|
122
125
|
license: { type: 'env' },
|
|
123
126
|
});
|
|
124
127
|
const isAlive = await sshPl?.isAlive();
|
|
125
|
-
expect(isAlive.
|
|
128
|
+
expect(isAlive.platforma).toBe(true);
|
|
126
129
|
|
|
127
130
|
const arch = await sshPl.getArch();
|
|
128
131
|
const remoteHome = await sshPl.getUserHomeDirectory();
|
|
@@ -170,7 +173,7 @@ describe('SshPl', async () => {
|
|
|
170
173
|
|
|
171
174
|
await sshPl.platformaInit({ localWorkdir: downloadDestination, license: { type: 'env' } });
|
|
172
175
|
let isAlive = await sshPl?.isAlive();
|
|
173
|
-
expect(isAlive.
|
|
176
|
+
expect(isAlive.platforma).toBe(true);
|
|
174
177
|
|
|
175
178
|
await sshPl.platformaInit({
|
|
176
179
|
localWorkdir: downloadDestination,
|
|
@@ -178,7 +181,7 @@ describe('SshPl', async () => {
|
|
|
178
181
|
useGlobalAccess: true,
|
|
179
182
|
});
|
|
180
183
|
isAlive = await sshPl?.isAlive();
|
|
181
|
-
expect(isAlive.
|
|
184
|
+
expect(isAlive.platforma).toBe(true);
|
|
182
185
|
|
|
183
186
|
const config = await sshPl.sshClient.readFile(plpath.platformaConf(remoteHome));
|
|
184
187
|
expect(config).contain('bin-ga');
|
|
@@ -191,7 +194,7 @@ describe('SshPl', async () => {
|
|
|
191
194
|
plBinary: { type: 'Download', version: '1.18.3' },
|
|
192
195
|
});
|
|
193
196
|
let isAlive = await sshPl?.isAlive();
|
|
194
|
-
expect(isAlive.
|
|
197
|
+
expect(isAlive.platforma).toBe(true);
|
|
195
198
|
|
|
196
199
|
await sshPl.platformaInit({
|
|
197
200
|
localWorkdir: downloadDestination,
|
|
@@ -199,7 +202,7 @@ describe('SshPl', async () => {
|
|
|
199
202
|
// latest version of pl binary will be get by default
|
|
200
203
|
});
|
|
201
204
|
isAlive = await sshPl?.isAlive();
|
|
202
|
-
expect(isAlive.
|
|
205
|
+
expect(isAlive.platforma).toBe(true);
|
|
203
206
|
});
|
|
204
207
|
|
|
205
208
|
it('Download pl. We have archive and extracted data', async () => {
|
|
@@ -15,9 +15,12 @@ export type PortPair = z.infer<typeof PortPair>;
|
|
|
15
15
|
|
|
16
16
|
export const SshPlPorts = z.object({
|
|
17
17
|
grpc: PortPair,
|
|
18
|
+
http: PortPair.optional(),
|
|
18
19
|
monitoring: PortPair,
|
|
19
20
|
debug: PortPair,
|
|
21
|
+
/** @deprecated */
|
|
20
22
|
minioPort: PortPair,
|
|
23
|
+
/** @deprecated */
|
|
21
24
|
minioConsolePort: PortPair,
|
|
22
25
|
});
|
|
23
26
|
/** All info about ports that are forwarded. */
|
|
@@ -34,6 +37,9 @@ export const ConnectionInfo = z.object({
|
|
|
34
37
|
|
|
35
38
|
// We added the field afterwards, the pl backend was this version.
|
|
36
39
|
plVersion: z.string().default('1.18.3'),
|
|
40
|
+
|
|
41
|
+
// It's true by default because it was added later and previous installation use minio.
|
|
42
|
+
minioIsUsed: z.boolean().default(true),
|
|
37
43
|
});
|
|
38
44
|
/** The content of the file that holds all the info about the connection on the remote server. */
|
|
39
45
|
export type ConnectionInfo = z.infer<typeof ConnectionInfo>;
|
|
@@ -48,6 +54,7 @@ export function newConnectionInfo(
|
|
|
48
54
|
ports: SshPlPorts,
|
|
49
55
|
useGlobalAccess: boolean,
|
|
50
56
|
plVersion: string,
|
|
57
|
+
minioIsUsed: boolean,
|
|
51
58
|
): ConnectionInfo {
|
|
52
59
|
return {
|
|
53
60
|
plUser,
|
|
@@ -55,6 +62,7 @@ export function newConnectionInfo(
|
|
|
55
62
|
ports,
|
|
56
63
|
useGlobalAccess,
|
|
57
64
|
plVersion,
|
|
65
|
+
minioIsUsed: minioIsUsed,
|
|
58
66
|
};
|
|
59
67
|
}
|
|
60
68
|
|