3.2 KiB
3.2 KiB
ID: DOC_000013 | Version: 0.2.2 | Status: Draft By: Codex (GPT-5)
Development
Repository-Struktur (Kurz)
backend/: FastAPI-App, Auth, Update-Logik, Templates, Static Assets.scripts/: Install/Deploy/Update/Helper-Skripte.systemd/: Beispiel-Unit.docs/architecture/: OpenAPI-Spezifikation fuer Update-Service.docs/: Dokumentation.assets/: Branding und Design.sk.sh: Legacy-CLI.
Lokales Setup
./scripts/create_venv.sh
source .venv/bin/activate
./scripts/run.sh
Standard: 0.0.0.0:80. Fuer andere Ports:
HOST=127.0.0.1 PORT=8000 ./scripts/run.sh
Release-Upload (Dev/Prod)
Das Update-Artefakt wird als tar.gz gebaut und ueber den Update-Service hochgeladen.
Das Script nutzt VERSION und laedt ein vollstaendiges Release (kein Delta).
Vorbereitung:
cp update-addon.env.example update-addon.env
Beispiel (Dev):
./scripts/upload_release.sh --profile dev
Tests und Lint
Im Repo sind keine automatisierten Tests enthalten. Verfuegbare Checks:
- Bash-Syntax:
bash -n sk.sh - ShellCheck:
shellcheck sk.sh
Coding Conventions
- Bash 4+,
set -euo pipefailin neuen Skripten. - Python: FastAPI-Patterns, klare Modultrennung (Auth, Actions, Update, OIDC).
Beitrag und Workflow
- Arbeite mit Feature-Branches.
- Aktualisiere
VERSION, Doku-Header undCHANGELOG.mdgemaess SOP. - PRs sollten Verhalten, Risiken und manuelle Tests beschreiben.
CI/CD
Aktuell keine CI/CD-Pipeline im Repository definiert.
Legacy/Interna
SKD_UPDATE_URLundSKD_UPDATE_STATUS_URLsind inbackend/settings.pynoch vorhanden, werden aber im aktuellen Code nicht genutzt.
Externe Abhaengigkeiten (mit Quelle und Zweck)
Python-Libraries (requirements.txt)
- FastAPI: https://fastapi.tiangolo.com/ (Web-API und Routing)
- Uvicorn: https://www.uvicorn.org/ (ASGI-Server)
- Pydantic: https://docs.pydantic.dev/ (Datenmodelle und Validierung)
- Jinja2: https://jinja.palletsprojects.com/ (HTML-Templates)
- PyJWT: https://pyjwt.readthedocs.io/ (JWT-Erstellung und -Validierung)
- python-pam: https://pypi.org/project/python-pam/ (PAM-Authentifizierung)
- httpx: https://www.python-httpx.org/ (HTTP-Client fuer Update/OIDC)
- cryptography: https://cryptography.io/ (Krypto-Abhaengigkeit fuer JWT)
- PyYAML (optional): https://pyyaml.org/ (YAML-Parsing in
scripts/deploy.sh)
System-Tools
- systemd: https://www.freedesktop.org/software/systemd/man/systemd.html (Service-Management)
- Linux-PAM: https://www.linux-pam.org/ (System-Authentifizierung)
- usermod/pkill/shutdown: https://man7.org/linux/man-pages/ (Account- und Session-Management)
- curl/tar/sha256sum/rsync/git/ssh: https://man7.org/linux/man-pages/ (Install/Update/Deploy)
- jq (optional): https://stedolan.github.io/jq/ (JSON-Parsing in Beispielen)
- notify-send: https://developer.gnome.org/libnotify/ (Desktop-Benachrichtigungen)
- paplay/aplay: https://www.freedesktop.org/wiki/Software/PulseAudio/ und https://alsa-project.org/ (Sound)
Externe Services
- Update-Service (intern): https://git.wlkns.org/stephan/update-webservice (Manifest/Status/Enrollment)
- OIDC-Service (intern): https://git.wlkns.org/stephan/oicd (Login via OIDC)
Weitere Dokumente
- Architektur:
docs/ARCHITECTURE.md - Deployment:
docs/DEPLOYMENT.md