diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea99f6c..48497ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - directory: ["recovery", "export"] + directory: ["auth", "export"] steps: - name: Checkout diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 751bcb6..1b3b50c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,13 +14,13 @@ jobs: - name: Checkout uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - - name: Publish Recovery + - name: Publish Auth uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca #v1.5.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - projectName: recovery - directory: recovery + projectName: auth + directory: auth gitHubToken: ${{ secrets.GITHUB_TOKEN }} - name: Publish Export diff --git a/Dockerfile b/Dockerfile index aff1593..cd36d13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,10 +7,13 @@ LABEL org.opencontainers.image.source https://github.com/tkhq/frames COPY nginx.conf /etc/nginx/nginx.conf -COPY recovery /usr/share/nginx/recovery +# maintain recovery for backwards-compatibility +COPY auth /usr/share/nginx/auth +COPY auth /usr/share/nginx/recovery COPY export /usr/share/nginx/export EXPOSE 8080/tcp EXPOSE 8081/tcp +EXPOSE 8082/tcp CMD ["nginx"] diff --git a/README.md b/README.md index 70edd09..5393292 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # Frames -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 repository contains code for the auth (which includes recovery) and export components of Turnkey. These components can be embedded as iframes by users to support end-users. -## 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. +## Auth +This self-contained HTML page is meant to be used for the following use cases: +- As a standalone document to enable first-party Turnkey root users to perform recovery and auth +- Embedded as an iframe for sub-org root recovery and auth -This page is hosted at https://recovery.turnkey.com/ +This page is hosted at https://auth.turnkey.com/, but we will retain https://recovery.turnkey.com/for compatibility. ## 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. @@ -28,15 +30,15 @@ nvm use Install dependencies: ```sh -cd recovery && npm install +cd auth && npm install cd export && npm install ``` # Unit Testing -The export and recovery pages have tests. They run on CI automatically. If you want to run them locally: +The auth and recovery pages each have tests. They run on CI automatically. If you want to run them locally: ```sh -cd recovery && npm test +cd auth && npm test cd export && npm test ``` @@ -51,11 +53,27 @@ Clone the `sdk` repo. 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. +Follow the README.md for the `wallet-export` [example](https://github.com/tkhq/sdk/tree/main/examples/wallet-export). Set the `NEXT_PUBLIC_EXPORT_IFRAME_URL="http://localhost:3000/"` in the example's environment variables configuration. The `wallet-export` example embeds this page as an iframe. ```sh cd sdk/examples/wallet-export ``` +# Running Local Auth +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 `email-auth` [example](https://github.com/tkhq/sdk/tree/main/examples/email-auth). Set the `NEXT_PUBLIC_AUTH_IFRAME_URL="http://localhost:3000/"` in the example's environment variables configuration. The `email-auth` example embeds this page as an iframe. +```sh +cd sdk/examples/email-auth +``` + # Building and running in Docker To build: @@ -63,7 +81,7 @@ To build: docker build . -t frames ``` -To run (mapping 8080 and 8081 to 18080/18081 because they're often busy): +To run (mapping `[8080, 8081]` to `[18080, 18081]` because they're often busy): ``` docker run -p18080:8080 -p18081:8081 -t frames ``` diff --git a/recovery/babel.config.js b/auth/babel.config.js similarity index 100% rename from recovery/babel.config.js rename to auth/babel.config.js diff --git a/auth/favicon.svg b/auth/favicon.svg new file mode 100644 index 0000000..73948fa --- /dev/null +++ b/auth/favicon.svg @@ -0,0 +1,10 @@ + diff --git a/recovery/index.html b/auth/index.html similarity index 94% rename from recovery/index.html rename to auth/index.html index 78407b0..f135357 100644 --- a/recovery/index.html +++ b/auth/index.html @@ -2,8 +2,9 @@
+ -