weed-cli 1.3.0__tar.gz → 1.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weed-cli
3
- Version: 1.3.0
3
+ Version: 1.3.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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "weed-cli"
7
- version = "1.3.0"
7
+ version = "1.3.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" }
@@ -35,7 +35,13 @@ except ImportError:
35
35
  _HAS_QR = False
36
36
 
37
37
  WEB_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'web')
38
- DEFAULT_RELAY = 'http://127.0.0.1:9101'
38
+ # same $WEED_RELAY/$WEED_TUNNEL convention weed.py's CLI subcommands and
39
+ # shell.py's WeedShell already read (see weed.py's _default_relay) --
40
+ # without this, running web_ui.py directly ignored them entirely and
41
+ # silently fell back to the loopback default, even with a real relay
42
+ # configured for every other way of running this tool
43
+ DEFAULT_RELAY = os.environ.get('WEED_RELAY', 'http://127.0.0.1:9101')
44
+ DEFAULT_TUNNEL = os.environ.get('WEED_TUNNEL')
39
45
  LIBRARY_PATH = os.path.expanduser('~/.weed_library.json')
40
46
  # every real POST body here is a handful of JSON fields (hashes, URLs,
41
47
  # titles) -- no endpoint ever legitimately needs anywhere near this much,
@@ -283,8 +289,9 @@ class Handler(BaseHTTPRequestHandler):
283
289
 
284
290
  if path == '/api/whoami':
285
291
  return self._json({'pubkey': _identity().pubkey_hex()})
286
- if path == '/api/lan-url':
287
- return self._json({'url': _lan_url})
292
+ if path == '/api/config':
293
+ return self._json({'lan_url': _lan_url, 'default_relay': DEFAULT_RELAY,
294
+ 'default_tunnel': DEFAULT_TUNNEL})
288
295
  if path == '/api/discover':
289
296
  return self._json({'results': node.discover(qs.get('relay') or [DEFAULT_RELAY])})
290
297
  if path == '/api/hosts':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weed-cli
3
- Version: 1.3.0
3
+ Version: 1.3.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
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