emailengine-app 2.79.7 → 2.79.9
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/dependabot.yml +22 -0
- package/.github/workflows/test.yml +39 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +37 -0
- package/DOCKER_DEPLOYMENT.md +8 -7
- package/Dockerfile +35 -11
- package/bin/emailengine.js +29 -13
- package/config/default.toml +15 -4
- package/copy-static-files.sh +23 -5
- package/data/google-crawlers.json +7 -1
- package/docker-compose.yml +12 -3
- package/install.sh +2 -0
- package/lib/account.js +26 -1
- package/lib/api-routes/account-routes.js +14 -3
- package/lib/api-routes/bull-board-routes.js +3 -2
- package/lib/api-routes/mailbox-routes.js +4 -1
- package/lib/api-routes/message-routes.js +6 -5
- package/lib/api-routes/outbox-routes.js +7 -4
- package/lib/api-routes/route-helpers.js +8 -0
- package/lib/api-routes/settings-routes.js +34 -25
- package/lib/api-routes/stats-routes.js +8 -1
- package/lib/api-routes/submit-routes.js +2 -1
- package/lib/api-routes/template-routes.js +3 -2
- package/lib/auth-token.js +73 -2
- package/lib/autodetect-imap-settings.js +33 -25
- package/lib/bounce-detect.js +45 -0
- package/lib/consts.js +13 -2
- package/lib/egress-fetch.js +133 -0
- package/lib/egress-filter.js +39 -4
- package/lib/email-client/base-client.js +274 -24
- package/lib/email-client/gmail/gmail-api.js +15 -7
- package/lib/email-client/gmail-client.js +121 -64
- package/lib/email-client/imap/mailbox.js +18 -59
- package/lib/email-client/imap-client.js +53 -29
- package/lib/email-client/notification-handler.js +11 -2
- package/lib/email-client/outlook/graph-api.js +106 -90
- package/lib/email-client/outlook-client.js +222 -106
- package/lib/export.js +35 -2
- package/lib/generate-text-preview.js +10 -5
- package/lib/handlebars-helpers.js +129 -0
- package/lib/headers-rewriter.js +1 -1
- package/lib/imap-proxy-auth.js +41 -21
- package/lib/imapproxy/imap-core/README.md +1 -0
- package/lib/imapproxy/imap-core/lib/tls-options.js +5 -46
- package/lib/imapproxy/imap-server.js +9 -10
- package/lib/llm-pre-process.js +4 -1
- package/lib/mcp/json-schema.js +50 -2
- package/lib/openapi/index.js +3 -0
- package/lib/outbox.js +50 -8
- package/lib/pre-process.js +4 -1
- package/lib/rate-limit.js +23 -4
- package/lib/rewrite-text-nodes.js +12 -1
- package/lib/schemas.js +37 -8
- package/lib/security-headers.js +396 -0
- package/lib/sentry.js +36 -4
- package/lib/settings.js +19 -1
- package/lib/smtp-auth.js +86 -7
- package/lib/sso.js +13 -3
- package/lib/submit-progress.js +29 -0
- package/lib/templates.js +11 -0
- package/lib/tools.js +361 -173
- package/lib/ui-routes/account-routes.js +73 -13
- package/lib/ui-routes/admin-config-routes.js +7 -21
- package/lib/ui-routes/admin-entities-routes.js +42 -12
- package/lib/ui-routes/auth-routes.js +87 -28
- package/lib/ui-routes/dashboard-routes.js +1 -1
- package/lib/ui-routes/export-routes.js +4 -0
- package/lib/ui-routes/internals-routes.js +2 -0
- package/lib/ui-routes/mcp-consent-routes.js +12 -2
- package/lib/ui-routes/network-config-routes.js +6 -5
- package/lib/ui-routes/oauth-config-routes.js +12 -1
- package/lib/ui-routes/route-helpers.js +65 -14
- package/lib/ui-routes/settings-page.js +10 -0
- package/lib/ui-routes/smtp-test-routes.js +7 -0
- package/lib/ui-routes/suppression-list-routes.js +16 -5
- package/lib/ui-routes/unsubscribe-routes.js +22 -3
- package/lib/webhook-egress.js +5 -0
- package/lib/webhooks.js +14 -2
- package/package.json +23 -26
- package/sbom.json +1 -1
- package/server.js +100 -71
- package/static/css/flyonui.css +1 -1
- package/static/js/ace/css/ace.css +1462 -0
- package/static/js/ace/css/kuroir-1.png +0 -0
- package/static/js/ace/css/kuroir-2.png +0 -0
- package/static/js/ace/css/main-1.png +0 -0
- package/static/js/ace/css/main-10.svg +4 -0
- package/static/js/ace/css/main-11.svg +5 -0
- package/static/js/ace/css/main-12.svg +4 -0
- package/static/js/ace/css/main-13.png +0 -0
- package/static/js/ace/css/main-14.png +0 -0
- package/static/js/ace/css/main-15.png +0 -0
- package/static/js/ace/css/main-16.png +0 -0
- package/static/js/ace/css/main-17.png +0 -0
- package/static/js/ace/css/main-18.png +0 -0
- package/static/js/ace/css/main-19.png +0 -0
- package/static/js/ace/css/main-2.png +0 -0
- package/static/js/ace/css/main-20.png +0 -0
- package/static/js/ace/css/main-21.png +0 -0
- package/static/js/ace/css/main-22.png +0 -0
- package/static/js/ace/css/main-23.png +0 -0
- package/static/js/ace/css/main-24.png +0 -0
- package/static/js/ace/css/main-25.svg +1 -0
- package/static/js/ace/css/main-26.png +0 -0
- package/static/js/ace/css/main-3.png +0 -0
- package/static/js/ace/css/main-4.png +0 -0
- package/static/js/ace/css/main-5.svg +7 -0
- package/static/js/ace/css/main-6.svg +9 -0
- package/static/js/ace/css/main-7.svg +7 -0
- package/static/js/ace/css/main-8.svg +9 -0
- package/static/js/ace/css/main-9.svg +6 -0
- package/static/js/ace/css/theme/kuroir.css +78 -0
- package/static/js/ace/css/theme/tomorrow_night.css +128 -0
- package/static/js/ace/css/theme/tomorrow_night_eighties.css +128 -0
- package/static/js/ace/css/theme/xcode.css +106 -0
- package/static/js/ace/css/tomorrow_night-1.png +0 -0
- package/static/js/ace/css/tomorrow_night-2.png +0 -0
- package/static/js/ace/css/tomorrow_night_eighties-1.png +0 -0
- package/static/js/ace/css/tomorrow_night_eighties-2.png +0 -0
- package/static/js/ace/css/xcode-1.png +0 -0
- package/static/js/ace/css/xcode-2.png +0 -0
- package/static/js/ee-client.js +256 -102
- package/static/js/public.js +7 -0
- package/static/js/ui.js +32 -0
- package/static/licenses.html +338 -298
- package/static/vendor/simplewebauthn/browser.min.js +2 -2
- package/translations/messages.pot +158 -112
- package/views/account/passkeys.hbs +8 -0
- package/views/account/password.hbs +11 -0
- package/views/account/security.hbs +18 -7
- package/views/accounts/account.hbs +21 -38
- package/views/accounts/browse.hbs +3 -1
- package/views/accounts/edit.hbs +1 -1
- package/views/accounts/register/imap-server.hbs +11 -3
- package/views/config/ai.hbs +3 -1
- package/views/config/branding.hbs +4 -2
- package/views/config/document-store/chat.hbs +1 -1
- package/views/config/document-store/index.hbs +1 -1
- package/views/config/email-processing.hbs +2 -0
- package/views/config/imap-proxy.hbs +3 -1
- package/views/config/license.hbs +1 -1
- package/views/config/logging.hbs +3 -1
- package/views/config/mcp.hbs +3 -1
- package/views/config/network.hbs +16 -16
- package/views/config/oauth/app.hbs +4 -4
- package/views/config/security.hbs +2 -0
- package/views/config/service.hbs +3 -1
- package/views/config/smtp.hbs +3 -1
- package/views/config/webhooks.hbs +4 -2
- package/views/error.hbs +10 -2
- package/views/internals/index.hbs +1 -1
- package/views/layout/app.hbs +9 -14
- package/views/layout/login.hbs +1 -1
- package/views/layout/prompt.hbs +1 -1
- package/views/layout/public.hbs +1 -1
- package/views/legal.hbs +1 -1
- package/views/mcp/authorize.hbs +1 -1
- package/views/partials/ace_assets.hbs +13 -0
- package/views/partials/add_account_modal.hbs +1 -1
- package/views/partials/address_list.hbs +4 -4
- package/views/partials/filter_editor_js.hbs +3 -3
- package/views/partials/gateway_js.hbs +1 -1
- package/views/partials/oauth_form.hbs +6 -6
- package/views/partials/public_theme_init.hbs +1 -1
- package/views/partials/template_form.hbs +2 -2
- package/views/partials/test_send.hbs +7 -4
- package/views/partials/theme_init.hbs +1 -1
- package/views/partials/ui/details.hbs +2 -2
- package/views/partials/ui/env-managed-alert.hbs +19 -0
- package/views/partials/webhook_form.hbs +1 -1
- package/views/partials/webhooks_editor_functions.hbs +1 -1
- package/views/reference/redirect.hbs +1 -1
- package/views/templates/template.hbs +2 -2
- package/views/tokens/new.hbs +1 -1
- package/views/unsubscribe.hbs +7 -1
- package/views/webhooks/webhook.hbs +2 -2
- package/workers/api.js +179 -175
- package/workers/export.js +1 -5
- package/workers/imap.js +33 -6
- package/workers/smtp.js +19 -43
- package/workers/submit.js +31 -13
- package/workers/webhooks.js +9 -24
- package/lib/reconnection-manager.js +0 -106
- package/static/front/EmailEngine_logo_horiz.png +0 -0
- package/static/front/EmailEngine_logo_vert.png +0 -0
- package/static/front/index.html +0 -57
- package/static/front/logo.png +0 -0
- package/static/vendor/handlebars/handlebars.min-v4.7.9.js +0 -29
|
@@ -42,7 +42,15 @@ const {
|
|
|
42
42
|
ACCOUNT_DISPLAY_STATES,
|
|
43
43
|
signedFormBlobFields: signedBlobFields
|
|
44
44
|
} = require('../schemas');
|
|
45
|
-
const {
|
|
45
|
+
const {
|
|
46
|
+
formatAccountData,
|
|
47
|
+
identityErrorView,
|
|
48
|
+
ACCOUNT_STATE_DISPLAY,
|
|
49
|
+
adminUrl,
|
|
50
|
+
accountSuggestions,
|
|
51
|
+
isClientError,
|
|
52
|
+
closedAfterConnectMessage
|
|
53
|
+
} = require('./route-helpers');
|
|
46
54
|
const { webhooks: Webhooks } = require('../webhooks');
|
|
47
55
|
const { describeEffectiveRouting, isDeliverableRoute } = require('../webhook-routing');
|
|
48
56
|
const { matchesExpectedIdentity, resolveExpectedIdentity } = require('../account/expected-identity');
|
|
@@ -141,10 +149,6 @@ function init(args) {
|
|
|
141
149
|
|
|
142
150
|
const accounts = await accountObject.listAccounts(request.query.state, request.query.query, request.query.page - 1, request.query.pageSize);
|
|
143
151
|
|
|
144
|
-
if (accounts.pages < request.query.page) {
|
|
145
|
-
request.query.page = accounts.pages;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
152
|
for (let account of accounts.accounts) {
|
|
149
153
|
let accountObject = new Account({ redis, account: account.account });
|
|
150
154
|
try {
|
|
@@ -189,6 +193,13 @@ function init(args) {
|
|
|
189
193
|
return url.pathname + url.search;
|
|
190
194
|
};
|
|
191
195
|
|
|
196
|
+
// A page past the end lists nothing, and the view renders its page links only
|
|
197
|
+
// around a non-empty listing, so it would show "No accounts found" with no way
|
|
198
|
+
// back - send it to the last page instead
|
|
199
|
+
if (accounts.pages && request.query.page > accounts.pages) {
|
|
200
|
+
return h.redirect(getPagingUrl(accounts.pages, request.query.state, request.query.query));
|
|
201
|
+
}
|
|
202
|
+
|
|
192
203
|
if (accounts.pages > accounts.page + 1) {
|
|
193
204
|
nextPage = getPagingUrl(accounts.page + 2, request.query.state, request.query.query);
|
|
194
205
|
}
|
|
@@ -806,6 +817,10 @@ function init(args) {
|
|
|
806
817
|
{
|
|
807
818
|
pageTitleFull: request.app.gt.gettext('Email Account Setup'),
|
|
808
819
|
values,
|
|
820
|
+
// Nothing resolved for the domain, so the server fields come up empty - the
|
|
821
|
+
// page says why rather than looking like a form that forgot its defaults
|
|
822
|
+
autodetectFailed: !serverSettings,
|
|
823
|
+
autodetectDomain: request.payload.email.split('@').pop(),
|
|
809
824
|
autoTest:
|
|
810
825
|
values._source &&
|
|
811
826
|
values.imap_auth_user &&
|
|
@@ -925,13 +940,47 @@ function init(args) {
|
|
|
925
940
|
|
|
926
941
|
if (verifyResult) {
|
|
927
942
|
if (verifyResult.imap && verifyResult.imap.error && verifyResult.imap.code) {
|
|
943
|
+
// The same translation the SMTP branch below does for its codes: the raw
|
|
944
|
+
// socket or ImapFlow error text is not something the person at the form
|
|
945
|
+
// can act on. Closed-after-connect keeps the TLS hint the account state
|
|
946
|
+
// badge shows for it, because a wrong port/TLS pairing is the usual cause.
|
|
928
947
|
switch (verifyResult.imap.code) {
|
|
929
948
|
case 'ENOTFOUND':
|
|
949
|
+
case 'EAI_AGAIN':
|
|
930
950
|
verifyResult.imap.error = request.app.gt.gettext('Server hostname was not found');
|
|
931
951
|
break;
|
|
932
952
|
case 'AUTHENTICATIONFAILED':
|
|
933
953
|
verifyResult.imap.error = request.app.gt.gettext('Invalid username or password');
|
|
934
954
|
break;
|
|
955
|
+
case 'ETIMEDOUT':
|
|
956
|
+
case 'ETIMEOUT':
|
|
957
|
+
case 'GREETING_TIMEOUT':
|
|
958
|
+
verifyResult.imap.error = request.app.gt.gettext('Connection timed out');
|
|
959
|
+
break;
|
|
960
|
+
case 'ECONNREFUSED':
|
|
961
|
+
case 'ECONNRESET':
|
|
962
|
+
case 'EHOSTUNREACH':
|
|
963
|
+
case 'ENETUNREACH':
|
|
964
|
+
verifyResult.imap.error = request.app.gt.gettext('Could not connect to server');
|
|
965
|
+
break;
|
|
966
|
+
case 'ClosedAfterConnectTLS':
|
|
967
|
+
case 'ClosedAfterConnectText':
|
|
968
|
+
verifyResult.imap.error = closedAfterConnectMessage(verifyResult.imap.code, request.app.gt);
|
|
969
|
+
break;
|
|
970
|
+
case 'EPROTO':
|
|
971
|
+
case 'ERR_TLS_CERT_ALTNAME_INVALID':
|
|
972
|
+
case 'ERR_SSL_WRONG_VERSION_NUMBER':
|
|
973
|
+
case 'CERT_HAS_EXPIRED':
|
|
974
|
+
case 'DEPTH_ZERO_SELF_SIGNED_CERT':
|
|
975
|
+
case 'SELF_SIGNED_CERT_IN_CHAIN':
|
|
976
|
+
case 'UNABLE_TO_VERIFY_LEAF_SIGNATURE':
|
|
977
|
+
verifyResult.imap.error = request.app.gt.gettext('TLS protocol error');
|
|
978
|
+
break;
|
|
979
|
+
default:
|
|
980
|
+
if (/openssl|ssl routines/i.test(verifyResult.imap.error)) {
|
|
981
|
+
verifyResult.imap.error = request.app.gt.gettext('TLS protocol error');
|
|
982
|
+
}
|
|
983
|
+
break;
|
|
935
984
|
}
|
|
936
985
|
}
|
|
937
986
|
|
|
@@ -1455,7 +1504,7 @@ function init(args) {
|
|
|
1455
1504
|
return h.view(
|
|
1456
1505
|
'accounts/account',
|
|
1457
1506
|
{
|
|
1458
|
-
pageTitle: `Accounts
|
|
1507
|
+
pageTitle: `Accounts - ${accountData.email}`,
|
|
1459
1508
|
|
|
1460
1509
|
menuAccounts: true,
|
|
1461
1510
|
account: accountData,
|
|
@@ -1480,8 +1529,6 @@ function init(args) {
|
|
|
1480
1529
|
),
|
|
1481
1530
|
gateways: gateways && gateways.gateways,
|
|
1482
1531
|
|
|
1483
|
-
testSendTemplate: cachedTemplates.testSend,
|
|
1484
|
-
|
|
1485
1532
|
accountForm: await getSignedFormData({
|
|
1486
1533
|
account: request.params.account,
|
|
1487
1534
|
name: accountData.name,
|
|
@@ -1544,13 +1591,22 @@ function init(args) {
|
|
|
1544
1591
|
try {
|
|
1545
1592
|
let accountObject = new Account({ redis, account: request.params.account, documentsQueue, call, secret: await getSecret() });
|
|
1546
1593
|
|
|
1547
|
-
let deleted = await accountObject.delete();
|
|
1594
|
+
let { deleted } = await accountObject.delete();
|
|
1548
1595
|
if (deleted) {
|
|
1549
1596
|
await request.flash({ type: 'info', message: `Account deleted` });
|
|
1597
|
+
} else {
|
|
1598
|
+
await request.flash({ type: 'danger', message: `Requested account was not found` });
|
|
1550
1599
|
}
|
|
1551
1600
|
|
|
1552
1601
|
return h.redirect('/admin/accounts');
|
|
1553
1602
|
} catch (err) {
|
|
1603
|
+
if (isClientError(err) && err.output.statusCode === 404) {
|
|
1604
|
+
// Already gone (a stale tab, a double submit): say so and land on the
|
|
1605
|
+
// listing rather than on the deleted account's page
|
|
1606
|
+
await request.flash({ type: 'danger', message: `Requested account was not found` });
|
|
1607
|
+
return h.redirect('/admin/accounts');
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1554
1610
|
await request.flash({ type: 'danger', message: `Couldn't delete account. Try again.` });
|
|
1555
1611
|
request.logger.error({ msg: 'Failed to delete the account', err, account: request.params.account, remoteAddress: request.app.ip });
|
|
1556
1612
|
return h.redirect(adminUrl`/admin/accounts/${request.params.account}`);
|
|
@@ -1865,7 +1921,7 @@ function init(args) {
|
|
|
1865
1921
|
return h.view(
|
|
1866
1922
|
'accounts/browse',
|
|
1867
1923
|
{
|
|
1868
|
-
pageTitle: `Browse
|
|
1924
|
+
pageTitle: `Browse - ${accountData.email}`,
|
|
1869
1925
|
|
|
1870
1926
|
menuAccounts: true,
|
|
1871
1927
|
account: request.params.account,
|
|
@@ -1879,6 +1935,10 @@ function init(args) {
|
|
|
1879
1935
|
},
|
|
1880
1936
|
|
|
1881
1937
|
options: {
|
|
1938
|
+
// Rendered email HTML keeps its remote images, which no other admin page loads. Its
|
|
1939
|
+
// stylesheet needs no exception: the widget stamps the nonce the page passes it
|
|
1940
|
+
// (styleNonce in views/accounts/browse.hbs) onto the element it appends
|
|
1941
|
+
plugins: { securityHeaders: { directives: { 'img-src': "'self' data: https:" } } },
|
|
1882
1942
|
validate: {
|
|
1883
1943
|
options: {
|
|
1884
1944
|
stripUnknown: true,
|
|
@@ -1945,7 +2005,7 @@ function init(args) {
|
|
|
1945
2005
|
return h.view(
|
|
1946
2006
|
'accounts/edit',
|
|
1947
2007
|
{
|
|
1948
|
-
pageTitle: `Accounts
|
|
2008
|
+
pageTitle: `Accounts - ${accountData.email}`,
|
|
1949
2009
|
|
|
1950
2010
|
menuAccounts: true,
|
|
1951
2011
|
account: request.params.account,
|
|
@@ -2108,7 +2168,7 @@ function init(args) {
|
|
|
2108
2168
|
return h.view(
|
|
2109
2169
|
'accounts/edit',
|
|
2110
2170
|
{
|
|
2111
|
-
pageTitle: `Accounts
|
|
2171
|
+
pageTitle: `Accounts - ${accountData.email}`,
|
|
2112
2172
|
|
|
2113
2173
|
menuAccounts: true,
|
|
2114
2174
|
account: request.params.account,
|
|
@@ -2165,7 +2225,7 @@ function init(args) {
|
|
|
2165
2225
|
.view(
|
|
2166
2226
|
'accounts/edit',
|
|
2167
2227
|
{
|
|
2168
|
-
pageTitle: `Accounts
|
|
2228
|
+
pageTitle: `Accounts - ${accountData.email}`,
|
|
2169
2229
|
|
|
2170
2230
|
menuAccounts: true,
|
|
2171
2231
|
account: request.params.account,
|
|
@@ -10,7 +10,6 @@ const Joi = require('joi');
|
|
|
10
10
|
const crypto = require('crypto');
|
|
11
11
|
const config = require('@zone-eu/wild-config');
|
|
12
12
|
const libmime = require('libmime');
|
|
13
|
-
const he = require('he');
|
|
14
13
|
const os = require('os');
|
|
15
14
|
const packageData = require('../../package.json');
|
|
16
15
|
const { simpleParser } = require('mailparser');
|
|
@@ -21,7 +20,7 @@ const consts = require('../consts');
|
|
|
21
20
|
const getSecret = require('../get-secret');
|
|
22
21
|
const timezonesList = require('timezones-list').default;
|
|
23
22
|
const { redis, submitQueue, notifyQueue, documentsQueue } = require('../db');
|
|
24
|
-
const { getByteSize, formatByteSize, getDuration, failAction, readEnvValue, readEnvList, httpAgent } = require('../tools');
|
|
23
|
+
const { getByteSize, formatByteSize, getDuration, failAction, readEnvValue, readEnvList, httpAgent, splitUrlCredentials } = require('../tools');
|
|
25
24
|
const { validateWebhookTarget } = require('../webhook-egress');
|
|
26
25
|
const { sendWebhookRequest } = require('../webhook-request');
|
|
27
26
|
const { llmPreProcess } = require('../llm-pre-process');
|
|
@@ -369,10 +368,9 @@ function init(args) {
|
|
|
369
368
|
timezone: request.payload.timezone
|
|
370
369
|
};
|
|
371
370
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
371
|
+
// Written when emptied too: the schema accepts a blank field, and skipping the
|
|
372
|
+
// write would leave the old URL in place after a save meant to clear it
|
|
373
|
+
data.serviceUrl = request.payload.serviceUrl ? new URL(request.payload.serviceUrl).origin : null;
|
|
376
374
|
|
|
377
375
|
await settings.setMulti(data);
|
|
378
376
|
}
|
|
@@ -1139,21 +1137,9 @@ return true;`
|
|
|
1139
1137
|
};
|
|
1140
1138
|
}
|
|
1141
1139
|
|
|
1142
|
-
let parsed =
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
if (parsed.username) {
|
|
1146
|
-
username = he.decode(parsed.username);
|
|
1147
|
-
parsed.username = '';
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
if (parsed.password) {
|
|
1151
|
-
password = he.decode(parsed.password);
|
|
1152
|
-
parsed.password = '';
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
if (username || password) {
|
|
1156
|
-
headers.Authorization = `Basic ${Buffer.from(he.encode(username || '') + ':' + he.encode(password || '')).toString('base64')}`;
|
|
1140
|
+
let { url: parsed, authorization } = splitUrlCredentials(webhooks);
|
|
1141
|
+
if (authorization) {
|
|
1142
|
+
headers.Authorization = authorization;
|
|
1157
1143
|
}
|
|
1158
1144
|
|
|
1159
1145
|
let customHeaders = request.payload.customHeaders
|
|
@@ -17,7 +17,7 @@ const { templates } = require('../templates');
|
|
|
17
17
|
const { webhooks } = require('../webhooks');
|
|
18
18
|
const consts = require('../consts');
|
|
19
19
|
const wellKnownServices = require('nodemailer/lib/well-known/services.json');
|
|
20
|
-
const { authAwareLevel, resolveKnownAccounts, adminUrl, mcpToolGrants, accountPickerEntry } = require('./route-helpers');
|
|
20
|
+
const { authAwareLevel, isClientError, resolveKnownAccounts, adminUrl, mcpToolGrants, accountPickerEntry, submittedValues } = require('./route-helpers');
|
|
21
21
|
const exampleWebhookPayloads = require('../payload-examples-webhooks.json');
|
|
22
22
|
|
|
23
23
|
const { DEFAULT_PAGE_SIZE } = consts;
|
|
@@ -316,6 +316,7 @@ return payload;`)
|
|
|
316
316
|
{
|
|
317
317
|
pageTitle: 'Webhook Routes',
|
|
318
318
|
menuWebhooks: true,
|
|
319
|
+
values: request.payload,
|
|
319
320
|
errors: err.details,
|
|
320
321
|
|
|
321
322
|
examplePayloadsJson: JSON.stringify(await getExampleWebhookPayloads()),
|
|
@@ -352,14 +353,16 @@ return payload;`)
|
|
|
352
353
|
|
|
353
354
|
return h
|
|
354
355
|
.view(
|
|
355
|
-
'
|
|
356
|
+
'webhooks/new',
|
|
356
357
|
{
|
|
357
|
-
pageTitle: '
|
|
358
|
-
|
|
358
|
+
pageTitle: 'Webhook Routes',
|
|
359
|
+
menuWebhooks: true,
|
|
360
|
+
values: request.payload,
|
|
359
361
|
errors,
|
|
360
362
|
|
|
361
363
|
examplePayloadsJson: JSON.stringify(await getExampleWebhookPayloads()),
|
|
362
|
-
notificationTypesJson: JSON.stringify(notificationTypes)
|
|
364
|
+
notificationTypesJson: JSON.stringify(notificationTypes),
|
|
365
|
+
scriptEnvJson: JSON.stringify((await settings.get('scriptEnv')) || '{}')
|
|
363
366
|
},
|
|
364
367
|
{
|
|
365
368
|
layout: 'app'
|
|
@@ -637,6 +640,7 @@ return payload;`)
|
|
|
637
640
|
|
|
638
641
|
webhook,
|
|
639
642
|
|
|
643
|
+
values: request.payload,
|
|
640
644
|
errors: err.details,
|
|
641
645
|
|
|
642
646
|
examplePayloadsJson: JSON.stringify(await getExampleWebhookPayloads()),
|
|
@@ -686,6 +690,7 @@ return payload;`)
|
|
|
686
690
|
|
|
687
691
|
webhook,
|
|
688
692
|
|
|
693
|
+
values: request.payload,
|
|
689
694
|
errors,
|
|
690
695
|
|
|
691
696
|
examplePayloadsJson: JSON.stringify(await getExampleWebhookPayloads()),
|
|
@@ -1100,6 +1105,7 @@ return payload;`)
|
|
|
1100
1105
|
|
|
1101
1106
|
formats: CODE_FORMATS.map(format => Object.assign({ selected: format.format === request.payload.format }, format)),
|
|
1102
1107
|
|
|
1108
|
+
values: request.payload,
|
|
1103
1109
|
errors: err.details,
|
|
1104
1110
|
|
|
1105
1111
|
contentHtmlJson: JSON.stringify(request.payload.contentHtml || ''),
|
|
@@ -1165,6 +1171,7 @@ return payload;`)
|
|
|
1165
1171
|
|
|
1166
1172
|
formats: CODE_FORMATS.map(format => Object.assign({ selected: format.format === request.payload.format }, format)),
|
|
1167
1173
|
|
|
1174
|
+
values: request.payload,
|
|
1168
1175
|
errors,
|
|
1169
1176
|
|
|
1170
1177
|
contentHtmlJson: JSON.stringify(request.payload.contentHtml || ''),
|
|
@@ -1319,6 +1326,7 @@ return payload;`)
|
|
|
1319
1326
|
|
|
1320
1327
|
formats: CODE_FORMATS.map(format => Object.assign({ selected: format.format === request.payload.format }, format)),
|
|
1321
1328
|
|
|
1329
|
+
values: request.payload,
|
|
1322
1330
|
errors: err.details,
|
|
1323
1331
|
|
|
1324
1332
|
contentHtmlJson: JSON.stringify(request.payload.contentHtml || ''),
|
|
@@ -1376,6 +1384,7 @@ return payload;`)
|
|
|
1376
1384
|
|
|
1377
1385
|
formats: CODE_FORMATS.map(format => Object.assign({ selected: format.format === request.payload.format }, format)),
|
|
1378
1386
|
|
|
1387
|
+
values: request.payload,
|
|
1379
1388
|
errors,
|
|
1380
1389
|
|
|
1381
1390
|
contentHtmlJson: JSON.stringify(request.payload.contentHtml || ''),
|
|
@@ -1558,10 +1567,6 @@ return payload;`)
|
|
|
1558
1567
|
|
|
1559
1568
|
let gateways = await gatewayObject.listGateways(request.query.page - 1, request.query.pageSize, request.query.query);
|
|
1560
1569
|
|
|
1561
|
-
if (gateways.pages < request.query.page) {
|
|
1562
|
-
request.query.page = gateways.pages;
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
1570
|
let nextPage = false;
|
|
1566
1571
|
let prevPage = false;
|
|
1567
1572
|
|
|
@@ -1577,6 +1582,13 @@ return payload;`)
|
|
|
1577
1582
|
return url.pathname + url.search;
|
|
1578
1583
|
};
|
|
1579
1584
|
|
|
1585
|
+
// A page past the end lists nothing, and the view renders its page links only
|
|
1586
|
+
// around a non-empty listing, so it would show "No gateways found" with no way
|
|
1587
|
+
// back - send it to the last page instead
|
|
1588
|
+
if (gateways.pages && request.query.page > gateways.pages) {
|
|
1589
|
+
return h.redirect(getPagingUrl(gateways.pages));
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1580
1592
|
if (gateways.pages > gateways.page + 1) {
|
|
1581
1593
|
nextPage = getPagingUrl(gateways.page + 2);
|
|
1582
1594
|
}
|
|
@@ -1808,7 +1820,10 @@ return payload;`)
|
|
|
1808
1820
|
{
|
|
1809
1821
|
pageTitle: 'Gateways',
|
|
1810
1822
|
menuGateways: true,
|
|
1811
|
-
wellKnownServices: JSON.stringify(Object.keys(wellKnownServices).map(key => Object.assign({ key }, wellKnownServices[key])))
|
|
1823
|
+
wellKnownServices: JSON.stringify(Object.keys(wellKnownServices).map(key => Object.assign({ key }, wellKnownServices[key]))),
|
|
1824
|
+
// the submitted password is not echoed back into the page
|
|
1825
|
+
values: submittedValues(request, 'pass'),
|
|
1826
|
+
errors: err.details
|
|
1812
1827
|
},
|
|
1813
1828
|
{
|
|
1814
1829
|
layout: 'app'
|
|
@@ -1846,6 +1861,7 @@ return payload;`)
|
|
|
1846
1861
|
pageTitle: 'Gateways',
|
|
1847
1862
|
menuGateways: true,
|
|
1848
1863
|
wellKnownServices: JSON.stringify(Object.keys(wellKnownServices).map(key => Object.assign({ key }, wellKnownServices[key]))),
|
|
1864
|
+
values: submittedValues(request, 'pass'),
|
|
1849
1865
|
|
|
1850
1866
|
errors
|
|
1851
1867
|
},
|
|
@@ -1930,7 +1946,9 @@ return payload;`)
|
|
|
1930
1946
|
menuGateways: true,
|
|
1931
1947
|
wellKnownServices: JSON.stringify(Object.keys(wellKnownServices).map(key => Object.assign({ key }, wellKnownServices[key]))),
|
|
1932
1948
|
hasSMTPPass,
|
|
1933
|
-
gatewayData
|
|
1949
|
+
gatewayData,
|
|
1950
|
+
values: submittedValues(request, 'pass'),
|
|
1951
|
+
errors: err.details
|
|
1934
1952
|
},
|
|
1935
1953
|
{
|
|
1936
1954
|
layout: 'app'
|
|
@@ -1975,6 +1993,7 @@ return payload;`)
|
|
|
1975
1993
|
wellKnownServices: JSON.stringify(Object.keys(wellKnownServices).map(key => Object.assign({ key }, wellKnownServices[key]))),
|
|
1976
1994
|
hasSMTPPass,
|
|
1977
1995
|
gatewayData,
|
|
1996
|
+
values: submittedValues(request, 'pass'),
|
|
1978
1997
|
|
|
1979
1998
|
errors
|
|
1980
1999
|
},
|
|
@@ -2138,13 +2157,22 @@ return payload;`)
|
|
|
2138
2157
|
try {
|
|
2139
2158
|
let gatewayObject = new Gateway({ redis, gateway: request.params.gateway, secret: await getSecret() });
|
|
2140
2159
|
|
|
2141
|
-
let deleted = await gatewayObject.delete();
|
|
2160
|
+
let { deleted } = await gatewayObject.delete();
|
|
2142
2161
|
if (deleted) {
|
|
2143
2162
|
await request.flash({ type: 'info', message: `Gateway deleted` });
|
|
2163
|
+
} else {
|
|
2164
|
+
await request.flash({ type: 'danger', message: `Requested gateway was not found` });
|
|
2144
2165
|
}
|
|
2145
2166
|
|
|
2146
2167
|
return h.redirect('/admin/gateways');
|
|
2147
2168
|
} catch (err) {
|
|
2169
|
+
if (isClientError(err) && err.output.statusCode === 404) {
|
|
2170
|
+
// Already gone (a stale tab, a double submit): say so and land on the
|
|
2171
|
+
// listing rather than on the deleted gateway's page
|
|
2172
|
+
await request.flash({ type: 'danger', message: `Requested gateway was not found` });
|
|
2173
|
+
return h.redirect('/admin/gateways');
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2148
2176
|
await request.flash({ type: 'danger', message: `Couldn't delete gateway. Try again.` });
|
|
2149
2177
|
request.logger.error({ msg: 'Failed to delete the gateway', err, gateway: request.params.gateway, remoteAddress: request.app.ip });
|
|
2150
2178
|
return h.redirect(adminUrl`/admin/gateways/gateway/${request.params.gateway}`);
|
|
@@ -2523,6 +2551,8 @@ return payload;`)
|
|
|
2523
2551
|
let deleted = await tokens.delete(request.payload.token, { remoteAddress: request.app.ip });
|
|
2524
2552
|
if (deleted) {
|
|
2525
2553
|
await request.flash({ type: 'info', message: `Token deleted` });
|
|
2554
|
+
} else {
|
|
2555
|
+
await request.flash({ type: 'danger', message: `Requested token was not found` });
|
|
2526
2556
|
}
|
|
2527
2557
|
|
|
2528
2558
|
return h.redirect('/admin/tokens');
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
const Joi = require('joi');
|
|
12
12
|
const crypto = require('crypto');
|
|
13
|
+
const { parentPort } = require('worker_threads');
|
|
13
14
|
const pbkdf2 = require('@phc/pbkdf2');
|
|
14
15
|
const QRCode = require('qrcode');
|
|
15
16
|
const { generateTotpSeed, verifyTotp, generateTotpUrl } = require('../totp');
|
|
@@ -100,6 +101,29 @@ async function verifyAdminPassword(hash, password, logger) {
|
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
|
|
104
|
+
// The current-password check behind the security page's step-down actions (the password change
|
|
105
|
+
// and switching the second factor off). A live session alone is not supposed to reveal the
|
|
106
|
+
// password, and unthrottled the field let a hijacked session guess it at full speed, so the
|
|
107
|
+
// check is rate limited the way the login form is: keyed on the account rather than the address
|
|
108
|
+
// because the caller is already authenticated as it, and with the login form's per-username
|
|
109
|
+
// budget. Owns the limiter and the warn logs; the caller decides how to report the failure.
|
|
110
|
+
//
|
|
111
|
+
// @returns {Promise<{ ok: true } | { ok: false, reason: 'rateLimited' | 'invalid' }>}
|
|
112
|
+
async function verifyCurrentPassword(request, h, authData, password) {
|
|
113
|
+
let rateLimit = await h.checkRateLimit(`password:verify:${authData.user || 'admin'}`, 1, 10, 60);
|
|
114
|
+
if (!rateLimit.success) {
|
|
115
|
+
request.logger.warn({ msg: 'Rate limited', rateLimit, remoteAddress: request.app.ip });
|
|
116
|
+
return { ok: false, reason: 'rateLimited' };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (!(await verifyAdminPassword(authData.password, password, request.logger))) {
|
|
120
|
+
request.logger.warn({ msg: 'Invalid current password', remoteAddress: request.app.ip });
|
|
121
|
+
return { ok: false, reason: 'invalid' };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return { ok: true };
|
|
125
|
+
}
|
|
126
|
+
|
|
103
127
|
// View model for the security page's passkey list. Only the fields the list renders are
|
|
104
128
|
// exposed - the stored credential also carries the public key, the signature counter and
|
|
105
129
|
// the owning user, none of which belong in a template context.
|
|
@@ -542,7 +566,9 @@ function init(args) {
|
|
|
542
566
|
{
|
|
543
567
|
pageTitle: 'Login',
|
|
544
568
|
menuLogin: true,
|
|
545
|
-
errors
|
|
569
|
+
errors,
|
|
570
|
+
// the hidden next input, so a retry still lands where the login started
|
|
571
|
+
values: { next: request.payload.next }
|
|
546
572
|
},
|
|
547
573
|
{
|
|
548
574
|
layout: 'login'
|
|
@@ -578,7 +604,8 @@ function init(args) {
|
|
|
578
604
|
{
|
|
579
605
|
pageTitle: 'Login',
|
|
580
606
|
menuLogin: true,
|
|
581
|
-
errors
|
|
607
|
+
errors,
|
|
608
|
+
values: { next: request.payload.next }
|
|
582
609
|
},
|
|
583
610
|
{
|
|
584
611
|
layout: 'login'
|
|
@@ -709,7 +736,10 @@ function init(args) {
|
|
|
709
736
|
|
|
710
737
|
let username = (request.auth && request.auth.credentials && request.auth.credentials.user) || 'admin';
|
|
711
738
|
|
|
712
|
-
|
|
739
|
+
// The RP ID is what the page names as the hostname the passkeys are bound to: it is
|
|
740
|
+
// derived from the Service URL on every ceremony, so a changed host silently strands
|
|
741
|
+
// every registered passkey, and the page is where that gets explained
|
|
742
|
+
let [registeredPasskeys, { rpId, origin: serviceUrl }] = await Promise.all([listPasskeysForView(username), passkeys.getRpConfig()]);
|
|
713
743
|
|
|
714
744
|
// Both reasons registration would fail are known here, so the button is disabled with
|
|
715
745
|
// the reason on it instead of letting the ceremony run into a server error.
|
|
@@ -730,7 +760,8 @@ function init(args) {
|
|
|
730
760
|
|
|
731
761
|
passkeys: registeredPasskeys,
|
|
732
762
|
passkeyBlockReason,
|
|
733
|
-
serviceUrl
|
|
763
|
+
serviceUrl,
|
|
764
|
+
rpId
|
|
734
765
|
},
|
|
735
766
|
{
|
|
736
767
|
layout: 'app'
|
|
@@ -813,6 +844,22 @@ function init(args) {
|
|
|
813
844
|
}
|
|
814
845
|
|
|
815
846
|
try {
|
|
847
|
+
// Switching the second factor off is a step down that a live session alone should
|
|
848
|
+
// not be able to take - the password change and passkey registration both ask for
|
|
849
|
+
// the password again, and so does this, through the same rate-limited check as
|
|
850
|
+
// the password change because it is the same guess-the-password surface.
|
|
851
|
+
let authData = await settings.get('authData');
|
|
852
|
+
if (authData && authData.password) {
|
|
853
|
+
let verified = await verifyCurrentPassword(request, h, authData, request.payload.password);
|
|
854
|
+
if (!verified.ok) {
|
|
855
|
+
await request.flash({
|
|
856
|
+
type: 'danger',
|
|
857
|
+
message: verified.reason === 'rateLimited' ? `Rate limited, please wait and try again` : `Invalid password`
|
|
858
|
+
});
|
|
859
|
+
return h.redirect(`/admin/account/security`);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
|
|
816
863
|
await settings.set('totpEnabled', false);
|
|
817
864
|
await settings.set('totpSeed', false);
|
|
818
865
|
|
|
@@ -836,11 +883,12 @@ function init(args) {
|
|
|
836
883
|
await request.flash({ type: 'danger', message: `Couldn't disable two-factor auth. Try again.` });
|
|
837
884
|
request.logger.error({ msg: 'Failed to disable 2FA', err });
|
|
838
885
|
|
|
839
|
-
return h.redirect('/admin').takeover();
|
|
886
|
+
return h.redirect('/admin/account/security').takeover();
|
|
840
887
|
},
|
|
841
888
|
|
|
842
889
|
payload: Joi.object({
|
|
843
|
-
type: Joi.string().valid('totp').description('The type of the two-factor authentication method').required()
|
|
890
|
+
type: Joi.string().valid('totp').description('The type of the two-factor authentication method').required(),
|
|
891
|
+
password: Joi.string().max(256).required().label('Current password')
|
|
844
892
|
})
|
|
845
893
|
}
|
|
846
894
|
}
|
|
@@ -1333,7 +1381,9 @@ function init(args) {
|
|
|
1333
1381
|
activePassword: true,
|
|
1334
1382
|
disableAuthWarning: true,
|
|
1335
1383
|
|
|
1336
|
-
username
|
|
1384
|
+
username,
|
|
1385
|
+
// the form warns that a password change removes these
|
|
1386
|
+
passkeyCount: await passkeys.countCredentials(username)
|
|
1337
1387
|
},
|
|
1338
1388
|
{
|
|
1339
1389
|
layout: 'app'
|
|
@@ -1354,23 +1404,11 @@ function init(args) {
|
|
|
1354
1404
|
let authData = await settings.get('authData');
|
|
1355
1405
|
let hasExistingPassword = !!(authData && authData.password);
|
|
1356
1406
|
if (hasExistingPassword) {
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
let rateLimit = await h.checkRateLimit(`password:verify:${authData.user || 'admin'}`, 1, 10, 60);
|
|
1363
|
-
if (!rateLimit.success) {
|
|
1364
|
-
request.logger.warn({ msg: 'Rate limited', rateLimit, remoteAddress: request.app.ip });
|
|
1365
|
-
let err = new Error('Rate limited, please wait and try again');
|
|
1366
|
-
err.details = { password0: err.message };
|
|
1367
|
-
throw err;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
let valid = await verifyAdminPassword(authData.password, request.payload.password0, request.logger);
|
|
1371
|
-
if (!valid) {
|
|
1372
|
-
request.logger.warn({ msg: 'Invalid current password', remoteAddress: request.app.ip });
|
|
1373
|
-
let err = new Error('Failed to verify current password');
|
|
1407
|
+
let verified = await verifyCurrentPassword(request, h, authData, request.payload.password0);
|
|
1408
|
+
if (!verified.ok) {
|
|
1409
|
+
let err = new Error(
|
|
1410
|
+
verified.reason === 'rateLimited' ? 'Rate limited, please wait and try again' : 'Failed to verify current password'
|
|
1411
|
+
);
|
|
1374
1412
|
err.details = { password0: err.message };
|
|
1375
1413
|
throw err;
|
|
1376
1414
|
}
|
|
@@ -1389,9 +1427,14 @@ function init(args) {
|
|
|
1389
1427
|
|
|
1390
1428
|
await settings.set('authData', authData);
|
|
1391
1429
|
|
|
1430
|
+
// Every passkey goes with the old password: registering one takes the password,
|
|
1431
|
+
// so a passkey that outlived a password change could be one registered by whoever
|
|
1432
|
+
// had the old password. The form warns about this while passkeys exist, and the
|
|
1433
|
+
// flash below says how many went.
|
|
1434
|
+
let clearedPasskeys = 0;
|
|
1392
1435
|
try {
|
|
1393
|
-
await passkeys.deleteAllCredentials(authData.user || 'admin');
|
|
1394
|
-
request.logger.info({ msg: 'All passkeys cleared after password change', user: authData.user || 'admin' });
|
|
1436
|
+
clearedPasskeys = await passkeys.deleteAllCredentials(authData.user || 'admin');
|
|
1437
|
+
request.logger.info({ msg: 'All passkeys cleared after password change', user: authData.user || 'admin', cleared: clearedPasskeys });
|
|
1395
1438
|
} catch (passkeyErr) {
|
|
1396
1439
|
request.logger.error({ msg: 'Failed to clear passkeys after password change', err: passkeyErr });
|
|
1397
1440
|
}
|
|
@@ -1402,6 +1445,16 @@ function init(args) {
|
|
|
1402
1445
|
user: authData.user,
|
|
1403
1446
|
passwordVersion: authData.passwordVersion
|
|
1404
1447
|
});
|
|
1448
|
+
|
|
1449
|
+
// Only this API worker's server got the default strategy above. With
|
|
1450
|
+
// EENGINE_WORKERS_API > 1 the other workers decided at boot that the instance
|
|
1451
|
+
// is open (settings.isInstanceSecured() was false then) and would keep serving
|
|
1452
|
+
// /admin without a login until restarted, so the same settings broadcast the
|
|
1453
|
+
// network config page uses tells every API worker to apply it (workers/api.js
|
|
1454
|
+
// handles the authData key). The value is a marker, not the credential.
|
|
1455
|
+
if (parentPort) {
|
|
1456
|
+
parentPort.postMessage({ cmd: 'settings', data: { authData: true } });
|
|
1457
|
+
}
|
|
1405
1458
|
} else {
|
|
1406
1459
|
request.cookieAuth.set('passwordVersion', authData.passwordVersion);
|
|
1407
1460
|
}
|
|
@@ -1416,7 +1469,12 @@ function init(args) {
|
|
|
1416
1469
|
return h.redirect('/admin');
|
|
1417
1470
|
}
|
|
1418
1471
|
|
|
1419
|
-
await request.flash({
|
|
1472
|
+
await request.flash({
|
|
1473
|
+
type: 'info',
|
|
1474
|
+
message: clearedPasskeys
|
|
1475
|
+
? `Password updated and ${clearedPasskeys} registered passkey${clearedPasskeys === 1 ? '' : 's'} removed`
|
|
1476
|
+
: `Password updated`
|
|
1477
|
+
});
|
|
1420
1478
|
|
|
1421
1479
|
return h.redirect('/admin/account/password');
|
|
1422
1480
|
} catch (err) {
|
|
@@ -1434,7 +1492,8 @@ function init(args) {
|
|
|
1434
1492
|
disableAuthWarning: true,
|
|
1435
1493
|
errors: err.details,
|
|
1436
1494
|
|
|
1437
|
-
username
|
|
1495
|
+
username,
|
|
1496
|
+
passkeyCount: await passkeys.countCredentials(username)
|
|
1438
1497
|
},
|
|
1439
1498
|
{
|
|
1440
1499
|
layout: 'app'
|
|
@@ -98,7 +98,7 @@ function init(args) {
|
|
|
98
98
|
color: typeof stats.redisPing !== 'number' ? 'warning' : stats.redisPing < ALLOWED_REDIS_LATENCY ? 'success' : 'danger',
|
|
99
99
|
icon: 'icon-[tabler--clock]',
|
|
100
100
|
comment: 'How many milliseconds does it take to run a Redis command',
|
|
101
|
-
value: typeof stats.redisPing !== 'number' ? '
|
|
101
|
+
value: typeof stats.redisPing !== 'number' ? '-' : nrFormatter.format(stats.redisPing / 1000000)
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -141,6 +141,10 @@ function init(args) {
|
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
143
|
options: {
|
|
144
|
+
// Crumb validates the crumb field of POST payloads only, so a DELETE sent by the page
|
|
145
|
+
// script passed with no CSRF check at all. Restful mode checks the X-CSRF-Token header
|
|
146
|
+
// instead, which is what the account page sends with this request
|
|
147
|
+
plugins: { crumb: { restful: true } },
|
|
144
148
|
validate: {
|
|
145
149
|
options: {
|
|
146
150
|
stripUnknown: true,
|