Skip to content

Commit

Permalink
Merge pull request #27 from celo-tools/desktop
Browse files Browse the repository at this point in the history
Major update: Create desktop apps and promote out of Beta
  • Loading branch information
jmrossy authored Mar 4, 2021
2 parents 0ab543a + ad395c1 commit 217d135
Show file tree
Hide file tree
Showing 202 changed files with 10,595 additions and 2,506 deletions.
5 changes: 4 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
"^src/(.*)": "<pkgDir>/src/$1"
}
}
]
],
// Seem to require these even though https://github.com/babel/babel/issues/10690 is closed?
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining"
]
}
},
Expand Down
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ node_modules
dist
webpack.config.js
jest.config.js
spec
spec
electron
scripts
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug Report
about: Report a bug in CeloWallet.app
title: ''
labels: ''
assignees: ''

---

#### App Version and Operating System

<!-- App version can be found in the About Wallet modal, link in the footer -->

- Tested on **version_here**
- Platform and version: **e.g. Web / Mac 10.13.5 / Windows 10 / ..**

#### Expected behavior

<!-- What did you expect to happen? -->

#### Actual behavior

<!-- What's the current behavior you're seeing? -->

#### Steps to reproduce the behavior

<!-- Explain steps to reproduce or provide a screenshot / gif -->
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Feature Request
about: Request a feature for CeloWallet.app
title: ''
labels: ''
assignees: ''

---

#### Feature Description

<!-- Share some info about what you'd like to see added or changed -->
65 changes: 65 additions & 0 deletions .github/workflows/bundle-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: bundle-desktop
on:
push:
branches:
- master
- staging
- production
- desktop
workflow_dispatch:

jobs:
test-and-build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x

- name: Install dependencies
run: yarn

- name: Run linter
run: yarn lint

# TODO re-enable
# - name: Run test
# shell: bash
# run: yarn test

- name: Build with webpack for electron
shell: bash
run: ./scripts/build.sh -n Mainnet -e

- name: Build on Mac
run: yarn electron-builder --mac --publish never
env:
CSC_LINK: ${{ secrets.MAC_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }}
if: runner.os == 'macOS'

- name: Build on Windows
run: yarn electron-builder --win --publish never
if: runner.os == 'Windows'

- name: Install deps for Linux
run: sudo apt-get update && sudo apt-get install libudev-dev libusb-1.0-0-dev
if: runner.os == 'Linux'

- name: Build on Linux
run: yarn electron-builder --linux --publish never
if: runner.os == 'Linux'

- uses: actions/upload-artifact@v2
with:
name: celowallet-artifacts
path: |
dist-electron/*-mac*.dmg
dist-electron/*-mac*.zip
dist-electron/*-linux*.AppImage
dist-electron/*-win*.exe
56 changes: 56 additions & 0 deletions .github/workflows/publish-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: publish-desktop
on: workflow_dispatch

jobs:
build-and-publish:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x

- name: Install dependencies
run: yarn

- name: Run linter
run: yarn lint

# TODO re-enable
# - name: Run test
# shell: bash
# run: yarn test

- name: Build with webpack for electron
shell: bash
run: ./scripts/build.sh -n Mainnet -e

- name: Build on Mac
run: yarn electron-builder --mac --publish always
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_LINK: ${{ secrets.MAC_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
if: runner.os == 'macOS'

- name: Build on Windows
run: yarn electron-builder --win --publish always
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: runner.os == 'Windows'

- name: Install deps for Linux
run: sudo apt-get update && sudo apt-get install libudev-dev libusb-1.0-0-dev
if: runner.os == 'Linux'

- name: Build on Linux
run: yarn electron-builder --linux --publish always
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: runner.os == 'Linux'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.cache/
coverage/
dist/
dist-electron/
node_modules/
*.log

Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"**/node_modules": false
},
"files.exclude": {
"**/*.js": { "when": "$(basename).ts" },
"**/*.js.map": true
},
"files.watcherExclude": {
Expand Down
31 changes: 15 additions & 16 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
# Frequently Asked Questions

[What can I do with the web wallet?](#what-can-i-do-with-the-web-wallet)
[Where can the app be used?](#where-can-the-app-be-used)

[Does it work on phones?](#does-it-work-on-phones)

[Will it work with Valora wallets?](#will-it-work-with-valora-wallets)

[How is it different than Valora?](#how-is-it-different-than-valora)

[Is the web wallet safe?](#is-the-web-wallet-safe)
[Is the web version safe?](#is-the-web-version-safe)

[Where are my keys stored?](#where-are-my-keys-stored)

[Can I download the wallet and run it offline?](#can-i-download-the-wallet-and-run-it-offline)

[Can feature X be added?](#can-feature-x-be-added)

## What can I do with the web wallet?
## Where can the app be used?

The web wallet is great at conveniently creating small wallets for day-to-day transactions. You can send payments, make currency exchanges, and see your transaction history.
The Celo Wallet can run in a modern browser (Chrome is recommended) or on your desktop (Mac, Windows, and Linux).
The desktop version has stricter security guarantees and is strongly recommended for large accounts.

## Does it work on phones?

Yes, the wallet was designed from the ground-up to be lightweight and mobile-friendly.
Yes, the web version was designed from the ground-up to be lightweight and mobile-friendly.

## Will it work with Valora wallets?

Yes, you can use your Account Key (mnemonic phrase) to import your account into the web wallet, back into Valora, or use both at the same time!
Yes, you can use your Account Key (mnemonic phrase) to import your account into the web wallet, back into Valora, or use both at the same time.

## How is it different than Valora?

The most obvious difference is platform: Valora runs on iOS and Android, the web wallet runs in any modern browser. More abstractly though, Valora is a social payments application whereas the web wallet is just a tool. That's why Valora includes extra features around importing contacts, verifying phone numbers, finding friends, etc. In contrast, one of this wallet's design principles is to be minimal, meaning no analytics, no plugins, and no device permissions (except for Ledger access).
The most obvious difference is platform: Valora runs on iOS and Android, the web wallet runs in any modern browser and on desktop. More abstractly though, Valora is a social payments application whereas the web wallet is just a tool. That's why Valora includes extra features around importing contacts, verifying phone numbers, finding friends, etc. In contrast, one of this wallet's design principles is to be minimal, meaning no analytics, no plugins, and no device permissions (except for Ledger access).

## Is the web wallet safe?
## Is the web version safe?

Short answer: Yes, but use is only recommended for small 'hot' wallets or Ledger-backed wallets.
Short answer: It's safe enough for small 'hot' wallets or Ledger-backed wallets. For anything larger or more important, the desktop version is strongly recommended.

Long answer: The core developers try their best to keep the all wallets safe. This includes encrypting your wallet at rest, minimal use of 3rd party code, pinning dependencies, using single-origin code sourcing, publishing bundle hashes, and other modern web development best practices. That said, the web is, by design, an open and extensible platform. That unfortunately means even the best web apps are vulnerable to certain risks, like malicious browser extensions. For this reason, the recommendation is to use the web wallet for small amounts only. For larger amounts, use Valora or a Ledger hardware wallet.
Long answer: The web version does what it can to protect your funds but web apps have certain inherent limitations. Protections includes: encrypting your wallet at rest, minimal use of 3rd party code, pinning dependencies, using single-origin code sourcing, publishing bundle hashes, and other modern web development best practices. That said, the web is, by design, an open and extensible platform. That unfortunately means all web apps are vulnerable to certain risks, like malicious browser extensions. For this reason, the recommendation is to use the web version for small amounts only. For larger amounts, use the desktop version, Valora or a Ledger hardware wallet.

## Where are my keys stored?

Your mnemonic, from which you keys are derived, is encrypted using your pin and stored in browser local storage. Your keys never leave your device. In other words, the web wallet is a self-sovereign (non-custodial) wallet.

## Can I download the wallet and run it offline?
Your mnemonic, from which you keys are derived, is encrypted using your password and stored either in browser local storage for web or on disk for desktop. Your keys never leave your device. In other words, this wallet is a self-sovereign (non-custodial) wallet.

Soon! The wallet has some limited Progress Web App (PWA) support for app pinning.
- Mac: `~/Library/Application Support/celo-web-wallet`
- Linux: `~/.config/celo-web-wallet or $XDG_CONFIG_HOME/celo-web-wallet`
- Windows: `C:\Users\{USERNAME}\AppData\Roaming\celo-web-wallet`

## Can feature X be added?

Expand Down
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Celo Web Wallet
# Celo Wallet For Web and Desktop

A browser-based, mobile-friendly, self-sovereign wallet for the Celo network.
A lightweight, self-sovereign wallet for the Celo network. Manage small accounts [on the web](https://celowallet.app) or large ones [on your desktop.](https://github.com/celo-tools/celo-web-wallet/releases) Fully compatible with Ledger hardware.

Ideal for managing small 'hot' wallets or Celo wallets on Ledger hardware.
## Desktop Downloads

The desktop downloads for Mac, Windows, and Linux are hosted here in the [releases page](https://github.com/celo-tools/celo-web-wallet/releases).

## Frequently Asked Questions

Expand All @@ -12,8 +14,8 @@ See the [FAQ](FAQ.md) for more details about common questions.

This wallet uses [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity). Current bundle hashes:

* Main bundle: `bundle.js -> sha256-FR2Caux0Qij79Jj47G0xbU8WYknbNmxxtWbKEim2cUw=`
* Optional Ledger bundle: `bundle-ledger.js -> sha256-m5wcEVEXFVmOal5a4P2F9Sum8c8jgGxVUg0d4k3G5MQ=`
* Main bundle: `bundle.js -> sha256-I4698ivrNQ6zcsW4WgC3fqUvNmAGEGIo9sUWSVzw4pw=`
* Optional Ledger bundle: `bundle-ledger.js -> sha256-Ue4vU1iTjNOEPSX51d7ofexxwCEBiiJmQUEX6Ewd4AQ=`

Advanced users can verify the source integrity by comparing the hashes in their page source to these values.

Expand All @@ -22,26 +24,29 @@ Advanced users can verify the source integrity by comparing the hashes in their
First install dependencies:

```sh
# The --ignore-scripts flag here is optional but improves security
yarn install --ignore-scripts
yarn install
```

To create and run a development build:
### Running in a browser

To create and run a development build in a browser (recommended for development):

```sh
yarn dev
```

To create a production build:
### Running in Electron

To build for electron and run in a desktop app:

```sh
yarn build:prod
yarn electron:dev
```

## Contributing

For small contributions such as bug fixes or style tweaks, please open a Pull Request.
For new features, please create an issue to start a discussion on [Discord](https://discord.com/channels/600834479145353243/783806028629934110).
For new features, please create an issue to start a discussion on [Discord](https://discord.com/channels/600834479145353243/812471799585439794).

## License

Expand Down
56 changes: 56 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
appId: app.celo.wallet
productName: Celo Wallet

directories:
app: dist
output: dist-electron
buildResources: electron/build

protocols:
name: Celo Wallet
schemes:
- celowallet

afterSign: scripts/notarize.js

mac:
artifactName: ${productName}-${version}-${os}.${ext}
category: public.app-category.wallet
hardenedRuntime: true
entitlements: electron/build/mac/entitlements.plist
entitlementsInherit: electron/build/mac/entitlements.plist
target:
- dmg
- zip

linux:
artifactName: ${productName}-${version}-${os}-${arch}.${ext}
category: Finance
target:
- target: AppImage
arch:
- x64

win:
artifactName: ${productName}-${version}-${os}-${arch}.${ext}
# icon: build/windows/app.ico
# certificateSubjectName: Ledger SAS
# certificateSha1: 7DD9ACB2EF0402883C65901EBBAFD06E5293D391
# signingHashAlgorithms:
# - sha256
target:
- target: nsis
arch:
- x64

nsis:
oneClick: false
perMachine: true
allowToChangeInstallationDirectory: true
installerIcon: installer.ico
uninstallerIcon: installer.ico

publish:
provider: github
owner: celo-tools
repo: celo-web-wallet
Binary file added electron/build/icon.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 added electron/build/installer.ico
Binary file not shown.
Loading

0 comments on commit 217d135

Please sign in to comment.