Skip to content

Commit

Permalink
fix: update vulnerable dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Jun 4, 2024
1 parent 1b25a3b commit 46e29af
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
"glob": "^7.1.3",
"inquirer": "^6.2.1",
"inquirer-autocomplete-prompt": "^1.0.1",
"ip": "^1.1.9",
"js-yaml": "^4.1.0",
"jsonfile": "^6.1.0",
"lodash": "^4.17.21",
Expand Down
28 changes: 24 additions & 4 deletions plugins/lando-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

// Modules
const _ = require('lodash');
const ip = require('ip');
const fs = require('fs');
const path = require('path');
const fs = require('node:fs');
const path = require('node:path');
const {networkInterfaces} = require('node:os');

// Default env values
const defaults = {
Expand Down Expand Up @@ -38,6 +38,26 @@ const uc = (uid, gid, username) => ({
},
});

/**
* Emulates the behavior of `ip.address()`: returns the first address with `ipv4` or loopback address `127.0.0.1`.
*
* @return {string}
*/
const hostIp = () => {
const interfaces = networkInterfaces();
const names = Object.keys(interfaces);

for (const name of names) {
for (const {address, family, internal} of interfaces[name]) {
if (family === 'IPv4' && !internal) {
return address;
}
}
}

return '127.0.0.1';
};

/*
* Helper to get ca run object
*/
Expand Down Expand Up @@ -100,7 +120,7 @@ module.exports = lando => {
LANDO_DOMAIN: lando.config.domain,
LANDO_HOST_HOME: lando.config.home,
LANDO_HOST_OS: lando.config.os.platform,
LANDO_HOST_IP: (process.platform === 'linux') ? ip.address() : 'host.docker.internal',
LANDO_HOST_IP: (process.platform === 'linux') ? hostIp() : 'host.docker.internal',
LANDO_LEIA: _.toInteger(lando.config.leia),
LANDO_MOUNT: '/app',
},
Expand Down
19 changes: 6 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1796,11 +1796,6 @@ invert-kv@^2.0.0:
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==

ip@^1.1.9:
version "1.1.9"
resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.9.tgz#8dfbcc99a754d07f425310b86a99546b1151e396"
integrity sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==

is-binary-path@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
Expand Down Expand Up @@ -2918,11 +2913,9 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1:
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.3.2:
version "7.3.7"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
dependencies:
lru-cache "^6.0.0"
version "7.6.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13"
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==

semver@^7.3.5, semver@^7.5.3:
version "7.5.4"
Expand Down Expand Up @@ -3236,9 +3229,9 @@ tar-stream@^2.0.0, tar-stream@^2.1.4:
readable-stream "^3.1.1"

tar@^6.1.11:
version "6.2.0"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.0.tgz#b14ce49a79cb1cd23bc9b016302dea5474493f73"
integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==
version "6.2.1"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
dependencies:
chownr "^2.0.0"
fs-minipass "^2.0.0"
Expand Down

0 comments on commit 46e29af

Please sign in to comment.