security(infra): remove backend/.env do tracking + .dockerignore + .env.example
- backend/.env deixa de ser versionado (continha JWT_SECRET, DATABASE_URL, DRAGONFLY_URL e chaves de IA); arquivo preservado em disco (dev e prod). - backend/.dockerignore: impede que segredos sejam copiados para a imagem (Dockerfile usa COPY . . e não havia .dockerignore). - .gitignore reforçado (**/.env, .secrets, *.dump, backups de env). - backend/.env.example documenta as variáveis sem valores. - JWT_SECRET rotacionado em dev e prod (fora do git). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -12,11 +12,21 @@ backend/test-db-users.js
|
|||||||
backend/test-db-users.cjs
|
backend/test-db-users.cjs
|
||||||
backend/pg-convert.js
|
backend/pg-convert.js
|
||||||
|
|
||||||
# Override local de ambiente DEV (aponta o banco p/ pgdev) — NÃO versionar
|
# Segredos de ambiente — NÃO versionar (qualquer nível)
|
||||||
.env
|
.env
|
||||||
|
**/.env
|
||||||
|
backend/.env
|
||||||
|
.secrets
|
||||||
|
**/.secrets
|
||||||
|
*.dump
|
||||||
|
backend/server.js.bak
|
||||||
|
|
||||||
# Dependências e caches locais
|
# Dependências e caches locais
|
||||||
node_modules/
|
node_modules/
|
||||||
frontend/node_modules/
|
frontend/node_modules/
|
||||||
backend/node_modules/
|
backend/node_modules/
|
||||||
.claude/
|
.claude/
|
||||||
|
|
||||||
|
# backups de env (segredos) — nunca versionar
|
||||||
|
*.env.bak*
|
||||||
|
backend/.env.bak*
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# Segredos e ambiente — NUNCA entram na imagem
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
*.secret
|
||||||
|
.secrets
|
||||||
|
|
||||||
|
# Dependências e caches (reinstalados no build)
|
||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
|
||||||
|
# Artefatos locais / backups / dados que não pertencem à imagem
|
||||||
|
*.bak
|
||||||
|
server.js.bak
|
||||||
|
sessions/
|
||||||
|
media/
|
||||||
|
data/
|
||||||
|
bkp/
|
||||||
|
*.dump
|
||||||
|
|
||||||
|
# Diagnóstico temporário
|
||||||
|
test-db-users.js
|
||||||
|
test-db-users.cjs
|
||||||
|
pg-convert.js
|
||||||
|
|
||||||
|
# Diversos
|
||||||
|
.git
|
||||||
|
.DS_Store
|
||||||
|
*.log
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
# ─────────────────────────────────────────────
|
|
||||||
# Server
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
PORT=8018
|
|
||||||
NODE_ENV=development
|
|
||||||
JWT_SECRET=scoreodonto_jwt_secret_forte_2026
|
|
||||||
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
# PostgreSQL (Prisma)
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
DATABASE_URL="postgresql://scoreodonto_user:clube67_scoreodonto_pass_9903@10.99.0.3:5432/scoreodonto?schema=public"
|
|
||||||
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
# DragonflyDB (compatível com Redis)
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
DRAGONFLY_URL=redis://:clube67_dragonfly_pass_9903@10.99.0.3:6379/1
|
|
||||||
DRAGONFLY_TTL_SECONDS=86400
|
|
||||||
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
# NATS JetStream
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
NATS_URL=nats://10.99.0.3:4222
|
|
||||||
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
# Temporal.io
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
TEMPORAL_ADDRESS=10.99.0.3:7233
|
|
||||||
TEMPORAL_NAMESPACE=default
|
|
||||||
TEMPORAL_TASK_QUEUE=scoreodonto-queue
|
|
||||||
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
# IA (OpenAI + Google Gemini)
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
OPENAI_API_KEY=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
|
|
||||||
GEMINI_API_KEY=AIza...
|
|
||||||
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
# WhatsApp / Baileys
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
BAILEYS_SESSIONS_PATH=/home/deploy/scoreodonto-sessions
|
|
||||||
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
# Frontend (CORS)
|
|
||||||
# ─────────────────────────────────────────────
|
|
||||||
FRONTEND_URL=http://localhost:3013
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Modelo de variáveis de ambiente do backend (SEM segredos).
|
||||||
|
# Copie para .env e preencha com valores REAIS. O .env NÃO é versionado.
|
||||||
|
PORT=8018
|
||||||
|
NODE_ENV=production
|
||||||
|
|
||||||
|
# Segredo de assinatura dos tokens JWT — gerar com: openssl rand -hex 48
|
||||||
|
JWT_SECRET=
|
||||||
|
|
||||||
|
# Banco e cache (não versionar valores reais)
|
||||||
|
DATABASE_URL=postgresql://USER:SENHA@HOST:5432/BANCO?schema=public
|
||||||
|
DRAGONFLY_URL=redis://:SENHA@HOST:6379/1
|
||||||
|
DRAGONFLY_TTL_SECONDS=3600
|
||||||
|
|
||||||
|
# Mensageria / workflows
|
||||||
|
NATS_URL=nats://HOST:4222
|
||||||
|
TEMPORAL_ADDRESS=HOST:7233
|
||||||
|
TEMPORAL_NAMESPACE=default
|
||||||
|
TEMPORAL_TASK_QUEUE=scoreodonto
|
||||||
|
|
||||||
|
# Chaves de IA (rotacionáveis apenas nos painéis dos provedores)
|
||||||
|
OPENAI_API_KEY=
|
||||||
|
GEMINI_API_KEY=
|
||||||
|
|
||||||
|
# Caminhos / front
|
||||||
|
BAILEYS_SESSIONS_PATH=/app/sessions
|
||||||
|
FRONTEND_URL=https://scoreodonto.com
|
||||||
Reference in New Issue
Block a user