docs: adiciona instrucoes para repositorio privado
Some checks failed
CI/CD Web + Desktop / Detect changes (push) Successful in 5s
Quality Checks / Lint, Test and Build (push) Successful in 4m40s
CI/CD Web + Desktop / Deploy Convex functions (push) Has been skipped
CI/CD Web + Desktop / Deploy (VPS Linux) (push) Has been cancelled

Atualiza docs/SETUP.md e scripts/setup-dev.sh com:
- Instrucoes para configurar chave SSH
- Opcao de usar Personal Access Token (PAT)
- Comandos para clonar/configurar via SSH ou HTTPS
- Script setup-dev.sh agora aceita --ssh para repo privado

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
esdrasrenan 2025-12-16 23:18:31 -03:00
parent 9e385b664d
commit 9c258b43f1
2 changed files with 131 additions and 11 deletions

View file

@ -19,17 +19,62 @@ curl -fsSL https://bun.sh/install | bash
powershell -c "irm bun.sh/install.ps1 | iex"
```
## Configurar Autenticacao (Repositorio Privado)
Se o repositorio for privado, configure autenticacao SSH antes de clonar.
### Opcao 1: SSH Key (Recomendado)
```bash
# 1. Gerar chave SSH (se nao tiver)
ssh-keygen -t ed25519 -C "seu-email@exemplo.com"
# Pressione Enter para aceitar o local padrao
# Defina uma senha ou deixe em branco
# 2. Copiar a chave publica
# Linux/macOS/WSL:
cat ~/.ssh/id_ed25519.pub
# Windows (PowerShell):
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub
# Windows (CMD):
type %USERPROFILE%\.ssh\id_ed25519.pub
```
**Adicionar a chave nos servicos:**
- **GitHub:** Settings > SSH and GPG keys > New SSH key
- **Forgejo:** Settings > SSH / GPG Keys > Add Key
### Opcao 2: Personal Access Token (PAT)
1. **GitHub:** Settings > Developer settings > Personal access tokens > Tokens (classic)
2. Gerar token com permissao `repo`
3. Usar o token como senha quando o git pedir
Para salvar o token (nao precisar digitar toda vez):
```bash
git config --global credential.helper store
# Proximo push/pull vai pedir usuario e token, e salvar
```
## Setup Rapido
### 1. Clonar o repositorio
**Repositorio publico (HTTPS):**
```bash
git clone https://github.com/esdrasrenan/sistema-de-chamados.git
cd sistema-de-chamados
```
Ou se ja tiver o repositorio:
**Repositorio privado (SSH):**
```bash
git clone git@github.com:esdrasrenan/sistema-de-chamados.git
cd sistema-de-chamados
```
Ou se ja tiver o repositorio:
```bash
cd sistema-de-chamados
git pull origin main
@ -37,17 +82,28 @@ git pull origin main
### 2. Configurar remotes (para CI/CD)
**Repositorio publico (HTTPS):**
```bash
# Adicionar remote do Forgejo (dispara CI/CD)
git remote add forgejo https://git.esdrasrenan.com.br/esdras/sistema-de-chamados.git
```
# Verificar remotes
**Repositorio privado (SSH):**
```bash
# Mudar origin para SSH (se clonou via HTTPS)
git remote set-url origin git@github.com:esdrasrenan/sistema-de-chamados.git
# Adicionar forgejo via SSH (porta 2222)
git remote add forgejo ssh://git@git.esdrasrenan.com.br:2222/esdras/sistema-de-chamados.git
```
**Verificar remotes:**
```bash
git remote -v
# Deve mostrar:
# origin https://github.com/esdrasrenan/sistema-de-chamados.git (fetch)
# origin https://github.com/esdrasrenan/sistema-de-chamados.git (push)
# forgejo https://git.esdrasrenan.com.br/esdras/sistema-de-chamados.git (fetch)
# forgejo https://git.esdrasrenan.com.br/esdras/sistema-de-chamados.git (push)
# Deve mostrar (exemplo com SSH):
# origin git@github.com:esdrasrenan/sistema-de-chamados.git (fetch)
# origin git@github.com:esdrasrenan/sistema-de-chamados.git (push)
# forgejo ssh://git@git.esdrasrenan.com.br:2222/esdras/sistema-de-chamados.git (fetch)
# forgejo ssh://git@git.esdrasrenan.com.br:2222/esdras/sistema-de-chamados.git (push)
```
### 3. Instalar dependencias