emailengine-app 2.73.1 → 2.74.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/docker-smoke-test.sh +45 -0
- package/.github/workflows/deploy.yml +22 -0
- package/.github/workflows/release.yaml +19 -0
- package/.github/workflows/test.yml +31 -0
- package/CHANGELOG.md +55 -0
- package/Dockerfile +14 -4
- package/data/google-crawlers.json +1 -1
- package/lib/api-routes/token-routes.js +13 -0
- package/lib/consts.js +15 -0
- package/lib/delivery-error.js +34 -11
- package/lib/email-client/imap/mailbox.js +96 -1
- package/lib/email-client/imap-client.js +101 -28
- package/lib/schemas.js +16 -2
- package/lib/settings.js +13 -0
- package/lib/tokens.js +15 -0
- package/lib/ui-routes/account-routes.js +65 -5
- package/lib/ui-routes/admin-entities-routes.js +13 -0
- package/lib/ui-routes/internals-routes.js +135 -67
- package/lib/ui-routes/route-helpers.js +9 -6
- package/lib/worker-rpc-error.js +54 -0
- package/package.json +9 -8
- package/sbom.json +1 -1
- package/server.js +3 -19
- package/setup-production.sh +7 -2
- package/static/css/flyonui.css +1 -1
- package/static/licenses.html +18 -18
- package/translations/messages.pot +24 -24
- package/views/accounts/edit.hbs +6 -0
- package/views/config/ai.hbs +3 -1
- package/views/internals/index.hbs +55 -29
- package/views/layout/app.hbs +22 -0
- package/views/partials/document_store_header.hbs +7 -4
- package/workers/api.js +5 -4
- package/workers/imap.js +3 -16
- package/workers/submit.js +3 -18
package/server.js
CHANGED
|
@@ -114,6 +114,7 @@ initSentry('main');
|
|
|
114
114
|
// Import additional dependencies
|
|
115
115
|
const pathlib = require('path');
|
|
116
116
|
const { redis, queueConf, notifyQueue, submitQueue, documentsQueue, exportQueue } = require('./lib/db');
|
|
117
|
+
const { packRpcError, unpackRpcError } = require('./lib/worker-rpc-error');
|
|
117
118
|
const promClient = require('prom-client');
|
|
118
119
|
const fs = require('fs').promises;
|
|
119
120
|
const crypto = require('crypto');
|
|
@@ -1262,17 +1263,7 @@ let spawnWorker = async (type, opts) => {
|
|
|
1262
1263
|
clearTimeout(timer);
|
|
1263
1264
|
callQueue.delete(message.mid);
|
|
1264
1265
|
if (message.error) {
|
|
1265
|
-
|
|
1266
|
-
if (message.code) {
|
|
1267
|
-
err.code = message.code;
|
|
1268
|
-
}
|
|
1269
|
-
if (message.statusCode) {
|
|
1270
|
-
err.statusCode = message.statusCode;
|
|
1271
|
-
}
|
|
1272
|
-
if (message.info) {
|
|
1273
|
-
err.info = message.info;
|
|
1274
|
-
}
|
|
1275
|
-
return reject(err);
|
|
1266
|
+
return reject(unpackRpcError(message));
|
|
1276
1267
|
} else {
|
|
1277
1268
|
return resolve(message.response);
|
|
1278
1269
|
}
|
|
@@ -1309,14 +1300,7 @@ let spawnWorker = async (type, opts) => {
|
|
|
1309
1300
|
}
|
|
1310
1301
|
})
|
|
1311
1302
|
.catch(err => {
|
|
1312
|
-
let callPayload = {
|
|
1313
|
-
cmd: 'resp',
|
|
1314
|
-
mid: message.mid,
|
|
1315
|
-
error: err.message,
|
|
1316
|
-
code: err.code,
|
|
1317
|
-
statusCode: err.statusCode,
|
|
1318
|
-
info: err.info
|
|
1319
|
-
};
|
|
1303
|
+
let callPayload = Object.assign({ cmd: 'resp', mid: message.mid }, packRpcError(err));
|
|
1320
1304
|
|
|
1321
1305
|
try {
|
|
1322
1306
|
postMessage(worker, callPayload);
|
package/setup-production.sh
CHANGED
|
@@ -55,6 +55,10 @@ if [ ! -f "docker-compose.yml" ]; then
|
|
|
55
55
|
exit 1
|
|
56
56
|
fi
|
|
57
57
|
|
|
58
|
+
# Everything this script writes from here on (the .env file and its backup) holds EENGINE_SECRET and
|
|
59
|
+
# generated passwords, so create them owner-only from birth instead of tightening after the fact.
|
|
60
|
+
umask 077
|
|
61
|
+
|
|
58
62
|
# Create .env file if it doesn't exist
|
|
59
63
|
if [ -f ".env" ]; then
|
|
60
64
|
print_message $YELLOW "Warning: .env file already exists"
|
|
@@ -64,8 +68,9 @@ if [ -f ".env" ]; then
|
|
|
64
68
|
print_message $YELLOW "Setup cancelled. Existing .env file preserved."
|
|
65
69
|
exit 0
|
|
66
70
|
fi
|
|
67
|
-
# Backup existing .env
|
|
68
|
-
|
|
71
|
+
# Backup existing .env. It holds EENGINE_SECRET and generated passwords; umask 077 (set above)
|
|
72
|
+
# keeps the copy owner-only from creation rather than leaving a world-readable window.
|
|
73
|
+
cp .env ".env.backup.$(date +%Y%m%d-%H%M%S)"
|
|
69
74
|
print_message $GREEN "✓ Existing .env backed up"
|
|
70
75
|
fi
|
|
71
76
|
|