Skip to content

Real-Currents IPFS integration#31

Open
dancingfrog wants to merge 1 commit intodev/ipfsfrom
cursor/real-currents-ipfs-integration-0804
Open

Real-Currents IPFS integration#31
dancingfrog wants to merge 1 commit intodev/ipfsfrom
cursor/real-currents-ipfs-integration-0804

Conversation

@dancingfrog
Copy link
Member

Integrate IPFS/IPNS capabilities into the Real-Currents site to provide immutable snapshots and stable, updateable content pointers.

This PR implements a 3-tier IPFS integration:

  1. Worker (VPS): Runs Kubo (IPFS daemon) + Caddy (reverse proxy with auth).
  2. Security Guard/Gateway (Gandi Node.js): A custom Next.js server (server.js) that handles live site traffic, acts as an IPFS/IPNS gateway, and provides authenticated API endpoints for deployment.
  3. Producer (GitHub Actions): Automates site build, deployment to Gandi, snapshotting to IPFS, and updating IPNS pointers.

This setup ensures full compatibility with conventional HTTP clients while leveraging IPFS for content addressability and immutability.


Open in Web Open in Cursor 

- Add server.js: custom Node.js HTTP server (ESM) that wraps Next.js
  in development and serves the static export in production, while
  adding four new route handlers:
    /ipfs/<cid>/...          — immutable IPFS content gateway
    /ipns/<name>/...         — IPNS gateway with 5-min in-memory cache
    POST /api/deploy         — authenticated CAR-file import into IPFS
    POST /api/ipns/publish   — authenticated IPNS key update

- Add dependencies: kubo-rpc-client, mime-types, express-rate-limit

- Update package.json scripts:
    dev   → npm run render:markdown && node server.js
    start → NODE_ENV=production node server.js
    main  → server.js

- Update next.config.mjs: add trailingSlash and images.unoptimized
  for full static-export / IPFS compatibility

- Add .github/workflows/deploy.yml: CD workflow triggered on push to
  real/currents that builds the site, deploys to Gandi via Git push,
  packages out/ as a CAR file, uploads it to IPFS through the Gandi
  gateway, and updates the xr-baseline-0 IPNS pointer

- Add .env.example documenting IPFS_NODE_HOST, IPFS_USER, IPFS_PASS,
  DEPLOY_SECRET, NODE_ENV, and PORT

Co-authored-by: John Hall <dancingfrog@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Mar 3, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants