1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #2951 from node-red/fix-flowfile-name-in-settings

fix flowfile name to flows.json in settings
This commit is contained in:
Nick O'Leary 2021-04-23 16:27:45 +01:00 committed by GitHub
commit be2e64433f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 8 deletions

View File

@ -38,6 +38,8 @@ var activeProject;
var globalGitUser = false; var globalGitUser = false;
var usingHostName = false;
function init(_settings, _runtime) { function init(_settings, _runtime) {
settings = _settings; settings = _settings;
runtime = _runtime; runtime = _runtime;
@ -77,6 +79,7 @@ function init(_settings, _runtime) {
} else { } else {
flowsFile = 'flows_'+require('os').hostname()+'.json'; flowsFile = 'flows_'+require('os').hostname()+'.json';
flowsFullPath = fspath.join(settings.userDir,flowsFile); flowsFullPath = fspath.join(settings.userDir,flowsFile);
usingHostName = true;
} }
var ffExt = fspath.extname(flowsFullPath); var ffExt = fspath.extname(flowsFullPath);
var ffBase = fspath.basename(flowsFullPath,ffExt); var ffBase = fspath.basename(flowsFullPath,ffExt);
@ -541,6 +544,7 @@ async function getFlows() {
} else { } else {
projectLogMessages.forEach(log.warn); projectLogMessages.forEach(log.warn);
} }
if (usingHostName) { log.warn(log._("storage.localfilesystem.warn_name")) };
log.info(log._("storage.localfilesystem.flows-file",{path:flowsFullPath})); log.info(log._("storage.localfilesystem.flows-file",{path:flowsFullPath}));
} }
} }

View File

@ -159,6 +159,7 @@
"restore": "Restoring __type__ file backup : __path__", "restore": "Restoring __type__ file backup : __path__",
"restore-fail": "Restoring __type__ file backup failed : __message__", "restore-fail": "Restoring __type__ file backup failed : __message__",
"fsync-fail": "Flushing file __path__ to disk failed : __message__", "fsync-fail": "Flushing file __path__ to disk failed : __message__",
"warn_name": "Flows file name not set. Generating name using hostname.",
"projects": { "projects": {
"changing-project": "Setting active project : __project__", "changing-project": "Setting active project : __project__",
"active-project": "Active project : __project__", "active-project": "Active project : __project__",

View File

@ -12,6 +12,13 @@
**/ **/
module.exports = { module.exports = {
// The file containing the flows. If not set, it defaults to flows_<hostname>.json
flowFile: 'flows.json',
// To enabled pretty-printing of the flow within the flow file, set the following
// property to true:
//flowFilePretty: true,
// the tcp port that the Node-RED web server is listening on // the tcp port that the Node-RED web server is listening on
uiPort: process.env.PORT || 1880, uiPort: process.env.PORT || 1880,
@ -61,13 +68,6 @@ module.exports = {
// Colourise the console output of the debug node // Colourise the console output of the debug node
//debugUseColors: true, //debugUseColors: true,
// The file containing the flows. If not set, it defaults to flows_<hostname>.json
//flowFile: 'flows.json',
// To enabled pretty-printing of the flow within the flow file, set the following
// property to true:
//flowFilePretty: true,
// By default, credentials are encrypted in storage using a generated key. To // By default, credentials are encrypted in storage using a generated key. To
// specify your own secret, set the following property. // specify your own secret, set the following property.
// If you want to disable encryption of credentials, set this property to false. // If you want to disable encryption of credentials, set this property to false.