From 13549d9656f4fc5022092a5a25d195cf0f0c9782 Mon Sep 17 00:00:00 2001 From: bruno-rocha-movile Date: Wed, 7 Dec 2016 10:58:18 -0200 Subject: [PATCH 1/6] Fixed crash if a webhook payload had a field named "payload" --- packages/rocketchat-integrations/server/api/api.coffee | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/rocketchat-integrations/server/api/api.coffee b/packages/rocketchat-integrations/server/api/api.coffee index 1786e0ce2fe..f69b485258c 100644 --- a/packages/rocketchat-integrations/server/api/api.coffee +++ b/packages/rocketchat-integrations/server/api/api.coffee @@ -50,9 +50,6 @@ Api = new Restivus apiPath: 'hooks/' auth: user: -> - if @bodyParams?.payload? - @bodyParams = JSON.parse @bodyParams.payload - @integration = RocketChat.models.Integrations.findOne _id: @request.params.integrationId token: decodeURIComponent @request.params.token From 585046a6cadb493a494852ecb779e6a6d8ba2f7b Mon Sep 17 00:00:00 2001 From: bruno-rocha-movile Date: Thu, 8 Dec 2016 21:46:41 -0200 Subject: [PATCH 2/6] Only unwrapping webhook payloads if necessary --- packages/rocketchat-integrations/server/api/api.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/rocketchat-integrations/server/api/api.coffee b/packages/rocketchat-integrations/server/api/api.coffee index f69b485258c..dadc14439e5 100644 --- a/packages/rocketchat-integrations/server/api/api.coffee +++ b/packages/rocketchat-integrations/server/api/api.coffee @@ -50,6 +50,12 @@ Api = new Restivus apiPath: 'hooks/' auth: user: -> + payloadKeys = Object.keys @bodyParams + payloadIsWrapped = @bodyParams?.payload? and payloadKeys.length == 1 + + if payloadIsWrapped and @request.headers['content-type'] is 'application/x-www-form-urlencoded' + @bodyParams = @bodyParams.payload + @integration = RocketChat.models.Integrations.findOne _id: @request.params.integrationId token: decodeURIComponent @request.params.token From 3ad36736f60b5a23bb9fa479b37b61d3dcdf7ec9 Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Fri, 9 Dec 2016 14:39:26 -0200 Subject: [PATCH 3/6] nom update --- package.json | 4 ++-- packages/rocketchat-livechat/app/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 51abda961d0..2220ec4fe12 100644 --- a/package.json +++ b/package.json @@ -63,9 +63,9 @@ "eslint": "^3.11.1" }, "dependencies": { - "babel-runtime": "^6.18.0", - "bcrypt": "^1.0.0", "jquery": "^2.1.0", + "babel-runtime": "^6.20.0", + "bcrypt": "^1.0.1", "moment": "^2.17.1", "moment-timezone": "^0.5.10", "toastr": "^2.1.2" diff --git a/packages/rocketchat-livechat/app/package.json b/packages/rocketchat-livechat/app/package.json index 1c0bb6f91dc..ca4b67ed8e8 100644 --- a/packages/rocketchat-livechat/app/package.json +++ b/packages/rocketchat-livechat/app/package.json @@ -21,9 +21,9 @@ }, "dependencies": { "autolinker": "^1.4.0", - "babel-runtime": "^6.18.0", - "bcrypt": "^1.0.0", "jquery": "^2.1.0", + "babel-runtime": "^6.20.0", + "bcrypt": "^1.0.1", "moment": "^2.17.1", "toastr": "^2.1.2" } From badf240af77ff7be806135833a0372831392de9d Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Fri, 9 Dec 2016 15:36:19 -0200 Subject: [PATCH 4/6] update momentjs to 2.17.1 --- packages/rocketchat-livechat/app/.meteor/versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-livechat/app/.meteor/versions b/packages/rocketchat-livechat/app/.meteor/versions index 43bf7548171..128e7dfc2af 100644 --- a/packages/rocketchat-livechat/app/.meteor/versions +++ b/packages/rocketchat-livechat/app/.meteor/versions @@ -49,7 +49,7 @@ minimongo@1.0.19 mizzao:timesync@0.4.0 modules@0.7.7 modules-runtime@0.7.7 -momentjs:moment@2.17.0 +momentjs:moment@2.17.1 mongo@1.1.14 mongo-id@1.0.6 npm-bcrypt@0.9.2 From 027647744cb3aea4f0174edc664627eb3c2cf2d5 Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Fri, 9 Dec 2016 15:48:19 -0200 Subject: [PATCH 5/6] conver to js --- server/startup/migrations/v069.coffee | 12 ---- server/startup/migrations/v069.js | 87 +++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 12 deletions(-) delete mode 100644 server/startup/migrations/v069.coffee create mode 100644 server/startup/migrations/v069.js diff --git a/server/startup/migrations/v069.coffee b/server/startup/migrations/v069.coffee deleted file mode 100644 index 601ce26a40d..00000000000 --- a/server/startup/migrations/v069.coffee +++ /dev/null @@ -1,12 +0,0 @@ -RocketChat.Migrations.add - version: 69 - up: -> - RocketChat.models.Settings.update { "_id": "theme-color-custom-scrollbar-color", "value": "rgba(255, 255, 255, 0.05)" }, { $set: { "editor": "expression", "value": "@transparent-darker" } } - RocketChat.models.Settings.update { "_id": "theme-color-info-font-color", "value": "#aaaaaa" }, { $set: { "editor": "expression", "value": "@secondary-font-color" } } - RocketChat.models.Settings.update { "_id": "theme-color-link-font-color", "value": "#008ce3" }, { $set: { "editor": "expression", "value": "@primary-action-color" } } - RocketChat.models.Settings.update { "_id": "theme-color-status-away", "value": "#fcb316" }, { $set: { "editor": "expression", "value": "@pending-color" } } - RocketChat.models.Settings.update { "_id": "theme-color-status-busy", "value": "#d30230" }, { $set: { "editor": "expression", "value": "@error-color" } } - RocketChat.models.Settings.update { "_id": "theme-color-status-offline", "value": "rgba(150, 150, 150, 0.50)" }, { $set: { "editor": "expression", "value": "@transparent-darker" } } - RocketChat.models.Settings.update { "_id": "theme-color-status-online", "value": "#35ac19" }, { $set: { "editor": "expression", "value": "@success-color" } } - RocketChat.models.Settings.update { "_id": "theme-color-tertiary-background-color", "value": "#eaeaea" }, { $set: { "editor": "expression", "value": "@component-color" } } - RocketChat.models.Settings.update { "_id": "theme-color-tertiary-font-color", "value": "rgba(255, 255, 255, 0.6)" }, { $set: { "editor": "expression", "value": "@transparent-lightest" } } diff --git a/server/startup/migrations/v069.js b/server/startup/migrations/v069.js new file mode 100644 index 00000000000..b49c1183efd --- /dev/null +++ b/server/startup/migrations/v069.js @@ -0,0 +1,87 @@ +RocketChat.Migrations.add({ + version: 69, + up: function() { + RocketChat.models.Settings.update({ + "_id": "theme-color-custom-scrollbar-color", + "value": "rgba(255, 255, 255, 0.05)" + }, { + $set: { + "editor": "expression", + "value": "@transparent-darker" + } + }); + RocketChat.models.Settings.update({ + "_id": "theme-color-info-font-color", + "value": "#aaaaaa" + }, { + $set: { + "editor": "expression", + "value": "@secondary-font-color" + } + }); + RocketChat.models.Settings.update({ + "_id": "theme-color-link-font-color", + "value": "#008ce3" + }, { + $set: { + "editor": "expression", + "value": "@primary-action-color" + } + }); + RocketChat.models.Settings.update({ + "_id": "theme-color-status-away", + "value": "#fcb316" + }, { + $set: { + "editor": "expression", + "value": "@pending-color" + } + }); + RocketChat.models.Settings.update({ + "_id": "theme-color-status-busy", + "value": "#d30230" + }, { + $set: { + "editor": "expression", + "value": "@error-color" + } + }); + RocketChat.models.Settings.update({ + "_id": "theme-color-status-offline", + "value": "rgba(150, 150, 150, 0.50)" + }, { + $set: { + "editor": "expression", + "value": "@transparent-darker" + } + }); + RocketChat.models.Settings.update({ + "_id": "theme-color-status-online", + "value": "#35ac19" + }, { + $set: { + "editor": "expression", + "value": "@success-color" + } + }); + RocketChat.models.Settings.update({ + "_id": "theme-color-tertiary-background-color", + "value": "#eaeaea" + }, { + $set: { + "editor": "expression", + "value": "@component-color" + } + }); + return RocketChat.models.Settings.update({ + "_id": "theme-color-tertiary-font-color", + "value": "rgba(255, 255, 255, 0.6)" + }, { + $set: { + "editor": "expression", + "value": "@transparent-lightest" + } + }); + } +}); + From 6e879a33ad360abd5a8282e6c08246f2d57278d3 Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Fri, 9 Dec 2016 16:20:45 -0200 Subject: [PATCH 6/6] slint fix --- server/startup/migrations/v069.js | 72 +++++++++++++++---------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/server/startup/migrations/v069.js b/server/startup/migrations/v069.js index b49c1183efd..8e56b7a932d 100644 --- a/server/startup/migrations/v069.js +++ b/server/startup/migrations/v069.js @@ -2,84 +2,84 @@ RocketChat.Migrations.add({ version: 69, up: function() { RocketChat.models.Settings.update({ - "_id": "theme-color-custom-scrollbar-color", - "value": "rgba(255, 255, 255, 0.05)" + '_id': 'theme-color-custom-scrollbar-color', + 'value': 'rgba(255, 255, 255, 0.05)' }, { $set: { - "editor": "expression", - "value": "@transparent-darker" + 'editor': 'expression', + 'value': '@transparent-darker' } }); RocketChat.models.Settings.update({ - "_id": "theme-color-info-font-color", - "value": "#aaaaaa" + '_id': 'theme-color-info-font-color', + 'value': '#aaaaaa' }, { $set: { - "editor": "expression", - "value": "@secondary-font-color" + 'editor': 'expression', + 'value': '@secondary-font-color' } }); RocketChat.models.Settings.update({ - "_id": "theme-color-link-font-color", - "value": "#008ce3" + '_id': 'theme-color-link-font-color', + 'value': '#008ce3' }, { $set: { - "editor": "expression", - "value": "@primary-action-color" + 'editor': 'expression', + 'value': '@primary-action-color' } }); RocketChat.models.Settings.update({ - "_id": "theme-color-status-away", - "value": "#fcb316" + '_id': 'theme-color-status-away', + 'value': '#fcb316' }, { $set: { - "editor": "expression", - "value": "@pending-color" + 'editor': 'expression', + 'value': '@pending-color' } }); RocketChat.models.Settings.update({ - "_id": "theme-color-status-busy", - "value": "#d30230" + '_id': 'theme-color-status-busy', + 'value': '#d30230' }, { $set: { - "editor": "expression", - "value": "@error-color" + 'editor': 'expression', + 'value': '@error-color' } }); RocketChat.models.Settings.update({ - "_id": "theme-color-status-offline", - "value": "rgba(150, 150, 150, 0.50)" + '_id': 'theme-color-status-offline', + 'value': 'rgba(150, 150, 150, 0.50)' }, { $set: { - "editor": "expression", - "value": "@transparent-darker" + 'editor': 'expression', + 'value': '@transparent-darker' } }); RocketChat.models.Settings.update({ - "_id": "theme-color-status-online", - "value": "#35ac19" + '_id': 'theme-color-status-online', + 'value': '#35ac19' }, { $set: { - "editor": "expression", - "value": "@success-color" + 'editor': 'expression', + 'value': '@success-color' } }); RocketChat.models.Settings.update({ - "_id": "theme-color-tertiary-background-color", - "value": "#eaeaea" + '_id': 'theme-color-tertiary-background-color', + 'value': '#eaeaea' }, { $set: { - "editor": "expression", - "value": "@component-color" + 'editor': 'expression', + 'value': '@component-color' } }); return RocketChat.models.Settings.update({ - "_id": "theme-color-tertiary-font-color", - "value": "rgba(255, 255, 255, 0.6)" + '_id': 'theme-color-tertiary-font-color', + 'value': 'rgba(255, 255, 255, 0.6)' }, { $set: { - "editor": "expression", - "value": "@transparent-lightest" + 'editor': 'expression', + 'value': '@transparent-lightest' } }); }