feat: server console (Feature 2) & complete roadmap

This commit is contained in:
Hitonabi
2026-06-20 21:47:37 +02:00
parent ef7f02e19f
commit 16199ce53a
6 changed files with 90 additions and 21 deletions
+4 -3
View File
@@ -5,11 +5,12 @@ Wenn MC_TOKEN gesetzt ist, muss jeder API-Call den Header X-MC-Token mitschicken
Leer = keine Auth (nur im vertrauenswuerdigen LAN betreiben!).
"""
from fastapi import Header, HTTPException
from fastapi import Header, HTTPException, Query
from config import TOKEN
def auth(x_mc_token: str = Header(default="")):
if TOKEN and x_mc_token != TOKEN:
def auth(x_mc_token: str = Header(default=""), token: str = Query(default="")):
t = x_mc_token or token
if TOKEN and t != TOKEN:
raise HTTPException(status_code=401, detail="Falsches oder fehlendes Token.")