infracloud/CONNECTIONS.md

432 lines
11 KiB
Markdown

# Guia de Conexoes - Infracloud
Documento de referencia rapida para conexao aos servicos e servidores.
## Servicos e Credenciais
### Tabela Geral
| Arquivo ~/.ssh/ | Tipo | Servico | Status |
|-----------------|------|---------|--------|
| `civo` | Chave SSH | Redbull, Echo VPS | ✅ |
| `github` | Chave SSH | GitHub | ✅ |
| `ic-ad` | Chave SSH | Azure DevOps | ✅ |
| `cloudflare-token` | Token | Cloudflare API (Rede5) | ✅ |
| `cloudflare-token-inventcloud` | Token | Cloudflare API (Inventcloud) | ✅ |
| `coolify-redbull-token` | Token | Coolify Redbull | ✅ |
| `forgejo-token` | Token | Forgejo (pipe.gohorsejobs.com) | ✅ |
| `github-token` | Token | GitHub PAT | ✅ |
| `absam-db-novo` | Credenciais | Absam DB SSH | ❌ (senha) |
| `monday.env` | Token | Monday.com API | ✅ |
| `bookstack-token` | Token | Bookstack API | ✅ |
| `openproject-token` | Token | OpenProject API | ✅ |
| `bionexo` | Chave SSH | Bionexo | ❓ |
| `civo-object-storage` | Credenciais | Civo Object Storage | ❓ |
| `euronodes-object-storage` | Credenciais | Euronodes Object Storage | ❓ |
| `mxroute-api-key` | API Key | MXRoute Email | ❓ |
| `app01-rabbitmq-beecare-origin` | Credenciais | RabbitMQ (Beecare) | ❓ |
| `lh-zeus` | Chave SSH | Zeus (LH) | ❓ |
**Backup:** `s3://rede5/vault/ssh/`
---
## VPS
### Redbull (DEV)
| Propriedade | Valor |
|-------------|-------|
| Hostname (Coolify HTTPS) | `redbull.rede5.com.br` |
| IP (SSH direto) | `185.194.141.70` |
| Plataforma | Coolify v4 |
| Usuario | root |
| Chave SSH | `civo` |
```bash
# SSH usa IP direto (porta 22 bloqueada no domínio — Cloudflare)
ssh redbull
# ou equivalente:
ssh -i ~/.ssh/civo root@185.194.141.70
```
### Echo (PROD)
| Propriedade | Valor |
|-------------|-------|
| IP | `152.53.120.181` |
| Plataforma | Dokku |
| Usuario | root |
| Chave SSH | `civo` |
```bash
ssh -i ~/.ssh/civo root@152.53.120.181
```
---
## Cloud Database (Absam.io)
### Conexao
| Propriedade | Valor |
|-------------|-------|
| Host | `db-60604.dc-us-1.absamcloud.com` |
| Porta PostgreSQL | `11985` |
| Porta SSH | `18863` |
| vpsID | `60604` |
| Console | https://cloud.absam.io |
| SSH Config | `absam-io` |
### Databases
| Database | Usuario | Uso |
|----------|---------|-----|
| saveinmed | saveinmed | Saveinmed Medusa v2 |
| gohorsejobs | ghj | GoHorseJobs Backend |
| rodiziosdaqui | rodizios | RodiziosDaqui Backend |
| ghj_codex | ghj | GoHorseJobs Codex |
| sextando_dev | sextando | Sextando DEV |
```bash
# Conectar via SSH (senha no arquivo ~/.ssh/absam-db-novo)
ssh absam-io
# Conectar ao PostgreSQL
psql -h db-60604.dc-us-1.absamcloud.com -p 11985 -U <usuario> -d <database>
# Tunnel SSH para PostgreSQL interno
ssh -L 15432:10.0.9.219:5432 absam-io -N
```
---
## Cloudflare
| Propriedade | Valor |
|-------------|-------|
| Email | `<email>` |
| Token | `~/.ssh/cloudflare-token` |
```bash
export CF_AUTH_EMAIL="<email>"
export CF_AUTH_KEY=$(cat ~/.ssh/cloudflare-token)
export CF_ZONE_ID="<zone_id>"
# Listar DNS records
curl -s -H "X-Auth-Email: $CF_AUTH_EMAIL" -H "X-Auth-Key: $CF_AUTH_KEY" \
"https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/dns_records"
```
---
## GitHub
| Propriedade | Valor |
|-------------|-------|
| Token | `~/.ssh/github-token` |
| Chave SSH | `github` / `github.pub` |
```bash
# Clonar com token
git clone https://<user>:$(cat ~/.ssh/github-token)@github.com/rede5/repo.git
# Testar SSH
ssh -T git@github.com
```
---
## Coolify (Redbull)
| Propriedade | Valor |
|-------------|-------|
| URL | `https://redbull.rede5.com.br` |
| API | `https://redbull.rede5.com.br/api/v1` |
| Token | `~/.ssh/coolify-redbull-token` |
```bash
TOKEN=$(cat ~/.ssh/coolify-redbull-token)
URL="https://redbull.rede5.com.br/api/v1"
# Listar aplicacoes
curl -s -H "Authorization: Bearer $TOKEN" "$URL/applications"
# Deploy
curl -s -H "Authorization: Bearer $TOKEN" "$URL/deploy?uuid=<APP_UUID>"
```
---
## Azure DevOps
| Propriedade | Valor |
|-------------|-------|
| Organization | CN-Squad |
| Project | Invista FIDC - Nexus |
| Chave SSH | `ic-ad` / `ic-ad.pub` |
| PAT | `~/.ssh/azure_devops_auth.json` |
```bash
# Testar SSH
ssh -T git@ssh.dev.azure.com
# Clonar via SSH
git clone git@ssh.dev.azure.com:v3/CN-Squad/Invista%20FIDC%20-%20Nexus/<repo>
# API (com PAT)
AZDO_PAT=$(cat ~/.ssh/azure_devops_auth.json | jq -r '.pat')
curl -s -u ":$AZDO_PAT" "https://dev.azure.com/CN-Squad/_apis/projects?api-version=7.0"
```
---
## Absam API
| Propriedade | Valor |
|-------------|-------|
| access-token | `~/.ssh/absam-token` (linha 1) |
| secret-token | `~/.ssh/absam-token` (linha 2) |
```bash
ABSAM_ACCESS_TOKEN=$(sed -n '1p' ~/.ssh/absam-token)
ABSAM_SECRET_TOKEN=$(sed -n '2p' ~/.ssh/absam-token)
# Listar VPS
curl -s -H "access-token: $ABSAM_ACCESS_TOKEN" \
-H "secret-token: $ABSAM_SECRET_TOKEN" \
"https://api.absam.io/v1/vps"
# Detalhes VPS
curl -s -H "access-token: $ABSAM_ACCESS_TOKEN" \
-H "secret-token: $ABSAM_SECRET_TOKEN" \
"https://api.absam.io/v1/vps/60604"
# Restart VPS
curl -s -X POST -H "access-token: $ABSAM_ACCESS_TOKEN" \
-H "secret-token: $ABSAM_SECRET_TOKEN" \
"https://api.absam.io/v1/vps/60604/restart"
```
---
## Forgejo
| Propriedade | Valor |
|-------------|-------|
| URL | https://pipe.gohorsejobs.com |
| Token | `~/.ssh/forgejo-token` |
**Acesso:** API apenas (SSH nao configurado)
```bash
TOKEN=$(cat ~/.ssh/forgejo-token)
# Usuario
curl -H "Authorization: token $TOKEN" "https://pipe.gohorsejobs.com/api/v1/user"
# Repositorios
curl -H "Authorization: token $TOKEN" "https://pipe.gohorsejobs.com/api/v1/user/repos"
# Clone via HTTPS
git clone https://<usuario>:$TOKEN@pipe.gohorsejobs.com/<repo>
```
---
## MXRoute Email
| Propriedade | Valor |
|-------------|-------|
| Server | <server> |
| Username | <username> |
| API Key | `~/.ssh/mxroute-api-key` |
```bash
API_KEY=$(grep "API-Key" ~/.ssh/mxroute-api-key | cut -d' ' -f2)
# Listar dominios
curl -X GET "https://api.mxroute.com/domains" \
-H "X-Server: <server>" \
-H "X-Username: <username>" \
-H "X-API-Key: $API_KEY"
# Listar contas de email
curl -X GET "https://api.mxroute.com/accounts/<dominio>" \
-H "X-Server: <server>" \
-H "X-Username: <username>" \
-H "X-API-Key: $API_KEY"
```
---
## Monday.com
| Propriedade | Valor |
|-------------|-------|
| Token | `~/.ssh/monday.env` |
| Board ID | `18400111746` |
| Account | dhgabriel888's Team |
```bash
# Carregar credenciais
source ~/.ssh/monday.env
# Testar API
curl -s -H "Authorization: $MONDAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "{ me { id name email } }"}'
# Listar tasks do board
curl -s -H "Authorization: $MONDAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "{ boards(ids: '$MONDAY_BOARD_ID') { items_page { items { id name state } } } }"}'
```
---
## Bookstack
| Propriedade | Valor |
|-------------|-------|
| URL | https://bookstack.rede5.com.br |
| Token | `~/.ssh/bookstack-token` |
```bash
TOKEN=$(cat ~/.ssh/bookstack-token)
# Listar livros
curl -s -H "Authorization: Token $TOKEN" "https://bookstack.rede5.com.br/api/books"
```
---
## OpenProject
| Propriedade | Valor |
|-------------|-------|
| URL | https://projetos.rede5.com.br |
| API Key | `~/.ssh/openproject-token` |
```bash
# O usuario da API e a palavra 'apikey' literal
# A senha e o token armazenado em ~/.ssh/openproject-token
TOKEN=$(cat ~/.ssh/openproject-token)
# Listar projetos
curl -s -u apikey:$TOKEN "https://projetos.rede5.com.br/api/v3/projects"
# Listar tarefas (work items)
curl -s -u apikey:$TOKEN "https://projetos.rede5.com.br/api/v3/work_packages"
```
---
## Repositórios de Desenvolvimento (Local)
Repositórios clonados e padronizados na branch `dev`.
| Projeto | Repositório Local | Branch | URL GitHub |
|---------|-------------------|--------|------------|
| Q1Agenda | `C:\dev\q1agenda-backend` | `dev` | [Link](https://github.com/rede5/q1agenda-backend) |
| Q1food (BE) | `C:\dev\food-backend` | `dev` | [Link](https://github.com/rede5/food-backend) |
| Q1food (FE) | `C:\dev\food-frontend` | `dev` | [Link](https://github.com/rede5/food-frontend) |
| Q1Vestuario (BE) | `C:\dev\vestuario-backend` | `dev` | [Link](https://github.com/rede5/vesturario-backend) |
| Q1Vestuario (FE) | `C:\dev\vestuario-frontend` | `dev` | [Link](https://github.com/rede5/vestuario-frontend) |
| Q1 SITE | `C:\dev\q1site` | `dev` | [Link](https://github.com/rede5/q1site) |
| GoHorseJobs | `C:\dev\gohorsejobs` | `dev` | [Link](https://github.com/rede5/gohorsejobs) |
| PHOTUM | `C:\dev\photum` | `dev` | [Link](https://github.com/rede5/photum) |
| SaveinMed | `C:\dev\saveinmed` | `dev` | [Link](https://github.com/rede5/saveinmed) |
| Q1FIT | `C:\dev\q1fit` | `dev` | [Link](https://github.com/rede5/q1fit) |
| Zeus | `C:\dev\zeus-suplementos` | `dev` | [Link](https://github.com/rede5/zeus-suplementos) |
| Infracloud | `C:\dev\infracloud` | `main` | [Link](https://github.com/rede5/infracloud) |
```bash
# Sincronizar todos os repos (exemplo)
cd C:\dev\<repo>
git checkout dev
git pull origin dev
```
---
## Object Storage (Civo)
| Propriedade | Valor |
|-------------|-------|
| Provider | Civo |
| Region | NYC1 |
| Bucket | rede5-vault |
| Credentials | `~/.ssh/civo-object-storage` |
---
## Object Storage (Euronodes)
| Propriedade | Valor |
|-------------|-------|
| Provider | Euronodes |
| Region | Netherlands |
| Bucket | rede5-backup |
| Credentials | `~/.ssh/euronodes-object-storage` |
---
## RabbitMQ (Beecare)
| Propriedade | Valor |
|-------------|-------|
| Host | app01-rabbitmq-beecare-origin |
| Credentials | `~/.ssh/app01-rabbitmq-beecare-origin` |
---
## SSH Config
Hosts configurados em `~/.ssh/config`:
```
Host redbull # redbull.rede5.com.br / 185.194.141.70 (Coolify DEV)
Host echo # 152.53.120.181 (Dokku PROD)
Host nc2 # 212.56.41.211 (Contabo)
Host absam-io # db-60604.dc-us-1.absamcloud.com (PostgreSQL)
```
---
## Links Uteis
| Servico | URL |
|---------|-----|
| Azure DevOps | https://dev.azure.com/CN-Squad/ |
| Coolify Redbull | https://redbull.rede5.com.br |
| Absam Console | https://cloud.absam.io |
| Cloudflare Dashboard | https://dash.cloudflare.com |
| Monday.com | https://dhgabriel888s-team.monday.com/boards/18400111746 |
---
*Atualizado em: 2026-02-26*
## Status dos Servicos (Testado em 2026-02-26)
| Servico | Status |
|---------|--------|
| VPS Redbull (SSH) | ✅ OK |
| VPS Echo (SSH) | ✅ OK |
| VPS NC2 (SSH) | ✅ OK |
| VPS Absam-io (SSH) | ✅ OK (requer senha) |
| GitHub (SSH) | ✅ OK |
| Bitbucket (SSH) | ✅ OK |
| Coolify API | ✅ OK |
| Forgejo API | ✅ OK |
| GitHub API | ✅ OK |
| Bookstack API | ✅ OK |
| Cloudflare (Rede5) | ✅ OK (20 zonas) |
| Cloudflare (Inventcloud) | ✅ OK (3 zonas) |
| MXRoute API | ✅ OK |
| OCI (Oracle) | ✅ OK |
| Kubernetes | ✅ OK |
| Object Storage Civo | ✅ OK |
| Object Storage Euronodes | ✅ OK |
| Monday.com API | ✅ OK |