Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop sync #7363

Merged
merged 34 commits into from
Jun 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
88e9cfd
Fix mobile avatars (#7177)
rodrigok Jun 7, 2017
e85109a
Fix migration version
geekgonecrazy Jun 3, 2017
5bcdcfd
Removing the kadira package install on build
JSzaszvari Jun 3, 2017
a9a830b
Fixes emoji titles translations
MartinSchoeler Jun 8, 2017
f885e2c
fix wrong commit
MartinSchoeler Jun 8, 2017
b66e1bc
Fix the admin oauthApps view not working due to converting to js from…
graywolf336 Jun 8, 2017
969599a
Merge branch 'develop' into release-candidate
geekgonecrazy Jun 8, 2017
b791a65
Revert merge from develop
sampaiodiego Jun 12, 2017
1c87c92
Merge pull request #7209 from RocketChat/fix-requirePasswordChange-no…
sampaiodiego Jun 9, 2017
c5ffd45
Fix the Zapier oAuth return url to the new one (#7215)
graywolf336 Jun 9, 2017
c5723da
Merge pull request #7208 from RocketChat/fix-oembed-previews-not-showing
sampaiodiego Jun 9, 2017
452b970
Fix editing others messages (#7200)
sampaiodiego Jun 8, 2017
8ea4a8b
Bump version to 0.57.0-rc.2
sampaiodiego Jun 12, 2017
e7e0785
[FIX] Proxy upload to correct instance
rodrigok Jun 21, 2017
f96832c
Move code to correct place
rodrigok Jun 22, 2017
f1e9f70
Merge pull request #7321 from RocketChat/fix-secret-url
rodrigok Jun 23, 2017
940ab0d
fix undefined description|title on image preview
ggazzo Jun 7, 2017
b031171
Merge pull request #7304 from RocketChat/hotfix/rc-avatar-upload-proxy
rodrigok Jun 27, 2017
f68a42c
Merge pull request #7345 from RocketChat/fix-preview-image
rodrigok Jun 27, 2017
492fce9
Merge pull request #7320 from RocketChat/fix-jump-to-unread
rodrigok Jun 27, 2017
e1a84a8
Merge pull request #7311 from RocketChat/use-db-for-spotlight
rodrigok Jun 27, 2017
b23eb6f
Merge pull request #7207 from RocketChat/fix-delete-message
rodrigok Jun 27, 2017
ced1652
Add support to run a specific migration
sampaiodiego Jun 23, 2017
e8baeae
Improve avatar migration
sampaiodiego Jun 23, 2017
7a4d855
Fix migration from GridFS
sampaiodiego Jun 26, 2017
46861ea
Run avatar migration in batches
sampaiodiego Jun 27, 2017
3db0301
Fix user's customFields not being saved
sampaiodiego Jun 28, 2017
f8273b2
Merge pull request #7308 from RocketChat/improvements/escape-error-me…
rodrigok Jun 28, 2017
7ccaa03
Merge pull request #7352 from RocketChat/improve-avatar-migration
rodrigok Jun 28, 2017
9547687
Merge pull request #7358 from RocketChat/fix-users-customfields
rodrigok Jun 28, 2017
2ec7590
Merge branch 'release-candidate' of https://github.com/RocketChat/Roc…
rodrigok Jun 28, 2017
2347d2a
Bump version to 0.57.0-rc.3
rodrigok Jun 28, 2017
7c1ab8e
Merge branch 'release-candidate' into develop
rodrigok Jun 28, 2017
46762ee
Merge release-candidate
rodrigok Jun 28, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,145 @@
<a name="0.57.0-rc.3"></a>
# 0.57.0-rc.3 (2017-06-28)


### New Features

- [#7311](https://github.com/RocketChat/Rocket.Chat/pull/7311) Force use of MongoDB for spotlight queries


### Bug Fixes

- [#7345](https://github.com/RocketChat/Rocket.Chat/pull/7345) click on image in a message
- [#7207](https://github.com/RocketChat/Rocket.Chat/pull/7207) Fix Block Delete Message After (n) Minutes
- [#7320](https://github.com/RocketChat/Rocket.Chat/pull/7320) Fix jump to unread button
- [#7321](https://github.com/RocketChat/Rocket.Chat/pull/7321) Fix Secret Url
- [#7358](https://github.com/RocketChat/Rocket.Chat/pull/7358) Fix user's customFields not being saved correctly
- [#7352](https://github.com/RocketChat/Rocket.Chat/pull/7352) Improve avatar migration
- [#7304](https://github.com/RocketChat/Rocket.Chat/pull/7304) Proxy upload to correct instance


<details>
<summary>Others</summary>

- [#7308](https://github.com/RocketChat/Rocket.Chat/pull/7308) Escape error messages
</details>



<a name="0.57.0-rc.2"></a>
# 0.57.0-rc.2 (2017-06-12)


### Bug Fixes

- [#7215](https://github.com/RocketChat/Rocket.Chat/pull/7215/) Fix the Zapier oAuth return url to the new one
- [#7209](https://github.com/RocketChat/Rocket.Chat/pull/7209) "requirePasswordChange" property not being saved when set to false
- [#7208](https://github.com/RocketChat/Rocket.Chat/pull/7208) Fix oembed previews not being shown
- [#7200](https://github.com/RocketChat/Rocket.Chat/pull/7200) Fix editing others messages
- [#7160](https://github.com/RocketChat/Rocket.Chat/pull/7160) Removing the kadira package install from example build script.



<a name="0.57.0-rc.1"></a>
# 0.57.0-rc.1 (2017-06-02)


### Bug Fixes

- [#7157](https://github.com/RocketChat/Rocket.Chat/pull/7157) Fix all reactions having the same username


<details>
<summary>Others</summary>

- [#7154](https://github.com/RocketChat/Rocket.Chat/pull/7154) Remove missing CoffeeScript dependencies
</details>



<a name="0.57.0-rc.0"></a>
# 0.57.0-rc.0 (2017-06-01)


### New Features

- [#7085](https://github.com/RocketChat/Rocket.Chat/pull/7085) API method and REST Endpoint for getting a single message by id
- [#6919](https://github.com/RocketChat/Rocket.Chat/pull/6919) Feature/delete any message permission
- [#6938](https://github.com/RocketChat/Rocket.Chat/pull/6938) Improve CI/Docker build/release
- [#7059](https://github.com/RocketChat/Rocket.Chat/pull/7059) Increase unread message count on [@here](https://github.com/here) mention
- [#6921](https://github.com/RocketChat/Rocket.Chat/pull/6921) LDAP: Use variables in User_Data_FieldMap for name mapping
- [#6857](https://github.com/RocketChat/Rocket.Chat/pull/6857) Make channel/group delete call answer to roomName
- [#7080](https://github.com/RocketChat/Rocket.Chat/pull/7080) Migration to add <html> tags to email header and footer
- [#6788](https://github.com/RocketChat/Rocket.Chat/pull/6788) New avatar storage types
- [#6690](https://github.com/RocketChat/Rocket.Chat/pull/6690) Show full name in mentions if use full name setting enabled
- [#6953](https://github.com/RocketChat/Rocket.Chat/pull/6953) Show info about multiple instances at admin page
- [#6605](https://github.com/RocketChat/Rocket.Chat/pull/6605) Start running unit tests


### Bug Fixes

- [#7025](https://github.com/RocketChat/Rocket.Chat/pull/7025) Add <html> and </html> to header and footer
- [#7084](https://github.com/RocketChat/Rocket.Chat/pull/7084) Add option to ignore TLS in SMTP server settings
- [#7072](https://github.com/RocketChat/Rocket.Chat/pull/7072) Add support for carriage return in markdown code blocks
- [#6910](https://github.com/RocketChat/Rocket.Chat/pull/6910) Allow image insert from slack through slackbridge
- [#6904](https://github.com/RocketChat/Rocket.Chat/pull/6904) Bugs in `isUserFromParams` helper
- [#6840](https://github.com/RocketChat/Rocket.Chat/pull/6840) Check that username is not in the room when being muted / unmuted
- [#7103](https://github.com/RocketChat/Rocket.Chat/pull/7103) clipboard (permalink, copy, pin, star buttons)
- [#7030](https://github.com/RocketChat/Rocket.Chat/pull/7030) do only store password if LDAP_Login_Fallback is on
- [#7105](https://github.com/RocketChat/Rocket.Chat/pull/7105) edit button on firefox
- [#6935](https://github.com/RocketChat/Rocket.Chat/pull/6935) Error when trying to show preview of undefined filetype
- [#7045](https://github.com/RocketChat/Rocket.Chat/pull/7045) Fix avatar upload via users.setAvatar REST endpoint
- [#6950](https://github.com/RocketChat/Rocket.Chat/pull/6950) Fix badge counter on iOS push notifications
- [#7121](https://github.com/RocketChat/Rocket.Chat/pull/7121) fix bug in preview image
- [#6972](https://github.com/RocketChat/Rocket.Chat/pull/6972) Fix error handling for non-valid avatar URL
- [#6974](https://github.com/RocketChat/Rocket.Chat/pull/6974) Fix login with Meteor saving an object as email address
- [#7104](https://github.com/RocketChat/Rocket.Chat/pull/7104) Fix missing CSS files on production builds
- [#6986](https://github.com/RocketChat/Rocket.Chat/pull/6986) Fix the other tests failing due chimp update
- [#7049](https://github.com/RocketChat/Rocket.Chat/pull/7049) Improve Tests
- [#6968](https://github.com/RocketChat/Rocket.Chat/pull/6968) make channels.create API check for create-c
- [#7044](https://github.com/RocketChat/Rocket.Chat/pull/7044) New screen sharing Chrome extension checking method
- [#6999](https://github.com/RocketChat/Rocket.Chat/pull/6999) overlapping text for users-typing-message
- [#7014](https://github.com/RocketChat/Rocket.Chat/pull/7014) Parse HTML on admin setting's descriptions
- [#6997](https://github.com/RocketChat/Rocket.Chat/pull/6997) Parse markdown links last
- [#7033](https://github.com/RocketChat/Rocket.Chat/pull/7033) Prevent Ctrl key on message field from reloading messages list
- [#6912](https://github.com/RocketChat/Rocket.Chat/pull/6912) Remove room from roomPick setting
- [#6961](https://github.com/RocketChat/Rocket.Chat/pull/6961) SAML: Only set KeyDescriptor when non empty
- [#7023](https://github.com/RocketChat/Rocket.Chat/pull/7023) Sidenav roomlist
- [#6913](https://github.com/RocketChat/Rocket.Chat/pull/6913) Slackbridge text replacements
- [#6903](https://github.com/RocketChat/Rocket.Chat/pull/6903) Updating Incoming Integration Post As Field Not Allowed
- [#6947](https://github.com/RocketChat/Rocket.Chat/pull/6947) Use AWS Signature Version 4 signed URLs for uploads
- [#7012](https://github.com/RocketChat/Rocket.Chat/pull/7012) video message recording dialog is shown in an incorrect position


<details>
<summary>Others</summary>

- [#7094](https://github.com/RocketChat/Rocket.Chat/pull/7094) [FIX]Fix the failing tests
- [#7092](https://github.com/RocketChat/Rocket.Chat/pull/7092) [FIX]Fixed typo hmtl -> html
- [#7145](https://github.com/RocketChat/Rocket.Chat/pull/7145) Convert file unsubscribe.coffee to js
- [#7146](https://github.com/RocketChat/Rocket.Chat/pull/7146) Convert hipchat importer to js
- [#7022](https://github.com/RocketChat/Rocket.Chat/pull/7022) Convert irc package to js
- [#7096](https://github.com/RocketChat/Rocket.Chat/pull/7096) Convert Livechat from Coffeescript to JavaScript
- [#6936](https://github.com/RocketChat/Rocket.Chat/pull/6936) Convert meteor-autocomplete package to js
- [#7017](https://github.com/RocketChat/Rocket.Chat/pull/7017) Convert oauth2-server-config package to js
- [#6795](https://github.com/RocketChat/Rocket.Chat/pull/6795) Convert Ui Account Package to Js
- [#6911](https://github.com/RocketChat/Rocket.Chat/pull/6911) Convert ui-admin package to js
- [#6775](https://github.com/RocketChat/Rocket.Chat/pull/6775) Convert WebRTC Package to Js
- [#7018](https://github.com/RocketChat/Rocket.Chat/pull/7018) converted rocketchat-importer
- [#6836](https://github.com/RocketChat/Rocket.Chat/pull/6836) converted rocketchat-ui coffee to js part 2
- [#6976](https://github.com/RocketChat/Rocket.Chat/pull/6976) fix the crashing tests
- [#7055](https://github.com/RocketChat/Rocket.Chat/pull/7055) Ldap: User_Data_FieldMap description
- [#7114](https://github.com/RocketChat/Rocket.Chat/pull/7114) LingoHub based on develop
- [#7005](https://github.com/RocketChat/Rocket.Chat/pull/7005) LingoHub based on develop
- [#6978](https://github.com/RocketChat/Rocket.Chat/pull/6978) LingoHub based on develop
- [#7062](https://github.com/RocketChat/Rocket.Chat/pull/7062) Remove Useless Jasmine Tests
- [#6914](https://github.com/RocketChat/Rocket.Chat/pull/6914) Rocketchat ui message
- [#7006](https://github.com/RocketChat/Rocket.Chat/pull/7006) Rocketchat ui3
- [#6987](https://github.com/RocketChat/Rocket.Chat/pull/6987) rocketchat-importer-slack coffee to js
- [#6735](https://github.com/RocketChat/Rocket.Chat/pull/6735) rocketchat-lib[4] coffee to js
</details>


<a name="0.56.0"></a>
# NEXT

Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-file-upload/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Package.onUse(function(api) {
api.addFiles('client/lib/fileUploadHandler.js', 'client');

api.addFiles('server/lib/FileUpload.js', 'server');
api.addFiles('server/lib/proxy.js', 'server');
api.addFiles('server/lib/requests.js', 'server');

api.addFiles('server/config/_configUploadStorage.js', 'server');
Expand Down
91 changes: 91 additions & 0 deletions packages/rocketchat-file-upload/server/lib/proxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/* globals UploadFS, InstanceStatus */

import http from 'http';
import URL from 'url';

const logger = new Logger('UploadProxy');

WebApp.connectHandlers.stack.unshift({
route: '',
handle: Meteor.bindEnvironment(function(req, res, next) {
// Quick check to see if request should be catch
if (req.url.indexOf(UploadFS.config.storesPath) === -1) {
return next();
}

logger.debug('Upload URL:', req.url);

if (req.method !== 'POST') {
return next();
}

// Remove store path
const parsedUrl = URL.parse(req.url);
const path = parsedUrl.pathname.substr(UploadFS.config.storesPath.length + 1);

// Get store
const regExp = new RegExp('^\/([^\/\?]+)\/([^\/\?]+)$');
const match = regExp.exec(path);

// Request is not valid
if (match === null) {
res.writeHead(400);
res.end();
return;
}

// Get store
const store = UploadFS.getStore(match[1]);
if (!store) {
res.writeHead(404);
res.end();
return;
}

// Get file
const fileId = match[2];
const file = store.getCollection().findOne({_id: fileId});
if (file === undefined) {
res.writeHead(404);
res.end();
return;
}

if (file.instanceId === InstanceStatus.id()) {
logger.debug('Correct instance');
return next();
}

// Proxy to other instance
const instance = InstanceStatus.getCollection().findOne({_id: file.instanceId});

if (instance == null) {
res.writeHead(404);
res.end();
return;
}

if (instance.extraInformation.host === process.env.INSTANCE_IP && RocketChat.isDocker() === false) {
instance.extraInformation.host = 'localhost';
}

logger.debug('Wrong instance, proxing to:', `${ instance.extraInformation.host }:${ instance.extraInformation.port }`);

const options = {
hostname: instance.extraInformation.host,
port: instance.extraInformation.port,
path: req.url,
method: 'POST'
};

const proxy = http.request(options, function(proxy_res) {
proxy_res.pipe(res, {
end: true
});
});

req.pipe(proxy, {
end: true
});
})
});
6 changes: 6 additions & 0 deletions packages/rocketchat-lib/server/models/Avatars.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
/* globals InstanceStatus */

RocketChat.models.Avatars = new class extends RocketChat.models._Base {
constructor() {
super('avatars');

this.model.before.insert((userId, doc) => {
doc.instanceId = InstanceStatus.id();
});

this.tryEnsureIndex({ name: 1 });
}

Expand Down
6 changes: 6 additions & 0 deletions packages/rocketchat-lib/server/models/Uploads.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
/* globals InstanceStatus */

RocketChat.models.Uploads = new class extends RocketChat.models._Base {
constructor() {
super('uploads');

this.model.before.insert((userId, doc) => {
doc.instanceId = InstanceStatus.id();
});

this.tryEnsureIndex({ 'rid': 1 });
this.tryEnsureIndex({ 'uploadedAt': 1 });
}
Expand Down
5 changes: 2 additions & 3 deletions packages/rocketchat-lib/server/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,8 @@ class ModelUsers extends RocketChat.models._Base {

setCustomFields(_id, fields) {
const values = {};
Object.keys(fields).reduce(key => {
const value = fields[key];
values[`customFields.${ key }`] = value;
Object.keys(fields).forEach(key => {
values[`customFields.${ key }`] = fields[key];
});

const update = {$set: values};
Expand Down
1 change: 1 addition & 0 deletions server/startup/avatar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* globals FileUpload */

Meteor.startup(function() {
WebApp.connectHandlers.use('/avatar/', Meteor.bindEnvironment(function(req, res/*, next*/) {
const params = {
Expand Down
Loading