Compare commits

25 Commits

Author SHA1 Message Date
github-actions[bot]
e54996937b chore(release): 0.2.0 2025-09-19 13:37:05 +00:00
f407d5c2ba Merge pull request 'chore(release): 0.2.0' (#2) from release/0.2.0 into main
Reviewed-on: #2
2025-09-19 13:34:37 +00:00
9d751b4fac build: add ruff lint depedency 2025-09-19 14:57:29 +02:00
bce62f6973 style(connector.py): order imports 2025-09-19 14:52:39 +02:00
6953922b3b style(__main__.py): order imports 2025-09-19 14:52:27 +02:00
c63b7f9f4d build: add isort lint depedency 2025-09-19 14:51:29 +02:00
30b2305dd1 fix(connector.py): fix hanging ACK double check in send_hello() 2025-08-30 18:42:33 +02:00
a25908bf46 style(connector.py): add empty line for clarity 2025-08-30 18:41:13 +02:00
8d06775c27 feat(connector.py): add no_check_ack arg to send() 2025-08-30 18:40:47 +02:00
5d5dbd371f feat(connector.py): ensure sent data is ACK'd in send() 2025-08-30 18:33:21 +02:00
6efc7754f9 fix(connector.py): avoid recursion on failure in send() 2025-08-30 18:28:46 +02:00
github-actions[bot]
f89d9c41f8 chore(release): 0.1.0 2025-08-28 22:44:55 +00:00
fa223cbbde Merge pull request 'chore(release): 0.1.0' (#1) from release/0.1.0 into main
Reviewed-on: #1
2025-08-28 22:44:30 +00:00
5844d4b521 feat(connector.py): require ACK for HELLO message, retry if not received 2025-08-29 00:40:35 +02:00
eef39bc2c0 chore(connector.py): remove redundant hello send in run() 2025-08-28 23:26:19 +02:00
4496fc60aa feat(connector.py): add reconnect() method to simplify reconnecting to server 2025-08-28 23:25:25 +02:00
25f6ebbf59 feat(connector.py): add send_hello() method 2025-08-28 23:24:39 +02:00
432ef9e242 refactor(connector.py): change max retry_interval to more sensible 30 secs 2025-08-28 23:21:54 +02:00
49f2d69e0b fix(connector.py): return empty bytestring if no data in receive() 2025-08-28 20:52:23 +02:00
43e61e7e68 refactor(connector.py): move time.sleep to the top of Connector._loop() to avoid infinite immediate retrying if data empty 2025-08-28 20:51:35 +02:00
18e60ee8c7 chore(.vscode/launch.json): add 'Debug client' preset 2025-08-28 19:45:57 +02:00
8c30c4328d feat(connector.py): add Connector class 2025-08-28 19:45:20 +02:00
eec14b91fd feat(__main__.py): add __main__.py 2025-08-28 19:45:00 +02:00
84d4b98214 build(uv.lock): add depedency on judas_protocol 2025-08-28 19:43:14 +02:00
88bba5c449 build(pyproject.toml): add depedency on judas_protocol 2025-08-28 19:42:52 +02:00
6 changed files with 307 additions and 136 deletions

13
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug client",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/src/judas_client/__main__.py",
"console": "integratedTerminal",
"justMyCode": true
}
]
}

View File

@@ -2,166 +2,57 @@
All notable changes to this project will be documented in this file.
## [0.2.0] - 2025-08-26
## [0.2.0] - 2025-09-19
### Bug Fixes
- [`1fa3550`](https://github.com/pufereq/template-repo/commit/1fa355089df36404fc5128620674f8a535e6d2c5) **panel.py**: fix panel route to be at `/panel` instead of `/panel/`
- [`d8405fa`](https://github.com/pufereq/template-repo/commit/d8405fa36376a29b1f5ae99f571f2adc8a6cc978) **server.py**: fix placeholder naming to be consistent
- [`8ad55ee`](https://github.com/pufereq/template-repo/commit/8ad55eed10dcc7d2fb849f3643dc805903f560a7) **__main__.py**: fix wrong import path
- [`23a53f7`](https://github.com/pufereq/template-repo/commit/23a53f79a073d4c88756a347312340f59d31b0da) **web_server.py**: fix server error when using /stream
- [`30b2305`](https://gitea.pufereq.pl/judas/judas_client/commit/30b2305dd1c988bfd6c7b38d125a6382bc75c84b) **connector.py**: fix hanging ACK double check in `send_hello()`
- [`6efc775`](https://gitea.pufereq.pl/judas/judas_client/commit/6efc7754f998e3b27e7dda736c8f1a5fafe55d1d) **connector.py**: avoid recursion on failure in `send()`
### Features
- [`9f74246`](https://github.com/pufereq/template-repo/commit/9f74246157717216b7687b0ca5cb453fba60405e) **web_server.py**: use socketio
- [`84ce509`](https://github.com/pufereq/template-repo/commit/84ce50963b7811c45e0c7fe94a1e66d71da70060) **routes/api.py**: add API route
- [`dbb464e`](https://github.com/pufereq/template-repo/commit/dbb464e41ccac68854a30084122aaa7659272081) **__main__.py**: call `BackendServer.run()`
- [`b8f5fdc`](https://github.com/pufereq/template-repo/commit/b8f5fdc794fe831386fb74e5ecb872f9ea118ec2) **server.py**: create a thread for _poll_loop
- [`a494b60`](https://github.com/pufereq/template-repo/commit/a494b606a5bf796685b1c0757c69d63d62e5e8a2) **web_server.py**: add `WEB_SERVER` and `BACKEND` app.configs
- [`4285da4`](https://github.com/pufereq/template-repo/commit/4285da4fa8be01e29041ec31bdf451d90f3e9825) **web_server.py**: add BackendServer reference to webserver
- [`14450ba`](https://github.com/pufereq/template-repo/commit/14450ba70df1b6d7effeb66407db2a4f03846404) **__main__.py**: init BackendServer in __main__
- [`2964ac7`](https://github.com/pufereq/template-repo/commit/2964ac76442425ab0078366cbe0f4162bab87638) **backend/server.py**: add placeholder backend
- [`38da1f4`](https://github.com/pufereq/template-repo/commit/38da1f476e3509d8c57b1c0a298e21bc1536c6d4) **templates/login.html**: autofocus password field
- [`d91f135`](https://github.com/pufereq/template-repo/commit/d91f135d5361ab91c55c43303e4eb2ae8e688ea2) **user.py**: add user management
- [`c1e20e5`](https://github.com/pufereq/template-repo/commit/c1e20e55245fa199d494453c9adf59addd232b86) **routes/__init__.py**: add __init__.py
- [`d56256f`](https://github.com/pufereq/template-repo/commit/d56256f6816b6f0043791bcb288264554cd68cf0) **routes/panel.py**: add panel.py route blueprint
- [`bbaffb3`](https://github.com/pufereq/template-repo/commit/bbaffb344fe0d519d2c535dc61902514acb3db9a) **routes/auth.py**: add auth.py route blueprint
- [`50be48d`](https://github.com/pufereq/template-repo/commit/50be48dba4e895a73b09c9af32fa27268df7561a) **routes/index.py**: add index.py route blueprint
- [`44df495`](https://github.com/pufereq/template-repo/commit/44df49509691505d9ec749395bc330a23e72fd38) **palette.css**: add catppuccin color palette
- [`8dbbea3`](https://github.com/pufereq/template-repo/commit/8dbbea3f56894753edcf7acdd0961634fcac8732) **__main__.py**: add __main__.py
### Miscellaneous Tasks
- [`89b6c1e`](https://github.com/pufereq/template-repo/commit/89b6c1ee835f7bf7cc8511683a0637f893daec25) **release.yaml**: update with latest pufereq/python-template release.yaml
- [`860ce5c`](https://github.com/pufereq/template-repo/commit/860ce5c836ec459b6ae70adf5583d9f5b6f8858f) **panel.py**: remove unnecesarry imports
- [`c628498`](https://github.com/pufereq/template-repo/commit/c628498637ab2a3d3554ee1e80a9872ecfd0d5e0) **__main__.py**: change log format
- [`90094e9`](https://github.com/pufereq/template-repo/commit/90094e9c4380c9f516e1134b75f13fac775d9cd0) **web_server.py**: remove LoginManager from `self.app.config`
- [`5a4b5dd`](https://github.com/pufereq/template-repo/commit/5a4b5ddd82bce3de8198dd2955c71edf5625d131) **backend/__init__.py**: add BackendServer to __all__
- [`1d00d5f`](https://github.com/pufereq/template-repo/commit/1d00d5f4f5cecb5c7e6b65347a29b3bfdfa48ddd) **routes/auth.py**: make login fail message more ambigiuous
- [`a3e9aed`](https://github.com/pufereq/template-repo/commit/a3e9aed6f4caecf2b6c707ae5b87f395e788ccc3) **web_server.py**: add `web server` to initial loggin to avoid confusion
- [`a32df2f`](https://github.com/pufereq/template-repo/commit/a32df2fd67a038b7bf147e83cbcca96498b89d58) **templates/stream.html**: remove stream.html template
- [`1901441`](https://github.com/pufereq/template-repo/commit/190144194887865716977acc51971323ab0e0bdf) **py.typed**: add py.typed
- [`f8f74cc`](https://github.com/pufereq/template-repo/commit/f8f74ccd4b27c9dc85c58b76d2328e9e7a288403) **routes/__init__.py**: add __init__.py
- [`89dd67b`](https://github.com/pufereq/template-repo/commit/89dd67b4897cfda2af9387d0f3bd6cdaa531d85e) **backend/__init__.py**: add __init__.py
- [`dbc61ac`](https://github.com/pufereq/template-repo/commit/dbc61ac6b73e821ba3ba6987bda68d8b84089aec) **web/__init__.py**: add web/__init__.py
### Refactor
- [`e6cc1d9`](https://github.com/pufereq/template-repo/commit/e6cc1d901e2eaaef2c65e9cf02ee4c6b1fd2d425) **panel.html**: rewrite panel.html template
- [`9e71270`](https://github.com/pufereq/template-repo/commit/9e71270e41aaa4e241e82d1688a29d1a9823fed4) **panel.py**: remove unnecesarry args to `render_template`
- [`1140052`](https://github.com/pufereq/template-repo/commit/11400520c984bb6efb85f3a6ed8acfd2a5cfe177) **server.py**: fix method naming and add logging
- [`77b6bd0`](https://github.com/pufereq/template-repo/commit/77b6bd07327cfe9750b18bcc7fcdb980b127ab27) **web_server.py**: rewrite to use OOP
- [`8b418a7`](https://github.com/pufereq/template-repo/commit/8b418a7d52c0a32d967da735bc6c519cf2808804) **templates/panel.html**: adapt urls for blueprints
- [`3e1fe9f`](https://github.com/pufereq/template-repo/commit/3e1fe9fa1e53a0376b2073fd208470bfb57ea1b0) **templates/login.html**: adapt urls for blueprints
- [`bd9d95b`](https://github.com/pufereq/template-repo/commit/bd9d95b741e1bc032d0fa7c816f802ce678b5645) **templates/index.html**: adapt urls for blueprints
- [`4baf29e`](https://github.com/pufereq/template-repo/commit/4baf29eb4afba7cf2cfab4e0ab5853d0c94c6ed1) **templates/details.html**: adapt urls for blueprints
- [`fc5dc23`](https://github.com/pufereq/template-repo/commit/fc5dc23c0e222db257f7fb55d0b878db5c3a255d) **style.css**: use new palette
- [`e575e8a`](https://github.com/pufereq/template-repo/commit/e575e8a15dd36616ac0d722e13e90a2df59af8b1) **.vscode/launch.json**: use __main__.py for running web server
- [`8d06775`](https://gitea.pufereq.pl/judas/judas_client/commit/8d06775c276089667d9bcdf679e89d9063834036) **connector.py**: add `no_check_ack` arg to `send()`
- [`5d5dbd3`](https://gitea.pufereq.pl/judas/judas_client/commit/5d5dbd371f60f6049a3abb397a8254a9e72305bc) **connector.py**: ensure sent data is ACK'd in `send()`
### Styling
- [`3bcffaa`](https://github.com/pufereq/template-repo/commit/3bcffaafab8ed9bd2f5cf0380d560ea1dc70616b) **style.css**: format w/ prettier
- [`055ab10`](https://github.com/pufereq/template-repo/commit/055ab10ab702094c8a07f8e5317098e0f95eaffa) **__main__.py**: add typing
- [`9949179`](https://github.com/pufereq/template-repo/commit/99491799970e28ec488dee0f9958ea885d5b7383) **login.html**: format
- [`6a07272`](https://github.com/pufereq/template-repo/commit/6a072724f293e52d0d9eaef5ca70b92be05c115b) **index.html**: format
- [`b79f3f3`](https://github.com/pufereq/template-repo/commit/b79f3f3387b15726a2b42fb17f2355fdb97a4a4a) **details.html**: format with prettier
- [`5fb6920`](https://github.com/pufereq/template-repo/commit/5fb69204361379dab44c426c61a170baa1364280) **.vscode/settings.json**: fix indentation
- [`c2e1984`](https://github.com/pufereq/template-repo/commit/c2e198495930f667eb8d777299dfcf2e83f88301) **web_server.py**: fix typing errors
- [`bce62f6`](https://gitea.pufereq.pl/judas/judas_client/commit/bce62f6973aa357e308d976e52c3000c3070d608) **connector.py**: order imports
- [`6953922`](https://gitea.pufereq.pl/judas/judas_client/commit/6953922b3b5f8f7f5013b820d0a0c4e5ff4c6b8d) **__main__.py**: order imports
- [`a25908b`](https://gitea.pufereq.pl/judas/judas_client/commit/a25908bf46aa47446cc9354bf1c60f23a3f01cea) **connector.py**: add empty line for clarity
### Build
- [`786c43a`](https://github.com/pufereq/template-repo/commit/786c43ae06f0550d589e74c94b14cd1a9b1136c6) **uv.lock**: add `flask-socketio` depedency
- [`309efe0`](https://github.com/pufereq/template-repo/commit/309efe074b24d9964dd7d2b767e85d533d526006) **pyproject.toml**: add `flask-socketio` depedency
- [`6bed7da`](https://github.com/pufereq/template-repo/commit/6bed7da165f3c361d938d52ba94b3e2e15894d76) **pyproject.toml**: use basic type checking to kinda supress flask_login's nonexistent typing
- [`9d751b4`](https://gitea.pufereq.pl/judas/judas_client/commit/9d751b4fac67940240fdf429ec05ed50d6f63266) add ruff lint depedency
- [`c63b7f9`](https://gitea.pufereq.pl/judas/judas_client/commit/c63b7f9f4d7e69abdcd574e08a49831013cbe551) add isort lint depedency
## [0.1.1] - 2025-08-09
### Miscellaneous Tasks
- [`8b6bf1e`](https://github.com/pufereq/template-repo/commit/8b6bf1e91366d76ee3203b508b895e4b75d7f845) **.vscode/launch.json**: use shell instead of debugpy for running flask
## [0.1.0] - 2025-08-09
## [0.1.0] - 2025-08-28
### Bug Fixes
- [`947adda`](https://github.com/pufereq/template-repo/commit/947adda4dac96dba545b795fbb71038642c8fe9a) **style.css**: fix text color on hover
### Documentation
- [`c6e9df1`](https://github.com/pufereq/template-repo/commit/c6e9df1f075ed8b997dd9034afcf6e3e281c48a3) **CODE_OF_CONDUCT.md**: add CoC
- [`49f2d69`](https://gitea.pufereq.pl/judas/judas_client/commit/49f2d69e0bc6a5b0203025dec5d208e4808d04a4) **connector.py**: return empty bytestring if no data in `receive()`
### Features
- [`f3c8449`](https://github.com/pufereq/template-repo/commit/f3c844929e585cff746e45077f5e4a77474b2722) **web_server.py**: remove redirect when logged in and trying to access `/`
- [`c41f954`](https://github.com/pufereq/template-repo/commit/c41f95497cc84b03350579bd6dd692734b9f7f89) **index.html**: add go to panel button if logged in
- [`8243ce2`](https://github.com/pufereq/template-repo/commit/8243ce22531cd3e80a8e71b0b120f36169d4e391) **style.css**: add button container class
- [`9847979`](https://github.com/pufereq/template-repo/commit/9847979f43c779af107193128133dae4b3e94070) **style.css**: add link class
- [`c0eb4e0`](https://github.com/pufereq/template-repo/commit/c0eb4e0a6dc2bb1d31c73ded8d90d3a110d18427) **style.css**: style details table
- [`ec6ed47`](https://github.com/pufereq/template-repo/commit/ec6ed477b9053007c23597518e8d1eb6adddf1aa) **login.html**: display error if provided
- [`95e40a4`](https://github.com/pufereq/template-repo/commit/95e40a412887493477035faa7e17b3cd5a5e7e39) **style.css**: add error container class
- [`d998b85`](https://github.com/pufereq/template-repo/commit/d998b85f9f103c472dc27eb6dc95614dcdcd8e4a) **style.css**: make all links pretty
- [`c0f51cb`](https://github.com/pufereq/template-repo/commit/c0f51cbaaf56ec931b5a577effd8190eb0d0cf04) **style.css**: add nord colors as variables for easy use
- [`6872348`](https://github.com/pufereq/template-repo/commit/6872348375270906d39b7154b2571baa504575e2) **panel.html**: change bg color based on status
- [`7c98d16`](https://github.com/pufereq/template-repo/commit/7c98d16cc2391c0ab22a9727887fa66d29b19b20) **panel.html**: add description and classes to table
- [`3709a42`](https://github.com/pufereq/template-repo/commit/3709a42e6416632daa9194d0346bbd7106686660) **style.css**: style panel table
- [`7b09a72`](https://github.com/pufereq/template-repo/commit/7b09a72d5cafc783e70d6f407627a2273a6b2c33) **style.css**: replace colors with var values
- [`5031799`](https://github.com/pufereq/template-repo/commit/503179907249ab8c50ed35d7f5181f7cbc24ef53) **login.html**: add basic login page
- [`6ec1af2`](https://github.com/pufereq/template-repo/commit/6ec1af2cf773bcd8bf9b3e64d639bc839c1b2802) **index.html**: add pretty typewriter effect to header on main
- [`ff911bc`](https://github.com/pufereq/template-repo/commit/ff911bc8bc3427262af8872efb96232c1ece5595) **index.html**: add welcome text and a disclaimer
- [`446e5fb`](https://github.com/pufereq/template-repo/commit/446e5fbc04ad9f7303e2327e859dd6be992d3d5b) **index.html**: add link to homepage to app name in header
- [`368769e`](https://github.com/pufereq/template-repo/commit/368769e1a7a5c12bcf9130245fba4b3e4d9b28e5) **stream.html**: add stream page template
- [`6ba91e5`](https://github.com/pufereq/template-repo/commit/6ba91e5ba6ad4aa2993abafb84677ac8ec689217) **panel.html**: add panel page template
- [`b125a30`](https://github.com/pufereq/template-repo/commit/b125a3008f8871a8f6dbe2c3fad8ca883aea7a12) **index.html**: add index page template
- [`e4620c8`](https://github.com/pufereq/template-repo/commit/e4620c81b2cbbedeb5decb192995494562a36f09) **details.html**: add details page template
- [`1b39dce`](https://github.com/pufereq/template-repo/commit/1b39dce6986e62ea7be5424f1656772b70fcc620) **style.css**: add stylesheet
- [`9edae70`](https://github.com/pufereq/template-repo/commit/9edae70618fae15d3ba138c09427c069cddb1465) **web_server.py**: add web_server.py
- [`5844d4b`](https://gitea.pufereq.pl/judas/judas_client/commit/5844d4b52123a3e28be79c980f037e922656fe58) **connector.py**: require ACK for HELLO message, retry if not received
- [`4496fc6`](https://gitea.pufereq.pl/judas/judas_client/commit/4496fc60aa8e048870ca5a958f3423c0e3c53f4f) **connector.py**: add `reconnect()` method to simplify reconnecting to server
- [`25f6ebb`](https://gitea.pufereq.pl/judas/judas_client/commit/25f6ebbf59c5cbeb7a0c9ea3de764f0552361dd3) **connector.py**: add `send_hello()` method
- [`8c30c43`](https://gitea.pufereq.pl/judas/judas_client/commit/8c30c4328dffe2064019f468a6138d66f31c2d89) **connector.py**: add `Connector` class
- [`eec14b9`](https://gitea.pufereq.pl/judas/judas_client/commit/eec14b91fdd1f254afd13c5247cff229b629b8b1) **__main__.py**: add `__main__.py`
### Miscellaneous Tasks
- [`b4b0e91`](https://github.com/pufereq/template-repo/commit/b4b0e9145075d30e3c06258756541ffac5de4766) **release.yaml**: add release workflow
- [`a5c1490`](https://github.com/pufereq/template-repo/commit/a5c1490aca2328999b1c675320eec95052b0242e) **.gitignore**: expand gitignore
- [`816582f`](https://github.com/pufereq/template-repo/commit/816582f61a551dbc2efdfabb7bfdba711f5743cb) **.vscode/launch.json**: fix formatting errors
- [`8459eb8`](https://github.com/pufereq/template-repo/commit/8459eb836f040305612cafbb977ad803fc7db181) **.vscode/settings.json**: set type checking mode to standard
- [`2fc702a`](https://github.com/pufereq/template-repo/commit/2fc702a482380bd56ffc6c3a0769fca06569aebd) **index.html**: add class link to login element
- [`8c99a28`](https://github.com/pufereq/template-repo/commit/8c99a28a8528e21928cc7d8535c5119d08535fb4) **.vscode/launch.json**: run flask on 0.0.0.0
- [`06ea024`](https://github.com/pufereq/template-repo/commit/06ea0246f51742060ce4051d609dbce7d716fdf8) **web_server.py**: add more pc placeholders
- [`2786f39`](https://github.com/pufereq/template-repo/commit/2786f39b9baf850a8438fb483a0346b8cd1ad1b7) **.vscode/launch.json**: add launch task for flask app
- [`1ab8bb8`](https://github.com/pufereq/template-repo/commit/1ab8bb866d6bec2787f76443b76e84a2a7865398) **.vscode/settings.json**: add auto-import completion settings
- [`324c404`](https://github.com/pufereq/template-repo/commit/324c4046f7f0c9ceab6b839be754abf8ac198130) initial commit
- [`eef39bc`](https://gitea.pufereq.pl/judas/judas_client/commit/eef39bc2c0f7f8488867d0c6b8d2eb6224c72454) **connector.py**: remove redundant hello send in `run()`
- [`18e60ee`](https://gitea.pufereq.pl/judas/judas_client/commit/18e60ee8c7d7d7cdf700456f6975d9e17e647e29) **.vscode/launch.json**: add 'Debug client' preset
- [`52eb609`](https://gitea.pufereq.pl/judas/judas_client/commit/52eb6094f9b3c14cdd14e5e9364c97297acaf641) initial commit
### Refactor
- [`40d0edd`](https://github.com/pufereq/template-repo/commit/40d0edd5071f1562a3a980ac4801124ff072e877) move `judas_server/` into `src/judas_server/`
- [`26352ca`](https://github.com/pufereq/template-repo/commit/26352ca54c763a83a6dde3ca49b5479e145c8380) **index.html**: make logout a button
- [`ea0f5f9`](https://github.com/pufereq/template-repo/commit/ea0f5f9a834eaed2f0b530fc83e2ce80f7406e3d) **details.html**: shorten heading text
- [`6979fe1`](https://github.com/pufereq/template-repo/commit/6979fe17e7f252a5168e9e53ec4fd085d488eaac) **style.css**: replace hex with var value
- [`fe82dad`](https://github.com/pufereq/template-repo/commit/fe82dad557773a3dd29871863c81dbbd634cbd1f) **details.html**: change table and layout of buttons
- [`7c7e762`](https://github.com/pufereq/template-repo/commit/7c7e762f0041f7eb28768dd934e14e0ea345d21b) **panel.html**: remove breaking line
- [`e07a379`](https://github.com/pufereq/template-repo/commit/e07a379036649903bad2f92acfd47b9e2dee2c4c) **web_server.py**: display pretty error if password incorrect
- [`960a7dd`](https://github.com/pufereq/template-repo/commit/960a7dd4bf936ad58c29b013c2b5a7673f13945e) **index.html**: put elements in main into divs to not screw up layout
- [`1f0fcc7`](https://github.com/pufereq/template-repo/commit/1f0fcc71c91d70973233adf293a3bf4a2b7b41b4) **style.css**: make main a flex container
- [`cde27d3`](https://github.com/pufereq/template-repo/commit/cde27d37e3319ccc6b370f0628c96437a42ace69) **web_server.py**: make status lowercase
- [`feb7a71`](https://github.com/pufereq/template-repo/commit/feb7a7181626cf58586c27ea198ae0ac5f7e03f3) **web_server.py**: redirect from `/` to `/panel` if logged in
- [`e15f02b`](https://github.com/pufereq/template-repo/commit/e15f02be05f4c22672ea0f61df7f57ceabd96907) **web_server.py**: render login.html instead of bare form in `/login`
- [`26fac14`](https://github.com/pufereq/template-repo/commit/26fac14802df69884cc0329ffa06aa10faffebd3) **stream.html**: make logout button pretty and fix name in header
- [`75694f9`](https://github.com/pufereq/template-repo/commit/75694f920073d283bed137989f6b56a4b23ff9f7) **details.html**: make logout button pretty and fix name in header
- [`522c147`](https://github.com/pufereq/template-repo/commit/522c14793aa26cb6e6a8e272dfa514c247c65518) **panel.html**: make logout button pretty and fix name in header
- [`04c46f1`](https://github.com/pufereq/template-repo/commit/04c46f1e982f5dd14e91972dbcb54039bc0b1286) **style.css**: add barebones stylesheet
### Styling
- [`5c4441a`](https://github.com/pufereq/template-repo/commit/5c4441a35f136c0c56120a8397de209d8067d25f) **style.css**: remove empty line
- [`f3f521e`](https://github.com/pufereq/template-repo/commit/f3f521efe241635c3995680cf579ba95798a13a1) **web_server.py**: fix type in `index()`
- [`9a074f1`](https://github.com/pufereq/template-repo/commit/9a074f17d87986d69d8f8a0b7367a436aa59be1c) **index.html**: add newline at end of file
- [`432ef9e`](https://gitea.pufereq.pl/judas/judas_client/commit/432ef9e2428c198497be28bc9bc53e7b7847cb05) **connector.py**: change max retry_interval to more sensible 30 secs
- [`43e61e7`](https://gitea.pufereq.pl/judas/judas_client/commit/43e61e7e681a7a133bc7b66aae722ad80abdb594) **connector.py**: move time.sleep to the top of `Connector._loop()` to avoid infinite immediate retrying if data empty
### Build
- [`de463b8`](https://github.com/pufereq/template-repo/commit/de463b8c713c87c1d37a19976fcb7432f0021401) **pyproject.toml**: make pyproject.toml compatible with uv
- [`30d9434`](https://github.com/pufereq/template-repo/commit/30d94348d7cdba23efe76303d42e39064cd2eefb) **cliff.toml**: add git-cliff config
- [`8968d7e`](https://github.com/pufereq/template-repo/commit/8968d7ec081df328a02a0dc3d4cf7643b19accf2) **pdm.lock**: remove pdm lockfile
- [`ad479fe`](https://github.com/pufereq/template-repo/commit/ad479fe0d7ab87edf37101d1234d5ba26f22b585) **pyproject.toml**: rename `start` script to `web`
- [`04d4e97`](https://github.com/pufereq/template-repo/commit/04d4e97f626fe3ddbbed1ab6586da40a439567ab) **pyproject.toml**: add flask start script
- [`9acc788`](https://github.com/pufereq/template-repo/commit/9acc788b34181c448ed08b2903bb97d14cf00e66) **pdm.lock**: add pdm lockfile
- [`7de428c`](https://github.com/pufereq/template-repo/commit/7de428c4757fcecfa1a6a2582ce042324433a67f) **pyproject.toml**: add flask and flask-login
- [`84d4b98`](https://gitea.pufereq.pl/judas/judas_client/commit/84d4b9821435857fa49c2d05e1ae8366d010a64d) **uv.lock**: add depedency on judas_protocol
- [`88bba5c`](https://gitea.pufereq.pl/judas/judas_client/commit/88bba5c44972c1a7fb2a6ca554d1148f45c842c3) **pyproject.toml**: add depedency on judas_protocol
<!-- generated by git-cliff -->

View File

@@ -4,16 +4,22 @@ build-backend = "uv_build"
[project]
name = "judas_client"
version = "0.1.0"
version = "0.2.0"
description = "A client for judas, a remote PC fleet management system."
readme = "README.md"
authors = []
requires-python = ">=3.13"
dependencies = []
dependencies = [
"judas-protocol",
]
license = { text = "GPL-3.0+" }
[dependency-groups]
bump = ["git-cliff>=2.9.1", "python-semantic-release>=10.2.0"]
lint = [
"isort>=6.0.1",
"ruff>=0.13.1",
]
test = [
"pytest>=4.2.1",
"pytest-cov>=6.2.1",
@@ -81,3 +87,6 @@ allowed_tags = [
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
default_bump_level = 0
[tool.uv.sources]
judas-protocol = { git = "https://gitea.pufereq.pl/judas/judas_protocol.git" }

View File

@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import logging as lg
from judas_client.connector import Connector
if __name__ == "__main__":
lg.basicConfig(
level=lg.DEBUG,
format="%(asctime)s : [%(levelname)s] : %(threadName)s : %(name)s :: %(message)s",
)
logger = lg.getLogger(__name__)
connector = Connector("127.0.0.1", 3692)
connector.run()

View File

@@ -0,0 +1,190 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import logging as lg
import socket
import time
import uuid
from judas_protocol import Message
class Connector:
def __init__(
self,
host: str,
port: int,
connect_timeout: float = 5.0,
ack_timeout: float = None,
) -> None:
self.logger: lg.Logger = lg.getLogger(
f"{__name__}.{self.__class__.__name__}"
)
self.logger.debug("Initializing Connector...")
self.host: str = host
self.port: int = port
self.socket_timeout: None = None
self.connect_timeout: float = connect_timeout
self.ack_timeout: float = ack_timeout
self.socket: socket.socket = socket.socket(
socket.AF_INET, socket.SOCK_STREAM
)
self.mac_address: str = self._get_mac_address()
def _get_mac_address(self) -> str:
mac_address: str = ":".join(
[
"{:02x}".format((uuid.getnode() >> ele) & 0xFF)
for ele in range(0, 8 * 6, 8)
][::-1]
)
self.logger.debug(f"MAC address: {mac_address}")
return mac_address
def _send_ack(self) -> None:
self.logger.debug("[>] Sending ACK...")
try:
self.socket.sendall(Message.ack().to_bytes())
self.logger.debug("[<] ACK sent")
except socket.error as e:
self.logger.error(f"[!] Failed to send ACK: {e}")
def _check_ack(self) -> bool:
self.logger.debug("[.] Waiting for ACK...")
try:
self.socket.settimeout(self.ack_timeout)
ack: bytes = self.socket.recv(1024)
self.socket.settimeout(self.socket_timeout)
if ack == Message.ack().to_bytes():
self.logger.debug("[<] ACK received")
return True
else:
self.logger.error(f"[!] Invalid ACK received: {ack}")
except TimeoutError as e:
self.logger.error(f"[!] ACK timeout: {e}")
except socket.error as e:
self.logger.error(f"[!] Failed to receive ACK: {e}")
return False
def connect(self, retry_interval: int = 1) -> None:
self.logger.debug(
f"Connecting to {self.host}:{self.port} with timeout {self.connect_timeout}s..."
)
try:
self.socket.settimeout(self.connect_timeout)
self.socket.connect((self.host, self.port))
self.socket.settimeout(self.socket_timeout)
self.logger.info(f"[+] Connected to {self.host}:{self.port}")
self.send_hello()
except (
socket.timeout,
ConnectionRefusedError,
ConnectionAbortedError,
) as e:
self.logger.error(
f"[!] Connection to {self.host}:{self.port} failed: {e}"
)
self.logger.info(
f"[.] Retrying connection in {retry_interval} s..."
)
time.sleep(retry_interval)
self.connect(retry_interval=min(30, retry_interval * 2))
def send(self, data: bytes, no_check_ack: bool = False) -> None:
self.logger.debug(f"[>] Sending data: {data}")
while True:
try:
self.socket.sendall(data)
if no_check_ack:
self.logger.debug("[>] Data sent without ACK check")
break
else:
self.logger.info("[>] Data sent")
acknowledged: bool = self._check_ack()
if acknowledged:
self.logger.debug("[.] Data acknowledged")
break
else:
self.logger.warning(
"[!] Data not acknowledged, retrying..."
)
except BrokenPipeError as e:
self.logger.error(f"[!] Broken pipe: {e}")
self.logger.info("[.] Reconnecting...")
self.connect()
except (socket.error, ValueError) as e:
self.logger.error(f"[!] Failed to send data: {e}")
time.sleep(1)
def receive(self) -> bytes:
self.logger.debug("[.] Waiting to receive data...")
try:
data: bytes = self.socket.recv(4096)
if not data:
self.logger.warning("[!] Received empty message")
return b""
self.logger.debug(f"[<] Received data: {data}")
return data
except socket.error as e:
self.logger.error(f"[!] Failed to receive data: {e}")
return b""
def close(self) -> None:
self.logger.debug("Closing connection...")
self.socket.close()
self.logger.info("Connection closed.")
def reconnect(self) -> None:
self.logger.debug("Reconnecting...")
self.close()
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.connect()
def send_hello(self) -> None:
self.logger.debug("[.] Sending hello message...")
hello_message: Message = Message.hello(self.mac_address)
acknowledged: bool = False
while not acknowledged:
self.send(hello_message.to_bytes(), no_check_ack=True)
self.logger.debug("[.] Hello message sent, waiting for ACK...")
acknowledged = self._check_ack()
if not acknowledged:
self.logger.warning(
"[!] Hello message not acknowledged, retrying..."
)
time.sleep(1)
def _loop(self) -> None:
self.logger.debug("Starting main loop...")
while True:
time.sleep(1)
data: bytes = self.receive()
if not data:
self.reconnect()
continue
message = Message.from_bytes(data.strip())
self.logger.info(f"[<] Message received: {message}")
# if self._check_ack():
# self.logger.debug("[.] ACK verified")
# else:
# self.logger.error("[!] ACK verification failed")
def run(self) -> None:
self.logger.debug("Running Connector...")
try:
self.connect()
self._loop()
except KeyboardInterrupt:
self.logger.info("Interrupted by user.")
finally:
self.close()

54
uv.lock generated
View File

@@ -226,6 +226,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" },
]
[[package]]
name = "isort"
version = "6.0.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/b8/21/1e2a441f74a653a144224d7d21afe8f4169e6c7c20bb13aec3a2dc3815e0/isort-6.0.1.tar.gz", hash = "sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450", size = 821955, upload-time = "2025-02-26T21:13:16.955Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/c1/11/114d0a5f4dabbdcedc1125dee0888514c3c3b16d3e9facad87ed96fad97c/isort-6.0.1-py3-none-any.whl", hash = "sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615", size = 94186, upload-time = "2025-02-26T21:13:14.911Z" },
]
[[package]]
name = "jinja2"
version = "3.1.6"
@@ -240,14 +249,21 @@ wheels = [
[[package]]
name = "judas-client"
version = "0.1.0"
version = "0.2.0"
source = { editable = "." }
dependencies = [
{ name = "judas-protocol" },
]
[package.dev-dependencies]
bump = [
{ name = "git-cliff" },
{ name = "python-semantic-release" },
]
lint = [
{ name = "isort" },
{ name = "ruff" },
]
test = [
{ name = "pytest" },
{ name = "pytest-cov" },
@@ -256,12 +272,17 @@ test = [
]
[package.metadata]
requires-dist = [{ name = "judas-protocol", git = "https://gitea.pufereq.pl/judas/judas_protocol.git" }]
[package.metadata.requires-dev]
bump = [
{ name = "git-cliff", specifier = ">=2.9.1" },
{ name = "python-semantic-release", specifier = ">=10.2.0" },
]
lint = [
{ name = "isort", specifier = ">=6.0.1" },
{ name = "ruff", specifier = ">=0.13.1" },
]
test = [
{ name = "pytest", specifier = ">=4.2.1" },
{ name = "pytest-cov", specifier = ">=6.2.1" },
@@ -269,6 +290,11 @@ test = [
{ name = "pytest-mock", specifier = ">=3.14.1" },
]
[[package]]
name = "judas-protocol"
version = "0.1.0"
source = { git = "https://gitea.pufereq.pl/judas/judas_protocol.git#fd070b176347a0f7b81f937b189d8f50736f3514" }
[[package]]
name = "markdown-it-py"
version = "4.0.0"
@@ -519,6 +545,32 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/e3/30/3c4d035596d3cf444529e0b2953ad0466f6049528a879d27534700580395/rich-14.1.0-py3-none-any.whl", hash = "sha256:536f5f1785986d6dbdea3c75205c473f970777b4a0d6c6dd1b696aa05a3fa04f", size = 243368, upload-time = "2025-07-25T07:32:56.73Z" },
]
[[package]]
name = "ruff"
version = "0.13.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/ab/33/c8e89216845615d14d2d42ba2bee404e7206a8db782f33400754f3799f05/ruff-0.13.1.tar.gz", hash = "sha256:88074c3849087f153d4bb22e92243ad4c1b366d7055f98726bc19aa08dc12d51", size = 5397987, upload-time = "2025-09-18T19:52:44.33Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/f3/41/ca37e340938f45cfb8557a97a5c347e718ef34702546b174e5300dbb1f28/ruff-0.13.1-py3-none-linux_armv6l.whl", hash = "sha256:b2abff595cc3cbfa55e509d89439b5a09a6ee3c252d92020bd2de240836cf45b", size = 12304308, upload-time = "2025-09-18T19:51:56.253Z" },
{ url = "https://files.pythonhosted.org/packages/ff/84/ba378ef4129415066c3e1c80d84e539a0d52feb250685091f874804f28af/ruff-0.13.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:4ee9f4249bf7f8bb3984c41bfaf6a658162cdb1b22e3103eabc7dd1dc5579334", size = 12937258, upload-time = "2025-09-18T19:52:00.184Z" },
{ url = "https://files.pythonhosted.org/packages/8d/b6/ec5e4559ae0ad955515c176910d6d7c93edcbc0ed1a3195a41179c58431d/ruff-0.13.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5c5da4af5f6418c07d75e6f3224e08147441f5d1eac2e6ce10dcce5e616a3bae", size = 12214554, upload-time = "2025-09-18T19:52:02.753Z" },
{ url = "https://files.pythonhosted.org/packages/70/d6/cb3e3b4f03b9b0c4d4d8f06126d34b3394f6b4d764912fe80a1300696ef6/ruff-0.13.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:80524f84a01355a59a93cef98d804e2137639823bcee2931f5028e71134a954e", size = 12448181, upload-time = "2025-09-18T19:52:05.279Z" },
{ url = "https://files.pythonhosted.org/packages/d2/ea/bf60cb46d7ade706a246cd3fb99e4cfe854efa3dfbe530d049c684da24ff/ruff-0.13.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff7f5ce8d7988767dd46a148192a14d0f48d1baea733f055d9064875c7d50389", size = 12104599, upload-time = "2025-09-18T19:52:07.497Z" },
{ url = "https://files.pythonhosted.org/packages/2d/3e/05f72f4c3d3a69e65d55a13e1dd1ade76c106d8546e7e54501d31f1dc54a/ruff-0.13.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c55d84715061f8b05469cdc9a446aa6c7294cd4bd55e86a89e572dba14374f8c", size = 13791178, upload-time = "2025-09-18T19:52:10.189Z" },
{ url = "https://files.pythonhosted.org/packages/81/e7/01b1fc403dd45d6cfe600725270ecc6a8f8a48a55bc6521ad820ed3ceaf8/ruff-0.13.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:ac57fed932d90fa1624c946dc67a0a3388d65a7edc7d2d8e4ca7bddaa789b3b0", size = 14814474, upload-time = "2025-09-18T19:52:12.866Z" },
{ url = "https://files.pythonhosted.org/packages/fa/92/d9e183d4ed6185a8df2ce9faa3f22e80e95b5f88d9cc3d86a6d94331da3f/ruff-0.13.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c366a71d5b4f41f86a008694f7a0d75fe409ec298685ff72dc882f882d532e36", size = 14217531, upload-time = "2025-09-18T19:52:15.245Z" },
{ url = "https://files.pythonhosted.org/packages/3b/4a/6ddb1b11d60888be224d721e01bdd2d81faaf1720592858ab8bac3600466/ruff-0.13.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f4ea9d1b5ad3e7a83ee8ebb1229c33e5fe771e833d6d3dcfca7b77d95b060d38", size = 13265267, upload-time = "2025-09-18T19:52:17.649Z" },
{ url = "https://files.pythonhosted.org/packages/81/98/3f1d18a8d9ea33ef2ad508f0417fcb182c99b23258ec5e53d15db8289809/ruff-0.13.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0f70202996055b555d3d74b626406476cc692f37b13bac8828acff058c9966a", size = 13243120, upload-time = "2025-09-18T19:52:20.332Z" },
{ url = "https://files.pythonhosted.org/packages/8d/86/b6ce62ce9c12765fa6c65078d1938d2490b2b1d9273d0de384952b43c490/ruff-0.13.1-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:f8cff7a105dad631085d9505b491db33848007d6b487c3c1979dd8d9b2963783", size = 13443084, upload-time = "2025-09-18T19:52:23.032Z" },
{ url = "https://files.pythonhosted.org/packages/a1/6e/af7943466a41338d04503fb5a81b2fd07251bd272f546622e5b1599a7976/ruff-0.13.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:9761e84255443316a258dd7dfbd9bfb59c756e52237ed42494917b2577697c6a", size = 12295105, upload-time = "2025-09-18T19:52:25.263Z" },
{ url = "https://files.pythonhosted.org/packages/3f/97/0249b9a24f0f3ebd12f007e81c87cec6d311de566885e9309fcbac5b24cc/ruff-0.13.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:3d376a88c3102ef228b102211ef4a6d13df330cb0f5ca56fdac04ccec2a99700", size = 12072284, upload-time = "2025-09-18T19:52:27.478Z" },
{ url = "https://files.pythonhosted.org/packages/f6/85/0b64693b2c99d62ae65236ef74508ba39c3febd01466ef7f354885e5050c/ruff-0.13.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:cbefd60082b517a82c6ec8836989775ac05f8991715d228b3c1d86ccc7df7dae", size = 12970314, upload-time = "2025-09-18T19:52:30.212Z" },
{ url = "https://files.pythonhosted.org/packages/96/fc/342e9f28179915d28b3747b7654f932ca472afbf7090fc0c4011e802f494/ruff-0.13.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:dd16b9a5a499fe73f3c2ef09a7885cb1d97058614d601809d37c422ed1525317", size = 13422360, upload-time = "2025-09-18T19:52:32.676Z" },
{ url = "https://files.pythonhosted.org/packages/37/54/6177a0dc10bce6f43e392a2192e6018755473283d0cf43cc7e6afc182aea/ruff-0.13.1-py3-none-win32.whl", hash = "sha256:55e9efa692d7cb18580279f1fbb525146adc401f40735edf0aaeabd93099f9a0", size = 12178448, upload-time = "2025-09-18T19:52:35.545Z" },
{ url = "https://files.pythonhosted.org/packages/64/51/c6a3a33d9938007b8bdc8ca852ecc8d810a407fb513ab08e34af12dc7c24/ruff-0.13.1-py3-none-win_amd64.whl", hash = "sha256:3a3fb595287ee556de947183489f636b9f76a72f0fa9c028bdcabf5bab2cc5e5", size = 13286458, upload-time = "2025-09-18T19:52:38.198Z" },
{ url = "https://files.pythonhosted.org/packages/fd/04/afc078a12cf68592345b1e2d6ecdff837d286bac023d7a22c54c7a698c5b/ruff-0.13.1-py3-none-win_arm64.whl", hash = "sha256:c0bae9ffd92d54e03c2bf266f466da0a65e145f298ee5b5846ed435f6a00518a", size = 12437893, upload-time = "2025-09-18T19:52:41.283Z" },
]
[[package]]
name = "shellingham"
version = "1.5.4"