Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into chor…
Browse files Browse the repository at this point in the history
…e/startup-performance
  • Loading branch information
ggazzo committed Sep 15, 2021
2 parents 8a878fe + 5443be7 commit 001d0f3
Show file tree
Hide file tree
Showing 221 changed files with 2,634 additions and 1,792 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:

Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
path: /tmp/build

test:
runs-on: ubuntu-16.04
runs-on: ubuntu-20.04
needs: build

strategy:
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
for i in $(seq 1 5); do (docker exec mongo mongo rocketchat --eval 'db.dropDatabase()') && npm run testci && s=0 && break || s=$? && sleep 1; done; (exit $s)
# notification:
# runs-on: ubuntu-latest
# runs-on: ubuntu-20.04
# needs: test

# steps:
Expand All @@ -274,7 +274,7 @@ jobs:
# token: ${{ secrets.GITHUB_TOKEN }}

build-image-pr:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
if: github.event.pull_request.head.repo.full_name == github.repository

strategy:
Expand Down Expand Up @@ -401,7 +401,7 @@ jobs:
docker push $IMAGE_NAME
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
if: github.event_name == 'release' || github.ref == 'refs/heads/develop'
needs: test

Expand Down Expand Up @@ -479,7 +479,7 @@ jobs:
fi
image-build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: deploy

strategy:
Expand Down Expand Up @@ -556,7 +556,7 @@ jobs:
docker push ${IMAGE}:develop
services-image-build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: deploy

strategy:
Expand Down
2 changes: 1 addition & 1 deletion app/action-links/client/lib/actionLinks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';

import { handleError } from '../../../utils/client';
import { handleError } from '../../../../client/lib/utils/handleError';
import { Messages, Subscriptions } from '../../../models/client';

// Action Links namespace creation.
Expand Down
19 changes: 0 additions & 19 deletions app/api/server/v1/emoji-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,6 @@ import { getUploadFormData } from '../lib/getUploadFormData';
import { findEmojisCustom } from '../lib/emoji-custom';
import { Media } from '../../../../server/sdk';

// DEPRECATED
// Will be removed after v3.0.0
API.v1.addRoute('emoji-custom', { authRequired: true }, {
get() {
const warningMessage = 'The endpoint "emoji-custom" is deprecated and will be removed after version v3.0.0';
console.warn(warningMessage);
const { query } = this.parseJsonQuery();
const emojis = Meteor.call('listEmojiCustom', query);

return API.v1.success(this.deprecationWarning({
endpoint: 'emoji-custom',
versionWillBeRemoved: '3.0.0',
response: {
emojis,
},
}));
},
});

API.v1.addRoute('emoji-custom.list', { authRequired: true }, {
get() {
const { query } = this.parseJsonQuery();
Expand Down
38 changes: 3 additions & 35 deletions app/api/server/v1/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,15 @@ import { EJSON } from 'meteor/ejson';
import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
import { escapeHTML } from '@rocket.chat/string-helpers';

import { hasRole, hasPermission } from '../../../authorization/server';
import { Info } from '../../../utils/server';
import { hasPermission } from '../../../authorization/server';
import { Users } from '../../../models/server';
import { settings } from '../../../settings/server';
import { API } from '../api';
import { getDefaultUserFields } from '../../../utils/server/functions/getDefaultUserFields';
import { getURL } from '../../../utils/lib/getURL';
import { StdOut } from '../../../logger/server/streamer';
import { getLogs } from '../../../../server/stream/stdout';
import { SystemLogger } from '../../../../server/lib/logger/system';


// DEPRECATED
// Will be removed after v3.0.0
API.v1.addRoute('info', { authRequired: false }, {
get() {
const warningMessage = 'The endpoint "/v1/info" is deprecated and will be removed after version v3.0.0';
console.warn(warningMessage);
const user = this.getLoggedInUser();

if (user && hasRole(user._id, 'admin')) {
return API.v1.success(this.deprecationWarning({
endpoint: 'info',
versionWillBeRemoved: '3.0.0',
response: {
info: Info,
},
}));
}

return API.v1.success(this.deprecationWarning({
endpoint: 'info',
versionWillBeRemoved: '3.0.0',
response: {
info: {
version: Info.version,
},
},
}));
},
});

API.v1.addRoute('me', { authRequired: true }, {
get() {
const fields = getDefaultUserFields();
Expand Down Expand Up @@ -227,7 +195,7 @@ API.v1.addRoute('stdout.queue', { authRequired: true }, {
if (!hasPermission(this.userId, 'view-logs')) {
return API.v1.unauthorized();
}
return API.v1.success({ queue: StdOut.queue });
return API.v1.success({ queue: getLogs() });
},
});

Expand Down
34 changes: 0 additions & 34 deletions app/api/server/v1/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,6 @@ import { hasPermission } from '../../../authorization';
import { Permissions, Roles } from '../../../models/server';
import { API } from '../api';

/**
This API returns all permissions that exists
on the server, with respective roles.
Method: GET
Route: api/v1/permissions
*/
API.v1.addRoute('permissions', { authRequired: true }, {
get() {
const warningMessage = 'The endpoint "permissions" is deprecated and will be removed after version v0.69';
console.warn(warningMessage);

const result = Meteor.runAsUser(this.userId, () => Meteor.call('permissions/get'));

return API.v1.success(result);
},
});

// DEPRECATED
// TODO: Remove this after three versions have been released. That means at 0.85 this should be gone.
API.v1.addRoute('permissions.list', { authRequired: true }, {
get() {
const result = Meteor.runAsUser(this.userId, () => Meteor.call('permissions/get'));

return API.v1.success(this.deprecationWarning({
endpoint: 'permissions.list',
versionWillBeRemoved: '0.85',
response: {
permissions: result,
},
}));
},
});

API.v1.addRoute('permissions.listAll', { authRequired: true }, {
get() {
const { updatedSince } = this.queryParams;
Expand Down
2 changes: 1 addition & 1 deletion app/apps/client/RealAppsEngineUIHost.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { AppsEngineUIHost } from '@rocket.chat/apps-engine/client/AppsEngineUIHo

import { Rooms } from '../../models/client';
import { APIClient } from '../../utils/client';
import { baseURI } from '../../utils/client/lib/baseuri';
import { getUserAvatarURL } from '../../utils/lib/getUserAvatarURL';
import { baseURI } from '../../../client/lib/baseURI';

export class RealAppsEngineUIHost extends AppsEngineUIHost {
constructor() {
Expand Down
3 changes: 2 additions & 1 deletion app/apps/client/gameCenter/gameCenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import { modal } from '../../../ui-utils/client';
import { APIClient, t, handleError } from '../../../utils/client';
import { APIClient, t } from '../../../utils/client';
import './gameCenter.html';
import { handleError } from '../../../../client/lib/utils/handleError';

const getExternalComponents = async (instance) => {
try {
Expand Down
7 changes: 4 additions & 3 deletions app/apps/client/gameCenter/invitePlayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { Session } from 'meteor/session';
import { AutoComplete } from '../../../meteor-autocomplete/client';
import { roomTypes } from '../../../utils/client';
import { ChatRoom } from '../../../models/client';
import { call, modal } from '../../../ui-utils/client';
import { modal } from '../../../ui-utils/client';
import { callWithErrorHandling } from '../../../../client/lib/utils/callWithErrorHandling';

import './invitePlayers.html';

Expand Down Expand Up @@ -77,7 +78,7 @@ Template.InvitePlayers.events({
const privateGroupName = `${ name.replace(/\s/g, '-') }-${ Random.id(10) }`;

try {
const result = await call('createPrivateGroup', privateGroupName, users);
const result = await callWithErrorHandling('createPrivateGroup', privateGroupName, users);

roomTypes.openRouteLink(result.t, result);

Expand All @@ -90,7 +91,7 @@ Template.InvitePlayers.events({
return;
}

call('sendMessage', {
callWithErrorHandling('sendMessage', {
_id: Random.id(),
rid: result.rid,
msg: TAPi18n.__('Apps_Game_Center_Play_Game_Together', { name }),
Expand Down
1 change: 1 addition & 0 deletions app/apps/server/converters/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class AppUsersConverter {
updatedAt: user._updatedAt,
lastLoginAt: user.lastLogin,
appId: user.appId,
customFields: user.customFields,
};
}

Expand Down
80 changes: 0 additions & 80 deletions app/authorization/client/hasPermission.js

This file was deleted.

Loading

0 comments on commit 001d0f3

Please sign in to comment.