feat(demo): public multi-visitor demo sandbox for Portainer
Turn the mock backend + UI into a public, click-to-play demo deployable as a
Portainer stack, gated behind DEMO=1 (classic single-user mock unchanged when off).
Backend (neode-ui/mock-backend.js):
- Per-session state isolation via AsyncLocalStorage + Proxy: every visitor gets
an isolated, deep-cloned copy of mockData/walletState/userState/etc., keyed by
a demo_sid cookie. Per-session WebSocket fan-out, idle reaper, session cap.
- Real per-session file storage (upload/folder/rename/delete) with a 50MB quota,
replacing the no-op filebrowser handlers; adds the missing app.filebrowser-token RPC.
- Force simulation mode (never touch a host Docker/Podman socket).
- Testnet (signet) flavor; shared login password "entertoexit".
- Report the real app version suffixed with -demo.
Frontend:
- VITE_DEMO build flag (useDemoIntro.ts): replay the intro once per calendar day
per browser; prefill + show the "entertoexit" login hint.
Deploy:
- docker-compose.demo.yml wired for DEMO, UI on :2100 (build-from-repo).
- demo-deploy/ thin stack (prebuilt :demo image refs + .env.example + README).
- .github/workflows/demo-images.yml builds/pushes archy-demo-{web,backend} images.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
29cd167894
commit
2715f2d847
@@ -0,0 +1,18 @@
|
||||
# Copy to .env and adjust. Used by demo-deploy/docker-compose.yml.
|
||||
|
||||
# Registry host + namespace that holds the prebuilt demo images.
|
||||
REGISTRY=146.59.87.168:3000/lfg2025
|
||||
|
||||
# Image tag to deploy (CI publishes :demo and :<git-sha>).
|
||||
IMAGE_TAG=demo
|
||||
|
||||
# Host port for the demo UI.
|
||||
DEMO_WEB_PORT=2100
|
||||
|
||||
# Optional — enables the in-app AI chat panel. Leave blank to disable.
|
||||
ANTHROPIC_API_KEY=
|
||||
|
||||
# Optional sandbox tuning (defaults shown).
|
||||
DEMO_SESSION_TTL_MS=2700000 # 45 min idle before a visitor session is reaped
|
||||
DEMO_MAX_SESSIONS=500 # concurrent visitor cap
|
||||
DEMO_FILE_QUOTA_BYTES=52428800 # 50 MB uploads per visitor
|
||||
@@ -0,0 +1,33 @@
|
||||
# Archipelago — Public Demo deploy
|
||||
|
||||
A click-to-play demo of the Archipelago UI, backed entirely by a mock backend.
|
||||
Every visitor gets an **isolated, ephemeral sandbox** (own apps, wallet, files),
|
||||
real container runtimes are never touched, and Bitcoin runs on **signet** test
|
||||
coins. **Login password: `entertoexit`** (shown on the login screen).
|
||||
|
||||
This directory is the full contents of the public `archy-demo` repo. It holds no
|
||||
source — only this compose file that pulls prebuilt `:demo` images.
|
||||
|
||||
## Deploy in Portainer
|
||||
|
||||
1. **Stacks → Add stack → Repository** (or paste `docker-compose.yml` into the web editor).
|
||||
2. Set environment variables (see `.env.example`) — at minimum `REGISTRY`, and
|
||||
`ANTHROPIC_API_KEY` if you want the AI chat panel.
|
||||
3. Deploy. The UI is served on `:2100` (override with `DEMO_WEB_PORT`).
|
||||
|
||||
To pick up a new build, redeploy the stack (or wire the CI Portainer webhook).
|
||||
|
||||
## How it stays current
|
||||
|
||||
The images are built from the Archipelago monorepo by
|
||||
`.github/workflows/demo-images.yml` on every change to `neode-ui/`, tagged `:demo`
|
||||
and `:<git-sha>`, and pushed to `REGISTRY`. Editing the real UI → CI rebuilds →
|
||||
redeploy here. No source lives in this repo.
|
||||
|
||||
## What's mocked
|
||||
|
||||
- **Per-visitor isolation** — state keyed by a `demo_sid` cookie, idle-reaped.
|
||||
- **Apps** — install/uninstall/start/stop are simulated (no real Docker).
|
||||
- **Wallet/Bitcoin** — signet-flavored; use the in-UI faucet for test sats.
|
||||
- **Files** — real per-session upload/rename/delete, 50 MB quota, wiped on reap.
|
||||
- **Intro** — replays once per calendar day per browser.
|
||||
@@ -0,0 +1,49 @@
|
||||
# Archipelago Public Demo — thin deploy stack
|
||||
#
|
||||
# This is the ENTIRE contents intended for the public `archy-demo` repo. It holds
|
||||
# NO source — it pulls prebuilt `:demo` images that CI builds from the monorepo on
|
||||
# every neode-ui change (see .github/workflows/demo-images.yml). Deploy this in
|
||||
# Portainer ("deploy from repository" or paste into the web editor).
|
||||
#
|
||||
# Demo login password: entertoexit
|
||||
# Access on http://<host>:2100
|
||||
#
|
||||
# Configure via a .env file (see .env.example):
|
||||
# REGISTRY registry host/namespace holding the demo images
|
||||
# IMAGE_TAG image tag to pull (default: demo)
|
||||
# ANTHROPIC_API_KEY optional — enables the AI chat panel
|
||||
# DEMO_WEB_PORT host port for the UI (default 2100)
|
||||
|
||||
services:
|
||||
neode-backend:
|
||||
image: ${REGISTRY:-146.59.87.168:3000/lfg2025}/archy-demo-backend:${IMAGE_TAG:-demo}
|
||||
container_name: archy-demo-backend
|
||||
environment:
|
||||
DEMO: "1"
|
||||
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
|
||||
NODE_OPTIONS: "--dns-result-order=ipv4first"
|
||||
DEMO_SESSION_TTL_MS: ${DEMO_SESSION_TTL_MS:-2700000}
|
||||
DEMO_MAX_SESSIONS: ${DEMO_MAX_SESSIONS:-500}
|
||||
DEMO_FILE_QUOTA_BYTES: ${DEMO_FILE_QUOTA_BYTES:-52428800}
|
||||
expose:
|
||||
- "5959"
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 1.1.1.1
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:5959/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
neode-web:
|
||||
image: ${REGISTRY:-146.59.87.168:3000/lfg2025}/archy-demo-web:${IMAGE_TAG:-demo}
|
||||
container_name: archy-demo-web
|
||||
ports:
|
||||
- "${DEMO_WEB_PORT:-2100}:80"
|
||||
environment:
|
||||
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
|
||||
depends_on:
|
||||
- neode-backend
|
||||
restart: unless-stopped
|
||||
Reference in New Issue
Block a user