diff --git a/src/config/constants.js b/src/config/constants.js new file mode 100644 index 000000000..21dc6e958 --- /dev/null +++ b/src/config/constants.js @@ -0,0 +1,33 @@ +/* + * ******************************************************************************* + * * Copyright (c) 2019 Edgeworx, Inc. + * * + * * This program and the accompanying materials are made available under the + * * terms of the Eclipse Public License v. 2.0 which is available at + * * http://www.eclipse.org/legal/epl-2.0 + * * + * * SPDX-License-Identifier: EPL-2.0 + * ******************************************************************************* + * + */ + +module.exports = { + 'App:Name': 'iofog-controller', + + 'Server:Port': 54421, + 'Server:DevMode': false, + + 'Email:ActivationEnabled': false, + 'Email:HomeUrl': 'https://iofog.org', + + 'Service:LogsDirectory': '/var/log/iofog-controller', + 'Service:LogsFileSize': 1048576, + + 'Settings:DefaultJobIntervalSeconds': 120, + 'Settings:UserTokenExpirationIntervalSeconds': 3600, + 'Settings:FogTokenExpirationIntervalSeconds': 3600, + 'Settings:FogStatusUpdateIntervalSeconds': 120, + 'Settings:FogStatusFrequencySeconds': 60, + + 'Diagnostics:DiagnosticDir': 'diagnostic', +} \ No newline at end of file diff --git a/src/config/index.js b/src/config/index.js index 8b10ec58d..bc5897449 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -13,6 +13,7 @@ const nconf = require('nconf') const path = require('path') +const constants = require('./constants'); class Config { constructor() { @@ -22,7 +23,7 @@ class Config { } get(key) { - return nconf.get(key) + return nconf.get(key) || constants[key] } set(key, value) {