feat: add I2P BitTorrent engine, DHT, and Firefox torrent extension
- Add pure-MoonBit bittorrent package: bencode codec, metainfo/magnet parsing with path traversal checks, peer wire protocol (BEP 10/9), and I2P Kademlia DHT with KRPC and 54-byte compact nodes - Add SHA-1 primitive in crypto for torrent info hashes - Add router torrent API and engine, enabled with --torrent-api (default 127.0.0.1:4445) and --download-dir - Add Firefox WebExtension torrent manager with native messaging host and packed .xpi - Add scripts to build a standalone Firefox + router AppImage and install the native host - Add just targets (proxy, appimage, extension), README docs, and ignore .cache/ and dist/
This commit is contained in:
1 parent
14eae00f5c
commit
fbe6818c4e
37 files changed
+8543
-9
No files matched your search
@@ -0,0 +1,112 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Moon I2P Torrent</title>
|
||||
<link rel="stylesheet" href="ui.css" />
|
||||
</head>
|
||||
<body class="popup">
|
||||
<header>
|
||||
<div class="brand">
|
||||
<img src="icon.svg" alt="" />
|
||||
<span>moon-i2p Torrent</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span id="router-pill" class="pill offline">Offline</span>
|
||||
<button id="open-manager-btn" class="secondary">Full View</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="card">
|
||||
<h2>
|
||||
<span>I2P Router & Proxy</span>
|
||||
<span class="row">
|
||||
<button id="start-router-btn">Start Router</button>
|
||||
<button id="stop-router-btn" class="secondary" style="display:none;">Stop</button>
|
||||
</span>
|
||||
</h2>
|
||||
<div class="grid-2">
|
||||
<div class="stat">
|
||||
<div class="stat-label">NetDB / Tunnels</div>
|
||||
<div id="net-summary" class="stat-val">--</div>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<div class="stat-label">I2P Proxy (.i2p)</div>
|
||||
<div class="row">
|
||||
<label class="row" style="gap:4px;">
|
||||
<input id="proxy-enabled" type="checkbox" />
|
||||
<span id="proxy-addr" class="mono">127.0.0.1:4444</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat" style="margin-top:6px;">
|
||||
<div class="stat-label">Torrent Session .b32.i2p</div>
|
||||
<div id="torrent-b32" class="stat-val mono">--</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>
|
||||
<span>I2P DHT</span>
|
||||
<span id="dht-summary" class="mono">0 nodes</span>
|
||||
</h2>
|
||||
<div class="grid-2">
|
||||
<div class="stat">
|
||||
<div class="stat-label">DHT Node ID (20B)</div>
|
||||
<div id="dht-node-id" class="stat-val mono">--</div>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<div class="stat-label">Sent / Recv / Peers</div>
|
||||
<div id="dht-stats" class="stat-val">0 / 0 / 0</div>
|
||||
</div>
|
||||
</div>
|
||||
<form id="bootstrap-form" class="row" style="margin-top:8px;">
|
||||
<input id="bootstrap-b32" type="text" placeholder="Bootstrap node .b32.i2p" />
|
||||
<input id="bootstrap-port" type="number" value="6881" style="width:74px;" />
|
||||
<button type="submit" class="secondary">Ping</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2><span>Add I2P Torrent</span></h2>
|
||||
<form id="magnet-form" class="row">
|
||||
<input id="magnet-uri" type="text" placeholder="magnet:?xt=urn:btih:..." />
|
||||
<button type="submit">Add</button>
|
||||
</form>
|
||||
<div id="dropzone" class="dropzone">
|
||||
Drop a .torrent file here or click to browse
|
||||
<input id="torrent-file" type="file" accept=".torrent" style="display:none;" />
|
||||
</div>
|
||||
<div id="status-msg" class="msg"></div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>
|
||||
<span>Torrents</span>
|
||||
<span id="torrent-count" class="mono">0</span>
|
||||
</h2>
|
||||
<div id="torrents-list" class="muted">No torrents added yet.</div>
|
||||
</section>
|
||||
|
||||
<details class="card">
|
||||
<summary>Settings (API, Proxy & Download Folder)</summary>
|
||||
<form id="settings-form" style="margin-top:8px;">
|
||||
<div class="grid-2">
|
||||
<div><div class="stat-label">Proxy Port</div><input id="cfg-proxy-port" type="number" /></div>
|
||||
<div><div class="stat-label">Torrent API Port</div><input id="cfg-api-port" type="number" /></div>
|
||||
</div>
|
||||
<div style="margin-top:6px;">
|
||||
<div class="stat-label">Download Directory</div>
|
||||
<input id="cfg-dl-dir" type="text" placeholder="~/Downloads/moon-i2p" />
|
||||
</div>
|
||||
<div class="row" style="margin-top:8px;justify-content:space-between;">
|
||||
<label class="row"><input id="cfg-intercept" type="checkbox" /> <span>Intercept .i2p magnets & .torrent links</span></label>
|
||||
<button type="submit" class="secondary">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</details>
|
||||
|
||||
<script src="ui.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user