Initial commit - SOGOMS v1.0.0
- sogoctl: supervisor avec health checks et restart auto - sogoway: gateway HTTP, auth JWT, routing par hostname - sogoms-db: microservice MariaDB avec pool par application - Protocol IPC Unix socket JSON length-prefixed - Config YAML multi-application (prokov) - Deploy script pour container Alpine gw3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
92
TODO.md
Executable file
92
TODO.md
Executable file
@@ -0,0 +1,92 @@
|
||||
# TODO - SOGOMS V1 Minimale
|
||||
|
||||
Objectif : valider l'architecture avec 2-3 microservices basiques.
|
||||
|
||||
## Phase 0 : Infrastructure
|
||||
|
||||
- [x] **Container gw3** : Alpine sur IN3 (13.23.33.5)
|
||||
- [x] **Config Prokov** : routes + scénarios YAML (auth, projects, tasks, tags, statuses)
|
||||
- [x] **Nginx host IN3** : routing /api/ → gw3:8080, / → dva-front
|
||||
|
||||
## Phase 1 : Protocole IPC
|
||||
|
||||
- [x] `internal/protocol/message.go` : structs Request/Response JSON
|
||||
- [x] `internal/protocol/server.go` : listener Unix socket
|
||||
- [x] `internal/protocol/client.go` : client pour appeler les services
|
||||
|
||||
## Phase 2 : Microservice DB
|
||||
|
||||
- [x] `cmd/sogoms/db/main.go` : point d'entrée
|
||||
- [x] Connexion MariaDB (pool par application)
|
||||
- [x] Action `query` : SELECT multi-résultats
|
||||
- [x] Action `query_one` : SELECT un résultat
|
||||
- [x] Action `insert` : INSERT retourne insert_id
|
||||
- [x] Action `update` : UPDATE retourne affected_rows
|
||||
- [x] Action `delete` : DELETE retourne affected_rows
|
||||
- [x] Écoute sur `/run/sogoms-db.1.sock`
|
||||
- [x] Test standalone sogoms-db
|
||||
|
||||
## Phase 3 : Config
|
||||
|
||||
- [x] `internal/config/config.go` : lecture YAML + registry par host
|
||||
- [x] `internal/config/routes.go` : parser routes (intégré dans config.go)
|
||||
|
||||
## Phase 4 : Gateway HTTP
|
||||
|
||||
- [x] `cmd/sogoway/main.go` : serveur HTTP :8080
|
||||
- [x] Routing par host → charge le bon fichier routes (prokov.yaml)
|
||||
- [x] `internal/auth/jwt.go` : génération + validation JWT (HS256)
|
||||
- [x] `internal/auth/password.go` : hash + verify password (bcrypt)
|
||||
- [x] Endpoint `POST /api/auth/login` : vérifie credentials, retourne JWT
|
||||
- [x] Endpoint `GET /api/auth/me` : valide JWT, retourne user
|
||||
- [x] Endpoint `POST /api/auth/register` : crée user, retourne JWT
|
||||
- [x] Communication avec sogoms-db via Unix socket
|
||||
- [x] Test standalone sogoway
|
||||
|
||||
## Phase 5 : Superviseur
|
||||
|
||||
- [x] `cmd/sogoctl/main.go` : point d'entrée
|
||||
- [x] Config `config/sogoctl.yaml` : services à lancer
|
||||
- [x] Lancement sogoms-db + sogoway (avec dépendances)
|
||||
- [x] Health check (socket + HTTP)
|
||||
- [x] Redémarrage automatique si crash
|
||||
|
||||
## Phase 6 : Test de validation
|
||||
|
||||
```bash
|
||||
# 1. Lancer sogoctl (démarre les services)
|
||||
./sogoctl
|
||||
|
||||
# 2. Login
|
||||
curl -X POST https://prokov.unikoffice.com/api/auth/login \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"email":"test@example.com","password":"secret"}'
|
||||
# → {"success":true,"data":{"token":"eyJ...","user":{...}}}
|
||||
|
||||
# 3. Vérifier le token
|
||||
curl https://prokov.unikoffice.com/api/auth/me \
|
||||
-H "Authorization: Bearer eyJ..."
|
||||
# → {"success":true,"data":{"user":{...}}}
|
||||
```
|
||||
|
||||
- [x] Test login OK
|
||||
- [x] Test /me avec token valide OK
|
||||
- [x] Test /me sans token → 401
|
||||
|
||||
## Phase 7 : Microservice Logs
|
||||
|
||||
- [ ] `cmd/sogoms/logs/main.go` : point d'entrée
|
||||
- [ ] Écoute sur Unix socket `/run/sogoms-logs.1.sock`
|
||||
- [ ] Actions `log_error`, `log_event` : écriture dans fichiers
|
||||
- [ ] Format fichiers : `/var/log/sogoms/{app}-{YYYYMMDD}-{type}.log`
|
||||
- [ ] Rotation automatique : suppression des fichiers > N jours (défaut 15)
|
||||
- [ ] Paramètre `retention_days` dans config
|
||||
- [ ] Intégration avec sogoway et sogoms-db
|
||||
|
||||
## Hors scope V1
|
||||
|
||||
- sogorch (orchestrateur scénarios)
|
||||
- sogoms-pdf, sogoms-email, sogoms-storage
|
||||
- Multi-tenant
|
||||
- Rate limiting
|
||||
- Exécution dynamique des scénarios YAML
|
||||
Reference in New Issue
Block a user