106 Commits
0.1.1 ... main

Author SHA1 Message Date
github-actions[bot]
5dd208a100 chore(release): 0.4.0 2025-11-30 17:39:03 +00:00
18b7e10631 Merge pull request 'chore(release): 0.4.0' (#12) from release/0.4.0 into main
Reviewed-on: #12
2025-11-30 17:37:18 +00:00
07106f1816 Merge pull request 'refactor: improve backend server' (#11) from refactor/improve-backend-server into develop
Reviewed-on: #11
2025-11-30 17:34:14 +00:00
115deaab4b fix(backend_server.py): use unused packet_size argument to _receive_inbound() 2025-11-30 18:32:48 +01:00
8d2b8f9519 refactor(backend_server.py): change log levels 2025-11-30 18:30:59 +01:00
f365139e9f style(backend_server.py): ignore type error in _handle_connection() 2025-11-30 18:12:24 +01:00
cc6b650f5c fix(backend_server.py): import Any from typing 2025-11-30 18:11:41 +01:00
faf1f4eeee refactor(backend_server.py): remove unused argument in BackendServer._send_outbound() 2025-11-30 18:10:37 +01:00
61a607c20e refactor: wip 2025-11-21 18:39:44 +01:00
fe7d78c1c8 build(uv.lock): update judas_protocol to 0.5.0 2025-11-19 21:46:31 +01:00
cee30251dd build(uv.lock): update judas_protocol to 0.4.3 2025-10-05 13:43:41 +02:00
721ab87e71 build(uv.lock): update judas_protocol to 0.3.0 2025-09-23 23:31:27 +02:00
1211ca2029 build(uv.lock): update judas_protocol to 0.2.0 2025-09-22 21:59:06 +02:00
5024862165 fix(backend_server.py): add 1ms sleep to prevent 100% CPU usage in _loop() 2025-09-22 21:58:59 +02:00
6f5fa33a12 feat(backend_server.py): handle all other client Exceptions in _handle_connection() 2025-09-22 21:57:43 +02:00
f0eeeb79a1 fix(backend_server.py): handle unregister exceptions 2025-09-22 21:56:40 +02:00
github-actions[bot]
6ef3f58d73 chore(release): 0.3.0 2025-09-19 13:29:28 +00:00
8f97bea0e9 Merge pull request 'release/0.3.0' (#10) from release/0.3.0 into main
Reviewed-on: #10
2025-09-19 13:28:10 +00:00
a2d1669179 Merge pull request 'feat: add backend server' (#9) from feat/add-backend-server into develop
Reviewed-on: #9
2025-09-19 13:20:40 +00:00
66db11c40b build: add ruff lint depedency 2025-09-19 14:57:38 +02:00
d96fec0222 build(web_server.py): order imports 2025-09-19 14:56:45 +02:00
6bbb152ae1 style(panel.py): order imports 2025-09-19 14:56:06 +02:00
b14541ea83 style(index.py): order imports 2025-09-19 14:55:56 +02:00
7d36e6e431 style(auth.py): order imports 2025-09-19 14:55:44 +02:00
98c49b1d0d style(api.py): order imports 2025-09-19 14:55:08 +02:00
377a846c59 style(client.py): order imports 2025-09-19 14:54:54 +02:00
a27b5b1275 style(backend_server.py): order imports 2025-09-19 14:54:43 +02:00
19aa80a08e style(__main__.py): order imports 2025-09-19 14:54:24 +02:00
a1b28faa9f build: add isort as lint depedency 2025-09-19 14:53:47 +02:00
df0b19d943 feat(routes/api.py): support mulitple clients correctly 2025-09-02 19:16:35 +02:00
b68c755c45 fix(backend_server.py): send ack on connect 2025-09-02 19:13:26 +02:00
0d074adc0d refactor(backend_server.py): use _send_ack() in _handle_connection() 2025-08-29 15:21:57 +02:00
f2b4811145 feat(backend_server.py): add BackendServer._send_ack() helper method 2025-08-29 15:20:02 +02:00
2922123a70 fix(backend/__init__.py): fix backend_server import 2025-08-29 15:17:58 +02:00
d5985cf594 feat(__main__.py): display ascii judas splash screen on launch 2025-08-29 00:38:59 +02:00
b9fd84d08f feat(gaga.py): add Lady Gaga's Born This Way album art ASCII 2025-08-29 00:38:23 +02:00
f7f6f19808 style(__main__.py): organize imports 2025-08-29 00:36:03 +02:00
ac7799213c refactor(__main__.py): provide host and port args to BackendServer explicitly 2025-08-29 00:35:22 +02:00
54512d8393 chore(routes/api.py): adapt emit_polled_data() for Client class 2025-08-29 00:33:44 +02:00
c0ad91b22f feat(backend_server.py): re-add the get_client_data() method 2025-08-29 00:31:43 +02:00
b9a7c2bdaf docs(backend_server.py): add TODO in _handle_connection() 2025-08-29 00:30:34 +02:00
ac66ce1999 chore(backend_server.py): set Client.last_seen on message receive 2025-08-29 00:29:56 +02:00
2ecd32decc feat(client.py): add Client class 2025-08-29 00:26:49 +02:00
1c96390f3c feat(backend_server.py): add error handling for HELLO message handler in _accept_connection() 2025-08-29 00:23:48 +02:00
c0cacfad2d fix(backend_server.py): fix server waiting for closed socket to dissapear by reusing it in __init__() 2025-08-29 00:20:02 +02:00
cafef5ed93 style(backend_server.py): remove unused imports 2025-08-29 00:18:18 +02:00
b5670e5d2c refactor(server.py): rename server.py to backend_server.py for clarity 2025-08-29 00:15:40 +02:00
639e1f73a0 feat(server.py): add socket-based communication 2025-08-28 20:04:32 +02:00
4e16a70174 build(uv.lock): add depedency on judas_protocol 2025-08-28 19:57:24 +02:00
4aa2ca426c build(pyproject.toml): add depedency on judas_protocol 2025-08-28 19:57:10 +02:00
github-actions[bot]
813407057e chore(release): 0.2.0 2025-08-26 18:01:32 +00:00
89b6c1ee83 ci(release.yaml): update with latest pufereq/python-template release.yaml 2025-08-26 20:00:23 +02:00
bf5cc97c11 Merge pull request 'chore(release): 0.2.0' (#8) from release/0.2.0 into main
Reviewed-on: #8
2025-08-26 17:58:45 +00:00
6f21e53677 Merge pull request 'feat: add placeholder backend' (#7) from feat/add-placeholder-backend into develop
Reviewed-on: #7
2025-08-26 17:56:00 +00:00
9f74246157 feat(web_server.py): use socketio 2025-08-26 19:42:03 +02:00
84ce50963b feat(routes/api.py): add API route 2025-08-26 19:41:45 +02:00
3bcffaafab style(style.css): format w/ prettier 2025-08-26 19:38:31 +02:00
e6cc1d901e refactor(panel.html): rewrite panel.html template 2025-08-26 19:37:14 +02:00
9e71270e41 refactor(panel.py): remove unnecesarry args to render_template 2025-08-26 19:36:43 +02:00
1fa355089d fix(panel.py): fix panel route to be at /panel instead of /panel/ 2025-08-26 19:34:55 +02:00
860ce5c836 chore(panel.py): remove unnecesarry imports 2025-08-26 19:34:14 +02:00
055ab10ab7 style(__main__.py): add typing 2025-08-26 19:33:29 +02:00
dbb464e41c feat(__main__.py): call BackendServer.run() 2025-08-26 19:32:53 +02:00
11400520c9 refactor(server.py): fix method naming and add logging 2025-08-26 19:30:50 +02:00
b8f5fdc794 feat(server.py): create a thread for _poll_loop 2025-08-26 19:10:24 +02:00
d8405fa363 fix(server.py): fix placeholder naming to be consistent 2025-08-26 19:09:41 +02:00
c628498637 chore(__main__.py): change log format 2025-08-26 19:08:46 +02:00
786c43ae06 build(uv.lock): add flask-socketio depedency 2025-08-26 19:04:58 +02:00
309efe074b build(pyproject.toml): add flask-socketio depedency 2025-08-26 19:04:43 +02:00
9949179997 style(login.html): format 2025-08-25 22:18:36 +02:00
6a072724f2 style(index.html): format 2025-08-25 22:18:23 +02:00
b79f3f3387 style(details.html): format with prettier 2025-08-25 22:18:06 +02:00
a494b606a5 feat(web_server.py): add WEB_SERVER and BACKEND app.configs 2025-08-25 21:43:15 +02:00
90094e9c43 chore(web_server.py): remove LoginManager from self.app.config 2025-08-25 21:42:38 +02:00
4285da4fa8 feat(web_server.py): add BackendServer reference to webserver 2025-08-25 21:42:00 +02:00
14450ba70d feat(__main__.py): init BackendServer in __main__ 2025-08-25 21:40:44 +02:00
5a4b5ddd82 chore(backend/__init__.py): add BackendServer to __all__ 2025-08-25 21:40:17 +02:00
2964ac7644 feat(backend/server.py): add placeholder backend 2025-08-25 21:39:32 +02:00
1d00d5f4f5 chore(routes/auth.py): make login fail message more ambigiuous 2025-08-25 20:24:57 +02:00
38da1f476e feat(templates/login.html): autofocus password field 2025-08-25 20:22:32 +02:00
c840788907 Merge pull request 'refactor: use OOP' (#6) from refactor/use-oop into develop
Reviewed-on: #6
2025-08-25 17:56:22 +00:00
a3e9aed6f4 chore(web_server.py): add web server to initial loggin to avoid confusion 2025-08-25 19:48:17 +02:00
8ad55eed10 fix(__main__.py): fix wrong import path 2025-08-25 19:40:39 +02:00
77b6bd0732 refactor(web_server.py): rewrite to use OOP 2025-08-25 19:40:11 +02:00
a32df2fd67 chore(templates/stream.html): remove stream.html template 2025-08-25 19:39:32 +02:00
8b418a7d52 refactor(templates/panel.html): adapt urls for blueprints 2025-08-25 19:38:35 +02:00
3e1fe9fa1e refactor(templates/login.html): adapt urls for blueprints 2025-08-25 19:38:22 +02:00
bd9d95b741 refactor(templates/index.html): adapt urls for blueprints 2025-08-25 19:38:12 +02:00
4baf29eb4a refactor(templates/details.html): adapt urls for blueprints 2025-08-25 19:37:58 +02:00
d91f135d53 feat(user.py): add user management 2025-08-25 19:35:16 +02:00
c1e20e5524 feat(routes/__init__.py): add __init__.py 2025-08-25 19:32:24 +02:00
d56256f681 feat(routes/panel.py): add panel.py route blueprint 2025-08-25 19:32:05 +02:00
bbaffb344f feat(routes/auth.py): add auth.py route blueprint 2025-08-25 19:31:55 +02:00
50be48dba4 feat(routes/index.py): add index.py route blueprint 2025-08-25 19:31:42 +02:00
fc5dc23c0e refactor(style.css): use new palette 2025-08-25 19:26:41 +02:00
44df495096 feat(palette.css): add catppuccin color palette 2025-08-25 19:26:13 +02:00
8dbbea3f56 feat(__main__.py): add __main__.py 2025-08-24 22:02:59 +02:00
e575e8a15d refactor(.vscode/launch.json): use __main__.py for running web server 2025-08-24 22:02:39 +02:00
1901441948 chore(py.typed): add py.typed 2025-08-15 20:38:14 +02:00
6bed7da165 build(pyproject.toml): use basic type checking to kinda supress flask_login's nonexistent typing 2025-08-15 20:36:20 +02:00
f8f74ccd4b chore(routes/__init__.py): add __init__.py 2025-08-09 22:47:47 +02:00
5fb6920436 style(.vscode/settings.json): fix indentation 2025-08-09 22:46:45 +02:00
23a53f79a0 fix(web_server.py): fix server error when using /stream 2025-08-09 22:46:06 +02:00
89dd67b489 chore(backend/__init__.py): add __init__.py 2025-08-09 22:44:06 +02:00
c2e1984959 style(web_server.py): fix typing errors 2025-08-09 22:42:19 +02:00
dbc61ac6b7 chore(web/__init__.py): add web/__init__.py 2025-08-09 22:41:43 +02:00
27 changed files with 1324 additions and 450 deletions

View File

@@ -5,35 +5,35 @@ on:
inputs:
short_description:
type: string
description: 'Short description of the release'
description: "Short description of the release"
required: false
auto_bump:
type: boolean
description: 'Auto bump version?'
description: "Auto bump version?"
required: true
bump_type:
type: choice
description: 'Bump type'
description: "Bump type"
required: true
options:
- 'major'
- 'minor'
- 'patch'
- 'prerelease'
- "major"
- "minor"
- "patch"
- "prerelease"
as_pre_release:
type: boolean
description: 'As pre-release?'
description: "As pre-release?"
required: true
prerelease_type:
type: choice
description: 'Pre-release label'
description: "Pre-release label"
required: true
options:
- 'dev'
- 'alpha'
- 'beta'
- 'rc'
- 'post'
- "dev"
- "alpha"
- "beta"
- "rc"
- "post"
jobs:
bump_version:
runs-on: ubuntu-latest
@@ -44,7 +44,7 @@ jobs:
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
submodules: 'recursive'
submodules: "recursive"
- name: 📦 install uv
uses: astral-sh/setup-uv@v5
@@ -92,9 +92,12 @@ jobs:
echo "Changes:" && cat release_body.md
uv run git-cliff > CHANGELOG.md
- name: 📦 update lockfile (re-sync)
run: uv sync
- name: 📤 push changes
run: |
git add CHANGELOG.md pyproject.toml src/*/__init__.py
git add CHANGELOG.md pyproject.toml src/*/__init__.py uv.lock
git commit -m "chore(release): ${{ steps.get_version.outputs.BUMPED_VERSION }}"
git push origin main
@@ -105,13 +108,14 @@ jobs:
tag_name: ${{ steps.get_version.outputs.BUMPED_VERSION }}
body_path: release_body.md
prerelease: ${{ github.event.inputs.as_pre_release }}
discussion_category_name: 'Announcements'
discussion_category_name: "Announcements"
- name: 🧹 cleanup
run: |
rm release_body.md
- name: 📤 merge into develop
continue-on-error: true
run: |
git checkout develop
git merge main

8
.vscode/launch.json vendored
View File

@@ -2,10 +2,12 @@
"version": "0.2.0",
"configurations": [
{
"name": "Launch Flask",
"type": "node-terminal",
"name": "Debug Flask",
"type": "debugpy",
"request": "launch",
"command": "flask --app src/judas_server/web/web_server.py run --host=0.0.0.0"
"program": "${workspaceFolder}/src/judas_server/__main__.py",
"console": "integratedTerminal",
"justMyCode": true
}
]
}

View File

@@ -1,4 +1,4 @@
{
"python.analysis.autoImportCompletions": true,
"python.analysis.typeCheckingMode": "standard",
"python.analysis.autoImportCompletions": true,
"python.analysis.typeCheckingMode": "standard"
}

View File

@@ -2,6 +2,162 @@
All notable changes to this project will be documented in this file.
## [0.4.0] - 2025-11-30
### Bug Fixes
- [`115deaa`](https://github.com/pufereq/template-repo/commit/115deaab4b0aaa9f0d3577be56e64fa3bb03f76b) **backend_server.py**: use unused `packet_size` argument to `_receive_inbound()`
- [`cc6b650`](https://github.com/pufereq/template-repo/commit/cc6b650f5cd1f3889c251fbe7b36c681be48b2a0) **backend_server.py**: import Any from typing
- [`5024862`](https://github.com/pufereq/template-repo/commit/50248621650590c17fcf96c0cec9618a2b0dd07c) **backend_server.py**: add 1ms sleep to prevent 100% CPU usage in `_loop()`
- [`f0eeeb7`](https://github.com/pufereq/template-repo/commit/f0eeeb79a188548c3f306f4bc875bacc6fd89588) **backend_server.py**: handle unregister exceptions
### Features
- [`6f5fa33`](https://github.com/pufereq/template-repo/commit/6f5fa33a122e9ebdf9df91628be67721cfc031e3) **backend_server.py**: handle all other client Exceptions in `_handle_connection()`
### Refactor
- [`8d2b8f9`](https://github.com/pufereq/template-repo/commit/8d2b8f9519bb809df45ba79ea53f12775c3097d4) **backend_server.py**: change log levels
- [`faf1f4e`](https://github.com/pufereq/template-repo/commit/faf1f4eeee341f5f8d234dc7d93ae5c86e276217) **backend_server.py**: remove unused argument in `BackendServer._send_outbound()`
- [`61a607c`](https://github.com/pufereq/template-repo/commit/61a607c20e205c18e60a9b26f6fb3c37a47d6a55) wip
### Styling
- [`f365139`](https://github.com/pufereq/template-repo/commit/f365139e9f064de309f655296b99868833ba7dce) **backend_server.py**: ignore type error in `_handle_connection()`
### Build
- [`fe7d78c`](https://github.com/pufereq/template-repo/commit/fe7d78c1c8cd1d0e13276ce82549ee97b896aff0) **uv.lock**: update judas_protocol to 0.5.0
- [`cee3025`](https://github.com/pufereq/template-repo/commit/cee30251ddb87b1f3ca84d0f3c8cf40fb37debcc) **uv.lock**: update judas_protocol to 0.4.3
- [`721ab87`](https://github.com/pufereq/template-repo/commit/721ab87e7156045703f55ecefc6ed3e15ffa36aa) **uv.lock**: update judas_protocol to 0.3.0
- [`1211ca2`](https://github.com/pufereq/template-repo/commit/1211ca20294dcc3907dbadfee4b294cf7e24a8f9) **uv.lock**: update judas_protocol to 0.2.0
## [0.3.0] - 2025-09-19
### Bug Fixes
- [`b68c755`](https://github.com/pufereq/template-repo/commit/b68c755c450c7b13f95b335fc93810847306708c) **backend_server.py**: send ack on connect
- [`2922123`](https://github.com/pufereq/template-repo/commit/2922123a7050a9438b024067ebad2901adb84fe3) **backend/__init__.py**: fix backend_server import
- [`c0cacfa`](https://github.com/pufereq/template-repo/commit/c0cacfad2d13799d3472a5d033ae15fd668401f9) **backend_server.py**: fix server waiting for closed socket to dissapear by reusing it in `__init__()`
### Documentation
- [`b9a7c2b`](https://github.com/pufereq/template-repo/commit/b9a7c2bdaf4be8dcea4c6f3196a6092f76eac183) **backend_server.py**: add TODO in `_handle_connection()`
### Features
- [`df0b19d`](https://github.com/pufereq/template-repo/commit/df0b19d94361f63d7ae3def51e3f9360242755b7) **routes/api.py**: support mulitple clients correctly
- [`f2b4811`](https://github.com/pufereq/template-repo/commit/f2b4811145a0a45b2a866aefb095f833c8cb50ae) **backend_server.py**: add `BackendServer._send_ack()` helper method
- [`d5985cf`](https://github.com/pufereq/template-repo/commit/d5985cf5945a304505546ef733631bc33d004621) **__main__.py**: display ascii judas splash screen on launch
- [`b9fd84d`](https://github.com/pufereq/template-repo/commit/b9fd84d08f24bb21e51b48b529f62bfe2671c895) **gaga.py**: add Lady Gaga's Born This Way album art ASCII
- [`c0ad91b`](https://github.com/pufereq/template-repo/commit/c0ad91b22f0e011da1021ead1c126a94aaf90f44) **backend_server.py**: re-add the `get_client_data()` method
- [`2ecd32d`](https://github.com/pufereq/template-repo/commit/2ecd32decce95e6aec74433ef3255bc4cf3c3988) **client.py**: add `Client` class
- [`1c96390`](https://github.com/pufereq/template-repo/commit/1c96390f3cade804b2667bb69bec4419703a6d56) **backend_server.py**: add error handling for HELLO message handler in `_accept_connection()`
- [`639e1f7`](https://github.com/pufereq/template-repo/commit/639e1f73a07286bce1a1ef227d216a722e3fa214) **server.py**: add socket-based communication
### Miscellaneous Tasks
- [`54512d8`](https://github.com/pufereq/template-repo/commit/54512d8393a32f59a9aaddf5a52cb18ee9986fdf) **routes/api.py**: adapt `emit_polled_data()` for `Client` class
- [`ac66ce1`](https://github.com/pufereq/template-repo/commit/ac66ce19998a4518a346b6608645486121cd2123) **backend_server.py**: set `Client.last_seen` on message receive
### Refactor
- [`0d074ad`](https://github.com/pufereq/template-repo/commit/0d074adc0d441428baac6858ff57717f3164cf6a) **backend_server.py**: use `_send_ack()` in `_handle_connection()`
- [`ac77992`](https://github.com/pufereq/template-repo/commit/ac7799213cba82dbb189919873130647d7c87a78) **__main__.py**: provide `host` and `port` args to `BackendServer` explicitly
- [`b5670e5`](https://github.com/pufereq/template-repo/commit/b5670e5d2cf08a031b99478de57aa53cba78bd5b) **server.py**: rename `server.py` to `backend_server.py` for clarity
### Styling
- [`6bbb152`](https://github.com/pufereq/template-repo/commit/6bbb152ae1b1178aa77cf54c6e0f544a0fed66ef) **panel.py**: order imports
- [`b14541e`](https://github.com/pufereq/template-repo/commit/b14541ea8302679091b519e3b6f630fabc0ce476) **index.py**: order imports
- [`7d36e6e`](https://github.com/pufereq/template-repo/commit/7d36e6e43132a687d0494f14f36d9b4dc357abaf) **auth.py**: order imports
- [`98c49b1`](https://github.com/pufereq/template-repo/commit/98c49b1d0d9bb7653a12c7558b5e6daf62a7762b) **api.py**: order imports
- [`377a846`](https://github.com/pufereq/template-repo/commit/377a846c5982be129724a84b4b77a6fb69fd03df) **client.py**: order imports
- [`a27b5b1`](https://github.com/pufereq/template-repo/commit/a27b5b1275fadfb2049fa5e5c535b6667ae37ab5) **backend_server.py**: order imports
- [`19aa80a`](https://github.com/pufereq/template-repo/commit/19aa80a08ebe65685209678b5daf061ffbf19840) **__main__.py**: order imports
- [`f7f6f19`](https://github.com/pufereq/template-repo/commit/f7f6f19808b19ae95bc361d00123a13c4afd344d) **__main__.py**: organize imports
- [`cafef5e`](https://github.com/pufereq/template-repo/commit/cafef5ed932ea5456260398b44e42d71702a386a) **backend_server.py**: remove unused imports
### Build
- [`66db11c`](https://github.com/pufereq/template-repo/commit/66db11c40b34d5315eda2a7dc19cd8ae428ae862) add ruff lint depedency
- [`d96fec0`](https://github.com/pufereq/template-repo/commit/d96fec0222bbf707bc1aa48a6d215dbfec93f159) **web_server.py**: order imports
- [`a1b28fa`](https://github.com/pufereq/template-repo/commit/a1b28faa9ff30ddf9da4e882c0bbac27f4863480) add isort as lint depedency
- [`4e16a70`](https://github.com/pufereq/template-repo/commit/4e16a70174a4492ec59a2ff356deddd758e3e6e1) **uv.lock**: add depedency on judas_protocol
- [`4aa2ca4`](https://github.com/pufereq/template-repo/commit/4aa2ca426c2ae3ac29724f70aa9a07e7eb5a723b) **pyproject.toml**: add depedency on judas_protocol
## [0.2.0] - 2025-08-26
### 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
### 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
### 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
### 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
## [0.1.1] - 2025-08-09
### Miscellaneous Tasks

View File

@@ -4,16 +4,25 @@ build-backend = "uv_build"
[project]
name = "judas_server"
version = "0.1.1"
version = "0.4.0"
description = "The backbone of the remote PC fleet management system."
readme = "README.md"
authors = []
requires-python = ">=3.13"
dependencies = ["flask>=3.1.1", "flask-login>=0.6.3"]
dependencies = [
"flask>=3.1.1",
"flask-login>=0.6.3",
"flask-socketio>=5.5.1",
"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",
@@ -21,6 +30,9 @@ test = [
"pytest-mock>=3.14.1",
]
[tool.basedpyright]
typeCheckingMode = "basic"
[tool.ruff]
line-length = 79
exclude = ["tests/*"]
@@ -78,3 +90,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,30 @@
# -*- coding: utf-8 -*-
import logging as lg
if __name__ == "__main__":
from judas_server.backend import BackendServer
from judas_server.gaga import LADY_GAGA
from judas_server.web.web_server import JudasWebServer
lg.basicConfig(
level=lg.DEBUG,
format="%(asctime)s : [%(levelname)s] : %(threadName)s : %(name)s :: %(message)s",
)
ladygaga_logger = lg.getLogger(f"{__name__}.LAGA_DYGA")
ladygaga_logger.info(LADY_GAGA)
backend_server: BackendServer = BackendServer(
host="0.0.0.0",
port=3692,
)
backend_server.run()
web_server: JudasWebServer = JudasWebServer(
backend=backend_server, secret_key="dildo"
)
web_server.run(
host="0.0.0.0",
port=5000,
)

View File

@@ -0,0 +1,3 @@
from .backend_server import BackendServer
__all__ = ["BackendServer"]

View File

@@ -0,0 +1,269 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import logging as lg
import selectors
import socket
import threading
import time
from typing import Any
from judas_protocol import Category, ControlAction, Message
from judas_server.backend.client import Client
class BackendServer:
def __init__(self, host: str = "0.0.0.0", port: int = 3692) -> None:
"""Initialize the backend server.
Args:
host (str): The host IP address to bind the server to.
port (int): The port number to bind the server to.
"""
self.logger: lg.Logger = lg.getLogger(
f"{__name__}.{self.__class__.__name__}"
)
self.logger.debug("Initializing Server...")
self.selector = selectors.DefaultSelector()
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server_socket.setsockopt(
socket.SOL_SOCKET, socket.SO_REUSEADDR, 1
)
self._bind_socket(host, port)
self.server_socket.listen()
self.server_socket.setblocking(False)
self.selector.register(
self.server_socket, selectors.EVENT_READ, data=None
)
self.clients: dict[str, Client] = {}
self.running: bool = False
def _bind_socket(self, host: str, port: int) -> None:
"""Bind the server socket to the specified host and port.
Args:
host (str): The host IP address to bind the server to.
port (int): The port number to bind the server to.
"""
self.logger.debug(f"Binding socket to {host}:{port}")
while True:
try:
self.server_socket.bind((host, port))
self.logger.debug(f"Socket bound to {host}:{port}")
break
except OSError as e:
self.logger.error(
f"Failed to bind socket to {host}:{port}, retrying...: {e}"
)
time.sleep(1)
def _send_ack(self, client: Client, target_id: str) -> None:
"""Send an ACK message to a client.
Args:
client (Client): The client to send the ACK to.
target_id (str): The id of the ACK'd message.
"""
ack: bytes = Message.ack(target_id=target_id).to_bytes()
self.logger.info(f"[>] Sending ACK to {client}")
client.outbound += ack
def _accept_connection(self, sock: socket.socket) -> None:
"""Accept a new client connection.
Args:
sock (socket.socket): The selected socket.
"""
conn, addr = sock.accept()
self.logger.info(f"[+] Accepted connection from {addr}")
client = Client(mac_id=None, addr=addr, socket=conn)
events = selectors.EVENT_READ | selectors.EVENT_WRITE
self.selector.register(conn, events, data=client)
self.logger.info(f"[+] Registered client {client}, HELLO pending...")
def _disconnect(self, client: Client) -> None:
"""Disconnect a client and clean up resources.
Args:
sock (socket.socket): The client socket to disconnect.
"""
self.logger.info(f"[-] Disconnecting {client}...")
self.logger.debug("[*] Sending DNR message...")
try:
self.selector.unregister(client.socket)
except Exception as e:
self.logger.error(f"Error unregistering client {client}: {e}")
client.disconnect()
def _send_outbound(self, sock: socket.socket, client: Client) -> None:
"""Queue data to be sent to a client.
Args:
client (Client): The client to send data to.
"""
self.logger.debug(f"[>] Sending data to {client}: {client.outbound!r}")
sent = sock.send(client.outbound)
client.outbound = client.outbound[sent:]
def _receive_inbound(
self, sock: socket.socket, client: Client, packet_size: int = 4096
) -> None:
"""Receive data from a client socket.
Args:
sock (socket.socket): The client socket to receive data from.
client (Client): The client object.
packet_size (int): The maximum amount of data to be received at once.
Returns:
bytes: The received data.
"""
recv_data = sock.recv(packet_size)
if recv_data:
self.logger.debug(
f"[<] Received data from {client}: {recv_data!r}"
)
client.inbound += recv_data
# set last seen
client.last_seen = time.time()
else:
self._disconnect(client)
def _handle_connection(
self, key: selectors.SelectorKey, mask: int
) -> None:
"""Handle a client connection.
Args:
key (selectors.SelectorKey): The selector key for the client.
mask (int): The event mask.
"""
sock: socket.socket = key.fileobj # type: ignore
client = key.data
try:
if mask & selectors.EVENT_READ:
self._receive_inbound(sock, client)
if client.inbound:
if client.mac_id is None:
# expect HELLO message
try:
msg = Message.from_bytes(client.inbound)
if (
msg.category == Category.CONTROL
and msg.action == ControlAction.HELLO
and msg.payload.get("mac") is not None
):
client.mac_id = msg.payload["mac"]
if (
client.mac_id in self.clients
and self.clients[client.mac_id].status
== "connected"
):
old_client: Client = self.clients[
client.mac_id
]
self.logger.warning(
f"Client {client.mac_id} is already connected from {old_client.addr}, disconnecting old client..."
)
self._disconnect(old_client)
# TODO: tell client not to reconnect
self.clients[client.mac_id] = client
self.logger.info(
f"[+] Registered new client {client}"
)
else:
self.logger.error(
f"Expected HELLO message from {client}, got {msg}"
)
self._disconnect(client)
return
except Exception as e:
self.logger.error(
f"Failed to parse HELLO message from {client}: {e}"
)
self._disconnect(client)
return
while b"\n" in client.inbound:
line, client.inbound = client.inbound.split(b"\n", 1)
self.logger.debug(
f"[<] Complete message from {client}: {line!r}"
)
try:
msg = Message.from_bytes(line)
self.logger.info(f"[.] Parsed message {msg.id}")
if msg.ack_required:
self._send_ack(client, target_id=msg.id)
except Exception as e:
self.logger.error(
f"Failed to parse message from {client}: {e}"
)
self._disconnect(client)
return
else:
self._disconnect(client)
if mask & selectors.EVENT_WRITE:
if client.outbound:
self._send_outbound(sock, client)
except ConnectionResetError as e:
self.logger.error(f"Connection reset by {client}, disconnect: {e}")
self._disconnect(client)
except Exception as e:
self.logger.error(f"Connection error for {client}: {e}")
self._disconnect(client)
def run(self) -> None:
"""Start the backend server."""
self.running = True
threading.Thread(
name="BackendServer thread", target=self._loop, daemon=True
).start()
def _loop(self) -> None:
"""Main server loop to handle incoming connections and data."""
self.logger.info("Server is running...")
try:
while self.running:
events = self.selector.select(timeout=1)
for key, mask in events:
if key.data is None:
self._accept_connection(key.fileobj) # type: ignore
else:
self._handle_connection(key, mask)
time.sleep(0.001) # prevent 100% CPU usage
except Exception as e:
self.logger.error(f"Server error: {e}")
raise e
finally:
self.selector.close()
self.server_socket.close()
self.logger.info("Server has stopped.")
def get_client_data(self, client_id: str) -> dict[str, Any] | None:
client: Client | None = self.clients.get(client_id, None)
if client is None:
self.logger.warning(f"Client {client_id} not found")
return None
return {
"id": client.mac_id,
"addr": client.addr,
"last_seen": client.last_seen,
"status": client.status,
}

View File

@@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
"""Client representation."""
from __future__ import annotations
import logging as lg
import socket
from enum import Enum
class ClientStatus(str, Enum):
CONNECTED = "connected"
DISCONNECTED = "disconnected"
class Client:
"""Represents a client."""
def __init__(
self, mac_id: str | None, addr: tuple[str, int], socket: socket.socket
) -> None:
"""Initialize the client.
Args:
mac_id (str | None): The unique identifier for the client.
Can be None if not yet assigned.
addr (tuple[str, int]): The (IP, port) address of the client.
socket (socket.socket): The socket object for communication.
"""
self.logger: lg.Logger = lg.getLogger(
f"{__name__}.{self.__class__.__name__}"
)
self.logger.debug(f"Initializing Client {addr}...")
self.mac_id: str | None = mac_id
self.last_seen: float = 0.0 # unix timestanp of last inbound message
self.status: ClientStatus = ClientStatus.CONNECTED
self.socket: socket.socket = socket
self.addr: tuple[str, int] = addr
self.inbound: bytes = b""
self.outbound: bytes = b""
def __str__(self) -> str:
return f"Client({self.mac_id} ({self.addr[0]}:{self.addr[1]}))"
def __repr__(self) -> str:
return f"Client({self.mac_id}, {self.addr})"
def disconnect(self) -> None:
"""Disconnect the client and close the socket."""
self.logger.debug(f"Disconnecting Client {self}...")
try:
self.socket.close()
except Exception as e:
self.logger.error(f"Error closing socket for Client {self}: {e}")
self.status = ClientStatus.DISCONNECTED
self.logger.info(f"Client {self} disconnected.")

43
src/judas_server/gaga.py Normal file
View File

@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
"""ASCII art of Lady Gaga's Born This Way album cover."""
from judas_server import __version__
LADY_GAGA: str = """
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢔⢑⠔⡁⡂⢅⠢⠃⢆⢊⠜⡩⠳⣕⣙⡪⡪⡢⣫⢺⢔⢵⢱⢕⢮⢮⢺⡢⢕⠕⡽⣘⢜⠳⣌⢢⠀⠀⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢰⣶⣆⢰⠰⡄⢢⣶⣶⢐⠂⡑⡐⢆⢊⠔⠌⢌⢂⠢⠡⢂⠅⢍⢲⣉⡙⢜⡘⢎⣗⢵⢕⡕⡧⡳⡹⣮⣫⢺⢼⡪⣮⡳⡜⡮⡙⠤⠄⢂⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠈⠉⢽⡫⠉⡏⡏⠉⠍⡏⡉⢋⡍⣇⢕⢨⡈⡔⡠⠁⠕⡀⡈⠄⠠⡀⠍⠜⠜⡪⣚⡎⢏⢯⢞⡽⣺⡺⡮⡷⣝⣗⢽⢽⣽⢽⢶⢦⡨⠌⢔⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⡠⠨⡪⡹⡸⡑⡕⡑⢄⠕⠄⠔⡈⠜⡈⡂⡂⢅⠁⢂⢅⡪⡨⠒⡜⡾⣘⡪⡣⡻⣷⡻⣯⢿⡺⣗⡿⣽⢽⡽⣞⡽⡫⢷⣆⠑⡄⢀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡀⠄⡕⣪⢞⢜⠌⡎⢜⠔⡡⢊⢰⢌⠎⡐⢄⢎⢢⡁⣂⠥⣌⢪⢪⡱⡹⡵⣎⢮⢯⡸⢝⣾⡽⣞⣿⠺⢝⣯⣿⢯⡳⡝⣄⠊⠻⢬⡢⣑⡀⠀⠀
⠀⠀⠀⠀⠀⠀⠠⡐⣼⣪⢯⢽⠢⡃⢊⠊⠜⢬⡢⣟⢮⡣⣕⢵⣱⢵⢵⣳⢯⡷⣯⣞⣞⡮⡯⣗⡯⡪⡫⣎⢷⣻⣿⣺⡿⣼⡿⣝⢽⡷⣝⢆⠁⠀⠈⠝⣖⢦⠀⠀
⠀⠀⠀⠀⢀⠨⠰⡱⡵⣯⢿⡝⢌⢐⠀⠂⠨⡠⢹⣺⡵⣳⢕⣯⢾⣻⡯⣿⣻⣿⣽⣾⣟⣿⣯⢿⡽⣳⢵⢕⡯⡿⣾⡮⣿⡿⣮⡫⣷⡻⣟⣧⡑⡐⢀⠐⡸⣕⡇⠠
⠀⠀⡀⠐⠄⠅⢕⢝⣽⣻⣯⡇⢅⠢⣁⡊⠆⢜⣮⡺⡽⣺⢽⣞⣿⣽⣟⣯⣿⣾⢿⣾⣿⣽⣾⣿⡽⣯⢿⢽⣯⣻⡽⣿⣟⣿⡸⡹⣷⣯⣟⣯⣷⡄⡂⠀⡍⡖⡷⠀
⠐⠀⠀⠨⠀⡘⡌⡇⡗⣟⡾⡊⢔⠅⡆⡌⡪⡘⣮⣞⢿⢽⢽⣺⡿⣾⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⡽⣯⣟⡾⣜⣿⣿⢽⣺⣇⠢⡙⣽⣾⣟⣿⣟⣆⠢⡸⡵⢼⣂
⠀⠀⢀⠠⠁⢜⠌⢌⠪⢪⡫⣎⢆⢇⢧⠪⡐⡘⡮⡿⡽⠹⡙⢕⣛⢿⣻⣿⢿⣻⣽⣿⣿⢿⣿⠿⣟⣿⢵⣷⣻⣪⣾⣟⡿⣯⣷⢑⢸⢸⡽⣿⣜⡿⣟⣞⠁⣳⢽⢯
⠀⠀⠀⠠⢨⢪⢈⠄⡑⡑⣕⢇⢇⢇⢧⢣⡓⣌⠊⡁⠀⠀⡈⢄⠀⠛⡾⡽⣻⣿⣻⣻⣺⠋⠁⠁⠀⠀⢏⢺⣾⣼⡏⡾⣿⣽⣾⢯⡢⡱⡱⣻⣧⢻⣿⣿⡜⣜⢿⡧
⠀⠀⡈⡌⡌⡂⡢⢐⢈⠆⡣⢪⢮⢣⡣⢇⢯⡪⡲⣐⠐⠝⡌⣎⠾⠦⠭⡎⣗⣷⡃⢧⠥⠺⠪⢅⠝⠂⢹⣨⣷⣿⣳⢝⣽⣿⣽⣯⣗⣗⢕⢯⣿⡸⣿⣿⢿⣇⣻⣇
⢠⢧⣫⢵⢕⢗⡊⢆⠢⡊⠔⣹⢪⣳⢱⢩⢇⢯⡳⣝⢽⣳⣖⣶⢽⡯⣗⢕⣗⣟⡮⡪⣺⣻⣷⣶⢶⡿⣽⣳⣿⣿⣧⣛⣾⣿⣷⣟⣷⣯⣳⡺⣿⡥⢼⣿⣿⣷⢸⣷
⢯⢿⢽⣝⢵⢱⣱⠵⡑⡌⢎⡞⡕⡵⡱⡑⡭⡳⡹⡮⣳⢳⣟⣾⣿⣯⡟⡮⣞⣯⣿⢜⠮⣷⣿⣾⣿⣿⣿⣯⣿⡿⣿⣶⢫⣿⣿⣽⣿⣷⣗⢿⣿⡗⡒⣿⣿⣻⣿⣿
⣻⡫⣳⢕⡷⡝⡎⡮⡪⡊⢢⠱⡱⢱⢱⠱⡸⡸⣕⢝⢮⡳⣻⣿⣷⣿⢽⡺⣻⡿⣟⢷⢽⣽⣿⣷⣿⠿⣽⣾⢿⣿⣯⣿⡯⣿⣿⢿⣿⣿⣿⣟⣿⣷⡐⡼⣿⡯⣿⣿
⡒⡕⡇⡯⡪⡎⡭⡪⡒⢌⠂⢕⠸⡨⡣⢣⠱⡱⡱⡳⣹⡪⣳⣿⣿⣻⡯⣟⣶⣿⣿⣽⣟⣾⣿⣿⣿⢿⣿⢯⣻⣿⣿⣿⣿⣻⣿⣯⢿⣿⣿⣿⣿⣿⣷⢏⢿⣿⢿⣿
⡈⡖⡝⣼⢝⢜⡸⡸⡨⡠⡑⡅⢇⠎⣊⢪⢊⢎⢪⢺⢸⢜⢮⢿⣯⡯⠏⡣⡑⡥⠣⠐⡨⠘⢾⢿⣿⣟⡿⣯⣻⣿⣿⢿⣯⣿⣿⣯⢯⢿⣿⣻⣿⡷⣿⣗⢽⢽⢿⣿
⠌⣮⡾⡳⡕⢝⡔⣕⢎⣪⢪⢪⢢⢃⢎⢎⡮⡺⣨⢳⣹⢸⢸⡻⣗⡏⠌⣶⣶⣾⣿⣿⡷⡕⠸⣟⣯⣿⣿⣳⢯⣿⣿⡿⣿⢷⣻⣿⣝⢝⣽⣿⣿⣟⡽⣾⡕⠝⡯⣿
⡨⡮⡳⡩⡸⡲⣹⣵⣟⡮⡺⢸⡰⡫⣸⢜⢮⢺⡸⡸⡜⡌⢎⢎⢗⠕⡨⢒⢜⢭⢗⢕⡰⡜⢼⢿⣿⣻⡾⣽⣎⣿⣿⣿⣽⢿⣗⢿⣽⡮⡪⣾⣟⡷⡍⢿⣣⢘⢮⡿
⠹⡜⡑⡬⡲⡽⣯⣷⢟⢔⢜⡴⡵⢏⢇⣣⢗⡇⢇⠎⡎⡎⡎⡜⢬⡣⠀⣧⣷⣽⣮⣯⡦⡩⣸⡿⣽⣯⢿⠕⢜⣽⣿⣽⡾⡯⣿⡞⣞⡯⡷⡿⣽⣟⠌⣞⣿⢨⢑⣿
⠮⡱⡱⣱⢽⣽⢿⢕⣯⠢⡃⡣⢑⣔⣗⠯⢓⠨⢢⢣⠣⡓⣝⢮⡘⣞⢄⠄⣽⠚⡙⠡⡈⣢⣷⢿⣻⡽⠃⢹⢔⠼⣾⢿⣿⡹⡵⣿⢺⡪⢪⡻⡮⣗⠧⡱⣿⡄⣫⡗
⢽⢸⡹⣕⣟⡞⣕⢯⣯⡇⡂⡢⢓⠌⡢⢨⢂⢕⠕⢅⠣⡊⢎⢗⢳⢸⣝⣗⣷⣶⣶⣷⣿⣟⣿⣻⢝⡮⡅⢂⠯⡪⣯⣿⢿⣎⢺⣽⣯⣻⣜⢜⢜⢜⣱⢱⣯⣏⢷⡯
⣏⢮⡪⡞⣃⢂⢪⢽⡾⣯⢂⢊⠢⡑⢅⠇⡊⠢⡑⢅⠇⢊⠔⣕⡕⡏⣿⡽⣿⣿⣿⣿⣟⣿⢝⡮⣷⢙⢌⠢⡩⡯⣷⣻⣿⣿⣔⢵⣿⡺⣟⣜⢮⢪⢎⡮⣾⣇⢽⡣
⢾⡫⡫⡊⡖⡜⡎⣕⢏⠯⣇⠪⡪⡂⡅⢂⠂⢕⠱⡑⡁⠅⡗⢱⣝⣾⡳⣹⢻⡯⡷⢿⢻⢱⣝⣞⢝⢴⡱⠀⢈⢹⣳⢽⢾⣻⣷⢕⢽⣿⢽⣞⢽⢺⢜⢮⣻⢮⢺⡸
⣣⣣⡳⣵⢽⣺⢽⣳⢱⡩⡪⡪⣐⠹⡸⡲⡸⡨⠬⠨⢰⢰⡱⡵⢻⢺⡺⣵⢻⣜⢮⡳⣽⢵⡣⣇⠣⡵⣫⡂⠰⠨⡷⣻⢽⣻⡾⣿⡸⣿⡽⣗⡝⡧⡳⡱⣻⢯⡣⣗
⣾⣺⡽⡯⣿⣝⡽⡪⡪⡂⢊⠪⡢⢣⠨⡂⣕⣔⡬⠮⠫⠓⠉⣐⢨⠚⡙⡎⡷⣕⣗⢯⡳⣝⢕⢕⣕⢯⠃⠈⡬⡨⡏⡽⣝⢷⣻⣽⣟⡾⣻⣽⣎⢯⡲⡸⣽⢗⣇⠧
⣳⢿⢽⢭⢺⣺⡪⡇⡗⡈⠢⡨⡨⡸⡸⣚⠮⡲⠭⠳⠒⠘⠉⠀⠀⠁⠀⡀⠱⣳⢽⣹⢹⢜⢕⢝⣜⠊⡀⠐⠀⢪⢻⡜⣝⢽⢽⣾⣻⣿⣽⡷⣗⢷⠱⡕⡽⢧⡳⣝
⡽⡽⡱⢱⢽⢮⣻⢊⢮⠠⠄⡀⠈⠀⠀⠀⠀⠈⠨⠀⠀⡀⠀⠀⠀⠀⠂⠀⠈⢘⢓⠕⠕⠡⠁⠁⠂⠀⠀⠀⠀⠀⢏⢷⡸⡜⡜⣷⡯⣷⣿⣽⣯⠫⠣⡯⣣⡣⡯⣞
⡎⠣⣝⣮⣟⣯⢷⡱⡑⠄⠀⠀⠑⠂⠆⢄⠀⠀⠀⠀⠀⠀⠄⢀⠀⠀⠀⠀⠉⠀⠠⠀⠂⠡⠀⠀⠀⠀⠀⠀⠀⠀⠨⢝⢷⡱⡱⢽⣻⢽⡾⣗⣯⢝⢌⡽⣧⠾⡽⣞
⠀⠈⢚⣞⡾⡯⡳⡕⡹⣆⠀⠄⡀⠀⠀⠀⠈⠑⠀⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⡀⠂⠯⣷⢝⢎⡯⡗⣿⣻⢽⠍⠭⠚⢽⡕⣰⢝
"""
# add centered subtitle
width: int = LADY_GAGA.index("\n", 1)
subtitle: str = f"judas_server {__version__}"
padding: int = (width - len(subtitle)) // 2
LADY_GAGA += " " * padding + subtitle + "\n"

View File

View File

View File

@@ -0,0 +1,5 @@
from .auth import auth_bp
from .index import index_bp
from .panel import panel_bp
__all__ = ["auth_bp", "index_bp", "panel_bp"]

View File

@@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import threading
from typing import TYPE_CHECKING
import flask
import flask_login
if TYPE_CHECKING:
from werkzeug.wrappers import Response
bp: flask.Blueprint = flask.Blueprint("api", __name__, url_prefix="/api")
@bp.route("/client/<client_id>", methods=["GET"])
@flask_login.login_required
def get_client_data(client_id: str) -> tuple[Response, int]:
"""API endpoint to get client data by ID.
Args:
client_id (str): The ID of the client.
Returns:
Response: JSON response with client data or error message.
"""
backend = flask.current_app.config["BACKEND"]
data = backend.get_client_data(client_id)
if data is None:
return flask.jsonify({"error": "Client not found"}), 404
return flask.jsonify(data), 200
@bp.route("/clients", methods=["GET"])
@flask_login.login_required
def list_clients() -> tuple[Response, int]:
"""API endpoint to list all clients.
Returns:
Response: JSON response with list of client IDs.
"""
backend = flask.current_app.config["BACKEND"]
client_ids = list(backend.clients.keys())
return flask.jsonify({"clients": client_ids}), 200
def emit_polled_data(app, socketio):
backend = app.config["BACKEND"]
def poll_loop():
import time
while True:
data = {}
for client_id in backend.clients.keys():
data[client_id] = backend.get_client_data(client_id)
socketio.emit("update_data", data)
time.sleep(1)
threading.Thread(name="Socketio", target=poll_loop, daemon=True).start()

View File

@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import TYPE_CHECKING
import flask
import flask_login
from judas_server.web.user import User
if TYPE_CHECKING:
from werkzeug.wrappers import Response
auth_bp: flask.Blueprint = flask.Blueprint(
"auth", __name__, url_prefix="/auth"
)
@auth_bp.route("/login", methods=["GET", "POST"])
def login() -> Response | str:
"""Handles user login via password form."""
if flask.request.method == "POST":
password = flask.request.form.get("password", "")
if password == flask.current_app.config["PASSWORD"]:
user = User("admin")
flask_login.login_user(user)
next_page = flask.request.args.get("next")
return flask.redirect(next_page or flask.url_for("index.index"))
# return flask.redirect(flask.url_for("panel.panel"))
else:
return flask.render_template(
"login.html",
error="Invalid credentials.",
)
return flask.render_template("login.html")
@auth_bp.route("/logout")
@flask_login.login_required
def logout() -> Response:
"""Logs out the current user."""
flask_login.logout_user()
return flask.redirect(flask.url_for("index.index"))

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import TYPE_CHECKING
import flask
import flask_login
if TYPE_CHECKING:
from werkzeug.wrappers import Response
index_bp: flask.Blueprint = flask.Blueprint("index", __name__)
@index_bp.route("/")
def index() -> Response | str:
"""Renders the index page."""
return flask.render_template(
"index.html", logged=flask_login.current_user.is_authenticated
)

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import flask
import flask_login
panel_bp: flask.Blueprint = flask.Blueprint(
"panel", __name__, url_prefix="/panel"
)
@panel_bp.route("")
@flask_login.login_required
def panel() -> str:
"""Renders the main panel page with PC details.
Returns:
Rendered HTML template with PC details.
"""
return flask.render_template("panel.html")

View File

@@ -0,0 +1,80 @@
:root {
--ctp-rosewater: #f5e0dc;
--ctp-rosewater-rgb: 245 224 220;
--ctp-rosewater-hsl: 9.600 55.556% 91.176%;
--ctp-flamingo: #f2cdcd;
--ctp-flamingo-rgb: 242 205 205;
--ctp-flamingo-hsl: 0.000 58.730% 87.647%;
--ctp-pink: #f5c2e7;
--ctp-pink-rgb: 245 194 231;
--ctp-pink-hsl: 316.471 71.831% 86.078%;
--ctp-mauve: #cba6f7;
--ctp-mauve-rgb: 203 166 247;
--ctp-mauve-hsl: 267.407 83.505% 80.980%;
--ctp-red: #f38ba8;
--ctp-red-rgb: 243 139 168;
--ctp-red-hsl: 343.269 81.250% 74.902%;
--ctp-maroon: #eba0ac;
--ctp-maroon-rgb: 235 160 172;
--ctp-maroon-hsl: 350.400 65.217% 77.451%;
--ctp-peach: #fab387;
--ctp-peach-rgb: 250 179 135;
--ctp-peach-hsl: 22.957 92.000% 75.490%;
--ctp-yellow: #f9e2af;
--ctp-yellow-rgb: 249 226 175;
--ctp-yellow-hsl: 41.351 86.047% 83.137%;
--ctp-green: #a6e3a1;
--ctp-green-rgb: 166 227 161;
--ctp-green-hsl: 115.455 54.098% 76.078%;
--ctp-teal: #94e2d5;
--ctp-teal-rgb: 148 226 213;
--ctp-teal-hsl: 170.000 57.353% 73.333%;
--ctp-sky: #89dceb;
--ctp-sky-rgb: 137 220 235;
--ctp-sky-hsl: 189.184 71.014% 72.941%;
--ctp-sapphire: #74c7ec;
--ctp-sapphire-rgb: 116 199 236;
--ctp-sapphire-hsl: 198.500 75.949% 69.020%;
--ctp-blue: #89b4fa;
--ctp-blue-rgb: 137 180 250;
--ctp-blue-hsl: 217.168 91.870% 75.882%;
--ctp-lavender: #b4befe;
--ctp-lavender-rgb: 180 190 254;
--ctp-lavender-hsl: 231.892 97.368% 85.098%;
--ctp-text: #cdd6f4;
--ctp-text-rgb: 205 214 244;
--ctp-text-hsl: 226.154 63.934% 88.039%;
--ctp-subtext1: #bac2de;
--ctp-subtext1-rgb: 186 194 222;
--ctp-subtext1-hsl: 226.667 35.294% 80.000%;
--ctp-subtext0: #a6adc8;
--ctp-subtext0-rgb: 166 173 200;
--ctp-subtext0-hsl: 227.647 23.611% 71.765%;
--ctp-overlay2: #9399b2;
--ctp-overlay2-rgb: 147 153 178;
--ctp-overlay2-hsl: 228.387 16.757% 63.725%;
--ctp-overlay1: #7f849c;
--ctp-overlay1-rgb: 127 132 156;
--ctp-overlay1-hsl: 229.655 12.775% 55.490%;
--ctp-overlay0: #6c7086;
--ctp-overlay0-rgb: 108 112 134;
--ctp-overlay0-hsl: 230.769 10.744% 47.451%;
--ctp-surface2: #585b70;
--ctp-surface2-rgb: 88 91 112;
--ctp-surface2-hsl: 232.500 12.000% 39.216%;
--ctp-surface1: #45475a;
--ctp-surface1-rgb: 69 71 90;
--ctp-surface1-hsl: 234.286 13.208% 31.176%;
--ctp-surface0: #313244;
--ctp-surface0-rgb: 49 50 68;
--ctp-surface0-hsl: 236.842 16.239% 22.941%;
--ctp-base: #1e1e2e;
--ctp-base-rgb: 30 30 46;
--ctp-base-hsl: 240.000 21.053% 14.902%;
--ctp-mantle: #181825;
--ctp-mantle-rgb: 24 24 37;
--ctp-mantle-hsl: 240.000 21.311% 11.961%;
--ctp-crust: #11111b;
--ctp-crust-rgb: 17 17 27;
--ctp-crust-hsl: 240.000 22.727% 8.627%;
}

View File

@@ -1,206 +1,202 @@
:root {
--nord-bg0: #2e3440;
--nord-bg1: #3b4252;
--nord-bg2: #434c5e;
--nord-bg3: #4c566a;
--nord-fg0: #eceff4;
--nord-fg1: #e5e9f0;
--nord-fg2: #d8dee9;
--nord-acc0: #8fbcbb;
--nord-acc1: #88c0d0;
--nord-acc2: #81a1c1;
--nord-acc3: #5e81ac;
--nord-aur0: #bf616a;
--nord-aur1: #d08770;
--nord-aur2: #ebcb8b;
--nord-aur3: #a3be8c;
--nord-aur4: #b48ead;
}
@import "palette.css";
* {
margin: 0;
padding: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: var(--nord-aur4);
font-family: monospace, sans-serif !important;
color: var(--nord-fg0);
background-color: var(--ctp-base);
font-family: monospace, sans-serif !important;
color: var(--ctp-text);
}
input {
font-family: inherit;
color: #eceff4;
background-color: var(--nord-bg2);
border: none;
border-radius: 0.25rem;
padding: 0.25rem;
font-family: inherit;
color: #eceff4;
background-color: var(--ctp-crust);
border: none;
border-radius: 0.25rem;
padding: 0.25rem;
}
a {
color: var(--nord-acc0);
text-decoration: none;
color: var(--ctp-blue);
text-decoration: none;
}
#wrapper {
display: flex;
flex-direction: column;
min-height: 100vh;
display: flex;
flex-direction: column;
min-height: 100vh;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
background-color: var(--nord-bg0);
color: var(--nord-fg0);
padding: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
background-color: var(--ctp-mantle);
/* color: var(--ctp-text); */
padding: 1rem;
}
main {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1rem;
background-color: var(--nord-bg1);
flex-grow: 1;
text-align: center;
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1rem;
/* background-color: var(--ctp-base); */
flex-grow: 1;
}
header a {
text-decoration: none;
color: var(--nord-fg0);
text-decoration: none;
/* color: var(--nord-fg0); */
}
.button {
display: inline-block;
padding: 0.5rem 1rem;
background-color: var(--nord-acc0);
color: var(--nord-bg0);
border: none;
border-radius: 0.25rem;
text-decoration: none;
transition: 0.3s ease-in-out;
display: inline-block;
padding: 0.5rem 1rem;
background-color: var(--ctp-lavender);
color: var(--ctp-base);
border: none;
border-radius: 0.25rem;
text-decoration: none;
transition: 0.3s ease-in-out;
}
.button a:hover {
color: var(--nord-bg0);
text-decoration: none;
}
/* .button a:hover { */
/* color: var(--nord-bg0); */
/* text-decoration: none; */
/* } */
.button:hover {
background-color: var(--nord-acc2);
cursor: pointer;
background-color: var(--ctp-mauve);
cursor: pointer;
}
.center {
text-align: center;
text-align: center;
}
.error-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 1rem;
padding: 1rem;
background-color: var(--nord-aur0);
color: var(--nord-fg0);
border: 6px solid var(--nord-aur1);
border-radius: 24px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 1rem;
padding: 1rem;
background-color: var(--ctp-surface0);
color: var(--ctp-red);
border: 6px solid var(--ctp-red);
border-radius: 24px;
}
.center-table {
margin: 0 auto;
width: 100%;
margin: 0 auto;
width: 100%;
}
.select-table{
border-collapse: collapse;
border: 2px solid var(--nord-fg0);
.select-table {
border-collapse: collapse;
border: 2px solid var(--ctp-surface0);
}
.select-table thead {
position: sticky;
top: -1px;
z-index: 2;
position: sticky;
top: -1px;
z-index: 2;
}
.select-table th, .select-table td {
padding: 0.5rem;
text-align: center;
border: 1px solid var(--nord-fg1);
border-collapse: collapse;
.select-table th,
.select-table td {
padding: 0.5rem;
text-align: center;
border: 1px solid var(--ctp-surface0);
border-collapse: collapse;
}
.select-table th {
background-color: var(--nord-bg2);
color: var(--nord-fg0);
background-color: var(--ctp-surface1);
color: var(--nord-fg0);
}
.select-table a {
display: block;
color: var(--nord-acc0);
text-decoration: none;
transition: 0.1s ease-in-out;
display: block;
/* color: var(--nord-acc0); */
text-decoration: none;
transition: 0.1s ease-in-out;
}
.select-table tr {
transition: 0.1s ease-in-out;
transition: 0.1s ease-in-out;
}
.select-table tr:hover {
background-color: var(--nord-acc1);
background-color: var(--ctp-surface0);
}
.select-table tr:hover a {
color: var(--nord-bg0);
color: var(--ctp-base);
}
.red-bg {
background-color: var(--nord-aur0);
background-color: var(--ctp-red);
}
.yellow-bg {
background-color: var(--nord-aur2);
background-color: var(--ctp-yellow);
}
.green-bg {
background-color: var(--nord-aur3);
background-color: var(--ctp-green);
}
.button-container {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
}
.link {
transition: 0.3s ease-in-out;
transition: 0.3s ease-in-out;
}
.link:hover {
color: var(--nord-acc2);
color: var(--ctp-blue);
}
.details-table tr td:first-child {
font-weight: 900;
background-color: var(--nord-bg3);
white-space: nowrap;
width: 1%;
font-weight: 900;
background-color: var(--ctp-surface0);
white-space: nowrap;
width: 1%;
}
.details-table {
border-collapse: collapse;
border: 2px solid var(--nord-fg0);
border-collapse: collapse;
border: 2px solid var(--ctp-surface1);
}
.details-table th, .details-table td {
padding: 0.5rem;
text-align: left;
border: 1px solid var(--nord-fg1);
border-collapse: collapse;
}
.details-table th,
.details-table td {
padding: 0.5rem;
text-align: left;
border: 1px solid var(--ctp-text);
border-collapse: collapse;
}
#notify {
display: none;
position: fixed;
top: 3rem;
right: 50%;
transform: translateX(50%);
background-color: var(--ctp-surface1);
padding: 1rem 2rem;
border: 4px solid var(--ctp-text);
border-radius: 1rem;
opacity: 0.8;
}

View File

@@ -1,36 +1,44 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>judas panel - details</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<link
rel="stylesheet"
href="{{ url_for('static', filename='css/style.css') }}"
/>
</head>
<body>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('index') }}">judas</a></h1>
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
</header>
<main>
<div class="button-container">
<p><a href="{{ url_for('panel') }}" class="link">Back to Panel</a></p>
<h2>{{ pc.id }}</h2>
<p><a href="{{ url_for('stream', pc_id=pc.id) }}" class="link">View Stream</a></p>
</div>
<table class="center-table details-table">
<tbody>
<tr>
<td>Status</td>
<td>{{ pc.status }}</td>
</tr>
<tr>
<td>Last Seen</td>
<td>{{ pc.last_seen }}</td>
</tr>
</tbody>
</table>
</main>
<header>
<h1><a href="{{ url_for('index.index') }}">judas</a></h1>
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
</header>
<main>
<div class="button-container">
<p><a href="{{ url_for('panel') }}" class="link">Back to Panel</a></p>
<h2>{{ pc.id }}</h2>
<p>
<a href="{{ url_for('stream', pc_id=pc.id) }}" class="link"
>View Stream</a
>
</p>
</div>
<table class="center-table details-table">
<tbody>
<tr>
<td>Status</td>
<td>{{ pc.status }}</td>
</tr>
<tr>
<td>Last Seen</td>
<td>{{ pc.last_seen }}</td>
</tr>
</tbody>
</table>
</main>
</div>
</body>
</html>
</body>
</html>

View File

@@ -1,54 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>judas</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>judas</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('index') }}">judas</a></h1>
{% if logged %}
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
{% else %}
<p><a class="button" href="{{ url_for('login') }}">Login</a></p>
{% endif %}
</header>
<main class="center">
<div>
<p>Welcome to</p>
<h2 id="typing-text" style="font-size: 3rem;">judas</h2>
<p>a remote PC fleet management system</p>
</div>
<p style="color: #bf616a;"><strong>Notice:</strong> Please use this system responsibly and in accordance with all applicable laws and organizational policies.</p>
{% if logged %}
<p><a class="button" href="{{ url_for('panel') }}">Go to panel</a></p>
{% else %}
<p>Please <a href="{{ url_for('login')}}" class="link">log in</a> to manage your remote PCs.</p>
{% endif %}
</main>
</div>
<script>
var i = 0;
var txt = document.getElementById("typing-text").innerHTML;
var minSpeed = 50;
var maxSpeed = 200;
<div id="wrapper">
<header>
<h1><a href="{{ url_for('index.index') }}">judas</a></h1>
{% if logged %}
<p><a class="button" href="{{ url_for('auth.logout') }}">Logout</a></p>
{% else %}
<p><a class="button" href="{{ url_for('auth.login') }}">Login</a></p>
{% endif %}
</header>
<main class="center">
<div>
<p>Welcome to</p>
<h2 id="typing-text" style="font-size: 3rem;">judas</h2>
<p>a remote PC fleet management system</p>
</div>
<p style="color: #bf616a;"><strong>Notice:</strong> Please use this system responsibly and in accordance with all applicable laws and organizational policies.</p>
{% if logged %}
<p><a class="button" href="{{ url_for('panel.panel') }}">Go to panel</a></p>
{% else %}
<p>Please <a href="{{ url_for('auth.login')}}" class="link">log in</a> to manage your remote PCs.</p>
{% endif %}
</main>
</div>
<script>
var i = 0;
var txt = document.getElementById("typing-text").innerHTML;
var minSpeed = 50;
var maxSpeed = 200;
document.getElementById("typing-text").innerHTML = "";
document.getElementById("typing-text").innerHTML = "";
function typeWriter() {
if (i < txt.length) {
document.getElementById("typing-text").innerHTML += txt.charAt(i);
i++;
function typeWriter() {
if (i < txt.length) {
document.getElementById("typing-text").innerHTML += txt.charAt(i);
i++;
var randomDelay = Math.floor(Math.random() * (maxSpeed - minSpeed + 1)) + minSpeed;
setTimeout(typeWriter, randomDelay);
}
}
var randomDelay = Math.floor(Math.random() * (maxSpeed - minSpeed + 1)) + minSpeed;
setTimeout(typeWriter, randomDelay);
}
}
typeWriter();
</script>
typeWriter();
</script>
</body>
</html>

View File

@@ -1,32 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>judas - login page</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>judas - login page</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('index') }}">judas</a></h1>
</header>
<main>
<h1>Login</h1>
<form method="post" class="center">
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<br>
<br>
<input type="submit" value="Login" class="button">
{% if error %}
<div class="error-container">
<h1>Login failure</h1>
<p>{{ error }}</p>
</div>
{% endif %}
</form>
</main>
</div>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('index.index') }}">judas</a></h1>
</header>
<main>
<h1>Login</h1>
<form method="post" class="center">
<label for="password">Password:</label>
<input type="password" id="password" name="password" required autofocus>
<br>
<br>
<input type="submit" value="Login" class="button">
{% if error %}
<div class="error-container">
<h1>Login failure</h1>
<p>{{ error }}</p>
</div>
{% endif %}
</form>
</main>
</div>
</body>
</html>
</html>

View File

@@ -1,42 +1,61 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>judas panel</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<link
rel="stylesheet"
href="{{ url_for('static', filename='css/style.css') }}"
/>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.socket.io/4.8.1/socket.io.min.js"></script>
<script>
$(document).ready(function () {
const socket = io();
const dataElement = $("#data");
const showNotify = (message) => {
$("#notify").stop().fadeIn();
$("#notify").text(message);
setTimeout(() => {
$("#notify").fadeOut();
}, 3000);
};
$("#notify").hide();
socket.on("connect", () => {
console.log("Connected to server");
showNotify("Connected to server");
});
socket.on("disconnect", () => {
console.log("Disconnected from server");
showNotify("Disconnected from server");
});
socket.on("update_data", (data) => {
console.log("Received data:", data);
document.getElementById("data").innerHTML = JSON.stringify(
data,
null,
2,
);
});
});
</script>
</head>
<body>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('index') }}">judas</a></h1>
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
</header>
<main>
<h2 class="center">Select a PC to Control</h2>
<p class="center">Choose a PC from the list below to view details or send commands.</p>
<table class="center-table select-table">
<thead>
<tr>
<th>PC ID</th>
<th>Status</th>
<th>Last Seen</th>
</tr>
</thead>
<tbody>
{% for pc in pcs.values() %}
<tr>
<td><a href="{{ url_for('details', pc_id=pc.id) }}">{{ pc.id }}</a></td>
<td class='{% if pc.status == "online" %}green-bg{% elif pc.status == "offline" %}red-bg{% else %}yellow-bg{% endif %}'>{{ pc.status if pc.status else 'Unknown' }}</td> <td>{{ pc.last_seen if pc.last_seen else 'Never' }}</td>
</tr>
{% else %}
<tr>
<td colspan="3">No PCs found.</td>
</tr>
{% endfor %}
</tbody>
</table>
</main>
<header>
<h1><a href="{{ url_for('index.index') }}">judas</a></h1>
<p><a class="button" href="{{ url_for('auth.logout') }}">Logout</a></p>
</header>
<div id="notify"></div>
<main>
<pre id="data"></pre>
</main>
</div>
</body>
</html>
</body>
</html>

View File

@@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>judas panel - stream</title>
</head>
<body>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('index') }}">judas</a></h1>
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
</header>
</div>
</body>
</html>

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import flask_login
class User(flask_login.UserMixin):
"""Represents a user for authentication purposes."""
def __init__(self, id: str) -> None:
super().__init__()
self.id = id
def get_id(self) -> str:
"""Return the unique identifier for the user."""
return self.id
def __str__(self) -> str:
return f"User(id={self.id})"
def __repr__(self) -> str:
return f"User(id={self.id})"
def load_user(user_id):
if user_id == "admin":
return User("admin")
return None

View File

@@ -1,170 +1,67 @@
# -*- coding: utf-8 -*-
from typing import Final
from __future__ import annotations
import flask
import flask_login
import logging as lg
from typing import TYPE_CHECKING
PASSWORD: Final[str] = "123"
from flask import Flask
from flask_login import LoginManager
from flask_socketio import SocketIO
app = flask.Flask(__name__)
app.secret_key = "dildo"
from judas_server.web.user import load_user
login_manager = flask_login.LoginManager()
login_manager.init_app(app)
if TYPE_CHECKING:
from judas_server.backend import BackendServer
PC_DETAILS = {
"PC1": {
"id": "PC1",
"status": "online",
"last_seen": "2023-10-01 12:00:00",
},
"PC2": {
"id": "PC2",
"status": "offline",
"last_seen": "2023-10-01 11:00:00",
},
"PC3": {
"id": "PC3",
"status": "offline",
"last_seen": "2023-10-01 11:00:00",
},
"PC4": {
"id": "PC4",
"status": "offline",
"last_seen": "2023-10-01 11:00:00",
},
"PC5": {
"id": "PC5",
"status": "offline",
"last_seen": "2023-10-01 11:00:00",
},
"PC6": {
"id": "PC6",
"status": "offline",
"last_seen": "2023-10-01 11:00:00",
},
"PC7": {
"id": "PC7",
"status": "offline",
"last_seen": "2023-10-01 11:00:00",
},
}
class JudasWebServer:
def __init__(self, backend: BackendServer, secret_key: str) -> None:
self.logger: lg.Logger = lg.getLogger(
f"{__name__}.{self.__class__.__name__}"
)
self.logger.debug("Initializing JudasWebServer...")
self.backend: BackendServer = backend
class User(flask_login.UserMixin):
"""Represents a user for authentication purposes."""
self.app: Flask = Flask(
__name__, static_folder="static", template_folder="templates"
)
self.app.secret_key = secret_key
def __init__(self, id: str):
super().__init__()
self.id = id
self.app.config["WEB_SERVER"] = self
self.app.config["BACKEND"] = self.backend
# hard-code password
self.app.config["PASSWORD"] = "123"
@login_manager.user_loader
def load_user(user_id: str) -> User | None:
"""Loads a user by user_id.
# extensions
self.login_manager: LoginManager = LoginManager()
Args:
user_id: The ID of the user.
self.socketio: SocketIO = SocketIO(self.app, cors_allowed_origins="*")
Returns:
The User object if found, else None.
"""
if user_id == "admin":
return User("admin")
return None
self.configure_extensions()
self.init_routes()
def configure_extensions(self) -> None:
self.logger.debug("Configuring extensions...")
self.login_manager.init_app(self.app)
self.login_manager.user_loader(load_user)
self.login_manager.login_view = "auth.login"
@app.route("/")
def index() -> flask.Response | str:
"""Renders the index page with a link to the login page."""
return flask.render_template(
"index.html", logged=flask_login.current_user.is_authenticated
)
# TODO: add login page
def init_routes(self) -> None:
self.logger.debug("Initializing routes...")
from judas_server.web.routes import api, auth_bp, index_bp, panel_bp
@app.route("/login", methods=["GET", "POST"])
def login() -> str:
"""Handles user login via password form."""
if flask.request.method == "POST":
password = flask.request.form.get("password", "")
if password == PASSWORD:
user = User("admin")
flask_login.login_user(user)
return flask.redirect(flask.url_for("panel"))
else:
return flask.render_template(
"login.html",
error="Invalid password. Please try again.",
)
return flask.render_template("login.html")
self.app.register_blueprint(index_bp)
self.app.register_blueprint(auth_bp)
self.app.register_blueprint(panel_bp)
self.app.register_blueprint(api.bp)
api.emit_polled_data(self.app, self.socketio)
@app.route("/logout")
@flask_login.login_required
def logout() -> str:
"""Logs out the current user."""
flask_login.logout_user()
return flask.redirect(flask.url_for("index"))
@app.route("/panel")
@flask_login.login_required
def panel() -> str:
"""Renders the main panel page with PC details.
Returns:
Rendered HTML template with PC details.
"""
return flask.render_template(
"panel.html",
username=flask_login.current_user.id,
pcs=PC_DETAILS,
)
@app.route("/details/<pc_id>")
@flask_login.login_required
def details(pc_id: str) -> str:
"""Renders the details page for a specific PC.
Args:
pc_id: The ID of the PC to display details for.
Returns:
Rendered HTML template with PC details.
"""
return flask.render_template(
"details.html",
username=flask_login.current_user.id,
pc=PC_DETAILS[pc_id],
)
@app.route("/stream/<pc_id>")
@flask_login.login_required
def stream(pc_id: str) -> str:
"""Renders the stream page for a specific PC.
Args:
pc_id: The ID of the PC to stream from.
Returns:
Rendered HTML template for streaming.
"""
return flask.render_template(
logged=True,
username=flask_login.current_user.id,
pc=PC_DETAILS[pc_id],
)
@app.route("/stream_feed/<pc_id>")
@flask_login.login_required
def stream_feed(pc_id: str) -> flask.Response:
return flask.Response(mimetype="multipart/x-mixed-replace; boundary=frame")
if __name__ == "__main__":
app.run(debug=True)
def run(self, host: str = "0.0.0.0", port: int = 5000) -> None:
self.logger.info(f"Starting web server on {host}:{port}...")
self.socketio.run(app=self.app, host=host, port=port)
self.logger.info("Server stopped.")

136
uv.lock generated
View File

@@ -1,5 +1,5 @@
version = 1
revision = 2
revision = 3
requires-python = ">=3.13"
[[package]]
@@ -11,6 +11,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" },
]
[[package]]
name = "bidict"
version = "0.23.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/9a/6e/026678aa5a830e07cd9498a05d3e7e650a4f56a42f267a53d22bcda1bdc9/bidict-0.23.1.tar.gz", hash = "sha256:03069d763bc387bbd20e7d49914e75fc4132a41937fa3405417e1a5a2d006d71", size = 29093, upload-time = "2024-02-18T19:09:05.748Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/99/37/e8730c3587a65eb5645d4aba2d27aae48e8003614d6aaf15dda67f702f1f/bidict-0.23.1-py3-none-any.whl", hash = "sha256:5dae8d4d79b552a71cbabc7deb25dfe8ce710b17ff41711e13010ead2abfc3e5", size = 32764, upload-time = "2024-02-18T19:09:04.156Z" },
]
[[package]]
name = "blinker"
version = "1.9.0"
@@ -188,6 +197,19 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/59/f5/67e9cc5c2036f58115f9fe0f00d203cf6780c3ff8ae0e705e7a9d9e8ff9e/Flask_Login-0.6.3-py3-none-any.whl", hash = "sha256:849b25b82a436bf830a054e74214074af59097171562ab10bfa999e6b78aae5d", size = 17303, upload-time = "2023-10-30T14:53:19.636Z" },
]
[[package]]
name = "flask-socketio"
version = "5.5.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "flask" },
{ name = "python-socketio" },
]
sdist = { url = "https://files.pythonhosted.org/packages/d1/1f/54d3de4982df695682af99c65d4b89f8a46fe6739780c5a68690195835a0/flask_socketio-5.5.1.tar.gz", hash = "sha256:d946c944a1074ccad8e99485a6f5c79bc5789e3ea4df0bb9c864939586c51ec4", size = 37401, upload-time = "2025-01-06T19:49:59.056Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/47/38/1b75b3ba3452860211ec87710f9854112911a436ee4d155533e0b83b5cd9/Flask_SocketIO-5.5.1-py3-none-any.whl", hash = "sha256:35a50166db44d055f68021d6ec32cb96f1f925cd82de4504314be79139ea846f", size = 18259, upload-time = "2025-01-06T19:49:56.555Z" },
]
[[package]]
name = "git-cliff"
version = "2.10.0"
@@ -229,6 +251,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/01/61/d4b89fec821f72385526e1b9d9a3a0385dda4a72b206d28049e2c7cd39b8/gitpython-3.1.45-py3-none-any.whl", hash = "sha256:8908cb2e02fb3b93b7eb0f2827125cb699869470432cc885f019b8fd0fccff77", size = 208168, upload-time = "2025-07-24T03:45:52.517Z" },
]
[[package]]
name = "h11"
version = "0.16.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
]
[[package]]
name = "idna"
version = "3.10"
@@ -256,6 +287,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 = "itsdangerous"
version = "2.2.0"
@@ -277,13 +317,20 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
]
[[package]]
name = "judas-protocol"
version = "0.5.0"
source = { git = "https://gitea.pufereq.pl/judas/judas_protocol.git#c48b69ecee16f5824ffd8bce8921341d5fa326b7" }
[[package]]
name = "judas-server"
version = "0.1.0"
version = "0.4.0"
source = { editable = "." }
dependencies = [
{ name = "flask" },
{ name = "flask-login" },
{ name = "flask-socketio" },
{ name = "judas-protocol" },
]
[package.dev-dependencies]
@@ -291,6 +338,10 @@ bump = [
{ name = "git-cliff" },
{ name = "python-semantic-release" },
]
lint = [
{ name = "isort" },
{ name = "ruff" },
]
test = [
{ name = "pytest" },
{ name = "pytest-cov" },
@@ -302,6 +353,8 @@ test = [
requires-dist = [
{ name = "flask", specifier = ">=3.1.1" },
{ name = "flask-login", specifier = ">=0.6.3" },
{ name = "flask-socketio", specifier = ">=5.5.1" },
{ name = "judas-protocol", git = "https://gitea.pufereq.pl/judas/judas_protocol.git" },
]
[package.metadata.requires-dev]
@@ -309,6 +362,10 @@ 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" },
@@ -489,6 +546,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/b2/05/77b60e520511c53d1c1ca75f1930c7dd8e971d0c4379b7f4b3f9644685ba/pytest_mock-3.14.1-py3-none-any.whl", hash = "sha256:178aefcd11307d874b4cd3100344e7e2d888d9791a6a1d9bfe90fbc1b74fd1d0", size = 9923, upload-time = "2025-05-26T13:58:43.487Z" },
]
[[package]]
name = "python-engineio"
version = "4.12.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "simple-websocket" },
]
sdist = { url = "https://files.pythonhosted.org/packages/ba/0b/67295279b66835f9fa7a491650efcd78b20321c127036eef62c11a31e028/python_engineio-4.12.2.tar.gz", hash = "sha256:e7e712ffe1be1f6a05ee5f951e72d434854a32fcfc7f6e4d9d3cae24ec70defa", size = 91677, upload-time = "2025-06-04T19:22:18.789Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/0c/fa/df59acedf7bbb937f69174d00f921a7b93aa5a5f5c17d05296c814fff6fc/python_engineio-4.12.2-py3-none-any.whl", hash = "sha256:8218ab66950e179dfec4b4bbb30aecf3f5d86f5e58e6fc1aa7fde2c698b2804f", size = 59536, upload-time = "2025-06-04T19:22:16.916Z" },
]
[[package]]
name = "python-gitlab"
version = "6.2.0"
@@ -526,6 +595,19 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/89/be/10966ab26f0f26a58b7f56b31c6cb71dea85c8cbaa856f4989c035a62901/python_semantic_release-10.2.0-py3-none-any.whl", hash = "sha256:88ebe464bd15edf9793715212257fc3d04baafea10a6362bc78d69892418ce88", size = 141226, upload-time = "2025-06-29T22:06:31.14Z" },
]
[[package]]
name = "python-socketio"
version = "5.13.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "bidict" },
{ name = "python-engineio" },
]
sdist = { url = "https://files.pythonhosted.org/packages/21/1a/396d50ccf06ee539fa758ce5623b59a9cb27637fc4b2dc07ed08bf495e77/python_socketio-5.13.0.tar.gz", hash = "sha256:ac4e19a0302ae812e23b712ec8b6427ca0521f7c582d6abb096e36e24a263029", size = 121125, upload-time = "2025-04-12T15:46:59.933Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/3c/32/b4fb8585d1be0f68bde7e110dffbcf354915f77ad8c778563f0ad9655c02/python_socketio-5.13.0-py3-none-any.whl", hash = "sha256:51f68d6499f2df8524668c24bcec13ba1414117cfb3a90115c559b601ab10caf", size = 77800, upload-time = "2025-04-12T15:46:58.412Z" },
]
[[package]]
name = "requests"
version = "2.32.4"
@@ -566,6 +648,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"
@@ -575,6 +683,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" },
]
[[package]]
name = "simple-websocket"
version = "1.1.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "wsproto" },
]
sdist = { url = "https://files.pythonhosted.org/packages/b0/d4/bfa032f961103eba93de583b161f0e6a5b63cebb8f2c7d0c6e6efe1e3d2e/simple_websocket-1.1.0.tar.gz", hash = "sha256:7939234e7aa067c534abdab3a9ed933ec9ce4691b0713c78acb195560aa52ae4", size = 17300, upload-time = "2024-10-10T22:39:31.412Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/52/59/0782e51887ac6b07ffd1570e0364cf901ebc36345fea669969d2084baebb/simple_websocket-1.1.0-py3-none-any.whl", hash = "sha256:4af6069630a38ed6c561010f0e11a5bc0d4ca569b36306eb257cd9a192497c8c", size = 13842, upload-time = "2024-10-10T22:39:29.645Z" },
]
[[package]]
name = "smmap"
version = "5.0.2"
@@ -665,3 +785,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/09/5e/1655cf481e079c1f22d0cabdd4e51733679932718dc23bf2db175f329b76/wrapt-1.17.2-cp313-cp313t-win_amd64.whl", hash = "sha256:eaf675418ed6b3b31c7a989fd007fa7c3be66ce14e5c3b27336383604c9da85c", size = 40750, upload-time = "2025-01-14T10:35:03.378Z" },
{ url = "https://files.pythonhosted.org/packages/2d/82/f56956041adef78f849db6b289b282e72b55ab8045a75abad81898c28d19/wrapt-1.17.2-py3-none-any.whl", hash = "sha256:b18f2d1533a71f069c7f82d524a52599053d4c7166e9dd374ae2136b7f40f7c8", size = 23594, upload-time = "2025-01-14T10:35:44.018Z" },
]
[[package]]
name = "wsproto"
version = "1.2.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "h11" },
]
sdist = { url = "https://files.pythonhosted.org/packages/c9/4a/44d3c295350d776427904d73c189e10aeae66d7f555bb2feee16d1e4ba5a/wsproto-1.2.0.tar.gz", hash = "sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065", size = 53425, upload-time = "2022-08-23T19:58:21.447Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/78/58/e860788190eba3bcce367f74d29c4675466ce8dddfba85f7827588416f01/wsproto-1.2.0-py3-none-any.whl", hash = "sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736", size = 24226, upload-time = "2022-08-23T19:58:19.96Z" },
]