Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jeff Vandrew Jr 2019-02-13 22:34:25 -05:00
commit 73a03c6f82
11 changed files with 82 additions and 62 deletions

View File

@ -425,28 +425,46 @@ THE SOFTWARE.
@angular/material/icon @angular/material/icon
angular2-qrcode angularx-qrcode
MIT MIT
The MIT License (MIT)
---------------------
Copyright (c) 2018 - present Andreas Jacob (Cordobo)
qrious Permission is hereby granted, free of charge, to any person obtaining a copy
GPL-3.0 of this software and associated documentation files (the "Software"), to deal
QRious in the Software without restriction, including without limitation the rights
Copyright (C) 2017 Alasdair Mercer to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Copyright (C) 2010 Tom Zerucha copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
This program is free software: you can redistribute it and/or modify The above copyright notice and this permission notice shall be included in
it under the terms of the GNU General Public License as published by all copies or substantial portions of the Software.
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
but WITHOUT ANY WARRANTY; without even the implied warranty of IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
GNU General Public License for more details. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
You should have received a copy of the GNU General Public License qrcodejs2
along with this program. If not, see <http://www.gnu.org/licenses/>. MIT
The MIT License (MIT)
---------------------
Copyright (c) 2012 davidshimjs
Permission is hereby granted, free of charge,
to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@angular/material/card @angular/material/card

View File

@ -8,5 +8,5 @@
<link rel="stylesheet" href="styles.5e0b52f71274005aea8e.css"></head> <link rel="stylesheet" href="styles.5e0b52f71274005aea8e.css"></head>
<body> <body>
<rtl-app></rtl-app> <rtl-app></rtl-app>
<script type="text/javascript" src="runtime.ec2944dd8b20ec099bf3.js"></script><script type="text/javascript" src="polyfills.418928a701f2040ada02.js"></script><script type="text/javascript" src="main.44b7bcda2d457ee3a6e9.js"></script></body> <script type="text/javascript" src="runtime.ec2944dd8b20ec099bf3.js"></script><script type="text/javascript" src="polyfills.418928a701f2040ada02.js"></script><script type="text/javascript" src="main.6a58ac00262ec13bea69.js"></script></body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,8 +3,8 @@ var clArgs = require('optimist').argv;
var ini = require('ini'); var ini = require('ini');
var common = require('./common'); var common = require('./common');
var path = require('path'); var path = require('path');
var crypto = require('crypto');
var upperCase = require('upper-case'); var upperCase = require('upper-case');
var logger = require('./controllers/logger');
var options = {}; var options = {};
var defaultConfig = { var defaultConfig = {
@ -186,12 +186,26 @@ var setOptions = () => {
}; };
} }
var logEnvVariables = () => {
if (!common.enable_logging) {
return;
}
logger.info('\r\nConfig Setup Variable PORT: ' + common.port);
logger.info('\r\nConfig Setup Variable LND_SERVER_URL: ' + common.lnd_server_url);
logger.info('\r\nConfig Setup Variable MACAROON_PATH: ' + common.macaroon_path);
logger.info('\r\nConfig Setup Variable NODE_AUTH_TYPE: ' + common.node_auth_type);
logger.info('\r\nConfig Setup Variable LND_CONFIG_PATH: ' + common.lnd_config_path);
logger.info('\r\nConfig Setup Variable RTL_CONFIG_PATH: ' + common.rtl_conf_file_path);
logger.info('\r\nConfig Setup Variable BITCOIND_CONFIG_PATH: ' + common.bitcoind_config_path);
logger.info('\r\nConfig Setup Variable RTL_SSO: ' + common.rtl_sso);
logger.info('\r\nConfig Setup Variable RTL_COOKIE_PATH: ' + common.rtl_cookie_path);
logger.info('\r\nConfig Setup Variable LOGOUT_REDIRECT_LINK: ' + common.logout_redirect_link);
}
var errMsg = ''; var errMsg = '';
var configFileExists = () => { var configFileExists = () => {
common.rtl_conf_file_path = (undefined !== process.env.RTL_CONFIG_PATH) ? process.env.RTL_CONFIG_PATH.substring(0, process.env.RTL_CONFIG_PATH.length - 9) : path.normalize(__dirname); common.rtl_conf_file_path = (undefined !== process.env.RTL_CONFIG_PATH) ? process.env.RTL_CONFIG_PATH.substring(0, process.env.RTL_CONFIG_PATH.length - 9) : path.normalize(__dirname);
RTLConfFile = common.rtl_conf_file_path + '/RTL.conf'; RTLConfFile = common.rtl_conf_file_path + '/RTL.conf';
console.log(common.rtl_conf_file_path);
console.log(RTLConfFile);
let exists = fs.existsSync(RTLConfFile); let exists = fs.existsSync(RTLConfFile);
if (exists) { if (exists) {
var config = ini.parse(fs.readFileSync(RTLConfFile, 'utf-8')); var config = ini.parse(fs.readFileSync(RTLConfFile, 'utf-8'));
@ -199,6 +213,7 @@ var configFileExists = () => {
validateConfigFile(config); validateConfigFile(config);
setOptions(); setOptions();
setSSOParams(); setSSOParams();
logEnvVariables();
} else { } else {
try { try {
fs.writeFileSync(RTLConfFile, ini.stringify(defaultConfig)); fs.writeFileSync(RTLConfFile, ini.stringify(defaultConfig));
@ -207,6 +222,7 @@ var configFileExists = () => {
validateConfigFile(config); validateConfigFile(config);
setOptions(); setOptions();
setSSOParams(); setSSOParams();
logEnvVariables();
} }
catch(err) { catch(err) {
console.error('Something went wrong, unable to create config file!\n' + err); console.error('Something went wrong, unable to create config file!\n' + err);

View File

@ -17,8 +17,8 @@ exports.authenticateUser = (req, res, next) => {
res.status(200).json({ token: token }); res.status(200).json({ token: token });
} else { } else {
res.status(401).json({ res.status(401).json({
message: "SSO Authentication Failed!", message: "Login Failure!",
error: "Please check app stack configurations!" error: "SSO Authentication Failed!"
}); });
} }
} else { } else {

View File

@ -5,6 +5,7 @@ var logger = require('./logger');
exports.getInfo = (req, res, next) => { exports.getInfo = (req, res, next) => {
options.url = common.lnd_server_url + '/getinfo'; options.url = common.lnd_server_url + '/getinfo';
logger.info('\r\nCalling getinfo from lnd server url: INFO: ' + options.url);
request(options).then((body) => { request(options).then((body) => {
logger.info('\r\nGetInfo: 9: ' + JSON.stringify(Date.now()) + ': INFO: ' + JSON.stringify(body)); logger.info('\r\nGetInfo: 9: ' + JSON.stringify(Date.now()) + ': INFO: ' + JSON.stringify(body));
const body_str = (undefined === body) ? '' : JSON.stringify(body); const body_str = (undefined === body) ? '' : JSON.stringify(body);

View File

@ -2,7 +2,9 @@ var fs = require('fs');
var common = require('../common'); var common = require('../common');
exports.info = (msgStr) => { exports.info = (msgStr) => {
console.log('Console: ' + msgStr); if (msgStr.indexOf('Config Setup Variable') === -1) {
console.log('Console: ' + msgStr);
}
if(common.enable_logging) { if(common.enable_logging) {
fs.appendFile(common.log_file, msgStr, function(err) { fs.appendFile(common.log_file, msgStr, function(err) {
if (err) { if (err) {

52
package-lock.json generated
View File

@ -1393,12 +1393,12 @@
"tslib": "^1.9.0" "tslib": "^1.9.0"
} }
}, },
"angular2-qrcode": { "angularx-qrcode": {
"version": "2.0.1", "version": "1.5.3",
"resolved": "https://registry.npmjs.org/angular2-qrcode/-/angular2-qrcode-2.0.1.tgz", "resolved": "https://registry.npmjs.org/angularx-qrcode/-/angularx-qrcode-1.5.3.tgz",
"integrity": "sha1-G05lwwJpS1B4ygb3ETj35DZ3VNw=", "integrity": "sha512-9WTsnOGNv3IvSriVSHOc7k6PIBcqqjivAQXhEF9SjDYgcio63zCkcsAC627vSaTqUoDkgE5MRoT4PO2UMROk2w==",
"requires": { "requires": {
"qrious": "^2.2.0" "qrcodejs2": "0.0.2"
} }
}, },
"ansi-colors": { "ansi-colors": {
@ -2318,15 +2318,6 @@
"integrity": "sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg==", "integrity": "sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg==",
"dev": true "dev": true
}, },
"canvas": {
"version": "1.6.13",
"resolved": "https://registry.npmjs.org/canvas/-/canvas-1.6.13.tgz",
"integrity": "sha512-XAfzfEOHZ3JIPjEV+WSI6PpISgUta3dgmndWbsajotz+0TQOX/jDpp2kawjRERatOGv9sMMzk5auB3GKEKA6hg==",
"optional": true,
"requires": {
"nan": "^2.10.0"
}
},
"caseless": { "caseless": {
"version": "0.12.0", "version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
@ -5183,10 +5174,9 @@
"dev": true "dev": true
}, },
"handlebars": { "handlebars": {
"version": "4.0.12", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz",
"integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==",
"dev": true,
"requires": { "requires": {
"async": "^2.5.0", "async": "^2.5.0",
"optimist": "^0.6.1", "optimist": "^0.6.1",
@ -5195,19 +5185,17 @@
}, },
"dependencies": { "dependencies": {
"async": { "async": {
"version": "2.6.1", "version": "2.6.2",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz",
"integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==",
"dev": true,
"requires": { "requires": {
"lodash": "^4.17.10" "lodash": "^4.17.11"
} }
}, },
"source-map": { "source-map": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
"dev": true
} }
} }
}, },
@ -8631,13 +8619,10 @@
"integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==",
"dev": true "dev": true
}, },
"qrious": { "qrcodejs2": {
"version": "2.3.0", "version": "0.0.2",
"resolved": "https://registry.npmjs.org/qrious/-/qrious-2.3.0.tgz", "resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
"integrity": "sha1-ynzmioIJmmepDkl59LHN9R7zJHU=", "integrity": "sha1-Rlr+Xjnxn6zsuTLBH3oYYQkUauE="
"requires": {
"canvas": "^1.6.5"
}
}, },
"qs": { "qs": {
"version": "6.5.2", "version": "6.5.2",
@ -10659,7 +10644,6 @@
"version": "3.4.9", "version": "3.4.9",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz",
"integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==",
"dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"commander": "~2.17.1", "commander": "~2.17.1",
@ -10670,14 +10654,12 @@
"version": "2.17.1", "version": "2.17.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
"dev": true,
"optional": true "optional": true
}, },
"source-map": { "source-map": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"optional": true "optional": true
} }
} }

View File

@ -32,7 +32,7 @@
"@ngrx/store-devtools": "^7.0.0", "@ngrx/store-devtools": "^7.0.0",
"@swimlane/ngx-charts": "^10.0.0", "@swimlane/ngx-charts": "^10.0.0",
"angular-user-idle": "^2.0.0", "angular-user-idle": "^2.0.0",
"angular2-qrcode": "^2.0.1", "angularx-qrcode": "^1.5.3",
"atob": "^2.1.2", "atob": "^2.1.2",
"core-js": "^2.5.4", "core-js": "^2.5.4",
"express": "^4.16.4", "express": "^4.16.4",

5
rtl.js
View File

@ -30,7 +30,7 @@ const onError = error => {
process.exit(1); process.exit(1);
break; break;
case "ECONNREFUSED": case "ECONNREFUSED":
console.error("LND Server is down/locked"); console.error("Server is down/locked");
default: default:
console.error("DEFUALT ERROR"); console.error("DEFUALT ERROR");
console.error(error.code); console.error(error.code);
@ -42,6 +42,7 @@ const onListening = () => {
const addr = server.address(); const addr = server.address();
const bind = typeof addr === "string" ? "pipe " + addr : "port " + port; const bind = typeof addr === "string" ? "pipe " + addr : "port " + port;
debug("Listening on " + bind); debug("Listening on " + bind);
console.log('Server is up and running, please open the UI at http://localhost:' + port);
}; };
const port = normalizePort(process.env.PORT || common.port); const port = normalizePort(process.env.PORT || common.port);
@ -50,4 +51,4 @@ const server = http.createServer(app);
server.on("error", onError); server.on("error", onError);
server.on("listening", onListening); server.on("listening", onListening);
server.listen(port); server.listen(port);
console.log('Server is up and running, please open the UI at http://localhost:' + port);