Merge branch 'master' into auto-updater

This commit is contained in:
Yuya Ochiai 2018-10-29 23:50:04 +09:00 committed by GitHub
commit 849800a80f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 32 deletions

View file

@ -23,6 +23,8 @@ Release date: TBD
#### Windows #### Windows
- Set "app start on login" preference to default on and synchronize its state with config.json. - Set "app start on login" preference to default on and synchronize its state with config.json.
[#846](https://github.com/mattermost/desktop/pull/846) [#846](https://github.com/mattermost/desktop/pull/846)
- Removed the ability to open UNC path and file:// links.
[#881](https://github.com/mattermost/desktop/pull/881)
#### Mac #### Mac
- Add **.dmg** package to support installation. - Add **.dmg** package to support installation.
@ -38,6 +40,8 @@ Release date: TBD
[#818](https://github.com/mattermost/desktop/pull/818) [#818](https://github.com/mattermost/desktop/pull/818)
- Set "app start on login" preference to default on and synchronize its state with config.json. - Set "app start on login" preference to default on and synchronize its state with config.json.
[#846](https://github.com/mattermost/desktop/pull/846) [#846](https://github.com/mattermost/desktop/pull/846)
- Added AppImage packages as unofficial build
[#864](https://github.com/mattermost/desktop/pull/864)
### Architectural Changes ### Architectural Changes
- Major version upgrade of Electron to v2.0.8. Electron is the underlying technology used to build the Desktop apps. - Major version upgrade of Electron to v2.0.8. Electron is the underlying technology used to build the Desktop apps.

View file

@ -30,7 +30,8 @@
"category": "Network;InstantMessaging", "category": "Network;InstantMessaging",
"target": [ "target": [
"deb", "deb",
"tar.gz" "tar.gz",
"appimage"
], ],
"extraFiles": [ "extraFiles": [
{ {

View file

@ -11,4 +11,5 @@ cp "${SRC}/mattermost-desktop-setup-${VERSION}-win.exe" "${DEST}/"
cp "${SRC}"/mattermost-desktop-*.zip "${DEST}/" cp "${SRC}"/mattermost-desktop-*.zip "${DEST}/"
cp "${SRC}"/*.tar.gz "${DEST}/" cp "${SRC}"/*.tar.gz "${DEST}/"
cp "${SRC}"/*.deb "${DEST}/" cp "${SRC}"/*.deb "${DEST}/"
cp "${SRC}"/*.AppImage "${DEST}/"
cp "${SRC}"/*.yml "${DEST}/" cp "${SRC}"/*.yml "${DEST}/"

View file

@ -22,25 +22,6 @@ const preloadJS = `file://${remote.app.getAppPath()}/browser/webview/mattermost_
const ERR_NOT_IMPLEMENTED = -11; const ERR_NOT_IMPLEMENTED = -11;
const U2F_EXTENSION_URL = 'chrome-extension://kmendfapggjehodndflmmgagdbamhnfd/u2f-comms.html'; const U2F_EXTENSION_URL = 'chrome-extension://kmendfapggjehodndflmmgagdbamhnfd/u2f-comms.html';
function extractFileURL(message) {
const matched = message.match(/Not allowed to load local resource:\s*(.+)/);
if (matched) {
return matched[1];
}
return '';
}
function isNetworkDrive(fileURL) {
const u = url.parse(fileURL);
if (u.protocol === 'file:' && u.host) {
// Disallow localhost, 127.0.0.1, ::1.
if (!u.host.match(/^localhost$|^127\.0\.0\.1$|^\[::1\]$/)) {
return true;
}
}
return false;
}
export default class MattermostView extends React.Component { export default class MattermostView extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -191,19 +172,9 @@ export default class MattermostView extends React.Component {
case 1: case 1:
console.warn(message); console.warn(message);
break; break;
case 2: { case 2:
const fileURL = extractFileURL(e.message);
if (isNetworkDrive(fileURL)) {
// Network drive: Should be allowed.
if (!shell.openExternal(decodeURI(fileURL))) {
console.log(`[${this.props.name}] shell.openExternal failed: ${fileURL}`);
}
} else {
// Local drive such as 'C:\Windows': Should not be allowed.
console.error(message); console.error(message);
}
break; break;
}
default: default:
console.log(message); console.log(message);
break; break;