Files
archivmail/CLAUDE.md
T
sysopsandClaude Sonnet 5 25865423f9 docs: Agent-Definitionen bereinigt (192.168.1.131 raus) + Dual-Source-Falle dokumentiert
192.168.1.131 gehört seit 2026-09-01 nicht mehr zum archivmail-Projekt (User-Bestätigung).
Alle Referenzen in CLAUDE.md und Agent-Defs auf den verbleibenden Server 192.168.1.132
korrigiert (Test/Prod-Paar existiert nicht mehr).

Zusätzlich Erkenntnisse aus PROJ-86-Audit (Subagenten db-migrator + mailarchiv-architect)
in die Agent-Defs eingearbeitet: emails.tenant_id vs. email_refs Dual-Source-Falle,
MailDocument-Fan-out-Drift-Muster, emails_global-Mirror-Pflicht, --tenant-Reindex-Lücke.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPFC6Jk2ke1Pq9XcuVGP1R
2026-09-01 13:56:41 +02:00

84 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# archivmail
Selbst gehostetes Mail-Archiv-System. Go-Backend + Next.js-Frontend + PostgreSQL + Manticore Search.
## Tech Stack
- **Backend:** Go 1.24, CGO_ENABLED=0, Manticore Search (Volltext-Index)
- **Frontend:** Next.js 16 (App Router), TypeScript, Tailwind CSS, shadcn/ui
- **Datenbank:** PostgreSQL (pgx/v5)
- **Volltext-Index:** Manticore Search (MySQL-Protokoll, Port 9306)
- **Deployment:** On-Premise, Systemd — einziger Server: 192.168.1.132 (teilproduktiv, seit 2026-09-01 kein separater Testserver mehr)
- **Auth:** JWT (httpOnly Cookie), bcrypt Cost 12
## Projektstruktur
```
cmd/archivmail/ CLI-Einstiegspunkt + Subkommandos
config/ YAML-Konfiguration
internal/
api/ HTTP-API + Handler
audit/ Audit-Log (PostgreSQL + Flat-File)
auth/ JWT-Authentifizierung
imap/ IMAP-Import, Scheduler, Store
index/ Manticore Search (CGO-frei), Async Worker
smtpd/ Eingebetteter SMTP-Daemon
storage/ AES-256-GCM Dateispeicher + PostgreSQL-Metadaten
userstore/ Benutzerverwaltung
pkg/mailparser/ RFC-2822 Parser, MBOX-Splitter
src/
app/ Next.js Seiten (/, /search, /mail/[id], /admin, /imap)
components/ UI-Komponenten (shadcn/ui)
hooks/ useAuth
lib/ api.ts, auth-cache.ts
```
## Build & Deploy
```bash
# Backend (kein CGO erforderlich)
CGO_ENABLED=0 go build -buildvcs=false -o archivmail ./cmd/archivmail/
# Frontend
npm run build # .next/standalone/ für Produktion
# Auf Server deployen
bash update.sh # oder: curl ... | bash
```
## Konventionen
- **Commits:** `feat(PROJ-X): ...`, `fix(PROJ-X): ...`, `chore: ...`
- **Feature-IDs:** PROJ-1, PROJ-2, … (nächste freie: siehe `features/INDEX.md`)
- **shadcn/ui:** Keine Custom-Versionen installierter Komponenten
- **Kein Supabase, kein Vercel** reines On-Premise-Deployment
- **Versionierung (`package.json`):** SemVer, Minor-Version = Anzahl aktiver Features in `features/INDEX.md` (Deployed + In Review + In Progress + Planned, ohne Removed) geteilt durch 10, abgerundet. Bei jedem neuen Feature-Ticket Minor prüfen/anheben; Patch für Bugfix-Reihen ohne neues Feature, Major bleibt 1 bis zu einer grundlegenden Neuarchitektur (z.B. archivmail 2.0).
## Wichtige Konfiguration (Server)
```
/etc/archivmail/config.yml Hauptkonfiguration
/etc/archivmail/keyfile AES-256 Schlüssel (32 Bytes, nie committen)
/var/archivmail/store/ Verschlüsselter E-Mail-Speicher
/var/lib/manticore/ Manticore RT-Indizes (emails_global, emails_tenant_N)
```
## Dienste (Systemd)
```bash
systemctl status archivmail # Go-Backend (Port 8080 + 2525)
systemctl status archivmail-web # Next.js-Frontend (Port 3000)
systemctl status manticore # Manticore Search (Port 9306, localhost)
journalctl -u archivmail -f
```
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
<!-- END:nextjs-agent-rules -->