diff --git a/projects/homelab/README.md b/projects/homelab/README.md index 5928820..5a191ad 100644 --- a/projects/homelab/README.md +++ b/projects/homelab/README.md @@ -5,89 +5,103 @@ tags: - homelab - infrastructure --- -# 🌐 Homelab & Infrastructure Planning -This project documents the architectural roadmaps, infrastructure designs, deployment automation, and system administration workflows for the homelab ecosystem. +# 🌐 Homelab Ecosystem & Core Infrastructure + +The **Homelab** project encompasses the architecture, automation, deployment pipelines, and operational runbooks powering the 24/7 personal infrastructure ecosystem hosted at `roadtotech.me`. + +The environment runs on dedicated hardware as a declarative NixOS appliance, providing self-hosted productivity tools, internal developer platforms, edge routing, and automated GitOps workflows. --- ---- -## 💬 Architectural Discussions ("Why & What If?") +## 🏛️ System Topology & Architecture -Foundational inquiries, problem statements, and trade-off analyses that inform the homelab's direction: +The homelab is organized into four decoupled architectural layers to isolate failures and maintain zero-downtime operations: -1. [**NixOS Monorepo vs. Multi-Repo Architecture**](discussions/nixos-monorepo-vs-multirepo.md) - - Evaluates coupling between workstation and server configurations; explores the trade-offs of single flake vs. standalone server appliance. -2. [**Decoupling `nixos-config` and `homelab-core`**](discussions/nixos-monorepo-decoupling.md) - - Analysis and file migration inventory for transferring the server definition into `homelab-core`. -3. [**Gitea Git Credential Helper, Protocol Trade-Offs, and Backup Architecture**](discussions/gitea-credentials-and-backup-strategy.md) - - Evaluates Git credential management, SSH vs. HTTPS, and primary (Gitea) vs. backup (GitHub) topology. -4. [**Dynu DDNS Polling Frequency, Resolver Rotation, and Rust Migration**](discussions/dynu-monitor-polling-and-language-tradeoffs.md) - - Evaluates 30m vs. 30s polling intervals, provider rate limits, and the rationale for migrating from Python directly to a native Rust daemon. +1. **Edge & Security Layer**: + - **Traefik Reverse Proxy**: Dynamic ingress routing over HTTPS with automated Let's Encrypt wildcard TLS certificates (`*.roadtotech.me`). + - **Authelia SSO**: ForwardAuth single sign-on with multi-factor authentication (2FA) protecting private services and dashboards. + - **Dynu Dynamic DNS**: Automated WAN address synchronization and fallback monitoring. +2. **Core Control Plane (`~/Core`)**: + - Central homelab services managed as a declarative NixOS appliance, including Gitea (Git forge & CI/CD runner), Nextcloud, Vaultwarden, Homepage dashboard, and deployment webhooks. +3. **Workload Plane (`~/Sites`)**: + - Autonomous, containerized application stacks (Docker Compose) completely decoupled from Core infrastructure. Each service repository declares its own metadata, routing rules, and lifecycle via an `app.yaml` manifest. +4. **Host Foundation**: + - Headless NixOS host system configured with encrypted secrets via SOPS-nix (`age`), strict firewall isolation, and standardized systemd timers for maintenance. --- -## 📑 Plans & Execution Roadmaps ("How & When?") +## 📍 Source Code & Repositories -Phased implementation plans originating from architectural decisions: +| Target | Location / URL | Description | +| :--- | :--- | :--- | +| **Gitea Forge** | [homelab-core](https://gitea.roadtotech.me/kiskaadee/homelab-core) | Primary Git repository housing the NixOS appliance and Core services | +| **Clone (SSH)** | `ssh://git@gitea.roadtotech.me:2223/kiskaadee/homelab-core.git` | Developer clone URL using SSH port 2223 | +| **Workstation Path** | `/home/kiskaadee/Projects/active/homelab/Core` | Active local development checkout on laptop workstation | +| **Production Target** | `server-remote:~/Core` | Production deployment checkout on the 24/7 server host | + +--- + +## 💬 Open Discussions + +Architectural inquiries and problem statements currently under evaluation that have **not yet produced an active implementation plan**: + +* ❓ [**WhatsApp & Telegram AI Assistant Backend Architecture**](discussions/chatbot-assistant-design.md) + - **Focus**: Evaluates architecture, webhook ingress, and trade-offs between Telegram Bot API and WhatsApp Cloud API for a personal AI assistant microservice (`~/Sites/homelab-assistant`) connected to the Brain vault. + - **Current Status**: Open inquiry examining authorization models, message formatting, cron triggers, and RAG search capabilities before formalizing an implementation plan. + +--- + +## 🚧 Work in Progress (Active Plans) + +Implementation roadmaps currently in progress (`status: active`) that are actively being executed or scheduled for deployment: -### 🏛️ Core Architecture & Evolution 1. 🟡 [**Architecture Consolidation & Hardening Roadmap**](plans/architecture-consolidation-roadmap.md) `[Active]` - - Four-tier topology formalization, GitOps security hardening (closed dispatch enum), `app.yaml` schema contract, and invariant tests. -2. 🟢 [**Turn `homelab-core` into a Declarative NixOS Appliance**](plans/nixos-appliance-migration.md) `[Completed]` - - Execution plan that migrated the headless server configuration into a self-contained NixOS appliance. - -### 🖥️ Server 24/7 & Infrastructure -1. 🟢 [**NixOS Server & Laptop Migration**](plans/server-24-7/nixos-server-laptop-migration.md) `[Completed]` - - Headless conversion of the server host and laptop workstation provisioning. -2. 🟢 [**Domain Migration (`roadtotech.me`)**](plans/server-24-7/domain-migration-roadtotech.md) `[Completed]` - - Cutover from legacy `arch-services.mywire.org` to apex `roadtotech.me`. -3. 🟢 [**Production Folder Structure Reorganization**](plans/server-24-7/folder-structure-reorganization.md) `[Completed]` - - Established strict production boundaries: `~/Core`, `~/Sites`, `~/Brain`, and `~/Config`. -4. 🟡 [**LVM Storage Optimization & Partition Resizing Strategy**](plans/server-24-7/lvm-storage-optimization-and-resizing.md) `[Active]` - - Storage topology analysis, desktop indexer cache reclamation, and zero-data-loss LVM resize runbook. - -### 📦 Orchestration (`appctl`) -1. 🟢 [**Core & Sites Cutover and Testing Plan**](plans/appctl/core-sites-cutover-testing-plan.md) `[Completed]` - - Zero-downtime cutover runbook from `~/Deployments` to decoupled `~/Core` and `~/Sites`. -2. 🟢 [**appctl Refactor & Decentralized `app.yaml` Metadata Architecture**](plans/appctl/refactor-and-metadata-sync.md) `[Completed]` - - Decentralized service manifests, canonical aliasing, and Homepage `services.yaml` compilation. -3. 🟢 [**appctl Git Synchronization & Full-Stack Lifecycle Strategy**](plans/appctl/git-sync-and-lifecycle.md) `[Completed]` - - Real-time Git tracking status (`✓ Synced`, `⬆ Ahead`, `⬇ Behind`, `* Dirty`), `--fetch`, and atomic `appctl update`. + - Formalizing the four-tier architectural boundaries, hardening the dynamic GitOps dispatcher with closed action enums, and codifying the `app.yaml` schema contract. +2. 🟡 [**Rust Daemon Migration Plan: Standalone `dynu-monitor`**](plans/dynu-monitor-rust-daemon.md) `[Active]` + - Implementing a standalone Rust daemon with 30-second polling and round-robin public DNS resolution across 5 independent providers (Cloudflare, Quad9, Google, OpenDNS, Dynu). +3. 🟡 [**Custom API Security Hardening & Threat Analysis**](plans/api-security-hardening.md) `[Active]` + - Defense-in-depth security hardening for custom microservice APIs (Learning Hub and Minecraft dashboard) using Authelia ForwardAuth, token validation, and rate limiting. 4. 🟡 [**Smart Selective Deployment Pipeline for Homelab Core**](plans/appctl/smart-deployment-pipeline.md) `[Active]` - - Change-aware Gitea GitOps & CLI deployment, selective container restarts, and bash autocompletion sync. - -### 🍵 Gitea & GitOps -1. 🟢 [**CI/CD & Deployment Strategy**](plans/gitea/deployment-and-cicd-strategy.md) `[Completed]` - - Design of automated deployment pipelines, self-hosted Gitea runner, and dynamic webhook dispatching. -2. 🟢 [**Real-Time Brain Synchronization & Gitea Push Mirroring**](plans/gitea/brain-sync-and-gitea-mirroring.md) `[Completed]` - - Pilot pipeline: zero-delay hooks, Gitea Actions CI, and instant reflection on `docs.roadtotech.me`. -3. 🟡 [**GitHub to Gitea Automated Batch Migration Plan**](plans/gitea/github-to-gitea-migration-plan.md) `[Active]` - - Batch migration automation (~35 repos) via `gh` and `tea` API, visibility retention, and recovery runbook. - -### 🔒 Security & Hardening -1. 🟡 [**Custom API Security Hardening & Threat Analysis**](plans/api-security-hardening.md) `[Active]` - - Attack surface review, Authelia ForwardAuth integration, rate limiting, and JWT fail-fast validation. - -### 🔄 Dynamic DNS & Infrastructure Daemons -1. 🟡 [**Rust Daemon Migration Plan: Standalone `dynu-monitor`**](plans/dynu-monitor-rust-daemon.md) `[Active]` - - High-frequency 30-second polling, 5-endpoint round-robin rotation, and zero-runtime-dependency Rust daemon. + - Enhancing `appctl` and Gitea Actions with change-aware selective container restarts to prevent unnecessary service interruptions during routine deployments. +5. 🟡 [**GitHub to Gitea Automated Batch Migration Plan**](plans/gitea/github-to-gitea-migration-plan.md) `[Active]` + - Automated migration tooling using `gh` and `tea` APIs to migrate ~35 repositories from GitHub to self-hosted Gitea with push mirrors for redundancy. +6. 🟡 [**LVM Storage Optimization & Partition Resizing Strategy**](plans/server-24-7/lvm-storage-optimization-and-resizing.md) `[Active]` + - Storage space audit, disk cleanup runbooks, and a non-destructive LVM logical volume expansion procedure for the server's root filesystem. --- -## 🛠️ Canonical Guides & Runbooks ("How to Use & Operate?") +## 🛠️ Canonical Guides & Runbooks -Operational procedures and standard operating runbooks: +Operational runbooks and procedures for daily administration: -1. [**Onboarding a New Application Stack**](guides/onboarding-a-new-service.md) - - Step-by-step procedure: directory setup in `~/Sites`, writing `app.yaml`, Traefik labels, and `appctl up`. -2. [**Managing Secrets and Authelia Users**](guides/managing-secrets-and-authelia-users.md) - - How to edit `nixos/secrets.yaml` with SOPS, generate Argon2 password hashes, and add users to Authelia. -3. [**Server Maintenance and System Updates Runbook**](guides/server-maintenance-and-updates.md) - - NixOS appliance upgrades, systemd post-update checklist, garbage collection, and Docker pruning. -4. [**Appctl & Application Manifests (`app.yaml`) User Guide**](guides/appctl-operations-and-manifest-guide.md) - - CLI reference for inspecting container health, managing stack lifecycles, and authoring `app.yaml`. -5. [**Brain GitOps & Auto-Sync Deployment Pipeline**](guides/brain-gitops-deployment-pipeline.md) - - How changes committed locally automatically push, validate in Gitea Actions, and deploy to `docs.roadtotech.me`. -6. [**Dynu DDNS Domain Configuration Troubleshooting Runbook**](guides/dynu-ddns-troubleshooting.md) - - Diagnostic steps for verifying WAN rotations, checking SOPS age keys, and forcing `ddclient` updates. +* [**Onboarding a New Application Stack**](guides/onboarding-a-new-service.md) — Step-by-step procedure for deploying new Docker Compose services in `~/Sites` with `app.yaml` and Traefik routing. +* [**Managing Secrets and Authelia Users**](guides/managing-secrets-and-authelia-users.md) — Guide for editing SOPS-encrypted secrets and managing user authentication credentials. +* [**Server Maintenance and System Updates Runbook**](guides/server-maintenance-and-updates.md) — Standard operating procedure for NixOS updates, garbage collection, and container pruning. +* [**Appctl & Application Manifests (`app.yaml`) User Guide**](guides/appctl-operations-and-manifest-guide.md) — Comprehensive reference for the `appctl` CLI tool and `app.yaml` schema. +* [**Brain GitOps & Auto-Sync Deployment Pipeline**](guides/brain-gitops-deployment-pipeline.md) — Technical runbook on how Brain commits automatically validate and publish to `docs.roadtotech.me`. +* [**Dynu DDNS Domain Configuration Troubleshooting Runbook**](guides/dynu-ddns-troubleshooting.md) — Diagnostic and recovery steps for WAN address synchronization issues. + +--- + +## 🏛️ Completed Roadmaps & Resolved Discussions + +Archived and foundational documentation for completed milestones: + +### Resolved Architectural Discussions +* [**NixOS Monorepo vs. Multi-Repo Architecture**](discussions/nixos-monorepo-vs-multirepo.md) — Evaluated workstation and server decoupling; resolved via appliance migration. +* [**Decoupling `nixos-config` and `homelab-core`**](discussions/nixos-monorepo-decoupling.md) — Migration inventory and separation plan; resolved via repository split. +* [**Dynamic Decentralized GitOps Dispatcher Architecture**](discussions/gitops-dispatcher-architecture.md) — Decoupled deployment webhook design; implemented in production. +* [**Gitea Git Credential Helper and Backup Strategy**](discussions/gitea-credentials-and-backup-strategy.md) — Evaluated credential helpers and push mirroring; resolved via Git credential helper configuration. +* [**Dynu DDNS Polling Frequency and Rust Migration**](discussions/dynu-monitor-polling-and-language-tradeoffs.md) — Investigated polling intervals and language trade-offs; resolved via `dynu-monitor-rust-daemon.md` plan. + +### Completed Plans +* 🟢 [**Turn `homelab-core` into a Declarative NixOS Appliance**](plans/nixos-appliance-migration.md) +* 🟢 [**Core & Sites Cutover and Testing Plan**](plans/appctl/core-sites-cutover-testing-plan.md) +* 🟢 [**appctl Refactor & Decentralized `app.yaml` Metadata Architecture**](plans/appctl/refactor-and-metadata-sync.md) +* 🟢 [**appctl Git Synchronization & Full-Stack Lifecycle Strategy**](plans/appctl/git-sync-and-lifecycle.md) +* 🟢 [**CI/CD & Deployment Strategy**](plans/gitea/deployment-and-cicd-strategy.md) +* 🟢 [**Real-Time Brain Synchronization & Gitea Push Mirroring**](plans/gitea/brain-sync-and-gitea-mirroring.md) +* 🟢 [**NixOS Server & Laptop Migration**](plans/server-24-7/nixos-server-laptop-migration.md) +* 🟢 [**Domain Migration (`roadtotech.me`)**](plans/server-24-7/domain-migration-roadtotech.md) +* 🟢 [**Production Folder Structure Reorganization**](plans/server-24-7/folder-structure-reorganization.md)