Skip to content

Commit 4a9ef71

Browse files
committed
v2.1.4
1 parent e61d527 commit 4a9ef71

8 files changed

+3817
-77
lines changed

bin/emailengine.js

+1-13
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,7 @@ if (process.argv[2] === 'encrypt') {
5050
console.error('-'.repeat(78));
5151
console.error('');
5252

53-
fs.readFile(pathlib.join(__dirname, '..', 'licenses.txt'), (err, data) => {
54-
if (err) {
55-
console.error('Failed to load license information');
56-
console.error(err);
57-
return process.exit(1);
58-
}
59-
60-
console.error('Included Modules');
61-
console.error('================');
62-
63-
console.error(data.toString().trim());
64-
process.exit();
65-
});
53+
process.exit();
6654
});
6755
});
6856
} else {

license-report-config.json

-3
This file was deleted.

license-table.js

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
'use strict';
2+
3+
const he = require('he');
4+
const packageData = require('./package.json');
5+
6+
let chunks = [];
7+
process.stdin.on('readable', () => {
8+
let chunk;
9+
while ((chunk = process.stdin.read()) !== null) {
10+
chunks.push(chunk);
11+
}
12+
});
13+
14+
process.stdin.on('end', () => {
15+
let list = JSON.parse(Buffer.concat(chunks));
16+
17+
console.log(
18+
'<!doctype html><html><head><meta charset="utf-8"><title>EmailEngine Licenses</title><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous"></head><body>'
19+
);
20+
console.log('<div class="container-fluid">');
21+
console.log(`<h1>EmailEngine v${packageData.version}</h1><p>EmailEngine includes code from the following software packages:</p>`);
22+
23+
console.log('<table class="table table-sm">');
24+
console.log(
25+
'<tr><thead class="thead-dark"><th>Package</th><th>Version</th><th>License</th><th>Publisher</th><th>Publisher\'s Email</th><th>Package URL</th></tr>'
26+
);
27+
28+
console.log('<tbody>');
29+
30+
for (let key of Object.keys(list)) {
31+
let splitter = key.lastIndexOf('@');
32+
let packageName = key.substr(0, splitter);
33+
let packageVersion = key.substr(splitter + 1);
34+
let data = list[key];
35+
console.log('<tr>');
36+
37+
console.log(`<td><a href="https://npmjs.com/package/${he.encode(packageName)}">${he.encode(packageName)}</a></td>`);
38+
39+
[packageVersion, [].concat(data.licenses || []).join(', '), data.publisher, data.email]
40+
.map(entry => entry || '')
41+
.forEach(entry => {
42+
console.log('<td>' + he.encode(entry) + '</td>');
43+
});
44+
console.log('<td>');
45+
46+
if (data.repository || data.url) {
47+
console.log(
48+
`<a href="${he.encode(data.repository || data.url)}">${he.encode(
49+
(data.repository || data.url || '').toString().replace(/^https?:\/\//i, '')
50+
)}</a>`
51+
);
52+
}
53+
54+
console.log('</td');
55+
console.log('</tr>');
56+
}
57+
58+
console.log('</tbody></table></div></body></html>');
59+
});

licenses.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ hapi-swagger MIT git://github.com/glennjones/hapi-swa
2020
he MIT git+https://github.com/mathiasbynens/he.git 1.2.0 Mathias Bynens
2121
html-to-text MIT git://github.com/html-to-text/node-html-to-text.git 8.1.0 Malte Legenhausen
2222
humanize n/a git://github.com/taijinlee/humanize.git 0.0.9 Tai-Jin Lee
23-
imapflow MIT git+https://github.com/postalsys/imapflow.git 1.0.77 Postal Systems OÜ
23+
imapflow MIT git+https://github.com/postalsys/imapflow.git 1.0.78 Postal Systems OÜ
2424
ioredis MIT git://github.com/luin/ioredis.git 4.28.1 luin
2525
joi BSD-3-Clause git://github.com/sideway/joi.git 17.4.2 n/a
2626
jquery MIT git+https://github.com/jquery/jquery.git 3.6.0 OpenJS Foundation and other contributors

package.json

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "emailengine-app",
3-
"version": "2.1.3",
3+
"version": "2.1.4",
44
"private": true,
55
"description": "Email Sync Engine",
66
"main": "server.js",
@@ -9,9 +9,8 @@
99
"dev": "node server --dbs.redis='redis://127.0.0.1/9' | pino-pretty",
1010
"test": "grunt",
1111
"swagger": "./getswagger.sh",
12-
"build-dist": "npm run licenses && npm run licenses-text && pkg package.json",
13-
"licenses": "license-report --only=prod --output=html --config license-report-config.json > static/licenses.html",
14-
"licenses-text": "license-report --only=prod --output=table --config license-report-config.json > licenses.txt"
12+
"build-dist": "npm run licenses && rm -rf node_modules package-lock.json && npm install --production && npx pkg --compress Brotli package.json && rm -rf package-lock.json && npm install",
13+
"licenses": "license-checker --json | node license-table.js > static/licenses.html"
1514
},
1615
"keywords": [
1716
"IMAP"
@@ -46,7 +45,7 @@
4645
"handlebars": "4.7.7",
4746
"hapi-auth-bearer-token": "8.0.0",
4847
"hapi-pino": "9.0.0",
49-
"hapi-swagger": "14.2.4",
48+
"hapi-swagger": "^14.2.4",
5049
"he": "1.2.0",
5150
"html-to-text": "8.1.0",
5251
"humanize": "0.0.9",
@@ -60,7 +59,7 @@
6059
"mailsplit": "5.3.1",
6160
"msgpack5": "5.3.2",
6261
"node-fetch": "2.6.6",
63-
"node-vault": "0.9.22",
62+
"node-vault": "^0.5.10",
6463
"nodemailer": "6.7.2",
6564
"pino": "7.4.1",
6665
"prom-client": "14.0.1",
@@ -81,7 +80,7 @@
8180
"grunt": "1.4.1",
8281
"grunt-cli": "1.4.3",
8382
"grunt-eslint": "24.0.0",
84-
"license-report": "4.5.0",
83+
"license-checker": "25.0.1",
8584
"pino-pretty": "7.2.0",
8685
"pkg": "5.4.1"
8786
},
@@ -95,7 +94,6 @@
9594
"lib/lua/**/*",
9695
"node_modules/bull/lib/commands/**/*",
9796
"node_modules/swagger-ui-dist/**/*",
98-
"licenses.txt",
9997
"LICENSE.txt"
10098
],
10199
"_targets": [

static/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ <h1>EmailEngine</h1>
4444
<div class="col-sm-8">
4545
<a href="https://emailengine.app" target="_blank">EmailEngine</a>
4646
<span class="text-muted">&copy; 2020-2021</span>
47-
<a class="text-muted" href="mailto:[email protected]" target="_blank">Postal Systems OÜ</a>
47+
<a class="text-muted" href="mailto:[email protected]" target="_blank">Postal Systems OÜ</a>.
48+
<a href="/licenses.html" target="_blank">Included software</a>.
4849
</div>
4950
</div>
5051
</div>

0 commit comments

Comments
 (0)