feat: scaffold second-brain structure for homelab, projects, and learning roadmaps
This commit is contained in:
1 parent
cd4b5e4a79
commit
f9bd0f832c
12 files changed
+337
-1
No files matched your search
@@ -1 +1,22 @@
|
||||
# second-brain
|
||||
# 🧠 Second Brain
|
||||
|
||||
Central repository for personal knowledge management, architecture plans, roadmaps, homelab infrastructure designs, and project tracking.
|
||||
|
||||
---
|
||||
|
||||
## 🧭 Navigation & Areas
|
||||
|
||||
| Area | Focus & Purpose | Key Documents |
|
||||
| :--- | :--- | :--- |
|
||||
| [**Homelab & Infrastructure**](homelab/README.md) | Systems architecture, NixOS migrations, DNS, CI/CD, and `appctl`. | [NixOS Server & Laptop Migration](homelab/nixos-server-laptop-migration.md)<br>[Domain Migration (`roadtotech.me`)](homelab/domain-migration-roadtotech.md)<br>[Appctl & Repositories Architecture](homelab/homelab-appctl-architecture.md)<br>[CI/CD & Deployment Strategy](homelab/deployment-and-cicd-strategy.md)<br>[Production Folder Structure](homelab/folder-structure-reorganization.md) |
|
||||
| [**Projects**](projects/README.md) | Active software projects, architecture notes, and feature roadmaps. | [MagNetFlix](projects/magnetflix.md)<br>[Nekoweb](projects/nekoweb.md) |
|
||||
| [**Learning & Growth**](learning/README.md) | Academic tracking, residency curriculum milestones, and notes. | [Backend Residency Roadmap](learning/backend-residency.md) |
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Active Strategic Goals
|
||||
|
||||
1. **Host Roles Separation**: Transition the desktop workstation into a dedicated 24/7 headless NixOS production server, making the laptop the primary graphical workstation.
|
||||
2. **Domain Migration**: Move from Dynu's free subdomain (`arch-services.mywire.org`) to owned domain (`roadtotech.me`).
|
||||
3. **Repository Decoupling**: Extract monolithic deployments into standalone Git repositories with CI/CD and manage lifecycles using `appctl`.
|
||||
4. **Clean Production State**: Remove non-production and development artifacts from the server machine.
|
||||
@@ -0,0 +1,23 @@
|
||||
# 🌐 Homelab & Infrastructure Planning
|
||||
|
||||
This section documents the architectural roadmaps, infrastructure designs, deployment automation, and system administration workflows for the homelab ecosystem.
|
||||
|
||||
---
|
||||
|
||||
## 📑 Index of Plans
|
||||
|
||||
1. [**NixOS Server & Laptop Migration**](nixos-server-laptop-migration.md)
|
||||
- Converting the desktop into a 24/7 headless production server.
|
||||
- Setting up the laptop as the primary graphical development workstation.
|
||||
- Decoupling visual configurations (Niri, Hyprland, Waybar, GUI apps) from the server.
|
||||
2. [**Domain Migration (`roadtotech.me`)**](domain-migration-roadtotech.md)
|
||||
- Step-by-step strategy for cutting over from `arch-services.mywire.org` to `roadtotech.me`.
|
||||
- DNS delegation options (Dynu vs. Cloudflare), Traefik ACME wildcard SSL, and Authelia session cookie updates.
|
||||
3. [**Homelab Infrastructure & Appctl Architecture**](homelab-appctl-architecture.md)
|
||||
- Making `appctl` a first-class homelab orchestrator.
|
||||
- Decoupling monolithic deployments into individual standalone Git repositories.
|
||||
4. [**CI/CD & Deployment Strategy**](deployment-and-cicd-strategy.md)
|
||||
- Automating image builds, GitOps updates, Gitea Actions/GitHub Actions, and production rollouts.
|
||||
5. [**Production Folder Structure Reorganization**](folder-structure-reorganization.md)
|
||||
- Establishing strict directory boundaries (`/home/kiskaadee/Production`, `/home/kiskaadee/Deployments`, `/home/kiskaadee/Projects`).
|
||||
- Removing development traces and non-production scratchpads from the server.
|
||||
@@ -0,0 +1,39 @@
|
||||
# 🚀 Deployment & CI/CD Strategy
|
||||
|
||||
## 🎯 Objective
|
||||
Automate the build, test, containerization, and deployment lifecycle for services hosted in the homelab.
|
||||
|
||||
---
|
||||
|
||||
## 🔄 CI/CD Pipelines Overview
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
autonumber
|
||||
actor Dev as Developer (Laptop)
|
||||
participant Git as Git Remote (Gitea / GitHub)
|
||||
participant CI as CI Runner (Actions)
|
||||
participant Registry as Container Registry (GHCR / Local Registry)
|
||||
participant Server as 24/7 Homelab Server
|
||||
|
||||
Dev->>Git: git push (feat/fix branch -> main)
|
||||
Git->>CI: Trigger Build & Test workflow
|
||||
CI->>CI: Run Linters & Unit Tests
|
||||
CI->>Registry: Build multi-stage Docker image & Push
|
||||
CI->>Server: Trigger GitOps Deploy / Webhook / SSH appctl pull
|
||||
Server->>Registry: Pull new image
|
||||
Server->>Server: Restart container with zero/minimal downtime
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Implementation Approaches
|
||||
|
||||
### 1. Webhooks & Watchtower / Diun
|
||||
- **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 needed from CI into homelab.
|
||||
- **Cons**: Less granular control over rollback logic.
|
||||
|
||||
### 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 <service> && appctl restart <service>`.
|
||||
- **Pros**: Full visibility, reproducible deployments, direct log output in CI UI.
|
||||
@@ -0,0 +1,38 @@
|
||||
# 🌐 Domain Migration Plan: `arch-services.mywire.org` ➔ `roadtotech.me`
|
||||
|
||||
## 🎯 Objective
|
||||
Migrate all homelab public endpoints, Authelia single sign-on (SSO), Traefik reverse proxy routers, and SSL certificates from Dynu's free subdomain (`arch-services.mywire.org`) to the custom registered domain (`roadtotech.me`).
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ DNS & Provider Strategies
|
||||
|
||||
### Option A: Dynu Custom Domain (Zero Traefik Changes)
|
||||
1. In Hostinger registrar, set Custom Nameservers: `ns1.dynu.com` ... `ns6.dynu.com`.
|
||||
2. In Dynu Control Panel, add `roadtotech.me` under DDNS services.
|
||||
3. Keep Traefik ACME resolver as `provider=dynu` with existing `DYNU_API_KEY`.
|
||||
4. Update NixOS environment declarations to `DOMAIN = "roadtotech.me"`.
|
||||
|
||||
### Option B: Cloudflare DNS (Homelab Industry Standard)
|
||||
1. In Hostinger registrar, set Cloudflare Nameservers.
|
||||
2. In Cloudflare, create an `A` record or dynamic DNS updater with API token.
|
||||
3. Switch Traefik ACME resolver to `provider=cloudflare` with `CF_DNS_API_TOKEN`.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Implementation Checklist
|
||||
|
||||
- [ ] **Step 1: DNS Setup & Propagation Verification**
|
||||
- Add domain to chosen DNS manager.
|
||||
- Create wildcard record: `*.roadtotech.me` ➔ Target WAN IP.
|
||||
- Verify DNS resolution via `dig roadtotech.me +short` and `dig test.roadtotech.me +short`.
|
||||
- [ ] **Step 2: Update Declarative NixOS Configuration**
|
||||
- `hosts/desktop/homeserver.nix`: Change `DOMAIN` to `"roadtotech.me"`.
|
||||
- `hosts/desktop/traefik-deployments.nix`: Update `DOMAIN_SUFFIX` and subdomain variables (`DOCS_DOMAIN`, `GITEA_DOMAIN`, etc.).
|
||||
- `hosts/desktop/secrets.yaml`: Update DDNS domain variable if stored in SOPS.
|
||||
- [ ] **Step 3: Traefik & SSL Validation**
|
||||
- Trigger Traefik reload/restart.
|
||||
- Inspect Traefik logs to confirm Let's Encrypt DNS-01 challenge completion for `roadtotech.me` and `*.roadtotech.me`.
|
||||
- [ ] **Step 4: Authelia & Cookie Verification**
|
||||
- Authenticate against `https://auth.roadtotech.me`.
|
||||
- Verify SSO forward-auth across subdomains (`gitea.roadtotech.me`, `jellyfin.roadtotech.me`, etc.).
|
||||
@@ -0,0 +1,37 @@
|
||||
# 📁 Server Folder Structure & Production Hygiene
|
||||
|
||||
## 🎯 Objective
|
||||
Establish clear, unambiguous directory boundaries across both the Server and Laptop to prevent development clutter from mixing with 24/7 production services.
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Standardized Directory Layout
|
||||
|
||||
### 🖥️ Production Server Layout
|
||||
```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
|
||||
```
|
||||
|
||||
*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.
|
||||
|
||||
---
|
||||
|
||||
### 💻 Laptop Workstation Layout
|
||||
```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
|
||||
```
|
||||
@@ -0,0 +1,37 @@
|
||||
# 📦 Homelab Architecture: Appctl & Independent Repositories
|
||||
|
||||
## 🎯 Vision & Goals
|
||||
1. **Decouple Deployments**: Break monolithic multi-service compose stacks into isolated, independently version-controlled Git repositories.
|
||||
2. **First-Class Orchestrator (`appctl`)**: Standardize service lifecycle management (start, stop, logs, update, backup, healthcheck) via `appctl`.
|
||||
|
||||
---
|
||||
|
||||
## 🏛️ Architecture Model
|
||||
|
||||
```text
|
||||
/home/kiskaadee/Production/ (or /srv/deployments/)
|
||||
├── core-ingress/ # Traefik, Authelia, Socket-Proxy (Git repo)
|
||||
├── gitea/ # Gitea & Gitea Actions runner (Git repo)
|
||||
├── jellyfin/ # Media server stack (Git repo)
|
||||
├── magnetflix/ # MagNetFlix app & microservices (Git repo)
|
||||
├── nekoweb/ # Haruneko / Nekoweb deployments (Git repo)
|
||||
└── docs/ # Astro / Starlight documentation (Git repo)
|
||||
```
|
||||
|
||||
Each service directory contains:
|
||||
- `compose.yaml` (clean, self-contained Docker Compose file)
|
||||
- `.env` / environment variable template linked to `/run/secrets/`
|
||||
- Custom Dockerfiles or build scripts if applicable
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ `appctl` Responsibilities
|
||||
|
||||
`appctl` acts as the unified CLI wrapper across all production services:
|
||||
- `appctl list`: Discover registered production services and their operational statuses.
|
||||
- `appctl up <app>`: Start container stack using standard networks (`proxy-net`, `socket-net`).
|
||||
- `appctl down <app>`: Gracefully stop container stack.
|
||||
- `appctl restart <app>`: Restart service.
|
||||
- `appctl pull <app>`: Pull latest container images and trigger zero-downtime recreation.
|
||||
- `appctl logs <app> [-f]`: Stream container logs.
|
||||
- `appctl status <app>`: Inspect health status and resource consumption.
|
||||
@@ -0,0 +1,56 @@
|
||||
# 🖥️ 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`.
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ Architectural Topology
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
subgraph "Workstation (Laptop)"
|
||||
A[NixOS Laptop]
|
||||
A1[Niri / Hyprland / Wayland GUI]
|
||||
A2[Alacritty / Foot / Browser]
|
||||
A3[Active Code & Dev Workspaces]
|
||||
end
|
||||
|
||||
subgraph "Production (Server / Ex-Desktop)"
|
||||
B[NixOS Headless Server 24/7]
|
||||
B1[Docker & Traefik Core]
|
||||
B2[Appctl / Service Orchestration]
|
||||
B3[Databases, Media & Homelab Services]
|
||||
end
|
||||
|
||||
A -- "SSH / WireGuard / Git" --> B
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📋 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.
|
||||
|
||||
### Phase 2: Workspaces & Project Data Transfer
|
||||
- [ ] 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.
|
||||
|
||||
### Phase 3: Server Configuration & Headless Conversion
|
||||
- [ ] Refactor NixOS configuration repository:
|
||||
- Rename/refactor `hosts/desktop` into `hosts/server` (or enforce pure headless specialization as default).
|
||||
- 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`).
|
||||
|
||||
### 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.
|
||||
@@ -0,0 +1,10 @@
|
||||
# 📚 Learning & Curriculum Tracking
|
||||
|
||||
Overview of active technical studies, residencies, and skill development roadmaps.
|
||||
|
||||
---
|
||||
|
||||
## 📑 Topics Index
|
||||
|
||||
1. [**Backend Residency**](backend-residency.md)
|
||||
- Curriculum milestones, projects, reading lists, and core competency goals.
|
||||
@@ -0,0 +1,25 @@
|
||||
# 🎓 Backend Residency Roadmap & Tracking
|
||||
|
||||
## 📌 Context
|
||||
The backend residency curriculum is focused on deep engineering fundamentals: systems programming, distributed systems, high-throughput backend services, database internals, and concurrency.
|
||||
|
||||
*Active Workspace*: `/home/kiskaadee/Learn/backend-residency`
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Core Pillars & Milestones
|
||||
|
||||
### 1. Fundamentals & Networking
|
||||
- [ ] Low-level TCP/UDP socket programming.
|
||||
- [ ] HTTP/1.1, HTTP/2, and gRPC implementations.
|
||||
- [ ] Protocol serialization (JSON, Protobuf, FlatBuffers).
|
||||
|
||||
### 2. Databases & Storage Engines
|
||||
- [ ] Relational databases (PostgreSQL queries, execution plans, indexing strategies).
|
||||
- [ ] NoSQL / Document databases (MongoDB data modeling).
|
||||
- [ ] Storage engine architecture (LSM-trees vs B-Trees, WAL, caching).
|
||||
|
||||
### 3. Concurrency & Systems Architecture
|
||||
- [ ] Multi-threading, event loops, async I/O models.
|
||||
- [ ] Distributed locks, transactions, consensus mechanisms (Raft/Paxos).
|
||||
- [ ] Message queues and streaming (Kafka / RabbitMQ / Redis PubSub).
|
||||
@@ -0,0 +1,12 @@
|
||||
# 🛠️ Projects Hub
|
||||
|
||||
Central tracker for active development projects, architecture notes, feature roadmaps, and deployment states.
|
||||
|
||||
---
|
||||
|
||||
## 📑 Projects Index
|
||||
|
||||
1. [**MagNetFlix**](magnetflix.md)
|
||||
- Media streaming / torrent frontend & indexing ecosystem.
|
||||
2. [**Nekoweb**](nekoweb.md)
|
||||
- Haruneko personal web presence and static/dynamic publishing experiments.
|
||||
@@ -0,0 +1,19 @@
|
||||
# 🎬 MagNetFlix
|
||||
|
||||
## 📌 Project Overview
|
||||
MagNetFlix is an integrated media application designed for exploring, streaming, and indexing media content.
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Architecture & Components
|
||||
- **Frontend / Client**: Web UI for browsing media catalog, managing queues, and playback.
|
||||
- **Backend Services**: API layer, scrapers/indexers, metadata fetchers (TMDB/OMDb), and torrent client bridge.
|
||||
- **Data Persistence**: Database storage for library states, watch progress, and torrent sessions.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Roadmaps & Action Items
|
||||
- [ ] Decouple into a standalone Git repository with isolated Docker build files.
|
||||
- [ ] Configure GitHub Actions / Gitea Actions to build container images on release.
|
||||
- [ ] Define declarative Traefik reverse proxy routing (`magnetflix.roadtotech.me`).
|
||||
- [ ] Implement healthcheck endpoints and integrate with `appctl`.
|
||||
@@ -0,0 +1,19 @@
|
||||
# 🐱 Nekoweb / Haruneko
|
||||
|
||||
## 📌 Project Overview
|
||||
Personal web presence, static/dynamic site generation, and online showcase deployed to Nekoweb / homelab infrastructure.
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Scope & Integrations
|
||||
- **Web Assets**: HTML/CSS/JS frontend, themes, retro aesthetics, and interactive components.
|
||||
- **Hosting / Deployments**:
|
||||
- Direct Nekoweb integration or self-hosted mirror behind Traefik.
|
||||
- Automated deployment on push via CI/CD.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Roadmaps & Action Items
|
||||
- [ ] Establish standalone Git repository structure.
|
||||
- [ ] Setup automated sync / upload script for Nekoweb API.
|
||||
- [ ] Connect custom domain / subdomain routing if needed.
|
||||
Reference in new issue
Block a user