Lightweight web UI for Magic Wormhole built with Go and vanilla JavaScript. End-to-end encryption, real-time progress, ~15MB Docker image.
  • TypeScript 40.5%
  • JavaScript 28.1%
  • Go 16.9%
  • CSS 13.1%
  • HTML 0.8%
  • Other 0.6%
Find a file
skr b601156524
All checks were successful
CI / frontend (push) Successful in 19s
CI / backend (push) Successful in 32s
CI / docker (push) Successful in 10s
CI / release (push) Has been skipped
fix: code review (WS race, CSWSH, PBKDF2, base64 chunking, timeouts, Docker bumps)
2026-05-08 12:49:03 +00:00
.forgejo fix: code review (WS race, CSWSH, PBKDF2, base64 chunking, timeouts, Docker bumps) 2026-05-08 12:49:03 +00:00
src fix: code review (WS race, CSWSH, PBKDF2, base64 chunking, timeouts, Docker bumps) 2026-05-08 12:49:03 +00:00
static added tests (#2) 2025-12-05 18:29:14 +01:00
.dockerignore intitial commit 2025-12-05 15:01:45 +01:00
.gitignore chore: align with nm visitenkarte standard 2026-05-08 10:21:51 +00:00
bun.lock switched over to typescript 2025-12-05 18:28:01 +01:00
docker-compose.yml switched over to typescript 2025-12-05 18:28:01 +01:00
Dockerfile fix: code review (WS race, CSWSH, PBKDF2, base64 chunking, timeouts, Docker bumps) 2026-05-08 12:49:03 +00:00
eslint.config.js switched over to typescript 2025-12-05 18:28:01 +01:00
go.mod fix: code review (WS race, CSWSH, PBKDF2, base64 chunking, timeouts, Docker bumps) 2026-05-08 12:49:03 +00:00
go.sum added tests (#2) 2025-12-05 18:29:14 +01:00
LICENSE chore: align with nm visitenkarte standard 2026-05-08 10:21:51 +00:00
main.go fix: code review (WS race, CSWSH, PBKDF2, base64 chunking, timeouts, Docker bumps) 2026-05-08 12:49:03 +00:00
main_test.go fix: code review (WS race, CSWSH, PBKDF2, base64 chunking, timeouts, Docker bumps) 2026-05-08 12:49:03 +00:00
package.json added tests (#2) 2025-12-05 18:29:14 +01:00
README.md chore: align with nm visitenkarte standard 2026-05-08 10:21:51 +00:00
tsconfig.json switched over to typescript 2025-12-05 18:28:01 +01:00

magic-wormhole-web

A modern web UI for Magic Wormhole file transfers. Built with Go and vanilla JavaScript — send files, folders, and encrypted messages between devices using a short wormhole code.

Features

  • File and folder transfer (folders are zipped on the fly)
  • Text messages (snippets, codes, links)
  • End-to-end encryption built in via Magic Wormhole's PAKE handshake; optional additional AES-256-GCM password layer
  • Real-time progress over WebSocket
  • System-aware light/dark theme
  • Responsive desktop / mobile UI
  • Zero frontend dependencies — pure vanilla JS, no framework

Quick Start

Docker (pre-built image)

docker run -p 8080:8080 git.neomint.com/nm/magic-wormhole-web:latest

Open http://localhost:8080.

Docker Compose

docker compose up -d

Build locally

docker build -t magic-wormhole-web .
docker run -p 8080:8080 magic-wormhole-web

Native (Go + Bun)

bun install
bun run build       # typecheck + lint + bundle TS to static/
go mod tidy
go run .            # serves on :8080

Usage

Sending Files

  1. Click the Send tab
  2. Drag & drop files/folders or click to browse
  3. Optionally enable encryption and set a password
  4. Click Send to generate a wormhole code
  5. Share the code (and password, if encrypted) with the recipient

Receiving Files

  1. Click the Receive tab
  2. Enter the wormhole code (format: number-word-word)
  3. If encrypted, enter the password when prompted
  4. Download or copy the received content

Configuration

Variable Default Description
PORT 8080 HTTP server port

Architecture

wormhole-web/
├── main.go              # Go backend server
├── static/
│   ├── index.html       # Single-page app shell
│   ├── app.js           # Application logic
│   ├── styles.css       # App styles with CSS variables
│   ├── particles.js     # Particle animation system
│   └── particles.css    # Particle styles (standalone)
├── Dockerfile           # Multi-stage build
└── docker-compose.yml   # Container orchestration

Backend (Go)

  • Embedded static files using go:embed
  • WebSocket support for real-time progress updates
  • Automatic temp file cleanup
  • Uses wormhole-william for Magic Wormhole protocol

Frontend (Vanilla JS)

  • State-based rendering without virtual DOM
  • CSS custom properties for theming
  • Web Crypto API for client-side encryption
  • File System Access API for native save dialogs

Particle Animation System

The particle animation is a standalone module that can be reused:

<link rel="stylesheet" href="particles.css">
<script src="particles.js"></script>

<div class="particle-container" id="container"></div>

<script>
  const container = document.getElementById('container');

  // Start animation
  initParticles(container, 'up');     // Stream upward
  initParticles(container, 'down');   // Stream downward
  initParticles(container, 'drift');  // 3D rotating sphere

  // Morph to shapes
  morphParticlesToCheck(container);   // Green checkmark
  morphParticlesToError(container);   // Red X

  // Transitions
  transitionToDrift(container);       // Smooth stream-to-sphere transition
</script>

Customize colors via CSS variables:

:root {
  --particle-color: #2563eb;    /* Default particle color */
  --particle-success: #16a34a;  /* Checkmark color */
  --particle-error: #ef4444;    /* Error X color */
}

API Reference

POST /api/send/text

Send a text message.

{ "text": "Hello, world!" }

POST /api/send/file

Send files via multipart form data.

  • file: Single file upload
  • files: Multiple files
  • paths: JSON array of file paths (for folder structure)

POST /api/receive

Receive content using a wormhole code.

{ "code": "7-guitarist-revenge" }

GET /api/ws?id={transferId}

WebSocket endpoint for real-time transfer status updates.

GET /api/download/{transferId}/{filename}

Download received files.

Security

  • All transfers use Magic Wormhole's PAKE-based encryption
  • Optional additional AES-256-GCM encryption for sensitive content
  • No data stored on server after transfer completion
  • Automatic cleanup of expired transfers (1 hour TTL)
  • Path traversal protection on file downloads
  • Input validation on wormhole codes and transfer IDs

License

MIT — © 2026 NeoMINT Research


Built by NeoMINT.