diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d6aaa2..4258045 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,20 +10,23 @@ on: jobs: tests: runs-on: ubuntu-latest + strategy: + matrix: + directory: ["recovery", "export"] steps: - name: Checkout uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - - name: Install node + - name: Install Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version: 18 - - name: Install dependencies - working-directory: ./recovery + - name: Install Dependencies for ${{ matrix.directory }} + working-directory: ./${{ matrix.directory }} run: npm install - - name: Run Tests - working-directory: ./recovery + - name: Run Tests for ${{ matrix.directory }} + working-directory: ./${{ matrix.directory }} run: npm test \ No newline at end of file diff --git a/README.md b/README.md index cc007c8..88c31f8 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,38 @@ -# recovery +# Frames -This repository contains code for the recovery component of Turnkey. This self-contained HTML page is meant to be used as a standalone document to help first-party Turnkey root users. It's also going to be embedded as an iframe to help with sub-org root recovery. +This repository contains code for the recovery and export components of Turnkey. These components can be embedded as iframes by users to support end-users in recovery and export. -This page is hosted on Github pages at https://tkhq.github.io/recovery/ +## Email Recovery +This self-contained HTML page is meant to be used as a standalone document to help first-party Turnkey root users. It's also going to be embedded as an iframe to help with sub-org root recovery. -# Running tests +This page is hosted at https://recovery.tkhqlabs.xyz/ -This HTML page has tests. They run on CI automatically. If you want to run them locally: +## Key and Wallet Export +This self-contained HTML page is meant to be used as either a standalone document or to be embedded as an iframe. + +This page is hosted at https://export.tkhqlabs.xyz/ + +# Getting Started + +Clone the repo: +```sh +git clone git@github.com:tkhq/frames.git +cd frames/ ``` + +Install dependencies +```sh npm install +``` + +# Unit Testing + +This HTML page has tests. They run on CI automatically. If you want to run them locally: +```sh npm test ``` -# Running a fake recovery +# Running a Fake Recovery Download mono, then check out `zeke-recovery-demo`: ```sh @@ -47,3 +67,19 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; fini ``` Now, paste the artifacts and then decrypt! Note the Enclave Auth Key should already be correct. + +# Running Local Wallet Export +Start the server. This command will run a simple static server on port 8080. +```sh +npm start +``` + +Clone the `sdk` repo. +```sh +git clone git@github.com:tkhq/sdk.git +``` + +Follow the README.md for the `key-export` example. Set the `NEXT_PUBLIC_EXPORT_IFRAME_URL="http://localhost:3000/export"` in the example's environment variables configuration. The `wallet-export` example embeds this page as an iframe. +```sh +cd sdk/examples/wallet-export +``` \ No newline at end of file diff --git a/export/babel.config.js b/export/babel.config.js new file mode 100644 index 0000000..b558b38 --- /dev/null +++ b/export/babel.config.js @@ -0,0 +1,7 @@ +module.exports = { + presets: [ + [ + '@babel/preset-env' + ], + ], + } \ No newline at end of file diff --git a/export/index.html b/export/index.html index be8c12e..ddbb757 100644 --- a/export/index.html +++ b/export/index.html @@ -3,9 +3,573 @@
-This public key will be sent along with a private key ID or wallet ID inside of a new EXPORT_PRIVATE_KEY
or EXPORT_WALLET
activity
The export bundle comes from the parent page and is composed of a public key and an encrypted payload. The payload is encrypted to this document's embedded key (stored in local storage and displayed above). The scheme relies on HPKE (RFC 9180).
+ +Below we display a log of the messages sent / received. The forms above send messages, and the code communicates results by sending events via the postMessage
API.