rule+docs: strict per-step commit rule, updated home cluster docs, session summary

- AGENTS.md: added STRICT RULE section — commit after every chat step
- locations/home-cluster-192-168-170.md: full rewrite (4min.pro domain, all SSL done, Forgejo backup, infra org)
- dialog-summaries/2026-06-06-home-cluster-ssl-pxe-forgejo-backup.md: session summary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
post 2026-06-07 01:24:16 +03:00
parent b130a3c6b6
commit e44e5db4a8
3 changed files with 241 additions and 150 deletions

View file

@ -19,6 +19,43 @@ At the beginning of work:
9. Read the active project's `repositories.md` when it exists.
10. Update project status when a meaningful change happens.
## STRICT RULE: Commit After Every Chat Step
This is a mandatory rule for all AI agents and computers using this knowledge base.
**After every completed step in a chat session — commit.**
A "step" is any of the following:
- A problem was encountered (even unsolved)
- A solution was found and verified
- A configuration was changed
- A decision was made
- A tool or service was set up or debugged
**What to commit each time:**
1. If a problem appeared → `problems/YYYY-MM-DD-short-description.md` (even if unsolved — include symptoms and what was tried)
2. If a solution was found → update that problem file with root cause + fix + verification
3. If a configuration changed → update the relevant `locations/` or project file
4. If a decision was made → `projects/<project>/decisions.md`
**Commit message format:** `step: <what happened in one line>`
**Push target:** `https://git.4min.pro/infra/agent-knowledge-base` (Forgejo primary). GitHub is auto-mirrored.
**Why this matters:** The user works across multiple computers and AI agents. If a problem is not committed immediately, the next agent starts blind and repeats the same investigation. Even a one-line problem entry is better than nothing.
**Minimum commit per step:**
```bash
cd /path/to/agent-knowledge-base
git add -A
git commit -m "step: <what happened>"
git push origin main
```
If the step produced no new knowledge (pure conversation, no changes), skip the commit.
---
## Agent Self-Learning Loop
Every agent should follow this loop:

View file

@ -0,0 +1,100 @@
# Dialog Summary: Home Cluster — SSL, PXE, Forgejo Migration, NAS Backup
**Date:** 2026-06-06 / 2026-06-07
**Machine:** airM1 (Mac, 192.168.170.x) + Proxmox/Docker/TrueNAS via SSH
**Agent:** Claude Code (claude-sonnet-4-6)
---
## What Was Done
### 1. SSL — All 9 Domains ✅
All Let's Encrypt certs issued for 4min.pro zone.
`www.4min.pro` and `monitor.4min.pro` required HTTP challenge (DNS challenge failed due to SOA min TTL 10800s NXDOMAIN negative cache). Used `/tmp/npm_http_ssl.py` on Docker host.
### 2. PXE Boot (netboot.xyz) ✅
**Problem:** PXE clients got no response.
**Three root causes fixed:**
1. Keenetic DHCP pool `_WEBADMIN` had no option 66/67 → added `option 66 ascii 192.168.170.30` and `option 67 ascii netboot.xyz.kpxe`
2. Docker bridge NAT breaks TFTP — TFTP opens ephemeral UDP port for data, Docker-proxy has no rule for it → fixed with `network_mode: host` in netboot.xyz compose
3. nginx inside container tried port 80 (occupied by NPM) → set `NGINX_PORT=8083` and `listen 8083` in nginx config
See `problems/` for detailed write-up.
### 3. Forgejo Git Server ✅
- CT100 (192.168.170.41), Forgejo v10.0.3
- SSL: https://git.4min.pro
- Disk expanded: 20GB → 256GB
- Org structure: `garage` (project repos) + `infra` (knowledge base and shared)
- All repos migrated or created (KaMaz, kamaz5360, joystick, ProjectionMapping, StereoWallND, agent-knowledge-base)
- `agent-knowledge-base` moved to `infra` org
**Key bug found:** Creating repos via Forgejo API without `auto_init: true` creates DB record but no `.git` dir on disk → SSH push fails with "Internal Server Error". Fix: delete + recreate with `auto_init: true`.
**macOS git + Forgejo HTTPS:** System git (Xcode/LibreSSL) cannot authenticate to Forgejo HTTPS. Use SSH: `git@192.168.170.41:org/repo.git`. Mac SSH key added to Forgejo (Key ID: 1).
### 4. Forgejo → GitHub Push Mirror ✅
- GitHub PAT added to Forgejo push mirror config
- Mirror triggers on every commit + every 8 hours
- All agents write to Forgejo only. GitHub is read-only backup.
### 5. Forgejo → NAS Daily Backup ✅
- Script: `/usr/local/bin/forgejo-backup.sh` on Proxmox host (192.168.170.40)
- NFS mount: `192.168.170.22:/mnt/datapool/backup` → `/mnt/nas-backup` (Proxmox fstab)
- Systemd timer: daily at 3:00 AM
- SQLite `.backup` command — no Forgejo downtime during backup
- Backup size: ~2.3GB. Retention: 30 days.
- Location on NAS: `/mnt/datapool/backup/forgejo/daily/YYYY-MM-DD_HH-MM/forgejo-backup.tar.gz`
### 6. Keenetic Management Scripts ✅
- `keenetic-pull.py` — Telnet, downloads config with timestamp
- `keenetic-push.py` — Telnet, applies commands or config file
- Location: `/Users/post/VScode/network/`
- **HTTP API auth does NOT work from Python** (SameSite=Strict cookie + challenge-response MD5 fails). Use Telnet only.
---
## Key Decisions
- **Forgejo primary, GitHub backup** — always push to `git.4min.pro`, never directly to GitHub
- **Knowledge base in `infra` org** — `git.4min.pro/infra/agent-knowledge-base` (not tied to any project)
- **netboot.xyz must use `network_mode: host`** — bridge NAT breaks TFTP
- **Keenetic: Telnet only** — HTTP API auth broken from Python
---
## Current State After Session
| Component | State |
|-----------|-------|
| SSL all 9 domains | ✅ |
| PXE netboot.xyz | ✅ Working (BIOS: netboot.xyz.kpxe) |
| Forgejo git.4min.pro | ✅ Running, 256GB disk |
| Forgejo → GitHub mirror | ✅ Auto on commit + 8h |
| Forgejo → NAS backup | ✅ Daily 3AM, 30d retention |
| Keenetic pull/push scripts | ✅ |
| AI Server (192.168.170.10) | ❌ Not started |
| Authentik SSO | ❌ Not started |
| kamaz5360 pushed to Forgejo | ✅ (done from another machine) |
| StereoWallND pushed to Forgejo | ❌ Pending (192.168.1.66) |
---
## Files Updated This Session
- `locations/home-cluster-192-168-170.md` — full rewrite with current state
- `AGENTS.md` — added STRICT RULE: commit after every chat step
- `projects/garage/decisions.md` — Forgejo migration, infra org, primary/backup rule
## Next Actions
1. Configure AI Server (192.168.170.10) — Ollama, ComfyUI, AllTalk TTS, LiteLLM
2. Connect Open WebUI to real Ollama on AI Server
3. Push StereoWallND from 192.168.1.66
4. Configure Authentik SSO

View file

@ -2,187 +2,141 @@
## Summary
Four-machine local AI platform. All machines **ONLINE** as of 2026-06-06.
External domain: `poxel.netcraze.link` → `95.165.0.208` (Keenetic DDNS).
Port forwarding 80/443 → 192.168.170.30 (NPM) is active.
Four-machine local AI platform. All machines **ONLINE**.
Domain: `4min.pro` (REG.RU DNS + Let's Encrypt via NPM).
Port forwarding 80/443 → 192.168.170.30 (NPM).
**Last updated: 2026-06-07**
## Network
- Subnet: `192.168.170.0/24`
- Router: `192.168.170.1` (Keenetic Peak, KeeneticOS 5.01.B.4.0-1)
- Router SSH port 22, Telnet port 23 (user: admin)
- **IMPORTANT:** SSH gets blocked by anti-bruteforce after repeated attempts — use Telnet instead
- `isolate-private` is DISABLED (was blocking WiFi→LAN traffic)
| Host | IP | Role |
|------|----|------|
| Keenetic Peak | 192.168.170.1 | Router / DHCP / NAT |
| TrueNAS | 192.168.170.22 | NAS / ZFS / NFS |
| Docker host | 192.168.170.30 | 13 Docker services |
| Proxmox | 192.168.170.40 | Hypervisor LXC |
| AI Server | 192.168.170.10 | **Not configured** |
---
## Router CLI — Key Commands
## Router — Keenetic Peak (192.168.170.1)
**Access:** Telnet port 23, login `admin`
**IMPORTANT:** Use Telnet scripts only — HTTP API auth does NOT work from Python (SameSite cookie bug).
Management scripts on Mac (192.168.170.x / airM1):
- `python3 /Users/post/VScode/network/keenetic-pull.py` — download config with timestamp
- `python3 /Users/post/VScode/network/keenetic-push.py --cmd "<cmd>"` — apply command
Key config:
- LAN: Bridge0 → Home, 192.168.170.1/24
- DHCP pool: `_WEBADMIN`, range .33–.152
- PXE: option 66=192.168.170.30, option 67=netboot.xyz.kpxe
- Port forward: 80/443 → 192.168.170.30
---
## Proxmox (192.168.170.40)
OS: Proxmox VE 9.2.3, node `prmx`
SSH: `ssh root@192.168.170.40` (password)
### LXC Containers
| VMID | Name | IP | Service | Disk |
|------|------|----|---------|------|
| 100 | forgejo | 192.168.170.41 | Forgejo v10.0.3 :3000 | 256GB |
| 102 | mcp | 192.168.170.43 | MCP hub (9 servers) | — |
Access: `pct exec 100 -- <cmd>`, `pct exec 102 -- <cmd>`
### Forgejo (CT100 — 192.168.170.41)
- Web: https://git.4min.pro
- Data: `/var/lib/forgejo/` (repos + sqlite db + lfs + data)
- Config: `/etc/forgejo/app.ini`
- Org structure:
- `garage` — project repos (KaMaz, kamaz5360, StereoWallND, ProjectionMapping, joystick)
- `infra` — shared knowledge base and infrastructure repos
**Forgejo → NAS backup (daily 3:00 AM, no downtime):**
- Script: `/usr/local/bin/forgejo-backup.sh` on Proxmox host
- Timer: `systemctl status forgejo-backup.timer` on Proxmox
- NFS: `192.168.170.22:/mnt/datapool/backup` → `/mnt/nas-backup` (Proxmox fstab)
- Location on NAS: `/mnt/datapool/backup/forgejo/daily/YYYY-MM-DD_HH-MM/forgejo-backup.tar.gz`
- Retention: 30 days
Restore:
```bash
# Connect
telnet 192.168.170.1
# Login: admin, Password: <REDACTED>
# Port forwarding (DNAT)
ip static tcp GigabitEthernet0/Vlan2 80 192.168.170.30
ip static tcp GigabitEthernet0/Vlan2 443 192.168.170.30
# Static DHCP binding
ip dhcp host <mac> <ip>
# Disable WiFi isolation
no isolate-private
# Save config
system configuration save
pct exec 100 -- systemctl stop forgejo
pct exec 100 -- bash -c "cd / && tar xzf /proc/self/fd/0" < /mnt/nas-backup/forgejo/daily/<DATE>/forgejo-backup.tar.gz
pct exec 100 -- systemctl start forgejo
```
---
### MCP Hub (CT102 — 192.168.170.43)
## Machine 1 — AI Inference Server
| Field | Value |
|-------|-------|
| IP | `192.168.170.10` (reserved, not yet configured) |
| CPU | 2× Intel Xeon, 36C/72T total |
| RAM | 256 GB |
| GPU | NVIDIA A6000 48 GB VRAM (+ optional RTX 4090 24 GB) |
### Planned services
| Service | Port | Purpose |
|---------|------|---------|
| Ollama | 11434 | LLM inference |
| ComfyUI | 8188 | Image/3D generation |
| AllTalk TTS (XTTS v2) | 5002 | Russian TTS |
| faster-whisper | 9000 | Russian STT |
| TripoSR / InstantMesh | 7860 | 3D generation |
| LiteLLM Proxy | 4000 | Unified OpenAI-compatible API |
| Sunshine | 47989 | Remote GUI access |
See `locations/mcp-hub-192-168-170-43.md` for details.
---
## Machine 2 — Proxmox `192.168.170.40` ✅
## Docker Engine (192.168.170.30)
| Field | Value |
|-------|-------|
| IP | `192.168.170.40` |
| OS | Proxmox VE 9.2.3, node `prmx` |
| RAM | 15 GB |
| Web UI | `https://192.168.170.40:8006` (root) |
| SSH | `ssh root@192.168.170.40` (password auth) |
| Storage | `ssd` ZFS 1.8TB (ALL containers here), `local` 67GB |
| MAC | `6c:4b:90:21:43:cc` |
OS: Debian 13 trixie
SSH: `ssh root@192.168.170.30` (password)
Stacks: `/opt/stacks/<name>/docker-compose.yml`
### Policy: LXC only for non-Docker services
### Running Services
### LXC Containers (Debian 12, unprivileged, storage: ssd)
| Service | Stack | Ports | URL |
|---------|-------|-------|-----|
| nginx-proxy-manager | npm | 80/443/81 | http://192.168.170.30:81 |
| portainer | portainer | 9000 | https://portainer.4min.pro |
| open-webui | webui | 8080 | https://ai.4min.pro |
| n8n | n8n | 5678 | https://n8n.4min.pro |
| flowise | flowise | 3000 | http://192.168.170.30:3000 |
| homarr | homarr | 7575 | https://home.4min.pro |
| minio | minio | 9001/9002 | http://192.168.170.30:9001 |
| netbootxyz | netboot | host | http://192.168.170.30:3002 |
| authentik-server | authentik | 9004/9454 | https://auth.4min.pro |
| prometheus | monitoring | 9090 | http://192.168.170.30:9090 |
| grafana | monitoring | 3100 | http://192.168.170.30:3100 |
| VMID | Hostname | IP | Service | Status |
|------|----------|----|---------|--------|
| 100 | forgejo | 192.168.170.41 | Forgejo v10.0.3 :3000 | ✅ running |
| 102 | mcp | 192.168.170.43 | MCP servers hub | ✅ running |
**netboot.xyz MUST use `network_mode: host`** — Docker bridge NAT breaks TFTP UDP data packets.
CT101 and CT103 removed — services on Docker machine.
### SSL Status (all ✅)
```bash
# Access containers from Proxmox host
pct exec 100 -- bash -c '<command>'
pct exec 102 -- bash -c '<command>'
```
All 9 domains have valid Let's Encrypt certs: `4min.pro`, `git`, `n8n`, `ai`, `home`, `portainer`, `auth`, `www`, `monitor`.
DNS challenge via certbot-dns-regru (API email in NPM config). HTTP challenge used for www/monitor (DNS had negative cache TTL issue).
---
## Machine 3 — Docker Engine `192.168.170.30` ✅
## TrueNAS (192.168.170.22)
| Field | Value |
|-------|-------|
| IP | `192.168.170.30` |
| OS | Debian 13 trixie |
| SSH | `ssh root@192.168.170.30` (password auth) |
| MAC | `14:b3:1f:2b:ab:a1` |
| Stacks | `/opt/stacks/<name>/docker-compose.yml` |
SSH: `ssh -i ~/.ssh/id_ed25519 truenas_admin@192.168.170.22`
ZFS pool: `datapool` (5.44TB usable, mirror vdev pairs)
### Running Docker services (13 containers)
### NFS Shares (exported to 192.168.170.0/24)
| Service | Port | Subdomain (planned) |
|---------|------|---------------------|
| Nginx Proxy Manager | 80/443/81 | — (reverse proxy) |
| Portainer | 9000/9443 | portainer.poxel.netcraze.link |
| Open WebUI | 8080 | ai.poxel.netcraze.link |
| n8n | 5678 | n8n.poxel.netcraze.link |
| Flowise | 3000 | flowise.poxel.netcraze.link |
| Homarr | 7575 | home.poxel.netcraze.link |
| MinIO | 9001/9002 | — |
| netboot.xyz | 3002/69udp/8083 | — (PXE boot server) |
| Authentik SSO | 9004/9454 | auth.poxel.netcraze.link |
| Prometheus | 9090 | monitor.poxel.netcraze.link |
| Grafana | 3100 | grafana.poxel.netcraze.link |
- Open WebUI → Ollama at `192.168.170.10:11434` (Machine 1, not yet configured)
| Path | Purpose |
|------|---------|
| /mnt/datapool/ai-models | AI model storage |
| /mnt/datapool/comfy-models | ComfyUI models |
| /mnt/datapool/renders | Render output |
| /mnt/datapool/backup | **Backups — Forgejo daily backup here** |
---
## Machine 4 — TrueNAS `192.168.170.22` ✅
## AI Server (192.168.170.10) — NOT CONFIGURED
| Field | Value |
|-------|-------|
| IP | `192.168.170.22` |
| OS | TrueNAS SCALE 26.0.0-BETA.1 |
| SSH | `ssh -i ~/.ssh/id_ed25519 truenas_admin@192.168.170.22` |
| MAC | `6c:92:bf:3b:f7:1f` |
### ZFS Pool
```
Pool: datapool (5.44 TB usable)
├── Mirror vdev 1: sda + sdb
└── Mirror vdev 2: sdc + sdd
Cache: L2ARC nvme0n1 953 GB
```
### NFS Shares (all on 192.168.170.0/24)
| Dataset | Mount |
|---------|-------|
| datapool/ai-models | `/mnt/datapool/ai-models` |
| datapool/comfy-models | `/mnt/datapool/comfy-models` |
| datapool/renders | `/mnt/datapool/renders` |
| datapool/backup | `/mnt/datapool/backup` |
Hardware: 2× Intel Xeon 36C/72T, 256GB RAM, NVIDIA A6000 48GB VRAM
Planned: Ollama, ComfyUI, AllTalk TTS, faster-whisper, LiteLLM Proxy
---
## Planned Subdomains (NPM + Let's Encrypt — NEXT STEP)
## Knowledge Base
| Subdomain | Backend |
|-----------|---------|
| git.poxel.netcraze.link | CT100 Forgejo :3000 |
| ai.poxel.netcraze.link | Docker Open WebUI :8080 |
| auth.poxel.netcraze.link | Docker Authentik :9004 |
| n8n.poxel.netcraze.link | Docker n8n :5678 |
| flowise.poxel.netcraze.link | Docker Flowise :3000 |
| home.poxel.netcraze.link | Docker Homarr :7575 |
| monitor.poxel.netcraze.link | Docker Grafana :3100 |
| portainer.poxel.netcraze.link | Docker Portainer :9443 |
| comfy.poxel.netcraze.link | Machine 1 ComfyUI :8188 |
| tts.poxel.netcraze.link | Machine 1 AllTalk TTS :5002 |
SSL: Let's Encrypt HTTP challenge via NPM (auto).
---
## Setup Status (2026-06-06)
| Component | Status |
|-----------|--------|
| Machine 4 TrueNAS | ✅ Configured |
| Machine 3 Docker (13 services) | ✅ All running |
| Machine 2 Proxmox + LXC | ✅ Configured |
| Router port forwarding 80/443 | ✅ Active |
| Router DHCP static bindings | ✅ Active |
| MCP servers on Mac ~/.claude.json | ✅ Active (npx/uvx) |
| netboot.xyz PXE server | ✅ Running |
| NPM subdomains + SSL | ⏳ NEXT STEP |
| Homarr dashboard populated | ⏳ Pending |
| Authentik SSO configured | ⏳ Pending |
| Machine 1 AI PC | ⏳ Not started |
Primary: `https://git.4min.pro/infra/agent-knowledge-base` (Forgejo)
GitHub mirror (auto): `https://github.com/krustophski/agent-knowledge-base`
Push mirror: Forgejo → GitHub on every commit + every 8h.
**Always write to Forgejo. Never push to GitHub directly.**