Compare commits

..

14 Commits

Author SHA1 Message Date
Akash Nimare
5b34bc696e electron: Fix app not rendering colors properly.
There is a bug in v2 of electron which causes
pale colors. Resetting the color profile to srgb
fixes this problem. This is a temporary solution
until electron officially fixes this.

Fixes: #497.
2018-05-23 11:10:20 +05:30
Akash Nimare
0e3c6bceeb node: Update node to v8 on appveyor. 2018-05-22 01:03:54 +05:30
Akash Nimare
c2e138c16a tests: Temporarily disable e2e tests on appveyor. 2018-05-21 23:23:41 +05:30
Akash Nimare
8d1b027b0e tests: Temporarily disable e2e tests. 2018-05-21 21:52:23 +05:30
Akash Nimare
7bb8d78973 node: Update node to v8 on travis. 2018-05-21 04:08:58 +05:30
Akash Nimare
a7c7791bf8 new release v2.3.1. 2018-05-21 03:40:22 +05:30
Akash Nimare
5d120b4416 shortcuts-menu: Add a tip-section to link to webapp's built-in hotkeys. 2018-05-21 03:29:56 +05:30
Abhigyan Khaund
ceaf13dee2 shortcuts-menu: Add a tip-section to link to webapp's built-in hotkeys.
Fixes: #459
2018-05-21 03:27:30 +05:30
Akash Nimare
f81381dfec electron: Update electron to v2.0.1. 2018-05-21 03:18:18 +05:30
Akash Nimare
dbe89cdd09 security: Use proper method to escape html.
Now using the `escape-html` module so that we can decode
the realm description properly and escape the html at the
same time. The encodeURIComponent function doesn't
provide this kind of flexibility. We need to decode the
real description properly since we show the same in the
tooltip and setting page.
2018-05-21 03:11:03 +05:30
Priyank Patel
14c59bdae1 Update node modules.
* dependencies: Upgrade rc to the depth of 5.

This updates rc dependecies, to fix a vulnerability

deep-extend - Prototype Pollution
Refs:  https://nodesecurity.io/advisories/612

* dependencies: Upgrade stringstream to the depth of 6.

This solves, 5 vulnerabilities which were using the vulnerable
version of stringstream.

stringstream - Out-of-bounds Read
Refs: https://nodesecurity.io/advisories/664

* gulp: Upgrade gulp to v4.0.0.

This solves, 5 vulnerabilities.

minimatch - Regular Expression Denial of Service
https://nodesecurity.io/advisories/118

lodash - Prototype Pollution
https://nodesecurity.io/advisories/577

* dependencies: Update request to the depth of 6.

This solves 5 vulnerabilities.

stringstream - Out-of-bounds Read
https://nodesecurity.io/advisories/664
2018-05-21 02:17:18 +05:30
Akash Nimare
0ac3e3f6d3 New release v2.3.0. 2018-05-17 00:59:39 +05:30
Akash Nimare
d69c1339e6 security: Do proper HTML escaping for server data.
This commit fixes a security bug which was caused by
using innerHTML and not doing proper HTML escaping.
Ideally, we should be doing proper HTML escaping for
any data we get from the server to avoid XSS attack.
We already handle realm icon and url very well, the
realm description was not handled previously but this commit
now fixes this in a right way.
2018-05-16 18:25:03 +05:30
Akash Nimare
fe56a20334 setting: Add an option to disable the auto-updates. (#493)
Fixes: #491.
2018-05-16 16:00:21 +05:30
12 changed files with 11494 additions and 16 deletions

View File

@@ -15,7 +15,7 @@ addons:
language: node_js language: node_js
node_js: node_js:
- '6' - '8'
before_install: before_install:
- ./scripts/travis-xvfb.sh - ./scripts/travis-xvfb.sh

View File

@@ -131,6 +131,9 @@ function createMainWindow() {
// Decrease load on GPU (experimental) // Decrease load on GPU (experimental)
app.disableHardwareAcceleration(); app.disableHardwareAcceleration();
// Temporary fix for Electron render colors differently
app.commandLine.appendSwitch('force-color-profile', 'srgb');
// eslint-disable-next-line max-params // eslint-disable-next-line max-params
app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { app.on('certificate-error', (event, webContents, url, error, certificate, callback) => {
event.preventDefault(); event.preventDefault();

1411
app/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"name": "zulip", "name": "zulip",
"productName": "Zulip", "productName": "Zulip",
"version": "2.2.0-beta", "version": "2.3.1",
"description": "Zulip Desktop App", "description": "Zulip Desktop App",
"license": "Apache-2.0", "license": "Apache-2.0",
"copyright": "Kandra Labs, Inc.", "copyright": "Kandra Labs, Inc.",
@@ -27,6 +27,7 @@
], ],
"dependencies": { "dependencies": {
"@electron-elements/send-feedback": "1.0.7", "@electron-elements/send-feedback": "1.0.7",
"escape-html": "1.0.3",
"auto-launch": "5.0.5", "auto-launch": "5.0.5",
"electron-is-dev": "0.3.0", "electron-is-dev": "0.3.0",
"electron-log": "2.2.14", "electron-log": "2.2.14",

View File

@@ -557,6 +557,22 @@ input.toggle-round:checked+label:after {
background: #329588; background: #329588;
} }
.tip {
background-color: hsl(46,63%,95%);
border: 1px solid hsl(46,63%,84%);
border-radius: 4px;
}
.md-14 {
font-size: 14px;
vertical-align: middle;
padding-right: 6px;
}
#open-hotkeys-link {
text-decoration: underline;
cursor: pointer;
}
/* responsive grid */ /* responsive grid */

View File

@@ -227,7 +227,7 @@ class ServerManagerView {
} }
onHover(index, serverName) { onHover(index, serverName) {
this.$serverIconTooltip[index].innerHTML = serverName; this.$serverIconTooltip[index].innerText = serverName;
this.$serverIconTooltip[index].removeAttribute('style'); this.$serverIconTooltip[index].removeAttribute('style');
// To handle position of servers' tooltip due to scrolling of list of organizations // To handle position of servers' tooltip due to scrolling of list of organizations
// This could not be handled using CSS, hence the top of the tooltip is made same // This could not be handled using CSS, hence the top of the tooltip is made same

View File

@@ -1,6 +1,7 @@
'use strict'; 'use strict';
const BaseSection = require(__dirname + '/base-section.js'); const BaseSection = require(__dirname + '/base-section.js');
const shell = require('electron').shell;
class ShortcutsSection extends BaseSection { class ShortcutsSection extends BaseSection {
constructor(props) { constructor(props) {
@@ -159,6 +160,7 @@ class ShortcutsSection extends BaseSection {
</table> </table>
<div class="setting-control"></div> <div class="setting-control"></div>
</div> </div>
<div class="settings-card tip"><b><i class="material-icons md-14">settings</i>Tip: </b>These desktop app shortcuts extend the Zulip webapp's <span id="open-hotkeys-link">keyboard shortcuts</span>.</div>
</div> </div>
`; `;
} }
@@ -298,13 +300,22 @@ class ShortcutsSection extends BaseSection {
</table> </table>
<div class="setting-control"></div> <div class="setting-control"></div>
</div> </div>
<div class="tip"><b><i class="material-icons md-14">lightbulb_outline</i>Tip: </b>These desktop app shortcuts extend the Zulip webapp's <span id="open-hotkeys-link">keyboard shortcuts</span>.</div>
</div> </div>
`; `;
} }
openHotkeysExternalLink() {
const link = 'https://zulipchat.com/help/keyboard-shortcuts';
const externalCreateNewOrgEl = document.getElementById('open-hotkeys-link');
externalCreateNewOrgEl.addEventListener('click', () => {
shell.openExternal(link);
});
}
init() { init() {
this.props.$root.innerHTML = (process.platform === 'darwin') ? this.props.$root.innerHTML = (process.platform === 'darwin') ?
this.templateMac() : this.templateWinLin(); this.templateMac() : this.templateWinLin();
this.openHotkeysExternalLink();
} }
} }

View File

@@ -5,6 +5,8 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
const JsonDB = require('node-json-db'); const JsonDB = require('node-json-db');
const request = require('request'); const request = require('request');
const escape = require('escape-html');
const Logger = require('./logger-util'); const Logger = require('./logger-util');
const logger = new Logger({ const logger = new Logger({
@@ -188,7 +190,7 @@ class DomainUtil {
// Following check handles both the cases // Following check handles both the cases
icon: data.realm_icon.startsWith('/') ? data.realm_uri + data.realm_icon : data.realm_icon, icon: data.realm_icon.startsWith('/') ? data.realm_uri + data.realm_icon : data.realm_icon,
url: data.realm_uri, url: data.realm_uri,
alias: data.realm_name alias: escape(data.realm_name)
}); });
} }
} else { } else {

View File

@@ -8,7 +8,7 @@ cache:
- node_modules - node_modules
install: install:
- ps: Install-Product node 6 x64 - ps: Install-Product node 8 x64
- git reset --hard HEAD - git reset --hard HEAD
- npm install npm -g - npm install npm -g
- node --version - node --version
@@ -21,4 +21,4 @@ build: off
test_script: test_script:
- npm run test - npm run test
- npm run test-e2e # - npm run test-e2e

10034
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"name": "zulip", "name": "zulip",
"productName": "Zulip", "productName": "Zulip",
"version": "2.2.0-beta", "version": "2.3.1",
"main": "./app/main", "main": "./app/main",
"description": "Zulip Desktop App", "description": "Zulip Desktop App",
"license": "Apache-2.0", "license": "Apache-2.0",
@@ -88,8 +88,8 @@
} }
], ],
"window": { "window": {
"width": 500, "width": 500,
"height": 500 "height": 500
} }
}, },
"win": { "win": {
@@ -123,12 +123,12 @@
"assert": "1.4.1", "assert": "1.4.1",
"cp-file": "^5.0.0", "cp-file": "^5.0.0",
"devtron": "1.4.0", "devtron": "1.4.0",
"electron": "2.0.0", "electron": "2.0.1",
"electron-builder": "20.13.4", "electron-builder": "20.13.4",
"electron-connect": "0.6.2", "electron-connect": "0.6.2",
"electron-debug": "1.4.0", "electron-debug": "1.4.0",
"google-translate-api": "2.3.0", "google-translate-api": "2.3.0",
"gulp": "3.9.1", "gulp": "^4.0.0",
"gulp-tape": "0.0.9", "gulp-tape": "0.0.9",
"is-ci": "^1.0.10", "is-ci": "^1.0.10",
"nodemon": "^1.14.11", "nodemon": "^1.14.11",

View File

@@ -15,6 +15,6 @@ fi
npm run test npm run test
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then # if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
npm run test-e2e # npm run test-e2e
fi # fi