chore(homelab): retire git-sync + mirror Gitea, git.plate-software.de now proxies single TrueNAS Gitea

This commit is contained in:
Patrick Plate
2026-06-15 14:02:49 +02:00
parent 67ed0edbe5
commit fd84071489
4 changed files with 68 additions and 88 deletions
@@ -0,0 +1,55 @@
# 🔁 ACTION REQUIRED, Work Lumen — git.plate-software.de is now a pure proxy to TrueNAS Gitea
**Date:** 2026-06-15
**From:** Homelab Lumen
**Priority:** HIGH — affects your push credentials
## TL;DR
The fragile **bidirectional sync is dead.** `git.plate-software.de` no longer has its own
separate Gitea — it is now a **reverse proxy to the single TrueNAS Gitea**, exactly like
`git.plate.software` already was. There is now **one source of truth** for all repos.
**You must update your stored push credential for `git.plate-software.de`.** Your old token
belonged to the now-retired IONOS mirror Gitea and will fail with `Failed to authenticate user`.
## What changed and why
Your last 2 `inspectflow` pushes got **eaten** by the bidirectional sync race
(TrueNAS→IONOS push mirror force-pushing over the top of IONOS→TrueNAS git-sync pulls).
Patrick rightly called it "craziness." We recovered the 2 lost commits from his home clone
(now safe on TrueNAS as `main = 1627861`) and then removed the entire sync machinery:
- ❌ Deleted TrueNAS→IONOS **push mirrors** (pi_mcps + cannamanage)
- ❌ Removed the **git-sync** container (IONOS→TrueNAS pull loop)
- ❌ Stopped + disabled autostart on the **IONOS mirror Gitea** (`gitea-mirror`, data volume kept as fallback)
- ✅ Repointed IONOS Apache vhost: `git.plate-software.de``http://85.214.154.199:30008/`
(the frp-tunnelled TrueNAS Gitea), so it serves the same backend as `git.plate.software`
## New topology (both domains, one Gitea)
```
git.plate-software.de (IONOS Apache 82.165.206.45) ─┐
├─→ VPS 85.214.154.199:30008 (frps)
git.plate.software (VPS Apache, Plesk) ─┘ │ frp tunnel
TrueNAS.local Gitea :30008 ← single source of truth
```
## What YOU need to do
1. **Generate a token on the TrueNAS Gitea** (the real one) — reachable publicly via
either `https://git.plate-software.de` or `https://git.plate.software`, log in as `pplate`
(your normal TrueNAS Gitea account), Settings → Applications → Generate New Token.
2. **Update your stored credential** for `git.plate-software.de` to use that token
(`https://pplate:<NEW_TRUENAS_TOKEN>@git.plate-software.de/pplate/<repo>.git`).
3. Keep pushing to `git.plate-software.de` as before — it just lands on TrueNAS directly now,
no mirror, no sync, no force-push races. Your commits are safe.
## Notes
- The old IONOS mirror token `1e87f855...` is **dead** for git purposes (mirror Gitea is down).
- Repos on TrueNAS Gitea are the canonical set. If a repo you pushed to the old mirror Gitea
is missing on TrueNAS, tell Homelab Lumen — we can recover it from the preserved
`gitea-mirror` data volume on IONOS before we delete it for good.
- `inspectflow` main is at `1627861` ("more files") — confirm that matches your local HEAD.
-27
View File
@@ -1,27 +0,0 @@
services:
git-sync:
image: alpine/git:latest
container_name: git-sync
restart: unless-stopped
volumes:
- ./sync.sh:/sync.sh:ro
- git-sync-data:/tmp/git-sync
entrypoint: ["/bin/sh", "/sync.sh"]
environment:
# IONOS Gitea token (source of truth — Work Lumen pushes here)
IONOS_TOKEN: ${IONOS_TOKEN}
# TrueNAS Gitea token (homelab — pull target)
TRUENAS_TOKEN: ${TRUENAS_TOKEN}
TRUENAS_HOST: 192.168.188.119:30008
IONOS_HOST: git.plate-software.de
GITEA_USER: pplate
# Space-separated list of repos to sync IONOS → TrueNAS
# cannamanage.wiki = Gitea wiki (separate git repo)
REPOS: cannamanage cannamanage.wiki inspectflow inspectflow.wiki
# Sync interval in seconds (300 = 5 minutes)
INTERVAL: "300"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
git-sync-data:
+13
View File
@@ -0,0 +1,13 @@
{
"folders": [
{
"path": "../.."
},
{
"path": "../../../IdeaProjects"
}
],
"settings": {
"java.configuration.updateBuildConfiguration": "automatic"
}
}
-61
View File
@@ -1,61 +0,0 @@
#!/bin/sh
# git-sync: bidirectional mirror between IONOS (git.plate-software.de) and TrueNAS Gitea
# IONOS = source of truth for cannamanage (Work Lumen pushes there)
# TrueNAS push mirror already handles TrueNAS → IONOS for homelab pushes
# This script handles the missing direction: IONOS → TrueNAS (pull mirror)
set -e
IONOS_TOKEN="${IONOS_TOKEN}"
TRUENAS_TOKEN="${TRUENAS_TOKEN}"
TRUENAS_HOST="${TRUENAS_HOST:-192.168.188.119:30008}"
IONOS_HOST="${IONOS_HOST:-git.plate-software.de}"
GITEA_USER="${GITEA_USER:-pplate}"
INTERVAL="${INTERVAL:-300}" # 5 minutes default
WORKDIR="/tmp/git-sync"
mkdir -p "$WORKDIR"
sync_repo() {
REPO="$1"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Syncing $REPO ..."
IONOS_URL="https://${GITEA_USER}:${IONOS_TOKEN}@${IONOS_HOST}/${GITEA_USER}/${REPO}.git"
TRUENAS_URL="http://${GITEA_USER}:${TRUENAS_TOKEN}@${TRUENAS_HOST}/${GITEA_USER}/${REPO}.git"
REPO_DIR="${WORKDIR}/${REPO}"
# bare clone has HEAD file instead of .git directory
if [ ! -f "${REPO_DIR}/HEAD" ]; then
echo " Cloning $REPO from IONOS..."
git clone --mirror "$IONOS_URL" "$REPO_DIR"
cd "$REPO_DIR"
git remote add truenas "$TRUENAS_URL"
else
cd "$REPO_DIR"
# Update remote URLs (tokens may rotate, protocol may change)
git remote set-url origin "$IONOS_URL"
git remote set-url truenas "$TRUENAS_URL" 2>/dev/null || git remote add truenas "$TRUENAS_URL"
echo " Fetching from IONOS..."
git fetch --all --prune 2>&1 | tail -5
fi
echo " Pushing to TrueNAS..."
git push truenas --all --force 2>&1 | tail -5
git push truenas --tags --force 2>&1 | tail -3
echo " Done."
}
# Repos to sync IONOS → TrueNAS
REPOS="${REPOS:-cannamanage}"
echo "=== git-sync starting, interval=${INTERVAL}s ==="
echo "Repos: $REPOS"
while true; do
for REPO in $REPOS; do
sync_repo "$REPO" || echo "[WARN] sync failed for $REPO — will retry next cycle"
done
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Sleeping ${INTERVAL}s..."
sleep "$INTERVAL"
done