Skip to content

Commit

Permalink
Merge pull request RocketChat#573 from WideChat/develop_pwa-catchup-f…
Browse files Browse the repository at this point in the history
…e768b8

[Upstream Catchup] Merge RC:master to develop_pwa
  • Loading branch information
ear-dev committed Apr 1, 2021
2 parents f4fc015 + 034ed39 commit 082c8c2
Show file tree
Hide file tree
Showing 19 changed files with 381 additions and 123 deletions.
2 changes: 1 addition & 1 deletion .docker/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/ubi8/nodejs-12

ENV RC_VERSION 3.12.0
ENV RC_VERSION 3.12.3

MAINTAINER buildmaster@rocket.chat

Expand Down
16 changes: 16 additions & 0 deletions .github/history-manual.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,21 @@
"contributors": [
"sampaiodiego"
]
}],
"3.12.2": [{
"title": "[FIX] Bump Livechat widget",
"userLogin": "sampaiodiego",
"contributors": [
"sampaiodiego"
]
}, {
"title": "[FIX] Security Hotfix (https://docs.rocket.chat/guides/security/security-updates)",
"userLogin": "sampaiodiego",
"contributors": [
"sampaiodiego",
"g-thome",
"KevLehman",
"matheusbsilva137"
]
}]
}
154 changes: 154 additions & 0 deletions .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -56582,6 +56582,160 @@
"4.0"
],
"pull_requests": []
},
"3.10.6": {
"node_version": "12.18.4",
"npm_version": "6.14.8",
"apps_engine_version": "1.21.0-alpha.4235",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": []
},
"3.11.2": {
"node_version": "12.18.4",
"npm_version": "6.14.8",
"apps_engine_version": "1.22.2",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "20727",
"title": "[FIX] Room owner not being able to override global retention policy",
"userLogin": "g-thome",
"description": "use correct permissions to check if room owner can override global retention policy",
"milestone": "3.11.2",
"contributors": [
"g-thome"
]
},
{
"pr": "20860",
"title": "[FIX] Prevent Message Attachment rendering",
"userLogin": "ggazzo",
"milestone": "3.11.2",
"contributors": [
"ggazzo"
]
},
{
"pr": "20740",
"title": "[FIX] External systems not being able to change Omnichannel Inquiry priorities ",
"userLogin": "renatobecker",
"description": "Due to a wrong property name, external applications were not able to change the priority of Omnichannel Inquires.",
"milestone": "3.11.2",
"contributors": [
"renatobecker"
]
}
]
},
"3.12.1": {
"node_version": "12.18.4",
"npm_version": "6.14.8",
"apps_engine_version": "1.23.0",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "21020",
"title": "[FIX] Missing spaces on attachment ",
"userLogin": "dougfabris",
"milestone": "3.12.1",
"contributors": [
"dougfabris",
"tassoevan",
"web-flow"
]
},
{
"pr": "21004",
"title": "[IMPROVE] Close Call contextual bar after starting jitsi call.",
"userLogin": "yash-rajpal",
"description": "After jitsi call is started, if the call is started in a new window then we should close contextual tab bar.\r\nSo, when 'YES' is pressed on modal, we call handleClose function if openNewWindow is true, as call doesn't starts on tab bar, it starts on new window.",
"milestone": "3.12.1",
"contributors": [
"yash-rajpal",
"tassoevan",
"web-flow"
]
},
{
"pr": "20973",
"title": "[FIX] Stopping Jitsi reload",
"userLogin": "yash-rajpal",
"description": "The Function where Jitsi call is started gets called many times due to `room.usernames` dep of useMemo, this dep triggers reloading of this function many times.\r\nSo removing this dep from useMemo dependencies",
"milestone": "3.12.1",
"contributors": [
"yash-rajpal",
"tassoevan",
"web-flow"
]
}
]
},
"3.8.9": {
"node_version": "12.18.4",
"npm_version": "6.14.8",
"apps_engine_version": "1.19.0",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": []
},
"3.10.7": {
"node_version": "12.18.4",
"npm_version": "6.14.8",
"apps_engine_version": "1.21.0-alpha.4235",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": []
},
"3.11.3": {
"node_version": "12.18.4",
"npm_version": "6.14.8",
"apps_engine_version": "1.22.2",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": []
},
"3.12.2": {
"node_version": "12.18.4",
"npm_version": "6.14.8",
"apps_engine_version": "1.23.0",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": []
},
"3.12.3": {
"node_version": "12.18.4",
"npm_version": "6.14.8",
"apps_engine_version": "1.23.0",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": []
}
}
}
1 change: 1 addition & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }}
REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .snapcraft/resources/prepareRocketChat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

curl -SLf "https://releases.rocket.chat/3.12.0/download/" -o rocket.chat.tgz
curl -SLf "https://releases.rocket.chat/3.12.3/download/" -o rocket.chat.tgz

tar xf rocket.chat.tgz --strip 1

Expand Down
2 changes: 1 addition & 1 deletion .snapcraft/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 5. `snapcraft snap`

name: rocketchat-server
version: 3.12.0
version: 3.12.3
summary: Rocket.Chat server
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
confinement: strict
Expand Down
87 changes: 87 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,63 @@

# 3.12.2
`2021-03-26 · 2 🐛 · 4 👩‍💻👨‍💻`

### Engine versions
- Node: `12.18.4`
- NPM: `6.14.8`
- MongoDB: `3.4, 3.6, 4.0`
- Apps-Engine: `1.23.0`

### 🐛 Bug fixes


- Bump Livechat widget

- Security Hotfix (https://docs.rocket.chat/guides/security/security-updates)

### 👩‍💻👨‍💻 Core Team 🤓

- [@KevLehman](https://github.com/KevLehman)
- [@g-thome](https://github.com/g-thome)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@sampaiodiego](https://github.com/sampaiodiego)

# 3.12.1
`2021-03-08 · 1 🚀 · 2 🐛 · 3 👩‍💻👨‍💻`

### Engine versions
- Node: `12.18.4`
- NPM: `6.14.8`
- MongoDB: `3.4, 3.6, 4.0`
- Apps-Engine: `1.23.0`

### 🚀 Improvements


- Close Call contextual bar after starting jitsi call. ([#21004](https://github.com/RocketChat/Rocket.Chat/pull/21004) by [@yash-rajpal](https://github.com/yash-rajpal))

After jitsi call is started, if the call is started in a new window then we should close contextual tab bar.
So, when 'YES' is pressed on modal, we call handleClose function if openNewWindow is true, as call doesn't starts on tab bar, it starts on new window.

### 🐛 Bug fixes


- Missing spaces on attachment ([#21020](https://github.com/RocketChat/Rocket.Chat/pull/21020))

- Stopping Jitsi reload ([#20973](https://github.com/RocketChat/Rocket.Chat/pull/20973) by [@yash-rajpal](https://github.com/yash-rajpal))

The Function where Jitsi call is started gets called many times due to `room.usernames` dep of useMemo, this dep triggers reloading of this function many times.
So removing this dep from useMemo dependencies

### 👩‍💻👨‍💻 Contributors 😍

- [@yash-rajpal](https://github.com/yash-rajpal)

### 👩‍💻👨‍💻 Core Team 🤓

- [@dougfabris](https://github.com/dougfabris)
- [@tassoevan](https://github.com/tassoevan)

# 3.12.0
`2021-02-28 · 5 🎉 · 17 🚀 · 74 🐛 · 30 🔍 · 29 👩‍💻👨‍💻`

Expand Down Expand Up @@ -538,6 +597,34 @@
- [@tassoevan](https://github.com/tassoevan)
- [@tiagoevanp](https://github.com/tiagoevanp)

# 3.11.2
`2021-02-28 · 3 🐛 · 3 👩‍💻👨‍💻`

### Engine versions
- Node: `12.18.4`
- NPM: `6.14.8`
- MongoDB: `3.4, 3.6, 4.0`
- Apps-Engine: `1.22.2`

### 🐛 Bug fixes


- External systems not being able to change Omnichannel Inquiry priorities ([#20740](https://github.com/RocketChat/Rocket.Chat/pull/20740))

Due to a wrong property name, external applications were not able to change the priority of Omnichannel Inquires.

- Prevent Message Attachment rendering ([#20860](https://github.com/RocketChat/Rocket.Chat/pull/20860))

- Room owner not being able to override global retention policy ([#20727](https://github.com/RocketChat/Rocket.Chat/pull/20727))

use correct permissions to check if room owner can override global retention policy

### 👩‍💻👨‍💻 Core Team 🤓

- [@g-thome](https://github.com/g-thome)
- [@ggazzo](https://github.com/ggazzo)
- [@renatobecker](https://github.com/renatobecker)

# 3.11.1
`2021-02-10 · 5 🐛 · 6 👩‍💻👨‍💻`

Expand Down
3 changes: 2 additions & 1 deletion app/api/server/v1/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ API.v1.addRoute('users.2fa.sendEmailCode', {
const userId = this.userId || Users[method](emailOrUsername, { fields: { _id: 1 } })?._id;

if (!userId) {
throw new Meteor.Error('error-invalid-user', 'Invalid user');
this.logger.error('[2fa] User was not found when requesting 2fa email code');
return API.v1.success();
}

emailCheck.sendEmailCode(getUserForCheck(userId));
Expand Down
2 changes: 2 additions & 0 deletions app/emoji-custom/server/methods/insertOrUpdateEmoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Meteor.methods({
emojiData.aliases = [];
}

emojiData.extension = emojiData.extension === 'svg+xml' ? 'png' : emojiData.extension;

let matchingResults = [];

if (emojiData._id) {
Expand Down
18 changes: 16 additions & 2 deletions app/emoji-custom/server/methods/uploadEmojiCustom.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
import { Meteor } from 'meteor/meteor';
import limax from 'limax';
import sharp from 'sharp';

import { hasPermission } from '../../../authorization';
import { RocketChatFile } from '../../../file';
import { RocketChatFileEmojiCustomInstance } from '../startup/emoji-custom';
import { api } from '../../../../server/sdk/api';

const getFile = async (file, extension) => {
if (extension !== 'svg+xml') {
return file;
}

return sharp(file)
.png()
.toBuffer();
};

Meteor.methods({
uploadEmojiCustom(binaryContent, contentType, emojiData) {
async uploadEmojiCustom(binaryContent, contentType, emojiData) {
if (!hasPermission(this.userId, 'manage-emoji')) {
throw new Meteor.Error('not_authorized');
}

emojiData.name = limax(emojiData.name, { replacement: '_' });
// delete aliases for notification purposes. here, it is a string rather than an array
delete emojiData.aliases;
const file = new Buffer(binaryContent, 'binary');

const file = await getFile(Buffer.from(binaryContent, 'binary'), emojiData.extension);

emojiData.extension = emojiData.extension === 'svg+xml' ? 'png' : emojiData.extension;

const rs = RocketChatFile.bufferToStream(file);
RocketChatFileEmojiCustomInstance.deleteFile(encodeURIComponent(`${ emojiData.name }.${ emojiData.extension }`));
Expand Down
3 changes: 2 additions & 1 deletion app/mailer/server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import stripHtml from 'string-strip-html';

import { settings } from '../../settings/server';
import { escapeHTML } from '../../../lib/escapeHTML';
import { replaceVariables } from './utils.js';

let contentHeader;
let contentFooter;
Expand All @@ -25,7 +26,7 @@ settings.get('Language', (key, value) => {
});

export const replacekey = (str, key, value = '') => str.replace(new RegExp(`(\\[${ key }\\]|__${ key }__)`, 'igm'), escapeHTML(value));
export const translate = (str) => str.replace(/\{ ?([^\} ]+)(( ([^\}]+))+)? ?\}/gmi, (match, key) => TAPi18n.__(key, { lng }));
export const translate = (str) => replaceVariables(str, (match, key) => TAPi18n.__(key, { lng }));
export const replace = function replace(str, data = {}) {
if (!str) {
return '';
Expand Down
1 change: 1 addition & 0 deletions app/mailer/server/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const replaceVariables = (str, callback) => str.replace(/\{ *([^\{\} ]+)[^\{\}]*\}/gmi, callback);
Loading

0 comments on commit 082c8c2

Please sign in to comment.