2
reference repo topology
dedinit wiki sync edited this page 2026-11-01 16:53:33 +00:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
title, created, updated, type, tags
title created updated type tags
reference-repo-topology — remotes и зеркало 2026-11-01 2026-11-01 reference
wiki
git
gitea
gitverse
mirror

Топология репозиториев

Проверено в сессии 2026-11-01: origin = Gitea, gitverse = зеркало (было наоборот — см. decision-gitea-primary).

Remotes

Remote URL Роль
origin https://gitea.nixg.ru/estorozhenko/dedinit.ru.git источник истины, пуш сюда = деплой сайта
gitverse git@gitverse.ru:kpa39l/dedinit.ru.git push-зеркало/бэкап, вручную пушить не нужно

Токен Gitea не хранится в URL remote — аутентификация идёт через credential helper с файлом в /opt/hermes/.hermes/secrets/.

Публикация изменения

cd /opt/dedinit.ru
git add -A && git commit -m "<что сделано>"
git push origin main        # Gitea → запускает deploy-dedinit и wiki-sync; gitverse получает зеркало

Проверка, что зеркало живо

source /opt/hermes/.hermes/secrets/git-tokens.env
curl -s -H "Authorization: token $GITEA_NIXG_TOKEN" \
  "$GITEA_NIXG_API/repos/estorozhenko/dedinit.ru/push_mirrors" | python3 -m json.tool
# ждём last_error пустым; сравнение факта:
git ls-remote https://gitverse.ru/kpa39l/dedinit.ru.git refs/heads/main
git rev-parse HEAD

sync_on_commit: true — синк сразу после пуша; interval: 1h — периодическая сверка как страховка.

Питфоллы

  • Глобальный HTTPS_PROXY на этом хосте валит CONNECT к gitea.nixg.ru; если пуш зависает — git -c http.proxy= -c https.proxy= push origin main.
  • git rev-list --left-right --count origin/main...main без предварительного git fetch врёт: remote-tracking ref в кэше устаревает. Сначала git fetch origin, потом сравнение (0 0).
  • Деплой собирает то, что лежит в Gitea: расхождение локальной main с origin/main сайт не замечает.
  • Отставание зеркала видно только в gitverse: git ls-remote https://gitverse.ru/kpa39l/dedinit.ru.git refs/heads/main против git rev-parse HEAD.

Ссылки