diff --git a/js/modules/debuglogs.js b/js/modules/debuglogs.js index 8c4e2643025..2df24535fbf 100644 --- a/js/modules/debuglogs.js +++ b/js/modules/debuglogs.js @@ -3,6 +3,8 @@ const FormData = require('form-data'); const got = require('got'); +const pify = require('pify'); +const { gzip } = require('zlib'); const BASE_URL = 'https://debuglogs.org'; const VERSION = window.getVersion(); @@ -52,12 +54,12 @@ exports.upload = async content => { form.append(key, value); }); - const contentBuffer = Buffer.from(content, 'utf8'); - const contentType = 'text/plain'; + const contentBuffer = await pify(gzip)(Buffer.from(content, 'utf8')); + const contentType = 'application/gzip'; form.append('Content-Type', contentType); form.append('file', contentBuffer, { contentType, - filename: `signal-desktop-debug-log-${VERSION}.txt`, + filename: `signal-desktop-debug-log-${VERSION}.txt.gz`, }); window.log.info('Debug log upload starting...'); diff --git a/package.json b/package.json index 6d462d152a5..d4b99ec2819 100644 --- a/package.json +++ b/package.json @@ -212,7 +212,6 @@ "eslint-plugin-import": "2.8.0", "eslint-plugin-mocha": "4.12.1", "eslint-plugin-more": "0.3.1", - "extract-zip": "1.6.6", "file-loader": "4.2.0", "grunt": "1.0.1", "grunt-cli": "1.2.0", diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index ff1650b953c..a376b58ee02 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -207,25 +207,25 @@ "rule": "jQuery-append(", "path": "js/modules/debuglogs.js", "line": " form.append('key', fields.key);", - "lineNumber": 48, + "lineNumber": 50, "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" + "updated": "2020-03-20T20:40:34.498Z" }, { "rule": "jQuery-append(", "path": "js/modules/debuglogs.js", "line": " form.append(key, value);", - "lineNumber": 52, + "lineNumber": 54, "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" + "updated": "2020-03-20T20:40:34.498Z" }, { "rule": "jQuery-append(", "path": "js/modules/debuglogs.js", "line": " form.append('Content-Type', contentType);", - "lineNumber": 57, + "lineNumber": 59, "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" + "updated": "2020-03-20T20:40:34.498Z" }, { "rule": "jQuery-load(", diff --git a/ts/util/lint/linter.ts b/ts/util/lint/linter.ts index d5e88d11197..5de12143025 100644 --- a/ts/util/lint/linter.ts +++ b/ts/util/lint/linter.ts @@ -153,7 +153,6 @@ const excludedFiles = [ '^node_modules/eslint*', '^node_modules/esprima/*', '^node_modules/express/*', - '^node_modules/extract-zip/*', '^node_modules/file-loader/*', '^node_modules/file-system-cache/*', // Currently only used in storybook '^node_modules/finalhandler/*', diff --git a/yarn.lock b/yarn.lock index 8ee9026c372..4c420d45a89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6978,15 +6978,6 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extract-zip@1.6.6, extract-zip@^1.6.5: - version "1.6.6" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.6.tgz#1290ede8d20d0872b429fd3f351ca128ec5ef85c" - dependencies: - concat-stream "1.6.0" - debug "2.6.9" - mkdirp "0.5.0" - yauzl "2.4.1" - extract-zip@^1.0.3: version "1.6.0" resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.0.tgz#7f400c9607ea866ecab7aa6d54fb978eeb11621a" @@ -6996,6 +6987,15 @@ extract-zip@^1.0.3: mkdirp "0.5.0" yauzl "2.4.1" +extract-zip@^1.6.5: + version "1.6.6" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.6.tgz#1290ede8d20d0872b429fd3f351ca128ec5ef85c" + dependencies: + concat-stream "1.6.0" + debug "2.6.9" + mkdirp "0.5.0" + yauzl "2.4.1" + extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"