@florianpat/lando-core 3.23.3-compose → 3.23.22-test1
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 +117 -1
- package/_redirects +1 -0
- package/bin/lando +2 -0
- package/bin/lando.cmd +3 -0
- package/builders/_lando.js +2 -1
- package/checksums.txt +0 -0
- package/components/l337-v4.js +2 -2
- package/components/plugin.js +1 -1
- package/config.yml +3 -2
- package/hooks/app-run-events.js +22 -0
- package/hooks/lando-autostart-engine.js +4 -25
- package/hooks/lando-run-setup.js +58 -0
- package/hooks/lando-setup-build-engine-darwin.js +13 -12
- package/hooks/lando-setup-build-engine-linux.js +14 -4
- package/hooks/lando-setup-build-engine-win32.js +27 -20
- package/hooks/lando-setup-build-engine-wsl.js +210 -0
- package/hooks/lando-setup-check.js +19 -0
- package/hooks/lando-setup-create-ca-wsl.js +34 -0
- package/hooks/lando-setup-create-ca.js +22 -23
- package/hooks/lando-setup-install-ca-darwin.js +5 -1
- package/hooks/lando-setup-install-ca-linux.js +4 -1
- package/hooks/lando-setup-install-ca-win32.js +5 -1
- package/hooks/lando-setup-install-ca-wsl.js +145 -0
- package/hooks/lando-setup-orchestrator.js +4 -4
- package/index.js +18 -12
- package/lib/app.js +2 -2
- package/lib/art.js +20 -8
- package/lib/compose.js +0 -3
- package/lib/daemon.js +79 -76
- package/lib/docker.js +2 -2
- package/lib/engine.js +10 -3
- package/lib/lando.js +2 -2
- package/lib/metrics.js +5 -3
- package/lib/router.js +1 -1
- package/lib/updates.js +18 -3
- package/netlify.toml +1 -6
- package/node_modules/cross-spawn/README.md +3 -10
- package/node_modules/cross-spawn/lib/enoent.js +1 -1
- package/node_modules/cross-spawn/lib/util/escape.js +4 -2
- package/node_modules/cross-spawn/package.json +1 -1
- package/node_modules/nanoid/.devcontainer.json +23 -0
- package/node_modules/nanoid/README.md +517 -2
- package/node_modules/nanoid/async/index.browser.cjs +37 -2
- package/node_modules/nanoid/async/index.browser.js +37 -2
- package/node_modules/nanoid/async/index.cjs +38 -2
- package/node_modules/nanoid/async/index.js +38 -2
- package/node_modules/nanoid/async/index.native.js +33 -2
- package/node_modules/nanoid/index.browser.cjs +39 -1
- package/node_modules/nanoid/index.browser.js +39 -1
- package/node_modules/nanoid/index.cjs +42 -2
- package/node_modules/nanoid/index.js +42 -2
- package/node_modules/nanoid/non-secure/index.cjs +15 -2
- package/node_modules/nanoid/non-secure/index.js +15 -2
- package/node_modules/nanoid/package.json +1 -1
- package/node_modules/nanoid/url-alphabet/index.cjs +4 -0
- package/node_modules/nanoid/url-alphabet/index.js +4 -0
- package/package.json +9 -8
- package/plugins/networking/app.js +4 -2
- package/plugins/networking/index.js +19 -6
- package/plugins/proxy/builders/_proxy.js +1 -2
- package/release-aliases/3-EDGE +1 -1
- package/release-aliases/3-STABLE +1 -1
- package/renderers/dc2.js +2 -1
- package/scripts/add-to-group.sh +72 -0
- package/scripts/docker-engine-start.sh +15 -1
- package/scripts/generate-checksums.sh +2 -2
- package/scripts/install-docker-desktop.ps1 +11 -12
- package/scripts/install-system-ca-win32.ps1 +14 -14
- package/scripts/lando-entrypoint.sh +4 -0
- package/scripts/run-elevated.ps1 +2 -2
- package/scripts/semcompare.sh +142 -0
- package/scripts/wait-for-user.sh +1 -2
- package/tasks/destroy.js +3 -0
- package/tasks/info.js +2 -1
- package/tasks/init.js +35 -30
- package/tasks/rebuild.js +2 -8
- package/tasks/restart.js +2 -8
- package/tasks/setup.js +2 -2
- package/tasks/shellenv.js +2 -2
- package/tasks/start.js +2 -8
- package/tasks/stop.js +3 -0
- package/utils/build-config.js +2 -0
- package/utils/build-tooling-runner.js +2 -1
- package/utils/get-app.js +1 -1
- package/utils/get-bin-paths.js +2 -2
- package/utils/get-compose-x.js +1 -1
- package/utils/get-config-defaults.js +12 -7
- package/utils/get-docker-bin-path.js +6 -2
- package/utils/get-docker-desktop-x.js +21 -0
- package/utils/get-docker-x.js +3 -2
- package/utils/get-shellenv.js +1 -2
- package/utils/get-system-cas.js +25 -6
- package/utils/get-win32-envvar-from-wsl.js +7 -0
- package/utils/is-admin-user.js +9 -8
- package/utils/is-group-member.js +14 -7
- package/utils/is-wsl-interop.js +17 -4
- package/utils/run-elevated.js +9 -0
- package/utils/run-powershell-script.js +31 -5
- package/utils/run-tasks.js +3 -2
- package/utils/setup-metrics.js +10 -1
- package/utils/shutdown-os.js +8 -3
- package/utils/spawn-sync-stringer.js +1 -0
- package/utils/update-shell-profile.js +8 -7
- package/utils/validate-ca.js +31 -0
- package/utils/winpath-2-wslpath.js +6 -0
- package/utils/wslpath-2-winpath.js +6 -0
- package/hooks/lando-dep-check.js +0 -26
package/utils/run-tasks.js
CHANGED
|
@@ -35,8 +35,9 @@ module.exports = async (tasks, {
|
|
|
35
35
|
fallbackRendererOptions = rendererOptions;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
//
|
|
39
|
-
if (process?.env?.TERM === 'dumb') renderer = '
|
|
38
|
+
// some sitautions just need the bare minimum
|
|
39
|
+
if (process?.env?.TERM === 'dumb') renderer = 'simple';
|
|
40
|
+
if (process?.env?.CI && !require('is-interactive')()) renderer = 'simple';
|
|
40
41
|
|
|
41
42
|
const defaults = {
|
|
42
43
|
ctx: {data: {}, errors: [], results: [], skipped: 0, ran: 0, total: 0},
|
package/utils/setup-metrics.js
CHANGED
|
@@ -18,10 +18,19 @@ const getMetricsContext = () => {
|
|
|
18
18
|
module.exports = (log, config) => {
|
|
19
19
|
const Metrics = require('./../lib/metrics');
|
|
20
20
|
const command = _.get(config, 'command._', 'unknown');
|
|
21
|
+
|
|
22
|
+
// group by endpoints and resolve multiples
|
|
23
|
+
const endpoints = _(_.groupBy(config.stats, 'url'))
|
|
24
|
+
.map((data, url) => ({
|
|
25
|
+
url,
|
|
26
|
+
report: data.map(data => data.report).every(report => report === true),
|
|
27
|
+
}))
|
|
28
|
+
.value();
|
|
29
|
+
|
|
21
30
|
return new Metrics({
|
|
22
31
|
log,
|
|
23
32
|
id: config.id,
|
|
24
|
-
endpoints
|
|
33
|
+
endpoints,
|
|
25
34
|
data: {
|
|
26
35
|
command: `lando ${command}`,
|
|
27
36
|
context: getMetricsContext(),
|
package/utils/shutdown-os.js
CHANGED
|
@@ -6,11 +6,12 @@ module.exports = ({
|
|
|
6
6
|
message = 'Lando wants to restart your computer',
|
|
7
7
|
password = undefined,
|
|
8
8
|
type = 'restart',
|
|
9
|
-
wait = process.platform === 'win32' ? 5 : 'now',
|
|
9
|
+
wait = process.landoPlatform === 'win32' || process.platform === 'win32' ? 5 : 'now',
|
|
10
|
+
platform = process.landoPlatform ?? process.platform,
|
|
10
11
|
} = {}) => {
|
|
11
12
|
debug('shutdown with %o %o', type, {message, wait});
|
|
12
13
|
|
|
13
|
-
switch (
|
|
14
|
+
switch (platform) {
|
|
14
15
|
case 'darwin':
|
|
15
16
|
args.push('shutdown');
|
|
16
17
|
// handle the restart type
|
|
@@ -48,6 +49,10 @@ module.exports = ({
|
|
|
48
49
|
args.push('/c');
|
|
49
50
|
args.push(message);
|
|
50
51
|
|
|
51
|
-
return require('./run-command')('shutdown', args, {debug});
|
|
52
|
+
return require('./run-command')('shutdown.exe', args, {debug});
|
|
53
|
+
case 'wsl':
|
|
54
|
+
args.push('-Command');
|
|
55
|
+
args.push(`wsl --terminate ${process.env.WSL_DISTRO_NAME}`);
|
|
56
|
+
return require('./run-command')('powershell.exe', args, {debug});
|
|
52
57
|
}
|
|
53
58
|
};
|
|
@@ -6,6 +6,12 @@ const os = require('os');
|
|
|
6
6
|
const read = require('./read-file');
|
|
7
7
|
const write = require('./write-file');
|
|
8
8
|
|
|
9
|
+
const trim = (data = []) => {
|
|
10
|
+
while (data.length > 0 && data[data.length - 1] === '') data.pop();
|
|
11
|
+
data.push('');
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
9
15
|
module.exports = (file, updates = []) => {
|
|
10
16
|
// create empty file if it doesnt exist first
|
|
11
17
|
if (!fs.existsSync(file)) {
|
|
@@ -17,9 +23,7 @@ module.exports = (file, updates = []) => {
|
|
|
17
23
|
// get the content
|
|
18
24
|
const content = read(file);
|
|
19
25
|
// split into lines
|
|
20
|
-
const lines = content.split('\n');
|
|
21
|
-
// if we end up with second to last line that is empty then pop
|
|
22
|
-
if (lines[lines.length - 2].trim() === '') lines.pop();
|
|
26
|
+
const lines = trim(content.split('\n'));
|
|
23
27
|
|
|
24
28
|
// loops through the updates and add/update as needed
|
|
25
29
|
for (const [update, search] of updates) {
|
|
@@ -31,11 +35,8 @@ module.exports = (file, updates = []) => {
|
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
// if the last element doesnt contain a newline
|
|
35
|
-
if (!lines[lines.length - 1].includes(os.EOL)) lines.push(os.EOL);
|
|
36
|
-
|
|
37
38
|
// Write the modified content back to the file
|
|
38
|
-
write(file, lines.join(os.EOL));
|
|
39
|
+
write(file, `${trim(lines).join(os.EOL)}${os.EOL}`);
|
|
39
40
|
|
|
40
41
|
// handle errors
|
|
41
42
|
} catch (error) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const forge = require('node-forge');
|
|
4
|
+
const read = require('./read-file');
|
|
5
|
+
|
|
6
|
+
module.exports = (cert, key, {
|
|
7
|
+
debug = require('debug')('@lando/validate-script'),
|
|
8
|
+
} = {}) => {
|
|
9
|
+
try {
|
|
10
|
+
cert = forge.pki.certificateFromPem(read(cert));
|
|
11
|
+
key = forge.pki.privateKeyFromPem(read(key));
|
|
12
|
+
|
|
13
|
+
// verify the signature using the public key in the CA certificate
|
|
14
|
+
const md = forge.md.sha256.create();
|
|
15
|
+
md.update('taanab', 'utf8');
|
|
16
|
+
const signature = key.sign(md);
|
|
17
|
+
|
|
18
|
+
// if they dont match then throw
|
|
19
|
+
if (!cert.publicKey.verify(md.digest().bytes(), signature)) {
|
|
20
|
+
debug('CA and its private key do not match');
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// otherwise we are good
|
|
25
|
+
return true;
|
|
26
|
+
} catch (error) {
|
|
27
|
+
debug('something is wrong with the CA %o', error.message);
|
|
28
|
+
debug('%o', error);
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
};
|
package/hooks/lando-dep-check.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = async lando => {
|
|
4
|
-
// only run if engine bootstrap or above and if engine/orchestrator have been installed
|
|
5
|
-
if (lando._bootstrapLevel >= 3) {
|
|
6
|
-
lando.log.verbose('build-engine exists: %s', lando.engine.dockerInstalled);
|
|
7
|
-
lando.log.verbose('orchestrator exists: %s', lando.engine.composeInstalled);
|
|
8
|
-
|
|
9
|
-
// BUILD ENGINE
|
|
10
|
-
if (lando.engine.dockerInstalled === false) {
|
|
11
|
-
if (lando.cli) {
|
|
12
|
-
const dep = process.platform === 'linux' ? 'DOCKER ENGINE' : 'DOCKER DESKTOP';
|
|
13
|
-
console.error(lando.cli.makeArt('noDockerDep', dep));
|
|
14
|
-
process.exit(1);
|
|
15
|
-
} else throw Error('docker could not be located!');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// ORCHESTRATOR
|
|
19
|
-
if (lando.engine.composeInstalled === false) {
|
|
20
|
-
if (lando.cli) {
|
|
21
|
-
console.error(lando.cli.makeArt('noDockerDep', 'DOCKER COMPOSE'));
|
|
22
|
-
process.exit(1);
|
|
23
|
-
} else throw Error('docker-compose could not be located!');
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|