Add YAML frontmatter to all 54 retained markdown documents. Frontmatter schema is type-specific — no universal status field. Type contracts applied: - knowledge: type + status (draft|stable) + topics - project: type + status (planned|active|paused|completed) - plan: type + status + project context - guide: type + project context (no lifecycle status) - journal: type + date (no status — journals are historical by definition) - practice: type + status (completed|active) + topics - inbox: type + created date 54 documents tagged across: knowledge/concepts/ (3) knowledge/technologies/ (7, including python/ subdirectory with 4) knowledge/methods/ (6) projects/homelab/ (1 overview + 6 plans + 6 guides) projects/magnetflix/ (1) projects/nekoweb/ (1) records/journal/ (7) practice/LeetCode/ (14) inbox/ (1)
5.8 KiB
5.8 KiB
type, project
| type | project |
|---|---|
| guide | homelab |
🧠 Real-Time Brain Synchronization & Gitea Push Mirroring
🎯 Motivation & Objectives
The Brain repository (~/Brain) represents an actively edited knowledge vault (notes, architectural plans, daily learnings) accessed via Obsidian on client workstations (laptop) and served live to https://docs.roadtotech.me via homelab-doc2site.
Key Challenges & Invariants:
- Zero CI/CD & Rate-Limit Overhead: Standard GitHub Actions pipelines consume build minutes, hit quota limits, and take minutes to deploy. Note edits must appear in seconds without triggering remote CI runners.
- Instant Local Reflection:
homelab-doc2sitedynamically reads from disk on every HTTP request. As soon as changes land on the server host in/home/kiskaadee/Brain, they are visible ondocs.roadtotech.mewith zero container rebuilds. - Automated Cloud Backup: Edits must be backed up offsite to GitHub automatically without manual multi-remote pushes.
🏛️ End-to-End GitOps Architecture
┌────────────────────────┐
│ Laptop (Author) │
│ (Obsidian / Markdown) │
└───────────┬────────────┘
│ (Auto Git Push over HTTPS)
▼
┌────────────────────────┐
│ Self-Hosted Gitea │
│ (gitea.roadtotech.me) │
└───────────┬────────────┘
│
┌───────────────────────┴───────────────────────┐
│ [Push Mirror (Auto Cloud Backup)] │ [Server Host Sync Pull]
▼ ▼
┌───────────────────────────────┐ ┌───────────────────────────────┐
│ GitHub Remote (Offsite) │ │ Server Systemd Service/Timer │
│ (github.com/kiskaadee/Brain) │ │ (brain-sync.timer / pull) │
└───────────────────────────────┘ └───────────────┬───────────────┘
▼
┌───────────────────────────────┐
│ Server Host: ~/Brain │
│ (Mounted to doc2site) │
└───────────────┬───────────────┘
▼
┌───────────────────────────────┐
│ Live docs.roadtotech.me (0s) │
└───────────────────────────────┘
🚀 Validated Test Results
A full end-to-end integration test was executed using a test repository (testing-repo):
- Local Push: Laptop pushed commits over HTTPS to
https://gitea.roadtotech.me/kiskaadee/testing-repo.git. - Gitea Push Mirror: Configured with GitHub Classic Personal Access Token (
ghp_...) andreposcope. - SHA Parity: Verified identical commit hashes (
38285c4) mirrored tohttps://github.com/kiskaadee/testing-repoinstantaneously.
⚙️ Implementation Guide
1. Configure Gitea Push Mirror (Web UI)
- Open Gitea repository
\rightarrowSettings\rightarrowRepository\rightarrowMirror Settings. - Add Push Mirror:
- Target Address:
https://github.com/kiskaadee/<repo-name>.git - Authorization: GitHub Username + Classic PAT (
ghp_...withreposcope). - Sync Trigger: Enable "Sync when commits are pushed".
- Target Address:
2. Client-Side (Laptop) Automation
On your laptop, configure automatic commit and push:
- Option A (Obsidian Git Plugin): Set auto-save / auto-commit interval to 5–10 minutes.
- Option B (Git Remote Configuration):
cd ~/Brain git remote set-url origin https://gitea.roadtotech.me/kiskaadee/Brain.git
3. Server-Side Automated Git Reconciliation (brain-sync.timer)
A lightweight NixOS systemd timer runs periodically on the homelab host to pull upstream edits:
# Declarative Systemd Timer in NixOS
systemd.services.brain-sync = {
description = "Synchronize Brain markdown vault from Gitea";
serviceConfig = {
Type = "oneshot";
User = "kiskaadee";
WorkingDirectory = "/home/kiskaadee/Brain";
ExecStart = "${pkgs.git}/bin/git pull --ff-only origin main";
};
};
systemd.timers.brain-sync = {
description = "Trigger Brain sync every 2 minutes";
timerConfig = {
OnBootSec = "1min";
OnUnitActiveSec = "2min";
};
wantedBy = [ "timers.target" ];
};
📄 Summary of Benefits
- ⚡ Instant: Note changes render live upon page load on
docs.roadtotech.me. - 🛡️ Zero API / CI/CD Quotas: Never consumes billable GitHub Actions minutes.
- 📦 Offsite Redundancy: Gitea autonomously keeps GitHub in sync as a hot backup.