Skip to content

Commit

Permalink
Merged Upstream develop (#61)
Browse files Browse the repository at this point in the history
* [FIX] Load messages after disconnect and message box scroll missing (RocketChat#14668)

* Removing unnecesary federation configs (RocketChat#14674)

* [FIX] SAML login error. (RocketChat#14686)

* Bump version to 1.1.1

* Service Account broadcast room callback added

* Service Account Callback completed

* CLI errors fixed

* [NEW] Service Account one-tap login complete

* Callbacks modified

* Service Accounts directory tab added

* [NEW] Service Accounts Login method

* Typo fixed

* CLI errors fixed

* CLI errors fixed

* [FIX] Anonymous chat read (RocketChat#14717)

* Prevent errors when allowing anonymous read

* getSingleMessage for anonymous users

* Fix register user when allow read and write anonymous is enabled

* Fix anonymous with sidebar extended as default

Co-authored-by: ubergeekzone <ubergeekzone@gmail.com>

* [FIX] User Real Name being erased when not modified (RocketChat#14711)

* [FIX] User status information on User Info panel (RocketChat#14763)

* [FIX] Anonymous chat read (RocketChat#14717)

* Prevent errors when allowing anonymous read

* getSingleMessage for anonymous users

* Fix register user when allow read and write anonymous is enabled

* Fix anonymous with sidebar extended as default

Co-authored-by: ubergeekzone <ubergeekzone@gmail.com>

* Bump version to 1.1.2

* [New] Service Account directory feature

* CLI errors fixed

* UsernameExists meteor method fixed

* Sync commit

* [NEW] Add loading animation to webdav file picker (RocketChat#14759)

* [NEW] Service Account subscription method added

* changed mongo version for snap from 3.2.7 to 3.4.20 (RocketChat#14838)

* add _hidden for messages loaded by thread (RocketChat#14837)

* Regression: thread loading parent msg if is not loaded (RocketChat#14839)

* [IMPROVE] Layout of livechat manager pages to new style (RocketChat#13900)

* [FIX] Removes E2E action button, icon and banner when E2E is disabled. (RocketChat#14810)

* add _hidden for messages loaded by thread (RocketChat#14837)

* Regression: thread loading parent msg if is not loaded (RocketChat#14839)

* Bump version to 1.1.3

* [IMPROVE] Adds link to download generated user data file (RocketChat#14175)

* [FIX] Error when using Download My Data or Export My Data (RocketChat#14645)

* [NEW] Custom User Status (RocketChat#13933)

Co-Authored-By: Tasso Evangelista <tasso@tassoevan.me>
Co-Authored-By: Guilherme Gazzo <guilhermegazzo@gmail.com>
Co-Authored-By: wreiske <wreiske@mieweb.com>

* Bump version to 1.2.0-rc.0

* Allow debugging of cached collections by name (RocketChat#14859)

* Regression: Allow debugging of cached collections by name (RocketChat#14862)

* Regression: Fix desktop notifications not being sent (RocketChat#14860)

* Broadcast Room name change handled

* Lint errors fixed

* getLoginToken method refactored

* Console statements removed

* Sidebar header permission modified

* Merge branch service-accounts

* Added service account directory search translation key

* Subscribers count added

* [FIX] Custom status fixes (RocketChat#14853)

* Fixes for status message text presence issues
Added statusText to several api endpoints
Changed statusMessage to statusText since that is what it is called everywhere

* Fixed slash command for changing status

* Fixed the "name is required" issue

* Make sure the status is set blank if selecting a default status... we don't want an "online" status when someone is actually offline!

* Fixes display of custom status on the room header

* Changed the header of DM rooms to query the server for the user status text when it is not found on the internal collection

* Changed Custom Status methods to check if the user is logged in

* Improved code readability

* Fix getting status list before logging in

* Bump version to 1.2.0-rc.1

* [FIX] LinkedIn OAuth login (RocketChat#14887)

* [NEW] Show App bundles and its apps (RocketChat#14886)

* Bump version to 1.2.0-rc.2

* Bump version to 1.2.0

* Bump version to 1.3.0-develop

* [FIX] Not showing local app on App Details (RocketChat#14894)

* Unread counter added in popver

* Get linked service account method added

* get cloud generated public key for marketplace licenses (RocketChat#14851)
  • Loading branch information
bhardwajaditya authored and Kailash0311 committed Jul 2, 2019
1 parent 6d6976c commit 3a6965e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/cloud/server/functions/connectWorkspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export function connectWorkspace(token) {
Settings.updateValueById('Cloud_Workspace_Client_Id', data.client_id);
Settings.updateValueById('Cloud_Workspace_Client_Secret', data.client_secret);
Settings.updateValueById('Cloud_Workspace_Client_Secret_Expires_At', data.client_secret_expires_at);
Settings.updateValueById('Cloud_Workspace_PublicKey', data.publicKey);
Settings.updateValueById('Cloud_Workspace_Registration_Client_Uri', data.registration_client_uri);

// Now that we have the client id and secret, let's get the access token
Expand Down
18 changes: 18 additions & 0 deletions app/cloud/server/functions/getWorkspaceKey.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { retrieveRegistrationStatus } from './retrieveRegistrationStatus';
import { settings } from '../../../settings';

export function getWorkspaceKey() {
const { connectToCloud, workspaceRegistered } = retrieveRegistrationStatus();

if (!connectToCloud || !workspaceRegistered) {
return false;
}

const publicKey = settings.get('Cloud_Workspace_PublicKey');

if (!publicKey) {
return false;
}

return publicKey;
}
10 changes: 9 additions & 1 deletion app/cloud/server/functions/syncWorkspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { retrieveRegistrationStatus } from './retrieveRegistrationStatus';
import { getWorkspaceAccessToken } from './getWorkspaceAccessToken';
import { getWorkspaceLicense } from './getWorkspaceLicense';
import { statistics } from '../../../statistics';
import { Settings } from '../../../models';
import { settings } from '../../../settings';

export function syncWorkspace(reconnectCheck = false) {
Expand All @@ -31,6 +32,7 @@ export function syncWorkspace(reconnectCheck = false) {

const workspaceUrl = settings.get('Cloud_Workspace_Registration_Client_Uri');

let result;
try {
const headers = {};
const token = getWorkspaceAccessToken(true);
Expand All @@ -41,7 +43,7 @@ export function syncWorkspace(reconnectCheck = false) {
return false;
}

HTTP.post(`${ workspaceUrl }/client`, {
result = HTTP.post(`${ workspaceUrl }/client`, {
data: info,
headers,
});
Expand All @@ -57,5 +59,11 @@ export function syncWorkspace(reconnectCheck = false) {
return false;
}

const { data } = result;

if (data.publicKey) {
Settings.updateValueById('Cloud_Workspace_PublicKey', data.publicKey);
}

return true;
}
1 change: 1 addition & 0 deletions app/cloud/server/functions/unregisterWorkspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export function unregisterWorkspace() {
Settings.updateValueById('Cloud_Workspace_Client_Id', null);
Settings.updateValueById('Cloud_Workspace_Client_Secret', null);
Settings.updateValueById('Cloud_Workspace_Client_Secret_Expires_At', null);
Settings.updateValueById('Cloud_Workspace_PublicKey', null);
Settings.updateValueById('Cloud_Workspace_Registration_Client_Uri', null);

return true;
Expand Down
3 changes: 2 additions & 1 deletion app/cloud/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import './methods';
import { getWorkspaceAccessToken } from './functions/getWorkspaceAccessToken';
import { getWorkspaceLicense } from './functions/getWorkspaceLicense';
import { getUserCloudAccessToken } from './functions/getUserCloudAccessToken';
import { getWorkspaceKey } from './functions/getWorkspaceKey';
import { Permissions } from '../../models';

if (Permissions) {
Expand All @@ -11,4 +12,4 @@ if (Permissions) {
// Ensure the client/workspace access token is valid
getWorkspaceAccessToken();

export { getWorkspaceAccessToken, getWorkspaceLicense, getUserCloudAccessToken };
export { getWorkspaceAccessToken, getWorkspaceLicense, getWorkspaceKey, getUserCloudAccessToken };
11 changes: 11 additions & 0 deletions app/lib/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2664,6 +2664,17 @@ settings.addGroup('Setup_Wizard', function() {
secret: true,
});

this.add('Cloud_Workspace_PublicKey', '', {
type: 'string',
hidden: true,
readonly: true,
enableQuery: {
_id: 'Register_Server',
value: true,
},
secret: true,
});

this.add('Cloud_Workspace_License', '', {
type: 'string',
hidden: true,
Expand Down

0 comments on commit 3a6965e

Please sign in to comment.