portacode 1.4.15.dev2__py3-none-any.whl → 1.4.15.dev4__py3-none-any.whl
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.
- portacode/_version.py +2 -2
- portacode/connection/handlers/WEBSOCKET_PROTOCOL.md +12 -5
- portacode/connection/handlers/__init__.py +6 -0
- portacode/connection/handlers/proxmox_infra.py +32 -5
- portacode/connection/terminal.py +6 -0
- {portacode-1.4.15.dev2.dist-info → portacode-1.4.15.dev4.dist-info}/METADATA +1 -1
- {portacode-1.4.15.dev2.dist-info → portacode-1.4.15.dev4.dist-info}/RECORD +11 -11
- {portacode-1.4.15.dev2.dist-info → portacode-1.4.15.dev4.dist-info}/WHEEL +0 -0
- {portacode-1.4.15.dev2.dist-info → portacode-1.4.15.dev4.dist-info}/entry_points.txt +0 -0
- {portacode-1.4.15.dev2.dist-info → portacode-1.4.15.dev4.dist-info}/licenses/LICENSE +0 -0
- {portacode-1.4.15.dev2.dist-info → portacode-1.4.15.dev4.dist-info}/top_level.txt +0 -0
portacode/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '1.4.15.
|
|
32
|
-
__version_tuple__ = version_tuple = (1, 4, 15, '
|
|
31
|
+
__version__ = version = '1.4.15.dev4'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 4, 15, 'dev4')
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -425,7 +425,7 @@ Creates or updates a Cloudflare tunnel in front of a managed container. The cont
|
|
|
425
425
|
|
|
426
426
|
**Responses:**
|
|
427
427
|
|
|
428
|
-
* Emits a [`cloudflare_tunnel_created`](#cloudflare_tunnel_created-event) event with the tunnel metadata.
|
|
428
|
+
* Emits a [`cloudflare_tunnel_created`](#cloudflare_tunnel_created-event) event with the tunnel metadata, the refreshed infra snapshot, and the optional `device_id` so dashboards can refresh the CT list.
|
|
429
429
|
* Emits an [`error`](#error) event on failure.
|
|
430
430
|
|
|
431
431
|
### `update_cloudflare_tunnel`
|
|
@@ -441,7 +441,7 @@ Refreshes the tunnel configuration for an existing tunnel (different port, URL,
|
|
|
441
441
|
|
|
442
442
|
**Responses:**
|
|
443
443
|
|
|
444
|
-
* Emits a [`cloudflare_tunnel_updated`](#cloudflare_tunnel_updated-event) event with the refreshed tunnel metadata
|
|
444
|
+
* Emits a [`cloudflare_tunnel_updated`](#cloudflare_tunnel_updated-event) event with the refreshed tunnel metadata, the refreshed infra snapshot, and the optional `device_id`.
|
|
445
445
|
* Emits an [`error`](#error) event on failure.
|
|
446
446
|
|
|
447
447
|
### `remove_cloudflare_tunnel`
|
|
@@ -454,7 +454,7 @@ Stops and removes any tunnel metadata associated with a container.
|
|
|
454
454
|
|
|
455
455
|
**Responses:**
|
|
456
456
|
|
|
457
|
-
* Emits a [`cloudflare_tunnel_removed`](#cloudflare_tunnel_removed-event) event
|
|
457
|
+
* Emits a [`cloudflare_tunnel_removed`](#cloudflare_tunnel_removed-event) event with the refreshed infra snapshot and optional `device_id`.
|
|
458
458
|
* Emits an [`error`](#error) event on failure.
|
|
459
459
|
|
|
460
460
|
### `proxmox_container_created`
|
|
@@ -1272,8 +1272,10 @@ Submitted after a successful `create_cloudflare_tunnel` action.
|
|
|
1272
1272
|
* `event` (string): `cloudflare_tunnel_created`.
|
|
1273
1273
|
* `ctid` (string): Container ID associated with the tunnel.
|
|
1274
1274
|
* `success` (boolean): True when the tunnel is running.
|
|
1275
|
-
* `
|
|
1275
|
+
* `device_id` (string, optional): Mirrors the `device_id` supplied with the command, letting dashboards refresh that device immediately.
|
|
1276
|
+
* `message` (string): Summary text; when a hostname was assigned (including Quick Tunnel), the host is appended (e.g., `Created ... -> example.com`).
|
|
1276
1277
|
* `tunnel` (object): Tunnel metadata matching the manager view. When using Cloudflare Quick Tunnel (no hostname supplied), `tunnel.url` holds the autogenerated `*.cfargotunnel.com` hostname.
|
|
1278
|
+
* `infra` (object): Snapshot produced by `get_infra_snapshot`, including the refreshed `managed_containers` list.
|
|
1277
1279
|
|
|
1278
1280
|
### `cloudflare_tunnel_updated`
|
|
1279
1281
|
|
|
@@ -1284,8 +1286,10 @@ Sent when `update_cloudflare_tunnel` completes.
|
|
|
1284
1286
|
* `event` (string): `cloudflare_tunnel_updated`.
|
|
1285
1287
|
* `ctid` (string): Container ID associated with the tunnel.
|
|
1286
1288
|
* `success` (boolean): True on success.
|
|
1287
|
-
* `
|
|
1289
|
+
* `device_id` (string, optional): Mirrors the command's `device_id`.
|
|
1290
|
+
* `message` (string): Summary text; includes the new hostname when one was assigned or changed.
|
|
1288
1291
|
* `tunnel` (object): Updated tunnel metadata.
|
|
1292
|
+
* `infra` (object): Snapshot produced by `get_infra_snapshot` so dashboards can refresh the managed container list.
|
|
1289
1293
|
|
|
1290
1294
|
### `cloudflare_tunnel_removed`
|
|
1291
1295
|
|
|
@@ -1296,7 +1300,10 @@ Sent after a tunnel has been removed from a container record.
|
|
|
1296
1300
|
* `event` (string): `cloudflare_tunnel_removed`.
|
|
1297
1301
|
* `ctid` (string): Container ID that no longer has a tunnel.
|
|
1298
1302
|
* `success` (boolean): True on success.
|
|
1303
|
+
* `device_id` (string, optional): Mirrors the command's `device_id`.
|
|
1299
1304
|
* `message` (string): Summary text.
|
|
1305
|
+
* `tunnel` (null): Always `null` to explicitly clear the stored tunnel metadata.
|
|
1306
|
+
* `infra` (object): The refreshed snapshot so dashboards see the updated container list.
|
|
1300
1307
|
|
|
1301
1308
|
### <a name="clock_sync_response"></a>`clock_sync_response`
|
|
1302
1309
|
|
|
@@ -43,12 +43,15 @@ from .project_state_handlers import (
|
|
|
43
43
|
)
|
|
44
44
|
from .proxmox_infra import (
|
|
45
45
|
ConfigureProxmoxInfraHandler,
|
|
46
|
+
CreateCloudflareTunnelHandler,
|
|
46
47
|
CreateProxmoxContainerHandler,
|
|
47
48
|
RevertProxmoxInfraHandler,
|
|
48
49
|
StartPortacodeServiceHandler,
|
|
49
50
|
StartProxmoxContainerHandler,
|
|
50
51
|
StopProxmoxContainerHandler,
|
|
52
|
+
RemoveCloudflareTunnelHandler,
|
|
51
53
|
RemoveProxmoxContainerHandler,
|
|
54
|
+
UpdateCloudflareTunnelHandler,
|
|
52
55
|
)
|
|
53
56
|
|
|
54
57
|
__all__ = [
|
|
@@ -62,6 +65,7 @@ __all__ = [
|
|
|
62
65
|
"TerminalListHandler",
|
|
63
66
|
"SystemInfoHandler",
|
|
64
67
|
"ConfigureProxmoxInfraHandler",
|
|
68
|
+
"CreateCloudflareTunnelHandler",
|
|
65
69
|
"CreateProxmoxContainerHandler",
|
|
66
70
|
# File operation handlers (optional - register as needed)
|
|
67
71
|
"FileReadHandler",
|
|
@@ -91,7 +95,9 @@ __all__ = [
|
|
|
91
95
|
"StartPortacodeServiceHandler",
|
|
92
96
|
"StartProxmoxContainerHandler",
|
|
93
97
|
"StopProxmoxContainerHandler",
|
|
98
|
+
"RemoveCloudflareTunnelHandler",
|
|
94
99
|
"RemoveProxmoxContainerHandler",
|
|
100
|
+
"UpdateCloudflareTunnelHandler",
|
|
95
101
|
"UpdatePortacodeHandler",
|
|
96
102
|
"RevertProxmoxInfraHandler",
|
|
97
103
|
]
|
|
@@ -1948,13 +1948,23 @@ class CreateCloudflareTunnelHandler(SyncHandler):
|
|
|
1948
1948
|
if hostname:
|
|
1949
1949
|
tunnel["url"] = hostname
|
|
1950
1950
|
created = _launch_container_tunnel(proxmox, node, vmid, tunnel)
|
|
1951
|
-
|
|
1951
|
+
infra = get_infra_snapshot()
|
|
1952
|
+
host_url = created.get("url")
|
|
1953
|
+
response_message = f"Created Cloudflare tunnel for container {vmid}."
|
|
1954
|
+
if host_url:
|
|
1955
|
+
response_message = f"{response_message[:-1]} -> {host_url}."
|
|
1956
|
+
response = {
|
|
1952
1957
|
"event": "cloudflare_tunnel_created",
|
|
1953
1958
|
"ctid": str(vmid),
|
|
1954
1959
|
"success": True,
|
|
1955
|
-
"message":
|
|
1960
|
+
"message": response_message,
|
|
1956
1961
|
"tunnel": created,
|
|
1962
|
+
"infra": infra,
|
|
1957
1963
|
}
|
|
1964
|
+
device_id = message.get("device_id")
|
|
1965
|
+
if device_id:
|
|
1966
|
+
response["device_id"] = device_id
|
|
1967
|
+
return response
|
|
1958
1968
|
|
|
1959
1969
|
|
|
1960
1970
|
class UpdateCloudflareTunnelHandler(SyncHandler):
|
|
@@ -1990,13 +2000,23 @@ class UpdateCloudflareTunnelHandler(SyncHandler):
|
|
|
1990
2000
|
if hostname:
|
|
1991
2001
|
updated_tunnel["url"] = hostname
|
|
1992
2002
|
result = _launch_container_tunnel(proxmox, node, vmid, updated_tunnel)
|
|
1993
|
-
|
|
2003
|
+
infra = get_infra_snapshot()
|
|
2004
|
+
host_url = result.get("url")
|
|
2005
|
+
response_message = f"Updated Cloudflare tunnel for container {vmid}."
|
|
2006
|
+
if host_url:
|
|
2007
|
+
response_message = f"{response_message[:-1]} -> {host_url}."
|
|
2008
|
+
response = {
|
|
1994
2009
|
"event": "cloudflare_tunnel_updated",
|
|
1995
2010
|
"ctid": str(vmid),
|
|
1996
2011
|
"success": True,
|
|
1997
|
-
"message":
|
|
2012
|
+
"message": response_message,
|
|
1998
2013
|
"tunnel": result,
|
|
2014
|
+
"infra": infra,
|
|
1999
2015
|
}
|
|
2016
|
+
device_id = message.get("device_id")
|
|
2017
|
+
if device_id:
|
|
2018
|
+
response["device_id"] = device_id
|
|
2019
|
+
return response
|
|
2000
2020
|
|
|
2001
2021
|
|
|
2002
2022
|
class RemoveCloudflareTunnelHandler(SyncHandler):
|
|
@@ -2009,12 +2029,19 @@ class RemoveCloudflareTunnelHandler(SyncHandler):
|
|
|
2009
2029
|
def execute(self, message: Dict[str, Any]) -> Dict[str, Any]:
|
|
2010
2030
|
vmid = _parse_ctid(message)
|
|
2011
2031
|
_remove_container_tunnel_state(vmid)
|
|
2012
|
-
|
|
2032
|
+
infra = get_infra_snapshot()
|
|
2033
|
+
response = {
|
|
2013
2034
|
"event": "cloudflare_tunnel_removed",
|
|
2014
2035
|
"ctid": str(vmid),
|
|
2015
2036
|
"success": True,
|
|
2016
2037
|
"message": f"Removed Cloudflare tunnel state for container {vmid}.",
|
|
2038
|
+
"tunnel": None,
|
|
2039
|
+
"infra": infra,
|
|
2017
2040
|
}
|
|
2041
|
+
device_id = message.get("device_id")
|
|
2042
|
+
if device_id:
|
|
2043
|
+
response["device_id"] = device_id
|
|
2044
|
+
return response
|
|
2018
2045
|
|
|
2019
2046
|
|
|
2020
2047
|
class ConfigureProxmoxInfraHandler(SyncHandler):
|
portacode/connection/terminal.py
CHANGED
|
@@ -53,11 +53,14 @@ from .handlers import (
|
|
|
53
53
|
ProjectStateGitCommitHandler,
|
|
54
54
|
UpdatePortacodeHandler,
|
|
55
55
|
ConfigureProxmoxInfraHandler,
|
|
56
|
+
CreateCloudflareTunnelHandler,
|
|
56
57
|
CreateProxmoxContainerHandler,
|
|
58
|
+
RemoveCloudflareTunnelHandler,
|
|
57
59
|
RevertProxmoxInfraHandler,
|
|
58
60
|
StartPortacodeServiceHandler,
|
|
59
61
|
StartProxmoxContainerHandler,
|
|
60
62
|
StopProxmoxContainerHandler,
|
|
63
|
+
UpdateCloudflareTunnelHandler,
|
|
61
64
|
RemoveProxmoxContainerHandler,
|
|
62
65
|
)
|
|
63
66
|
from .handlers.project_aware_file_handlers import (
|
|
@@ -482,11 +485,14 @@ class TerminalManager:
|
|
|
482
485
|
# System management handlers
|
|
483
486
|
self._command_registry.register(ConfigureProxmoxInfraHandler)
|
|
484
487
|
self._command_registry.register(CreateProxmoxContainerHandler)
|
|
488
|
+
self._command_registry.register(CreateCloudflareTunnelHandler)
|
|
485
489
|
self._command_registry.register(StartPortacodeServiceHandler)
|
|
486
490
|
self._command_registry.register(StartProxmoxContainerHandler)
|
|
487
491
|
self._command_registry.register(StopProxmoxContainerHandler)
|
|
488
492
|
self._command_registry.register(RemoveProxmoxContainerHandler)
|
|
493
|
+
self._command_registry.register(UpdateCloudflareTunnelHandler)
|
|
489
494
|
self._command_registry.register(RevertProxmoxInfraHandler)
|
|
495
|
+
self._command_registry.register(RemoveCloudflareTunnelHandler)
|
|
490
496
|
self._command_registry.register(UpdatePortacodeHandler)
|
|
491
497
|
|
|
492
498
|
# ---------------------------------------------------------------------
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
portacode/README.md,sha256=4dKtpvR8LNgZPVz37GmkQCMWIr_u25Ao63iW56s7Ke4,775
|
|
2
2
|
portacode/__init__.py,sha256=oB3sV1wXr-um-RXio73UG8E5Xx6cF2ZVJveqjNmC-vQ,1086
|
|
3
3
|
portacode/__main__.py,sha256=jmHTGC1hzmo9iKJLv-SSYe9BSIbPPZ2IOpecI03PlTs,296
|
|
4
|
-
portacode/_version.py,sha256=
|
|
4
|
+
portacode/_version.py,sha256=lNc0ImD-iXjnQNmUBMONgJ_o7DkDwAOhw49jGQrIzEw,719
|
|
5
5
|
portacode/cli.py,sha256=mGLKoZ-T2FBF7IA9wUq0zyG0X9__-A1ao7gajjcVRH8,21828
|
|
6
6
|
portacode/data.py,sha256=5-s291bv8J354myaHm1Y7CQZTZyRzMU3TGe5U4hb-FA,1591
|
|
7
7
|
portacode/keypair.py,sha256=0OO4vHDcF1XMxCDqce61xFTlFwlTcmqe5HyGsXFEt7s,5838
|
|
@@ -12,17 +12,17 @@ portacode/connection/README.md,sha256=f9rbuIEKa7cTm9C98rCiBbEtbiIXQU11esGSNhSMiJ
|
|
|
12
12
|
portacode/connection/__init__.py,sha256=atqcVGkViIEd7pRa6cP2do07RJOM0UWpbnz5zXjGktU,250
|
|
13
13
|
portacode/connection/client.py,sha256=jtLb9_YufqPkzi9t8VQH3iz_JEMisbtY6a8L9U5weiU,14181
|
|
14
14
|
portacode/connection/multiplex.py,sha256=L-TxqJ_ZEbfNEfu1cwxgJ5vUdyRzZjsMy2Kx1diiZys,5237
|
|
15
|
-
portacode/connection/terminal.py,sha256=
|
|
15
|
+
portacode/connection/terminal.py,sha256=b_Ni_rFd4y9QyH9BnTmA8jdnjGA89nLn9PJRUAtE1vc,45387
|
|
16
16
|
portacode/connection/handlers/README.md,sha256=HsLZG1QK1JNm67HsgL6WoDg9nxzKXxwkc5fJPFJdX5g,12169
|
|
17
|
-
portacode/connection/handlers/WEBSOCKET_PROTOCOL.md,sha256=
|
|
18
|
-
portacode/connection/handlers/__init__.py,sha256=
|
|
17
|
+
portacode/connection/handlers/WEBSOCKET_PROTOCOL.md,sha256=5VZSDPvXjtOl-8YZ-2UVtH8WgPnEWe7WB33YPrS8_8Q,104190
|
|
18
|
+
portacode/connection/handlers/__init__.py,sha256=j69jGkf2-mYyCicvYfp2wk8-xB8yqpWktiN5xADXBno,3137
|
|
19
19
|
portacode/connection/handlers/base.py,sha256=oENFb-Fcfzwk99Qx8gJQriEMiwSxwygwjOiuCH36hM4,10231
|
|
20
20
|
portacode/connection/handlers/chunked_content.py,sha256=h6hXRmxSeOgnIxoU8CkmvEf2Odv-ajPrpHIe_W3GKcA,9251
|
|
21
21
|
portacode/connection/handlers/diff_handlers.py,sha256=iYTIRCcpEQ03vIPKZCsMTE5aZbQw6sF04M3dM6rUV8Q,24477
|
|
22
22
|
portacode/connection/handlers/file_handlers.py,sha256=nAJH8nXnX07xxD28ngLpgIUzcTuRwZBNpEGEKdRqohw,39507
|
|
23
23
|
portacode/connection/handlers/project_aware_file_handlers.py,sha256=AqgMnDqX2893T2NsrvUSCwjN5VKj4Pb2TN0S_SuboOE,9803
|
|
24
24
|
portacode/connection/handlers/project_state_handlers.py,sha256=v6ZefGW9i7n1aZLq2jOGumJIjYb6aHlPI4m1jkYewm8,1686
|
|
25
|
-
portacode/connection/handlers/proxmox_infra.py,sha256=
|
|
25
|
+
portacode/connection/handlers/proxmox_infra.py,sha256=mH6xxT9v9X0jwdCBjU3p48lURYisY0T0HPjuzV3eoH8,76070
|
|
26
26
|
portacode/connection/handlers/registry.py,sha256=qXGE60sYEWg6ZtVQzFcZ5YI2XWR6lMgw4hAL9x5qR1I,6181
|
|
27
27
|
portacode/connection/handlers/session.py,sha256=uNGfiO_1B9-_yjJKkpvmbiJhIl6b-UXlT86UTfd6WYE,42219
|
|
28
28
|
portacode/connection/handlers/system_handlers.py,sha256=fr12QpOr_Z8KYGUU-AYrTQwRPAcrLK85hvj3SEq1Kw8,14757
|
|
@@ -65,7 +65,7 @@ portacode/utils/__init__.py,sha256=NgBlWTuNJESfIYJzP_3adI1yJQJR0XJLRpSdVNaBAN0,3
|
|
|
65
65
|
portacode/utils/diff_apply.py,sha256=4Oi7ft3VUCKmiUE4VM-OeqO7Gk6H7PF3WnN4WHXtjxI,15157
|
|
66
66
|
portacode/utils/diff_renderer.py,sha256=S76StnQ2DLfsz4Gg0m07UwPfRp8270PuzbNaQq-rmYk,13850
|
|
67
67
|
portacode/utils/ntp_clock.py,sha256=VqCnWCTehCufE43W23oB-WUdAZGeCcLxkmIOPwInYHc,2499
|
|
68
|
-
portacode-1.4.15.
|
|
68
|
+
portacode-1.4.15.dev4.dist-info/licenses/LICENSE,sha256=2FGbCnUDgRYuQTkB1O1dUUpu5CVAjK1j4_p6ack9Z54,1066
|
|
69
69
|
test_modules/README.md,sha256=Do_agkm9WhSzueXjRAkV_xEj6Emy5zB3N3VKY5Roce8,9274
|
|
70
70
|
test_modules/__init__.py,sha256=1LcbHodIHsB0g-g4NGjSn6AMuCoGbymvXPYLOb6Z7F0,53
|
|
71
71
|
test_modules/test_device_online.py,sha256=QtYq0Dq9vME8Gp2O4fGSheqVf8LUtpsSKosXXk56gGM,1654
|
|
@@ -91,8 +91,8 @@ testing_framework/core/playwright_manager.py,sha256=Tw46qwxIhOFkS48C2IWIQHHNpEe-
|
|
|
91
91
|
testing_framework/core/runner.py,sha256=j2QwNJmAxVBmJvcbVS7DgPJUKPNzqfLmt_4NNdaKmZU,19297
|
|
92
92
|
testing_framework/core/shared_cli_manager.py,sha256=BESSNtyQb7BOlaOvZmm04T8Uezjms4KCBs2MzTxvzYQ,8790
|
|
93
93
|
testing_framework/core/test_discovery.py,sha256=2FZ9fJ8Dp5dloA-fkgXoJ_gCMC_nYPBnA3Hs2xlagzM,4928
|
|
94
|
-
portacode-1.4.15.
|
|
95
|
-
portacode-1.4.15.
|
|
96
|
-
portacode-1.4.15.
|
|
97
|
-
portacode-1.4.15.
|
|
98
|
-
portacode-1.4.15.
|
|
94
|
+
portacode-1.4.15.dev4.dist-info/METADATA,sha256=_aGI2IBtnFRpsBNluIGdWOACE0w1-ixtszIbrAItIis,13051
|
|
95
|
+
portacode-1.4.15.dev4.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
96
|
+
portacode-1.4.15.dev4.dist-info/entry_points.txt,sha256=lLUUL-BM6_wwe44Xv0__5NQ1BnAz6jWjSMFvZdWW3zU,48
|
|
97
|
+
portacode-1.4.15.dev4.dist-info/top_level.txt,sha256=TGhTYUxfW8SyVZc_zGgzjzc24gGT7nSw8Qf73liVRKM,41
|
|
98
|
+
portacode-1.4.15.dev4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|