mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-09 16:01:44 +00:00
* fix(core): normalize secure keys for TOML instances
* feat(wasi): run core behind Cloudflare WebSockets
Introduce the Cloudflare Worker WASI host that runs the EasyTier core
behind host-upgraded WebSockets.
- Worker package scaffold (wrangler Durable Object, build-wasm script,
vitest config) and core-runtime/websocket-host/data-plane runtime.
- WASI host WebSocket tunnel ABI (imports, adapter, runtime exports)
with bounded receive memory and bounded admission queue.
- Route host sockets through the portable listener plan
(HostListenerRegistration, listener queue, admission handler split).
- Build the WASM guest with the aes-gcm feature so secure peer
sessions have their cipher available.
* feat(wasi): add outbound browser client runtime
Add the outbound-only WASI runtime and browser connector host so
browser pages can dial EasyTier peers through WebSocket relays.
- CoreConnectivityMode::{OutboundOnly, InboundOnly} gating for
listeners, discovery, and direct connectivity modules.
- ExternalTunnelConnector plumbing through composite/connector_host/
manual for browser WebSocket dials.
- Browser/Node smoke entries with shared helpers
(smoke-shared.ts).
* feat(wasi): extend browser data plane with TCP half-close
Add the data-plane pieces the browser runtime needs for full-duplex
TCP streams behind host WebSockets:
- Guest TCP shutdown_write operation with submit/take ABI pair
(DATA_PLANE_ABI_VERSION 3 -> 4) and smoltcp half-close support.
- Worker data-plane TCP listener/stream plumbing and core-runtime
listener registration.
- Unit coverage for the new session ops and listener wiring.
* refactor(wasi): make host tunnel ABI transport-neutral
Replace WebSocket-specific core and WASI boundaries with a
message-oriented Host Tunnel interface. Keep WebSocket framing and text
rejection in the Cloudflare host while preserving payload boundaries,
ownership, cancellation, backpressure, and EOF behavior.
Rename feature flags and guest imports and exports to the Host Tunnel
ABI. Update both Worker profiles, tests, and architecture documentation.
* feat(web): split WASI hosts into publishable npm packages
Extract the shared JSPI, WASI, Host Tunnel, and data-plane runtime
into @easytier/runtime. Keep ABI handles, guest memory, TOML, and
operation broker details behind its adapter entry point.
Add typed, auto-starting @easytier/browser and factory-based
@easytier/cloudflare packages. Ship a matching Wasm profile with
each platform package and validate its capabilities before packing.
Persist Cloudflare instance identity in Durable Object storage,
centralize WebSocket admission ownership, and add package-level
coverage for the public interfaces.
* fix(web): make public packages portable
Embed the browser Wasm artifact in the published JavaScript entry
point. This lets esbuild consumers bundle the package without an asset
loader or a copied file.
Return Cloudflare's nominal Durable Object base type and document the
named subclass export required by generated Wrangler bindings.
* docs(web): add public package walkthrough
Expand both package READMEs with installation, configuration, local
validation, health checks, and deployment instructions.
Add a standalone Vite and Wrangler example that imports only the
public Browser and Cloudflare entries. Generate Worker bindings from
configuration and keep local secrets outside version control.
* chore(go): import EasyTier Go host
Add the standalone Go host runtime as a monorepo subtree without
carrying its development branch ancestry.
Preserve its API, tests, examples, generated protobuf bindings, and
embedded WASI artifacts.
* refactor(hosts): colocate Go and JavaScript runtimes
Move the browser, Cloudflare, shared runtime, and web example into
the easytier-js subtree. Update workspace metadata, build paths, and
documentation for the new layout.
Adopt github.com/EasyTier/EasyTier/easytier-go as the Go module path.
Resolve artifact and protobuf generation from the enclosing monorepo.
* build(web): isolate JavaScript host workspace
Keep public browser and Cloudflare packages outside the legacy frontend
workspace so root installs and cross-platform builds do not pull workerd.
Make each package build generate its required WASI artifact from a clean
checkout. Add a dedicated workflow that runs the same install and check
commands documented for contributors.
Move JavaScript dependencies into a scoped lockfile and restore the root
workspace lockfile to its pre-host state.
46 lines
1.5 KiB
JavaScript
46 lines
1.5 KiB
JavaScript
import { readFile } from "node:fs/promises";
|
|
import path from "node:path";
|
|
|
|
const [profile, artifactArgument] = process.argv.slice(2);
|
|
if (profile !== "browser" && profile !== "cloudflare") {
|
|
throw new Error(
|
|
"usage: validate-wasm.mjs <browser|cloudflare> <artifact-file>",
|
|
);
|
|
}
|
|
if (artifactArgument === undefined) {
|
|
throw new Error("Wasm artifact file is required");
|
|
}
|
|
|
|
const artifact = path.resolve(process.cwd(), artifactArgument);
|
|
const module = new WebAssembly.Module(await readFile(artifact));
|
|
const imports = new Set(
|
|
WebAssembly.Module.imports(module)
|
|
.filter((entry) => entry.module === "easytier_host")
|
|
.map((entry) => entry.name),
|
|
);
|
|
const exports = new Set(
|
|
WebAssembly.Module.exports(module).map((entry) => entry.name),
|
|
);
|
|
|
|
requireSymbol(exports, "easytier_host_tunnel_abi_version", "export");
|
|
requireSymbol(exports, "easytier_instance_accept_tunnel", "export");
|
|
if (profile === "browser") {
|
|
requireSymbol(imports, "start_tunnel_connect", "import");
|
|
requireSymbol(exports, "easytier_data_plane_tcp_connect_submit", "export");
|
|
} else {
|
|
rejectSymbol(imports, "start_tunnel_connect", "import");
|
|
rejectSymbol(exports, "easytier_data_plane_tcp_connect_submit", "export");
|
|
}
|
|
|
|
function requireSymbol(symbols, name, kind) {
|
|
if (!symbols.has(name)) {
|
|
throw new Error(`${profile} artifact is missing ${kind} ${name}`);
|
|
}
|
|
}
|
|
|
|
function rejectSymbol(symbols, name, kind) {
|
|
if (symbols.has(name)) {
|
|
throw new Error(`${profile} artifact unexpectedly contains ${kind} ${name}`);
|
|
}
|
|
}
|