Compare commits
9 Commits
448ffa443d
...
0.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8fe5d66d4 | ||
| 4ee7a56695 | |||
|
eb46889157
|
|||
|
|
48df6e4534 | ||
| 76ef047551 | |||
|
2d8dc06fa1
|
|||
|
11ae93ed3c
|
|||
|
ac5521618b
|
|||
|
64866079d7
|
25
CHANGELOG.md
25
CHANGELOG.md
@@ -2,6 +2,31 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [0.4.1] - 2026-02-28
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- [`eb46889`](https://gitea.pufereq.pl/judas/judas_client/commit/eb4688915747e2dcff3b331618c2b0185f1b611d) **connector.py**: fix `address already in use` error
|
||||||
|
|
||||||
|
## [0.4.0] - 2026-02-28
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- [`ac55216`](https://gitea.pufereq.pl/judas/judas_client/commit/ac5521618ba89b25fd31f09357470ed96cd405cf) **client.py**: add custom ID support with `JUDAS_ID` env variable
|
||||||
|
- [`6486607`](https://gitea.pufereq.pl/judas/judas_client/commit/64866079d7e2087be7dd8588b22be73006605a91) **connector.py**: handle `CONTROL.CLOSE` msgs
|
||||||
|
|
||||||
|
### Miscellaneous Tasks
|
||||||
|
|
||||||
|
- [`448ffa4`](https://gitea.pufereq.pl/judas/judas_client/commit/448ffa443d0b7b464d3f70f81a0b1b3f17765484) **uv.lock**: update depedencies for Python 3.14
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- [`11ae93e`](https://gitea.pufereq.pl/judas/judas_client/commit/11ae93ed3ceac148097f4246e53e2150a653fcf8) **client.py**: rename `Client.mac_address` -> `Client.id`
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
- [`2d8dc06`](https://gitea.pufereq.pl/judas/judas_client/commit/2d8dc06fa1087bb1ed968d798dc82cd0c6159e16) **uv.lock**: update judas_protocol to 0.6.0
|
||||||
|
|
||||||
## [0.3.0] - 2025-11-30
|
## [0.3.0] - 2025-11-30
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "judas_client"
|
name = "judas_client"
|
||||||
version = "0.3.0"
|
version = "0.4.1"
|
||||||
description = "A client for judas, a remote PC fleet management system."
|
description = "A client for judas, a remote PC fleet management system."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = []
|
authors = []
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging as lg
|
import logging as lg
|
||||||
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from judas_protocol import Message
|
from judas_protocol import Message
|
||||||
@@ -29,11 +30,18 @@ class Client:
|
|||||||
self.server_host: str = server_host
|
self.server_host: str = server_host
|
||||||
self.server_port: int = server_port
|
self.server_port: int = server_port
|
||||||
|
|
||||||
self.mac_address: str = self._get_mac_address()
|
if "JUDAS_ID" in os.environ:
|
||||||
self.logger.debug(f"MAC address: {self.mac_address}")
|
self.id: str = os.environ["JUDAS_ID"]
|
||||||
|
self.logger.debug(
|
||||||
|
f"Using ID from environment variable JUDAS_ID: {self.id}"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.id = self._get_mac_address()
|
||||||
|
|
||||||
|
self.logger.debug(f"ID: {self.id}")
|
||||||
|
|
||||||
self.connector: Connector = Connector(
|
self.connector: Connector = Connector(
|
||||||
mac_address=self.mac_address,
|
mac_address=self.id,
|
||||||
host=self.server_host,
|
host=self.server_host,
|
||||||
port=self.server_port,
|
port=self.server_port,
|
||||||
on_message=self.handle_message,
|
on_message=self.handle_message,
|
||||||
@@ -63,5 +71,5 @@ class Client:
|
|||||||
|
|
||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
"""Run the client."""
|
"""Run the client."""
|
||||||
self.logger.info(f"Starting Client ({self.mac_address})...")
|
self.logger.info(f"Starting Client ({self.id})...")
|
||||||
self.connector.run()
|
self.connector.run()
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class Connector:
|
|||||||
self.socket: socket.socket = socket.socket(
|
self.socket: socket.socket = socket.socket(
|
||||||
socket.AF_INET, socket.SOCK_STREAM
|
socket.AF_INET, socket.SOCK_STREAM
|
||||||
)
|
)
|
||||||
|
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||||
self.socket.setblocking(False)
|
self.socket.setblocking(False)
|
||||||
|
|
||||||
self.selector.register(
|
self.selector.register(
|
||||||
@@ -174,8 +175,17 @@ class Connector:
|
|||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
message: Message = Message.from_bytes(message_bytes)
|
message: Message = Message.from_bytes(message_bytes)
|
||||||
# handle incoming ACKs
|
|
||||||
if (
|
if (
|
||||||
|
message.category == Category.CONTROL
|
||||||
|
and message.action == ControlAction.CLOSE
|
||||||
|
):
|
||||||
|
self.logger.warning(
|
||||||
|
"[!] Received CLOSE command from server, shutting down."
|
||||||
|
)
|
||||||
|
self.running = False
|
||||||
|
break
|
||||||
|
# handle incoming ACKs
|
||||||
|
elif (
|
||||||
message.category == Category.CONTROL
|
message.category == Category.CONTROL
|
||||||
and message.action == ControlAction.ACK
|
and message.action == ControlAction.ACK
|
||||||
):
|
):
|
||||||
|
|||||||
6
uv.lock
generated
6
uv.lock
generated
@@ -275,7 +275,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "judas-client"
|
name = "judas-client"
|
||||||
version = "0.3.0"
|
version = "0.4.1"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "judas-protocol" },
|
{ name = "judas-protocol" },
|
||||||
@@ -318,8 +318,8 @@ test = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "judas-protocol"
|
name = "judas-protocol"
|
||||||
version = "0.5.0"
|
version = "0.6.0"
|
||||||
source = { git = "https://gitea.pufereq.pl/judas/judas_protocol.git#c48b69ecee16f5824ffd8bce8921341d5fa326b7" }
|
source = { git = "https://gitea.pufereq.pl/judas/judas_protocol.git#d16c1914ba343aed300f1c5fae0201370c3274de" }
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "markdown-it-py"
|
name = "markdown-it-py"
|
||||||
|
|||||||
Reference in New Issue
Block a user