From d86b9d462272465dc1b320f37b10aa04b1ea52ef Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Fri, 11 Sep 2026 08:18:37 -0500 Subject: [PATCH] docs(homelab): align migration and deployment plans with implementation milestones --- .../gitea/brain-sync-and-gitea-mirroring.md | 2 +- .../gitea/deployment-and-cicd-strategy.md | 39 +++++++-------- .../folder-structure-reorganization.md | 48 +++++++++++-------- .../nixos-server-laptop-migration.md | 40 +++++++++------- 4 files changed, 68 insertions(+), 61 deletions(-) diff --git a/projects/homelab/plans/gitea/brain-sync-and-gitea-mirroring.md b/projects/homelab/plans/gitea/brain-sync-and-gitea-mirroring.md index ec1dced..5107ae8 100644 --- a/projects/homelab/plans/gitea/brain-sync-and-gitea-mirroring.md +++ b/projects/homelab/plans/gitea/brain-sync-and-gitea-mirroring.md @@ -1,5 +1,5 @@ --- -type: guide +type: plan project: homelab tags: - gitea diff --git a/projects/homelab/plans/gitea/deployment-and-cicd-strategy.md b/projects/homelab/plans/gitea/deployment-and-cicd-strategy.md index 4dac2a8..e215833 100644 --- a/projects/homelab/plans/gitea/deployment-and-cicd-strategy.md +++ b/projects/homelab/plans/gitea/deployment-and-cicd-strategy.md @@ -1,6 +1,6 @@ --- type: plan -status: active +status: completed project: homelab tags: - gitea @@ -38,30 +38,23 @@ sequenceDiagram --- -## πŸ› οΈ Implementation Approaches +## πŸ› οΈ Realized Architecture: Dynamic Webhook GitOps & Gitea Runner -### 1. Webhooks & Watchtower / Diun (Pull Model - Recommended) -- **Approach**: CI pushes tagged images to GHCR. Watchtower/Diun running on the server detects new digest and automatically updates containers. -- **Pros**: Zero inbound SSH keys or open firewall ports needed from CI into homelab. -- **Cons**: Less granular control over immediate rollbacks. +Rather than relying on continuous image polling via Watchtower, the homelab adopted a **push-driven, event-based GitOps architecture**: -### 2. GitOps with Gitea Actions / GitHub Actions Runner -- **Approach**: Run a self-hosted lightweight Gitea runner on the server. On release/push to `main`, the runner executes `appctl pull && appctl restart `. -- **Pros**: Full visibility, reproducible deployments, direct log output in CI UI. +1. **Self-Hosted CI Runner (`act_runner`)**: + - Runs as a container inside `homelab-gitea` using `catthehacker/ubuntu:act-latest`. + - Executes linting, type-checking, and test validation in 15 seconds. +2. **Decentralized Host Dispatcher (`homelab-gitops.service`)**: + - Lightweight webhook daemon running on the server host at port 9000. + - Dispatches payloads dynamically to `~/Core/scripts/gitops_dispatcher.py`. + - Inspects `app.yaml` deployment declarations (`git_pull`, `compose_up`, `appctl_sync`) and applies updates with zero delay. +3. **Knowledge Base Pilot**: + - Successfully deployed on `~/Brain` with pre-commit gates, Gitea Actions CI, and instant `doc2site` reflection on `docs.roadtotech.me`. --- -## 🎯 Candidate Pilot Services for CI/CD - -The following micro-repos are selected as prioritized pilot targets for automated CI/CD pipelines: - -1. **`homelab-landing`** (`~/Sites/homelab-landing`): - - Pure static/nginx web portal (`roadtotech.me`). - - Fast, low-risk playground to test multi-stage Docker build, GHCR push, and automated deployment. -2. **`homelab-dashboard`** (`~/Sites/homelab-dashboard`): - - Fast-evolving Learning Hub API backend & Homepage customization. - - Ideal for testing pytest/linting pipelines before publishing. -3. **`homelab-minecraft`** (`~/Sites/homelab-minecraft`): - - Custom FastAPI Identity Manager Web Admin. - - Ideal for testing Python security linters, JWT validation, and container packaging. - +## πŸ”— Production Guides & Specifications +* [Dynamic Decentralized GitOps Dispatcher Architecture](../../guides/homelab-gitops-dispatcher-architecture.md) +* [Brain GitOps & Auto-Sync Deployment Pipeline](../../guides/brain-gitops-deployment-pipeline.md) +* [GitHub to Gitea Automated Batch Migration Plan](github-to-gitea-migration-plan.md) diff --git a/projects/homelab/plans/server-24-7/folder-structure-reorganization.md b/projects/homelab/plans/server-24-7/folder-structure-reorganization.md index 731aa41..3a83c46 100644 --- a/projects/homelab/plans/server-24-7/folder-structure-reorganization.md +++ b/projects/homelab/plans/server-24-7/folder-structure-reorganization.md @@ -1,6 +1,6 @@ --- type: plan -status: active +status: completed project: homelab tags: - homelab @@ -16,33 +16,41 @@ Establish clear, unambiguous directory boundaries across both the Server and Lap --- -## πŸ—ΊοΈ Standardized Directory Layout +## πŸ—ΊοΈ Realized Production Layout -### πŸ–₯️ Production Server Layout +> [!NOTE] +> The initial proposal for a monolithic `~/Deployments` directory was superseded by the decoupled `~/Core` and `~/Sites` architecture documented in [Homelab Architecture: Appctl & Decentralized Repositories](../../guides/homelab-appctl-architecture.md) and executed in [Core & Sites Cutover and Testing Plan](../appctl/core-sites-cutover-testing-plan.md). + +### πŸ–₯️ Production Server Layout (`/home/kiskaadee/`) ```text /home/kiskaadee/ -β”œβ”€β”€ Config/ # NixOS declarative configuration for this host -β”œβ”€β”€ Deployments/ # Or Production/ - Live Docker compose services (Git tracked) -β”‚ β”œβ”€β”€ core/ # Ingress (Traefik, Authelia, Socket-Proxy) -β”‚ β”œβ”€β”€ apps/ # Individual standalone services -β”‚ └── data/ # Persistent volumes or bind-mount configs -β”œβ”€β”€ Media/ # Jellyfin media libraries, recordings, storage -└── second-brain/ # Synced knowledge base & operational docs +β”œβ”€β”€ Core/ # Hardened Ingress & Gateway (Traefik, Authelia, Socket-Proxy) +β”œβ”€β”€ Sites/ # Decentralized micro-repositories for each container stack +β”œβ”€β”€ Brain/ # Synced personal knowledge base & operational docs +β”œβ”€β”€ Config/ # NixOS declarative configuration (hosts/server) +└── Media/ # High-capacity media storage for Jellyfin (/media) ``` -*Rule for Server*: -- **No** active development trees, compiler build caches (`target/`, `node_modules/` in home), or transient scratchpads. -- All running services run as containers or declarative systemd units. +*Rules for Server*: +- **No** active development trees, compiler build caches (`target/`, `node_modules/` in home root), or transient scratchpads. +- All running services run as containers orchestrated via `appctl` or declarative systemd units. --- -### πŸ’» Laptop Workstation Layout +### πŸ’» Laptop Workstation Layout (`/home/kiskaadee/`) ```text /home/kiskaadee/ -β”œβ”€β”€ Config/ # Shared NixOS repository (laptop configuration) -β”œβ”€β”€ Projects/ # Active source code repositories -β”œβ”€β”€ Learn/ # Backend residency and study coursework -β”œβ”€β”€ Experiments/ # Prototypes, spike tests, scratchpads -β”œβ”€β”€ second-brain/ # Personal notes & architecture plans -└── Downloads/ / Pictures/ # Standard user directories +β”œβ”€β”€ Projects/ # Active source code repositories +β”‚ └── active/ # Current work trees (e.g. homelab micro-repos, new-repo, dynu-monitor) +β”œβ”€β”€ Learn/ # Backend residency and study coursework +β”œβ”€β”€ Experiments/ # Prototypes, spike tests, scratchpads +β”œβ”€β”€ Brain/ # Local canonical knowledge graph vault +β”œβ”€β”€ Config/ # NixOS configuration repository (hosts/laptop) +└── Downloads/ / Pictures/ # Standard user directories ``` + +--- + +## πŸ”— Related Documents +* [Homelab Architecture: Appctl & Decentralized Repositories](../../guides/homelab-appctl-architecture.md) +* [Core & Sites Cutover and Testing Plan](../appctl/core-sites-cutover-testing-plan.md) diff --git a/projects/homelab/plans/server-24-7/nixos-server-laptop-migration.md b/projects/homelab/plans/server-24-7/nixos-server-laptop-migration.md index 99c77c1..c836838 100644 --- a/projects/homelab/plans/server-24-7/nixos-server-laptop-migration.md +++ b/projects/homelab/plans/server-24-7/nixos-server-laptop-migration.md @@ -1,6 +1,6 @@ --- type: plan -status: active +status: completed project: homelab tags: - homelab @@ -13,7 +13,7 @@ tags: # πŸ–₯️ NixOS Server & Laptop Workstation Migration ## 🎯 Executive Summary -Transition the current physical machine (`desktop`) into a dedicated, headless, 24/7 homelab production server (`server`). Transfer all GUI workflows, desktop environments, and active development workspaces to the `laptop`. +Transition the physical machine (`desktop`) into a dedicated, headless, 24/7 homelab production server (`server`). Transfer all GUI workflows, desktop environments, and active development workspaces to the `laptop`. --- @@ -43,26 +43,32 @@ graph LR ## πŸ“‹ Phased Execution Roadmap ### Phase 1: Laptop NixOS Baseline & Graphical Parity -- [ ] Install NixOS on the target laptop. -- [ ] Pull and configure `hosts/laptop/` from `nixos-config`. -- [ ] Move graphical stack definitions (Niri, Hyprland, Waybar, Mako, Rofi/Fuzzel, audio tools) to be enabled on `hosts/laptop/`. -- [ ] Verify GPU hardware acceleration (Intel/AMD/Nvidia drivers on laptop). -- [ ] Test user applications and shell environments on the laptop. +- [x] Install NixOS on the target laptop. +- [x] Pull and configure `hosts/laptop/` from `nixos-config`. +- [x] Move graphical stack definitions (Niri, Hyprland, Waybar, Mako, Rofi/Fuzzel, audio tools) to be enabled on `hosts/laptop/`. +- [x] Verify GPU hardware acceleration (Intel/AMD/Nvidia drivers on laptop). +- [x] Test user applications and shell environments on the laptop. ### Phase 2: Workspaces & Project Data Transfer -- [ ] Migrate local development repositories from desktop to laptop: +- [x] Migrate local development repositories from desktop to laptop: - Working trees in `Projects/`, `Learn/`, `Experiments/`. -- [ ] Configure SSH keys, GPG keys, and GitHub/Gitea credentials on the laptop. -- [ ] Verify that all ongoing development compiles and runs natively on the laptop. +- [x] Configure SSH keys, GPG keys, and GitHub/Gitea credentials on the laptop. +- [x] Verify that all ongoing development compiles and runs natively on the laptop. ### Phase 3: Server Configuration & Headless Conversion -- [ ] Refactor NixOS configuration repository: - - Rename/refactor `hosts/desktop` into `hosts/server` (or enforce pure headless specialization as default). +- [x] Refactor NixOS configuration repository: + - Establish `hosts/server` as dedicated headless configuration. - Remove graphical packages, desktop managers, display managers (`greetd`), and desktop-only daemons from the server host. - - Keep homelab modules: `homeserver.nix`, `traefik-deployments.nix`, `dynu.nix`, Docker daemon, SOPS secrets. -- [ ] Set up robust unattended boot, power management (disable sleep/suspend on idle), and wake-on-LAN/systemd watchdog if applicable. -- [ ] Dry-build and validate server configuration (`nix build .#nixosConfigurations.server.config.system.build.toplevel --no-link`). + - Maintain homelab modules: `homeserver.nix`, `traefik-deployments.nix`, `dynu.nix`, Docker daemon, SOPS secrets. +- [x] Set up robust unattended boot, power management (disable sleep/suspend on idle), and wake-on-LAN/systemd watchdog if applicable. +- [x] Dry-build and validate server configuration (`nix build .#nixosConfigurations.server.config.system.build.toplevel --no-link`). ### Phase 4: Production Hygiene & Decommissioning -- [ ] Clean up redundant folders on the server (e.g. personal browser profiles, desktop scratchpads, non-production experiments). -- [ ] Verify 24/7 stability, monitoring, and auto-restart of all Docker containers on boot. +- [x] Clean up redundant folders on the server (e.g. personal browser profiles, desktop scratchpads, non-production experiments). +- [x] Verify 24/7 stability, monitoring, and auto-restart of all Docker containers on boot. + +--- + +## 🏁 Outcome & Operational State +* **Headless Server (`server`)**: Operating 24/7 at `192.168.1.36` (port 2222), hosting `Core/`, `Sites/`, `Brain/`, and `Config/`. +* **Laptop Workstation (`laptop`)**: Primary daily development machine managing repositories locally and syncing declaratively via Git and SSH.