diff --git a/app/controllers/web/my-account/update-domain.js b/app/controllers/web/my-account/update-domain.js index ca64f2881..aae4a0c8a 100644 --- a/app/controllers/web/my-account/update-domain.js +++ b/app/controllers/web/my-account/update-domain.js @@ -8,7 +8,7 @@ const punycode = require('node:punycode'); const RE2 = require('re2'); const Boom = require('@hapi/boom'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const isSANB = require('is-string-and-not-blank'); const { boolean } = require('boolean'); const { isPort } = require('validator'); diff --git a/app/controllers/web/my-account/validate-alias.js b/app/controllers/web/my-account/validate-alias.js index 3b56c2ebd..82cf653f8 100644 --- a/app/controllers/web/my-account/validate-alias.js +++ b/app/controllers/web/my-account/validate-alias.js @@ -6,7 +6,7 @@ const Boom = require('@hapi/boom'); const RE2 = require('re2'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const isSANB = require('is-string-and-not-blank'); const slug = require('speakingurl'); const splitLines = require('split-lines'); diff --git a/app/models/aliases.js b/app/models/aliases.js index 6b0e008f7..750ea4bf3 100644 --- a/app/models/aliases.js +++ b/app/models/aliases.js @@ -6,7 +6,7 @@ const Boom = require('@hapi/boom'); const RE2 = require('re2'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const captainHook = require('captain-hook'); const isFQDN = require('is-fqdn'); const isSANB = require('is-string-and-not-blank'); diff --git a/app/models/domains.js b/app/models/domains.js index 7fe569ed9..c3070e593 100644 --- a/app/models/domains.js +++ b/app/models/domains.js @@ -13,7 +13,7 @@ const { setTimeout } = require('node:timers/promises'); const Boom = require('@hapi/boom'); const RE2 = require('re2'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const cryptoRandomString = require('crypto-random-string'); const dayjs = require('dayjs-with-plugins'); const getDmarcRecord = require('mailauth/lib/dmarc/get-dmarc-record'); diff --git a/app/models/emails.js b/app/models/emails.js index d20177c01..a5bc00114 100644 --- a/app/models/emails.js +++ b/app/models/emails.js @@ -11,7 +11,7 @@ const Axe = require('axe'); const Boom = require('@hapi/boom'); const SpamScanner = require('spamscanner'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const dayjs = require('dayjs-with-plugins'); const getStream = require('get-stream'); const intoStream = require('into-stream'); diff --git a/app/models/logs.js b/app/models/logs.js index 9a6fbc13b..6a2cacd39 100644 --- a/app/models/logs.js +++ b/app/models/logs.js @@ -12,7 +12,7 @@ const Graceful = require('@ladjs/graceful'); const Redis = require('@ladjs/redis'); const _ = require('lodash'); const ansiHTML = require('ansi-html-community'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const captainHook = require('captain-hook'); const dayjs = require('dayjs-with-plugins'); const isFQDN = require('is-fqdn'); diff --git a/app/models/users.js b/app/models/users.js index 4e44be273..9bc07bf93 100644 --- a/app/models/users.js +++ b/app/models/users.js @@ -5,7 +5,7 @@ const Boom = require('@hapi/boom'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const captainHook = require('captain-hook'); const countryList = require('country-list'); const cryptoRandomString = require('crypto-random-string'); diff --git a/config/index.js b/config/index.js index 673ab56a7..3d83d04b9 100644 --- a/config/index.js +++ b/config/index.js @@ -10,7 +10,7 @@ const path = require('node:path'); const Axe = require('axe'); const Boom = require('@hapi/boom'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const consolidate = require('@ladjs/consolidate'); const dayjs = require('dayjs-with-plugins'); const isSANB = require('is-string-and-not-blank'); diff --git a/config/utilities.js b/config/utilities.js index 6ec6fd118..b171c2e35 100644 --- a/config/utilities.js +++ b/config/utilities.js @@ -12,7 +12,7 @@ const _ = require('lodash'); const ajc = require('array-join-conjunction'); const ansiHTML = require('ansi-html-community'); const arrayJoinConjunction = require('array-join-conjunction'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const capitalize = require('capitalize'); const dashify = require('dashify'); const dayjs = require('dayjs-with-plugins'); diff --git a/helpers/imap/on-append.js b/helpers/imap/on-append.js index df38cbe8d..e1eb7aa48 100644 --- a/helpers/imap/on-append.js +++ b/helpers/imap/on-append.js @@ -15,7 +15,7 @@ const { Buffer } = require('node:buffer'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const dayjs = require('dayjs-with-plugins'); const isHTML = require('is-html'); const mongoose = require('mongoose'); diff --git a/helpers/message-splitter.js b/helpers/message-splitter.js index f9291e406..13d6128ae 100644 --- a/helpers/message-splitter.js +++ b/helpers/message-splitter.js @@ -10,7 +10,7 @@ const { Transform } = require('node:stream'); // Many thanks to Andris Reissman // // -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const { Headers } = require('mailsplit'); const { Iconv } = require('iconv'); diff --git a/helpers/monitor-server.js b/helpers/monitor-server.js index 77e97f271..639514193 100644 --- a/helpers/monitor-server.js +++ b/helpers/monitor-server.js @@ -20,7 +20,7 @@ const { // heapdumpOnOOM: false // }); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const checkDiskSpace = require('check-disk-space').default; // const dayjs = require('dayjs-with-plugins'); const ip = require('ip'); diff --git a/helpers/on-data-mx.js b/helpers/on-data-mx.js index e4b7f01f8..e42a03b6b 100644 --- a/helpers/on-data-mx.js +++ b/helpers/on-data-mx.js @@ -7,7 +7,7 @@ const { Buffer } = require('node:buffer'); const SpamScanner = require('spamscanner'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const isSANB = require('is-string-and-not-blank'); const { SRS } = require('sender-rewriting-scheme'); const { isEmail } = require('validator'); diff --git a/helpers/on-data.js b/helpers/on-data.js index 94ee67c71..8b287b0cf 100644 --- a/helpers/on-data.js +++ b/helpers/on-data.js @@ -6,7 +6,7 @@ const { Buffer } = require('node:buffer'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const getStream = require('get-stream'); const pFilter = require('p-filter'); const safeStringify = require('fast-safe-stringify'); diff --git a/helpers/parse-payload.js b/helpers/parse-payload.js index 313db6e97..3ad519911 100644 --- a/helpers/parse-payload.js +++ b/helpers/parse-payload.js @@ -12,7 +12,7 @@ const { randomUUID } = require('node:crypto'); const { Headers, Splitter, Joiner } = require('mailsplit'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const checkDiskSpace = require('check-disk-space').default; const dayjs = require('dayjs-with-plugins'); const getStream = require('get-stream'); diff --git a/helpers/sync-temporary-mailbox.js b/helpers/sync-temporary-mailbox.js index 2197eaa80..0b13cc4f4 100644 --- a/helpers/sync-temporary-mailbox.js +++ b/helpers/sync-temporary-mailbox.js @@ -6,7 +6,7 @@ const { Buffer } = require('node:buffer'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const checkDiskSpace = require('check-disk-space').default; const ms = require('ms'); const pify = require('pify'); diff --git a/helpers/worker.js b/helpers/worker.js index 211994385..1547fb857 100644 --- a/helpers/worker.js +++ b/helpers/worker.js @@ -20,7 +20,7 @@ const Redis = require('@ladjs/redis'); const _ = require('lodash'); const archiver = require('archiver'); const archiverZipEncrypted = require('archiver-zip-encrypted'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const checkDiskSpace = require('check-disk-space').default; const dashify = require('dashify'); const getStream = require('get-stream'); diff --git a/imap-server.js b/imap-server.js index 47c172616..4a9de2ccf 100644 --- a/imap-server.js +++ b/imap-server.js @@ -18,7 +18,7 @@ const os = require('node:os'); const MessageHandler = require('wildduck/lib/message-handler'); const RateLimiter = require('async-ratelimiter'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const mongoose = require('mongoose'); const pRetry = require('p-retry'); const pWaitFor = require('p-wait-for'); diff --git a/jobs/cleanup-sqlite.js b/jobs/cleanup-sqlite.js index 1b4f9e088..ce1534d7a 100644 --- a/jobs/cleanup-sqlite.js +++ b/jobs/cleanup-sqlite.js @@ -18,7 +18,7 @@ require('#config/mongoose'); const Graceful = require('@ladjs/graceful'); const Redis = require('@ladjs/redis'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const dayjs = require('dayjs-with-plugins'); const mongoose = require('mongoose'); const ms = require('ms'); diff --git a/jobs/cleanup-tmp.js b/jobs/cleanup-tmp.js index 882993ac1..f97243c10 100644 --- a/jobs/cleanup-tmp.js +++ b/jobs/cleanup-tmp.js @@ -16,7 +16,7 @@ const { parentPort } = require('node:worker_threads'); require('#config/mongoose'); const Graceful = require('@ladjs/graceful'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const ip = require('ip'); const mongoose = require('mongoose'); const ms = require('ms'); diff --git a/mx-server.js b/mx-server.js index 0e41cefdf..d93f98ec6 100644 --- a/mx-server.js +++ b/mx-server.js @@ -5,7 +5,7 @@ const fs = require('node:fs'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const ms = require('ms'); const pify = require('pify'); const { SMTPServer } = require('smtp-server'); diff --git a/package.json b/package.json index b31a783da..2d6ca5ccc 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "@aws-sdk/s3-request-presigner": "3.637.0", "@forevolve/bootstrap-dark": "4.0.2", "@fortawesome/fontawesome-free": "5.15.4", + "@forwardemail/bytes": "4.0.0", "@forwardemail/highlight-pug": "1.0.1", "@forwardemail/passport-fido2-webauthn": "0.1.0", "@forwardemail/uuid-by-string": "5.0.0", @@ -99,7 +100,6 @@ "bree": "9.2.4", "bson-objectid": "2.0.4", "bufferutil": "4.0.8", - "bytes": "3.1.2", "cabin": "13.2.8", "caldav-adapter": "7.0.6", "capitalize": "2.0.4", diff --git a/smtp-server.js b/smtp-server.js index a59d802e1..806cf4d34 100644 --- a/smtp-server.js +++ b/smtp-server.js @@ -6,7 +6,7 @@ const fs = require('node:fs'); const RateLimiter = require('async-ratelimiter'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const ms = require('ms'); const pify = require('pify'); const { SMTPServer } = require('smtp-server'); diff --git a/test/imap/index.js b/test/imap/index.js index cbf0ddff3..d24786b6e 100644 --- a/test/imap/index.js +++ b/test/imap/index.js @@ -17,7 +17,7 @@ const { Buffer } = require('node:buffer'); const { createHash, randomUUID } = require('node:crypto'); const Axe = require('axe'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const dayjs = require('dayjs-with-plugins'); const getStream = require('get-stream'); const ip = require('ip'); diff --git a/test/smtp/index.js b/test/smtp/index.js index 596f6ebe7..027c4bcee 100644 --- a/test/smtp/index.js +++ b/test/smtp/index.js @@ -11,7 +11,7 @@ const API = require('@ladjs/api'); const Client = require('nodemailer/lib/smtp-connection'); const Redis = require('ioredis-mock'); const _ = require('lodash'); -const bytes = require('bytes'); +const bytes = require('@forwardemail/bytes'); const dayjs = require('dayjs-with-plugins'); const ip = require('ip'); const ms = require('ms');