Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty import config #7647

Merged
merged 3 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions lib/server/bootevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function boot (env, language) {

//////////////////////////////////////////////////
// Check Node version.
// Latest Node LTS releases are recommended and supported.
// Latest Node LTS releases are recommended and supported.
// Current Node releases MAY work, but are not recommended. Will be tested in CI
// Older Node versions or Node versions with known security issues will not work.
///////////////////////////////////////////////////
Expand All @@ -35,7 +35,7 @@ function boot (env, language) {
var nodeVersion = process.version;

const isLTS = process.release.lts ? true : false;

if (isLTS && (semver.satisfies(nodeVersion, '^16.0.0') || semver.satisfies(nodeVersion, '^14.0.0'))) {
//Latest Node 14 LTS and Node 16 LTS are recommended and supported.
//Require at least Node 14 without known security issues
Expand Down Expand Up @@ -72,11 +72,15 @@ function boot (env, language) {
var configURL = env.IMPORT_CONFIG || null;
var url = require('url');
var href = null;
try {
href = url.parse(configURL).href;
} catch (e) {
console.error('Parsing config URL from IMPORT_CONFIG failed');

if (configURL) {
try {
href = url.parse(configURL).href;
} catch (e) {
console.error('Parsing config URL from IMPORT_CONFIG failed');
}
}

if(configURL && href) {
var request = require('request');
console.log('Getting settings from', href);
Expand Down Expand Up @@ -267,7 +271,7 @@ function boot (env, language) {
function setupListeners (ctx, next) {

console.log('Executing setupListeners');

if (hasBootErrors(ctx)) {
return next();
}
Expand Down
4 changes: 4 additions & 0 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ module.exports = {
rules
},
resolve: {
fallback: {
'process/browser': require.resolve('process/browser'),
events: require.resolve('events/')
},
alias: {
stream: 'stream-browserify',
crypto: 'crypto-browserify',
Expand Down