SOGOMS v1.0.1 - Microservices logs, smtp et roadmap

Nouveaux services:
- sogoms-logs : logging centralisé avec rotation
- sogoms-smtp : envoi emails avec templates YAML

Nouvelles fonctionnalités:
- Queries YAML externalisées (config/queries/{app}/)
- CRUD générique paramétrable
- Filtres par rôle (default, admin)
- Templates email (config/emails/{app}/)

Documentation:
- DOCTECH.md : documentation technique complète
- README.md : vision et roadmap
- TODO.md : phases 11-15 planifiées

Roadmap:
- Phase 11: sogoms-crypt (chiffrement)
- Phase 12: sogoms-imap/mailproc (emails)
- Phase 13: sogoms-cron (tâches planifiées)
- Phase 14: sogoms-push (MQTT temps réel)
- Phase 15: sogoms-schema (API auto-générée)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-16 14:58:46 +01:00
parent 7e27f87d6f
commit a4694a10d1
36 changed files with 2786 additions and 2387 deletions

View File

@@ -0,0 +1,41 @@
# Template: Réinitialisation de mot de passe
subject: "Réinitialisation de votre mot de passe Prokov"
body: |
Bonjour {{.Name}},
Vous avez demandé la réinitialisation de votre mot de passe.
Cliquez sur le lien ci-dessous pour créer un nouveau mot de passe :
{{.ResetURL}}
Ce lien expire dans {{.ExpiresIn}}.
Si vous n'êtes pas à l'origine de cette demande, ignorez cet email.
Cordialement,
L'équipe Prokov
body_html: |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
<h1 style="color: #2563eb;">Réinitialisation de mot de passe</h1>
<p>Bonjour <strong>{{.Name}}</strong>,</p>
<p>Vous avez demandé la réinitialisation de votre mot de passe.</p>
<p style="text-align: center; margin: 30px 0;">
<a href="{{.ResetURL}}" style="background-color: #2563eb; color: white; padding: 12px 24px; text-decoration: none; border-radius: 6px; display: inline-block;">
Réinitialiser mon mot de passe
</a>
</p>
<p style="color: #666; font-size: 14px;">Ce lien expire dans {{.ExpiresIn}}.</p>
<p style="color: #666; font-size: 14px;">Si vous n'êtes pas à l'origine de cette demande, ignorez cet email.</p>
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
<p style="color: #666; font-size: 14px;">Cordialement,<br>L'équipe Prokov</p>
</div>
</body>
</html>

View File

@@ -0,0 +1,45 @@
# Template: Notification d'assignation de tâche
subject: "Nouvelle tâche : {{.TaskName}}"
body: |
Bonjour {{.Name}},
Une nouvelle tâche vous a été assignée :
Projet : {{.ProjectName}}
Tâche : {{.TaskName}}
{{if .Description}}Description : {{.Description}}{{end}}
{{if .DueDate}}Échéance : {{.DueDate}}{{end}}
Connectez-vous pour voir les détails.
Cordialement,
L'équipe Prokov
body_html: |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
<h1 style="color: #2563eb;">Nouvelle tâche assignée</h1>
<p>Bonjour <strong>{{.Name}}</strong>,</p>
<p>Une nouvelle tâche vous a été assignée :</p>
<div style="background-color: #f8fafc; border-left: 4px solid #2563eb; padding: 15px; margin: 20px 0;">
<p style="margin: 5px 0;"><strong>Projet :</strong> {{.ProjectName}}</p>
<p style="margin: 5px 0;"><strong>Tâche :</strong> {{.TaskName}}</p>
{{if .Description}}<p style="margin: 5px 0;"><strong>Description :</strong> {{.Description}}</p>{{end}}
{{if .DueDate}}<p style="margin: 5px 0;"><strong>Échéance :</strong> {{.DueDate}}</p>{{end}}
</div>
<p style="text-align: center; margin: 30px 0;">
<a href="{{.TaskURL}}" style="background-color: #2563eb; color: white; padding: 12px 24px; text-decoration: none; border-radius: 6px; display: inline-block;">
Voir la tâche
</a>
</p>
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
<p style="color: #666; font-size: 14px;">Cordialement,<br>L'équipe Prokov</p>
</div>
</body>
</html>

View File

@@ -0,0 +1,67 @@
# Template: Récapitulatif des tâches du jour
subject: "Vos tâches du jour - {{.Date}}"
body: |
Bonjour {{.Name}},
Voici vos tâches prévues pour aujourd'hui ({{.Date}}) :
{{range .Tasks}}
- [{{.Status}}] {{.Name}}{{if .Project}} ({{.Project}}){{end}}{{if .DueTime}} - {{.DueTime}}{{end}}
{{end}}
{{if .TaskCount}}Vous avez {{.TaskCount}} tâche(s) à accomplir.{{end}}
Bonne journée !
Cordialement,
L'équipe Prokov
body_html: |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
<h1 style="color: #2563eb;">Vos tâches du jour</h1>
<p>Bonjour <strong>{{.Name}}</strong>,</p>
<p>Voici vos tâches prévues pour aujourd'hui ({{.Date}}) :</p>
<table style="width: 100%; border-collapse: collapse; margin: 20px 0;">
<thead>
<tr style="background-color: #f8fafc;">
<th style="padding: 12px; text-align: left; border-bottom: 2px solid #e2e8f0;">Tâche</th>
<th style="padding: 12px; text-align: left; border-bottom: 2px solid #e2e8f0;">Projet</th>
<th style="padding: 12px; text-align: left; border-bottom: 2px solid #e2e8f0;">Statut</th>
<th style="padding: 12px; text-align: left; border-bottom: 2px solid #e2e8f0;">Heure</th>
</tr>
</thead>
<tbody>
{{range .Tasks}}
<tr>
<td style="padding: 12px; border-bottom: 1px solid #e2e8f0;">{{.Name}}</td>
<td style="padding: 12px; border-bottom: 1px solid #e2e8f0;">{{.Project}}</td>
<td style="padding: 12px; border-bottom: 1px solid #e2e8f0;">
<span style="background-color: {{.StatusColor}}; color: white; padding: 4px 8px; border-radius: 4px; font-size: 12px;">{{.Status}}</span>
</td>
<td style="padding: 12px; border-bottom: 1px solid #e2e8f0;">{{.DueTime}}</td>
</tr>
{{end}}
</tbody>
</table>
{{if .TaskCount}}
<p style="background-color: #eff6ff; padding: 15px; border-radius: 6px; text-align: center;">
<strong>{{.TaskCount}}</strong> tâche(s) à accomplir aujourd'hui
</p>
{{end}}
<p>Bonne journée !</p>
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
<p style="color: #666; font-size: 14px;">Cordialement,<br>L'équipe Prokov</p>
</div>
</body>
</html>

View File

@@ -0,0 +1,34 @@
# Template: Email de bienvenue
subject: "Bienvenue sur Prokov, {{.Name}} !"
body: |
Bonjour {{.Name}},
Bienvenue sur Prokov !
Votre compte a été créé avec succès.
Email: {{.Email}}
Vous pouvez maintenant vous connecter et commencer à gérer vos projets.
Cordialement,
L'équipe Prokov
body_html: |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
<h1 style="color: #2563eb;">Bienvenue sur Prokov !</h1>
<p>Bonjour <strong>{{.Name}}</strong>,</p>
<p>Votre compte a été créé avec succès.</p>
<p><strong>Email :</strong> {{.Email}}</p>
<p>Vous pouvez maintenant vous connecter et commencer à gérer vos projets.</p>
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
<p style="color: #666; font-size: 14px;">Cordialement,<br>L'équipe Prokov</p>
</div>
</body>
</html>

View File

@@ -0,0 +1,25 @@
# Requêtes d'authentification
# Données chargées après login réussi
login_data:
projects: >
SELECT id, parent_id, name, description, position, created_at, updated_at
FROM projects WHERE user_id = ? ORDER BY position
tasks: >
SELECT id, project_id, status_id, title, description, priority,
date_start, date_end, time_estimated, time_spent, billing, position,
created_at, updated_at
FROM tasks WHERE user_id = ? ORDER BY position
tags: >
SELECT id, name, color, created_at
FROM tags WHERE user_id = ?
statuses: >
SELECT id, project_id, code, name, color, position, created_at
FROM statuses WHERE user_id = ? ORDER BY code
# Requêtes unitaires
user_by_email: >
SELECT id, email, name, password FROM users WHERE email = ?
user_by_id: >
SELECT id, email, name, created_at FROM users WHERE id = ?

View File

@@ -0,0 +1,44 @@
# Requêtes CRUD projects
list:
query: >
SELECT id, parent_id, name, description, position, created_at, updated_at
FROM projects
filters:
default: "user_id = :user_id"
admin: ""
order: "position ASC"
show:
query: >
SELECT id, parent_id, name, description, position, created_at, updated_at
FROM projects WHERE id = :id
filters:
default: "user_id = :user_id"
admin: ""
create:
table: projects
fields:
- user_id
- parent_id
- name
- description
- position
update:
table: projects
fields:
- parent_id
- name
- description
- position
filters:
default: "user_id = :user_id"
admin: ""
delete:
table: projects
filters:
default: "user_id = :user_id"
admin: ""

View File

@@ -0,0 +1,55 @@
# Requêtes CRUD statuses
list:
query: >
SELECT id, project_id, code, name, color, position, created_at
FROM statuses
filters:
default: "user_id = :user_id"
admin: ""
order: "code ASC"
list_by_project:
query: >
SELECT id, project_id, code, name, color, position, created_at
FROM statuses WHERE (project_id = :project_id OR project_id IS NULL)
filters:
default: "user_id = :user_id"
admin: ""
order: "code ASC"
show:
query: >
SELECT id, project_id, code, name, color, position, created_at
FROM statuses WHERE id = :id
filters:
default: "user_id = :user_id"
admin: ""
create:
table: statuses
fields:
- user_id
- project_id
- code
- name
- color
- position
update:
table: statuses
fields:
- project_id
- code
- name
- color
- position
filters:
default: "user_id = :user_id"
admin: ""
delete:
table: statuses
filters:
default: "user_id = :user_id"
admin: ""

View File

@@ -0,0 +1,39 @@
# Requêtes CRUD tags
list:
query: >
SELECT id, name, color, created_at
FROM tags
filters:
default: "user_id = :user_id"
admin: ""
show:
query: >
SELECT id, name, color, created_at
FROM tags WHERE id = :id
filters:
default: "user_id = :user_id"
admin: ""
create:
table: tags
fields:
- user_id
- name
- color
update:
table: tags
fields:
- name
- color
filters:
default: "user_id = :user_id"
admin: ""
delete:
table: tags
filters:
default: "user_id = :user_id"
admin: ""

View File

@@ -0,0 +1,73 @@
# Requêtes CRUD tasks
list:
query: >
SELECT id, project_id, status_id, title, description, priority,
date_start, date_end, time_estimated, time_spent, billing, position,
created_at, updated_at
FROM tasks
filters:
default: "user_id = :user_id"
admin: ""
order: "position ASC"
list_by_project:
query: >
SELECT id, project_id, status_id, title, description, priority,
date_start, date_end, time_estimated, time_spent, billing, position,
created_at, updated_at
FROM tasks WHERE project_id = :project_id
filters:
default: "user_id = :user_id"
admin: ""
order: "position ASC"
show:
query: >
SELECT id, project_id, status_id, title, description, priority,
date_start, date_end, time_estimated, time_spent, billing, position,
created_at, updated_at
FROM tasks WHERE id = :id
filters:
default: "user_id = :user_id"
admin: ""
create:
table: tasks
fields:
- user_id
- project_id
- status_id
- title
- description
- priority
- date_start
- date_end
- time_estimated
- time_spent
- billing
- position
update:
table: tasks
fields:
- project_id
- status_id
- title
- description
- priority
- date_start
- date_end
- time_estimated
- time_spent
- billing
- position
filters:
default: "user_id = :user_id"
admin: ""
delete:
table: tasks
filters:
default: "user_id = :user_id"
admin: ""

View File

@@ -23,6 +23,20 @@ auth:
jwt_secret_file: /secrets/prokov_jwt_secret
jwt_expiry: 24h
# Logs
logs:
retention_days: 30
# SMTP
smtp:
host: barbotte.o2switch.net
port: 465
user: prokov@unikoffice.com
password_file: /secrets/prokov_smtp_pass
from: prokov@unikoffice.com
from_name: Prokov
tls: true # false = STARTTLS (587), true = TLS direct (465)
# Routes
routes:
# === AUTH ===

View File

@@ -13,7 +13,35 @@ services:
- "/config"
- "-socket"
- "/run/sogoms-db.1.sock"
- "-logs-socket"
- "/run/sogoms-logs.1.sock"
health_socket: /run/sogoms-db.1.sock
depends_on:
- sogoms-logs
sogoms-logs:
binary: /opt/sogoms/bin/sogoms-logs
args:
- "-config"
- "/config"
- "-socket"
- "/run/sogoms-logs.1.sock"
- "-logdir"
- "/var/log/sogoms"
health_socket: /run/sogoms-logs.1.sock
sogoms-smtp:
binary: /opt/sogoms/bin/sogoms-smtp
args:
- "-config"
- "/config"
- "-socket"
- "/run/sogoms-smtp.1.sock"
- "-logs-socket"
- "/run/sogoms-logs.1.sock"
health_socket: /run/sogoms-smtp.1.sock
depends_on:
- sogoms-logs
sogoway:
binary: /opt/sogoms/bin/sogoway
@@ -24,6 +52,9 @@ services:
- "8080"
- "-db-socket"
- "/run/sogoms-db.1.sock"
- "-logs-socket"
- "/run/sogoms-logs.1.sock"
health_url: http://localhost:8080/health
depends_on:
- sogoms-db
- sogoms-logs