Angular 8 Update

Angular 8 Update
This commit is contained in:
ShahanaFarooqui 2019-07-27 14:20:17 -04:00
parent d2e815aab6
commit a9e8ca6a75
53 changed files with 4931 additions and 2929 deletions

View File

@ -8,8 +8,12 @@
"sourceRoot": "src",
"projectType": "application",
"prefix": "rtl",
"schematics": {},
"targets": {
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
@ -42,7 +46,14 @@
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "4mb",
"maximumError": "5mb"
}
]
}
}
},
@ -96,7 +107,7 @@
"RTLApp-e2e": {
"root": "e2e/",
"projectType": "application",
"targets": {
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {

View File

@ -1,3 +1,28 @@
@angular-devkit/build-angular
MIT
The MIT License
Copyright (c) 2017 Google, Inc.
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/animations
MIT
@ -36,7 +61,7 @@ MIT
MIT
The MIT License
Copyright (c) 2018 Google LLC.
Copyright (c) 2019 Google LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -205,7 +230,7 @@ convert-string
core-js
MIT
Copyright (c) 2014-2018 Denis Pushkarev
Copyright (c) 2014-2019 Denis Pushkarev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -1198,212 +1223,6 @@ Apache-2.0
rxjs-compat
Apache-2.0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
sha256
tslib

View File

@ -5,8 +5,8 @@
<title>RTL</title>
<base href="/rtl/"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico">
<link rel="stylesheet" href="styles.83644e00292bcd08f710.css"></head>
<link rel="stylesheet" href="styles.95c3afc83be2d91ee834.css"></head>
<body>
<rtl-app></rtl-app>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.d68e8f4f73dfaef206f1.js"></script><script type="text/javascript" src="main.025b36ac6da731e47e44.js"></script></body>
<script src="runtime-es2015.703a23e48ad83c851e49.js" type="module"></script><script src="polyfills-es2015.2a0da12c7706d5c3e2aa.js" type="module"></script><script src="runtime-es5.465c2333d355155ec5f3.js" nomodule></script><script src="polyfills-es5.84431ea76d33490d0941.js" nomodule></script><script src="main-es2015.ad87193d8f17c92a2f4d.js" type="module"></script><script src="main-es5.4b5fee64a9fad1d3dbb7.js" nomodule></script></body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
!function(e){function r(r){for(var n,f,i=r[0],l=r[1],a=r[2],c=0,s=[];c<i.length;c++)o[f=i[c]]&&s.push(o[f][0]),o[f]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=f(f.s=t[0]))}return e}var n={},o={0:0},u=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,(function(r){return e[r]}).bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="";var i=window.webpackJsonp=window.webpackJsonp||[],l=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var p=l;t()}([]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -397,36 +397,36 @@ connect.logEnvVariables = () => {
if (common.multi_node_setup) {
common.nodes.forEach((node, idx) => {
if (!node.enable_logging) { return; }
logger.info('\r\nConfig Setup Variable DEFAULT_NODE_INDEX: ' + common.selectedNode.index);
logger.info('\r\nConfig Setup Variable NODE_SETUP: MULTI', node);
logger.info('\r\nConfig Setup Variable RTL_SSO: ' + common.rtl_sso, node);
logger.info('\r\nConfig Setup Variable RTL_COOKIE_PATH: ' + common.rtl_cookie_path, node);
logger.info('\r\nConfig Setup Variable LOGOUT_REDIRECT_LINK: ' + common.logout_redirect_link + '\r\n', node);
logger.info('\r\nConfig Setup Variable INDEX: ' + node.index, node);
logger.info('\r\nConfig Setup Variable LN NODE: ' + node.ln_node, node);
logger.info('\r\nConfig Setup Variable LN IMPLEMENTATION: ' + node.ln_implementation, node);
logger.info('\r\nConfig Setup Variable PORT: ' + common.port, node);
logger.info('\r\nConfig Setup Variable MACAROON_PATH: ' + node.macaroon_path, node);
logger.info('\r\nConfig Setup Variable LND_SERVER_URL: ' + node.lnd_server_url, node);
logger.info('\r\nConfig Setup Variable RTL_CONFIG_PATH: ' + node.rtl_conf_file_path, node);
logger.info('\r\nConfig Setup Variable LND_CONFIG_PATH: ' + node.lnd_config_path, node);
logger.info('\r\nConfig Setup Variable BITCOIND_CONFIG_PATH: ' + node.bitcoind_config_path, node);
logger.info('\r\nConfig Setup Variable CHANNEL_BACKUP_PATH: ' + node.channel_backup_path, node);
logger.info({fileName: 'Config Setup Variable', msg: 'DEFAULT_NODE_INDEX: ' + common.selectedNode.index});
logger.info({fileName: 'Config Setup Variable', msg: 'NODE_SETUP: MULTI', node});
logger.info({fileName: 'Config Setup Variable', msg: 'RTL_SSO: ' + common.rtl_sso, node});
logger.info({fileName: 'Config Setup Variable', msg: 'RTL_COOKIE_PATH: ' + common.rtl_cookie_path, node});
logger.info({fileName: 'Config Setup Variable', msg: 'LOGOUT_REDIRECT_LINK: ' + common.logout_redirect_link + '\r\n', node});
logger.info({fileName: 'Config Setup Variable', msg: 'INDEX: ' + node.index, node});
logger.info({fileName: 'Config Setup Variable', msg: 'LN NODE: ' + node.ln_node, node});
logger.info({fileName: 'Config Setup Variable', msg: 'LN IMPLEMENTATION: ' + node.ln_implementation, node});
logger.info({fileName: 'Config Setup Variable', msg: 'PORT: ' + common.port, node});
logger.info({fileName: 'Config Setup Variable', msg: 'MACAROON_PATH: ' + node.macaroon_path, node});
logger.info({fileName: 'Config Setup Variable', msg: 'LND_SERVER_URL: ' + node.lnd_server_url, node});
logger.info({fileName: 'Config Setup Variable', msg: 'RTL_CONFIG_PATH: ' + node.rtl_conf_file_path, node});
logger.info({fileName: 'Config Setup Variable', msg: 'LND_CONFIG_PATH: ' + node.lnd_config_path, node});
logger.info({fileName: 'Config Setup Variable', msg: 'BITCOIND_CONFIG_PATH: ' + node.bitcoind_config_path, node});
logger.info({fileName: 'Config Setup Variable', msg: 'CHANNEL_BACKUP_PATH: ' + node.channel_backup_path, node});
});
} else {
if (!common.nodes[0].enable_logging) { return; }
logger.info('\r\nConfig Setup Variable NODE_SETUP: SINGLE');
logger.info('\r\nConfig Setup Variable PORT: ' + common.port);
logger.info('\r\nConfig Setup Variable LND_SERVER_URL: ' + common.nodes[0].lnd_server_url);
logger.info('\r\nConfig Setup Variable MACAROON_PATH: ' + common.nodes[0].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.nodes[0].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.nodes[0].bitcoind_config_path);
logger.info('\r\nConfig Setup Variable CHANNEL_BACKUP_PATH: ' + common.nodes[0].channel_backup_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);
logger.info({fileName: 'Config Setup Variable', msg: 'NODE_SETUP: SINGLE'});
logger.info({fileName: 'Config Setup Variable', msg: 'PORT: ' + common.port});
logger.info({fileName: 'Config Setup Variable', msg: 'LND_SERVER_URL: ' + common.nodes[0].lnd_server_url});
logger.info({fileName: 'Config Setup Variable', msg: 'MACAROON_PATH: ' + common.nodes[0].macaroon_path});
logger.info({fileName: 'Config Setup Variable', msg: 'NODE_AUTH_TYPE: ' + common.node_auth_type});
logger.info({fileName: 'Config Setup Variable', msg: 'LND_CONFIG_PATH: ' + common.nodes[0].lnd_config_path});
logger.info({fileName: 'Config Setup Variable', msg: 'RTL_CONFIG_PATH: ' + common.rtl_conf_file_path});
logger.info({fileName: 'Config Setup Variable', msg: 'BITCOIND_CONFIG_PATH: ' + common.nodes[0].bitcoind_config_path});
logger.info({fileName: 'Config Setup Variable', msg: 'CHANNEL_BACKUP_PATH: ' + common.nodes[0].channel_backup_path});
logger.info({fileName: 'Config Setup Variable', msg: 'RTL_SSO: ' + common.rtl_sso});
logger.info({fileName: 'Config Setup Variable', msg: 'RTL_COOKIE_PATH: ' + common.rtl_cookie_path});
logger.info({fileName: 'Config Setup Variable', msg: 'LOGOUT_REDIRECT_LINK: ' + common.logout_redirect_link});
}
}
@ -440,20 +440,20 @@ connect.getAllNodeAllChannelBackup = (node) => {
};
request(options, function (err, res, body) {
if (err) {
logger.error('\r\nConnect: ' + new Date().toJSON().slice(0,19) + ': ERROR: Channel Backup Response Failed: ' + JSON.stringify(err));
logger.error({fileName: 'Connect', lineNum: 443, msg: 'Channel Backup Response Failed: ' + JSON.stringify(err)});
} else {
fs.writeFile(channel_backup_file, JSON.stringify(body), function(err) {
if (err) {
if (node.ln_node) {
logger.error('\r\nConnect: ' + new Date().toJSON().slice(0,19) + ': ERROR: Channel Backup Failed for Node ' + node.ln_node + ' with error response: ' + JSON.stringify(err));
logger.error({fileName: 'Connect', lineNum: 448, msg: 'Channel Backup Failed for Node ' + node.ln_node + ' with error response: ' + JSON.stringify(err)});
} else {
logger.error('\r\nConnect: ' + new Date().toJSON().slice(0,19) + ': ERROR: Channel Backup Failed: ' + JSON.stringify(err));
logger.error({fileName: 'Connect', lineNum: 450, msg: 'Channel Backup Failed: ' + JSON.stringify(err)});
}
} else {
if (node.ln_node) {
logger.info('\r\nConnect: ' + new Date().toJSON().slice(0,19) + ': INFO: Channel Backup Successful for Node: ' + node.ln_node);
logger.info({fileName: 'Connect', msg: 'Channel Backup Successful for Node: ' + node.ln_node});
} else {
logger.info('\r\nConnect: ' + new Date().toJSON().slice(0,19) + ': INFO: Channel Backup Successful');
logger.info({fileName: 'Connect', msg: 'Channel Backup Successful'});
}
}
});

View File

@ -6,17 +6,17 @@ var common = require('../common');
exports.updateSelectedNode = (req, res, next) => {
const selNodeIndex = req.body.selNodeIndex;
common.selectedNode = common.findNode(selNodeIndex);
logger.info('\r\nConf: 9: ' + JSON.stringify(Date.now()) + ': INFO: Selected Node Updated!' + JSON.stringify(common.selectedNode.ln_node));
logger.info({fileName: 'RTLConf', msg: 'Selected Node Updated!' + JSON.stringify(common.selectedNode.ln_node)});
res.status(200).json({status: 'Selected Node Updated!'});
};
exports.getRTLConfig = (req, res, next) => {
if(!common.multi_node_setup) {
var RTLConfFile = common.rtl_conf_file_path + '/RTL.conf';
logger.info('\r\nConf: 7: ' + JSON.stringify(Date.now()) + ': INFO: Getting RTL Config');
logger.info({fileName: 'RTLConf', msg: 'Getting RTL Config'});
fs.readFile(RTLConfFile, 'utf8', function(err, data) {
if (err) {
logger.error('\r\nConf: 10: ' + JSON.stringify(Date.now()) + ': ERROR: Getting RTL Config Failed!');
logger.error({fileName: 'RTLConf', lineNum: 19, msg: 'Getting RTL Config Failed!'});
res.status(500).json({
message: "Reading RTL Config Failed!",
error: err
@ -39,14 +39,14 @@ exports.getRTLConfig = (req, res, next) => {
});
} else {
var RTLMultiNodeConfFile = common.rtl_conf_file_path + '/RTL-Multi-Node-Conf.json';
logger.info('\r\nRTLConf.js: 32: ' + JSON.stringify(Date.now()) + ': INFO: Getting Multi Node Config');
logger.info({fileName: 'RTLConf', msg: 'Getting Multi Node Config'});
fs.readFile(RTLMultiNodeConfFile, 'utf8', function(err, data) {
if (err) {
if (err.code === 'ENOENT') {
logger.error('\r\nRTLConf.js: 36: ' + JSON.stringify(Date.now()) + ': INFO: Multi Node Config does not exist!');
logger.error({fileName: 'RTLConf', lineNum: 46, msg: 'Multi Node Config does not exist!'});
res.status(200).json({ selectedNodeIndex: {}, sso: {}, nodes: [] });
} else {
logger.error('\r\nRTLConf.js: 39: ' + JSON.stringify(Date.now()) + ': ERROR: Getting Multi Node Config Failed!');
logger.error({fileName: 'RTLConf', lineNum: 49, msg: 'Getting Multi Node Config Failed!'});
res.status(500).json({
message: "Reading Multi Node Config Failed!",
error: err
@ -95,11 +95,11 @@ exports.updateUISettings = (req, res, next) => {
});
try {
fs.writeFileSync(RTLConfFile, JSON.stringify(config, null, 2), 'utf-8');
logger.info('\r\nConf: 77: ' + JSON.stringify(Date.now()) + ': INFO: Updating UI Settings Succesful!');
logger.info({fileName: 'RTLConf', msg: 'Updating UI Settings Succesful!'});
res.status(201).json({message: 'UI Settings Updated Successfully'});
}
catch (err) {
logger.error('\r\nConf: 71: ' + JSON.stringify(Date.now()) + ': ERROR: Updating UI Settings Failed!');
logger.error({fileName: 'Conf', lineNum: 102, msg: 'Updating UI Settings Failed!'});
res.status(500).json({
message: "Updating UI Settings Failed!",
error: 'Updating UI Settings Failed!'
@ -119,13 +119,13 @@ exports.updateUISettings = (req, res, next) => {
fs.writeFileSync(RTLConfFile, ini.stringify(config));
fs.appendFile(RTLConfFile, ini.stringify(settingsTemp, { section: 'Settings' }), function(err) {
if (err) {
logger.error('\r\nConf: 71: ' + JSON.stringify(Date.now()) + ': ERROR: Updating UI Settings Failed!');
logger.error({fileName: 'Conf', lineNum: 122, msg:'Updating UI Settings Failed!'});
res.status(500).json({
message: "Updating UI Settings Failed!",
error: 'Updating UI Settings Failed!'
});
} else {
logger.info('\r\nConf: 77: ' + JSON.stringify(Date.now()) + ': INFO: Updating UI Settings Succesful!');
logger.info({fileName: 'RTLConf', msg: 'Updating UI Settings Succesful!'});
res.status(201).json({message: 'UI Settings Updated Successfully'});
}
});
@ -153,10 +153,10 @@ exports.getConfig = (req, res, next) => {
confFile = '';
break;
}
logger.info('\r\nConf: 99: ' + JSON.stringify(Date.now()) + ': INFO: Node Type: ' + req.params.nodeType + ', File Path: ' + confFile);
logger.info({fileName: 'RTLConf', msg: 'Node Type: ' + req.params.nodeType + ', File Path: ' + confFile});
fs.readFile(confFile, 'utf8', function(err, data) {
if (err) {
logger.error('\r\nConf: 102: ' + JSON.stringify(Date.now()) + ': ERROR: Reading Conf Failed!');
logger.error({fileName: 'Conf', lineNum: 159, msg: 'Reading Conf Failed!'});
res.status(500).json({
message: "Reading Config File Failed!",
error: err

View File

@ -18,6 +18,7 @@ exports.authenticateUser = (req, res, next) => {
);
res.status(200).json({ token: token });
} else {
logger.error({fileName: 'Authenticate', lineNum: 21, msg: 'Password Validation Failed!'});
res.status(401).json({
message: "Login Failure!",
error: "SSO Authentication Failed!"
@ -34,6 +35,7 @@ exports.authenticateUser = (req, res, next) => {
);
res.status(200).json({ token: token });
} else {
logger.error({fileName: 'Authenticate', lineNum: 38, msg: 'Password Validation Failed!'});
res.status(401).json({
message: "Authentication Failed!",
error: "Password Validation Failed!"
@ -49,6 +51,7 @@ exports.authenticateUser = (req, res, next) => {
);
res.status(200).json({ token: token });
} else {
logger.error({fileName: 'Authenticate', lineNum: 54, msg: 'Password Validation Failed!'});
res.status(401).json({
message: "Authentication Failed!",
error: "Password Validation Failed!"
@ -57,7 +60,7 @@ exports.authenticateUser = (req, res, next) => {
} else {
fs.readFile(common.nodes[0].lnd_config_path, 'utf8', function (err, data) {
if (err) {
logger.error('\r\nAuthenticate: 45: ' + JSON.stringify(Date.now()) + ': ERROR: LND Config Reading Failed!');
logger.error({fileName: 'Authenticate', lineNum: 60, msg: 'LND Config Reading Failed!'});
err.description = 'You might be connecting RTL remotely to your LND node OR You might be missing rpcpass in your lnd.conf.';
err.description = err.description + ' If the former modify the RTL.conf for remote setting.';
err.description = err.description + ' If the later modify the lnd.conf to include rpcpass';
@ -83,6 +86,7 @@ exports.authenticateUser = (req, res, next) => {
);
res.status(200).json({ token: token });
} else {
logger.error({fileName: 'Authenticate', lineNum: 89, msg: 'Password Validation Failed!'});
res.status(401).json({
message: "Authentication Failed!",
error: "Password Validation Failed!"

View File

@ -8,7 +8,7 @@ exports.getBalance = (req, res, next) => {
options.url = common.getSelLNDServerUrl() + '/balance/' + req.params.source;
options.qs = req.query;
request(options).then((body) => {
logger.info('\r\nBalance: 9: ' + JSON.stringify(Date.now()) + ': INFO: ' + 'Request params: ' + JSON.stringify(req.params) + 'Request Query: ' + JSON.stringify(req.query) + ' Balance Received: ' + JSON.stringify(body));
logger.info({fileName: 'Balance', msg: 'Request params: ' + JSON.stringify(req.params) + 'Request Query: ' + JSON.stringify(req.query) + ' Balance Received: ' + JSON.stringify(body)});
if(undefined !== body) {
body.btc_balance = (undefined === body.balance) ? 0 : common.convertToBTC(body.balance);
body.btc_total_balance = (undefined === body.total_balance) ? 0 : common.convertToBTC(body.total_balance);

View File

@ -11,7 +11,7 @@ getAliasForChannel = (channel, channelType) => {
options.url = common.getSelLNDServerUrl() + '/graph/node/' + channel.channel.remote_node_pub;
}
request(options).then(function(aliasBody) {
logger.info('\r\nChannels: 13: ' + JSON.stringify(Date.now()) + ': INFO: Alias: ' + JSON.stringify(aliasBody.node.alias));
logger.info({fileName: 'Channels', msg: 'Alias: ' + JSON.stringify(aliasBody.node.alias)});
if (undefined === channelType || channelType === 'all') {
channel.remote_alias = aliasBody.node.alias;
resolve(aliasBody.node.alias);
@ -42,7 +42,7 @@ exports.getChannels = (req, res, next) => {
})
)
.then(function(values) {
logger.info('\r\nChannels: 43: ' + JSON.stringify(Date.now()) + ': INFO: Channels with Alias: ' + JSON.stringify(body));
logger.info({fileName: 'Channels', msg: 'Channels with Alias: ' + JSON.stringify(body)});
res.status(200).json(body);
}).catch(err => {
console.error(err.error);
@ -60,12 +60,12 @@ exports.getChannels = (req, res, next) => {
});
body.channels = common.sortDescByKey(body.channels, 'close_type');
}
logger.info('\r\nChannels: 55: ' + JSON.stringify(Date.now()) + ': INFO: Pending/Closed Channels: ' + JSON.stringify(body));
logger.info({fileName: 'Channels', msg: 'Pending/Closed Channels: ' + JSON.stringify(body)});
res.status(200).json(body);
}
})
.catch(function (err) {
logger.info('\r\nChannels: 61: ' + JSON.stringify(Date.now()) + ': ERROR: Get Channel: ' + JSON.stringify(err));
logger.error({fileName: 'Channels', lineNum: 68, msg: 'Get Channel: ' + JSON.stringify(err)});
return res.status(500).json({
message: 'Fetching Channels Failed!',
error: err.error
@ -89,7 +89,7 @@ exports.postChannel = (req, res, next) => {
}
options.form = JSON.stringify(options.form);
request.post(options).then((body) => {
logger.info('\r\nChannels: 74: ' + JSON.stringify(Date.now()) + ': INFO: Channel Open Response: ' + JSON.stringify(body));
logger.info({fileName: 'Channels', msg: 'Channel Open Response: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: 'Open Channel Failed!',
@ -100,7 +100,7 @@ exports.postChannel = (req, res, next) => {
}
})
.catch(function (err) {
logger.info('\r\nChannels: 86: ' + JSON.stringify(Date.now()) + ': ERROR: Open Channel: ' + JSON.stringify(err));
logger.error({fileName: 'Channels', lineNum: 103, msg: 'Open Channel: ' + JSON.stringify(err)});
return res.status(500).json({
message: 'Open Channel Failed!',
error: err.error
@ -124,7 +124,7 @@ exports.postTransactions = (req, res, next) => {
});
}
request.post(options).then((body) => {
logger.info('\r\nChannels: 107: ' + JSON.stringify(Date.now()) + ': INFO: Send Payment Response: ' + JSON.stringify(body));
logger.info({fileName: 'Channels', msg: 'Send Payment Response: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: 'Send Payment Failed!',
@ -140,7 +140,7 @@ exports.postTransactions = (req, res, next) => {
}
})
.catch(function (err) {
logger.info('\r\nChannels: 124: ' + JSON.stringify(Date.now()) + ': ERROR: Send Payment: ' + JSON.stringify(err));
logger.error({fileName: 'Channels', lineNum: 143, msg: 'Send Payment: ' + JSON.stringify(err)});
return res.status(500).json({
message: 'Send Payment Failed!',
error: err.error
@ -153,9 +153,9 @@ exports.closeChannel = (req, res, next) => {
options = common.getOptions();
let channelpoint = req.params.channelPoint.replace(':', '/');
options.url = common.getSelLNDServerUrl() + '/channels/' + channelpoint + '?force=' + req.query.force;
logger.info('\r\nChannels: 144: ' + JSON.stringify(Date.now()) + ': INFO: Closing Channel: ' + options.url);
logger.info({fileName: 'Channels', msg: 'Closing Channel: ' + options.url});
request.delete(options).then((body) => {
logger.info('\r\nChannels: 146: ' + JSON.stringify(Date.now()) + ': INFO: Close Channel Response: ' + JSON.stringify(body));
logger.info({fileName: 'Channels', msg: 'Close Channel Response: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: 'Close Channel Failed!',
@ -166,7 +166,7 @@ exports.closeChannel = (req, res, next) => {
}
})
.catch(function (err) {
logger.info('\r\nChannels: 157: ' + JSON.stringify(Date.now()) + ': ERROR: Close Channel: ' + JSON.stringify(err));
logger.error({fileName: 'Channels', lineNum: 169, msg: 'Close Channel: ' + JSON.stringify(err)});
return res.status(500).json({
message: 'Close Channel Failed!',
error: err.error
@ -195,9 +195,9 @@ exports.postChanPolicy = (req, res, next) => {
chan_point: {funding_txid_str: txid_str, output_index: parseInt(output_idx)}
});
}
logger.info('\r\nChannels: 185: ' + JSON.stringify(Date.now()) + ': INFO: Update Channel Policy Options: ' + JSON.stringify(options));
logger.info({fileName: 'Channels', msg: 'Update Channel Policy Options: ' + JSON.stringify(options)});
request.post(options).then((body) => {
logger.info('\r\nChannels: 187: ' + JSON.stringify(Date.now()) + ': INFO: Update Channel Policy: ' + JSON.stringify(body));
logger.info({fileName: 'Channels', msg: 'Update Channel Policy: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: 'Update Channel Failed!',
@ -208,7 +208,7 @@ exports.postChanPolicy = (req, res, next) => {
}
})
.catch(function (err) {
logger.info('\r\nChannels: 198: ' + JSON.stringify(Date.now()) + ': ERROR: Update Channel Policy: ' + JSON.stringify(err));
logger.error({fileName: 'Channels', lineNum: 211, msg: 'Update Channel Policy: ' + JSON.stringify(err)});
return res.status(500).json({
message: 'Update Channel Failed!',
error: err.error

View File

@ -9,12 +9,12 @@ exports.getBackup = (req, res, next) => {
let channel_backup_file = '';
let message = '';
if (req.params.channelPoint === 'ALL') {
message = 'All Channels Backup Successful!';
channel_backup_file = common.selectedNode.channel_backup_path + '/channel-all.bak';
channel_backup_file = common.selectedNode.channel_backup_path + '\\channel-all.bak';
message = 'All Channels Backup Successful at: ' + channel_backup_file + ' !';
options.url = common.getSelLNDServerUrl() + '/channels/backup';
} else {
message = 'Channel ' + req.params.channelPoint + ' Backup Successful!';
channel_backup_file = common.selectedNode.channel_backup_path + '/channel-' + req.params.channelPoint.replace(':', '-') + '.bak';
channel_backup_file = common.selectedNode.channel_backup_path + '\\channel-' + req.params.channelPoint.replace(':', '-') + '.bak';
message = 'Channel Backup Successful at: ' + channel_backup_file + ' !';
let channelpoint = req.params.channelPoint.replace(':', '/');
options.url = common.getSelLNDServerUrl() + '/channels/backup/' + channelpoint;
let exists = fs.existsSync(channel_backup_file);
@ -31,7 +31,7 @@ exports.getBackup = (req, res, next) => {
}
}
request(options).then(function (body) {
logger.info('\r\nChannels Backup: 16: ' + new Date().toJSON().slice(0,19) + ': INFO: Channel Backup: ' + JSON.stringify(body));
logger.info({fileName: 'Channels Backup', msg: 'Channel Backup: ' + JSON.stringify(body)});
fs.writeFile(channel_backup_file, JSON.stringify(body), function(err) {
if (err) {
return res.status(500).json({ message: 'Channels Backup Failed!', error: err.error });
@ -41,7 +41,7 @@ exports.getBackup = (req, res, next) => {
});
})
.catch(function (err) {
logger.info('\r\nChannels Backup: 27: ' + new Date().toJSON().slice(0,19) + ': ERROR: Channel Backup: ' + JSON.stringify(err));
logger.error({fileName: 'Channels Backup', lineNum: 44, msg: 'Channel Backup: ' + JSON.stringify(err)});
return res.status(500).json({
message: 'Channels Backup Failed!',
error: err.error
@ -86,11 +86,11 @@ exports.postBackupVerify = (req, res, next) => {
}
if (verify_backup !== '') {
request.post(options).then(function (body) {
logger.info('\r\nChannels Backup Verify: 73: ' + new Date().toJSON().slice(0,19) + ': INFO: Channel Backup Verify: ' + JSON.stringify(body));
logger.info({fileName: 'Channels Backup Verify', msg: 'Channel Backup Verify: ' + JSON.stringify(body)});
res.status(201).json({ message: message });
})
.catch(function (err) {
logger.info('\r\nChannels Backup Verify: 77: ' + new Date().toJSON().slice(0,19) + ': ERROR: Channel Backup Verify: ' + JSON.stringify(err));
logger.error({fileName: 'Channels Backup Verify', lineNum: 93, msg: 'Channel Backup Verify: ' + JSON.stringify(err)});
return res.status(404).json({
message: 'Channel backup to Verify failed!',
error: err.error

View File

@ -7,7 +7,7 @@ exports.getFees = (req, res, next) => {
options = common.getOptions();
options.url = common.getSelLNDServerUrl() + '/fees';
request(options).then((body) => {
logger.info('\r\nFees: 8: ' + JSON.stringify(Date.now()) + ': INFO: Fee Received: ' + JSON.stringify(body));
logger.info({fileName: 'Fees', msg: 'Fee Received: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: "Fetching fee failed!",

View File

@ -9,14 +9,14 @@ exports.getInfo = (req, res, next) => {
options = common.getOptions();
options.url = common.getSelLNDServerUrl() + '/getinfo';
if(common.multi_node_setup) {
logger.info('\r\nSelected Node: ' + JSON.stringify(common.selectedNode.ln_node));
logger.info({fileName:'GetInfo', msg: 'Selected Node: ' + JSON.stringify(common.selectedNode.ln_node)});
} else {
logger.info('\r\nSingle Node Setup!');
logger.info({fileName:'GetInfo', msg: 'Single Node Setup!'});
}
common.nodes.map(node => { connect.getAllNodeAllChannelBackup(node); });
logger.info('\r\nCalling getinfo from lnd server url: INFO: ' + options.url);
logger.info({fileName: 'GetInfo', msg: 'Calling getinfo from lnd server url: ' + options.url});
request(options).then((body) => {
logger.info('\r\nGetInfo: 9: ' + JSON.stringify(Date.now()) + ': INFO: ' + JSON.stringify(body));
logger.info({fileName: 'GetInfo', msg: JSON.stringify(body)});
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
if(undefined === body || search_idx > -1 || body.error) {

View File

@ -9,7 +9,7 @@ exports.getDescribeGraph = (req, res, next) => {
request.get(options).then((body) => {
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
logger.info('\r\nGraph: 10: ' + JSON.stringify(Date.now()) + ': INFO: Describe Graph Received: ' + body_str);
logger.info({fileName: 'Graph', msg: 'Describe Graph Received: ' + body_str});
if(undefined === body || search_idx > -1 || body.error) {
res.status(500).json({
message: "Fetching Describe Graph Failed!",
@ -33,7 +33,7 @@ exports.getGraphInfo = (req, res, next) => {
request.get(options).then((body) => {
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
logger.info('\r\nGraph: 33: ' + JSON.stringify(Date.now()) + ': INFO: Network Info Received: ' + body_str);
logger.info({fileName: 'Graph', msg: 'Network Info Received: ' + body_str});
if(undefined === body || search_idx > -1 || body.error) {
res.status(500).json({
message: "Fetching network Info failed!",
@ -44,7 +44,7 @@ exports.getGraphInfo = (req, res, next) => {
body.btc_avg_channel_size = (undefined === body.avg_channel_size) ? 0 : common.convertToBTC(body.avg_channel_size);
body.btc_min_channel_size = (undefined === body.min_channel_size) ? 0 : common.convertToBTC(body.min_channel_size);
body.btc_max_channel_size = (undefined === body.max_channel_size) ? 0 : common.convertToBTC(body.max_channel_size);
logger.info('\r\nGraph: 44: ' + JSON.stringify(Date.now()) + ': INFO: Network Information After Rounding and Conversion: ' + body_str);
logger.info({fileName: 'Graph', msg: 'Network Information After Rounding and Conversion: ' + body_str});
res.status(200).json(body);
}
})
@ -60,7 +60,7 @@ exports.getGraphNode = (req, res, next) => {
options = common.getOptions();
options.url = common.getSelLNDServerUrl() + '/graph/node/' + req.params.pubKey;
request(options).then((body) => {
logger.info('\r\nGraph: 59: ' + JSON.stringify(Date.now()) + ': INFO: Node Info Received: ' + JSON.stringify(body));
logger.info({fileName: 'Graph', msg: 'Node Info Received: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: "Fetching node Info failed!",
@ -84,7 +84,31 @@ exports.getGraphEdge = (req, res, next) => {
options = common.getOptions();
options.url = common.getSelLNDServerUrl() + '/graph/edge/' + req.params.chanid;
request(options).then((body) => {
logger.info('\r\nGraph: 79: ' + JSON.stringify(Date.now()) + ': INFO: Edge Info Received: ' + JSON.stringify(body));
logger.info({fileName: 'Graph', msg: 'Edge Info Received: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: "Fetching Edge Info Failed!",
error: (undefined === body) ? 'Error From Server!' : body.error
});
}
if (undefined !== body) {
body.last_update_str = (undefined === body.last_update) ? '' : common.convertTimestampToDate(body.last_update);
}
res.status(200).json(body);
})
.catch((err) => {
return res.status(500).json({
message: "Fetching Edge Info Failed!",
error: err.error
});
});
};
exports.getQueryRoutes = (req, res, next) => {
options = common.getOptions();
options.url = common.getSelLNDServerUrl() + '/graph/routes/' + req.params.destPubkey + '/' + req.params.amount;
request(options).then((body) => {
logger.info({fileName: 'Graph', msg: 'Edge Info Received: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: "Fetching Edge Info Failed!",

View File

@ -7,7 +7,7 @@ exports.getInvoice = (req, res, next) => {
options = common.getOptions();
options.url = common.getSelLNDServerUrl() + '/invoice/' + req.params.rHashStr;
request(options).then((body) => {
logger.info('\r\nInvoice: 8: ' + JSON.stringify(Date.now()) + ': INFO: Invoice Info Received: ' + JSON.stringify(body));
logger.info({fileName: 'Invoice', msg: 'Invoice Info Received: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: "Fetching Invoice Info Failed!",
@ -31,7 +31,7 @@ exports.listInvoices = (req, res, next) => {
request(options).then((body) => {
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
logger.info('\r\nInvoice: 30: ' + JSON.stringify(Date.now()) + ': INFO: Invoices List Received: ' + body_str);
logger.info({fileName: 'Invoice', msg: 'Invoices List Received: ' + body_str});
if(undefined === body || search_idx > -1 || body.error) {
res.status(500).json({
message: "Fetching Invoice Info failed!",
@ -47,7 +47,7 @@ exports.listInvoices = (req, res, next) => {
});
body.invoices = common.sortDescByKey(body.invoices, 'creation_date');
}
logger.info('\r\nInvoice: 45: ' + JSON.stringify(Date.now()) + ': INFO: Invoices List Received: ' + JSON.stringify(body));
logger.info({fileName: 'Invoice', msg: 'Invoices List Received: ' + JSON.stringify(body)});
res.status(200).json(body);
}
})
@ -69,7 +69,7 @@ exports.addInvoice = (req, res, next) => {
expiry: req.body.expiry
});
request.post(options).then((body) => {
logger.info('\r\nInvoice: 64: ' + JSON.stringify(Date.now()) + ': INFO: Add Invoice Responce: ' + JSON.stringify(body));
logger.info({fileName: 'Invoice', msg: 'Add Invoice Responce: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: "Add Invoice Failed!",

View File

@ -1,8 +1,9 @@
var fs = require('fs');
var common = require('../common');
exports.info = (msgStr, selNode = common.selectedNode) => {
if (msgStr.indexOf('Config Setup Variable') === -1) {
exports.info = (msgJSON, selNode = common.selectedNode) => {
const msgStr = '\r\nINFO: ' + msgJSON.fileName + ' => ' + msgJSON.msg;
if (msgJSON.fileName !== 'Config Setup Variable') {
console.log('Console: ' + msgStr);
}
if(selNode.enable_logging) {
@ -16,7 +17,8 @@ exports.info = (msgStr, selNode = common.selectedNode) => {
}
}
exports.error = (msgStr, selNode = common.selectedNode) => {
exports.error = (msgJSON, selNode = common.selectedNode) => {
const msgStr = '\r\nERROR: ' + msgJSON.fileName + '(' + msgJSON.lineNum + ') => ' + msgJSON.msg;
console.error('Console: ' + msgStr);
if(selNode.enable_logging) {
fs.appendFile(selNode.log_file, msgStr, function(err) {
@ -27,4 +29,4 @@ exports.error = (msgStr, selNode = common.selectedNode) => {
}
});
}
}
}

View File

@ -9,7 +9,7 @@ exports.getNewAddress = (req, res, next) => {
request(options).then((body) => {
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
logger.info('\r\nNewAddress: 10: ' + JSON.stringify(Date.now()) + ': INFO: New Address Received: ' + body_str);
logger.info({fileName: 'NewAddress', msg: 'New Address Received: ' + body_str});
if(undefined === body || search_idx > -1 || body.error) {
res.status(500).json({
message: "Fetching new address failed!",

View File

@ -9,7 +9,7 @@ exports.decodePayment = (req, res, next) => {
request(options).then((body) => {
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
logger.info('\r\nPayReq: 10: ' + JSON.stringify(Date.now()) + ': INFO: Payment Decodd Received: ' + body_str);
logger.info({fileName: 'PayReq', msg: 'Payment Decodd Received: ' + body_str});
if(undefined === body || search_idx > -1 || body.error) {
res.status(500).json({
message: "Payment Request Decode Failed!",

View File

@ -9,7 +9,7 @@ exports.getPayments = (req, res, next) => {
request(options).then((body) => {
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
logger.info('\r\nPayments: 10: ' + JSON.stringify(Date.now()) + ': INFO: Payment Decoded Received: ' + body_str);
logger.info({fileName: 'Payments', msg: 'Payment Decoded Received: ' + body_str});
if(undefined === body || search_idx > -1 || body.error) {
res.status(500).json({
message: "Payments List Failed!",

View File

@ -8,7 +8,7 @@ getAliasForPeers = (peer) => {
options.url = common.getSelLNDServerUrl() + '/graph/node/' + peer.pub_key;
request(options)
.then(function(aliasBody) {
logger.info('\r\nPeers: 11: ' + JSON.stringify(Date.now()) + ': INFO: Alias: ' + JSON.stringify(aliasBody.node.alias));
logger.info({fileName: 'Peers', msg: 'Alias: ' + JSON.stringify(aliasBody.node.alias)});
peer.alias = aliasBody.node.alias;
resolve(aliasBody.node.alias);
})
@ -29,7 +29,7 @@ exports.getPeers = (req, res, next) => {
if (undefined !== body.peers) {
body.peers = common.sortDescByKey(body.peers, 'alias');
}
logger.info('\r\nPeers: 29: ' + JSON.stringify(Date.now()) + ': INFO: Peers with Alias: ' + JSON.stringify(body));
logger.info({fileName: 'Peers', msg: 'Peers with Alias: ' + JSON.stringify(body)});
res.status(200).json(body.peers);
});
})
@ -49,7 +49,7 @@ exports.postPeer = (req, res, next) => {
perm: req.body.perm
});
request.post(options, (error, response, body) => {
logger.info('\r\nPeers: 48: ' + JSON.stringify(Date.now()) + ': INFO: Peer Added: ' + JSON.stringify(body));
logger.info({fileName: 'Peers', msg: 'Peer Added: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: "Adding peer failed!",
@ -66,11 +66,11 @@ exports.postPeer = (req, res, next) => {
.then(function(values) {
if (undefined !== body.peers) {
body.peers = common.sortDescByKey(body.peers, 'alias');
logger.info('\r\nPeers: 69: ' + JSON.stringify(Date.now()) + ': INFO: Peer with Alias: ' + JSON.stringify(body));
logger.info({fileName: 'Peers', msg: 'Peer with Alias: ' + JSON.stringify(body)});
body.peers = common.newestOnTop(body.peers, 'pub_key', req.body.pubkey);
logger.info('\r\nPeers: 71: ' + JSON.stringify(Date.now()) + ': INFO: Peer with Newest On Top: ' + JSON.stringify(body));
logger.info({fileName: 'Peers', msg: 'Peer with Newest On Top: ' + JSON.stringify(body)});
}
logger.info('\r\nPeers: 73: ' + JSON.stringify(Date.now()) + ': INFO: Peer Added Successfully');
logger.info({fileName: 'Peers', msg: 'Peer Added Successfully'});
res.status(201).json(body.peers);
})
.catch((err) => {
@ -88,14 +88,14 @@ exports.deletePeer = (req, res, next) => {
options = common.getOptions();
options.url = common.getSelLNDServerUrl() + '/peers/' + req.params.peerPubKey;
request.delete(options).then((body) => {
logger.info('\r\nPeers: 81: ' + JSON.stringify(Date.now()) + ': INFO: Detach Peer Response: ' + JSON.stringify(body));
logger.info({fileName: 'Peers', msg: 'Detach Peer Response: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: "Detach peer failed!",
error: (undefined === body) ? 'Error From Server!' : body.error
});
} else {
logger.info('\r\nPeers: 88: ' + JSON.stringify(Date.now()) + ': INFO: Peer Detached: ' + req.params.peerPubKey);
logger.info({fileName: 'Peers', msg: 'Peer Detached: ' + req.params.peerPubKey});
res.status(204).json({});
}
})

View File

@ -20,11 +20,11 @@ exports.forwardingHistory = (req, res, next) => {
options.form.start_time = req.body.start_time;
}
options.form = JSON.stringify(options.form);
logger.info('\r\nSwitch: 14: ' + JSON.stringify(Date.now()) + ': INFO: Switch Post Options: ' + JSON.stringify(options));
logger.info({fileName: 'Switch', msg: 'Switch Post Options: ' + JSON.stringify(options)});
request.post(options).then((body) => {
logger.info('\r\nSwitch: 16: ' + JSON.stringify(Date.now()) + ': INFO: Switch Post Response: ' + JSON.stringify(body));
logger.info({fileName: 'Switch', msg: 'Switch Post Response: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
logger.error('\r\nSwitch: 18: ' + JSON.stringify(Date.now()) + ': ERROR: Switch Post Erroe: ' + JSON.stringify((undefined === body) ? 'Error From Server!' : body.error));
logger.error({fileName: 'Switch', lineNum: 27, msg: 'Switch Post Erroe: ' + JSON.stringify((undefined === body) ? 'Error From Server!' : body.error)});
res.status(500).json({
message: "Switch post failed!",
error: (undefined === body) ? 'Error From Server!' : body.error
@ -36,12 +36,12 @@ exports.forwardingHistory = (req, res, next) => {
});
body.forwarding_events = common.sortDescByKey(body.forwarding_events, 'timestamp');
}
logger.info('\r\nSwitch: 38: ' + JSON.stringify(Date.now()) + ': INFO: Forwarding History Received: ' + JSON.stringify(body));
logger.info({fileName: 'Switch', msg: 'Forwarding History Received: ' + JSON.stringify(body)});
res.status(201).json(body);
}
})
.catch(function (err) {
logger.error('\r\nSwitch: 28: ' + JSON.stringify(Date.now()) + ': ERROR: Switch Post Error: ' + JSON.stringify(err));
logger.error({fileName: 'Switch', lineNum: 44, msg: 'Switch Post Error: ' + JSON.stringify(err)});
return res.status(500).json({
message: "Switch post failed!",
error: err.error

View File

@ -9,7 +9,7 @@ exports.getTransactions = (req, res, next) => {
request(options).then((body) => {
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
logger.info('\r\nTransactions: 10: ' + JSON.stringify(Date.now()) + ': INFO: Transaction Received: ' + body_str);
logger.info({fileName: 'Transactions', msg: 'Transaction Received: ' + body_str});
if(undefined === body || search_idx > -1 || body.error) {
res.status(500).json({
message: "Fetching Transactions Failed!",
@ -47,7 +47,7 @@ exports.postTransactions = (req, res, next) => {
}
options.form = JSON.stringify(options.form);
request.post(options).then((body) => {
logger.info('\r\nTransactions: 42: ' + JSON.stringify(Date.now()) + ': INFO: Transaction Post Response: ' + JSON.stringify(body));
logger.info({fileName: 'Transactions', msg: 'Transaction Post Response: ' + JSON.stringify(body)});
if(undefined === body || body.error) {
res.status(500).json({
message: "Transactions post failed!",

View File

@ -54,7 +54,7 @@ exports.operateWallet = (req, res, next) => {
err_message = 'Initializing wallet failed!';
}
request(options).then((body) => {
logger.info('\r\nWallet: 20: ' + JSON.stringify(Date.now()) + ': INFO: Wallet Response: ' + JSON.stringify(body));
logger.info({fileName: 'Wallet', msg: 'Wallet Response: ' + JSON.stringify(body)});
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
if(undefined === body) {
@ -80,7 +80,7 @@ exports.operateWallet = (req, res, next) => {
res.status(201).json('Successful');
}
}).catch(error => {
logger.info('\r\nWallet: 83: ' + JSON.stringify(Date.now()) + ': INFO: Wallet Response: ' + JSON.stringify(error.error));
logger.error({fileName: 'Wallet', lineNum: 83, msg: 'Wallet Response: ' + JSON.stringify(error.error)});
if((error.error.code === 1 && error.error.error === 'context canceled') || (error.error.code === 14 && error.error.error === 'transport is closing')) {
res.status(201).json('Successful');
} else {

7221
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "rtl",
"version": "0.4.3-beta",
"version": "0.4.4-beta",
"license": "MIT",
"scripts": {
"ng": "ng",
@ -14,23 +14,23 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^7.2.15",
"@angular/cdk": "^7.3.7",
"@angular/common": "^7.2.15",
"@angular/compiler": "^7.2.15",
"@angular/core": "^7.2.15",
"@angular/flex-layout": "^7.0.0-beta.19",
"@angular/forms": "^7.2.15",
"@angular/animations": "~8.1.2",
"@angular/cdk": "^8.1.1",
"@angular/common": "~8.1.2",
"@angular/compiler": "~8.1.2",
"@angular/core": "~8.1.2",
"@angular/flex-layout": "^8.0.0-beta.26",
"@angular/forms": "~8.1.2",
"@angular/http": "^7.2.15",
"@angular/material": "^7.3.7",
"@angular/platform-browser": "^7.2.15",
"@angular/platform-browser-dynamic": "^7.2.15",
"@angular/router": "^7.2.15",
"@ngrx/effects": "^7.4.0",
"@ngrx/router-store": "^7.4.0",
"@ngrx/store": "^7.4.0",
"@ngrx/store-devtools": "^7.4.0",
"@swimlane/ngx-charts": "^10.0.0",
"@angular/material": "^8.1.1",
"@angular/platform-browser": "~8.1.2",
"@angular/platform-browser-dynamic": "~8.1.2",
"@angular/router": "~8.1.2",
"@ngrx/effects": "^8.1.0",
"@ngrx/router-store": "^8.1.0",
"@ngrx/store": "^8.1.0",
"@ngrx/store-devtools": "^8.1.0",
"@swimlane/ngx-charts": "^12.0.1",
"angular-user-idle": "^2.0.0",
"angularx-qrcode": "^1.5.3",
"cookie-parser": "^1.4.4",
@ -43,32 +43,32 @@
"node-sass": "^4.12.0",
"optimist": "^0.6.1",
"request-promise": "^4.2.2",
"rxjs": "^6.5.2",
"rxjs-compat": "^6.3.3",
"rxjs": "~6.5.2",
"rxjs-compat": "^6.5.2",
"sha256": "^0.2.0",
"tslib": "^1.9.0",
"upper-case": "^1.1.3",
"zone.js": "~0.8.29"
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.9",
"@angular/cli": "^7.3.9",
"@angular/compiler-cli": "^7.2.15",
"@angular/language-service": "^7.2.15",
"@types/jasmine": "~2.8.8",
"@angular-devkit/build-angular": "~0.801.2",
"@angular/cli": "~8.1.2",
"@angular/compiler-cli": "~8.1.2",
"@angular/language-service": "~8.1.2",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^8.9.5",
"codelyzer": "~4.3.0",
"jasmine-core": "~2.99.1",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.0.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.2.4"
"tslint": "~5.15.0",
"typescript": "~3.4.3"
}
}

View File

@ -7,5 +7,6 @@ router.get("/", authCheck, graphController.getDescribeGraph);
router.get("/info", authCheck, graphController.getGraphInfo);
router.get("/node/:pubKey", authCheck, graphController.getGraphNode);
router.get("/edge/:chanid", authCheck, graphController.getGraphEdge);
router.get("/routes/:destPubkey/:amount", authCheck, graphController.getQueryRoutes);
module.exports = router;

View File

@ -7,7 +7,7 @@
<mat-sidenav-content perfectScrollbar class="overflow-auto">
<mat-toolbar fxLayout="row" fxLayoutAlign="space-between center" color="primary" class="padding-gap-x">
<div fxLayoutAlign="center center">
<button *ngIf="settings.menu === 'Vertical'" mat-icon-button (click)="sideNavToggle(sideNavigation)">
<button *ngIf="settings.menu === 'Vertical'" mat-icon-button (click)="sideNavToggle()">
<mat-icon>menu</mat-icon>
</button>
</div>

View File

@ -20,8 +20,8 @@ import * as fromRTLReducer from './shared/store/rtl.reducers';
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild('sideNavigation') sideNavigation: any;
@ViewChild('settingSidenav') settingSidenav: any;
@ViewChild('sideNavigation', { static: true }) sideNavigation: any;
@ViewChild('settingSidenav', { static: true }) settingSidenav: any;
public selNode: Node;
public settings: Settings;
public information: GetInfo = {};
@ -112,11 +112,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
private readAccessKey() {
const url = window.location.href;
const ak = url.substring(url.lastIndexOf('access-key=') + 11).trim();
if (ak) {
this.store.dispatch(new RTLActions.Signout());
}
return ak;
return url.substring(url.lastIndexOf('access-key=') + 11).trim();
}
initializeRemainingData() {

View File

@ -8,6 +8,7 @@
</mat-card-header>
<mat-card-content>
<div fxLayout="column" fxLayout.gt-sm="row wrap" fxFlex="100" fxLayoutAlign="space-between start">
<h3 fxFlex="100">Backup folder location: {{this.selNode.settings.channelBackupPath}}</h3>
<button fxFlex="49" fxLayoutAlign="center center" mat-raised-button color="primary" tabindex="1" (click)="onBackupChannels({})">Backup</button>
<button fxFlex="49" fxLayoutAlign="center center" mat-raised-button color="accent" tabindex="2" (click)="onVerifyChannels({})">Verify Backup</button>
</div>

View File

@ -7,6 +7,7 @@ import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatTableDataSource, MatSort } from '@angular/material';
import { Node } from '../../../shared/models/RTLconfig';
import { Channel } from '../../../shared/models/lndModels';
import { LoggerService } from '../../../shared/services/logger.service';
@ -20,7 +21,8 @@ import * as fromRTLReducer from '../../../shared/store/rtl.reducers';
styleUrls: ['./channel-backup.component.scss']
})
export class ChannelBackupComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
public selNode: Node;
public displayedColumns = ['chan_id', 'backup', 'verify'];
public selChannel: Channel;
public channels: any;
@ -34,6 +36,7 @@ export class ChannelBackupComponent implements OnInit, OnDestroy {
this.store.select('rtlRoot')
.pipe(takeUntil(this.unSubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => {
this.selNode = rtlStore.selNode;
rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'Fetchchannels') {
this.flgLoading[0] = 'error';

View File

@ -18,7 +18,7 @@ import * as fromRTLReducer from '../../../shared/store/rtl.reducers';
styleUrls: ['./channel-closed.component.scss']
})
export class ChannelClosedComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
public displayedColumns = [];
public closedChannels: any;
public flgLoading: Array<Boolean | 'error'> = [true];

View File

@ -20,7 +20,7 @@ import * as fromRTLReducer from '../../../shared/store/rtl.reducers';
styleUrls: ['./channel-manage.component.scss']
})
export class ChannelManageComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
public totalBalance = 0;
public selectedPeer = '';
public fundingAmount: number;

View File

@ -18,7 +18,7 @@ import * as fromRTLReducer from '../../../shared/store/rtl.reducers';
styleUrls: ['./channel-pending.component.scss']
})
export class ChannelPendingComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
public selNode: Node;
public selectedFilter = 0;
public information: GetInfo = {};

View File

@ -21,7 +21,7 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
animations: [newlyAddedRowAnimation]
})
export class InvoicesComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
public selNode: Node;
public newlyAddedInvoiceMemo = '';
public newlyAddedInvoiceValue = 0;

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs/Subject';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';

View File

@ -21,8 +21,8 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
animations: [newlyAddedRowAnimation]
})
export class PaymentsComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
@ViewChild('sendPaymentForm') form;
@ViewChild(MatSort, { static: true }) sort: MatSort;
@ViewChild('sendPaymentForm', { static: true }) form;
public selNode: Node;
public newlyAddedPayment = '';
public flgAnimate = true;

View File

@ -22,7 +22,7 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
animations: [newlyAddedRowAnimation]
})
export class PeersComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
public newlyAddedPeer = '';
public flgAnimate = true;
public displayedColumns = [];

View File

@ -18,8 +18,8 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
styleUrls: ['./routing-peers.component.scss']
})
export class RoutingPeersComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sortIn: MatSort;
@ViewChild('tableOut', {read: MatSort}) sortOut: MatSort;
@ViewChild(MatSort, { static: true }) sortIn: MatSort;
@ViewChild('tableOut', {read: MatSort, static: true}) sortOut: MatSort;
public displayedColumns = [];
public RoutingPeersIncoming: any;
public RoutingPeersOutgoing: any;

View File

@ -18,7 +18,7 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
styleUrls: ['./forwarding-history.component.scss']
})
export class ForwardingHistoryComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
public displayedColumns = [];
public forwardingHistoryEvents: any;
public lastOffsetIndex = 0;

View File

@ -19,7 +19,7 @@ import * as fromRTLReducer from '../../../shared/store/rtl.reducers';
styleUrls: ['./list-transactions.component.scss']
})
export class ListTransactionsComponent implements OnInit, OnDestroy {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
public displayedColumns = [];
public listTransactions: any;
public flgLoading: Array<Boolean | 'error'> = [true];

View File

@ -33,7 +33,7 @@ export const cipherSeedLength: ValidatorFn = (control: FormGroup): ValidationErr
}]
})
export class UnlockLNDComponent implements OnInit, OnDestroy {
@ViewChild(MatStepper) stepper: MatStepper;
@ViewChild(MatStepper, { static: true }) stepper: MatStepper;
public insecureLND = false;
public genSeedResponse = [];
public initWalletResponse = '';
@ -42,6 +42,8 @@ export class UnlockLNDComponent implements OnInit, OnDestroy {
passwordFormGroup: FormGroup;
cipherFormGroup: FormGroup;
passphraseFormGroup: FormGroup;
proceed = true;
warnRes = true;
private unsubs = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private store: Store<fromRTLReducer.State>, private formBuilder: FormBuilder, private rtlEffects: RTLEffects, private router: Router) {}

View File

@ -15,7 +15,8 @@ export class Settings {
public satsToBTC: boolean,
public bitcoindConfigPath?: string,
public enableLogging?: boolean,
public lndServerUrl?: string
public lndServerUrl?: string,
public channelBackupPath?: string
) { }
}

View File

@ -93,6 +93,7 @@ export class RTLEffects implements OnDestroy {
}),
map((rtlConfig: any) => {
this.logger.info(rtlConfig);
if (+rtlConfig.sso.rtlSSO) { this.store.dispatch(new RTLActions.Signout()); }
return {
type: RTLActions.SET_RTL_CONFIG,
payload: rtlConfig

View File

@ -1 +1 @@
export const VERSION = '0.4.3-beta';
export const VERSION = '0.4.4-beta';

View File

@ -8,13 +8,18 @@
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"module": "esnext",
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"es2018",
"dom"
]
}
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}