-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align and specify NPM module versions (#5685)
The Dockerfile specifies NPM modules to be installed. However, some do not specify a version, so the latest is installed. Later in meshcentral.js mainStart() specific versions are required. If they don't match the latest version, all modules will be reinstalled to get the specific versions. #5684 Soft version conflict on NPM modules causes NPM modules to be installed on startup in Docker #5545 Docker on Debian 11 fails on version 1.1.15 and 1.1.16 giving NPM errors #5681 InstallModules() installs all modules, not just missing modules (regression)
- Loading branch information
1 parent
a57ab97
commit 64bef74
Showing
4 changed files
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,8 +86,9 @@ COPY ./docker/config.json.template /opt/meshcentral/config.json.template | |
# install dependencies from package.json and nedb | ||
RUN cd meshcentral && npm install && npm install nedb | ||
|
||
RUN if ! [ -z "$INCLUDE_MONGODBTOOLS" ]; then cd meshcentral && npm install [email protected]; fi | ||
RUN if ! [ -z "$PREINSTALL_LIBS" ] && [ "$PREINSTALL_LIBS" == "true" ]; then cd meshcentral && npm install ssh2 saslprep semver nodemailer image-size [email protected] [email protected] yubikeyotp; fi | ||
# NOTE: ALL MODULES MUST HAVE A VERSION NUMBER AND THE VERSION MUST MATCH THAT USED IN meshcentral.js mainStart() | ||
RUN if ! [ -z "$INCLUDE_MONGODBTOOLS" ]; then cd meshcentral && npm install [email protected] [email protected]; fi | ||
RUN if ! [ -z "$PREINSTALL_LIBS" ] && [ "$PREINSTALL_LIBS" == "true" ]; then cd meshcentral && npm install [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]; fi | ||
|
||
EXPOSE 80 443 4433 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3877,7 +3877,7 @@ function InstallModuleEx(modulenames, args, func) { | |
|
||
if (args.debug) { console.log('NPM Command Line: ' + npmpath + ` install --no-audit --no-package-lock --omit=optional --no-save --no-fund ${names}`); } | ||
|
||
child_process.exec(npmpath + ` install --no-audit --no-package-lock --no-optional --omit=optional --no-save ${names}`, { maxBuffer: 512000, timeout: 120000, cwd: parentpath }, function (error, stdout, stderr) { | ||
child_process.exec(npmpath + ` install --no-audit --no-package-lock --no-optional --omit=optional --no-save ${names}`, { maxBuffer: 512000, timeout: 300000, cwd: parentpath }, function (error, stdout, stderr) { | ||
if ((error != null) && (error != '')) { | ||
var mcpath = __dirname; | ||
if (mcpath.endsWith('\\node_modules\\meshcentral') || mcpath.endsWith('/node_modules/meshcentral')) { mcpath = require('path').join(mcpath, '..', '..'); } | ||
|
@@ -4016,10 +4016,11 @@ function mainStart() { | |
} | ||
|
||
// Build the list of required modules | ||
// NOTE: ALL MODULES MUST HAVE A VERSION NUMBER AND THE VERSION MUST MATCH THAT USED IN Dockerfile | ||
var modules = ['[email protected]','[email protected]','[email protected]','[email protected]','[email protected]','[email protected]','[email protected]','[email protected]','[email protected]','[email protected]','[email protected]','@yetzt/nedb','[email protected]','[email protected]','[email protected]','[email protected]']; | ||
if (require('os').platform() == 'win32') { modules.push('[email protected]'); modules.push('[email protected]'); if (sspi == true) { modules.push('[email protected]'); } } // Add Windows modules | ||
if (ldap == true) { modules.push('[email protected]'); } | ||
if (ssh == true) { modules.push('ssh2@1.14.0'); } | ||
if (ssh == true) { modules.push('ssh2@1.15.0'); } | ||
if (passport != null) { modules.push(...passport); } | ||
if (captcha == true) { modules.push('[email protected]'); } | ||
|
||
|
@@ -4037,7 +4038,7 @@ function mainStart() { | |
if (config.settings.plugins != null) { modules.push('[email protected]'); } // Required for version compat testing and update checks | ||
if ((config.settings.plugins != null) && (config.settings.plugins.proxy != null)) { modules.push('[email protected]'); } // Required for HTTP/HTTPS proxy support | ||
else if (config.settings.xmongodb != null) { modules.push('[email protected]'); } // Add MongoJS, old driver. | ||
if (nodemailer || ((config.smtp != null) && (config.smtp.name != 'console')) || (config.sendmail != null)) { modules.push('[email protected].6'); } // Add SMTP support | ||
if (nodemailer || ((config.smtp != null) && (config.smtp.name != 'console')) || (config.sendmail != null)) { modules.push('[email protected].8'); } // Add SMTP support | ||
if (sendgrid || (config.sendgrid != null)) { modules.push('@sendgrid/mail'); } // Add SendGrid support | ||
if ((args.translate || args.dev) && (Number(process.version.match(/^v(\d+\.\d+)/)[1]) >= 16)) { modules.push('[email protected]'); modules.push('[email protected]'); modules.push('[email protected]'); modules.push('[email protected]'); } // Translation support | ||
if (typeof config.settings.crowdsec == 'object') { modules.push('@crowdsec/[email protected]'); } // Add CrowdSec bounser module (https://www.npmjs.com/package/@crowdsec/express-bouncer) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters