From a172b5465f4aa2a8907f30f7cdf3cca643394869 Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 6 Mar 2026 18:59:36 +0100 Subject: [PATCH] docs: move dev quick-reference to Instructions.md --- Docs/Instructions.md | 31 +++++++++++++++++++++++++++++++ Docs/Tasks.md | 33 --------------------------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/Docs/Instructions.md b/Docs/Instructions.md index cc0c3be..17670ca 100644 --- a/Docs/Instructions.md +++ b/Docs/Instructions.md @@ -226,3 +226,34 @@ Verify against [Architekture.md](Architekture.md) and the project structure rule - **Never** push directly to `main` — always use feature branches. - **Never** skip the review step — sloppy code compounds over time. - **Never** leave a task half-done — finish it or revert it. + +--- + +## 7. Dev Quick-Reference + +### Start / stop the stack + +```bash +make up # start all containers (from repo root) +make down # stop all containers +make logs # tail logs +``` + +Backend: `http://127.0.0.1:8000` · Frontend (Vite proxy): `http://127.0.0.1:5173` + +### API login (dev) + +The frontend SHA256-hashes the password before sending it to the API. +The session cookie is named `bangui_session`. + +```bash +# Dev master password: Hallo123! +HASHED=$(echo -n "Hallo123!" | sha256sum | awk '{print $1}') +TOKEN=$(curl -s -X POST http://127.0.0.1:8000/api/auth/login \ + -H 'Content-Type: application/json' \ + -d "{\"password\":\"$HASHED\"}" \ + | python3 -c 'import sys,json; print(json.load(sys.stdin)["token"])') + +# Use token in subsequent requests: +curl -H "Cookie: bangui_session=$TOKEN" http://127.0.0.1:8000/api/dashboard/status +``` diff --git a/Docs/Tasks.md b/Docs/Tasks.md index 0176e31..99b04b0 100644 --- a/Docs/Tasks.md +++ b/Docs/Tasks.md @@ -2,39 +2,6 @@ This document breaks the entire BanGUI project into development stages, ordered so that each stage builds on the previous one. Every task is described in prose with enough detail for a developer to begin work. References point to the relevant documentation. ---- - -## Dev Quick-Reference - -### Environment - -Start / stop the dev stack (from repo root): - -```bash -make up # start all containers -make down # stop all containers -make logs # tail logs -``` - -Backend is reachable at `http://127.0.0.1:8000` (direct) or via the Vite proxy at `http://127.0.0.1:5173`. - -### API Login (dev) - -The frontend SHA256-hashes the password before sending it to the API. -The session cookie is named `bangui_session`. - -```bash -# Dev master password: Hallo123! -HASHED=$(echo -n "Hallo123!" | sha256sum | awk '{print $1}') -TOKEN=$(curl -s -X POST http://127.0.0.1:8000/api/auth/login \ - -H 'Content-Type: application/json' \ - -d "{\"password\":\"$HASHED\"}" \ - | python3 -c 'import sys,json; print(json.load(sys.stdin)["token"])') - -# Use token in subsequent requests: -curl -H "Cookie: bangui_session=$TOKEN" http://127.0.0.1:8000/api/dashboard/status -``` - --- 1. ✅ DONE — fix ban list 500 error **Root cause:** `compose.debug.yml` mounted `fail2ban-dev-config` as a named Docker volume