weed-cli 0.1.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- weed_cli-1.0.2/LICENSE +21 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/PKG-INFO +3 -1
- {weed_cli-0.1.0 → weed_cli-1.0.2}/pyproject.toml +1 -1
- {weed_cli-0.1.0 → weed_cli-1.0.2}/shell.py +17 -18
- {weed_cli-0.1.0 → weed_cli-1.0.2}/weed.py +11 -9
- {weed_cli-0.1.0 → weed_cli-1.0.2}/weed_cli.egg-info/PKG-INFO +3 -1
- {weed_cli-0.1.0 → weed_cli-1.0.2}/weed_cli.egg-info/SOURCES.txt +1 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/README.md +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/dht.py +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/discovery_relay.py +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/lightning_settle.py +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/node.py +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/poc_reputation.py +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/setup.cfg +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/tunnel_relay.py +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/web_ui.py +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/weed_cli.egg-info/dependency_links.txt +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/weed_cli.egg-info/entry_points.txt +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/weed_cli.egg-info/requires.txt +0 -0
- {weed_cli-0.1.0 → weed_cli-1.0.2}/weed_cli.egg-info/top_level.txt +0 -0
weed_cli-1.0.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ryan Scarbery
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: weed-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Censorship-resistant video PoC — discovery/hosting/download over signed relay events, a real Kademlia DHT, or a TLS-capable NAT-traversal tunnel
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: p2p,video,censorship-resistant,discovery,dht,kademlia,nat-traversal
|
|
@@ -13,6 +13,7 @@ Classifier: Topic :: Communications :: File Sharing
|
|
|
13
13
|
Classifier: Topic :: Internet
|
|
14
14
|
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
16
17
|
Requires-Dist: btcvm>=1.3.7
|
|
17
18
|
Requires-Dist: cryptography>=41.0
|
|
18
19
|
Provides-Extra: dev
|
|
@@ -25,6 +26,7 @@ Provides-Extra: qr
|
|
|
25
26
|
Requires-Dist: qrcode>=7.4; extra == "qr"
|
|
26
27
|
Provides-Extra: viz
|
|
27
28
|
Requires-Dist: matplotlib>=3.8; extra == "viz"
|
|
29
|
+
Dynamic: license-file
|
|
28
30
|
|
|
29
31
|
# Censorship-resistant video platform — PoC notes
|
|
30
32
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "weed-cli"
|
|
7
|
-
version = "
|
|
7
|
+
version = "1.0.2"
|
|
8
8
|
description = "Censorship-resistant video PoC — discovery/hosting/download over signed relay events, a real Kademlia DHT, or a TLS-capable NAT-traversal tunnel"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -106,11 +106,12 @@ class WeedShell(cmd.Cmd):
|
|
|
106
106
|
on --relay (default: your session's default relay — see `relay`)
|
|
107
107
|
unless --no-announce is given. --price sets what download charges
|
|
108
108
|
(default free). --tunnel registers with a tunnel_relay.py instead of
|
|
109
|
-
relying on a reachable inbound port — for hosting behind NAT/CGNAT
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
["tls"]) — the relay
|
|
109
|
+
relying on a reachable inbound port — for hosting behind NAT/CGNAT.
|
|
110
|
+
Registers one control connection per file (REGISTER's token is
|
|
111
|
+
each file's own content hash), so a whole tree tunnels fine, not
|
|
112
|
+
just a single file. Prefix tls:// if the relay terminates TLS at
|
|
113
|
+
the edge (e.g. a Fly service with handlers = ["tls"]) — the relay
|
|
114
|
+
process itself never needs to know."""
|
|
114
115
|
parts = shlex.split(arg)
|
|
115
116
|
if not parts:
|
|
116
117
|
print(' usage: host <archive_dir> [--file NAME] [--port N] [--price SAT] '
|
|
@@ -148,10 +149,6 @@ class WeedShell(cmd.Cmd):
|
|
|
148
149
|
i += 1
|
|
149
150
|
|
|
150
151
|
entries = node.load_manifest_entries(archive_dir, file_name)
|
|
151
|
-
if tunnel and len(entries) > 1:
|
|
152
|
-
print(f' {len(entries)} files in {archive_dir} but --tunnel only serves one at a time '
|
|
153
|
-
f'— pass --file NAME to pick one')
|
|
154
|
-
return
|
|
155
152
|
# fail fast, before announcing anything — a manifest entry with no
|
|
156
153
|
# matching chunk data would otherwise get announced to the relay
|
|
157
154
|
# and only fail later, in the background server thread (onecmd's
|
|
@@ -165,17 +162,19 @@ class WeedShell(cmd.Cmd):
|
|
|
165
162
|
elif not relay:
|
|
166
163
|
print(' no relay set (run `relay` first, or pass --relay) — hosting without announcing')
|
|
167
164
|
if tunnel:
|
|
168
|
-
|
|
165
|
+
# one control connection per file, each registered under its
|
|
166
|
+
# own content hash — see do_host's docstring
|
|
169
167
|
relay_host, relay_port, use_tls = node._parse_tunnel(tunnel)
|
|
170
168
|
expanded_dir = os.path.expanduser(archive_dir)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
169
|
+
for entry in entries:
|
|
170
|
+
file_path = entry.get('last_path') or os.path.join(expanded_dir, entry['name'])
|
|
171
|
+
tt = threading.Thread(target=_bg,
|
|
172
|
+
args=(node.run_host_tunnel, relay_host, relay_port,
|
|
173
|
+
entry['sha256'], entry, all_leaves[entry['sha256']],
|
|
174
|
+
file_path, price),
|
|
175
|
+
kwargs={'use_tls': use_tls, 'quiet': True}, daemon=True)
|
|
176
|
+
tt.start()
|
|
177
|
+
self._host_threads.append(tt)
|
|
179
178
|
t = threading.Thread(target=_bg,
|
|
180
179
|
args=(node.run_host_server, archive_dir, file_name, port),
|
|
181
180
|
kwargs={'quiet': True, 'price': price}, daemon=True)
|
|
@@ -139,9 +139,6 @@ def cmd_host(args):
|
|
|
139
139
|
import node
|
|
140
140
|
identity = node.load_or_create_identity()
|
|
141
141
|
entries = node.load_manifest_entries(args.archive_dir, args.file)
|
|
142
|
-
if args.tunnel and len(entries) > 1:
|
|
143
|
-
sys.exit(f"{len(entries)} files in {args.archive_dir} but --tunnel only serves one at a "
|
|
144
|
-
f"time — pass --file NAME to pick one")
|
|
145
142
|
# fail fast, before announcing anything — a manifest entry with no
|
|
146
143
|
# matching chunk data would otherwise get announced to the relay and
|
|
147
144
|
# only fail later, in the background server thread
|
|
@@ -153,14 +150,19 @@ def cmd_host(args):
|
|
|
153
150
|
tunnel=args.tunnel)
|
|
154
151
|
print(f"announced {entry['name']} on {relay_url}: {result}")
|
|
155
152
|
if args.tunnel:
|
|
156
|
-
|
|
153
|
+
# REGISTER's token is the file's own content hash (see
|
|
154
|
+
# run_host_tunnel/connect_via_tunnel), so a whole tree just means
|
|
155
|
+
# one control connection per file, each registered under its own
|
|
156
|
+
# hash — no protocol change needed, CONNECT already looks a
|
|
157
|
+
# downloader's requested hash up the same way.
|
|
157
158
|
relay_host, relay_port, use_tls = node._parse_tunnel(args.tunnel)
|
|
158
159
|
archive_dir = os.path.expanduser(args.archive_dir)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
for entry in entries:
|
|
161
|
+
file_path = entry.get('last_path') or os.path.join(archive_dir, entry['name'])
|
|
162
|
+
threading.Thread(target=node.run_host_tunnel,
|
|
163
|
+
args=(relay_host, relay_port, entry['sha256'], entry,
|
|
164
|
+
all_leaves[entry['sha256']], file_path, args.price),
|
|
165
|
+
kwargs={'use_tls': use_tls}, daemon=True).start()
|
|
164
166
|
node.run_host_server(args.archive_dir, args.file, args.port, price=args.price)
|
|
165
167
|
|
|
166
168
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: weed-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Censorship-resistant video PoC — discovery/hosting/download over signed relay events, a real Kademlia DHT, or a TLS-capable NAT-traversal tunnel
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: p2p,video,censorship-resistant,discovery,dht,kademlia,nat-traversal
|
|
@@ -13,6 +13,7 @@ Classifier: Topic :: Communications :: File Sharing
|
|
|
13
13
|
Classifier: Topic :: Internet
|
|
14
14
|
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
16
17
|
Requires-Dist: btcvm>=1.3.7
|
|
17
18
|
Requires-Dist: cryptography>=41.0
|
|
18
19
|
Provides-Extra: dev
|
|
@@ -25,6 +26,7 @@ Provides-Extra: qr
|
|
|
25
26
|
Requires-Dist: qrcode>=7.4; extra == "qr"
|
|
26
27
|
Provides-Extra: viz
|
|
27
28
|
Requires-Dist: matplotlib>=3.8; extra == "viz"
|
|
29
|
+
Dynamic: license-file
|
|
28
30
|
|
|
29
31
|
# Censorship-resistant video platform — PoC notes
|
|
30
32
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|