13 Commits

10 changed files with 35 additions and 14 deletions

14
.vscode/launch.json vendored
View File

@@ -2,18 +2,12 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Launch Flask", "name": "Debug Flask",
"type": "debugpy", "type": "debugpy",
"request": "launch", "request": "launch",
"module": "flask", "program": "${workspaceFolder}/src/judas_server/__main__.py",
"env": { "console": "integratedTerminal",
"FLASK_APP": "judas_server/web/web_server.py" "justMyCode": true
},
"args": [
"run",
"--host",
"0.0.0.0"
]
} }
] ]
} }

View File

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

View File

@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.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-09
### Bug Fixes ### Bug Fixes

View File

@@ -4,7 +4,7 @@ build-backend = "uv_build"
[project] [project]
name = "judas_server" name = "judas_server"
version = "0.1.0" version = "0.1.1"
description = "The backbone of the remote PC fleet management system." description = "The backbone of the remote PC fleet management system."
readme = "README.md" readme = "README.md"
authors = [] authors = []
@@ -21,6 +21,9 @@ test = [
"pytest-mock>=3.14.1", "pytest-mock>=3.14.1",
] ]
[tool.basedpyright]
typeCheckingMode = "basic"
[tool.ruff] [tool.ruff]
line-length = 79 line-length = 79
exclude = ["tests/*"] exclude = ["tests/*"]

View File

@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
import logging as lg
if __name__ == "__main__":
from judas_server.web.server import JudasWebServer
lg.basicConfig(
level=lg.DEBUG,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
)
server = JudasWebServer(secret_key="dildo")
server.run(
host="0.0.0.0",
port=5000,
)

View File

View File

View File

View File

View File

@@ -85,7 +85,7 @@ def index() -> flask.Response | str:
@app.route("/login", methods=["GET", "POST"]) @app.route("/login", methods=["GET", "POST"])
def login() -> str: def login() -> flask.Response | str:
"""Handles user login via password form.""" """Handles user login via password form."""
if flask.request.method == "POST": if flask.request.method == "POST":
password = flask.request.form.get("password", "") password = flask.request.form.get("password", "")
@@ -154,6 +154,7 @@ def stream(pc_id: str) -> str:
Rendered HTML template for streaming. Rendered HTML template for streaming.
""" """
return flask.render_template( return flask.render_template(
"stream.html",
logged=True, logged=True,
username=flask_login.current_user.id, username=flask_login.current_user.id,
pc=PC_DETAILS[pc_id], pc=PC_DETAILS[pc_id],