# Absam Cloud Database

Cloud Database gerenciado pela Absam.io.

## Informacoes do Servidor

| Campo | Valor |
|-------|-------|
| vpsID | 60604 |
| Nome | novo-cloud-database |
| OS | PostgreSQL 17 |
| Provedor | Absam.io |
| Console | https://cloud.absam.io |

## Conectividade

### SSH

| Campo | Valor |
|-------|-------|
| Host | db-60604.dc-us-1.absamcloud.com |
| Porta | 18863 |
| Usuario | admin |
| Senha | `<REDACTED>` |

### PostgreSQL

| Tipo | Host | Porta |
|------|------|-------|
| Privado (interno) | 10.0.9.219 | 5432 |
| Publico | db-60604.dc-us-1.absamcloud.com | 11985 |

### Databases

| Database | Usuario | Senha | Projeto |
|----------|---------|-------|---------|
| saveinmed | saveinmed | `<REDACTED>` | Saveinmed Medusa v2 |
| gohorsejobs | ghj | `<REDACTED>` | GoHorseJobs Backend |
| rodiziosdaqui | rodizios | `<REDACTED>` | RodiziosDaqui Backend |
| ghj_codex | ghj | `<REDACTED>` | GoHorseJobs Codex |

> **Nota:** As senhas estao armazenadas em `~/.ssh/absam-db-novo`

### API Tokens (Absam Cloud)

| Campo | Valor |
|-------|-------|
| access-token | `<REDACTED>` |
| secret-token | `<REDACTED>` |

> **Nota:** Os tokens estao armazenados em `~/.ssh/absam-token`

## Configuracao SSH

Adicionar ao `~/.ssh/config`:

```
Host absam-db
    HostName db-60604.dc-us-1.absamcloud.com
    User admin
    Port 18863
    PreferredAuthentications password
    PubkeyAuthentication no
```

## Uso

### Conectar via SSH

```bash
ssh absam-db
```

### Conectar ao PostgreSQL (porta publica)

```bash
psql -h db-60604.dc-us-1.absamcloud.com -p 11985 -U <usuario> -d <database>
```

### Connection Strings

```
postgres://<usuario>:<senha>@db-60604.dc-us-1.absamcloud.com:11985/<database>
```

### Conectar ao PostgreSQL (via tunel SSH)

```bash
ssh -L 15432:10.0.9.219:5432 absam-db -N

# Em outro terminal
psql -h localhost -p 15432 -U <usuario> -d <database>
```

## Absam Cloud API

### Autenticacao

```bash
export ABSAM_ACCESS_TOKEN="<token>"
export ABSAM_SECRET_TOKEN="<token>"
```

### Comandos

```bash
# Listar VPS
curl -s -H "access-token: $ABSAM_ACCESS_TOKEN" \
  -H "secret-token: $ABSAM_SECRET_TOKEN" \
  "https://api.absam.io/v1/vps"

# Detalhes da 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"
```

## Links

- **Console Absam**: https://cloud.absam.io
- **API Docs**: https://docs.absam.io

---

*Documento atualizado em: 2026-02-21*
