sqlite3 docker script incomplete

sqlite3 docker script incomplete
pull/905/head
Shahana Farooqui 3 years ago
parent 64ae54bd3d
commit 9c6ac9013b

1
.gitignore vendored

@ -61,3 +61,4 @@ RTL-Config-for-BTC-Testing.json
ECLDummyData.log
_config.yml
.vscode/launch.json
RTL-Config-Docker.json

@ -1,19 +1,29 @@
FROM node:16-alpine
RUN apk add --no-cache tini
WORKDIR /RTL
COPY package.json /RTL/package.json
COPY package-lock.json /RTL/package-lock.json
# Install dependencies
RUN npm install --production
COPY . /RTL
RUN apk add --no-cache g++ git jq make python3 sqlite sqlite-dev \
&& NODE_SQLITE_VERSION=4.2.0 \
&& npm un sqlite3 -S \
&& npm i --production \
&& wget https://github.com/mapbox/node-sqlite3/archive/refs/tags/v${NODE_SQLITE_VERSION}.zip -O /opt/sqlite3.zip \
&& mkdir -p /opt/sqlite3 \
&& unzip /opt/sqlite3.zip -d /opt/sqlite3 \
&& cd /opt/sqlite3/node-sqlite3-${NODE_SQLITE_VERSION} \
&& npm install \
&& ./node_modules/.bin/node-pre-gyp install --fallback-to-build --build-from-source --sqlite=/usr/bin --python=/usr/bin/python3 \
&& mv /opt/sqlite3/node-sqlite3-${NODE_SQLITE_VERSION} /opt/app/node_modules/sqlite3 \
&& apk del g++ git jq make python3 \
&& rm -Rf /opt/sqlite3 /opt/sqlite3.zip
COPY angular/ /RTL/angular/
COPY backend/ /RTL/backend/
COPY rtl.js /RTL/rtl.js
EXPOSE 3000
ENTRYPOINT ["/sbin/tini", "-g", "--"]
CMD ["node", "rtl"]

@ -2,9 +2,6 @@ FROM node:16-stretch-slim AS builder
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-static-armel /tini
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-static-armel.asc /tini.asc
# RUN apt-get install gnupg
# RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
# && gpg --batch --verify /tini.asc /tini
RUN chmod +x /tini
WORKDIR /RTL

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -10,9 +10,9 @@
<link i18n-rel="" rel="mask-icon" href="assets/images/favicon-light/safari-pinned-tab.svg" color="#5bbad5">
<meta i18n-content="" name="msapplication-TileColor" content="#da532c">
<meta i18n-content="" name="theme-color" content="#ffffff">
<style>@font-face{font-family:"Roboto";src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:"Roboto";src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:"Roboto";src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:"Roboto";src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:"Roboto";src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:"Roboto";src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:"Roboto";src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:"Roboto";src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:"Roboto";src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:"Roboto";src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:"Roboto";src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:"Roboto";src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:"Roboto",sans-serif!important;font-size:62.5%}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}</style><link rel="stylesheet" href="styles.15e3ffcb5aa94cda.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.15e3ffcb5aa94cda.css"></noscript></head>
<style>@font-face{font-family:Roboto;src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:62.5%}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}</style><link rel="stylesheet" href="styles.2c38f7d09aa7e379.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.2c38f7d09aa7e379.css"></noscript></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.a6b510948f5c028f.js" type="module"></script><script src="polyfills.c41bc361ba340cf0.js" type="module"></script><script src="main.d0689102a9397134.js" type="module"></script>
<script src="runtime.d1c6c7072345f1ee.js" type="module"></script><script src="polyfills.6d989da208bd6fd1.js" type="module"></script><script src="main.af96d7513f5967b0.js" type="module"></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

@ -1 +0,0 @@
(()=>{"use strict";var e,v={},g={};function r(e){var i=g[e];if(void 0!==i)return i.exports;var t=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(i,t,f,o)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,f,o]=e[n],s=!0,l=0;l<t.length;l++)(!1&o||a>=o)&&Object.keys(r.O).every(b=>r.O[b](t[l]))?t.splice(l--,1):(s=!1,o<a&&(a=o));if(s){e.splice(n--,1);var u=f();void 0!==u&&(i=u)}}return i}o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[t,f,o]},r.n=e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return r.d(i,{a:i}),i},r.d=(e,i)=>{for(var t in i)r.o(i,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:i[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((i,t)=>(r.f[t](e,i),i),[])),r.u=e=>e+"."+{119:"fd44fa722359c380",142:"696681818c67828a",314:"6f64b8d2d7662c1d",871:"d455809c35893640"}[e]+".js",r.miniCssF=e=>"styles.15e3ffcb5aa94cda.css",r.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),(()=>{var e={},i="RTLApp:";r.l=(t,f,o,n)=>{if(e[t])e[t].push(f);else{var a,s;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==i+o){a=d;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",i+o),a.src=r.tu(t)),e[t]=[f];var c=(m,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(_=>_(b)),m)return m(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tu=i=>(void 0===e&&(e={createScriptURL:t=>t},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e.createScriptURL(i))})(),r.p="",(()=>{var e={666:0};r.f.j=(f,o)=>{var n=r.o(e,f)?e[f]:void 0;if(0!==n)if(n)o.push(n[2]);else if(666!=f){var a=new Promise((d,c)=>n=e[f]=[d,c]);o.push(n[2]=a);var s=r.p+r.u(f),l=new Error;r.l(s,d=>{if(r.o(e,f)&&(0!==(n=e[f])&&(e[f]=void 0),n)){var c=d&&("load"===d.type?"missing":d.type),p=d&&d.target&&d.target.src;l.message="Loading chunk "+f+" failed.\n("+c+": "+p+")",l.name="ChunkLoadError",l.type=c,l.request=p,n[1](l)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var i=(f,o)=>{var l,u,[n,a,s]=o,d=0;if(n.some(p=>0!==e[p])){for(l in a)r.o(a,l)&&(r.m[l]=a[l]);if(s)var c=s(r)}for(f&&f(o);d<n.length;d++)r.o(e,u=n[d])&&e[u]&&e[u][0](),e[n[d]]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(i.bind(null,0)),t.push=i.bind(null,t.push.bind(t))})()})();

@ -0,0 +1 @@
(()=>{"use strict";var e,v={},g={};function r(e){var i=g[e];if(void 0!==i)return i.exports;var t=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(i,t,f,o)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,f,o]=e[n],c=!0,d=0;d<t.length;d++)(!1&o||a>=o)&&Object.keys(r.O).every(b=>r.O[b](t[d]))?t.splice(d--,1):(c=!1,o<a&&(a=o));if(c){e.splice(n--,1);var l=f();void 0!==l&&(i=l)}}return i}o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[t,f,o]},r.n=e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return r.d(i,{a:i}),i},r.d=(e,i)=>{for(var t in i)r.o(i,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:i[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((i,t)=>(r.f[t](e,i),i),[])),r.u=e=>e+"."+{341:"b8a580aaec33bd90",637:"b1e644594aecb88a",859:"2fc2085dd229dc4c",893:"58115bdd7e94914a"}[e]+".js",r.miniCssF=e=>{},r.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),(()=>{var e={},i="RTLApp:";r.l=(t,f,o,n)=>{if(e[t])e[t].push(f);else{var a,c;if(void 0!==o)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++){var u=d[l];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==i+o){a=u;break}}a||(c=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",i+o),a.src=r.tu(t)),e[t]=[f];var s=(m,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(_=>_(b)),m)return m(b)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),c&&document.head.appendChild(a)}}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tu=i=>(void 0===e&&(e={createScriptURL:t=>t},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e.createScriptURL(i))})(),r.p="",(()=>{var e={666:0};r.f.j=(f,o)=>{var n=r.o(e,f)?e[f]:void 0;if(0!==n)if(n)o.push(n[2]);else if(666!=f){var a=new Promise((u,s)=>n=e[f]=[u,s]);o.push(n[2]=a);var c=r.p+r.u(f),d=new Error;r.l(c,u=>{if(r.o(e,f)&&(0!==(n=e[f])&&(e[f]=void 0),n)){var s=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;d.message="Loading chunk "+f+" failed.\n("+s+": "+p+")",d.name="ChunkLoadError",d.type=s,d.request=p,n[1](d)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var i=(f,o)=>{var d,l,[n,a,c]=o,u=0;if(n.some(p=>0!==e[p])){for(d in a)r.o(a,d)&&(r.m[d]=a[d]);if(c)var s=c(r)}for(f&&f(o);u<n.length;u++)r.o(e,l=n[u])&&e[l]&&e[l][0](),e[n[u]]=0;return r.O(s)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(i.bind(null,0)),t.push=i.bind(null,t.push.bind(t))})()})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -320,10 +320,15 @@ export class ConfigService {
try {
this.common.rtl_conf_file_path = (process.env.RTL_CONFIG_PATH) ? process.env.RTL_CONFIG_PATH : join(this.directoryName, '../..');
const confFileFullPath = this.common.rtl_conf_file_path + sep + 'RTL-Config.json';
const config = JSON.parse(fs.readFileSync(confFileFullPath, 'utf-8'));
this.updateLogByLevel();
this.validateNodeConfig(config);
this.setSelectedNode(config);
if (!fs.existsSync(confFileFullPath)) {
fs.writeFile(confFileFullPath, JSON.stringify(this.setDefaultConfig()), () => { });
}
else {
const config = JSON.parse(fs.readFileSync(confFileFullPath, 'utf-8'));
this.updateLogByLevel();
this.validateNodeConfig(config);
this.setSelectedNode(config);
}
}
catch (err) {
this.logger.log({ selectedNode: this.common.initSelectedNode, level: 'ERROR', fileName: 'Config', msg: 'Something went wrong while configuring the node server: \n' + err });

@ -1,36 +1,20 @@
/* eslint-disable no-console */
import * as fs from 'fs';
import { join, dirname, sep } from 'path';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
import * as crypto from 'crypto';
import sqlz from 'sequelize';
const { Sequelize } = sqlz;
import { Logger } from '../utils/logger.js';
import { Common } from '../utils/common.js';
import { Offer } from '../models/offers.model.js';
export class DatabaseService {
constructor() {
this.hash = crypto.createHash('sha256');
this.logger = Logger;
this.common = Common;
this.rtlConfigPassword = '';
this.directoryName = dirname(fileURLToPath(import.meta.url));
this.rtlSequelize = null;
this.rtlDB = null;
let confFilePath = ((process.env.RTL_CONFIG_PATH) ? process.env.RTL_CONFIG_PATH : join(this.directoryName, '../..')) + sep + 'RTL-Config.json';
const config = JSON.parse(fs.readFileSync(confFilePath, 'utf-8'));
if ((+process.env.RTL_SSO === 0) || (typeof process.env.RTL_SSO === 'undefined' && +config.SSO.rtlSSO === 0)) {
if ((process.env.APP_PASSWORD && process.env.APP_PASSWORD.trim() !== '') || (config.multiPass && config.multiPass !== '')) {
this.rtlConfigPassword = this.hash.update(process.env.APP_PASSWORD).digest('hex');
}
else if (config.multiPassHashed && config.multiPassHashed !== '') {
this.rtlConfigPassword = config.multiPassHashed;
}
}
this.rtlSequelize = new Sequelize({
database: 'RTLStore',
username: '',
password: this.rtlConfigPassword,
password: '',
storage: join(this.directoryName, '..', '..', 'database', 'rtl-db.sqlite'),
dialect: 'sqlite',
logging: messageToLog => this.logger.log({ level: 'DEBUG', fileName: 'DBLog', msg: messageToLog })

@ -4,6 +4,7 @@ volumes:
bitcoin_data:
lightning_data:
lightning_shared:
rtl_db:
services:
bitcoind:
@ -107,6 +108,7 @@ services:
- lnd
volumes:
- lightning_shared:/shared:ro
- rtl_db:/database
ports:
- "${RTL_PORT}:${RTL_PORT}"
environment:

4177
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -301,10 +301,14 @@ export class ConfigService {
try {
this.common.rtl_conf_file_path = (process.env.RTL_CONFIG_PATH) ? process.env.RTL_CONFIG_PATH : join(this.directoryName, '../..');
const confFileFullPath = this.common.rtl_conf_file_path + sep + 'RTL-Config.json';
const config = JSON.parse(fs.readFileSync(confFileFullPath, 'utf-8'));
this.updateLogByLevel();
this.validateNodeConfig(config);
this.setSelectedNode(config);
if (!fs.existsSync(confFileFullPath)) {
fs.writeFile(confFileFullPath, JSON.stringify(this.setDefaultConfig()), () => { });
} else {
const config = JSON.parse(fs.readFileSync(confFileFullPath, 'utf-8'));
this.updateLogByLevel();
this.validateNodeConfig(config);
this.setSelectedNode(config);
}
} catch (err) {
this.logger.log({ selectedNode: this.common.initSelectedNode, level: 'ERROR', fileName: 'Config', msg: 'Something went wrong while configuring the node server: \n' + err });
throw new Error(err);

@ -1,38 +1,23 @@
/* eslint-disable no-console */
import * as fs from 'fs';
import { join, dirname, sep } from 'path';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
import * as crypto from 'crypto';
import sqlz from 'sequelize';
const { Sequelize } = sqlz;
import { Logger, LoggerService } from '../utils/logger.js';
import { Common, CommonService } from '../utils/common.js';
import { Offer } from '../models/offers.model.js';
export class DatabaseService {
private hash = crypto.createHash('sha256');
public logger: LoggerService = Logger;
public common: CommonService = Common;
public rtlConfigPassword = '';
public directoryName = dirname(fileURLToPath(import.meta.url));
public rtlSequelize = null;
public rtlDB = null;
constructor() {
let confFilePath = ((process.env.RTL_CONFIG_PATH) ? process.env.RTL_CONFIG_PATH : join(this.directoryName, '../..')) + sep + 'RTL-Config.json';
const config = JSON.parse(fs.readFileSync(confFilePath, 'utf-8'));
if ((+process.env.RTL_SSO === 0) || (typeof process.env.RTL_SSO === 'undefined' && +config.SSO.rtlSSO === 0)) {
if ((process.env.APP_PASSWORD && process.env.APP_PASSWORD.trim() !== '') || (config.multiPass && config.multiPass !== '')) {
this.rtlConfigPassword = this.hash.update(process.env.APP_PASSWORD).digest('hex');
} else if (config.multiPassHashed && config.multiPassHashed !== '') {
this.rtlConfigPassword = config.multiPassHashed;
}
}
this.rtlSequelize = new Sequelize({
database: 'RTLStore',
username: '',
password: this.rtlConfigPassword,
password: '',
storage: join(this.directoryName, '..', '..', 'database', 'rtl-db.sqlite'),
dialect: 'sqlite',
logging: messageToLog => this.logger.log({ level: 'DEBUG', fileName: 'DBLog', msg: messageToLog })

@ -188,7 +188,7 @@ export class CLOffersTableComponent implements OnInit, AfterViewInit, OnDestroy
if (offerDecoded.absolute_expiry) {
documentDefinition.content.push({ text: 'Expiry: ' + (this.datePipe.transform(new Date(offerDecoded.absolute_expiry), 'dd/MMM/YYYY HH:mm')) });
}
pdfMake.createPdf(documentDefinition, null, null, pdfFonts.pdfMake.vfs).download(selOffer.offer_id);
pdfMake.createPdf(documentDefinition, null, null, pdfFonts.pdfMake.vfs).download('Offer-' + (offerDecoded ? offerDecoded.description : selOffer.bolt12));
});
}

Loading…
Cancel
Save