From 2b9c8f18501b839409a7936196d7a2d978b94bbe Mon Sep 17 00:00:00 2001 From: evanmcfarland Date: Mon, 10 Nov 2025 11:30:20 -0500 Subject: [PATCH 1/2] Add domain switch implementation plan --- DOMAIN_SWITCH_PLAN.md | 334 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 334 insertions(+) create mode 100644 DOMAIN_SWITCH_PLAN.md diff --git a/DOMAIN_SWITCH_PLAN.md b/DOMAIN_SWITCH_PLAN.md new file mode 100644 index 00000000..21e4bbd8 --- /dev/null +++ b/DOMAIN_SWITCH_PLAN.md @@ -0,0 +1,334 @@ +# 🤖 AUTONOMOUS PR ORCHESTRATOR - DO NOT SKIP + +**You are an autonomous PR orchestrator. Your ONLY job is to implement this plan and create a PR.** + +## Isolation Check (RUN FIRST) +```bash +REPO_ROOT=$(git rev-parse --show-toplevel) +if [ "$REPO_ROOT" = "/home/theseus/alexandria/lbryfun" ]; then + echo "❌ FATAL: In main repo. Must be in worktree." + echo "Worktree: /home/theseus/alexandria/lbryfun-domain-switch" + exit 1 +fi +echo "✅ In isolated worktree: $REPO_ROOT" +``` + +## Your Autonomous Workflow (NO QUESTIONS ALLOWED) +1. **Verify isolation** - You must be in worktree: `/home/theseus/alexandria/lbryfun-domain-switch` +2. **Implement feature** - Follow plan sections below +3. **Build locally** (verification only - NEVER DEPLOY TO MAINNET): + ```bash + ./scripts/build.sh + ``` + **⚠️ PRODUCTION WARNING**: This is a live financial application. Never deploy to mainnet. +4. **Create PR** (MANDATORY): + ```bash + git add . + git commit -m "Switch domain from lbry.fun to caffeinelauncher.com" + git push -u origin feature/switch-to-caffeinelauncher + gh pr create --title "[Config]: Switch domain to caffeinelauncher.com" --body "Implements DOMAIN_SWITCH_PLAN.md - Updates all domain references from lbry.fun to caffeinelauncher.com for IC boundary node registration" + ``` +5. **Iterate autonomously**: + - FOR i=1 to 5: + - Check review: `gh pr view [NUM] --json comments` + - Count P0 issues + - IF P0 > 0: Fix immediately, commit, push, sleep 300s, continue + - IF P0 = 0: Report success, EXIT + - After 5 iterations: Escalate to human + +## CRITICAL RULES +- ❌ NO questions ("should I?", "want me to?", "is it done?") +- ❌ NO skipping PR creation - it's MANDATORY +- ❌ NO stopping after implementation - create PR immediately +- ✅ After sleep: IMMEDIATELY continue (no pause) +- ✅ ONLY stop at: approved, max iterations, or error + +**Branch:** `feature/switch-to-caffeinelauncher` +**Worktree:** `/home/theseus/alexandria/lbryfun-domain-switch` + +--- + +# Implementation Plan: Domain Switch to caffeinelauncher.com + +## Task Classification +**CONFIGURATION CHANGE**: Update domain references and prepare for boundary node registration → targeted fixes + +## Current State + +### Domain References Found +1. **`src/lbry_fun_frontend/public/.well-known/ic-domains`** (line 1-2) + - Contains: `lbry.fun` and `www.lbry.fun` + - Purpose: IC boundary node domain verification + +2. **`src/lbry_fun_frontend/public/.well-known/ii-alternative-origins`** (line 2) + - Contains: `https://lbry.app` in alternativeOrigins array + - Purpose: Internet Identity authentication origins + - Note: lbry.app appears to be related but separate domain + +3. **`validation/VALIDATION_GUIDE.md`** (line 4) + - Contains: Reference to "lbry.fun" in documentation + - Purpose: User-facing documentation + +4. **`src/lbry_fun_frontend/public/.ic-assets.json`** + - Configures `.well-known` directory to be served with proper headers + - No changes needed (structure remains same) + +### Files That DON'T Need Changes +- `webpack.config.js` - Only contains IC infrastructure URLs (localhost, ic0.app) +- `src/lbry_fun_frontend/src/features/auth/utils/authUtils.ts` - Only IC gateway URLs +- `src/lbry_fun_frontend/src/utils/getIcHost.ts` - Only IC gateway URLs +- `dfx.json` - Canister configuration only +- No environment variables found referencing lbry.fun + +## Implementation Steps + +### Step 1: Update IC Domains File (MODIFY) +**File:** `src/lbry_fun_frontend/public/.well-known/ic-domains` + +**Current Content:** +``` +lbry.fun +www.lbry.fun +``` + +**New Content:** +``` +caffeinelauncher.com +www.caffeinelauncher.com +``` + +**Reasoning:** This file is read by IC boundary nodes to verify domain ownership. Must match the domain being registered. + +### Step 2: Evaluate II Alternative Origins (RESEARCH FIRST) +**File:** `src/lbry_fun_frontend/public/.well-known/ii-alternative-origins` + +**Current Content:** +```json +{ + "alternativeOrigins": ["https://lbry.app", "https://yj5ba-aiaaa-aaaap-qkmoa-cai.icp0.io", "http://localhost:8080", "http://localhost:3000", "http://yj5ba-aiaaa-aaaap-qkmoa-cai.localhost:4943"] +} +``` + +**Analysis Needed:** +- Does `lbry.app` need to be updated to `caffeinelauncher.com`? +- Or is `lbry.app` a separate domain that should remain? +- Need to understand if this is the same frontend or different + +**Decision Logic:** +``` +IF lbry.app == current production domain for this frontend: + UPDATE to caffeinelauncher.com +ELSE IF lbry.app == legacy/separate domain: + ADD caffeinelauncher.com to array (keep both) + OR replace if migrating completely +``` + +**Recommended Action (for implementer to verify):** +Since we're switching primary domain from lbry.fun → caffeinelauncher.com, and lbry.app appears related: +```json +{ + "alternativeOrigins": [ + "https://caffeinelauncher.com", + "https://yj5ba-aiaaa-aaaap-qkmoa-cai.icp0.io", + "http://localhost:8080", + "http://localhost:3000", + "http://yj5ba-aiaaa-aaaap-qkmoa-cai.localhost:4943" + ] +} +``` + +**⚠️ IMPLEMENTER: Verify with user if lbry.app should be preserved in array** + +### Step 3: Update Documentation (MODIFY) +**File:** `validation/VALIDATION_GUIDE.md` + +**Change:** Line 4 +```markdown +# OLD +This guide explains how to validate tokenomics for **any** token launch on lbry.fun. + +# NEW +This guide explains how to validate tokenomics for **any** token launch on caffeinelauncher.com. +``` + +**Additional Check:** Search entire file for other references +```bash +grep -n "lbry\.fun" validation/VALIDATION_GUIDE.md +``` +Update any other occurrences found. + +### Step 4: Build and Test Locally +```bash +# Verify changes compile +./scripts/build.sh + +# Expected: Clean build with no errors +# The .well-known files will be copied to dist/lbry_fun_frontend/ +``` + +**Verification:** +```bash +# Check that files are copied correctly +cat dist/lbry_fun_frontend/.well-known/ic-domains +# Should show: caffeinelauncher.com and www.caffeinelauncher.com + +cat dist/lbry_fun_frontend/.well-known/ii-alternative-origins +# Should show updated JSON with caffeinelauncher.com +``` + +## Post-PR Manual Steps (Document in PR Description) + +After PR is merged and changes are deployed to mainnet, the following manual steps are required: + +### Step 5: Register Domain with IC Boundary Nodes +**⚠️ This cannot be automated - requires manual execution after deployment** + +```bash +# Register primary domain +curl -sLv -X POST \ + -H 'Content-Type: application/json' \ + https://icp0.io/registrations \ + --data @- < +git push + +# Re-deploy frontend +./scripts/network_deploy_frontend.sh +``` + +### DNS Rollback +```bash +# Point domain back to old infrastructure +# Update DNS records to previous values +# Wait for TTL to expire (5-15 minutes with 300s TTL) +``` + +### Boundary Node Cleanup +```bash +# Old domain (lbry.fun) registration remains valid +# Can re-register if needed using same curl command + +# If need to remove caffeinelauncher.com: +# Currently no public API for deletion +# Contact DFINITY support on forum.dfinity.org +``` + +## Success Criteria + +- [ ] `.well-known/ic-domains` contains caffeinelauncher.com domains +- [ ] `.well-known/ii-alternative-origins` updated appropriately +- [ ] Documentation updated +- [ ] Local build succeeds +- [ ] PR created and approved +- [ ] Changes deployed to mainnet (manual step) +- [ ] Domain registered with boundary nodes (manual step) +- [ ] HTTPS works on caffeinelauncher.com +- [ ] Internet Identity authentication works +- [ ] No SSL certificate errors + +## Notes for Implementer + +1. **II Alternative Origins Decision**: Line 2 update requires verification. If unsure, ask user in PR description whether `lbry.app` should be preserved. + +2. **No Backend Changes**: This is purely a frontend configuration change. No Rust code modifications needed. + +3. **No Environment Variables**: No `.env` file changes needed since domain is not stored there. + +4. **Deployment Timing**: Code changes can be merged anytime, but boundary node registration must happen AFTER deployment to mainnet for verification to work. + +5. **Certificate Issuance**: Boundary nodes use Let's Encrypt. First issuance takes 5-15 min. Renewals are automatic. + +## References + +- IC Custom Domains Docs: https://internetcomputer.org/docs/current/developer-docs/web-apps/custom-domains/using-custom-domains +- Boundary Node Registration: https://icp0.io/registrations +- Forum Discussions: https://forum.dfinity.org (search "custom domain") + +--- + +## Summary + +This is a straightforward configuration change affecting 2-3 files. The code changes are minimal and low-risk. The critical steps (boundary node registration, DNS verification) are manual and must happen after deployment. + +**Total Modified Files:** 2-3 +**Total New Files:** 0 +**Total Deleted Files:** 0 +**Risk Level:** Low (configuration only) +**Deployment:** Requires manual boundary node registration post-merge From 263ee02015b4039ee2d827ecf77c4d65dc8c3b77 Mon Sep 17 00:00:00 2001 From: evanmcfarland Date: Mon, 10 Nov 2025 13:27:23 -0500 Subject: [PATCH 2/2] Switch domain from lbry.fun to caffeinelauncher.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/lbry_fun_frontend/public/.well-known/ic-domains | 4 ++-- .../public/.well-known/ii-alternative-origins | 2 +- validation/VALIDATION_GUIDE.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lbry_fun_frontend/public/.well-known/ic-domains b/src/lbry_fun_frontend/public/.well-known/ic-domains index 7d475e0c..ab93c7e8 100644 --- a/src/lbry_fun_frontend/public/.well-known/ic-domains +++ b/src/lbry_fun_frontend/public/.well-known/ic-domains @@ -1,2 +1,2 @@ -lbry.fun -www.lbry.fun +caffeinelauncher.com +www.caffeinelauncher.com diff --git a/src/lbry_fun_frontend/public/.well-known/ii-alternative-origins b/src/lbry_fun_frontend/public/.well-known/ii-alternative-origins index d51f429c..46ff2720 100644 --- a/src/lbry_fun_frontend/public/.well-known/ii-alternative-origins +++ b/src/lbry_fun_frontend/public/.well-known/ii-alternative-origins @@ -1,3 +1,3 @@ { - "alternativeOrigins": ["https://lbry.app", "https://yj5ba-aiaaa-aaaap-qkmoa-cai.icp0.io", "http://localhost:8080", "http://localhost:3000", "http://yj5ba-aiaaa-aaaap-qkmoa-cai.localhost:4943"] + "alternativeOrigins": ["https://caffeinelauncher.com", "https://yj5ba-aiaaa-aaaap-qkmoa-cai.icp0.io", "http://localhost:8080", "http://localhost:3000", "http://yj5ba-aiaaa-aaaap-qkmoa-cai.localhost:4943"] } \ No newline at end of file diff --git a/validation/VALIDATION_GUIDE.md b/validation/VALIDATION_GUIDE.md index af90688e..97312249 100644 --- a/validation/VALIDATION_GUIDE.md +++ b/validation/VALIDATION_GUIDE.md @@ -2,7 +2,7 @@ ## Quick Start -This guide explains how to validate tokenomics for **any** token launch on lbry.fun. +This guide explains how to validate tokenomics for **any** token launch on caffeinelauncher.com. ### Prerequisites @@ -477,4 +477,4 @@ Include git commit hash in validation reports to track which code version was us --- -*This validation system ensures mathematical correctness and on-chain accuracy for all lbry.fun tokenomics.* +*This validation system ensures mathematical correctness and on-chain accuracy for all caffeinelauncher.com tokenomics.*