Skip to content

Commit

Permalink
v1.15.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Sep 6, 2023
1 parent 7b946f9 commit 9e142be
Show file tree
Hide file tree
Showing 179 changed files with 2,641 additions and 1,753 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/statoscope-comment.jora
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $getSizeByChunks: => files.(getAssetSize($$, true)).reduce(=> size + $$, 0);
}
},
validation: {
$messages: resolveInputFile().compilations.[hash].(hash.validation_getItems());
$messages: $after.compilations.[hash].(hash.validation_getItems());
$messages,
total: $messages.size()
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/statoscope-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ module.exports = ({ initialSize, bundleSize, validation, prNumber}) => `**📦 S
**🕵️ Validation errors:** ${validation.total > 0 ? validation.total : '✅'}
Full Statoscope report could be found [here️](https://deploy-preview-${prNumber}--mytonwallet-e5kxpi8iga.netlify.app/report.html)
Full Statoscope report could be found [here️](https://deploy-preview-${prNumber}--mytonwallet-e5kxpi8iga.netlify.app/statoscope-report.html) / [diff](https://deploy-preview-${prNumber}--mytonwallet-e5kxpi8iga.netlify.app/statoscope-report.html#diff)
`;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Upload main stats
name: Statoscope upload reference statistics

on:
push:
Expand All @@ -12,7 +12,7 @@ jobs:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Reconfigure git to use HTTPS authentication
Expand All @@ -24,8 +24,8 @@ jobs:
- name: Install
run: npm ci
- name: Build
run: npm run build:production; cp ./public/build-stats.json ./reference.json
- uses: actions/upload-artifact@v2
run: npm run build:production; cp ./public/statoscope-build-statistics.json ./statoscope-reference.json
- uses: actions/upload-artifact@v3
with:
name: main-stats
path: ./reference.json
name: statoscope-reference
path: ./statoscope-reference.json
16 changes: 10 additions & 6 deletions .github/workflows/statoscope.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,30 @@ jobs:
node_modules
key: ${{ github.sha }}
- name: Build
run: npm run build:production; cp public/build-stats.json input.json
- name: Download reference stats
run: npm run build:production
- name: Download reference statistics
uses: dawidd6/action-download-artifact@v2
with:
workflow: upload-main-stats.yml
workflow: statoscope-upload-reference-statistics.yml
workflow_conclusion: success
name: main-stats
name: statoscope-reference
path: ./
continue-on-error: true
- name: Prepare statoscope input
run: cp public/statoscope-build-statistics.json input.json; mv statoscope-reference.json reference.json
- name: Validate
run: npm run statoscope:validate-diff
- name: Query stats
if: "github.event_name == 'pull_request'"
run: cat .github/workflows/statoscope-comment.jora | npx --no-install @statoscope/cli query --input input.json --input reference.json > result.json
run: cat .github/workflows/statoscope-comment.jora | npx --no-install @statoscope/cli query --input input.json --input reference.json > statoscope-result.json
- name: Hide bot comments
uses: int128/hide-comment-action@v1
- name: Comment PR
if: "github.event_name == 'pull_request'"
uses: actions/[email protected]
with:
script: |
const createStatoscopeComment = require('./dev/createStatoscopeComment');
const createStatoscopeComment = require('./dev/statoscopeCreateComment');
await createStatoscopeComment({ github, context, core })
- name: Cleanup
run: rm input.json; rm reference.json
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
node_modules
dist
dist-electron
MyTonWallet.zip
MyTonWallet-chrome.zip
MyTonWallet-firefox.zip
MyTonWallet-opera.zip
.cache
.env*
!.env.example
Expand All @@ -13,9 +14,10 @@ dev/perf/screenshot*
.DS_store
.DS_Store
test-results
public/build-stats.json
public/reference.json
public/statoscope-build-statistics.json
public/statoscope-reference.json
public/statoscope-report.html
public/statoscope-master-reference.json
trash/
coverage/
src/i18n/en.json
Expand Down
88 changes: 11 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@

The wallet is **self-custodial and safe**. The developers **do not** have access to funds, browser history or any other information. We focus on **speed**, **size** and **attention to detail**. We try to avoid using third-party libraries to ensure maximum reliability and safety, and also to lower the bundle size.

## Table of contents

- [Requirements](#requirements)
- [Local Setup](#local-setup)
- [Dev Mode](#dev-mode)
- [Installing App on Linux](#installing-app-on-linux)
- [Electron](./docs/electron.md)
- [Verifying GPG Signatures](./docs/gpg-check.md)
- [Support Us](#support-us)

## Requirements

Ready to build on **macOS** and **Linux**.
Expand All @@ -29,86 +39,10 @@ npm i
npm run dev
```

## Electron

Electron allows to build native application, that can be installed and run on Windows, macOS and Linux.

### Installing app on Linux
## Installing App on Linux

In order for the application to work correctly and be displayed in the Linux menu, you need to install the AppImage via [AppImageLauncher](https://github.com/TheAssassin/AppImageLauncher)

#### NPM scripts

- `npm run dev:electron`

Run Electron in development mode, concurrently starts 3 processes with watch for changes: main (main Electron process), renderer (FE code) and Webpack for Electron (compiles main Electron process from TypeScript).

- `npm run electron:webpack`

The main process code for Electron, which includes preload functionality, is written in TypeScript and is compiled using the `webpack-electron.config.js` configuration to generate JavaScript code.

- `npm run electron:build`

Prepare renderer (FE code) build, compile Electron main process code, install and build native dependencies, is used before packaging or publishing.

- `npm run electron:staging`

Create packages for macOS, Windows and Linux in `dist-electron` folders with `APP_ENV` as `staging` (allows to open DevTools, includes sourcemaps and does not minify built JavaScript code), can be used for manual distribution and testing packaged application.

- `npm run electron:production`

Create packages for macOS, Windows and Linux in `dist-electron` folders with `APP_ENV` as `production` (disabled DevTools, minified built JavaScript code), can be used for manual distribution and testing packaged application.

- `npm run deploy:electron`

Create packages for macOS, Windows and Linux in `dist-electron` folder and publish release to GitHub, which allows supporting autoupdates. See [GitHub release workflow](#github-release) for more info.

#### Code signing on MacOS

To sign the code of your application, follow these steps:

- Install certificates to `login` folder of your Keychain.
- Download and install `Developer ID - G2` certificate from the [Apple PKI](https://www.apple.com/certificateauthority/) page.
- Under the Keychain application, go to the private key associated with your developer certificate. Then do `key > Get Info > Access Control`. Down there, make sure your application (Xcode) is in the list `Always allow access by these applications` and make sure `Confirm before allowing access` is turned on.
- A valid and appropriate identity from your keychain will be automatically used when you publish your application.

More info in the [official documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing).

#### Notarize on MacOS

Application notarization is done automatically in [electron-builder](https://github.com/electron-userland/electron-builder/) module, which requires `APPLE_ID` and `APPLE_APP_SPECIFIC_PASSWORD` environment variables to be passed.

How to obtain app-specific password:

- Sign in to [appleid.apple.com](appleid.apple.com).
- In the "Sign-In and Security" section, select "App-Specific Passwords".
- Select "Generate an app-specific password" or select the Add button, then follow the steps on your screen.

#### GitHub release

##### GitHub access token

In order to publish new release, you need to add GitHub access token to `.env`. Generate a GitHub access token by going to https://github.com/settings/tokens/new. The access token should have the repo scope/permission. Once you have the token, assign it to an environment variable:

```
# .env
GH_TOKEN="{YOUR_TOKEN_HERE}"
```

##### Publish settings

Publish configuration in `electron-builder.yml` config file allows to set GitHub repository owner/name.

##### Release workflow

- Draft a new release on GitHub. Create new tag version with the value of `version` in your application `package.json`, and prefix it with `v`. “Release title” can be anything you want.

For example, if your application `package.json` version is `1.0`, your draft’s tag version would be `v1.0`.

- Save draft release
- Run `npm run electron:publish`, which will upload build artefacts to newly reated release.
- Once you are done, publish the release. GitHub will tag the latest commit.

## Support Us

If you like what we do, feel free to contribute by creating a pull request, or just support us using this TON wallet: `EQAIsixsrb93f9kDyplo_bK5OdgW5r0WCcIJZdGOUG1B282S`. We appreciate it a lot!
2 changes: 0 additions & 2 deletions deploy/copy_to_dist.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash

cp -R ./public/* ${1:-"dist"}
rm ./dist/statoscope-report.html
rm ./dist/build-stats.json

cp ./src/lib/rlottie/rlottie-wasm.js ${1:-"dist"}
cp ./src/lib/rlottie/rlottie-wasm.wasm ${1:-"dist"}
23 changes: 23 additions & 0 deletions deploy/package_extension.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

set -e

if [ -z "$1" ]; then
echo "Missing argument: <target>"
exit 1
fi

TARGET="$1"

cp -R ./public/* ./src/lib/rlottie/rlottie-wasm.js ./src/lib/rlottie/rlottie-wasm.wasm ./dist/

rm -rf ./dist/statoscope-* \
./dist/get \
./dist/background-electron-dmg.tiff \
./dist/electron-entitlements.mac.plist \
./dist/icon-electron-* \
./dist/site.webmanifest

rm -f "MyTonWallet-$TARGET.zip"

zip -r -X "MyTonWallet-$TARGET.zip" dist/*
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-env node */

const fs = require('fs');
const createPrComment = require('./createPrComment');
const createPrComment = require('./statoscopeCreatePrComment');
const template = require('../.github/workflows/statoscope-comment');

module.exports = async ({ github, context }) => {
const data = JSON.parse(fs.readFileSync('result.json', 'utf8'));
const data = JSON.parse(fs.readFileSync('statoscope-result.json', 'utf8'));
data.prNumber = context.issue.number;
const body = template(data);

Expand Down
File renamed without changes.
75 changes: 75 additions & 0 deletions docs/electron.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Electron

Electron allows to build native application, that can be installed and run on Windows, macOS and Linux.

## NPM scripts

- `npm run dev:electron`

Run Electron in development mode, concurrently starts 3 processes with watch for changes: main (main Electron process), renderer (FE code) and Webpack for Electron (compiles main Electron process from TypeScript).

- `npm run electron:webpack`

The main process code for Electron, which includes preload functionality, is written in TypeScript and is compiled using the `webpack-electron.config.js` configuration to generate JavaScript code.

- `npm run electron:build`

Prepare renderer (FE code) build, compile Electron main process code, install and build native dependencies, is used before packaging or publishing.

- `npm run electron:staging`

Create packages for macOS, Windows and Linux in `dist-electron` folders with `APP_ENV` as `staging` (allows to open DevTools, includes sourcemaps and does not minify built JavaScript code), can be used for manual distribution and testing packaged application.

- `npm run electron:production`

Create packages for macOS, Windows and Linux in `dist-electron` folders with `APP_ENV` as `production` (disabled DevTools, minified built JavaScript code), can be used for manual distribution and testing packaged application.

- `npm run deploy:electron`

Create packages for macOS, Windows and Linux in `dist-electron` folder and publish release to GitHub, which allows supporting autoupdates. See [GitHub release workflow](#github-release) for more info.

## Code signing on MacOS

To sign the code of your application, follow these steps:

- Install certificates to `login` folder of your Keychain.
- Download and install `Developer ID - G2` certificate from the [Apple PKI](https://www.apple.com/certificateauthority/) page.
- Under the Keychain application, go to the private key associated with your developer certificate. Then do `key > Get Info > Access Control`. Down there, make sure your application (Xcode) is in the list `Always allow access by these applications` and make sure `Confirm before allowing access` is turned on.
- A valid and appropriate identity from your keychain will be automatically used when you publish your application.

More info in the [official documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing).

## Notarize on MacOS

Application notarization is done automatically in [electron-builder](https://github.com/electron-userland/electron-builder/) module, which requires `APPLE_ID` and `APPLE_APP_SPECIFIC_PASSWORD` environment variables to be passed.

How to obtain app-specific password:

- Sign in to [appleid.apple.com](appleid.apple.com).
- In the "Sign-In and Security" section, select "App-Specific Passwords".
- Select "Generate an app-specific password" or select the Add button, then follow the steps on your screen.

## GitHub release

### GitHub access token

In order to publish new release, you need to add GitHub access token to `.env`. Generate a GitHub access token by going to https://github.com/settings/tokens/new. The access token should have the repo scope/permission. Once you have the token, assign it to an environment variable:

```
# .env
GH_TOKEN="{YOUR_TOKEN_HERE}"
```

### Publish settings

Publish configuration in `electron-builder.yml` config file allows to set GitHub repository owner/name.

### Release workflow

- Draft a new release on GitHub. Create new tag version with the value of `version` in your application `package.json`, and prefix it with `v`. “Release title” can be anything you want.

For example, if your application `package.json` version is `1.0`, your draft’s tag version would be `v1.0`.

- Save draft release
- Run `npm run electron:publish`, which will upload build artefacts to newly reated release.
- Once you are done, publish the release. GitHub will tag the latest commit.
44 changes: 44 additions & 0 deletions docs/gpg-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Verifying GPG signatures of MyTonWallet using macOS or Linux command line
This can be used to verify the authenticity of MyTonWallet binaries/sources.

Download only from https://mytonwallet.app/get or https://github.com/mytonwalletorg/mytonwallet/releases and remember to check the gpg signature again every time you download a new version.

## Obtain public GPG key for Mytonwallet Dev
In a terminal enter (or copy):

```shell
gpg --keyserver keys.openpgp.org --recv-keys 9F14486135531F4127DF8CAD52978EAFD01FD271
```

You should be able to substitute any public GPG keyserver if keys.openpgp.org is (temporarily) not working

## Download MyTonWallet and signature file (.asc)
Download the `MyTonWallet-<platform>.dmg` (or `.exe` or `.AppImage` file). Download the signature file with the same name and extension `.asc`.

## Verify GPG signature
Run the following command from the same directory you saved the files replacing <executable file> with the one actually downloaded:

```shell
gpg --verify <executable file>.asc <executable file>
```

The message should say:

```shell
Good signature from "Mytonwallet Dev <[email protected]>"
```

and

```shell
Primary key fingerprint: 9F14 4861 3553 1F41 27DF 8CAD 5297 8EAF D01F D271
```

You can ignore this:

```shell
WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
```

(It simply means you have not established a web of trust with other GPG users.)
Loading

0 comments on commit 9e142be

Please sign in to comment.