@marinoscar/platform-cli 0.1.0-next.13 → 0.1.0-next.14
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 +15 -0
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/engine/commands/deploy.d.ts.map +1 -1
- package/dist/engine/commands/deploy.js +2 -0
- package/dist/engine/commands/deploy.js.map +1 -1
- package/dist/engine/deploy/checks/compose.d.ts +10 -1
- package/dist/engine/deploy/checks/compose.d.ts.map +1 -1
- package/dist/engine/deploy/checks/compose.js +4 -4
- package/dist/engine/deploy/checks/compose.js.map +1 -1
- package/dist/engine/deploy/checks/index.d.ts +1 -0
- package/dist/engine/deploy/checks/index.d.ts.map +1 -1
- package/dist/engine/deploy/checks/index.js +4 -0
- package/dist/engine/deploy/checks/index.js.map +1 -1
- package/dist/engine/deploy/checks/stack-ports.d.ts +4 -0
- package/dist/engine/deploy/checks/stack-ports.d.ts.map +1 -0
- package/dist/engine/deploy/checks/stack-ports.js +234 -0
- package/dist/engine/deploy/checks/stack-ports.js.map +1 -0
- package/dist/engine/deploy/checks/types.d.ts +16 -0
- package/dist/engine/deploy/checks/types.d.ts.map +1 -1
- package/dist/engine/deploy/checks/types.js.map +1 -1
- package/dist/engine/deploy/compose-command.d.ts +16 -0
- package/dist/engine/deploy/compose-command.d.ts.map +1 -0
- package/dist/engine/deploy/compose-command.js +40 -0
- package/dist/engine/deploy/compose-command.js.map +1 -0
- package/dist/engine/deploy/compose-containers.d.ts +30 -1
- package/dist/engine/deploy/compose-containers.d.ts.map +1 -1
- package/dist/engine/deploy/compose-containers.js +79 -13
- package/dist/engine/deploy/compose-containers.js.map +1 -1
- package/dist/engine/deploy/compose-port-variables.d.ts +18 -0
- package/dist/engine/deploy/compose-port-variables.d.ts.map +1 -0
- package/dist/engine/deploy/compose-port-variables.js +136 -0
- package/dist/engine/deploy/compose-port-variables.js.map +1 -0
- package/dist/engine/deploy/compose-ports.d.ts +98 -0
- package/dist/engine/deploy/compose-ports.d.ts.map +1 -0
- package/dist/engine/deploy/compose-ports.js +204 -0
- package/dist/engine/deploy/compose-ports.js.map +1 -0
- package/dist/engine/deploy/compose-project.d.ts +1 -1
- package/dist/engine/deploy/compose-project.d.ts.map +1 -1
- package/dist/engine/deploy/compose-project.js.map +1 -1
- package/dist/engine/deploy/install.d.ts +2 -10
- package/dist/engine/deploy/install.d.ts.map +1 -1
- package/dist/engine/deploy/install.js +36 -24
- package/dist/engine/deploy/install.js.map +1 -1
- package/dist/engine/deploy/stack-ports-gate.d.ts +19 -0
- package/dist/engine/deploy/stack-ports-gate.d.ts.map +1 -0
- package/dist/engine/deploy/stack-ports-gate.js +54 -0
- package/dist/engine/deploy/stack-ports-gate.js.map +1 -0
- package/dist/engine/deploy/steps/registry.d.ts +2 -2
- package/dist/engine/deploy/steps/registry.d.ts.map +1 -1
- package/dist/engine/deploy/steps/registry.js +2 -0
- package/dist/engine/deploy/steps/registry.js.map +1 -1
- package/dist/engine/deploy/testing/fake-containers.d.ts +13 -2
- package/dist/engine/deploy/testing/fake-containers.d.ts.map +1 -1
- package/dist/engine/deploy/testing/fake-containers.js +9 -2
- package/dist/engine/deploy/testing/fake-containers.js.map +1 -1
- package/dist/engine/deploy/testing/fake-vps.d.ts.map +1 -1
- package/dist/engine/deploy/testing/fake-vps.js +6 -0
- package/dist/engine/deploy/testing/fake-vps.js.map +1 -1
- package/dist/engine/deploy/update.d.ts.map +1 -1
- package/dist/engine/deploy/update.js +34 -0
- package/dist/engine/deploy/update.js.map +1 -1
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/tui/screens/deploy/doctor.js +1 -0
- package/dist/engine/tui/screens/deploy/doctor.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type PublishedPort } from './compose-ports.js';
|
|
2
|
+
/**
|
|
3
|
+
* The environment variable that sets the host port compose reported, or
|
|
4
|
+
* `undefined` when the port is a literal in the files (or cannot be traced).
|
|
5
|
+
*
|
|
6
|
+
* @param options - The port, the compose files' text in the order compose
|
|
7
|
+
* merges them, and the environment compose interpolates with (the
|
|
8
|
+
* deployment's `.env`, then the process environment).
|
|
9
|
+
* @returns the variable name, such as `GREPTIME_BIND_PG_PORT`.
|
|
10
|
+
* @stability experimental
|
|
11
|
+
*/
|
|
12
|
+
export declare function portVariableFor(options: {
|
|
13
|
+
port: PublishedPort;
|
|
14
|
+
/** The text of each compose file, in merge order. */
|
|
15
|
+
files: readonly string[];
|
|
16
|
+
env: ReadonlyMap<string, string>;
|
|
17
|
+
}): string | undefined;
|
|
18
|
+
//# sourceMappingURL=compose-port-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-port-variables.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/compose-port-variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AA2IvE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,IAAI,EAAE,aAAa,CAAC;IACpB,qDAAqD;IACrD,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,GAAG,MAAM,GAAG,SAAS,CAerB"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { splitPortSpec } from './compose-ports.js';
|
|
2
|
+
/** The `${NAME}` / `${NAME:-default}` / `$NAME` forms compose interpolates. */
|
|
3
|
+
const INTERPOLATION = /\$\$|\$\{([A-Za-z_][A-Za-z0-9_]*)(?:(:?)([-?+])([^}]*))?\}|\$([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
4
|
+
/**
|
|
5
|
+
* Compose's interpolation of one token against an environment. `${V:-d}` takes
|
|
6
|
+
* `d` when V is unset OR empty, `${V-d}` only when unset, `${V:?m}` and
|
|
7
|
+
* `${V?m}` keep the value (the failure is compose's to report), `${V:+a}`
|
|
8
|
+
* yields `a` when V is set and non-empty.
|
|
9
|
+
*/
|
|
10
|
+
function interpolate(token, env) {
|
|
11
|
+
return token.replace(INTERPOLATION, (match, braced, colon, operator, argument, bare) => {
|
|
12
|
+
if (match === '$$')
|
|
13
|
+
return '$';
|
|
14
|
+
const name = braced ?? bare ?? '';
|
|
15
|
+
const value = env.get(name);
|
|
16
|
+
const unset = value === undefined || (colon === ':' && value === '');
|
|
17
|
+
if (operator === '-')
|
|
18
|
+
return unset ? (argument ?? '') : (value ?? '');
|
|
19
|
+
if (operator === '+')
|
|
20
|
+
return unset ? '' : (argument ?? '');
|
|
21
|
+
return value ?? '';
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** The first variable a token reads, if any. */
|
|
25
|
+
function variableOf(token) {
|
|
26
|
+
for (const match of token.matchAll(INTERPOLATION)) {
|
|
27
|
+
const name = match[1] ?? match[5];
|
|
28
|
+
if (name !== undefined)
|
|
29
|
+
return name;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
/** The leading whitespace width of a line. */
|
|
34
|
+
function indentOf(line) {
|
|
35
|
+
return line.length - line.trimStart().length;
|
|
36
|
+
}
|
|
37
|
+
/** A list item's value: the quoted string, else the text up to a trailing comment. */
|
|
38
|
+
function itemValue(line) {
|
|
39
|
+
const body = line.trimStart();
|
|
40
|
+
if (!body.startsWith('-'))
|
|
41
|
+
return undefined;
|
|
42
|
+
const rest = body.slice(1).trim();
|
|
43
|
+
const quoted = /^(["'])(.*?)\1/.exec(rest);
|
|
44
|
+
if (quoted !== null)
|
|
45
|
+
return quoted[2] ?? '';
|
|
46
|
+
return rest.replace(/\s+#.*$/, '').trim();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The raw `ports:` entries of `service` after applying every file in order:
|
|
50
|
+
* `ports: !override` / `!reset` drops what the earlier files listed (as compose
|
|
51
|
+
* does), a plain `ports:` adds to it.
|
|
52
|
+
*/
|
|
53
|
+
function rawPortsOf(service, texts) {
|
|
54
|
+
let entries = [];
|
|
55
|
+
for (const text of texts) {
|
|
56
|
+
let inServices = false;
|
|
57
|
+
let serviceIndent = -1;
|
|
58
|
+
let inService = false;
|
|
59
|
+
let portsIndent = -1; // >= 0 while inside this service's `ports:` list
|
|
60
|
+
for (const line of text.split(/\r?\n/)) {
|
|
61
|
+
const trimmed = line.trim();
|
|
62
|
+
if (trimmed === '' || trimmed.startsWith('#'))
|
|
63
|
+
continue;
|
|
64
|
+
const indent = indentOf(line);
|
|
65
|
+
if (indent === 0) {
|
|
66
|
+
inServices = /^services:\s*(#.*)?$/.test(trimmed);
|
|
67
|
+
inService = false;
|
|
68
|
+
portsIndent = -1;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (!inServices)
|
|
72
|
+
continue;
|
|
73
|
+
// Leaving a `ports:` list: the first line that is not deeper than its key
|
|
74
|
+
// (an item may sit at the key's own indent, which YAML allows).
|
|
75
|
+
if (portsIndent >= 0 && (indent < portsIndent || (indent === portsIndent && !trimmed.startsWith('-')))) {
|
|
76
|
+
portsIndent = -1;
|
|
77
|
+
}
|
|
78
|
+
if (portsIndent >= 0) {
|
|
79
|
+
const value = itemValue(line);
|
|
80
|
+
const split = value === undefined ? undefined : splitPortSpec(value);
|
|
81
|
+
if (split !== undefined)
|
|
82
|
+
entries.push(split);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
// The first key under `services:` fixes the indent of the service names.
|
|
86
|
+
if (serviceIndent === -1)
|
|
87
|
+
serviceIndent = indent;
|
|
88
|
+
if (indent === serviceIndent) {
|
|
89
|
+
const name = /^([A-Za-z0-9_.-]+):/.exec(trimmed)?.[1];
|
|
90
|
+
inService = name === service;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (!inService)
|
|
94
|
+
continue;
|
|
95
|
+
const ports = /^ports:\s*(!override|!reset)?\s*(\[\s*\])?\s*(#.*)?$/.exec(trimmed);
|
|
96
|
+
if (ports === null)
|
|
97
|
+
continue;
|
|
98
|
+
if (ports[1] !== undefined)
|
|
99
|
+
entries = [];
|
|
100
|
+
if (ports[2] === undefined)
|
|
101
|
+
portsIndent = indent;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return entries;
|
|
105
|
+
}
|
|
106
|
+
/** Whether an interpolated published token (`14003`, `8000-8010`) covers `port`. */
|
|
107
|
+
function covers(published, port) {
|
|
108
|
+
const [first = '', last = first] = published.trim().split('-');
|
|
109
|
+
const low = Number(first);
|
|
110
|
+
const high = Number(last);
|
|
111
|
+
return Number.isInteger(low) && Number.isInteger(high) && low <= port && port <= high;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The environment variable that sets the host port compose reported, or
|
|
115
|
+
* `undefined` when the port is a literal in the files (or cannot be traced).
|
|
116
|
+
*
|
|
117
|
+
* @param options - The port, the compose files' text in the order compose
|
|
118
|
+
* merges them, and the environment compose interpolates with (the
|
|
119
|
+
* deployment's `.env`, then the process environment).
|
|
120
|
+
* @returns the variable name, such as `GREPTIME_BIND_PG_PORT`.
|
|
121
|
+
* @stability experimental
|
|
122
|
+
*/
|
|
123
|
+
export function portVariableFor(options) {
|
|
124
|
+
const { port, files, env } = options;
|
|
125
|
+
const wildcard = (ip) => ip === '' || ip === '0.0.0.0' || ip === '::';
|
|
126
|
+
const matching = rawPortsOf(port.service, files).filter((entry) => {
|
|
127
|
+
const hostIp = interpolate(entry.hostIp, env).replace(/^\[|\]$/g, '');
|
|
128
|
+
return (covers(interpolate(entry.published, env), port.port) &&
|
|
129
|
+
entry.protocol === port.protocol &&
|
|
130
|
+
(hostIp === port.hostIp || (wildcard(hostIp) && wildcard(port.hostIp))));
|
|
131
|
+
});
|
|
132
|
+
// The last file wins, so the last matching entry names the variable.
|
|
133
|
+
const last = matching[matching.length - 1];
|
|
134
|
+
return last === undefined ? undefined : variableOf(last.published);
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=compose-port-variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-port-variables.js","sourceRoot":"","sources":["../../../src/engine/deploy/compose-port-variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAsB,MAAM,oBAAoB,CAAC;AA4BvE,+EAA+E;AAC/E,MAAM,aAAa,GAAG,wFAAwF,CAAC;AAE/G;;;;;GAKG;AACH,SAAS,WAAW,CAAC,KAAa,EAAE,GAAgC;IAClE,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAe,EAAE,KAAc,EAAE,QAAiB,EAAE,QAAiB,EAAE,IAAa,EAAE,EAAE;QAClI,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,GAAG,CAAC;QAC/B,MAAM,IAAI,GAAG,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5B,MAAM,KAAK,GAAG,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;QACrE,IAAI,QAAQ,KAAK,GAAG;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QACtE,IAAI,QAAQ,KAAK,GAAG;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QAC3D,OAAO,KAAK,IAAI,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,gDAAgD;AAChD,SAAS,UAAU,CAAC,KAAa;IAC/B,KAAK,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AC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAChE,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACtE,OAAO,CACL,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;YACpD,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ;YAChC,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACxE,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,qEAAqE;IACrE,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3C,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { ComposeProjectCommandRunner } from './compose-containers.js';
|
|
2
|
+
/**
|
|
3
|
+
* One host port the composed stack publishes.
|
|
4
|
+
*
|
|
5
|
+
* @stability experimental
|
|
6
|
+
*/
|
|
7
|
+
export interface PublishedPort {
|
|
8
|
+
/** The compose service that publishes it. */
|
|
9
|
+
service: string;
|
|
10
|
+
/** The host address; `''` when none was given, which is every interface. */
|
|
11
|
+
hostIp: string;
|
|
12
|
+
/** The host port. A published range is one entry per port. */
|
|
13
|
+
port: number;
|
|
14
|
+
/** `tcp`, `udp` or `sctp`. */
|
|
15
|
+
protocol: string;
|
|
16
|
+
}
|
|
17
|
+
/** `docker compose config --format json` output that is not the stack this module can read. */
|
|
18
|
+
export declare class ComposeConfigError extends Error {
|
|
19
|
+
constructor(message: string);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Splits a short-syntax port spec (`127.0.0.1:14003:4003/tcp`) at the colons
|
|
23
|
+
* that are not inside `${...}` or an IPv6 `[...]`, and returns the host side.
|
|
24
|
+
*
|
|
25
|
+
* Shared by the rendered-config fallback and the raw-file variable scan, so
|
|
26
|
+
* both read one grammar.
|
|
27
|
+
*
|
|
28
|
+
* @param spec - The spec, quotes and whitespace already removed.
|
|
29
|
+
* @returns the host address (`''` when none), the published token (which may
|
|
30
|
+
* still hold `${VAR:-default}`), and the protocol; `undefined` for a spec
|
|
31
|
+
* with no published side (`"80"`, a container-only port).
|
|
32
|
+
*/
|
|
33
|
+
export declare function splitPortSpec(spec: string): {
|
|
34
|
+
hostIp: string;
|
|
35
|
+
published: string;
|
|
36
|
+
protocol: string;
|
|
37
|
+
} | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Every host port a rendered compose project publishes, from the JSON of
|
|
40
|
+
* `docker compose config --format json`.
|
|
41
|
+
*
|
|
42
|
+
* `published` is a string for compose v2 and a number elsewhere, and a range
|
|
43
|
+
* (`"8000-8002"`) is one entry per port; no `published` (or `0`) is a port
|
|
44
|
+
* Docker picks and is no claim; no `host_ip` is every interface; the protocol
|
|
45
|
+
* defaults to `tcp`. A service that lists a short-syntax string instead of the
|
|
46
|
+
* long form is read too. A range wider than 1024 ports is cut at 1024.
|
|
47
|
+
*
|
|
48
|
+
* @param json - The command's stdout.
|
|
49
|
+
* @returns the ports, deduplicated, in service order.
|
|
50
|
+
* @throws ComposeConfigError when the text is not a compose project. The
|
|
51
|
+
* message never quotes the text: it holds the stack's secrets.
|
|
52
|
+
* @stability experimental
|
|
53
|
+
*/
|
|
54
|
+
export declare function parseComposePorts(json: string): PublishedPort[];
|
|
55
|
+
/**
|
|
56
|
+
* What asking compose for the stack's ports came to.
|
|
57
|
+
*
|
|
58
|
+
* @stability experimental
|
|
59
|
+
*/
|
|
60
|
+
export type StackPortsResult =
|
|
61
|
+
/** The ports the stack publishes. */
|
|
62
|
+
{
|
|
63
|
+
status: 'ok';
|
|
64
|
+
ports: PublishedPort[];
|
|
65
|
+
}
|
|
66
|
+
/** Docker could not be reached at all (no `docker`, no daemon, no socket access): nothing was learned. */
|
|
67
|
+
| {
|
|
68
|
+
status: 'docker-unreachable';
|
|
69
|
+
message: string;
|
|
70
|
+
}
|
|
71
|
+
/** Compose refused to render the stack (a missing required variable, an invalid file) or printed something unreadable. */
|
|
72
|
+
| {
|
|
73
|
+
status: 'render-failed';
|
|
74
|
+
message: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Renders the deployment's compose project exactly as `up -d` would and lists
|
|
78
|
+
* the host ports it publishes, with `docker compose config --format json` run
|
|
79
|
+
* under the run's project and files, in the checkout's compose directory. That
|
|
80
|
+
* directory is where compose finds the deployment's `.env`: no `--env-file` is
|
|
81
|
+
* passed by any `up`, so none is passed here, and the process environment
|
|
82
|
+
* overrides the file the same way. Never runs anything that changes a container.
|
|
83
|
+
*
|
|
84
|
+
* @param options - The command seam, the deployment and the project.
|
|
85
|
+
* @returns the ports, or why they could not be read.
|
|
86
|
+
* @stability experimental
|
|
87
|
+
*/
|
|
88
|
+
export declare function readStackPorts(options: {
|
|
89
|
+
/** The command seam; the engine's `runCommand`. */
|
|
90
|
+
run: ComposeProjectCommandRunner;
|
|
91
|
+
/** The deployment folder. */
|
|
92
|
+
deployRoot: string;
|
|
93
|
+
/** The compose project the run passes to `-p`. */
|
|
94
|
+
project: string;
|
|
95
|
+
/** The deployment's groups; the always-on ones are added. */
|
|
96
|
+
groups?: readonly string[] | undefined;
|
|
97
|
+
}): Promise<StackPortsResult>;
|
|
98
|
+
//# sourceMappingURL=compose-ports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-ports.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/compose-ports.ts"],"names":[],"m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AAM,EAAE,GAAG,SAAS,CAAC;CACxC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAmB5B"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { composeArgv, composeCwd } from './compose-command.js';
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Which host ports will the composed stack publish? (#1024)
|
|
4
|
+
// =============================================================================
|
|
5
|
+
//
|
|
6
|
+
// `docker compose up -d` recreates the services that changed, in dependency
|
|
7
|
+
// order, and only THEN meets a host port something else holds. By that point the
|
|
8
|
+
// web, api and nginx containers have been replaced and the one that needed the
|
|
9
|
+
// port (`greptimedb` on 127.0.0.1:14003) cannot start: the site is down. So the
|
|
10
|
+
// question "will every port the stack publishes bind?" has to be answered before
|
|
11
|
+
// the first container is touched, and the only complete answer to "which ports
|
|
12
|
+
// does the stack publish?" is compose's own: the same files, the same project and
|
|
13
|
+
// the same `.env` `up` will read, merged and interpolated (`!override` and
|
|
14
|
+
// `${APP_BIND_PORT:-3535}` included), i.e. `docker compose config --format json`.
|
|
15
|
+
//
|
|
16
|
+
// ⚠ THAT OUTPUT CARRIES EVERY SECRET. The rendered `environment:` of each
|
|
17
|
+
// service holds POSTGRES_PASSWORD, JWT_SECRET and the rest, in clear. This module
|
|
18
|
+
// parses it in memory and hands back ports only; it never logs, journals or
|
|
19
|
+
// quotes stdout, not even to explain a parse failure. A failed command's message
|
|
20
|
+
// is stderr (the executor's tail), which compose does not fill with values.
|
|
21
|
+
//
|
|
22
|
+
// Read-only, argv only, never a shell string. `config` needs no daemon: whether
|
|
23
|
+
// Docker is reachable is the caller's question (`listComposeContainers`).
|
|
24
|
+
// =============================================================================
|
|
25
|
+
/** Hard stop on one published range, so a pathological `1-65535` cannot make a check probe 65k sockets. */
|
|
26
|
+
const MAX_RANGE_PORTS = 1024;
|
|
27
|
+
/** Compose renders the whole stack; a big project on a small VPS is slow, a hang is not. */
|
|
28
|
+
const CONFIG_TIMEOUT_MS = 60_000;
|
|
29
|
+
/** `docker compose config --format json` output that is not the stack this module can read. */
|
|
30
|
+
export class ComposeConfigError extends Error {
|
|
31
|
+
constructor(message) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.name = 'ComposeConfigError';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Splits a short-syntax port spec (`127.0.0.1:14003:4003/tcp`) at the colons
|
|
38
|
+
* that are not inside `${...}` or an IPv6 `[...]`, and returns the host side.
|
|
39
|
+
*
|
|
40
|
+
* Shared by the rendered-config fallback and the raw-file variable scan, so
|
|
41
|
+
* both read one grammar.
|
|
42
|
+
*
|
|
43
|
+
* @param spec - The spec, quotes and whitespace already removed.
|
|
44
|
+
* @returns the host address (`''` when none), the published token (which may
|
|
45
|
+
* still hold `${VAR:-default}`), and the protocol; `undefined` for a spec
|
|
46
|
+
* with no published side (`"80"`, a container-only port).
|
|
47
|
+
*/
|
|
48
|
+
export function splitPortSpec(spec) {
|
|
49
|
+
const parts = [];
|
|
50
|
+
let current = '';
|
|
51
|
+
let braces = 0;
|
|
52
|
+
let brackets = 0;
|
|
53
|
+
for (const char of spec) {
|
|
54
|
+
if (char === '{')
|
|
55
|
+
braces += 1;
|
|
56
|
+
else if (char === '}')
|
|
57
|
+
braces = Math.max(0, braces - 1);
|
|
58
|
+
else if (char === '[')
|
|
59
|
+
brackets += 1;
|
|
60
|
+
else if (char === ']')
|
|
61
|
+
brackets = Math.max(0, brackets - 1);
|
|
62
|
+
if (char === ':' && braces === 0 && brackets === 0) {
|
|
63
|
+
parts.push(current);
|
|
64
|
+
current = '';
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
current += char;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
parts.push(current);
|
|
71
|
+
// [hostIp:]published:target[/protocol]; fewer than two parts publishes nothing.
|
|
72
|
+
if (parts.length < 2)
|
|
73
|
+
return undefined;
|
|
74
|
+
const target = parts[parts.length - 1] ?? '';
|
|
75
|
+
const slash = target.indexOf('/');
|
|
76
|
+
const protocol = slash === -1 ? 'tcp' : target.slice(slash + 1).toLowerCase();
|
|
77
|
+
const published = parts[parts.length - 2] ?? '';
|
|
78
|
+
const hostIp = parts.length >= 3 ? parts.slice(0, parts.length - 2).join(':').replace(/^\[|\]$/g, '') : '';
|
|
79
|
+
return { hostIp, published, protocol: protocol === '' ? 'tcp' : protocol };
|
|
80
|
+
}
|
|
81
|
+
/** The ports a `published` token names: `3535`, `"3535"` or the range `"8000-8002"`. */
|
|
82
|
+
function expandPublished(published) {
|
|
83
|
+
if (published === undefined || published === null)
|
|
84
|
+
return [];
|
|
85
|
+
const text = String(published).trim();
|
|
86
|
+
// '' and 0 mean "Docker picks one": no claim to collide with.
|
|
87
|
+
if (text === '' || text === '0')
|
|
88
|
+
return [];
|
|
89
|
+
const [first = '', last = first] = text.split('-');
|
|
90
|
+
const low = Number(first);
|
|
91
|
+
const high = Number(last);
|
|
92
|
+
if (!Number.isInteger(low) || !Number.isInteger(high) || low < 1 || high < low || high > 65535) {
|
|
93
|
+
throw new ComposeConfigError(`unreadable published port ${JSON.stringify(text)}`);
|
|
94
|
+
}
|
|
95
|
+
const ports = [];
|
|
96
|
+
for (let port = low; port <= high && ports.length < MAX_RANGE_PORTS; port += 1)
|
|
97
|
+
ports.push(port);
|
|
98
|
+
return ports;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Every host port a rendered compose project publishes, from the JSON of
|
|
102
|
+
* `docker compose config --format json`.
|
|
103
|
+
*
|
|
104
|
+
* `published` is a string for compose v2 and a number elsewhere, and a range
|
|
105
|
+
* (`"8000-8002"`) is one entry per port; no `published` (or `0`) is a port
|
|
106
|
+
* Docker picks and is no claim; no `host_ip` is every interface; the protocol
|
|
107
|
+
* defaults to `tcp`. A service that lists a short-syntax string instead of the
|
|
108
|
+
* long form is read too. A range wider than 1024 ports is cut at 1024.
|
|
109
|
+
*
|
|
110
|
+
* @param json - The command's stdout.
|
|
111
|
+
* @returns the ports, deduplicated, in service order.
|
|
112
|
+
* @throws ComposeConfigError when the text is not a compose project. The
|
|
113
|
+
* message never quotes the text: it holds the stack's secrets.
|
|
114
|
+
* @stability experimental
|
|
115
|
+
*/
|
|
116
|
+
export function parseComposePorts(json) {
|
|
117
|
+
let document;
|
|
118
|
+
try {
|
|
119
|
+
document = JSON.parse(json);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
throw new ComposeConfigError('the output of `docker compose config --format json` is not JSON');
|
|
123
|
+
}
|
|
124
|
+
const services = document?.services;
|
|
125
|
+
if (typeof services !== 'object' || services === null || Array.isArray(services)) {
|
|
126
|
+
throw new ComposeConfigError('the output of `docker compose config --format json` has no services');
|
|
127
|
+
}
|
|
128
|
+
const found = [];
|
|
129
|
+
const seen = new Set();
|
|
130
|
+
const add = (entry) => {
|
|
131
|
+
const key = `${entry.service}|${entry.hostIp}|${entry.port}|${entry.protocol}`;
|
|
132
|
+
if (seen.has(key))
|
|
133
|
+
return;
|
|
134
|
+
seen.add(key);
|
|
135
|
+
found.push(entry);
|
|
136
|
+
};
|
|
137
|
+
for (const [service, definition] of Object.entries(services)) {
|
|
138
|
+
const ports = definition?.ports;
|
|
139
|
+
if (!Array.isArray(ports))
|
|
140
|
+
continue;
|
|
141
|
+
for (const raw of ports) {
|
|
142
|
+
if (typeof raw === 'string') {
|
|
143
|
+
const split = splitPortSpec(raw.replace(/["'\s]/g, ''));
|
|
144
|
+
if (split === undefined)
|
|
145
|
+
continue;
|
|
146
|
+
for (const port of expandPublished(split.published)) {
|
|
147
|
+
add({ service, hostIp: split.hostIp, port, protocol: split.protocol });
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (typeof raw !== 'object' || raw === null)
|
|
152
|
+
continue;
|
|
153
|
+
const entry = raw;
|
|
154
|
+
const hostIp = typeof entry.host_ip === 'string' ? entry.host_ip.replace(/^\[|\]$/g, '') : '';
|
|
155
|
+
const protocol = typeof entry.protocol === 'string' && entry.protocol !== '' ? entry.protocol.toLowerCase() : 'tcp';
|
|
156
|
+
for (const port of expandPublished(entry.published))
|
|
157
|
+
add({ service, hostIp, port, protocol });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return found;
|
|
161
|
+
}
|
|
162
|
+
/** The wordings Docker uses for "I cannot be asked", from the docker-daemon check plus the missing binary. */
|
|
163
|
+
const DOCKER_UNREACHABLE = /cannot connect to the docker daemon|failed to connect to the docker api|is the docker daemon running|docker\.sock|docker: command not found/i;
|
|
164
|
+
/** The failure's own words: the executor's message (argv and stderr tail), and stderr. Never stdout. */
|
|
165
|
+
function failureText(error) {
|
|
166
|
+
if (!(error instanceof Error))
|
|
167
|
+
return String(error);
|
|
168
|
+
const result = error.result;
|
|
169
|
+
const stderr = result?.stderr?.trim() ?? '';
|
|
170
|
+
return stderr === '' || error.message.includes(stderr) ? error.message : `${error.message}\n${stderr}`;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Renders the deployment's compose project exactly as `up -d` would and lists
|
|
174
|
+
* the host ports it publishes, with `docker compose config --format json` run
|
|
175
|
+
* under the run's project and files, in the checkout's compose directory. That
|
|
176
|
+
* directory is where compose finds the deployment's `.env`: no `--env-file` is
|
|
177
|
+
* passed by any `up`, so none is passed here, and the process environment
|
|
178
|
+
* overrides the file the same way. Never runs anything that changes a container.
|
|
179
|
+
*
|
|
180
|
+
* @param options - The command seam, the deployment and the project.
|
|
181
|
+
* @returns the ports, or why they could not be read.
|
|
182
|
+
* @stability experimental
|
|
183
|
+
*/
|
|
184
|
+
export async function readStackPorts(options) {
|
|
185
|
+
const cwd = composeCwd(options.deployRoot);
|
|
186
|
+
const argv = composeArgv(['config', '--format', 'json'], options.project, options.groups, cwd);
|
|
187
|
+
let stdout;
|
|
188
|
+
try {
|
|
189
|
+
({ stdout } = await options.run(argv, { cwd, timeoutMs: CONFIG_TIMEOUT_MS }));
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
const message = failureText(error);
|
|
193
|
+
return DOCKER_UNREACHABLE.test(message)
|
|
194
|
+
? { status: 'docker-unreachable', message }
|
|
195
|
+
: { status: 'render-failed', message };
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
return { status: 'ok', ports: parseComposePorts(stdout) };
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
return { status: 'render-failed', message: error instanceof Error ? error.message : String(error) };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=compose-ports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-ports.js","sourceRoot":"","sources":["../../../src/engine/deploy/compose-ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG/D,gFAAgF;AAChF,6DAA6D;AAC7D,gFAAgF;AAChF,EAAE;AACF,4EAA4E;AAC5E,iFAAiF;AACjF,+EAA+E;AAC/E,gFAAgF;AAChF,iFAAiF;AACjF,+EAA+E;AAC/E,kFAAkF;AAClF,2EAA2E;AAC3E,kFAAkF;AAClF,EAAE;AACF,0EAA0E;AAC1E,kFAAkF;AAClF,4EAA4E;AAC5E,iFAAiF;AACjF,4EAA4E;AAC5E,EAAE;AACF,gFAAgF;AAChF,0EAA0E;AAC1E,gFAAgF;AAEhF,2GAA2G;AAC3G,MAAM,eAAe,GAAG,IAAI,CAAC;AAE7B,4FAA4F;AAC5F,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAkBjC,+FAA+F;AAC/F,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,OAAO,GAAG,EAA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AC,IAAI,CAAC,OAAO,CAAC;YACrC,CAAC,CAAC,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE;YAC3C,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC;IAC3C,CAAC;IAED,IAAI,CAAC;QACH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACtG,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComposeProjectCommandRunner } from './compose-containers.js';
|
|
2
2
|
import { type DeployState } from './state.js';
|
|
3
|
-
export { isPathUnder, type ComposeContainer, type ComposeProjectCommandRunner } from './compose-containers.js';
|
|
3
|
+
export { isPathUnder, type ComposeContainer, type ComposePortBinding, type ComposeProjectCommandRunner } from './compose-containers.js';
|
|
4
4
|
/**
|
|
5
5
|
* The evidence that decided which project a deployment folder runs under,
|
|
6
6
|
* strongest first. Lets a message say WHY a project was picked.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-project.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/compose-project.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,2BAA2B,EACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAA+B,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"compose-project.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/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G;IAC3G,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,6BAA6B,CAAC,CAkExC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-project.js","sourceRoot":"","sources":["../../../src/engine/deploy/compose-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,aAAa,GAGd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAoB,MAAM,YAAY,CAAC;AAE3E,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"compose-project.js","sourceRoot":"","sources":["../../../src/engine/deploy/compose-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,aAAa,GAGd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAoB,MAAM,YAAY,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAoF,MAAM,yBAAyB,CAAC;AA4ExI,wDAAwD;AACxD,SAAS,UAAU,CAAC,UAAuC;IACzD,OAAO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CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,KAAK,EAAE,UAAU;gBACjB,OAAO,EACL,0BAA0B,IAAI,8BAA8B,SAAS,CAAC,OAAO,gCAAgC;oBAC7G,mCAAmC,IAAI,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aACvG,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { composeArgv, composeCwd } from './compose-command.js';
|
|
1
2
|
import type { EnvGroup } from './env-metadata.js';
|
|
2
3
|
import { runCommand as defaultRunCommand } from './executor.js';
|
|
3
4
|
import { type ConsentOptions, type ConsentOutcome } from './consent.js';
|
|
@@ -125,7 +126,7 @@ interface InstallContext extends StepContext {
|
|
|
125
126
|
/** The privileged login `--allow-superuser` kept (#980), for the state to record. */
|
|
126
127
|
superuserKept?: string | undefined;
|
|
127
128
|
}
|
|
128
|
-
export
|
|
129
|
+
export { composeArgv, composeCwd };
|
|
129
130
|
/**
|
|
130
131
|
* The compose project name for a deployment.
|
|
131
132
|
*
|
|
@@ -151,14 +152,6 @@ export declare const LEGACY_COMPOSE_PROJECT = "compose";
|
|
|
151
152
|
export declare function composeProjectFor(state: {
|
|
152
153
|
composeProject?: string | undefined;
|
|
153
154
|
} | undefined): string;
|
|
154
|
-
/**
|
|
155
|
-
* The full `docker compose` argv for this deployment.
|
|
156
|
-
*
|
|
157
|
-
* `groups` are the deployment's groups -- this run's flag, else what install
|
|
158
|
-
* recorded -- and decide which compose files take part; see compose-files.ts.
|
|
159
|
-
* The always-on telemetry files are included whatever is passed (#567).
|
|
160
|
-
*/
|
|
161
|
-
export declare function composeArgv(extra: readonly string[], project?: string, groups?: readonly string[] | undefined, composeDir?: string): string[];
|
|
162
155
|
/** Secrets for the journal's redactor, from the metadata rather than a guess. */
|
|
163
156
|
export declare function secretsFrom(env: ReadonlyMap<string, string>): SecretEntry[];
|
|
164
157
|
/**
|
|
@@ -229,5 +222,4 @@ export interface InstallResult {
|
|
|
229
222
|
export declare function runInstall(requested: InstallOptions): Promise<InstallResult>;
|
|
230
223
|
/** Slug used for the default deploy root, from the repository name. */
|
|
231
224
|
export declare function defaultRootFor(repoUrl: string, base: string): string;
|
|
232
|
-
export {};
|
|
233
225
|
//# sourceMappingURL=install.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/install.ts"],"names":[],"mappings":"
|
|
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,EACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAA4C,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAUxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAe,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAmE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