Skip to content

Commit

Permalink
Merge branch 'v1.1.0' into released
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Apr 15, 2019
2 parents be43caf + cd18cf9 commit d885225
Show file tree
Hide file tree
Showing 45 changed files with 793 additions and 319 deletions.
102 changes: 70 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,39 @@
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
version: 2.1
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:11.0

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/repo

steps:
# build holoflows-kit
- run: |
cd ..
git clone -q --depth=1 https://github.com/DimensionFoundation/holoflows-kit
- run:
name: Clone @holoflows/kit
command: |
cd ..
git clone -q --depth=1 https://github.com/project-holoflows/holoflows-kit
- restore_cache:
keys:
- v1-dependencies-holoflows-{{ checksum "~/holoflows-kit/package.json" }}
- v1-holoflows-{{ checksum "~/holoflows-kit/yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-holoflows-
- run: |
cd ../holoflows-kit
yarn install
- v1-holoflows-
- run:
name: Install @holoflows/kit
command: |
cd ../holoflows-kit
yarn install --frozen-lockfile
- save_cache:
paths:
- ~/holoflows-kit/node_modules
key: v1-dependencies-holoflows-{{ checksum "~/holoflows-kit/package.json" }}
- run: |
cd ../holoflows-kit
yarn build
yarn link
key: v1-holoflows-{{ checksum "~/holoflows-kit/yarn.lock" }}
- run:
name: Build @holoflows/kit
command: |
cd ../holoflows-kit
yarn build
yarn link
# build maskbook
- checkout
Expand All @@ -45,21 +43,61 @@ jobs:
- tsbuild-cache
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn install
- v1-maskbook-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v1-maskbook-{{ .Branch }}-
- v1-maskbook-
- run:
name: Build Maskbook
command: |
yarn install --frozen-lockfile
yarn link @holoflows/kit
yarn build
sudo apt-get install zip
cd build
zip -r ../Maskbook.zip ./*
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: yarn link @holoflows/kit
- run: yarn build
- run: sudo apt-get install zip
key: v1-maskbook-{{ .Branch }}-{{ checksum "yarn.lock" }}
- save_cache:
paths:
- .tscache/
key: tsbuild-cache
- run: zip -r build.zip build/
- store_artifacts:
path: build.zip
path: Maskbook.zip
destination: /Maskbook.zip
- persist_to_workspace:
root: ~/repo/
paths:
- Maskbook.zip
publish-github-release:
docker:
- image: cibuilds/github:0.10
steps:
- checkout
- attach_workspace:
at: ~/repo/
- run:
name: 'Publish Release on GitHub'
command: |
set -o nounset
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -b "✔ No breaking changes. / ⚠ Has breaking changes!
🎨 UI Improvements
👩‍💻 Miscellaneous" -replace -draft -prerelease $(git describe HEAD) ~/repo/Maskbook.zip
# -b BODY \ # Set text describing the contents of the release
# -delete \ # Delete release and its git tag in advance if it exists (same as -recreate)
# -n TITLE \ # Set release title
workflows:
version: 2
main:
jobs:
- build
- publish-github-release:
requires:
- build
filters:
branches:
only: released
# test
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Maskbook · ![GitHub license](https://img.shields.io/badge/license-AGPL-blue.svg?style=flat-square) ![Ciecle CI](https://img.shields.io/circleci/project/github/project-maskbook/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)

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

For general introductions, see https://Maskbook.io/

[Install Maskbook](https://maskbook.io/install/)

## Documentation for developers

- License: AGPL
- Code Style: Use [prettier](https://github.com/prettier/prettier)
- [Git flow](https://github.com/nvie/gitflow) enabled, `master` as the latest branch, `released` as the stable branch
- UI developing: Use `yarn start` / `npm start` to start a [Storybook](https://storybook.js.org/)
- Extension developing: Use `yarn watch` / `npm run watch` to start watch build for extension
- Crypto: We're using [ECDH SECP256-k1](https://en.wikipedia.org/wiki/ECC) and [AES-GCM](https://en.wikipedia.org/wiki/AES)
- Data transfer between users: We're using [gun.js](https://gun.eco)

### Prepare

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

#### Install dependencies

- `yarn install`

#### Prepare for library @holoflows/kit

- `cd ..`
- `git clone https://github.com/project-holoflows/Holoflows-kit.git`
- `cd Holoflows-kit`
- `yarn install`
- `yarn build`
- `yarn link`
- `cd ../Maskbook`

#### Install @holoflows/kit in Maskbook

- `yarn link @holoflows/kit`

### Folder Structure

- ./public - Resource file
- ./src/components - UI Components
- ./src/crypto - Crypto related
- ./src/key-management - How we manage keys and user infos
- ./src/utils - Utils
- ./src/extension
- - ./background-script - Scripts that running in the background page as a service
- - ./content-script - Script that be injected into the web page
- - ./injected-script - Script that will run in the main frame of the injected web page
1 change: 1 addition & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = function override(/** @type{import("webpack").Configuration} */
app: path.join(__dirname, './src/index.tsx'),
contentscript: path.join(__dirname, './src/content-script.ts'),
backgroundservice: path.join(__dirname, './src/background-service.ts'),
injectedscript: path.join(__dirname, './src/extension/injected-script/index.ts'),
}
config.output.filename = 'static/js/[name].js'
config.output.chunkFilename = 'static/js/[name].chunk.js'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maskbook",
"version": "1.0.0",
"version": "1.1.1",
"private": true,
"dependencies": {
"@material-ui/core": "^3.9.2",
Expand Down
Binary file added public/128x128.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 public/16x16.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 public/256x256.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 public/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 14 additions & 4 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"$schema": "http://json.schemastore.org/chrome-manifest",
"name": "Maskbook",
"version": "1.0",
"version": "1.1.1",
"manifest_version": 2,
"content_scripts": [
{
"matches": ["https://www.facebook.com/*"],
"js": ["/static/js/contentscript.js"],
"run_at": "document_idle",
"all_frames": true
},
{
"matches": ["https://www.facebook.com/*"],
"js": ["/static/js/injectedscript.js"],
"run_at": "document_start",
"all_frames": true
}
],
"web_accessible_resources": ["*.css", "*.js", "*.jpg", "*.png"],
Expand All @@ -22,7 +28,11 @@
"chrome_style": true
},
"icons": {
"256": "/maskbook-icon.png",
"16": "/maskbook-icon-padded.png"
}
"16": "/16x16.png",
"48": "/48x48.png",
"128": "/128x128.png",
"256": "/256x256.png"
},
"homepage_url": "https://maskbook.io",
"description": "Encrypt your posts & chats on You-Know-Where. Allow only your friends to decrypt."
}
7 changes: 1 addition & 6 deletions src/components/DataSource/PeopleRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@ import { MessageCenter } from '../../utils/messages'
import { PeopleService } from '../../extension/content-script/rpc'

const ref = new ValueRef<Person[]>([])
ref.startWatch()
PeopleService.getAllPeople().then(p => (ref.value = p))
MessageCenter.on('newPerson', p => {
const old = ref.value.filter(x => x.username !== p.username)
ref.value = [...old, p]
})
export function usePeople() {
const [people, setPeople] = React.useState<Person[]>([])
const cb = React.useCallback(() => setPeople(ref.value), [setPeople])
React.useEffect(() => {
ref.addListener('onChange', cb)
return () => void ref.removeListener('onChange', cb)
})
React.useEffect(() => ref.addListener(val => setPeople(val)))
return people.filter(x => x.username !== '$self')
}
Loading

0 comments on commit d885225

Please sign in to comment.