@marinoscar/platform-cli 0.1.0-next.14 → 0.1.0-next.16
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/CHANGELOG.md +28 -0
- package/README.md +3 -1
- package/dist/engine/commands/deploy.d.ts +7 -0
- package/dist/engine/commands/deploy.d.ts.map +1 -1
- package/dist/engine/commands/deploy.js +5 -2
- package/dist/engine/commands/deploy.js.map +1 -1
- package/dist/engine/create-cli.d.ts +41 -1
- package/dist/engine/create-cli.d.ts.map +1 -1
- package/dist/engine/create-cli.js +6 -1
- package/dist/engine/create-cli.js.map +1 -1
- package/dist/engine/deploy/app-version.d.ts +62 -6
- package/dist/engine/deploy/app-version.d.ts.map +1 -1
- package/dist/engine/deploy/app-version.js +123 -11
- package/dist/engine/deploy/app-version.js.map +1 -1
- package/dist/engine/deploy/checks/stack-ports.d.ts.map +1 -1
- package/dist/engine/deploy/checks/stack-ports.js +38 -11
- package/dist/engine/deploy/checks/stack-ports.js.map +1 -1
- package/dist/engine/deploy/compose-port-variables.d.ts +40 -0
- package/dist/engine/deploy/compose-port-variables.d.ts.map +1 -1
- package/dist/engine/deploy/compose-port-variables.js +62 -14
- package/dist/engine/deploy/compose-port-variables.js.map +1 -1
- package/dist/engine/deploy/free-ports.d.ts +145 -0
- package/dist/engine/deploy/free-ports.d.ts.map +1 -0
- package/dist/engine/deploy/free-ports.js +235 -0
- package/dist/engine/deploy/free-ports.js.map +1 -0
- package/dist/engine/deploy/install.d.ts +14 -0
- package/dist/engine/deploy/install.d.ts.map +1 -1
- package/dist/engine/deploy/install.js +100 -2
- package/dist/engine/deploy/install.js.map +1 -1
- package/dist/engine/deploy/update.d.ts +2 -0
- package/dist/engine/deploy/update.d.ts.map +1 -1
- package/dist/engine/deploy/update.js +45 -1
- package/dist/engine/deploy/update.js.map +1 -1
- package/dist/engine/deploy/version-step.d.ts +9 -0
- package/dist/engine/deploy/version-step.d.ts.map +1 -1
- package/dist/engine/deploy/version-step.js +4 -3
- package/dist/engine/deploy/version-step.js.map +1 -1
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/registries.d.ts.map +1 -1
- package/dist/engine/registries.js +2 -0
- package/dist/engine/registries.js.map +1 -1
- package/dist/engine/tui/screens/deploy/install.d.ts.map +1 -1
- package/dist/engine/tui/screens/deploy/install.js +4 -0
- package/dist/engine/tui/screens/deploy/install.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { type ComposeContainer } from './compose-containers.js';
|
|
2
|
+
/** How far above the default a search walks before giving up. */
|
|
3
|
+
export declare const DEFAULT_PORT_SEARCH_LIMIT = 200;
|
|
4
|
+
/** Where a port is published: the address and protocol a clash is judged on. */
|
|
5
|
+
export interface PortClaim {
|
|
6
|
+
/** The host address; `''` (and `0.0.0.0`, `::`) is every interface. */
|
|
7
|
+
hostIp: string;
|
|
8
|
+
/** `tcp`, `udp` or `sctp`. */
|
|
9
|
+
protocol: string;
|
|
10
|
+
}
|
|
11
|
+
/** Why a candidate port was passed over. */
|
|
12
|
+
export interface SkippedPort {
|
|
13
|
+
port: number;
|
|
14
|
+
/** `listener`: a process listens on it; `container`: a container is configured to publish it; `taken`: another variable of this run has it. */
|
|
15
|
+
reason: 'listener' | 'container' | 'taken';
|
|
16
|
+
/** The container that holds it, for `container`. A running one is preferred over a stopped one. */
|
|
17
|
+
holder?: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
/** The port found, and the ones passed over on the way. */
|
|
20
|
+
export interface PortPick {
|
|
21
|
+
port: number;
|
|
22
|
+
skipped: SkippedPort[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Whether `value` is an integer port number (1 to 65535).
|
|
26
|
+
*
|
|
27
|
+
* @param value - Any number.
|
|
28
|
+
* @returns true for a usable port.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isPort(value: number): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The first free host port at or above `preferred`.
|
|
33
|
+
*
|
|
34
|
+
* `options` carries:
|
|
35
|
+
*
|
|
36
|
+
* - `preferred`: where the search starts (the template default).
|
|
37
|
+
* - `hostIp` and `protocol`: where the port will be published.
|
|
38
|
+
* - `also`: more places the SAME port number is published (a variable that
|
|
39
|
+
* feeds a TCP and a UDP mapping); all of them must be free.
|
|
40
|
+
* - `taken`: ports already chosen for other variables of this run. Not
|
|
41
|
+
* changed; the caller adds the result.
|
|
42
|
+
* - `containers`: every container Docker knows, in any state. A container claims
|
|
43
|
+
* a port when it is configured to publish it on an address that overlaps (a
|
|
44
|
+
* wildcard clashes with every address) and the same protocol.
|
|
45
|
+
* - `probe`: says whether nothing listens on the port (true = free).
|
|
46
|
+
* - `limit`: how many ports to try (default 200); the search never goes above
|
|
47
|
+
* 65535.
|
|
48
|
+
* - `label`: names the variable in the error.
|
|
49
|
+
*
|
|
50
|
+
* @param options - The search, as above.
|
|
51
|
+
* @returns the port and the candidates passed over.
|
|
52
|
+
* @throws PreconditionError when `preferred` is not a port, or none is free.
|
|
53
|
+
*/
|
|
54
|
+
export declare function pickFreePort(options: {
|
|
55
|
+
preferred: number;
|
|
56
|
+
hostIp: string;
|
|
57
|
+
protocol: string;
|
|
58
|
+
also?: readonly PortClaim[] | undefined;
|
|
59
|
+
taken?: ReadonlySet<number> | undefined;
|
|
60
|
+
containers: readonly ComposeContainer[];
|
|
61
|
+
probe: (port: number) => Promise<boolean>;
|
|
62
|
+
limit?: number | undefined;
|
|
63
|
+
label?: string | undefined;
|
|
64
|
+
}): Promise<PortPick>;
|
|
65
|
+
/**
|
|
66
|
+
* The sentence for a pick that did not land on the default:
|
|
67
|
+
* `GREPTIME_BIND_PG_PORT=14013 (14003 is held by evopath-greptimedb-1)`.
|
|
68
|
+
*
|
|
69
|
+
* @param variable - The variable the port is for.
|
|
70
|
+
* @param pick - What `pickFreePort` returned.
|
|
71
|
+
* @param preferred - The default the search started from.
|
|
72
|
+
* @returns the text, or `undefined` when the default was free (nothing to say).
|
|
73
|
+
*/
|
|
74
|
+
export declare function describePick(variable: string, pick: PortPick, preferred: number): string | undefined;
|
|
75
|
+
/** A port variable decided by `planPortValues`. */
|
|
76
|
+
export interface PortDecision {
|
|
77
|
+
variable: string;
|
|
78
|
+
port: number;
|
|
79
|
+
/** The default the search started from. */
|
|
80
|
+
preferred: number;
|
|
81
|
+
/** What `describePick` says, or `undefined` when the default was free. */
|
|
82
|
+
message: string | undefined;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Decides a value for every published-port variable that needs one.
|
|
86
|
+
*
|
|
87
|
+
* The variables come from the compose files (`publishedPortVariables`), so an
|
|
88
|
+
* app overlay that publishes a new port is covered without a list to keep. A
|
|
89
|
+
* variable is decided only when it is in `eligible`, has no non-blank value in
|
|
90
|
+
* `given`, is not in `exclude`, and a starting point is known (the template
|
|
91
|
+
* default, else the compose file's). Everything else is left exactly as it is.
|
|
92
|
+
* Variables are decided in the order the files publish them; each choice is
|
|
93
|
+
* `taken` for the next, and so are the ports the `given` values already use.
|
|
94
|
+
*
|
|
95
|
+
* `options` carries:
|
|
96
|
+
*
|
|
97
|
+
* - `files`: the compose files' text, in merge order.
|
|
98
|
+
* - `eligible`: the keys this run may decide (the template's, or for an update
|
|
99
|
+
* the keys it is adding).
|
|
100
|
+
* - `given`: values that stay as they are, the `.env` on disk and the
|
|
101
|
+
* operator's answers. A key with a value here is never moved.
|
|
102
|
+
* - `defaults`: the template default of each key, where the search starts.
|
|
103
|
+
* - `exclude`: keys decided elsewhere (`APP_BIND_PORT`).
|
|
104
|
+
* - `taken`: ports already in use by this run.
|
|
105
|
+
* - `containers`: every container Docker knows, or `undefined` when Docker
|
|
106
|
+
* cannot be asked (probe-only).
|
|
107
|
+
* - `probe`: says whether nothing listens on a port (default: the loopback bind
|
|
108
|
+
* probe).
|
|
109
|
+
* - `limit`: the search bound per variable.
|
|
110
|
+
*
|
|
111
|
+
* @param options - The decision inputs, as above.
|
|
112
|
+
* @returns one decision per variable decided, in file order.
|
|
113
|
+
* @throws PreconditionError when a variable has no free port within the bound.
|
|
114
|
+
*/
|
|
115
|
+
export declare function planPortValues(options: {
|
|
116
|
+
files: readonly string[];
|
|
117
|
+
eligible: ReadonlySet<string>;
|
|
118
|
+
given: ReadonlyMap<string, string>;
|
|
119
|
+
defaults: ReadonlyMap<string, string>;
|
|
120
|
+
exclude?: ReadonlySet<string> | undefined;
|
|
121
|
+
taken?: Iterable<number> | undefined;
|
|
122
|
+
containers: readonly ComposeContainer[] | undefined;
|
|
123
|
+
probe?: ((port: number) => Promise<boolean>) | undefined;
|
|
124
|
+
limit?: number | undefined;
|
|
125
|
+
}): Promise<PortDecision[]>;
|
|
126
|
+
/**
|
|
127
|
+
* The containers a pick must avoid: every one except those of the run's own
|
|
128
|
+
* compose project, which `up -d` recreates (the rule `stack-ports-free` applies).
|
|
129
|
+
*
|
|
130
|
+
* @param containers - What `listComposeContainers` returned, or `undefined`.
|
|
131
|
+
* @param project - The deployment's compose project.
|
|
132
|
+
* @returns the other projects' containers, or `undefined` when Docker could not be asked.
|
|
133
|
+
*/
|
|
134
|
+
export declare function foreignContainers(containers: readonly ComposeContainer[] | undefined, project: string): ComposeContainer[] | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* The text of the deployment's compose files, in the order compose merges them
|
|
137
|
+
* (the same list `up -d` uses, app overlays last). A file that cannot be read
|
|
138
|
+
* is an empty string: a missing checkout is the compose call's error to report.
|
|
139
|
+
*
|
|
140
|
+
* @param deployRoot - The deployment folder.
|
|
141
|
+
* @param groups - The deployment's groups.
|
|
142
|
+
* @returns one text per compose file.
|
|
143
|
+
*/
|
|
144
|
+
export declare function readComposeFileTexts(deployRoot: string, groups?: readonly string[] | undefined): string[];
|
|
145
|
+
//# sourceMappingURL=free-ports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"free-ports.d.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SAAS,CAEhC;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CASzG"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { PreconditionError } from '../errors.js';
|
|
4
|
+
import { isLoopbackPortFree } from './checks/types.js';
|
|
5
|
+
import { composeCwd } from './compose-command.js';
|
|
6
|
+
import { publishesPort } from './compose-containers.js';
|
|
7
|
+
import { composeFilesFor } from './compose-files.js';
|
|
8
|
+
import { publishedPortVariables } from './compose-port-variables.js';
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Free host ports for the variables the CLI writes (#1027)
|
|
11
|
+
// =============================================================================
|
|
12
|
+
//
|
|
13
|
+
// Every app the platform deploys publishes the same default host ports
|
|
14
|
+
// (`APP_BIND_PORT=3535`, `GREPTIME_BIND_PG_PORT=14003`), so the SECOND app on a
|
|
15
|
+
// server collided with the first on its telemetry port and `stack-ports-free`
|
|
16
|
+
// (#1024) stopped it, leaving the operator to hand-edit `.env`. When the CLI is
|
|
17
|
+
// about to WRITE a value for a published-port variable it now picks one that is
|
|
18
|
+
// actually free:
|
|
19
|
+
//
|
|
20
|
+
// - FREE means no container in ANY state is configured to publish it on an
|
|
21
|
+
// address that can clash (the source `stack-ports-free` uses), nothing
|
|
22
|
+
// listens on it (the same loopback bind probe as `bind-port-free`), and it
|
|
23
|
+
// is not already chosen for another variable of the same run.
|
|
24
|
+
// - THE SEARCH STARTS AT THE DEFAULT AND WALKS UP, bounded, so a lone app
|
|
25
|
+
// keeps the familiar numbers and says nothing extra.
|
|
26
|
+
// - AN EXISTING VALUE IS NEVER MOVED. Only a variable with no value yet gets a
|
|
27
|
+
// pick: an SSH tunnel or a BI tool may depend on the number, and
|
|
28
|
+
// `stack-ports-free` still reports a clash with the fix.
|
|
29
|
+
// - DOCKER UNREACHABLE (`containers` undefined) is probe-only: still picks.
|
|
30
|
+
//
|
|
31
|
+
// `stack-ports-free` stays the final guard; this module only chooses what the
|
|
32
|
+
// guard is then asked about. It reads Docker and probes sockets and writes
|
|
33
|
+
// nothing: the callers decide where a value goes.
|
|
34
|
+
// =============================================================================
|
|
35
|
+
/** How far above the default a search walks before giving up. */
|
|
36
|
+
export const DEFAULT_PORT_SEARCH_LIMIT = 200;
|
|
37
|
+
/** The highest port number. */
|
|
38
|
+
const MAX_PORT = 65535;
|
|
39
|
+
/**
|
|
40
|
+
* Whether `value` is an integer port number (1 to 65535).
|
|
41
|
+
*
|
|
42
|
+
* @param value - Any number.
|
|
43
|
+
* @returns true for a usable port.
|
|
44
|
+
*/
|
|
45
|
+
export function isPort(value) {
|
|
46
|
+
return Number.isInteger(value) && value >= 1 && value <= MAX_PORT;
|
|
47
|
+
}
|
|
48
|
+
/** Whether the listener probe says something about this claim: it binds TCP on the loopback. */
|
|
49
|
+
function probeable(claim) {
|
|
50
|
+
return claim.protocol === 'tcp' && ['', '0.0.0.0', '::', '[::]', '127.0.0.1'].includes(claim.hostIp);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The first free host port at or above `preferred`.
|
|
54
|
+
*
|
|
55
|
+
* `options` carries:
|
|
56
|
+
*
|
|
57
|
+
* - `preferred`: where the search starts (the template default).
|
|
58
|
+
* - `hostIp` and `protocol`: where the port will be published.
|
|
59
|
+
* - `also`: more places the SAME port number is published (a variable that
|
|
60
|
+
* feeds a TCP and a UDP mapping); all of them must be free.
|
|
61
|
+
* - `taken`: ports already chosen for other variables of this run. Not
|
|
62
|
+
* changed; the caller adds the result.
|
|
63
|
+
* - `containers`: every container Docker knows, in any state. A container claims
|
|
64
|
+
* a port when it is configured to publish it on an address that overlaps (a
|
|
65
|
+
* wildcard clashes with every address) and the same protocol.
|
|
66
|
+
* - `probe`: says whether nothing listens on the port (true = free).
|
|
67
|
+
* - `limit`: how many ports to try (default 200); the search never goes above
|
|
68
|
+
* 65535.
|
|
69
|
+
* - `label`: names the variable in the error.
|
|
70
|
+
*
|
|
71
|
+
* @param options - The search, as above.
|
|
72
|
+
* @returns the port and the candidates passed over.
|
|
73
|
+
* @throws PreconditionError when `preferred` is not a port, or none is free.
|
|
74
|
+
*/
|
|
75
|
+
export async function pickFreePort(options) {
|
|
76
|
+
const { preferred, taken = new Set(), containers, probe, limit = DEFAULT_PORT_SEARCH_LIMIT } = options;
|
|
77
|
+
const label = options.label ?? 'a host port';
|
|
78
|
+
const claims = [{ hostIp: options.hostIp, protocol: options.protocol }, ...(options.also ?? [])];
|
|
79
|
+
if (!isPort(preferred)) {
|
|
80
|
+
throw new PreconditionError(`Cannot pick a free port for ${label}: ${String(preferred)} is not a port number.`);
|
|
81
|
+
}
|
|
82
|
+
const last = Math.min(MAX_PORT, preferred + Math.max(1, limit) - 1);
|
|
83
|
+
const skipped = [];
|
|
84
|
+
for (let port = preferred; port <= last; port += 1) {
|
|
85
|
+
if (taken.has(port)) {
|
|
86
|
+
skipped.push({ port, reason: 'taken' });
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const claimants = containers.filter((container) => claims.some((claim) => publishesPort(container, port, claim)));
|
|
90
|
+
if (claimants.length > 0) {
|
|
91
|
+
const holder = claimants.find((container) => container.running) ?? claimants[0];
|
|
92
|
+
skipped.push({ port, reason: 'container', holder: holder?.name });
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
// Probed once per port, and only where the probe is honest: it binds TCP on
|
|
96
|
+
// the loopback, which sees a listener on 127.0.0.1 or on every interface.
|
|
97
|
+
if (claims.some(probeable) && !(await probe(port))) {
|
|
98
|
+
skipped.push({ port, reason: 'listener' });
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
return { port, skipped };
|
|
102
|
+
}
|
|
103
|
+
throw new PreconditionError(`No free host port for ${label} from ${preferred} to ${last} (${skipped.length} tried). ` +
|
|
104
|
+
`Free one of them, or set ${options.label ?? 'the variable'} to a free port in the environment file by hand.`);
|
|
105
|
+
}
|
|
106
|
+
/** How many skipped candidates a message spells out. */
|
|
107
|
+
const MAX_PHRASES = 3;
|
|
108
|
+
/**
|
|
109
|
+
* The sentence for a pick that did not land on the default:
|
|
110
|
+
* `GREPTIME_BIND_PG_PORT=14013 (14003 is held by evopath-greptimedb-1)`.
|
|
111
|
+
*
|
|
112
|
+
* @param variable - The variable the port is for.
|
|
113
|
+
* @param pick - What `pickFreePort` returned.
|
|
114
|
+
* @param preferred - The default the search started from.
|
|
115
|
+
* @returns the text, or `undefined` when the default was free (nothing to say).
|
|
116
|
+
*/
|
|
117
|
+
export function describePick(variable, pick, preferred) {
|
|
118
|
+
if (pick.port === preferred && pick.skipped.length === 0)
|
|
119
|
+
return undefined;
|
|
120
|
+
const phrase = (entry) => entry.reason === 'container'
|
|
121
|
+
? `${entry.port} is held by ${entry.holder ?? 'another container'}`
|
|
122
|
+
: entry.reason === 'listener'
|
|
123
|
+
? `${entry.port} has a listener`
|
|
124
|
+
: `${entry.port} is used by another variable of this run`;
|
|
125
|
+
const shown = pick.skipped.slice(0, MAX_PHRASES).map(phrase);
|
|
126
|
+
if (pick.skipped.length > MAX_PHRASES)
|
|
127
|
+
shown.push(`${pick.skipped.length - MAX_PHRASES} more in use`);
|
|
128
|
+
return `${variable}=${pick.port} (${shown.join(', ')})`;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Decides a value for every published-port variable that needs one.
|
|
132
|
+
*
|
|
133
|
+
* The variables come from the compose files (`publishedPortVariables`), so an
|
|
134
|
+
* app overlay that publishes a new port is covered without a list to keep. A
|
|
135
|
+
* variable is decided only when it is in `eligible`, has no non-blank value in
|
|
136
|
+
* `given`, is not in `exclude`, and a starting point is known (the template
|
|
137
|
+
* default, else the compose file's). Everything else is left exactly as it is.
|
|
138
|
+
* Variables are decided in the order the files publish them; each choice is
|
|
139
|
+
* `taken` for the next, and so are the ports the `given` values already use.
|
|
140
|
+
*
|
|
141
|
+
* `options` carries:
|
|
142
|
+
*
|
|
143
|
+
* - `files`: the compose files' text, in merge order.
|
|
144
|
+
* - `eligible`: the keys this run may decide (the template's, or for an update
|
|
145
|
+
* the keys it is adding).
|
|
146
|
+
* - `given`: values that stay as they are, the `.env` on disk and the
|
|
147
|
+
* operator's answers. A key with a value here is never moved.
|
|
148
|
+
* - `defaults`: the template default of each key, where the search starts.
|
|
149
|
+
* - `exclude`: keys decided elsewhere (`APP_BIND_PORT`).
|
|
150
|
+
* - `taken`: ports already in use by this run.
|
|
151
|
+
* - `containers`: every container Docker knows, or `undefined` when Docker
|
|
152
|
+
* cannot be asked (probe-only).
|
|
153
|
+
* - `probe`: says whether nothing listens on a port (default: the loopback bind
|
|
154
|
+
* probe).
|
|
155
|
+
* - `limit`: the search bound per variable.
|
|
156
|
+
*
|
|
157
|
+
* @param options - The decision inputs, as above.
|
|
158
|
+
* @returns one decision per variable decided, in file order.
|
|
159
|
+
* @throws PreconditionError when a variable has no free port within the bound.
|
|
160
|
+
*/
|
|
161
|
+
export async function planPortValues(options) {
|
|
162
|
+
const { given, defaults, eligible, exclude = new Set() } = options;
|
|
163
|
+
const probe = options.probe ?? isLoopbackPortFree;
|
|
164
|
+
const containers = options.containers ?? [];
|
|
165
|
+
const variables = publishedPortVariables({ files: options.files, env: new Map([...defaults, ...given]) });
|
|
166
|
+
// What the run already uses: the ports it was told about, and every value
|
|
167
|
+
// another published-port variable keeps.
|
|
168
|
+
const taken = new Set(options.taken ?? []);
|
|
169
|
+
for (const { variable } of variables) {
|
|
170
|
+
const value = Number(given.get(variable));
|
|
171
|
+
if (given.get(variable) !== undefined && isPort(value))
|
|
172
|
+
taken.add(value);
|
|
173
|
+
}
|
|
174
|
+
const decisions = [];
|
|
175
|
+
for (const candidate of variables) {
|
|
176
|
+
const { variable } = candidate;
|
|
177
|
+
if (!eligible.has(variable) || exclude.has(variable))
|
|
178
|
+
continue;
|
|
179
|
+
if ((given.get(variable) ?? '') !== '')
|
|
180
|
+
continue;
|
|
181
|
+
const fromTemplate = Number(defaults.get(variable));
|
|
182
|
+
const preferred = isPort(fromTemplate) ? fromTemplate : candidate.defaultPort;
|
|
183
|
+
if (preferred === undefined)
|
|
184
|
+
continue;
|
|
185
|
+
const [first, ...rest] = candidate.claims;
|
|
186
|
+
if (first === undefined)
|
|
187
|
+
continue;
|
|
188
|
+
const pick = await pickFreePort({
|
|
189
|
+
preferred,
|
|
190
|
+
hostIp: first.hostIp,
|
|
191
|
+
protocol: first.protocol,
|
|
192
|
+
also: rest,
|
|
193
|
+
taken,
|
|
194
|
+
containers,
|
|
195
|
+
probe,
|
|
196
|
+
limit: options.limit,
|
|
197
|
+
label: variable,
|
|
198
|
+
});
|
|
199
|
+
taken.add(pick.port);
|
|
200
|
+
decisions.push({ variable, port: pick.port, preferred, message: describePick(variable, pick, preferred) });
|
|
201
|
+
}
|
|
202
|
+
return decisions;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* The containers a pick must avoid: every one except those of the run's own
|
|
206
|
+
* compose project, which `up -d` recreates (the rule `stack-ports-free` applies).
|
|
207
|
+
*
|
|
208
|
+
* @param containers - What `listComposeContainers` returned, or `undefined`.
|
|
209
|
+
* @param project - The deployment's compose project.
|
|
210
|
+
* @returns the other projects' containers, or `undefined` when Docker could not be asked.
|
|
211
|
+
*/
|
|
212
|
+
export function foreignContainers(containers, project) {
|
|
213
|
+
return containers?.filter((container) => container.project !== project);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The text of the deployment's compose files, in the order compose merges them
|
|
217
|
+
* (the same list `up -d` uses, app overlays last). A file that cannot be read
|
|
218
|
+
* is an empty string: a missing checkout is the compose call's error to report.
|
|
219
|
+
*
|
|
220
|
+
* @param deployRoot - The deployment folder.
|
|
221
|
+
* @param groups - The deployment's groups.
|
|
222
|
+
* @returns one text per compose file.
|
|
223
|
+
*/
|
|
224
|
+
export function readComposeFileTexts(deployRoot, groups) {
|
|
225
|
+
const composeDir = composeCwd(deployRoot);
|
|
226
|
+
return composeFilesFor(groups, composeDir).map((file) => {
|
|
227
|
+
try {
|
|
228
|
+
return readFileSync(join(composeDir, file), 'utf8');
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return '';
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=free-ports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"free-ports.js","sourceRoot":"","sources":["../../../src/engine/deploy/free-ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAyB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,gFAAgF;AAChF,4DAA4D;AAC5D,gFAAgF;AAChF,EAAE;AACF,uEAAuE;AACvE,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,gFAAgF;AAChF,iBAAiB;AACjB,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,kEAAkE;AAClE,4EAA4E;AAC5E,yDAAyD;AACzD,iFAAiF;AACjF,qEAAqE;AACrE,6DAA6D;AAC7D,8EAA8E;AAC9E,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,kDAAkD;AAClD,gFAAgF;AAEhF,iEAAiE;AACjE,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C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IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -16,6 +16,20 @@ export interface InstallOptions extends AppRoleOptions {
|
|
|
16
16
|
deployRoot: string;
|
|
17
17
|
domain?: string | undefined;
|
|
18
18
|
bindPort: number;
|
|
19
|
+
/**
|
|
20
|
+
* True when `bindPort` is the default nobody asked for (`--port` was not
|
|
21
|
+
* passed), so a fresh install may move it to a free port (#1027): it walks up
|
|
22
|
+
* from `bindPort` past a port another app holds, and the CHOSEN number is what
|
|
23
|
+
* `.env`, the state, the vhost and the health probe then use. Absent or false
|
|
24
|
+
* means the operator named the port: it is kept, and the preflight fails if it
|
|
25
|
+
* is taken. A deployment that already has an `APP_BIND_PORT` keeps it either way.
|
|
26
|
+
*/
|
|
27
|
+
bindPortIsDefault?: boolean | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Says whether nothing listens on a loopback port (true = free). Test seam
|
|
30
|
+
* for the free-port search and the port checks; defaults to a real bind.
|
|
31
|
+
*/
|
|
32
|
+
portFree?: ((port: number) => Promise<boolean>) | undefined;
|
|
19
33
|
proxyRoot: string;
|
|
20
34
|
/**
|
|
21
35
|
* How the shared proxy runs. Absent means "as recorded, else detected" --
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/install.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAI/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAQL,KAAK,cAAc,E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E,UAAU,EAAE,OAAO,iBAAiB,CAAA;CAAE,EAC1F,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAC9D;AAmDD,wBAAsB,UAAU,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CA8RlF;AAgCD,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGpE"}
|
|
@@ -21,7 +21,9 @@ import { openJournal } from './journal.js';
|
|
|
21
21
|
import { bootstrapProxyRoot, certificateStatus, describeProxyRuntime, installVhost, issueCertificate, resolveRecordedProxyRuntime, } from './proxy.js';
|
|
22
22
|
import { checkoutHead, ensureCheckout, resolveRepoTarget, resolveRepoUrl } from './repo.js';
|
|
23
23
|
import { explainComposeFailure } from './compose-hints.js';
|
|
24
|
-
import { freshComposeProject } from './compose-containers.js';
|
|
24
|
+
import { freshComposeProject, listComposeContainers } from './compose-containers.js';
|
|
25
|
+
import { isLoopbackPortFree } from './checks/types.js';
|
|
26
|
+
import { describePick, foreignContainers, isPort, pickFreePort, planPortValues, readComposeFileTexts } from './free-ports.js';
|
|
25
27
|
import { detectComposeProject, reconcileComposeProject } from './compose-project.js';
|
|
26
28
|
import { DEPLOY_STATE_VERSION, appendHistory, readState, writeState, } from './state.js';
|
|
27
29
|
import { assertStackPortsFree, STACK_PORTS_STEP_ID } from './stack-ports-gate.js';
|
|
@@ -43,6 +45,44 @@ function environmentOf(context) {
|
|
|
43
45
|
const path = envFilePath(context.options.deployRoot);
|
|
44
46
|
return existsSync(path) ? parseEnvFile(readFileSync(path, 'utf8')) : undefined;
|
|
45
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* `existing` plus a free port for every published-port variable of the
|
|
50
|
+
* template that has no value in it (#1027).
|
|
51
|
+
*
|
|
52
|
+
* "No value" is the rule that keeps an existing deployment safe: an `.env`
|
|
53
|
+
* that already holds `GREPTIME_BIND_PG_PORT` keeps it even when something else
|
|
54
|
+
* took the port since (an SSH tunnel may depend on it; `stack-ports-free`
|
|
55
|
+
* reports the clash with the fix), and so does an operator's answer. A variable
|
|
56
|
+
* the `.env` lacks (a reinstall over an environment from before the key
|
|
57
|
+
* existed) is decided like a fresh install's.
|
|
58
|
+
*
|
|
59
|
+
* `APP_BIND_PORT` is not decided here: `settleBindPort` chose it before the
|
|
60
|
+
* pipeline ran, and the step writes it from `options.bindPort`.
|
|
61
|
+
*/
|
|
62
|
+
async function withFreePorts(context, specs, existing) {
|
|
63
|
+
const project = context.composeProject ?? freshComposeProject(context.options.deployRoot);
|
|
64
|
+
const decisions = await planPortValues({
|
|
65
|
+
files: readComposeFileTexts(context.options.deployRoot, context.options.groups),
|
|
66
|
+
eligible: new Set(specs.map((spec) => spec.key)),
|
|
67
|
+
given: existing ?? new Map(),
|
|
68
|
+
defaults: new Map(specs.map((spec) => [spec.key, spec.defaultValue])),
|
|
69
|
+
exclude: new Set(['APP_BIND_PORT']),
|
|
70
|
+
taken: [context.options.bindPort],
|
|
71
|
+
containers: foreignContainers(await listComposeContainers(context.runCommand), project),
|
|
72
|
+
probe: context.options.portFree,
|
|
73
|
+
});
|
|
74
|
+
if (decisions.length === 0)
|
|
75
|
+
return existing;
|
|
76
|
+
const planned = new Map(existing ?? []);
|
|
77
|
+
for (const decision of decisions) {
|
|
78
|
+
planned.set(decision.variable, String(decision.port));
|
|
79
|
+
if (decision.message !== undefined) {
|
|
80
|
+
context.journal.line(`Picked a free host port: ${decision.message}`);
|
|
81
|
+
context.hooks?.onProgress?.(`Picked a free host port: ${decision.message}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return planned;
|
|
85
|
+
}
|
|
46
86
|
/** The question the proxy-bootstrap gate asks. */
|
|
47
87
|
function bootstrapQuestion(proxyRoot, container) {
|
|
48
88
|
return (`This server has no shared reverse proxy. Create one in ${proxyRoot} ` +
|
|
@@ -373,6 +413,7 @@ export function buildInstallSteps() {
|
|
|
373
413
|
// This preflight runs before the `environment` step has written the
|
|
374
414
|
// `.env`; the `stack-ports` step asks again with the final one.
|
|
375
415
|
environmentPending: true,
|
|
416
|
+
...(context.options.portFree === undefined ? {} : { portFree: context.options.portFree }),
|
|
376
417
|
proxyRoot: context.options.proxyRoot,
|
|
377
418
|
// Resolved before the checks, because it decides which of them are
|
|
378
419
|
// required: certbot-installed only on the host, renewal-path hygiene
|
|
@@ -463,6 +504,11 @@ export function buildInstallSteps() {
|
|
|
463
504
|
nonInteractive: context.options.nonInteractive,
|
|
464
505
|
});
|
|
465
506
|
const onDisk = existsSync(path) ? parseEnvFile(readFileSync(path, 'utf8')) : undefined;
|
|
507
|
+
// #1027: a free host port for every published-port variable nobody gave a
|
|
508
|
+
// value (the default may be another app's). Decided BEFORE the wizard so
|
|
509
|
+
// `--all` shows the pick as the default to accept or change, and an
|
|
510
|
+
// answer or an existing `.env` value is never overridden.
|
|
511
|
+
const withPorts = await withFreePorts(context, specs, existing);
|
|
466
512
|
const { values } = await runEnvWizard({
|
|
467
513
|
specs,
|
|
468
514
|
// With --skip-proxy and no --domain there is no public hostname to
|
|
@@ -480,7 +526,7 @@ export function buildInstallSteps() {
|
|
|
480
526
|
adminUser: admin.user,
|
|
481
527
|
})),
|
|
482
528
|
}),
|
|
483
|
-
...(
|
|
529
|
+
...(withPorts === undefined ? {} : { existing: withPorts }),
|
|
484
530
|
...(context.options.all === undefined ? {} : { all: context.options.all }),
|
|
485
531
|
...(context.options.nonInteractive === undefined
|
|
486
532
|
? {}
|
|
@@ -663,6 +709,7 @@ export function buildInstallSteps() {
|
|
|
663
709
|
composeProject: context.composeProject,
|
|
664
710
|
groups: context.options.groups,
|
|
665
711
|
proxyRoot: context.options.proxyRoot,
|
|
712
|
+
...(context.options.portFree === undefined ? {} : { portFree: context.options.portFree }),
|
|
666
713
|
},
|
|
667
714
|
line: (text) => context.journal.line(text),
|
|
668
715
|
warn: (text) => context.hooks?.onProgress?.(text),
|
|
@@ -1086,6 +1133,50 @@ export async function scheduleRenewal(context, proxyRoot, runtime) {
|
|
|
1086
1133
|
}
|
|
1087
1134
|
context.hooks?.onProgress?.(result.detail);
|
|
1088
1135
|
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Settles `options.bindPort` BEFORE anything reads it (#1027).
|
|
1138
|
+
*
|
|
1139
|
+
* When `--port` was not passed (`bindPortIsDefault`), the default is a starting
|
|
1140
|
+
* point, not a promise: a deployment that already wrote `APP_BIND_PORT` keeps
|
|
1141
|
+
* it (a re-run must never move a port a proxy vhost and a tunnel point at), and
|
|
1142
|
+
* a fresh one walks up from the default past any port another app holds. The
|
|
1143
|
+
* result is written back into `options`, the one object every step, the
|
|
1144
|
+
* preflight, the state, the vhost, the health probe and the final summary read,
|
|
1145
|
+
* so none of them can see the default after this ran.
|
|
1146
|
+
*
|
|
1147
|
+
* Only the `.env` counts as a record here: the state's `bindPort` of a run that
|
|
1148
|
+
* failed before the environment step is a choice that was never written, and is
|
|
1149
|
+
* made again (it lands on the same port unless something took it since).
|
|
1150
|
+
*/
|
|
1151
|
+
async function settleBindPort(options, input) {
|
|
1152
|
+
if (options.bindPortIsDefault !== true)
|
|
1153
|
+
return;
|
|
1154
|
+
const path = envFilePath(options.deployRoot);
|
|
1155
|
+
const recorded = existsSync(path) ? Number(parseEnvFile(readFileSync(path, 'utf8')).get('APP_BIND_PORT')) : Number.NaN;
|
|
1156
|
+
if (isPort(recorded)) {
|
|
1157
|
+
if (recorded !== options.bindPort) {
|
|
1158
|
+
input.journal.line(`Keeping APP_BIND_PORT=${recorded} from the existing environment file (the default ${options.bindPort} was not asked for).`);
|
|
1159
|
+
options.bindPort = recorded;
|
|
1160
|
+
}
|
|
1161
|
+
return;
|
|
1162
|
+
}
|
|
1163
|
+
const containers = foreignContainers(await listComposeContainers(input.runCommand), input.project);
|
|
1164
|
+
// Any address: `bind-port-owner` counts a container that publishes the port anywhere.
|
|
1165
|
+
const pick = await pickFreePort({
|
|
1166
|
+
preferred: options.bindPort,
|
|
1167
|
+
hostIp: '',
|
|
1168
|
+
protocol: 'tcp',
|
|
1169
|
+
containers: containers ?? [],
|
|
1170
|
+
probe: options.portFree ?? isLoopbackPortFree,
|
|
1171
|
+
label: 'APP_BIND_PORT',
|
|
1172
|
+
});
|
|
1173
|
+
const message = describePick('APP_BIND_PORT', pick, options.bindPort);
|
|
1174
|
+
options.bindPort = pick.port;
|
|
1175
|
+
if (message !== undefined) {
|
|
1176
|
+
input.journal.line(`Picked a free host port: ${message}`);
|
|
1177
|
+
options.hooks?.onProgress?.(`Picked a free host port: ${message}`);
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1089
1180
|
export async function runInstall(requested) {
|
|
1090
1181
|
// Every step reads `options.groups`, so widening it once here is what puts
|
|
1091
1182
|
// the always-on groups (#567) into the wizard, the compose file list, the
|
|
@@ -1128,6 +1219,13 @@ export async function runInstall(requested) {
|
|
|
1128
1219
|
const freshProject = loadedState === undefined && !isDeployment(options.deployRoot);
|
|
1129
1220
|
let existingState = loadedState;
|
|
1130
1221
|
let composeProject = freshProject ? freshComposeProject(options.deployRoot) : composeProjectFor(existingState);
|
|
1222
|
+
// ⚠ BEFORE ANY READER OF `options.bindPort`, the project detection below
|
|
1223
|
+
// included: see settleBindPort (#1027).
|
|
1224
|
+
await settleBindPort(options, {
|
|
1225
|
+
project: composeProject,
|
|
1226
|
+
runCommand: options.runCommand ?? defaultRunCommand,
|
|
1227
|
+
journal,
|
|
1228
|
+
});
|
|
1131
1229
|
// True when the project below came from Docker for a deployment with NO
|
|
1132
1230
|
// record: evidence, so the failure path may record it like a fresh name.
|
|
1133
1231
|
let projectFromDocker = false;
|