Skip to content

Commit 0d0dce2

Browse files
authored
Merge pull request #14 from beetapp/reintroduce
Implement electron context isolation & reintroduce BTS based chains
2 parents 6776405 + e43804c commit 0d0dce2

File tree

114 files changed

+33580
-6186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+33580
-6186
lines changed

.github/workflows/node.js.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ jobs:
4646
- name: Checkout code
4747
uses: actions/checkout@v3
4848

49-
- name: Use Node.js 18.x
49+
- name: Use Node.js 21.6.2
5050
uses: actions/setup-node@v3
5151
with:
52-
node-version: 18.x
52+
node-version: 'node'
5353
cache: 'npm'
5454

5555
- run: npm install

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Thumbs.db
1313
/app/app.js
1414
/app/modal.js
1515
/app/background.js
16+
/app/preload.js
17+
/app/preloadmodal.js
1618
/app/receipt.js
1719
/app/**/*.map
1820
/app/*.ttf

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Interacting with any blockchain can be cumbersome if you are not familiar with h
44

55
In general, every action on a blockchain requires a cryptographic signature of the required private keys for the action, and when you are using third party tools (especially closed source ones), the question about trust quickly arises ("Are they gonna steal my private keys?").
66

7-
BeetEOS aims to solve these trust concerns, whilst additionally facilitating private key managament for the everyday EOS user.
7+
BeetEOS aims to solve these trust concerns, whilst additionally facilitating private key managament for the everyday EOS/Bitshares based blockchain user.
88

99
A general rule of thumb for the inexperienced: Never ever expose your private keys on the internet, and if that is ever needed, stay vigilant and do your due diligence.
1010

1111
# BeetEOS - Your EOS blockchain companion
1212

13-
BeetEOS is a locally installed stand-alone key and identity manager and signing app for EOS based blockchains, originally evolved from the BitShares Blockchains and influenced by the [Beet](https://github.com/bitshares/beet) and [Scatter](https://github.com/GetScatter) wallets.
13+
BeetEOS is a locally installed stand-alone key and identity manager and signing app for both Bitshares and EOS based blockchains influenced by the [Beet](https://github.com/bitshares/beet) and [Scatter](https://github.com/GetScatter) wallets.
1414

1515
BeetEOS allows separate account management while being in full control of what data to expose to third parties.
1616

@@ -44,11 +44,11 @@ Releases are bundled as installers and are available at https://github.com/bitsh
4444

4545
ATTENTION
4646

47-
Beet binaries will never be hosted anywhere but within GitHub releases. If you find Beet binaries anywhere else, it is likely a phishing attempt.
47+
BeetEOS binaries will never be hosted anywhere but within GitHub releases. If you find Beet binaries anywhere else, it is likely a phishing attempt.
4848

4949
## For developers
5050

51-
Beet is an [electron-based app](https://www.electronjs.org) for [cross-platform compatibility](https://www.electron.build), utilising the [VueJS framework](https://blog.vuejs.org/posts/vue-3-as-the-new-default.html), [BalmUI design system](https://material.balmjs.com) and the [Socket.IO](https://socket.io) libraries.
51+
BeetEOS is an [electron-based app](https://www.electronjs.org) for [cross-platform compatibility](https://www.electron.build), utilising the [VueJS framework](https://blog.vuejs.org/posts/vue-3-as-the-new-default.html), [BalmUI design system](https://material.balmjs.com) and the [Socket.IO](https://socket.io) libraries.
5252

5353
To run Beet it's simply a case of
5454

@@ -68,7 +68,8 @@ If you are in linux you may need to do: `sudo apt-get install libudev-dev` befor
6868

6969
## Current Limitations
7070

71-
BeetEOS currently only supports single-sig accounts (one private key to unlock the blockchain action), and depending on the blockchain different import options may be available.
71+
BeetEOS currently only supports single-signature accounts (one private key to unlock the blockchain action), and depending on the blockchain different import options may be available.
72+
7273
Please open an issue to add support for your desired way.
7374

7475
## Encountered an issue? Want a new feature?

app/img/beet-notification.png

-11.5 KB
Loading

app/img/beet-taskbar.png

-13.1 KB
Loading

app/img/beet-tray.png

-13.1 KB
Loading

app/img/beet.png

-11.5 KB
Loading

app/img/beetSmall.png

4.57 KB
Loading

build/start.js

+39-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,51 @@
1-
const childProcess = require("child_process");
2-
const electron = require("electron");
3-
const webpack = require("webpack");
4-
const config = require("./webpack.app.config");
1+
const childProcess = require('child_process');
2+
const electron = require('electron');
3+
const webpack = require('webpack');
4+
const mainConfig = require('./webpack.main.config.js');
5+
const rendererConfig = require('./webpack.renderer.config.js');
6+
const preloadConfig = require('./webpack.preload.config.js');
57

68
const env = "development";
7-
const compiler = webpack(config(env));
9+
const mainCompiler = webpack(mainConfig(env));
10+
const rendererCompiler = webpack(rendererConfig(env));
11+
const preloadCompiler = webpack(preloadConfig(env));
12+
813
let electronStarted = false;
14+
let mainDone = false;
15+
let rendererDone = false;
16+
let preloadDone = false;
917

10-
const watching = compiler.watch({}, (err, stats) => {
11-
if (!err && !stats.hasErrors() && !electronStarted) {
18+
const startElectron = () => {
19+
if (!electronStarted && mainDone && rendererDone && preloadDone) {
1220
electronStarted = true;
1321

1422
childProcess
1523
.spawn(electron, ["."], { stdio: "inherit" })
1624
.on("close", () => {
17-
watching.close();
25+
mainWatching.close();
26+
rendererWatching.close();
27+
preloadWatching.close();
1828
});
1929
}
30+
};
31+
32+
const mainWatching = mainCompiler.watch({}, (err, stats) => {
33+
if (!err && !stats.hasErrors()) {
34+
mainDone = true;
35+
startElectron();
36+
}
37+
});
38+
39+
const rendererWatching = rendererCompiler.watch({}, (err, stats) => {
40+
if (!err && !stats.hasErrors()) {
41+
rendererDone = true;
42+
startElectron();
43+
}
2044
});
45+
46+
const preloadWatching = preloadCompiler.watch({}, (err, stats) => {
47+
if (!err && !stats.hasErrors()) {
48+
preloadDone = true;
49+
startElectron();
50+
}
51+
});

build/webpack.app.config.js

-18
This file was deleted.

build/webpack.base.config.js

-106
This file was deleted.

build/webpack.main.config.js

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
const path = require('path');
2+
const nodeExternals = require('webpack-node-externals');
3+
const FriendlyErrorsWebpackPlugin = require('@soda/friendly-errors-webpack-plugin');
4+
5+
module.exports = function(env) {
6+
return {
7+
target: 'electron-main',
8+
entry: {
9+
background: "./src/background.js",
10+
},
11+
output: {
12+
filename: "[name].js",
13+
path: path.resolve(__dirname, "../app"),
14+
},
15+
mode: env === "production" ? "production" : "development",
16+
node: {
17+
__dirname: false,
18+
__filename: false
19+
},
20+
21+
externals: [nodeExternals({
22+
allowlist: [
23+
'@babel/runtime',
24+
'query-string',
25+
'decode-uri-component',
26+
'split-on-first',
27+
'filter-obj'
28+
]
29+
})],
30+
31+
resolve: {
32+
extensions: ['.js', '.json'],
33+
mainFields: ["main"],
34+
alias: {
35+
env: path.resolve(__dirname, `../config/env_${env}.json`),
36+
'~': path.resolve(__dirname, '../src/')
37+
}
38+
},
39+
40+
devtool: "source-map",
41+
42+
module: {
43+
rules: [
44+
{
45+
test: /node_modules[/\\](bytebuffer)[/\\].+/,
46+
resolve: {
47+
aliasFields: ["main"]
48+
}
49+
},
50+
{
51+
test: /node_modules[/\\](lzma)[/\\].+/,
52+
resolve: {
53+
aliasFields: ["main"]
54+
}
55+
}
56+
]
57+
},
58+
59+
plugins: [
60+
new FriendlyErrorsWebpackPlugin({
61+
clearConsole: env === "development",
62+
onErrors: function (severity, errors) {
63+
console.log({severity, errors})
64+
},
65+
})
66+
]
67+
};
68+
};

build/webpack.preload.config.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
const path = require('path');
2+
const FriendlyErrorsWebpackPlugin = require('@soda/friendly-errors-webpack-plugin');
3+
4+
module.exports = function(env) {
5+
return {
6+
entry: {
7+
preload: "./src/preload.js",
8+
preloadmodal: "./src/preloadmodal.js",
9+
},
10+
output: {
11+
filename: "[name].js",
12+
path: path.resolve(__dirname, "../app"),
13+
},
14+
target: 'electron-preload',
15+
mode: env === "production" ? "production" : "development",
16+
17+
node: {
18+
__dirname: false,
19+
__filename: false
20+
},
21+
22+
externals: [],
23+
24+
resolve: {
25+
extensions: ['.*', '.js'],
26+
mainFields: ["preload"],
27+
alias: {
28+
env: path.resolve(__dirname, `../config/env_${env}.json`),
29+
'~': path.resolve(__dirname, '../src/')
30+
}
31+
},
32+
33+
devtool: "source-map",
34+
35+
plugins: [
36+
new FriendlyErrorsWebpackPlugin({
37+
clearConsole: env === "development",
38+
onErrors: function (severity, errors) {
39+
console.log({severity, errors})
40+
},
41+
})
42+
]
43+
};
44+
};

0 commit comments

Comments
 (0)