834595df6b
Единый workspace.local.env для адресов и паролей, init-machine, Set-GitRemotes, push-safe и check-no-secrets для политики kalinamall/github.
2.2 KiB
2.2 KiB
Workspace bootstrap
Единая настройка Mac / Windows для Git (SSH), Cursor и политики push.
Целевое место в Gitea: репозиторий Answer.and.other.shit (можно скопировать эту папку в scripts/workspace-bootstrap/).
Быстрый старт (новая машина)
# 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):
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
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
Переменная окружения
export WORKSPACE_ENV=/path/to/workspace.local.env
./init-machine.sh
По умолчанию: config/workspace.local.env рядом со скриптами.