From 7d49f9cffd6f78bc21163e9c610cee1f7a063f6d Mon Sep 17 00:00:00 2001 From: kccleoc Date: Wed, 28 Jan 2026 12:32:26 +0800 Subject: [PATCH] Update README.md docs: add GitHub Pages deployment guide --- README.md | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 150 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6642e35..9bc6404 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,107 @@ console.log(decrypted.w); // Recovered mnemonic console.log(decrypted.pp); // BIP39 passphrase indicator (0 or 1) ``` +## Deployment to GitHub Pages (FREE) + +This project uses a two-repository setup to keep source code private while hosting the app for free. + +### One-Time Setup + +#### 1. Create Public Deployment Repo + +Go to https://github.com/new and create: +- **Name**: `seedpgp-web-app` (or any name you prefer) +- **Visibility**: **Public** +- **Don't** initialize with README, .gitignore, or license + +#### 2. Configure Vite Base Path + +Edit `vite.config.ts`: + +```typescript +export default defineConfig({ + plugins: [react()], + base: '/seedpgp-web-app/', // Match your public repo name +}) +``` + +#### 3. Build and Deploy + +```bash +# Build the production bundle +bun run build + +# Initialize git in dist folder +cd dist +git init +git add . +git commit -m "Deploy seedpgp v1.1.0" + +# Push to your public repo +git remote add origin https://github.com/kccleoc/seedpgp-web-app.git +git branch -M main +git push -u origin main + +# Return to project root +cd .. +``` + +#### 4. Enable GitHub Pages + +1. Go to `https://github.com/kccleoc/seedpgp-web-app/settings/pages` +2. **Source**: Deploy from a branch +3. **Branch**: Select `main` → `/` (root) +4. Click **Save** + +Wait 1-2 minutes, then visit: **https://kccleoc.github.io/seedpgp-web-app/** + +--- + +### Deploying Updates (v1.2.0, v1.3.0, etc.) + +Create `scripts/deploy.sh` in your project root: + +```bash +#!/bin/bash +set -e + +VERSION=$1 + +if [ -z "$VERSION" ]; then + echo "Usage: ./scripts/deploy.sh v1.2.0" + exit 1 +fi + +echo "🔨 Building $VERSION..." +bun run build + +echo "📦 Deploying to GitHub Pages..." +cd dist +git add . +git commit -m "Deploy $VERSION" || echo "No changes to commit" +git push + +cd .. +echo "✅ Deployed to https://kccleoc.github.io/seedpgp-web-app/" +echo "🏷️ Don't forget to tag: git tag $VERSION && git push --tags" +``` + +Make executable and use: + +```bash +chmod +x scripts/deploy.sh +./scripts/deploy.sh v1.2.0 +``` + +--- + +### Repository Structure + +- **seedpgp-web** (Private) - Your source code, active development +- **seedpgp-web-app** (Public) - Built files only, served via GitHub Pages + +**Cost: $0/month** ✅ + ## Frame Format ``` @@ -82,7 +183,6 @@ BASE45 - Base45-encoded PGP message Creates a SeedPGP plaintext object. **Parameters:** - - `mnemonic` (string): BIP39 mnemonic phrase (12/18/24 words) - `bip39PassphraseUsed` (boolean): Whether a BIP39 passphrase was used - `recipientFingerprints` (string[]): Optional array of recipient key fingerprints @@ -94,7 +194,6 @@ Creates a SeedPGP plaintext object. Encrypts a plaintext object to SeedPGP format. **Parameters:** - ```typescript { plaintext: SeedPgpPlaintext; @@ -104,7 +203,6 @@ Encrypts a plaintext object to SeedPGP format. ``` **Returns:** - ```typescript { framed: string; // SEEDPGP1 frame @@ -118,7 +216,6 @@ Encrypts a plaintext object to SeedPGP format. Decrypts a SeedPGP frame. **Parameters:** - ```typescript { frameText: string; // SEEDPGP1 frame @@ -168,6 +265,17 @@ bun test --watch - Test decryption immediately after generating backups - Consider password-only (SKESK) encryption as additional fallback +### 🔒 Production Deployment Warning + +The GitHub Pages deployment at **https://kccleoc.github.io/seedpgp-web-app/** is for: +- ✅ Testing and demonstration +- ✅ Convenient access for personal use +- ⚠️ Always verify the URL before use + +For maximum security with real funds: +- Run locally: `bun run dev` +- Or self-host on your own domain with HTTPS + ## Project Structure ``` @@ -180,8 +288,11 @@ seedpgp-web/ │ │ ├── crc16.ts # CRC16-CCITT-FALSE │ │ └── types.ts # TypeScript definitions │ └── App.tsx # React UI +├── scripts/ +│ └── deploy.sh # Deployment automation ├── package.json -└── README.md +├── DEVELOPMENT.md # Development guide +└── README.md # This file ``` ## Tech Stack @@ -195,6 +306,7 @@ seedpgp-web/ ## Roadmap - [ ] QR code generation UI +- [ ] QR code scanner with camera support - [ ] Multi-frame support for larger payloads - [ ] Hardware wallet integration - [ ] Mobile scanning app @@ -211,14 +323,45 @@ MIT License - see LICENSE file for details ## Version History ### v1.1.0 (2026-01-28) - - Initial public release - Full BIP39 mnemonic support - Trezor test vector validation - Production-ready implementation +- GitHub Pages deployment guide --- ⚠️ **Disclaimer**: This software is provided as-is. Always test thoroughly before trusting with real funds. The author is not responsible for lost funds due to software bugs or user error. - +``` + +Now create the deployment script: + +```bash +mkdir -p scripts +cat > scripts/deploy.sh << 'EOF' +#!/bin/bash +set -e + +VERSION=$1 + +if [ -z "$VERSION" ]; then + echo "Usage: ./scripts/deploy.sh v1.2.0" + exit 1 +fi + +echo "🔨 Building $VERSION..." +bun run build + +echo "📦 Deploying to GitHub Pages..." +cd dist +git add . +git commit -m "Deploy $VERSION" || echo "No changes to commit" +git push + +cd .. +echo "✅ Deployed to https://kccleoc.github.io/seedpgp-web-app/" +echo "🏷️ Don't forget to tag: git tag $VERSION && git push --tags" +EOF + +chmod +x scripts/deploy.sh ```