commit 2cb7cbf0b98aa60191bd845088030a4ce45a6dc8 Author: Mark Lewis Date: Thu Sep 24 12:56:37 2026 -0500 Add initial documentation for homelab operations, deployments, and service inventory diff --git a/README.md b/README.md new file mode 100644 index 0000000..e373534 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Homelab operations + +Working documentation, started 2026-09-24. **Verify all details against the running systems before treating this as a recovery runbook.** Never commit credentials, private keys, VPN configurations, API tokens, or unredacted configuration exports. + +## Start here + +- [Network topology](network/topology.md): physical paths, routing, DNS, ingress, and known constraints. +- [Service inventory](services/inventory.md): what runs where and what each service depends on. +- [Docker deployment](deployments/docker.md) +- [LXC deployment](deployments/lxc.md) +- [VM deployment](deployments/vm.md) +- [Discovery checklist](discovery.md): commands and questions to replace assumptions with observed facts. + +## Documentation convention + +Each page records a **verified date** and identifies items as `Confirmed`, `Reported`, or `To verify`. A reported detail came from prior troubleshooting and may have since changed. Include host, service owner, source/config path, persistent storage, ingress, dependencies, backup, restore, and upgrade method for each deployed app. Prefer a PR for infrastructure changes that updates the relevant page in the same change. diff --git a/deployments/docker.md b/deployments/docker.md new file mode 100644 index 0000000..43b7c6f --- /dev/null +++ b/deployments/docker.md @@ -0,0 +1,13 @@ +# Deploy a Docker service + +Status: draft process; adjust to actual Compose layout on `freighter`. + +1. Create or update the service's Compose project in its source repository. Use pinned image versions where practical. Put secrets in the host's secret mechanism, outside Git. +2. Define persistent volumes, UID/GID, restart policy, resource needs, and health check. Existing workloads have used UID/GID `1005:1005`; confirm this for the new image and its mounts. +3. Attach the appropriate existing Docker network (`homestack` or `homenet`); verify which network Traefik actually shares. Expose only necessary ports. +4. Add Traefik labels for host, entrypoint, TLS resolver, middleware, and **correct internal service port**. Verify the container and Traefik share a network; specify `traefik.docker.network` when ambiguous. +5. Validate Compose (`docker compose config`), then deploy (`docker compose up -d`) from the intended project directory. Check `docker compose ps`, health, and logs. +6. Test direct container access, then local FQDN through Traefik, then external access only if intended. A Traefik 404 suggests route discovery/rule mismatch; a gateway error suggests backend/network/port issues. +7. Add monitoring, backups, and an entry in the service inventory. Record rollback image tag and volume restore method before a major upgrade. + +Do not copy a real credential, API token, or Cloudflare DNS credential into Compose tracked by Git. diff --git a/deployments/lxc.md b/deployments/lxc.md new file mode 100644 index 0000000..0db1d49 --- /dev/null +++ b/deployments/lxc.md @@ -0,0 +1,13 @@ +# Deploy a Proxmox LXC + +Status: draft process. Confirm defaults and storage targets on `pve`. + +1. Choose LXC when the service can run in a container and does not require a full guest kernel. Record guest ID, hostname, OS version, owner, CPU, RAM, disk, and storage. +2. Create from an approved template or recorded provisioning script. Decide privileged versus unprivileged and any features (`nesting`, `keyctl`) deliberately. Avoid enabling extra privileges by default. +3. Configure bridge, address or DHCP reservation, DNS, time, and guest firewall policy. Confirm name resolution and outbound package access. +4. Add storage mounts with explicit ownership and backup handling. NFS mounts may live on the Proxmox host or in the guest; record the actual path and dependency. +5. Install the service, capture configuration path and systemd unit, and set restart behavior. Configure Alloy/log forwarding, monitoring, patch management, and guest backup. +6. For HTTP ingress, add the agreed Proxmox note metadata for Traefik discovery; verify generated route, TLS, DNS record, and backend port. Document the metadata schema after inspecting the running discovery service. +7. Test service URL, reboot persistence, backup job, and rollback. Add the guest and app to the inventory. + +Example already discussed: Ollama `llama1.home`, LXC 103, Ubuntu 24.04, unprivileged, 10 vCPU/16 GB, nesting/keyctl; verify current settings before reusing them as a template. diff --git a/deployments/vm.md b/deployments/vm.md new file mode 100644 index 0000000..24a0420 --- /dev/null +++ b/deployments/vm.md @@ -0,0 +1,11 @@ +# Deploy a Proxmox VM + +Status: draft process. Confirm image, storage, and backup standards on `pve`. + +1. Choose a VM when a separate kernel, OS isolation, or kernel/device features are needed. Record VM ID, hostname, owner, OS image, CPU/RAM, disk controller, storage and network bridge. +2. Create the guest with a supported image; enable the guest agent where suitable. Configure DHCP reservation or static address, DNS, time, SSH keys, package updates and local console access. +3. Define disks and external mounts, then record which data is captured by snapshots/backups. Check that NFS and startup dependencies are available before service start. +4. Install workload and systemd units, then configure monitoring, logs, patching, backup and restore. Add ingress via Proxmox notes only if the service is meant to be published. +5. Test application access, clean reboot, backup completion, and a rollback path. Record the VM in the inventory. + +**Storage lesson:** VM 113 `tor-vpn` previously failed to boot and needed filesystem repair after corruption. A successful snapshot is not a restore test; document recovery media, filesystem check process, and backup location for each critical VM. diff --git a/discovery.md b/discovery.md new file mode 100644 index 0000000..ef1a68b --- /dev/null +++ b/discovery.md @@ -0,0 +1,22 @@ +# Discovery and verification checklist + +Run these on the appropriate host and redact credentials before committing outputs. Prefer summarizing results in the docs over storing raw exports. + +| Source | What to collect | Example read-only commands | +| --- | --- | --- | +| Proxmox `pve` | Guest IDs, names, status, resources | `pct list`; `qm list`; `pvesm status` | +| Individual guest | OS, IP, listening ports, units | `hostnamectl`; `ip -br addr`; `ss -lntp`; `systemctl --type=service --state=running` | +| `freighter` | Compose projects, containers, networks, bind mounts | `docker compose ls`; `docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Ports}}'`; `docker network ls` | +| OPNsense | Interfaces, DHCP leases, routes, Unbound, firewall and WireGuard | Export **sanitized summaries** from UI; preserve secure config backup separately | +| Switches/AP | Port map, link speeds, management IP, wireless SSIDs | Controller inventory and switch port view | +| Storage | NFS exports, mounts, backup destinations and free space | `findmnt -t nfs,nfs4`; `df -h` | +| DNS/ingress | Internal/external answers and Traefik routes | `dig `; Traefik dashboard/API if enabled | + +## Questions that block a trustworthy diagram + +- Which exact physical ports connect modem, OPNsense WAN/LAN, both switches, AP, `pve`, storage, and `freighter`? +- What is the current NIC/interface mapping after the USB adapter replacement? +- What are the VLAN/subnet, DHCP, VPN, and route tables today? +- Where are Compose files and Proxmox notes discovery code/config stored? +- Which services are on which guest or Compose project, and which NFS shares are mounted where? +- What backs up OPNsense, Proxmox guests, Docker volumes, Gitea, and off-host data? When was each last restored? diff --git a/network/topology.md b/network/topology.md new file mode 100644 index 0000000..bfe2f88 --- /dev/null +++ b/network/topology.md @@ -0,0 +1,44 @@ +# Network topology + +Last documented: 2026-09-24. Status: **reported; verify against live configuration**. + +```mermaid +flowchart TD + ISP[Internet / modem] --> SA[Switch A] + SA --> FW[OPNsense mini PC] + SA <-->|existing 100 Mb/s CAT5 run| SB[Switch B] + SB --> PVE[Proxmox pve / R720] + FW --> LAN[Flat LAN and Wi-Fi AP] + PVE --> CT[LXC and VM guests] + LAN --> FRE[freighter / Docker and Traefik] + VPS[Debian VPS] <-->|WireGuard tunnel| FW +``` + +**Diagram is conceptual.** Exact switch ports, AP uplink, firewall WAN/LAN attachment, and whether the 100 Mb/s run remains in the traffic path need verification. Do not use this drawing to change cabling. + +| Area | Current understanding | Status | +| --- | --- | --- | +| Internet | 500 Mb/s service | Reported | +| Firewall | OPNsense on mini PC with UPS; LAN is flat after VLAN removal | Reported | +| LAN | `192.168.1.0/24` is implied by observed hosts; confirm mask and DHCP scope | To verify | +| DNS | Unbound on OPNsense; internal `home` domain; `*.home.mlewis.co` used for TLS names | Reported | +| Reverse proxy | Traefik on `freighter`, routing Docker apps and Proxmox guests | Reported | +| Public ingress | Debian VPS connects by WireGuard to OPNsense; confirm exact reverse proxy path | Reported | +| Interfloor cable | CAT5 run has negotiated 100 Mb/s in previous troubleshooting | Reported | +| USB NIC | Previous ASIX adapter caused LAN outages; Realtek replacement ordered 2026-09-23 | To verify installed state | + +## Addressing and name resolution + +Record LAN subnet/gateway, DHCP scope and reservations, OPNsense interface mapping, AP management address, DNS overrides, wildcard/public DNS ownership, and VPN subnets here. Do not infer current interface names from the prior `ue0` observation. Record both internal and external resolution for a sample `*.home.mlewis.co` name. + +## Traffic paths to test + +1. LAN client → Unbound → internal service by FQDN. +2. LAN client → Traefik → Docker service and LXC service. +3. External client → VPS → WireGuard → reverse proxy → published service. +4. Remote WireGuard client → LAN name resolution and service; document split routes and any exceptions for Android Auto. +5. Proxmox guest → NFS storage and backup destination. + +## Firewall and recovery + +Keep a table of destination-based rules with source, destination, ports, reason, owner, and change date. Document a local-console path into OPNsense, its configuration backup location, and rollback procedure for interface changes. Avoid putting VPN keys or raw exports in Git. diff --git a/services/inventory.md b/services/inventory.md new file mode 100644 index 0000000..839c440 --- /dev/null +++ b/services/inventory.md @@ -0,0 +1,38 @@ +# Service inventory + +Last documented: 2026-09-24. This is a **seed inventory from prior discussions**, not a live scan. Confirm host, ports, URLs, storage, and backup coverage. + +| Service | Purpose | Placement reported | Key dependencies / notes | Status | +| --- | --- | --- | --- | --- | +| OPNsense / Unbound | Routing, firewall, DNS, DHCP | Mini PC | Modem, switches, UPS; USB NIC state to verify | Reported | +| Proxmox `pve` | VM and LXC host | Dell R720 | Local pool, NFS, power/UPS; 128 GB RAM reported | Reported | +| Traefik | HTTP ingress and TLS | Docker on `freighter` | Docker networks, DNS challenge, dynamic guest discovery | Reported | +| Proxmox notes discovery service | Publishes guest routes and DNS records from notes | systemd on `freighter` | Proxmox API, Traefik config, DNS API | Reported; identify repo/service name | +| Jellyfin | Media and Live TV | Proxmox guest, exact ID to verify | NFS media, go2rtc camera feed, reverse proxy | Reported | +| Audiobookshelf | Audiobooks | To verify | NFS audiobook storage, ingress | Reported | +| Seerr / JellyBridge | Media requests and integration | To verify | Jellyfin and ingress | Reported | +| Gitea | Git hosting | LXC | SSH and HTTP ingress; SSH link host may need correction | Reported | +| Grafana / Loki / Alloy | Dashboards and logs | To verify per component | Syslog and guest agents; prefer full ingestion | Reported | +| Uptime Kuma | Availability monitoring | To verify | DNS, ingress, notification endpoint | Reported | +| Ollama `llama1.home` | Local CPU inference | LXC 103 | qwen3:8b, 10 vCPU/16 GB reported | Reported | +| ALPR | Plate recognition API and batch jobs | To verify | Camera images, local CPU, storage | Reported | +| Home SIEM / MCP controller | DNS, DHCP, firewall investigations | To verify | OPNsense data, Ollama, log retention | Reported | +| go2rtc | Camera stream relay | `freighter` or other host: verify | Reolink RTSP, Jellyfin M3U; port 1984/8554 observed | Reported | +| PatchMon | Patch and CIS tracking | To verify | Guest agents, Traefik route; port 3000 observed | Reported | +| WireGuard ingress | VPS-to-home tunnel | Debian VPS and OPNsense | Routing and firewall rules | Reported | +| `tor-vpn` | VPN workload | Debian VM 113 | qcow2 disk; repaired after boot corruption | Reported | + +## Per-service record template + +Copy this section into `services/.md` for each service: + +- **Purpose and users:** +- **Owner and host:** hostname, Proxmox guest ID or Compose project; verified date. +- **Source and deployment:** repository, compose path or guest provisioning method. +- **Access:** FQDN, listen address, ports, Traefik router, authentication. +- **Data:** volumes/mounts, NFS exports, database, retention. +- **Dependencies:** upstream/downstream services, DNS, certificates, networks. +- **Secrets:** where managed (never the secret values). +- **Monitoring and logs:** health endpoint, dashboards, alert route. +- **Backup and restore:** method, schedule, destination, last restore test. +- **Updates and rollback:** commands or link to runbook, maintenance impact.