Some checks failed
Build and Deploy GooSeek / build-and-deploy (push) Failing after 8m22s
- Create pkg/email package (sender, templates, types) - SMTP client with TLS, rate limiting, async sending - HTML email templates with GooSeek branding - Integrate welcome + password reset emails in auth-svc - Add limit warning emails (80%/100%) in llm-svc middleware - Add space invite endpoint with email notification in thread-svc - Add GetUserEmail helper in JWT middleware - Add SMTP config to .env, config.go, K8s configmap Made-with: Cursor
54 lines
1.9 KiB
Markdown
54 lines
1.9 KiB
Markdown
# Email Notification Service
|
||
|
||
## Статус: Готово
|
||
|
||
## Что реализовано
|
||
|
||
### Пакет `backend/pkg/email/`
|
||
- `types.go` — типы уведомлений (Welcome, PasswordReset, LimitWarning, SpaceInvite, SystemAlert)
|
||
- `sender.go` — SMTP клиент с TLS, rate limiting (1 письмо/тип/24ч), async отправка
|
||
- `templates.go` — HTML шаблоны с брендингом GooSeek
|
||
|
||
### Интеграции
|
||
|
||
| Сервис | Уведомления | Файл |
|
||
|--------|-------------|------|
|
||
| auth-svc | Welcome, Password Reset | `backend/cmd/auth-svc/main.go` |
|
||
| llm-svc | Limit Warning (80%), Limit Exceeded (100%) | `backend/pkg/middleware/llm_limits.go` |
|
||
| thread-svc | Space Invite | `backend/cmd/thread-svc/main.go` |
|
||
|
||
### Новые API endpoints
|
||
- `POST /api/v1/spaces/:id/invite` — приглашение в Space по email
|
||
- `GET /api/v1/spaces/:id/invites` — список приглашений
|
||
|
||
### Конфигурация
|
||
```env
|
||
SMTP_HOST=smtp.example.com
|
||
SMTP_PORT=587
|
||
SMTP_USER=noreply@gooseek.ru
|
||
SMTP_PASSWORD=
|
||
SMTP_FROM=GooSeek <noreply@gooseek.ru>
|
||
SMTP_TLS=true
|
||
SITE_URL=https://gooseek.ru
|
||
SITE_NAME=GooSeek
|
||
```
|
||
|
||
## Файлы изменены
|
||
- `backend/pkg/email/types.go` — новый
|
||
- `backend/pkg/email/sender.go` — новый
|
||
- `backend/pkg/email/templates.go` — новый
|
||
- `backend/pkg/config/config.go` — SMTP конфиг
|
||
- `backend/pkg/middleware/jwt.go` — GetUserEmail()
|
||
- `backend/pkg/middleware/llm_limits.go` — email при лимитах
|
||
- `backend/internal/usage/repository.go` — GetUserEmail()
|
||
- `backend/cmd/auth-svc/main.go` — welcome + reset emails
|
||
- `backend/cmd/llm-svc/main.go` — emailSender в LLMLimits
|
||
- `backend/cmd/thread-svc/main.go` — invite endpoint + email
|
||
- `backend/deploy/k8s/configmap.yaml` — SMTP переменные
|
||
- `.env` — SMTP переменные
|
||
|
||
## Сервер
|
||
- IP: 5.187.77.89
|
||
- GPU: RTX 4060 Ti 16GB
|
||
- Site: https://gooseek.ru
|