gohorsejobs/seeder-api
Tiago Yamamoto 89358acc13 refactor(auth): remove hash hardcoded da migration, seeder gera em runtime
Antes: 010_seed_super_admin.sql tinha hash bcrypt fixo amarrado a um pepper
específico. Qualquer mudança no PASSWORD_PEPPER quebrava todos os logins
silenciosamente após reset do banco.

Agora:
- migration 010: insere superadmin com placeholder inválido + force_change_password.
  ON CONFLICT DO NOTHING preserva o hash se o seeder já rodou.
- seeder users.js: faz upsert de 'lol' com bcrypt(senha + env.PASSWORD_PEPPER)
  em runtime. Mudar o pepper e re-rodar o seeder é suficiente para atualizar
  as credenciais sem tocar em nenhuma migration.
- docs/AGENTS.md: atualiza gotcha #1 explicando o novo fluxo migrate → seed
- docs/DEVOPS.md: fix opção 1 do troubleshooting inclui re-deploy do seeder

Fluxo correto após reset do banco (coberto pelo start.sh opções 2, 6, 8):
  npm run migrate  →  superadmin criado, hash = placeholder
  npm run seed     →  hash recalculado com PEPPER do ambiente, status = active

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 12:05:54 -06:00
..
sql data(seeder): add location SQL data files 2025-12-24 16:23:33 -03:00
src refactor(auth): remove hash hardcoded da migration, seeder gera em runtime 2026-02-22 12:05:54 -06:00
.dockerignore
.env.example chore: add login verification scripts and update deps 2025-12-24 14:22:56 -03:00
.gitignore feat: expand testing, add fast seeder options, hardcode superadmin 2025-12-24 17:07:45 -03:00
Dockerfile fix: corrige URLs do frontend para HTTPS e SSL do seeder 2026-02-17 10:14:57 -06:00
go.mod Convert seeder API to Go server 2026-01-02 10:29:00 -03:00
go.sum Convert seeder API to Go server 2026-01-02 10:29:00 -03:00
main.go fix(seeder): update root response with actual endpoints (no /docs) 2026-01-02 20:23:34 -03:00
package-lock.json fix: resolve build errors for Coolify deployment 2026-02-16 08:42:29 -06:00
package.json fix: resolve build errors for Coolify deployment 2026-02-16 08:42:29 -06:00
README.md docs: add AI context rules and missing READMEs 2026-02-21 13:33:36 -06:00
SEEDER-API.md docs: unify test users in root README and update superadmin to lol login 2026-02-21 14:48:25 -06:00

Seeder API - GoHorse Jobs

This directory contains utility APIs specifically designed for seeding, automating data input, or populating the database.

🚨 AI Rules Warning 🚨

Before making ANY changes to infrastructure deployment manifests or Kubernetes files, please refer to the project-wide AI Rules located at .agent/rules.md. Do NOT touch k3s or k8s files. Do not alter raw RSA/base64 authentication keys.