-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #473 from mysteriumnetwork/make-it-dark
Make it dark
- Loading branch information
Showing
27 changed files
with
229 additions
and
570 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) 2022 BlockDev AG | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const crypto = require("crypto") | ||
|
||
/** | ||
* @see {@link https://stackoverflow.com/a/72219174} | ||
*/ | ||
let cryptoPatched = false | ||
const monkeyPatchCrypto = () => { | ||
if (cryptoPatched) return | ||
cryptoPatched = true | ||
|
||
/** | ||
* The MD4 algorithm is not available anymore in Node.js 17+ (because of library SSL 3). | ||
* In that case, silently replace MD4 by the MD5 algorithm. | ||
*/ | ||
try { | ||
crypto.createHash("md4") | ||
} catch (e) { | ||
console.warn('Crypto "MD4" is not supported anymore by this Node.js version') | ||
const origCreateHash = crypto.createHash | ||
crypto.createHash = (alg, opts) => { | ||
return origCreateHash(alg === "md4" ? "md5" : alg, opts) | ||
} | ||
} | ||
} | ||
|
||
monkeyPatchCrypto() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "mysterium-vpn-desktop", | ||
"productName": "MysteriumVPN", | ||
"description": "Desktop VPN client for Mysterium Network", | ||
"productName": "MysteriumDark", | ||
"description": "Desktop VPN client (legacy) for Mysterium Network", | ||
"version": "0.0.0-snapshot", | ||
"main": "index.js", | ||
"author": { | ||
|
@@ -44,7 +44,6 @@ | |
"mysterium-vpn-js": "26.0.0", | ||
"node-machine-id": "^1.1.12", | ||
"open": "^7.0.0", | ||
"pushy-electron": "^1.0.8", | ||
"qrcode.react": "^2.0.0", | ||
"react": "^18.2.0", | ||
"react-autosuggest": "^10.1.0", | ||
|
@@ -85,6 +84,7 @@ | |
"@typescript-eslint/eslint-plugin": "^5.23.0", | ||
"@typescript-eslint/parser": "^5.23.0", | ||
"chmodr": "^1.2.0", | ||
"cross-env": "^7.0.3", | ||
"electron": "^20.1.2", | ||
"electron-builder": "^23.3.3", | ||
"electron-devtools-installer": "^3.2.0", | ||
|
@@ -110,13 +110,15 @@ | |
}, | ||
"analyticsUrl": "https://analytics.mysterium.network", | ||
"intercomAppId": "sjkeehf4", | ||
"pushyAppId": "5f23dc54d4786d7760003a71", | ||
"sentryDsn": "https://[email protected]/5222592", | ||
"electronWebpack": { | ||
"renderer": { | ||
"sourceDirectory": "src/app", | ||
"template": "src/app/index.html", | ||
"webpackConfig": "webpack.renderer.additions.js" | ||
}, | ||
"main": { | ||
"webpackConfig": "webpack.main.additions.js" | ||
} | ||
}, | ||
"build": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
src/app/ui-kit/components/MysteriumVPN2Toast/MysteriumVPN2Toast.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* eslint-disable */ | ||
/** | ||
* Copyright (c) 2021 BlockDev AG | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
import React, { useEffect } from "react"; | ||
import icon from "./icon.png"; | ||
import { toast } from "react-hot-toast"; | ||
import { dismissibleToast } from "../dismissibleToast"; | ||
import { shell } from "electron"; | ||
import styled from "styled-components"; | ||
import { useStores } from "../../../store"; | ||
|
||
const Container = styled.div` | ||
cursor: pointer; | ||
`; | ||
export const MysteriumVPN2Toast: React.FC = () => { | ||
const root = useStores() | ||
const { config } = root | ||
useEffect(() => { | ||
if (config.vpn2Offered) { | ||
return | ||
} | ||
|
||
let link: string | ||
if (root.isWindows) { | ||
link = "https://www.mysteriumvpn.com/mysterium-vpn-v2?utm_source=MysteriumDark&utm_medium=Windows&utm_campaign=Banner" | ||
} else if (root.isMacOS) { | ||
link = "https://www.mysteriumvpn.com/mysterium-vpn-v2?utm_source=MysteriumDark&utm_medium=Mac&utm_campaign=Banner" | ||
} else { | ||
link = "https://www.mysteriumvpn.com/mysterium-vpn-v2?utm_source=MysteriumDark&utm_medium=Other&utm_campaign=Banner" | ||
} | ||
|
||
toast(dismissibleToast( | ||
<Container> | ||
<a onClick={() => { | ||
shell.openExternal(link); | ||
config.setVpn2Offered() | ||
}}> | ||
<b>MysteriumVPN 2.0 for Desktop is available</b><br /> | ||
<span>Download the new app to use Mysterium VPN on Android, iOS, Mac and Windows</span> | ||
</a> | ||
</Container> | ||
), { | ||
duration: Infinity, | ||
icon: <img src={icon} width={64} height={64} />, | ||
style: { | ||
maxWidth: 400, | ||
} | ||
}); | ||
}); | ||
return <></>; | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.