Archipelago — open-source initial import
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>A to B Bitcoin - Neode</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.header {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
backdrop-filter: blur(10px);
|
||||
padding: 16px 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.badge {
|
||||
background: rgba(34, 197, 94, 0.2);
|
||||
border: 1px solid rgba(34, 197, 94, 0.4);
|
||||
color: #86efac;
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
iframe {
|
||||
flex: 1;
|
||||
border: none;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.loading {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
text-align: center;
|
||||
color: white;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>🅰️➡️🅱️ A to B Bitcoin</h1>
|
||||
<div class="badge">Running on Neode</div>
|
||||
</div>
|
||||
<iframe
|
||||
id="atobFrame"
|
||||
src="https://app.atobitcoin.io"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name atob;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Enable gzip compression
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
|
||||
# Health check endpoint
|
||||
location /health {
|
||||
access_log off;
|
||||
return 200 "healthy\n";
|
||||
add_header Content-Type text/plain;
|
||||
}
|
||||
|
||||
# Proxy to actual ATOB if needed (or serve local iframe)
|
||||
location /api {
|
||||
proxy_pass https://app.atobitcoin.io;
|
||||
proxy_set_header Host app.atobitcoin.io;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# Copy nginx config template
|
||||
cp /etc/nginx/nginx.conf.template /etc/nginx/nginx.conf
|
||||
|
||||
# Ensure client_max_body_size 0 is present (unlimited uploads)
|
||||
# This is a safety net in case the config template was cached without the directive
|
||||
if ! grep -q 'client_max_body_size' /etc/nginx/nginx.conf; then
|
||||
sed -i 's/http {/http {\n client_max_body_size 0;/' /etc/nginx/nginx.conf
|
||||
fi
|
||||
|
||||
exec nginx -g 'daemon off;'
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* PUBLIC-DEMO-ONLY IndeeHub sign-in seeder.
|
||||
*
|
||||
* Served at /__demo/indee-demo-signin.js on the :2101 IndeeHub whole-origin
|
||||
* demo proxy (see nginx-demo.conf) and injected into the proxied site's HTML
|
||||
* <head> via sub_filter. It only ever runs on the demo's :2101 origin inside
|
||||
* the demo iframe — it never ships in real-node artifacts.
|
||||
*
|
||||
* THROWAWAY DEMO IDENTITY — NOT A SECRET. The embedded secp256k1 keypair was
|
||||
* freshly generated for the public demo (2026-07-29) and has never belonged
|
||||
* to any real user. Its whole purpose is to be a shared, public "demo
|
||||
* visitor" Nostr identity so the embedded IndeeHub boots signed in with no
|
||||
* login wall. Anyone extracting this key can only impersonate the demo
|
||||
* visitor, by design (threat T-gjd-01: accepted).
|
||||
*
|
||||
* How it works: IndeeHub's bundle (applesauce-accounts) restores accounts on
|
||||
* boot from localStorage key "indeedhub-accounts" (JSON array of serialized
|
||||
* accounts; a "nsec" private-key account deserializes as
|
||||
* { id, type: "nsec", pubkey, metadata, signer: { key: <hex sk> } }) and
|
||||
* activates the account whose id is stored under "indeedhub-active-account".
|
||||
* This classic script executes before the SPA's deferred module bundle, so
|
||||
* seeding here is visible to that boot-restore. Seeding is idempotent: an
|
||||
* existing non-empty account list is never overwritten.
|
||||
*/
|
||||
;(function () {
|
||||
'use strict'
|
||||
|
||||
var ACCOUNTS_KEY = 'indeedhub-accounts'
|
||||
var ACTIVE_KEY = 'indeedhub-active-account'
|
||||
|
||||
// Throwaway demo keypair (see header — public by design, not a secret).
|
||||
var DEMO_SK_HEX = 'ce2ffa96f99968beffc789cbba5d8b52f4a3020454dcaf77c2b553961bf5a8c9'
|
||||
var DEMO_PK_HEX = '7261540160244ec65ce0bf86ba03997e9b1b3b35c277e416bf1c7ba4271fee31'
|
||||
var DEMO_ACCOUNT_ID = 'archy-demo-visitor'
|
||||
|
||||
try {
|
||||
var existing = null
|
||||
try {
|
||||
existing = JSON.parse(localStorage.getItem(ACCOUNTS_KEY))
|
||||
} catch (e) {
|
||||
existing = null
|
||||
}
|
||||
if (Array.isArray(existing) && existing.length > 0) return
|
||||
|
||||
var account = {
|
||||
id: DEMO_ACCOUNT_ID,
|
||||
type: 'nsec',
|
||||
pubkey: DEMO_PK_HEX,
|
||||
metadata: { name: 'Archy Demo' },
|
||||
signer: { key: DEMO_SK_HEX },
|
||||
}
|
||||
localStorage.setItem(ACCOUNTS_KEY, JSON.stringify([account]))
|
||||
localStorage.setItem(ACTIVE_KEY, DEMO_ACCOUNT_ID)
|
||||
} catch (e) {
|
||||
// localStorage unavailable (e.g. blocked third-party storage) — the demo
|
||||
// visitor just sees IndeeHub's normal signed-out state.
|
||||
}
|
||||
})()
|
||||
@@ -0,0 +1,226 @@
|
||||
worker_processes 1;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
access_log /var/log/nginx/access.log;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
# Allow large uploads globally (filebrowser, etc.)
|
||||
client_max_body_size 0;
|
||||
|
||||
# WebSocket upgrade passthrough (mempool live data, etc.)
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
|
||||
# Proxy API requests to backend
|
||||
location /rpc/v1 {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Proxy WebSocket connections
|
||||
location /ws {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 86400;
|
||||
}
|
||||
|
||||
# Proxy public assets from backend
|
||||
location /public {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
# Proxy REST API requests
|
||||
location /rest {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
# ElectrumX UI status (polled by the electrs-ui shell)
|
||||
location /electrs-status {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
# LND UI endpoints (polled by the lnd-ui shell)
|
||||
location /proxy/ {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
location /lnd-connect-info {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
# Proxy FileBrowser API to mock backend (demo mode)
|
||||
# ^~ on every /app/ prefix: the .css/.js/.img cache regex below must
|
||||
# never swallow app-shell assets (they live on the backend, not in the
|
||||
# web root — without ^~ nginx prefers the regex and 404s them).
|
||||
location ^~ /app/filebrowser/ {
|
||||
client_max_body_size 10G;
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_request_buffering off;
|
||||
}
|
||||
|
||||
# IndeeHub is NOT proxied under a /app/indeedhub/ path prefix — the
|
||||
# old sub_filter path-rewrite approach broke the SPA's runtime-built
|
||||
# absolute-root asset URLs. Instead, a dedicated WHOLE-ORIGIN reverse
|
||||
# proxy of https://indee.tx1138.com listens on :2101 (see the second
|
||||
# server block below): the SPA sees itself at '/' so every asset and
|
||||
# router path just works, framing headers are stripped, and a demo
|
||||
# sign-in seed script is injected. useDemoIntro.demoAppUrl points the
|
||||
# in-app iframe at http://<demo-host>:2101/.
|
||||
|
||||
# Mempool is NOT proxied upstream anymore — the mock backend serves a
|
||||
# branded placeholder page for it (see DEMO_APP_PAGES in mock-backend.js),
|
||||
# so /app/mempool/ falls through to the generic /app/ location below.
|
||||
|
||||
# Proxy every other app UI (/app/<id>/) to the mock backend, which serves
|
||||
# the per-app mock UIs (bitcoin-ui, electrumx, lnd, fedimint) and the
|
||||
# generic "Not available in the demo" notice for the rest.
|
||||
location ^~ /app/ {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
# Serve AIUI SPA
|
||||
location /aiui/ {
|
||||
alias /usr/share/nginx/html/aiui/;
|
||||
try_files $uri $uri/ =404;
|
||||
|
||||
location ~* /aiui/assets/ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
}
|
||||
|
||||
# Proxy AIUI API requests (web-search, etc.) to backend
|
||||
location /api/ {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
# Proxy Ollama (local AI) requests to backend
|
||||
location /aiui/api/ollama/ {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_set_header Connection "";
|
||||
}
|
||||
|
||||
# Proxy Claude API requests to backend (which handles API key + streaming)
|
||||
location /aiui/api/claude/ {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_set_header Connection "";
|
||||
}
|
||||
|
||||
# Serve static files
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Cache static assets (media too — the intro video/audio are versioned
|
||||
# with ?v=N query busters, so immutable is safe)
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|webp|mp4|webm|mp3|woff2?)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
}
|
||||
|
||||
# ── IndeeHub whole-origin demo proxy (:2101) ────────────────────────────
|
||||
# Pure reverse proxy of the LIVE https://indee.tx1138.com site on its own
|
||||
# port — no path prefix, no URL rewriting, so the SPA's absolute-root
|
||||
# asset/router paths work untouched. The upstream's X-Frame-Options
|
||||
# (SAMEORIGIN) and any CSP are stripped so the demo can embed it in the
|
||||
# in-app iframe session, and a PUBLIC-DEMO-ONLY sign-in seed script is
|
||||
# injected into the HTML <head> (it seeds a labelled throwaway demo Nostr
|
||||
# account into the :2101 origin's isolated localStorage, so IndeeHub boots
|
||||
# signed in). Upstream is pinned to a single fixed hostname — this cannot
|
||||
# be used as an open proxy.
|
||||
server {
|
||||
listen 2101;
|
||||
server_name _;
|
||||
|
||||
# Demo sign-in seeder, served same-origin to the proxied SPA.
|
||||
location = /__demo/indee-demo-signin.js {
|
||||
root /usr/share/nginx/html;
|
||||
add_header Cache-Control "no-store";
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass https://indee.tx1138.com;
|
||||
proxy_ssl_server_name on;
|
||||
proxy_ssl_name indee.tx1138.com;
|
||||
proxy_set_header Host indee.tx1138.com;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_read_timeout 86400;
|
||||
|
||||
# Allow embedding in the demo's iframe session.
|
||||
proxy_hide_header X-Frame-Options;
|
||||
proxy_hide_header Content-Security-Policy;
|
||||
|
||||
# HTML injection: upstream must not compress or sub_filter no-ops.
|
||||
# (sub_filter applies to text/html by default — exactly what we want.)
|
||||
proxy_set_header Accept-Encoding "";
|
||||
sub_filter_once on;
|
||||
sub_filter '</head>' '<script src="/__demo/indee-demo-signin.js"></script></head>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
worker_processes 1;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
access_log /var/log/nginx/access.log;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
|
||||
# Proxy API requests to backend
|
||||
location /rpc/v1 {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Proxy WebSocket connections
|
||||
location /ws {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 86400;
|
||||
}
|
||||
|
||||
# Proxy public assets from backend
|
||||
location /public {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Proxy REST API requests
|
||||
location /rest {
|
||||
proxy_pass http://neode-backend:5959;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Serve static files
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Cache static assets
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user