feat: workspace-bootstrap — init SSH/git/Cursor для Mac и Windows
Единый workspace.local.env для адресов и паролей, init-machine, Set-GitRemotes, push-safe и check-no-secrets для политики kalinamall/github.
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
# Workspace bootstrap
|
||||
|
||||
Единая настройка **Mac / Windows** для Git (SSH), Cursor и политики push.
|
||||
|
||||
Целевое место в Gitea: репозиторий **Answer.and.other.shit** (можно скопировать эту папку в `scripts/workspace-bootstrap/`).
|
||||
|
||||
## Быстрый старт (новая машина)
|
||||
|
||||
```bash
|
||||
# 1. Клонировать bootstrap (или весь Answer.and.other.shit)
|
||||
cd scripts/workspace-bootstrap
|
||||
|
||||
# 2. Секреты и адреса — один файл (не в git!)
|
||||
cp config/workspace.local.env.example config/workspace.local.env
|
||||
# отредактировать workspace.local.env
|
||||
|
||||
# 3. Машина: SSH, git, клоны, remotes
|
||||
./init-machine.sh
|
||||
|
||||
# 4. Cursor: правила в проекты
|
||||
./init-cursor.sh
|
||||
|
||||
# 5. Добавить ~/.ssh/id_ed25519_kalinamall.pub в Gitea (kalinamall + home) и GitHub
|
||||
./init-machine.sh --verify
|
||||
```
|
||||
|
||||
Windows (PowerShell):
|
||||
|
||||
```powershell
|
||||
cd scripts\workspace-bootstrap
|
||||
copy config\workspace.local.env.example config\workspace.local.env
|
||||
# отредактировать
|
||||
.\init-machine.ps1
|
||||
.\init-cursor.sh # через Git Bash, или: bash init-cursor.sh
|
||||
.\init-machine.ps1 -Verify
|
||||
```
|
||||
|
||||
## Файлы
|
||||
|
||||
| Файл | В git | Назначение |
|
||||
|------|-------|------------|
|
||||
| `config/workspace.local.env.example` | да | шаблон |
|
||||
| `config/workspace.local.env` | **нет** | логины, IP, пароли, пути |
|
||||
| `config/repos.yaml` | да | список репозиториев |
|
||||
| `config/ssh-config.template` | да | `~/.ssh/config` |
|
||||
| `config/hosts.template` | да | строки для `/etc/hosts` или `C:\Windows\System32\drivers\etc\hosts` |
|
||||
|
||||
## Push
|
||||
|
||||
```bash
|
||||
cd ~/Documents/Cursor/Projects/reverse-proxy
|
||||
../../reverse-proxy/scripts/workspace-bootstrap/push-safe.sh
|
||||
# или из bootstrap: ./push-safe.sh /path/to/repo
|
||||
```
|
||||
|
||||
- **kalinamall** — всегда (с секретами)
|
||||
- **home** — если `PUSH_HOME=yes` в env
|
||||
- **github** — только после `check-no-secrets.sh`
|
||||
|
||||
## Переменная окружения
|
||||
|
||||
```bash
|
||||
export WORKSPACE_ENV=/path/to/workspace.local.env
|
||||
./init-machine.sh
|
||||
```
|
||||
|
||||
По умолчанию: `config/workspace.local.env` рядом со скриптами.
|
||||
Reference in New Issue
Block a user