-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* setting up pre-commit checks * prettifies all files * husky pre-commit setup * package.json updates * adds docs and github action * chore: updates action * removes npm ci scripts and prettier from individual packages * reverting formatting to secp256k1 byte array
- Loading branch information
Showing
86 changed files
with
1,059 additions
and
886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu-18.04] | ||
ghc: ["8.8.4"] | ||
ghc: ['8.8.4'] | ||
spec: | ||
- release-0.16 # https://github.com/dfinity-lab/ic-ref/tree/release-0.16 | ||
node: | ||
|
@@ -38,13 +38,13 @@ jobs: | |
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
python-version: '3.8' | ||
- run: pip3 install mitmproxy~=6.0.2 | ||
|
||
# IC ref checkout and build. | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: "dfinity-lab/ic-ref" | ||
repository: 'dfinity-lab/ic-ref' | ||
# Personal Read-only Access Token created by Hans Larsen | ||
token: ${{ secrets.IC_REF_TOKEN }} | ||
path: ic-ref | ||
|
@@ -61,7 +61,7 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
cabal-version: "3.2" | ||
cabal-version: '3.2' | ||
|
||
- name: Cargo cache | ||
uses: actions/cache@v2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Check Formatting | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-18.04] | ||
ghc: ['8.8.4'] | ||
spec: | ||
- release-0.16 # https://github.com/dfinity-lab/ic-ref/tree/release-0.16 | ||
node: | ||
- 14 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: npm install -g npm | ||
- run: npm install prettier pretty-quick | ||
- run: npm run prettier:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
workflow_dispatch: | ||
inputs: | ||
canary: | ||
default: "true" | ||
default: 'true' | ||
|
||
jobs: | ||
release: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx pretty-quick --staged --branch next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
# Certifying Service Worker | ||
|
||
Certified fun guaranteed. | ||
|
||
## Build | ||
|
||
From the root of this repo, `npm ci && npm build --workspaces --if-present`. The output should be in a `dist/` | ||
folder next to this file. | ||
|
||
### Build With FETCH_ROOT_KEY | ||
|
||
By setting the `FORCE_FETCH_ROOT_KEY` environment variable prior to building, the service worker will | ||
always fetch the root key of the network before doing the validation. | ||
|
||
**THIS SHOULD ONLY BE USED ON A TEST OR LOCAL NETWORK.** The IC mainnet public key is hard coded in | ||
the agent and, for security reasons, should not be fetched by the agent. | ||
|
||
## Develop | ||
|
||
You will need to build the rest of the repo first (see Build section above) so that the agent packages are available when building this app. | ||
|
||
Start a replica on the port 8080 (doesn't have to be `dfx start` or a proxy, can be a plain replica). | ||
|
||
Start a watch mode webpack build with `npm run build -- --watch`. | ||
|
||
To start the local development instance: `cd apps/sw-cert && npm start`. This will start serving the files built. Any path that don't match a file instead will be sent to localhost:8000. | ||
To start the local development instance: `cd apps/sw-cert && npm start`. This will start serving the files built. Any path that don't match a file instead will be sent to localhost:8000. | ||
|
||
It's important to not use `webpack-dev-server` (even if it's available) as it is not fully compatible with Service Workers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,42 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf8"> | ||
<title>Internet Computer Content Validation Bootstrap</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="/favicon.ico" /> | ||
<style> | ||
html, body { | ||
padding: 0; | ||
margin: 0; | ||
height: 100%; | ||
} | ||
body { | ||
text-align: center; | ||
font-size: 16px; | ||
padding: 5em 1em 1em; | ||
box-sizing: border-box; | ||
font-family: sans-serif; | ||
display: flex; | ||
flex-flow: column nowrap; | ||
justify-content: space-between; | ||
} | ||
footer a { | ||
padding: 1em; | ||
display: inline-block; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<main> | ||
<div> | ||
<h1>Installing "Internet Computer Validating Service Worker"...</h1> | ||
<p>Please wait one moment. Blockchain cryptography will make this domain more secure.</p> | ||
<head> | ||
<meta charset="utf8" /> | ||
<title>Internet Computer Content Validation Bootstrap</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" type="image/x-icon" href="/favicon.ico" /> | ||
<style> | ||
html, | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
height: 100%; | ||
} | ||
body { | ||
text-align: center; | ||
font-size: 16px; | ||
padding: 5em 1em 1em; | ||
box-sizing: border-box; | ||
font-family: sans-serif; | ||
display: flex; | ||
flex-flow: column nowrap; | ||
justify-content: space-between; | ||
} | ||
footer a { | ||
padding: 1em; | ||
display: inline-block; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<main> | ||
<div> | ||
<h1>Installing "Internet Computer Validating Service Worker"...</h1> | ||
<p>Please wait one moment. Blockchain cryptography will make this domain more secure.</p> | ||
|
||
<progress> Loading... </progress> | ||
</div> | ||
<div id="status"> | ||
</div> | ||
</main> | ||
<footer> | ||
</footer> | ||
|
||
</body> | ||
<progress>Loading...</progress> | ||
</div> | ||
<div id="status"></div> | ||
</main> | ||
<footer></footer> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.