|
|
@ -8,31 +8,36 @@ var upperCase = require('upper-case');
|
|
|
|
var logger = require('./controllers/logger');
|
|
|
|
var logger = require('./controllers/logger');
|
|
|
|
var connect = {};
|
|
|
|
var connect = {};
|
|
|
|
|
|
|
|
|
|
|
|
var defaultConfig = {
|
|
|
|
const setDefaultConfig = () => {
|
|
|
|
Authentication: {
|
|
|
|
var macaroonPath = '';
|
|
|
|
macaroonPath: '',
|
|
|
|
var lndConfigPath = '';
|
|
|
|
nodeAuthType: 'DEFAULT',
|
|
|
|
var bitcoindConfigPath = '';
|
|
|
|
lndConfigPath: '',
|
|
|
|
return {
|
|
|
|
rtlPass: ''
|
|
|
|
Authentication: {
|
|
|
|
},
|
|
|
|
macaroonPath: macaroonPath,
|
|
|
|
Settings: {
|
|
|
|
nodeAuthType: 'DEFAULT',
|
|
|
|
flgSidenavOpened: true,
|
|
|
|
lndConfigPath: lndConfigPath,
|
|
|
|
flgSidenavPinned: true,
|
|
|
|
rtlPass: ''
|
|
|
|
menu: 'Vertical',
|
|
|
|
},
|
|
|
|
menuType: 'Regular',
|
|
|
|
Settings: {
|
|
|
|
theme: 'dark-blue',
|
|
|
|
flgSidenavOpened: true,
|
|
|
|
satsToBTC: false,
|
|
|
|
flgSidenavPinned: true,
|
|
|
|
lndServerUrl: 'https://localhost:8080/v1',
|
|
|
|
menu: 'Vertical',
|
|
|
|
bitcoindConfigPath: '',
|
|
|
|
menuType: 'Regular',
|
|
|
|
enableLogging: false,
|
|
|
|
theme: 'dark-blue',
|
|
|
|
port: 3000
|
|
|
|
satsToBTC: false,
|
|
|
|
},
|
|
|
|
lndServerUrl: 'https://localhost:8080/v1',
|
|
|
|
SSO: {
|
|
|
|
bitcoindConfigPath: bitcoindConfigPath,
|
|
|
|
rtlSSO: 0,
|
|
|
|
enableLogging: false,
|
|
|
|
rtlCookiePath: '',
|
|
|
|
port: 3000
|
|
|
|
logoutRedirectLink: '/login'
|
|
|
|
},
|
|
|
|
}
|
|
|
|
SSO: {
|
|
|
|
};
|
|
|
|
rtlSSO: 0,
|
|
|
|
|
|
|
|
rtlCookiePath: '',
|
|
|
|
|
|
|
|
logoutRedirectLink: '/login'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const normalizePort = val => {
|
|
|
|
const normalizePort = val => {
|
|
|
|
var port = parseInt(val, 10);
|
|
|
|
var port = parseInt(val, 10);
|
|
|
@ -253,7 +258,7 @@ connect.configFileExists = () => {
|
|
|
|
logEnvVariables();
|
|
|
|
logEnvVariables();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
fs.writeFileSync(RTLConfFile, ini.stringify(defaultConfig));
|
|
|
|
fs.writeFileSync(RTLConfFile, ini.stringify(setDefaultConfig()));
|
|
|
|
var config = ini.parse(fs.readFileSync(RTLConfFile, 'utf-8'));
|
|
|
|
var config = ini.parse(fs.readFileSync(RTLConfFile, 'utf-8'));
|
|
|
|
setMacaroonPath(clArgs, config)
|
|
|
|
setMacaroonPath(clArgs, config)
|
|
|
|
validateConfigFile(config);
|
|
|
|
validateConfigFile(config);
|
|
|
|