Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.15.3 #1467

Merged
merged 9 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
"no-label-var": "error",
"no-restricted-globals": "error",
"no-undef-init": "error",
"no-undefined": "error",
"block-spacing": "error",
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"comma-style": "error",
Expand Down
44 changes: 24 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,29 @@ name: Artifact

on:
push:
branches: [ master, 'Release-*' ]
tags: [ 'v*' ]
release:
types: [released]
# Triggers the workflow only when merging pull request to the branches.
pull_request:
types: [closed]
branches: [ master, 'Release-*' ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

inputs:
version:
description: 'Release version'
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Cache node_modules
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-npm-packages
with:
path: node_modules
Expand All @@ -37,7 +35,7 @@ jobs:
run: npm ci --legacy-peer-deps

- name: Cache build frontend
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-build-frontend
with:
path: frontend
Expand All @@ -47,7 +45,7 @@ jobs:
run: npm run buildfrontend

- name: Cache build backend
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-build-backend
with:
path: backend
Expand All @@ -61,26 +59,32 @@ jobs:
needs: build
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache build frontend
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-build-frontend
with:
path: frontend
key: ${{ runner.os }}-frontend-${{ github.sha }}

- name: Cache build backend
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-build-backend
with:
path: backend
key: ${{ runner.os }}-backend-${{ github.sha }}

- name: Compress files
run: tar -czf /tmp/rtlbuild.tar.gz frontend backend rtl.js package.json package-lock.json

- uses: actions/upload-artifact@v2
env:
VERSION: "${{ github.event.release.tag_name || github.event.inputs.version || '' }}"
run: |
tar -czf /tmp/rtl-build-$VERSION.tar.gz frontend backend rtl.js package.json package-lock.json
zip -r /tmp/rtl-build-$VERSION.zip frontend backend rtl.js package.json package-lock.json

- uses: actions/upload-artifact@v3
with:
name: rtl-build-${{ github.event.release.tag_name }}
path: /tmp/rtlbuild.tar.gz
name: rtl-build-${{ github.event.release.tag_name || github.event.inputs.version || '' }}
path: |
/tmp/rtl-build-${{ github.event.release.tag_name || github.event.inputs.version || '' }}.tar.gz
/tmp/rtl-build-${{ github.event.release.tag_name || github.event.inputs.version || '' }}.zip
4 changes: 2 additions & 2 deletions backend/controllers/cln/invoices.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export const deleteExpiredInvoice = (req, res, next) => {
if (options.error) {
return res.status(options.statusCode).json({ message: options.message, error: options.error });
}
options.url = req.session.selectedNode.settings.lnServerUrl + '/v1/delexpiredinvoice';
options.url = req.session.selectedNode.settings.lnServerUrl + '/v1/autoclean-once';
options.body = req.body;
request.post(options).then((body) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoice', msg: 'Invoices Deleted', data: body });
res.status(204).json({ status: 'Invoice Deleted Successfully' });
res.status(201).json({ status: 'Cleaned Invoices: ' + body.autoclean.expiredinvoices.cleaned + ', Uncleaned Invoices: ' + body.autoclean.expiredinvoices.uncleaned });
}).catch((errRes) => {
const err = common.handleError(errRes, 'Invoice', 'Delete Invoice Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });
Expand Down
2 changes: 1 addition & 1 deletion backend/controllers/cln/offers.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const disableOffer = (req, res, next) => {
if (options.error) {
return res.status(options.statusCode).json({ message: options.message, error: options.error });
}
options.url = req.session.selectedNode.settings.lnServerUrl + '/v1/disableOffer';
options.url = req.session.selectedNode.settings.lnServerUrl + '/v1/disableoffer';
options.body = req.body;
request.post(options).then((body) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Offers', msg: 'Offer Disabled', data: body });
Expand Down
2 changes: 1 addition & 1 deletion backend/controllers/eclair/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const simplifyAllChannels = (selNode, channels) => {
});
channelNodeIds = channelNodeIds.substring(1);
options.url = selNode.settings.lnServerUrl + '/nodes';
options.form = { nodeIds: channelNodeIds };
options.form = channelNodeIds;
logger.log({ selectedNode: selNode, level: 'DEBUG', fileName: 'Channels', msg: 'Node Ids to find alias', data: channelNodeIds });
return request.post(options).then((nodes) => {
logger.log({ selectedNode: selNode, level: 'DEBUG', fileName: 'Channels', msg: 'Filtered Nodes Received', data: nodes });
Expand Down
41 changes: 0 additions & 41 deletions backend/controllers/lnd/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,47 +155,6 @@ export const postChannel = (req, res, next) => {
return res.status(err.statusCode).json({ message: err.message, error: err.error });
});
};
export const postTransactions = (req, res, next) => {
const { paymentReq, paymentAmount, feeLimit, outgoingChannel, allowSelfPayment, lastHopPubkey } = req.body;
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Sending Payment..' });
options = common.getOptions(req);
if (options.error) {
return res.status(options.statusCode).json({ message: options.message, error: options.error });
}
options.url = req.session.selectedNode.settings.lnServerUrl + '/v1/channels/transaction-stream';
options.form = { payment_request: paymentReq };
if (paymentAmount) {
options.form.amt = paymentAmount;
}
if (feeLimit) {
options.form.fee_limit = feeLimit;
}
if (outgoingChannel) {
options.form.outgoing_chan_id = outgoingChannel;
}
if (allowSelfPayment) {
options.form.allow_self_payment = allowSelfPayment;
}
if (lastHopPubkey) {
options.form.last_hop_pubkey = Buffer.from(lastHopPubkey, 'hex').toString('base64');
}
options.form = JSON.stringify(options.form);
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Send Payment Options', data: options.form });
request.post(options).then((body) => {
body = body.result ? body.result : body;
if (body.payment_error) {
const err = common.handleError(body.payment_error, 'Channels', 'Send Payment Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });
}
else {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Payment Sent', data: body });
res.status(201).json(body);
}
}).catch((errRes) => {
const err = common.handleError(errRes, 'Channels', 'Send Payment Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });
});
};
export const closeChannel = (req, res, next) => {
try {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Closing Channel..' });
Expand Down
30 changes: 30 additions & 0 deletions backend/controllers/lnd/payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,33 @@ export const paymentLookup = (req, res, next) => {
return res.status(err.statusCode).json({ message: err.message, error: err.error });
});
};
export const sendPayment = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Payments', msg: 'Sending Payment..' });
options = common.getOptions(req);
if (options.error) {
return res.status(options.statusCode).json({ message: options.message, error: options.error });
}
options.url = req.session.selectedNode.settings.lnServerUrl + '/v2/router/send';
if (req.body.last_hop_pubkey) {
req.body.last_hop_pubkey = Buffer.from(req.body.last_hop_pubkey, 'hex').toString('base64');
}
req.body.amp = req.body.amp ?? false;
req.body.timeout_seconds = req.body.timeout_seconds || 600;
options.form = JSON.stringify(req.body);
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Payments', msg: 'Send Payment Options', data: options.form });
request.post(options).then((body) => {
const results = body.split('\n').filter(Boolean).map((jsonString) => JSON.parse(jsonString));
body = results.length > 0 ? results[results.length - 1] : { result: { status: 'UNKNOWN' } };
if (body.result.status === 'FAILED') {
const err = common.handleError(common.titleCase(body.result.failure_reason.replace(/_/g, ' ').replace('FAILURE REASON ', '')), 'Payments', 'Send Payment Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });
}
if (body.result.status === 'SUCCEEDED') {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Payments', msg: 'Payment Sent', data: body.result });
res.status(201).json(body.result);
}
}).catch((errRes) => {
const err = common.handleError(errRes, 'Payments', 'Send Payment Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });
});
};
3 changes: 1 addition & 2 deletions backend/routes/lnd/channels.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getAllChannels, getPendingChannels, getClosedChannels, postChannel, postTransactions, closeChannel, postChanPolicy } from '../../controllers/lnd/channels.js';
import { getAllChannels, getPendingChannels, getClosedChannels, postChannel, closeChannel, postChanPolicy } from '../../controllers/lnd/channels.js';
const router = Router();
router.get('/', isAuthenticated, getAllChannels);
router.get('/pending', isAuthenticated, getPendingChannels);
router.get('/closed', isAuthenticated, getClosedChannels);
router.post('/', isAuthenticated, postChannel);
router.post('/transactions', isAuthenticated, postTransactions);
router.delete('/:channelPoint', isAuthenticated, closeChannel);
router.post('/chanPolicy', isAuthenticated, postChanPolicy);
export default router;
3 changes: 2 additions & 1 deletion backend/routes/lnd/payments.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { decodePayment, decodePayments, getPayments, getAllLightningTransactions, paymentLookup } from '../../controllers/lnd/payments.js';
import { decodePayment, decodePayments, getPayments, getAllLightningTransactions, paymentLookup, sendPayment } from '../../controllers/lnd/payments.js';
const router = Router();
router.get('/', isAuthenticated, getPayments);
router.get('/alltransactions', isAuthenticated, getAllLightningTransactions);
router.get('/decode/:payRequest', isAuthenticated, decodePayment);
router.get('/lookup/:paymentHash', isAuthenticated, paymentLookup);
router.post('/', isAuthenticated, decodePayments);
router.post('/send', isAuthenticated, sendPayment);
export default router;
3 changes: 2 additions & 1 deletion backend/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ export class CommonService {
}
});
};
this.readCookie = () => {
this.readCookie = (config) => {
this.appConfig.SSO = config.SSO;
const exists = fs.existsSync(this.appConfig.SSO.rtlCookiePath);
if (exists) {
try {
Expand Down
4 changes: 2 additions & 2 deletions backend/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class ConfigService {
this.common.nodes[idx] = { settings: { blockExplorerUrl: '' }, authentication: {} };
this.common.nodes[idx].index = node.index;
this.common.nodes[idx].lnNode = node.lnNode;
this.common.nodes[idx].lnImplementation = (process?.env?.lnImplementation) ? process?.env?.lnImplementation : node.lnImplementation ? node.lnImplementation : 'LND';
this.common.nodes[idx].lnImplementation = (process?.env?.LN_IMPLEMENTATION) ? process?.env?.LN_IMPLEMENTATION : node.lnImplementation ? node.lnImplementation : 'LND';
if (this.common.nodes[idx].lnImplementation === 'CLT') {
this.common.nodes[idx].lnImplementation = 'CLN';
}
Expand Down Expand Up @@ -343,7 +343,7 @@ export class ConfigService {
this.errMsg = 'Please set rtlCookiePath value for single sign on option!';
}
else {
this.common.readCookie();
this.common.readCookie(config);
}
}
};
Expand Down
1 change: 1 addition & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ docker build -t rtl:${RTL_VERSION} -f dockerfiles/Dockerfile .
Create an environment file with your required configurations. Sample .env:
```
RTL_CONFIG_PATH=/RTLConfig
LN_IMPLEMENTATION=LND
MACAROON_PATH=/LNDMacaroon
LN_SERVER_URL=https://host.docker.internal:8080

Expand Down
1 change: 1 addition & 0 deletions frontend/17.6fa7154eb6e447e2.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/17.d00d31d08d7bad32.js

This file was deleted.

1 change: 1 addition & 0 deletions frontend/190.03f035c34a56c8be.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/190.88ca997666a3998a.js

This file was deleted.

1 change: 1 addition & 0 deletions frontend/193.0e1a81316bbc29da.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/193.b1206fbf24aa1327.js

This file was deleted.

Loading
Loading