Skip to content

Commit b176539

Browse files
committed
Merge branch 'release/1.4.0' into released
2 parents daa366d + d8a6f49 commit b176539

File tree

114 files changed

+7827
-5046
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

+7827
-5046
lines changed

Diff for: .circleci/config.yml

-36
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,7 @@ jobs:
99
- image: circleci/node:11.0
1010
working_directory: ~/repo
1111
steps:
12-
# build holoflows-kit
13-
- run:
14-
name: Clone @holoflows/kit
15-
command: |
16-
cd ..
17-
git clone -q --depth=1 https://github.com/DimensionDev/holoflows-kit
18-
- restore_cache:
19-
keys:
20-
- v1-holoflows-{{ checksum "~/holoflows-kit/yarn.lock" }}
21-
# fallback to using the latest cache if no exact match is found
22-
- v1-holoflows-
23-
- run:
24-
name: Install @holoflows/kit
25-
command: |
26-
cd ../holoflows-kit
27-
yarn install --frozen-lockfile
28-
- save_cache:
29-
paths:
30-
- ~/holoflows-kit/node_modules
31-
key: v1-holoflows-{{ checksum "~/holoflows-kit/yarn.lock" }}
32-
- run:
33-
name: Build @holoflows/kit
34-
command: |
35-
cd ../holoflows-kit
36-
yarn build
37-
yarn link
38-
39-
# build maskbook
4012
- checkout
41-
- restore_cache:
42-
keys:
43-
- tsbuild-cache
4413
- restore_cache:
4514
keys:
4615
- v1-maskbook-{{ .Branch }}-{{ checksum "yarn.lock" }}
@@ -50,7 +19,6 @@ jobs:
5019
name: Build Maskbook
5120
command: |
5221
yarn install --frozen-lockfile
53-
yarn link @holoflows/kit
5422
yarn build
5523
sudo apt-get install zip
5624
cd build
@@ -59,10 +27,6 @@ jobs:
5927
paths:
6028
- node_modules
6129
key: v1-maskbook-{{ .Branch }}-{{ checksum "yarn.lock" }}
62-
- save_cache:
63-
paths:
64-
- .tscache/
65-
key: tsbuild-cache
6630
- store_artifacts:
6731
path: Maskbook.zip
6832
destination: /Maskbook.zip

Diff for: README.md

+33-21
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Maskbook · ![GitHub license](https://img.shields.io/badge/license-AGPL-blue.svg?style=flat-square) ![Ciecle CI](https://img.shields.io/circleci/project/github/DimensionDev/Maskbook.svg?style=flat-square&logo=circleci) [![Join the chat at https://gitter.im/Maskbook/community](https://badges.gitter.im/Maskbook/community.svg)](https://gitter.im/Maskbook/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ![Chrome Web Store](https://img.shields.io/chrome-web-store/v/jkoeaghipilijlahjplgbfiocjhldnap.svg?logo=Maskbook&logoColor=%231c68f3&style=flat-square)
1+
# Maskbook · ![GitHub license](https://img.shields.io/badge/license-AGPL-blue.svg?style=flat-square) ![Circle CI](https://img.shields.io/circleci/project/github/DimensionDev/Maskbook.svg?style=flat-square&logo=circleci) [![Join the chat at https://gitter.im/Maskbook/community](https://badges.gitter.im/Maskbook/community.svg)](https://gitter.im/Maskbook/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ![Chrome Web Store](https://img.shields.io/chrome-web-store/v/jkoeaghipilijlahjplgbfiocjhldnap.svg?logo=Maskbook&logoColor=%231c68f3&style=flat-square)
22

33
Encrypt your posts & chats on You-Know-Where. Allow only your friends to decrypt.
44

5-
For general introductions, see https://Maskbook.io/
5+
For general introductions, see https://Maskbook.com/
66

77
[Install Maskbook on Chrome Web Store](https://chrome.google.com/webstore/detail/maskbook/jkoeaghipilijlahjplgbfiocjhldnap/)
88

@@ -11,41 +11,53 @@ For general introductions, see https://Maskbook.io/
1111
- License: AGPL
1212
- Code Style: Use [prettier](https://github.com/prettier/prettier)
1313
- [Git flow](https://github.com/nvie/gitflow) enabled, `master` as the latest branch, `released` as the stable branch
14-
- UI developing: Use `yarn start` / `npm start` to start a [Storybook](https://storybook.js.org/)
15-
- Extension developing: Use `yarn watch` / `npm run watch` to start watch build for extension
16-
- Crypto: We're using [ECDH SECP256-k1](https://en.wikipedia.org/wiki/ECC) and [AES-GCM](https://en.wikipedia.org/wiki/AES)
14+
- Crypto: We're using [Elliptic Curve Cryptography (ECC)](https://en.wikipedia.org/wiki/ECC) of the [SECP256-k1](https://en.bitcoin.it/wiki/Secp256k1) parameters for [secret sharing](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie–Hellman) and [AES-GCM](https://en.wikipedia.org/wiki/Galois/Counter_Mode) for encryption
1715
- Data transfer between users: We're using [gun.js](https://gun.eco)
1816

19-
### Prepare
20-
21-
After `Maskbook` and `@holoflows/kit` gets stable, we will directly add `@holoflows/kit` as a dependency. Currently, you need to install and build the latest version of `@holoflows/kit`.
22-
2317
#### Install dependencies
2418

2519
- `yarn install`
2620

27-
#### Prepare for library @holoflows/kit
21+
#### Build and developing
2822

29-
- `cd ..`
30-
- `git clone https://github.com/DimensionDev/holoflows-kit.git`
31-
- `cd Holoflows-kit`
32-
- `yarn install`
33-
- `yarn build`
34-
- `yarn link`
35-
- `cd ../Maskbook`
23+
- `yarn watch` runs a watching mode. Output files in `./dist/`. Load it as unpacked Chrome or Firefox extension
24+
- `yarn build` build a production version. Output files in `./build/`
25+
- `yarn test` to run test (we didn't have one yet)
26+
- `yarn start` to start StoryBook. Used for UI only developing.
3627

37-
#### Install @holoflows/kit in Maskbook
28+
#### Non-famous libraries we are using
3829

39-
- `yarn link @holoflows/kit`
30+
- `@holoflows/kit` - A toolkit for extension developing
31+
- `anchrome` - Use it to detect links in the text
32+
- `construct-style-sheets-polyfill` - A polyfill for a web api
33+
- `elliptic` - A crypto library, we use it to encrypt and decrypt
34+
- `gun` - A decentralized graph databasem we use it to sync user's shared crypto key
35+
- `pvtsutils` and `tiny-secp256k1` - A crypto library, we use it to zip and unzip SECP256k1 keys but not using it to encrypt/decrypt
36+
- `serialijse` - A serialization / deserialization library
37+
- `webcrypto-liner` - A wrapper library, it wrap `elliptic` into WebCrypto API
4038

4139
### Folder Structure
4240

4341
- ./public - Resource file
4442
- ./src/components - UI Components
45-
- ./src/crypto - Crypto related
46-
- ./src/key-management - How we manage keys and user infos
43+
- ./src/crypto - Crypto related (Note, in "alpha" version, the bigger number means the older version, our first payload version is alpha-42, and the latest version in July 1 2019 is alpha-40)
44+
- ./src/key-management - **OLD Database**, deprecated, in most cases you don't need them.
45+
- ./src/database - How we store data.
46+
- - ./type.ts - Type definition for Identifier (used everywhere!)
47+
- - ./{avatar,group,people,post}.ts - How we store these data in database
48+
- - ./helpers - Helper methods for Services to use database easier
49+
- - ./migrate - Migrate old database to new one.
4750
- ./src/utils - Utils
51+
- - ./components - Some general React Components
52+
- - ./hooks - Some general React hooks
53+
- - ./jss - (this folder is MIT Licensed) Custom Renderer that let JSS render styles into ShadowRoot
54+
- - ./type-transform - Transform data types between each other
4855
- ./src/extension
4956
- - ./background-script - Scripts that running in the background page as a service
5057
- - ./content-script - Script that be injected into the web page
5158
- - ./injected-script - Script that will run in the main frame of the injected web page
59+
- ./tests - Some tests for Crypto algorithms
60+
- ./stories - Folder for StoryBook
61+
- ./protocols - Some standard definitions of protocols that used in Maskbook
62+
- ./network - How does Maskbook exchange information between users
63+
- ./social-network/ - Maskbook's multiple network support (Work in progress)

Diff for: config-overrides.js

+39-25
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ const path = require('path')
22

33
process.env.BROWSER = 'none'
44
module.exports = function override(/** @type{import("webpack").Configuration} */ config, env) {
5-
// CSP bans eval
6-
// And non-inline source-map not working
7-
if (env === 'development') config.devtool = 'inline-source-map'
5+
// CSP bans eval and non-inline source-map not working
6+
config.devtool = 'inline-source-map'
87
config.entry = {
98
app: path.join(__dirname, './src/index.tsx'),
109
contentscript: path.join(__dirname, './src/content-script.ts'),
@@ -17,11 +16,8 @@ module.exports = function override(/** @type{import("webpack").Configuration} */
1716
// Leads a loading failure in background service
1817
config.optimization.runtimeChunk = false
1918
config.optimization.splitChunks = undefined
20-
2119
// Dismiss warning for gun.js
22-
config.module.wrappedContextCritical = false
2320
config.module.exprContextCritical = false
24-
config.module.unknownContextCritical = false
2521

2622
config.plugins.push(
2723
new (require('write-file-webpack-plugin'))({
@@ -55,29 +51,47 @@ module.exports = function override(/** @type{import("webpack").Configuration} */
5551
)
5652
}
5753
// Let webpack build to es2017 instead of es5
58-
for (const x of config.module.rules) {
59-
if (!x.oneOf) continue
60-
for (const rule of x.oneOf) {
61-
// Replace babel-loader with ts-loader
62-
if (rule.loader === require.resolve('babel-loader')) {
63-
if (rule.include) {
64-
rule.loader = require.resolve('ts-loader')
65-
rule.options = {
54+
config.module.rules = [
55+
// from cra
56+
{
57+
parser: { requireEnsure: false },
58+
},
59+
// eslint omitted
60+
{
61+
oneOf: [
62+
// url-loader from cra
63+
{
64+
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
65+
loader: require.resolve('url-loader'),
66+
options: { limit: 10000, name: 'static/media/[name].[hash:8].[ext]' },
67+
},
68+
// babel-loader omitted
69+
// babel-loader omitted
70+
// css module loader omitted
71+
// css module loader omitted
72+
// scss loader omitted
73+
// scss (with css module) loader omitted,
74+
// file-loader from cra
75+
{
76+
loader: require.resolve('file-loader'),
77+
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
78+
options: { name: 'static/media/[name].[hash:8].[ext]' },
79+
},
80+
// our own ts-loader
81+
{
82+
test: /\.(js|mjs|jsx|ts|tsx)$/,
83+
include: path.resolve(__dirname, './src'),
84+
loader: require.resolve('ts-loader'),
85+
options: {
6686
transpileOnly: true,
6787
compilerOptions: {
6888
jsx: 'react',
6989
},
70-
}
71-
}
72-
}
73-
}
74-
}
75-
config.module.rules.forEach(rule => {
76-
// Remove the babel-loader
77-
if (rule.oneOf) rule.oneOf = rule.oneOf.filter(x => x.loader !== require.resolve('babel-loader'))
78-
})
79-
// Disable the eslint linter. We have tslint.
80-
config.module.rules = config.module.rules.filter(x => x.enforce !== 'pre')
90+
},
91+
},
92+
],
93+
},
94+
]
8195
// write-file-webpack-plugin conflict with this
8296
// ! Don't upgrade webpack to 5 until they fix this
8397
config.output.futureEmitAssets = false

Diff for: package.json

+43-35
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
11
{
22
"name": "maskbook",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"private": true,
55
"dependencies": {
6-
"@material-ui/core": "^3.9.2",
7-
"@material-ui/icons": "^3.0.2",
6+
"@holoflows/kit": "https://github.com/DimensionDev/holoflows-kit",
7+
"@material-ui/core": "^4.0.0",
8+
"@material-ui/icons": "^4.0.0",
9+
"@material-ui/styles": "^4.0.0",
810
"@types/classnames": "^2.2.7",
911
"@types/gun": "^0.9.1",
10-
"@types/jest": "^24.0.6",
12+
"@types/jest": "^24.0.13",
1113
"@types/lodash-es": "^4.17.3",
12-
"@types/node": "11.13.7",
13-
"@types/react": "16.8.14",
14-
"@types/react-dom": "16.8.4",
15-
"@types/react-jss": "^8.6.3",
16-
"@types/react-router-dom": "^4.3.2",
14+
"@types/node": "^12.0.2",
15+
"@types/react": "^16.8.18",
16+
"@types/react-dom": "^16.8.4",
17+
"@types/react-router-dom": "^4.3.3",
1718
"@types/tiny-secp256k1": "^1.0.0",
19+
"anchorme": "^1.1.2",
1820
"classnames": "^2.2.6",
1921
"construct-style-sheets-polyfill": "^2.0.1",
20-
"copy-webpack-plugin": "^5.0.0",
22+
"copy-webpack-plugin": "^5.0.3",
2123
"elliptic": "^6.4.1",
2224
"gun": "0.2019.422",
25+
"idb": "^4.0.3",
2326
"lodash-es": "^4.17.11",
2427
"node-sass": "^4.11.0",
2528
"npm-run-all": "^4.1.5",
2629
"pvtsutils": "^1.0.4",
2730
"react": "^16.8.3",
28-
"react-app-rewired": "^2.1.0",
31+
"react-app-rewired": "^2.1.3",
2932
"react-dom": "^16.8.3",
30-
"react-jss": "^8.6.1",
33+
"react-jss": "^10.0.0-alpha.16",
3134
"react-router-dom": "^5.0.0",
32-
"react-scripts": "3.0.0",
35+
"react-scripts": "^3.0.1",
3336
"reflect-metadata": "^0.1.13",
34-
"storybook-addon-material-ui": "0.9.0-alpha.18",
35-
"tiny-secp256k1": "^1.1.0",
36-
"ts-loader": "^5.4.3",
37+
"serialijse": "^0.1.3",
38+
"storybook-addon-material-ui": "^0.9.0-alpha.19",
39+
"tiny-secp256k1": "^1.1.2",
40+
"ts-loader": "^6.0.1",
3741
"tslint": "^5.16.0",
38-
"typed-db": "^1.0.1-1",
39-
"typescript": "^3.4.4",
42+
"typescript": "^3.5.1",
4043
"web-ext-types": "^3.1.0",
4144
"webcrypto-liner": "0.1.38",
4245
"webextension-polyfill": "^0.4.0",
@@ -47,30 +50,35 @@
4750
"build": "react-app-rewired build",
4851
"test": "react-app-rewired test",
4952
"start": "start-storybook -p 9009 -s public",
50-
"build-storybook": "build-storybook -s public"
53+
"build-storybook": "build-storybook -s public",
54+
"postinstall": "cd node_modules/@holoflows/kit\nyarn\nyarn build"
5155
},
52-
"eslintConfig": {
53-
"extends": "react-app"
54-
},
55-
"browserslist": [
56-
">0.2%",
57-
"not dead",
58-
"not ie <= 11",
59-
"not op_mini all"
60-
],
6156
"devDependencies": {
6257
"@babel/core": "^7.4.3",
63-
"@storybook/addon-actions": "^5.1.0-alpha.33",
64-
"@storybook/addon-info": "^5.1.0-alpha.33",
65-
"@storybook/addon-knobs": "^5.1.0-alpha.33",
66-
"@storybook/addon-links": "^5.1.0-alpha.33",
67-
"@storybook/addons": "^5.1.0-alpha.33",
68-
"@storybook/react": "^5.1.0-alpha.33",
58+
"@storybook/addon-actions": "^5.1.0-rc.1",
59+
"@storybook/addon-info": "^5.1.0-rc.1",
60+
"@storybook/addon-knobs": "^5.1.0-rc.1",
61+
"@storybook/addon-links": "^5.1.0-rc.1",
62+
"@storybook/addons": "^5.1.0-rc.1",
63+
"@storybook/react": "^5.1.0-rc.1",
6964
"@types/storybook__addon-actions": "^3.4.2",
7065
"@types/storybook__addon-info": "^4.1.0",
7166
"@types/storybook__addon-knobs": "^5.0.0",
7267
"@types/storybook__addon-links": "^3.3.4",
7368
"@types/storybook__react": "^4.0.1",
74-
"awesome-typescript-loader": "^5.2.1"
69+
"awesome-typescript-loader": "^5.2.1",
70+
"react-devtools": "^3.6.1"
71+
},
72+
"browserslist": {
73+
"production": [
74+
">0.2%",
75+
"not dead",
76+
"not op_mini all"
77+
],
78+
"development": [
79+
"last 1 chrome version",
80+
"last 1 firefox version",
81+
"last 1 safari version"
82+
]
7583
}
7684
}

Diff for: public/manifest.json

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
{
22
"$schema": "http://json.schemastore.org/chrome-manifest",
33
"name": "Maskbook",
4-
"version": "1.3.0",
4+
"version": "1.4.0",
55
"manifest_version": 2,
66
"content_scripts": [
77
{
8-
"matches": ["https://www.facebook.com/*"],
9-
"js": ["polyfill/adoptedStyleSheets.js", "polyfill/browser-polyfill.min.js", "js/contentscript.js"],
10-
"run_at": "document_idle",
11-
"all_frames": true
8+
"matches": ["https://www.facebook.com/*", "https://m.facebook.com/*"],
9+
"js": ["polyfill/browser-polyfill.min.js", "js/contentscript.js"],
10+
"run_at": "document_idle"
1211
}
1312
],
1413
"web_accessible_resources": ["*.css", "*.js", "*.jpg", "*.png"],
15-
"permissions": ["https://www.facebook.com/*", "storage", "downloads", "background", "webNavigation"],
14+
"permissions": [
15+
"https://www.facebook.com/*",
16+
"https://m.facebook.com/*",
17+
"storage",
18+
"downloads",
19+
"background",
20+
"webNavigation"
21+
],
1622
"background": {
1723
"scripts": ["polyfill/webcrypto-liner.shim.js", "polyfill/browser-polyfill.min.js", "js/backgroundservice.js"]
1824
},
@@ -27,6 +33,5 @@
2733
"256": "256x256.png"
2834
},
2935
"homepage_url": "https://maskbook.io",
30-
"description": "__MSG_manifest_description__",
31-
"default_locale": "en"
36+
"description": "Encrypt your posts & chats on You-Know-Where. Allow only your friends to decrypt."
3237
}

0 commit comments

Comments
 (0)