refractor: afgerond

This commit is contained in:
kodi
2026-02-28 15:51:58 +01:00
parent df2a577402
commit 7d84733b17
4 changed files with 135 additions and 5 deletions
+47 -4
View File
@@ -18,15 +18,55 @@ Refactoring must always:
## Repository structure
Backend (FastAPI)
- control/app.py (main API)
Backend (FastAPI modular monolith)
Bootstrap
- control/app.py (application bootstrap & router wiring ONLY)
System / platform router
- control/app_system.py
Feature routers
- control/app_containers.py
- control/app_pods.py
- control/app_networks.py
- control/app_files.py
- control/app_images.py
Shared infrastructure
- control/common.py
WebUI (static Apache)
- webui/html/index.html
- webui/html/assets/js/tabs/
- webui/conf/httpd.conf
### Backend architecture rule (HARD)
control/app.py is a bootstrap layer only.
It may:
- create FastAPI app
- include routers
- register startup events
It must NOT:
- contain feature endpoints
- contain system logic
- contain Podman or systemctl implementations
All endpoints belong in routers.
### Module ownership rule
If unsure where new logic belongs:
- shared logic → control/common.py
- system/platform logic → control/app_system.py
- feature logic → corresponding app_<feature>.py router
Never introduce new endpoints in control/app.py.
---
## Runtime architecture (IMPORTANT)
@@ -123,8 +163,11 @@ New functionality must be added via:
Security rules:
- No shell=True
- subprocess must be explicit and safe
- Respect allowed_units.txt
- Never assume systemd states.
- Never assume systemd states
Legacy notice:
allow_list / allowed_units.txt functionality has been removed
and must NOT be reintroduced.
---