Files
local_machine/docs/git/LOCAL_MACHINE_GITEA_SETUP.md
ahauimix 1938b7c743 Expand local_machine docs and automation for connectivity, games, and ops.
Add proxy/VPN/telegram launchd and emergency runbooks; reorganize apps docs;
document JA3 CrossOver runbook and Wine troubleshooting; add GOG/HoMM game
scripts, disk cleanup guides, and gitea push-via-proxy helper. Ignore temp/.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 08:12:19 +03:00

81 lines
3.8 KiB
Markdown
Raw Blame History

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.
# local_machine — репозиторий на Gitea
Репозиторий **local_machine** на сервере Gitea (gitea.hunab.app): документация и скрипты для локальной машины.
## Быстрый старт
### 1. Создать репозиторий на Gitea (один раз)
**Вариант А — через веб-интерфейс**
1. Открыть: https://gitea.hunab.app
2. Войти под пользователем `hunabgit` (или своим).
3. **New Repository** → Name: `local_machine` → Create Repository.
4. Репо создавать **пустым** (без README / .gitignore).
**Вариант Б — через API (если есть токен)**
```bash
# Токен: Gitea → Settings → Applications → Generate New Token (write:repository, read:repository)
export GITEA_TOKEN="your_token"
bash scripts/deployment/gitea/setup-and-push.sh --create-only
```
### 2. Инициализация и первый пуш
**Важно:** сначала создай репозиторий на Gitea (шаг 1), иначе `git push` выдаст ошибку.
Из корня **local_machine** (не из родительского репо):
```bash
cd /Users/eternal/code/local_machine
bash scripts/deployment/gitea/setup-and-push.sh
```
Скрипт:
- инициализирует git в `local_machine` (если ещё нет `.git`);
- добавляет `origin` (SSH или HTTPS);
- делает первый коммит и `git push -u origin main`.
Если пуш упал (таймаут или «repository not found»): создай репо по шагу 1, затем снова выполни `git push -u origin main` из каталога `local_machine`.
### 3. Если пуш из РФ зависает
По гайду [GITEA_COMPLETE_GUIDE.md](./GITEA_COMPLETE_GUIDE.md):
- предпочтительно **SSH** (порт 2223):
`git remote set-url origin ssh://git@gitea.hunab.app:2223/hunabgit/local_machine.git`
и снова `git push -u origin main`;
- либо **пуш через прокси на зеркальный сервер 206.189.35.205** (как в hunabapp):
```bash
# Из корня local_machine. Требуется: прокси hsites-ahau, ключ к 206, репо local_machine создан на Gitea на 206.
bash scripts/deployment/gitea/git-push-gitea-via-proxy.sh
# или с явным хостом: GITEA_SERVER=user@206.189.35.205 bash scripts/deployment/gitea/git-push-gitea-via-proxy.sh
```
Скрипт пробует по порядку: SSH через прокси → HTTPS → bundle (копирование на сервер и `docker exec` в контейнер Gitea). Режим проверки без пуша: `bash scripts/deployment/gitea/git-push-gitea-via-proxy.sh --dry-run`.
## .gitignore
В корне проекта настроен `.gitignore`, чтобы не пушить:
- системный мусор: `.DS_Store`, `Thumbs.db`;
- секреты и ключи: `.env`, `*.pem`, `*.key`, конфиги VPN с ключами (`docs/connectivity/vpn/*.conf`);
- артефакты: `node_modules/`, `__pycache__/`, `*.log`, `*.tmp`, кэши и т.п.;
- IDE/редакторы: `.idea/`, `.vscode/`, `.cursor/`.
Конфиги с приватными ключами (WireGuard и т.д.) в репозиторий не попадают.
## Дальнейшая работа
- Клонирование:
`git clone https://gitea.hunab.app/hunabgit/local_machine.git`
или по SSH:
`git clone git@gitea.hunab.app:hunabgit/local_machine.git`
- Обычные коммиты и пуш:
`git add ... && git commit -m "..." && git push origin main`
Полный гайд по Gitea (пуши, SSH, bundle, из РФ): [GITEA_COMPLETE_GUIDE.md](./GITEA_COMPLETE_GUIDE.md).