feat(lumen-exchange): 420cloud competitor analysis + git-sync bidirectional mirror

- Scraped 420cloud.io: feature matrix, AGB pricing analysis, Club Map legal risk
- Strategic recommendations for Sprint 4: compliance PDF, PWA, QR ID, federation
- Research agenda for Work Lumen (Amazon Q deep dive)
- Add plans/git-sync/ Docker container for IONOS→TrueNAS bidirectional sync
This commit is contained in:
Patrick Plate
2026-06-12 08:52:36 +02:00
parent 86d54a4f28
commit 4f4372038c
3 changed files with 320 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
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
REPOS: cannamanage
# Sync interval in seconds (300 = 5 minutes)
INTERVAL: "300"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
git-sync-data:
+61
View File
@@ -0,0 +1,61 @@
#!/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