Skip to content

Commit

Permalink
try gh pages docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nichoth committed Apr 22, 2024
1 parent 733475d commit f0bf166
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 3 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: GitHub Pages deploy

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install
run: npm install
- name: Build
run: npm run build-docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist
.env
public
.partykit/
docs
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

Link multiple devices via websocket.
Link multiple devices via websocket. Linking means that both devices share the
same AES key.

This depends on each device having a [keystore](https://github.com/fission-codes/keystore-idb) that stores the private keys. Also, you need a websocket server, for example [partykit](https://www.partykit.io/).
This depends on each device having a [keystore](https://github.com/fission-codes/keystore-idb) that stores the private keys. Also, you need a websocket server,
for example [partykit](https://www.partykit.io/).

We have two devices, a parent and a child. To securely send an AES key to
another device, the parent first opens a websocket connection at a random URL.
The URL for the websocket needs to be transmitted out-of-band.

When the new device (the child) connects to the websocket, it tells the parent
its public key. The parent then encrypts its AES key to the child's public key.
The child gets the key, which it is able to decrypt with its private key.

## install

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"build-cjs": "esbuild src/*.ts --format=cjs --keep-names --tsconfig=tsconfig.build.json --outdir=./dist --out-extension:.js=.cjs --sourcemap=inline",
"build-esm": "tsc --project tsconfig.build.json",
"build": "mkdir -p ./dist && rm -rf ./dist/* && npm run build-cjs && npm run build-esm",
"build-docs": "typedoc ./src/index.ts",
"start": "concurrently --kill-others \"npx partykit dev\" \"npx vite\"",
"preversion": "npm run lint",
"version": "auto-changelog -p --template keepachangelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md",
Expand Down Expand Up @@ -73,6 +74,7 @@
"preact": "^10.20.2",
"tap-spec": "^5.0.0",
"tape-run": "^11.0.0",
"typedoc": "^0.25.13",
"typescript": "^5.4.4",
"vite": "^5.2.10"
},
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export type Certificate = Awaited<
* @param {Identity} identity The existing identity
* @param {Crypto} oddCrypto A Crypto implementation from `odd`
* @param {Object} opts Host, crypto, and a code for the websocket
* @param {Crypto} opts.oddCrypto An instance of odd crypto
* @param {string} opts.host The address for your websocket
* @param {string} opts.code A unique ID for the websocket connection. Should
* be transmitted out of band to the new device.
Expand Down

0 comments on commit f0bf166

Please sign in to comment.