infrastructure/network_index.md

329 lines
18 KiB
Markdown

# KingDezigns Network Documentation Index
Last Updated: 2026-10-11
This index provides a structured overview of the KingDezigns network,
including VLANs, servers, firewall/security architecture, and hosted
applications.
------------------------------------------------------------------------
# 📁 VLAN Documentation
## 🔧 Core VLANs
- [VLAN 1 --- Infrastructure](vlan1_infrastructure.md)
- [VLAN 10 --- Management](vlan10_management.md)
## 🧑‍💻 Trusted User VLANs
- [VLAN 20 --- Trusted Devices](vlan20_trusted.md)
## 🏠 Smart Home & Guest VLANs
- [VLAN 30 --- IoT](vlan30_iot.md)
- [VLAN 40 --- Guest](vlan40_guest.md)
## 🧪 Server & Lab VLAN
- [VLAN 50 --- Lab / Servers](vlan50_lab.md)
------------------------------------------------------------------------
# 🖥️ Server Documentation
## Core Services
- [Home Assistant Server](server_homeassistant.md)
- [NAS08 --- Pi-hole, Nextcloud, Office, Vaultwarden,
STOCKPROXY](server_nas08.md)
- [NAS16 --- LAMP Stack, MariaDB, Webmin, Forgejo, Fund Tracker, Debt
Eliminator, Umami](server_nas16.md)
- [PLEX32 --- Plex Media Server + Tautulli](server_plex32.md)
- [Forgejo --- Self-Hosted Git Server](server_forgejo.md)
- [Fund Tracker --- Multi-Profile Mutual Fund/Stock
Tracking](server_fundtracker.md)
- [Debt Eliminator / CutTheCard --- Personal Debt
Tracking](server_debteliminator.md)
- [CutTheCard Subscription Model --- transition plan](debteliminator_subscription_model.md)
- [Umami --- Self-Hosted Web Analytics](server_umami.md)
## AI / Development Workstations
- [KingDezigns-AI-001 --- OpenCode + Ollama Local AI Coding
Agent](kingdezigns-ai-001-summary.md)
## Network Hardware
- [UCG Gateway Max](server_ucg.md)
------------------------------------------------------------------------
# 🔥 Firewall Policies
- [Firewall Policies Overview](firewall_policies.md)
Firewall rules themselves remain documented centrally in
`firewall_policies.md`. Service documentation should describe required
connectivity but should not duplicate the authoritative firewall rule
definitions.
------------------------------------------------------------------------
# 🛡️ Security Stack
## Intrusion Prevention
- **CrowdSec** --- installed on Home Assistant Server as a native HA
add-on
- Agent reads NPM, HA, and SSH logs via journald
- Community blocklist updates every 2 hours
- Firewall Bouncer enforces bans at nftables level
- All LAN VLANs are whitelisted
- Applies automatically to NPM-proxied services, including
Forgejo, Fund Tracker, and Debt Eliminator
- See `server_homeassistant.md`
## Perimeter Defense
- **Fail2Ban**
- NAS16 active
- PLEX32 active
- NAS08 recommended
- Backend proxy IPs are protected from accidental bans
- Real IP forwarding is configured on NAS16 and NAS08
## DNS-level Protection
- **Pi-hole** --- NAS08 (`192.168.150.35`)
- Network-wide DNS filtering
- All VLANs forced to Pi-hole through the documented firewall
policy
- Local DNS overrides are required when internal clients access an
internally hosted service through its public hostname
## Application Authentication
### Fund Tracker
- Session-cookie authentication
- bcrypt password hashing
- Admin/user roles
- Versioned legal-document acceptance
- See `server_fundtracker.md`
### Debt Eliminator / CutTheCard
- Session-cookie authentication
- `HttpOnly`, `SameSite=Strict` cookies
- Secure cookies behind HTTPS
- bcrypt password hashing
- Five failed-login attempts → 15-minute lockout
- Disabled accounts blocked and active sessions invalidated
- Admin-managed accounts
- Versioned Terms of Use, Privacy Statement, and Affiliate Disclosure acceptance
- Self-service account suspend/unsuspend and two-step self-delete (v2.2.0)
- **Admin Roles v2** (per-permission admin access; Primary Admin + Supervisor can assign roles)
- **Household Sharing (v2.1.20):** owner invites another user by email as view/edit; members never see full account numbers, billing, profile or Budget; owner-visible activity log
- **Accessibility:** WCAG 2.2 AA is a release requirement - see `accessibility_standards.md`
- Searchable security/audit log
- AES-256-GCM account-number encryption
- Stripe-powered donations (one-time + recurring), public Support/Contact form, downloadable Records Archive export, and a public SEO/Learning Center — see `server_debteliminator.md` for detail
- **Domains — CONFIRMED (2026-09-15):** Production is now `https://www.cutthecard.net` (was `debt.kingdezigns.com`); QA is now `https://debt.qa.cutthecard.net` (was `debt.qa.kingdezigns.com`). NPM on HAS and Dreamhost DNS were both updated for both. `cutthecard.org` redirects to `cutthecard.net` at Dreamhost only, not in NPM. Both old `kingdezigns.com` hostnames are deprecated — see `server_debteliminator.md` §0a/§2a for the standing reminder to scrub remaining references
- **Blog Engine (2026-09-30):** public SEO articles at `/blog` (outside the paywall, crawlable, in `sitemap.xml`), each revision on its own URL, with Preview/Schedule/Publish/Archive/Unpublish and scheduled go-live; no new ingress, NPM or CrowdSec changes were needed
- **Admin → Revenue / Subscriptions (2026-09-30):** unified revenue ledger (`donations.payment_kind`), subscription summary tiles, per-user monthly/yearly amounts
- **Navigation regroup (2026-10-11):** sidebar is now task-based collapsible groups (Phase 1); see `server_debteliminator.md` §8b
- **Analytics loader (2026-10-02):** one `site-scripts.js` loader tag per page; Umami page-level analytics on public and app pages (admin never tracked) — see `server_debteliminator.md` §12h
- See `server_debteliminator.md`
## Web Analytics
### Umami (self-hosted)
- `https://stats.cutthecard.net` — Docker on NAS16 (`192.168.150.40:3001`), proxied by NPM on HAS, Force SSL
- Cookie-free, first-party; no data sent to third parties
- Pi-hole local DNS override `stats.cutthecard.net` → `192.168.150.30`
- Tracks CutTheCard (public + app pages, page-level only, admin excluded) and the personal kingdezigns.com site
- Chosen over Google Analytics (privacy/trust) and Plausible (ClickHouse too heavy for a Pi)
- Default login must be changed on first login
- See `server_umami.md`
------------------------------------------------------------------------
# 🌐 Network Architecture Overview
The KingDezigns network is designed around:
- Clear VLAN segmentation
- Explicit inter-VLAN access
- Isolation of untrusted devices
- Preservation of Home Assistant functionality
- AI-friendly documentation
- Layered security
- Single external ingress through NPM
## Security Layer Model
``` text
Internet
↓
UCG Max — firewall / VLAN segmentation
↓
CrowdSec Firewall Bouncer — nftables enforcement
↓
NPM on HAS — HTTPS termination / reverse proxy
↓
Backend Services
├── NAS08
├── NAS16
└── PLEX32
↓
Fail2Ban — backend brute-force protection
↑
Pi-hole — DNS filtering
```
------------------------------------------------------------------------
# 🔑 SSH Key Authentication Map
SSH key authentication is configured between the documented
administrative hosts and VLAN 50 servers.
Key type: ED25519.
Keys are generated per machine and are not shared.
------------------------------------------------------------------------
# 🖥️ KingDezigns001 --- Admin Workstation
KingDezigns001 is the primary Linux administrative workstation on VLAN
20.
It is the normal starting point for application deployments because
NAS16 has no browser.
For Debt Eliminator:
``` text
KingDezigns001 ~/Downloads
↓
SCP → NAS16 ~/deploys/ (never /tmp)
↓
SSH → NAS16
↓
sudo cp → QA
↓
sudo docker restart (or rebuild) QA container
↓
QA testing
↓
Dev Log Deploy to Prod (automated pipeline)
↓
Production verification
```
**Standing rule (mandatory, every time):** any reply that delivers files for
Debt Eliminator or Fund Tracker must *open* with the full SCP → `sudo cp` →
restart command block (real file names and paths, `sudo rm` for deleted files,
restart-vs-rebuild stated, verification lines) before explaining the change.
See `server_debteliminator.md` §3a-0 for the template.
------------------------------------------------------------------------
# 🤖 KingDezigns-AI-001 --- Local AI Coding Workstation
**Not to be confused with KingDezigns001 above** — similar name, different
machine, different VLAN.
KingDezigns-AI-001 is a **GMKtec NucBox K8 Plus** (AMD Ryzen 7 8845HS,
Radeon 780M iGPU, ~29.6GB unified RAM, Linux Mint 22.3) running
**Ollama** (local LLM inference) and **OpenCode** (an AI coding agent),
so coding-agent work can run entirely on local hardware rather than a
cloud API. Static IP reservations: **192.168.100.50** and
**192.168.100.51** — VLAN 1 (Infrastructure).
- Ollama is pinned to **v0.32.9** (since 2026-09-19; was v0.17.5 — newer
versions ≥ 0.32.10 have a Vulkan regression on this iGPU that crashes
models above ~16 GB; the original v0.17.5 pin was for a qwen3.5
tool-calling bug, retest pending) and runs on its **Vulkan**
backend (Mesa RADV) rather than ROCm, since ROCm doesn't support this
iGPU (gfx1103).
- Ollama itself listens on `127.0.0.1:11434` only — **all model
inference stays local to this machine.**
- The OpenCode web UI (`opencode web`) was opened up to the LAN
(`--hostname 0.0.0.0`, port 4096, allowed through the host's `ufw`) so
it can be reached from other VLAN 1/20 devices, while Ollama itself
remains loopback-only — remote devices talk to OpenCode, which relays
to Ollama locally.
- **⚠️ Open security item:** as of the 2026-09-14 setup, the OpenCode
server has **no password configured**
(`OPENCODE_SERVER_PASSWORD` unset) — anyone who can reach
`192.168.100.50:4096` or `.51:4096` can create files and run shell
commands on this machine with no login. This is treated as acceptable
for a trusted home LAN for now, but **port 4096 must never be
port-forwarded to the internet**, and setting a server password is a
recommended follow-up. See `kingdezigns-ai-001-summary.md` for the
exact env var and setup detail once addressed.
Full setup detail, the Ollama/OpenCode fixes applied, and the exact
network-exposure change are in
[kingdezigns-ai-001-summary.md](kingdezigns-ai-001-summary.md).
------------------------------------------------------------------------
# 🧠 Notes for AI Systems
- **MANDATORY — deploy commands first:** whenever you hand the user files to deploy
(tarball, patch or single file), begin the reply with the exact SCP → `sudo cp` →
`sudo docker restart <container>` block, using real file names and paths, before any
description of the change. State restart-only vs rebuild. This applies every time, to
every revision, without being asked. Template: `server_debteliminator.md` §3a-0;
Fund Tracker equivalents: `server_fundtracker.md`.
- Treat the dedicated server documentation as authoritative for
service-specific configuration.
- `firewall_policies.md` is authoritative for firewall rules.
- Do not duplicate firewall rule definitions into service files.
- When updating a project file, preserve its existing organization and
terminology unless the project itself has changed.
- Debt Eliminator / CutTheCard is hosted on NAS16.
- Branded as **CutTheCard** in all UI. As of 2026-09-15, **confirmed**:
Production is `https://www.cutthecard.net` and QA is
`https://debt.qa.cutthecard.net` — NPM on HAS and Dreamhost DNS were
both updated to match, for both environments (not just the
application's own config). `cutthecard.org` redirects to
`cutthecard.net` at Dreamhost only, not in NPM. Both
`debt.kingdezigns.com` and `debt.qa.kingdezigns.com` are deprecated;
remaining references to either across the doc set/app are tracked as
a standing reminder in `server_debteliminator.md` §0a until fully
scrubbed. See `server_debteliminator.md` §2a for detail.
- Debt Eliminator has independent QA and Production environments from launch.
- Debt Eliminator Production is port 8002.
- Debt Eliminator QA is port 8003.
- NPM on HAS is the external ingress point.
- Debt Eliminator uses PostgreSQL, FastAPI, Python 3.12, and a vanilla HTML/JS/CSS frontend.
- Debt Eliminator's transaction register uses a recompute-from-scratch ledger.
- Charge-level interest rates and promotional APR (standard + deferred) are supported per transaction.
- 0% Balance Transfer strategy evaluates donor/receiver pairs in Avalanche order; `credit_limit` field limits recommended amount.
- The Debt Reduction Plan page (formerly Payoff Strategy) has a four-step progressive layout.
- Payment Register is a year-at-a-glance application page and supports a saved Payments-Only/All-Transactions preference.
- Debt Eliminator's My Account, Admin Accounts, and Help Center pages are current application functionality.
- Debt Eliminator's DevLog supports deployment instructions, attach-to-existing-version no-version projects, an automated QA → Production deploy pipeline (`deploy_engine.py`), per-item assignment/due-date/on-hold tracking with a weekly overdue-item alert email, and a permanent deployment-history table separate from the single-generation file backup.
- **2026-09-30:** DevLog is now **v2.1.3** (app source string still 1.10.1). New since 2026-09-15: Blog Engine with revisions/archive/scheduling, unified revenue ledger + Admin → Revenue page, Subscriptions admin tiles/per-user amounts; SitePay and Email Campaigns are in the code (summary-level in `server_debteliminator.md` §0b). The latest backup is `debteliminator-v2.1.3-backup-2026-09-30_08-47-16.tar.gz`. Standing reminder still open: `APP_SECRET_KEY` unset in Production + live Stripe keys in plaintext in the compose file.
- **Earlier — since the 2026-09-03 reconciliation (DevLog v2.0.19 / app source v1.10.1 at the time):** Stripe donations (one-time + recurring), a public Support/Contact request form, self-service account suspend/delete, a Privacy Statement + Affiliate Disclosure legal document (affiliate links themselves not yet live), a downloadable Records Archive (.xlsx/.docx) export, an SEO foundation with a public six-article Learning Center, and a dark/light theme. Full detail in `server_debteliminator.md`.
- **Version namespaces must be kept separate:** the 2026-09-15 Production backup is named **v2.0.19** because that is the latest deployed DevLog version, while the application source reports **v1.10.1** and shared frontend assets are **no longer on a single cache-marker value** — split between v1.8.3 and v1.8.4 depending on the page (see `server_debteliminator.md` §4.3).
- The dedicated Debt Eliminator backup covers Production application files and the Production PostgreSQL database; it does not include the independent QA database/project tree.
- Never document actual production passwords, SMTP passwords, database passwords, encryption keys, session secrets, Stripe keys, or other credentials.
- `APP_SECRET_KEY` should be explicitly configured in QA and Production before relying on encrypted account numbers — **still open as of 2026-09-15, now higher-priority** because live Stripe secret/publishable/webhook keys were also found stored in plaintext in the Production compose file. User has acknowledged and deferred this — tracked as a standing reminder (re-surface every ~5 days) in `server_debteliminator.md` §0a/§26.
- **KingDezigns-AI-001** (added 2026-09-14) is a local AI coding workstation on VLAN 1 (192.168.100.50/.51) running Ollama + OpenCode entirely on local hardware — not to be confused with **KingDezigns001**, the separate VLAN 20 admin workstation used for Debt Eliminator/Fund Tracker deployments. Model inference (Ollama) is loopback-only; the OpenCode web UI is exposed to the LAN on port 4096 with **no server password currently set** — a known, accepted-for-now risk on the trusted home LAN, but port 4096 must never be forwarded externally. See `kingdezigns-ai-001-summary.md`.
- **Umami analytics (added 2026-10-01):** self-hosted, cookie-free web analytics on NAS16 (`stats.cutthecard.net` → NPM → `192.168.150.40:3001`; containers `umami`, `umami_db`). Secrets live in `/opt/umami/umami.secrets` via `env_file` — OMV regenerates `umami.env` and wipes manual edits, so never rely on it. CutTheCard loads tracking through a single loader, `/dashboard/site-scripts.js` (add future scripts there, not on pages). See `server_umami.md` and `server_debteliminator.md` §12h. Open: confirm custom reading events in production, add Umami to `nas16-backup.sh`, disclose analytics in the Privacy Statement, confirm default admin password changed.
------------------------------------------------------------------------
- **2026-10-11 (Debt Eliminator):** DevLog is **v2.1.20** (seen in a **QA** backup, `debteliminator-v2_1_20-backup-2026-10-10_23-51-34.tar.gz` - not the usual Production-only archive). New since v2.1.7: Admin Roles v2, public Demo Calculator, Milestones, Windfall Allocator, CSV/Statement Import (nothing stored), accessibility layer, reminders, Credit Utilization, Budget-to-Payoff, blog auto-archive, **Household Sharing**. Sidebar regrouped into collapsible groups (Phase 1). Details in `server_debteliminator.md` §0d, §8b, §12i-12j; accessibility rules in `accessibility_standards.md`. Standing open item: `APP_SECRET_KEY` unset (also absent from QA compose) - overdue for a reminder.
- **2026-10-11 (Debt Eliminator, Home Page Swap):** the old About page is now the site home page ("Start Here") at `https://www.cutthecard.net/` (and `/index.html`); the `/` → `/dashboard/` redirect was removed; Accounts remains `/dashboard/index.html`; `/dashboard/about.html` 301s to `/`; sign-in from an entry page lands on `/`. Built against the v2.1.21 QA backup; package `home-page-swap-v2.1.22.tar.gz` delivered, QA deployment not yet confirmed. Detail in `server_debteliminator.md` §0e.
------------------------------------------------------------------------
# ✔️ End of File