Skip to content

Commit

Permalink
Merge pull request #14 from beetapp/reintroduce
Browse files Browse the repository at this point in the history
Implement electron context isolation & reintroduce BTS based chains
  • Loading branch information
grctest authored Mar 10, 2024
2 parents 6776405 + e43804c commit 0d0dce2
Show file tree
Hide file tree
Showing 114 changed files with 33,580 additions and 6,186 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js 18.x
- name: Use Node.js 21.6.2
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 'node'
cache: 'npm'

- run: npm install
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Thumbs.db
/app/app.js
/app/modal.js
/app/background.js
/app/preload.js
/app/preloadmodal.js
/app/receipt.js
/app/**/*.map
/app/*.ttf
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Interacting with any blockchain can be cumbersome if you are not familiar with h

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?").

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

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.

# BeetEOS - Your EOS blockchain companion

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.
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.

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

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

ATTENTION

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

## For developers

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.
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.

To run Beet it's simply a case of

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

## Current Limitations

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.
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.

Please open an issue to add support for your desired way.

## Encountered an issue? Want a new feature?
Expand Down
Binary file modified app/img/beet-notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/img/beet-taskbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/img/beet-tray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/img/beet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/img/beetSmall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 39 additions & 8 deletions build/start.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@
const childProcess = require("child_process");
const electron = require("electron");
const webpack = require("webpack");
const config = require("./webpack.app.config");
const childProcess = require('child_process');
const electron = require('electron');
const webpack = require('webpack');
const mainConfig = require('./webpack.main.config.js');
const rendererConfig = require('./webpack.renderer.config.js');
const preloadConfig = require('./webpack.preload.config.js');

const env = "development";
const compiler = webpack(config(env));
const mainCompiler = webpack(mainConfig(env));
const rendererCompiler = webpack(rendererConfig(env));
const preloadCompiler = webpack(preloadConfig(env));

let electronStarted = false;
let mainDone = false;
let rendererDone = false;
let preloadDone = false;

const watching = compiler.watch({}, (err, stats) => {
if (!err && !stats.hasErrors() && !electronStarted) {
const startElectron = () => {
if (!electronStarted && mainDone && rendererDone && preloadDone) {
electronStarted = true;

childProcess
.spawn(electron, ["."], { stdio: "inherit" })
.on("close", () => {
watching.close();
mainWatching.close();
rendererWatching.close();
preloadWatching.close();
});
}
};

const mainWatching = mainCompiler.watch({}, (err, stats) => {
if (!err && !stats.hasErrors()) {
mainDone = true;
startElectron();
}
});

const rendererWatching = rendererCompiler.watch({}, (err, stats) => {
if (!err && !stats.hasErrors()) {
rendererDone = true;
startElectron();
}
});

const preloadWatching = preloadCompiler.watch({}, (err, stats) => {
if (!err && !stats.hasErrors()) {
preloadDone = true;
startElectron();
}
});
18 changes: 0 additions & 18 deletions build/webpack.app.config.js

This file was deleted.

106 changes: 0 additions & 106 deletions build/webpack.base.config.js

This file was deleted.

68 changes: 68 additions & 0 deletions build/webpack.main.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const FriendlyErrorsWebpackPlugin = require('@soda/friendly-errors-webpack-plugin');

module.exports = function(env) {
return {
target: 'electron-main',
entry: {
background: "./src/background.js",
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "../app"),
},
mode: env === "production" ? "production" : "development",
node: {
__dirname: false,
__filename: false
},

externals: [nodeExternals({
allowlist: [
'@babel/runtime',
'query-string',
'decode-uri-component',
'split-on-first',
'filter-obj'
]
})],

resolve: {
extensions: ['.js', '.json'],
mainFields: ["main"],
alias: {
env: path.resolve(__dirname, `../config/env_${env}.json`),
'~': path.resolve(__dirname, '../src/')
}
},

devtool: "source-map",

module: {
rules: [
{
test: /node_modules[/\\](bytebuffer)[/\\].+/,
resolve: {
aliasFields: ["main"]
}
},
{
test: /node_modules[/\\](lzma)[/\\].+/,
resolve: {
aliasFields: ["main"]
}
}
]
},

plugins: [
new FriendlyErrorsWebpackPlugin({
clearConsole: env === "development",
onErrors: function (severity, errors) {
console.log({severity, errors})
},
})
]
};
};
44 changes: 44 additions & 0 deletions build/webpack.preload.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const path = require('path');
const FriendlyErrorsWebpackPlugin = require('@soda/friendly-errors-webpack-plugin');

module.exports = function(env) {
return {
entry: {
preload: "./src/preload.js",
preloadmodal: "./src/preloadmodal.js",
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "../app"),
},
target: 'electron-preload',
mode: env === "production" ? "production" : "development",

node: {
__dirname: false,
__filename: false
},

externals: [],

resolve: {
extensions: ['.*', '.js'],
mainFields: ["preload"],
alias: {
env: path.resolve(__dirname, `../config/env_${env}.json`),
'~': path.resolve(__dirname, '../src/')
}
},

devtool: "source-map",

plugins: [
new FriendlyErrorsWebpackPlugin({
clearConsole: env === "development",
onErrors: function (severity, errors) {
console.log({severity, errors})
},
})
]
};
};
Loading

0 comments on commit 0d0dce2

Please sign in to comment.