Commit Graph

93 Commits

Author SHA1 Message Date
sysops e46b68b63f feat(PROJ-20): GoBD-konforme Nutzer-Löschung mit IMAP-Cleanup und Warn-Dialog
- imap/store.go: DeleteByOwner() – löscht alle IMAP-Konten eines Nutzers
- api/server.go: handleDeleteUser lädt Nutzername vor Löschung, ruft DeleteByOwner, schreibt erweitertes Audit-Log (username, role, IMAP-Count, GoBD-Hinweis)
- admin/page.tsx: confirm() ersetzt durch Dialog mit GoBD-Hinweis, Deaktivieren-Option (empfohlen) und endgültigem Löschen (destruktiv)
- features/PROJ-20-nutzer-loeschung.md: Feature-Spec angelegt
- features/INDEX.md: PROJ-20 eingetragen, Next ID → PROJ-21

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 13:44:32 +01:00
sysops 2900e53753 chore: update.sh aktualisiert sich beim Start selbst aus Gitea
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 12:43:15 +01:00
sysops dc71d78d7d chore: migrate-Block aus update.sh entfernt
archivmail kennt keinen migrate-Subcommand – der Block hat immer nur warn ausgegeben und nichts getan.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 12:41:05 +01:00
sysops f00ebbe733 fix: Xapian-Lockfile nach systemctl stop entfernen
Verhindert DatabaseLockError beim Neustart wenn flintlock durch harten Abbruch liegen bleibt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 12:38:42 +01:00
sysops f2dbf18e5a fix: safe.directory für _build vor git fetch setzen
Verhindert "dubious ownership"-Fehler wenn _build unter anderem Nutzer angelegt wurde.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 11:24:59 +01:00
sysops 2dbfd3ddf6 chore: allowed_ips Kommentare in config.test.yml ergänzt
Erklärt Zweck, Syntax (IP + CIDR), Leer=allow-all und Neustart-Pflicht.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 11:13:41 +01:00
sysops b95c49daa5 feat(PROJ-2): EML/MBOX-Upload für alle Benutzer zugänglich
- Backend: neue Routen POST /api/upload + GET /api/upload/{jobID}/progress (nur Auth, kein Admin)
- api.ts: uploadMailFilesUser + getUploadProgressUser für /api/upload
- search/page.tsx: Importieren-Button + Upload-Dialog mit Drag-and-Drop, Fortschrittsanzeige und automatischer Suchlisten-Aktualisierung nach Import

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 10:12:09 +01:00
sysops 1e677659b9 chore: replace AI Coding Starter Kit references with archivmail project info
- CLAUDE.md: vollständig auf archivmail-Kontext umgeschrieben (Go/Xapian Stack, On-Premise Deploy, keine Supabase/Vercel)
- package.json: name und description auf archivmail aktualisiert

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 09:58:41 +01:00
sysops 861df83986 chore: .gitignore und features/ aus Git-Tracking entfernen (nur lokal)
Ignore-Regeln liegen jetzt in .git/info/exclude und werden
nie nach Gitea übertragen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 09:53:47 +01:00
sysops ce10864e62 chore: .claude/ Verzeichnis komplett in .gitignore aufnehmen
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 09:44:05 +01:00
sysops 7c29ee88bd docs: vollständige README, PROJ-2 Web-Upload, PROJ-19 Mailpiler-Migration
README.md:
- Vollständige Dokumentation aller implementierten Funktionen
- Konfigurationsreferenz, Installation, Systemd, REST-API-Übersicht
- In-Progress-Features klar gekennzeichnet

PROJ-2 (EML/MBOX Web-Upload):
- POST /api/admin/upload – Multipart-Upload mit Hintergrund-Job
- GET /api/admin/upload/{jobID}/progress – Polling
- Admin-Tab "Import" mit Drag-and-Drop, Fortschrittsbalken, Abschlussbericht

PROJ-19 (Mailpiler Migration):
- archivmail import-piler mit Methoden: pilerexport | direct | auto
- Direct: AES-256-CBC + zlib mit defensiven Fallbacks
- pilerexport: Wrapper um mailpilers Export-Tool

Status-Updates: PROJ-3, PROJ-4, PROJ-6, PROJ-7, PROJ-10, PROJ-11 → Deployed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 09:23:34 +01:00
sysops 31de5ec99c fix(deploy): Binary auch nach /opt/archivmail/archivmail kopieren (Service-Pfad)
Der systemd-Service nutzt /opt/archivmail/archivmail direkt.
Das neue Binary wurde nur nach /opt/archivmail/bin/ deployed,
wodurch der Service das alte Binary weiter verwendete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 02:26:32 +01:00
sysops 988c37d85d feat(PROJ-8): Automatischer IMAP-Sync (Cron-Scheduler)
Backend:
- internal/imap/store.go: 7 neue Felder (sync_interval_min, last_sync_at,
  last_sync_count, last_uid, sync_running, sync_status, sync_error_msg)
  DB-Migration via ALTER TABLE ADD COLUMN IF NOT EXISTS
  Neue Methoden: ListAll, UpdateSyncInterval, SetSyncRunning, UpdateSyncResult
- internal/imap/scheduler.go: Scheduler mit time.Ticker (1 min),
  inkrementeller Sync via UID SEARCH UID <lastUID+1>:*,
  exponential backoff (3 Versuche: 1s / 60s / 300s),
  sync_running-Flag verhindert parallele Syncs
- internal/api/server.go: POST /api/imap/{id}/sync (manueller Trigger),
  PATCH /api/imap/{id} (sync_interval_min setzen, 0 oder 5-1440 min)
- cmd/archivmail/main.go: Scheduler gestartet + via SetImap verdrahtet

Frontend:
- src/lib/api.ts: 6 neue ImapAccount-Felder, triggerImapSync, updateImapInterval
- src/app/imap/page.tsx: Intervall-Dropdown, "Sync jetzt"-Button,
  Letzter-Sync-Anzeige mit Status-Badge, Polling auch bei sync_running

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 02:17:44 +01:00
sysops 9cc540a880 fix(deploy): update.sh an tatsächliche Server-Struktur anpassen
- FRONTEND_DIR: /opt/archivmail/frontend → /opt/archivmail/web
- Go Build: CGO_ENABLED=1 -tags xapian -buildvcs=false (Xapian-Support)
- Frontend: standalone-Output deployen statt .next/ direkt
- Services: archivmail-frontend → archivmail-web

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 02:01:07 +01:00
sysops bb963a796f security: Zufallspasswörter beim Erststart, kryptographisch sichere JTI-Generierung
- seedDefaultUsers: generiert kryptographisch zufällige Passwörter (crypto/rand)
  statt hartkodiertes "archivmailrockz" — Passwörter werden einmalig im Terminal
  angezeigt und können danach nicht wiederhergestellt werden
- generateJTI: verwendet crypto/rand (16 Byte, hex) statt time.UnixNano XOR deadbeef

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 01:19:24 +01:00
sysops 7e165c8eed feat(PROJ-1): httpOnly Cookie, Auditor-Guard, Nutzer-Aktionen (C)
Backend:
- Login setzt httpOnly SameSite=Strict Cookie (archivmail_session)
- Logout löscht Cookie + blacklistet Token
- authMiddleware: Cookie first, Bearer als Fallback (CLI kompatibel)

Frontend:
- api.ts: credentials: include statt localStorage/Bearer Token
- updateUser(), deleteUser() hinzugefügt
- useAuth: kein localStorage mehr, nur /api/auth/me
  requireRole: "admin" | "auditor" | undefined
- Login-Seite: kein localStorage
- Navbar: kein localStorage
- Admin: Nutzer-Aktionen (Sperren/Freischalten, Löschen, Passwort-Reset)
  Löschen verhindert wenn letzter Admin (HTTP 409)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 19:57:13 +01:00
sysops a94b1d3e52 fix(PROJ-1): bcrypt Cost 12, Rate-Limiting, last_login_at, User Update/Delete
- bcrypt cost erhöht von DefaultCost (10) auf 12
- Rate-Limiting: max 5 Fehlversuche in 15 Min → HTTP 429
- last_login_at in DB gespeichert und bei jedem Login aktualisiert
- login_attempts Tabelle für Fehlversuche
- PATCH /api/users/{id}: Passwort-Reset, Rolle, E-Mail, Active
- DELETE /api/users/{id}: Löschen mit Schutz für letzten Admin

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 23:04:45 +01:00
sysops 3c722d0987 feat(PROJ-18): E-Mail Integritätsprüfung (SHA-256 Verifikation)
- Storage: VerifyIntegrity, GetAllIDs, GetVerifyStatus + DB-Spalten
- main: Hintergrund-Worker alle 5 Minuten (beim Start sofort: 40/40 OK)
- API: verify_ok + verified_at in GET /api/mails/{id} Antwort
- Frontend: Grüner Haken / graues X / rotes X in Mail-Ansicht

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 21:28:40 +01:00
sysops 7e68c7ab02 feat(PROJ-5): AES-256-GCM Verschlüsselung, PostgreSQL Metadaten, Async Index Worker
- Storage: AES-256-GCM Verschlüsselung (keyfile, graceful fallback bei fehlendem Key)
- Storage: PostgreSQL emails-Tabelle mit Auto-Migration
- Storage: Save/Delete/Stats/FirstAndLastMail nutzen DB wenn verfügbar
- Index: Async IndexWorker (Go-Channel, Queue 1000, non-blocking Submit)
- SMTP: IndexCallback für async Indexierung nach Mail-Eingang
- main: Backfill beim Start (40 Mails migriert + indexiert)
- Bestehende Mails werden transparent entschlüsselt (Fallback auf Raw)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 20:26:50 +01:00
sysops 850290b5ef feat(PROJ-12): E-Mail Export EML/PDF/ZIP
- GET /api/export/pdf/{id}: PDF-Generierung (stdlib, kein ext. Paket)
- POST /api/export/zip: Streaming-ZIP mit manifest.csv, Anhänge optional
- Max. 500 Mails pro Export, Zugriffscheck per Rolle
- Audit-Log für jeden Export
- Frontend: PDF-Button in Mail-Ansicht
- Frontend: Checkboxen + ZIP-Export-Dialog in Suchergebnissen

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 19:49:00 +01:00
sysops 30479cfc60 fix(PROJ-15): archivmail Symlink in /usr/local/bin beim Update setzen
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 19:17:54 +01:00
sysops 4f93b9667d feat(PROJ-15): CLI Import & Export als Subcommands
- archivmail import: EML + MBOX, --file/--dir/--recursive/--dry-run/--json
- archivmail export: EML + MBOX, Filter --from/--to/--date-from/--date-to/--query/--force/--json
- archivmail help / version
- MBOX Parser (SplitMbox) in pkg/mailparser/mbox.go
- Subcommand-Router in main.go ohne externe Abhängigkeit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 18:25:21 +01:00
sysops dbcc980343 chore: Supabase-Paket entfernen (wird nicht verwendet)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 18:01:12 +01:00
sysops 15fb4e4eaf chore: AI Coding Starter Kit Dateien aus Git entfernen
- .claude/skills/, agents/, rules/ ignoriert (Workflow-Dateien)
- docs/production/ ignoriert (Template-Docs)
- src/lib/supabase.ts ignoriert (nicht verwendet)
- public/ Default-SVGs ignoriert
- .gitignore entsprechend erweitert

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 17:59:54 +01:00
sysops d360c9a5ba feat(PROJ-17): Admin Dashboard Systemauslastung immer anzeigen
- Systemauslastungs-Sektion wird immer gerendert (nicht nur bei Erfolg)
- Fehlermeldung wenn /api/admin/system/stats nicht erreichbar ist
- Feature-Status auf In Review gesetzt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 11:43:19 +01:00
“alexvisualmakers” a893084a88 feat: Add path scoping to rules and enforce project init workflow
- Add paths frontmatter to frontend, backend, and security rules so
  they only load when editing relevant files
- Add mandatory new-project detection to general rules that redirects
  to /requirements before any implementation
- Add write-then-verify protocol for feature tracking updates to
  prevent hallucinated file edits

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:11:43 +01:00
“alexvisualmakers” 7c8a2c3622 chore: Use Opus 4.6 for all skills and sub-agents
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 11:57:44 +01:00
“alexvisualmakers” 600552c858 feat: Migrate from agent markdown files to Skills, Rules, and Sub-Agents
Replace the manual "read .claude/agents/*.md" workflow with native
Claude Code features for a more efficient, scalable development experience:

- **Skills** (.claude/skills/): 7 auto-discovered slash commands
  (/requirements, /architecture, /frontend, /backend, /qa, /deploy, /help)
  with forked sub-agents for heavy tasks and inline execution for interactive ones
- **Rules** (.claude/rules/): 4 modular rule files (general, frontend, backend,
  security) auto-applied based on file context
- **Sub-Agents** (.claude/agents/): Lightweight configs for frontend-dev,
  backend-dev, and qa-engineer with model, tool, and turn limit settings
- **Context Engineering**: Layered context loading, context isolation via
  forked skills, built-in context recovery after compaction, and
  "always read, never guess" rules to prevent hallucinated code references
- **CLAUDE.md**: Auto-loaded project context replacing PROJECT_CONTEXT.md
- **Feature tracking**: features/INDEX.md as persistent state across sessions
- **Production guides**: docs/production/ for error tracking, security,
  performance, database optimization, and rate limiting
- **Init Mode**: /requirements detects empty PRD and bootstraps full project
  setup (PRD + all feature specs) from a single project description

Removed: 6 monolithic agent files, PROJECT_CONTEXT.md, HOW_TO_USE_AGENTS.md,
TEMPLATE_CHANGELOG.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 10:15:27 +01:00
“alexvisualmakers” d7abbc3f8c fix: Add complete shadcn/ui CSS variables and Tailwind config
globals.css:
- Add all shadcn/ui CSS variables in HSL format (without hsl() wrapper)
- Include: card, popover, primary, secondary, muted, accent, destructive
- Include: input, ring, radius, chart colors
- Complete light and dark mode definitions

tailwind.config.ts:
- Map all CSS variables with hsl(var(--...)) wrapper
- Add borderRadius config for --radius variable
- Add chart colors mapping

This ensures all shadcn/ui components render correctly out of the box.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 15:28:09 +01:00
“alexvisualmakers” cec3890c6f fix: Resolve build errors with border color and import paths
- Add missing --border CSS variable for light and dark mode
- Add border color to Tailwind config using hsl(var(--border))
- Fix import paths in sidebar.tsx (@/hooks/ instead of @/components/hooks/)
- Fix import path in toaster.tsx (@/hooks/ instead of @/components/hooks/)

These fixes ensure npm run dev / npm run build work out of the box.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 12:53:56 +01:00
“alexvisualmakers” 2f47d526ff feat: Enforce mandatory shadcn/ui component usage in Frontend Dev
- Add critical section: always check shadcn/ui before creating components
- List all 35 installed shadcn components with categories
- Add VERBOTEN section: never create own versions of shadcn components
- Update example component to use shadcn Card/Button/Badge
- Add shadcn checklist items before marking work as done

This ensures Claude Code always uses shadcn/ui instead of building
custom implementations of standard UI elements.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 10:23:25 +01:00
“alexvisualmakers” 3aa2072cca feat: Add comprehensive shadcn/ui component library
Install 35 shadcn components for standard business application:

Base: Button, Input, Label, Card
Forms: Form, Select, Checkbox, Radio, Switch, Textarea
Auth/Feedback: Dialog, Alert, AlertDialog, Toast, Sonner
Dashboard: Table, Tabs, Avatar, Badge, Dropdown, Popover, Tooltip
Navigation: NavigationMenu, Sidebar, Breadcrumb, Sheet, Command
Data Display: Skeleton, Progress, Separator, ScrollArea, Collapsible,
              Accordion, Pagination

Includes hooks (use-toast, use-mobile) and updated Tailwind config.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 10:20:39 +01:00
“alexvisualmakers” 13cda026ba fix: Restore design guidelines in Frontend Dev workflow
Revert accidental removal of design-vorgaben section while keeping
the new Supabase auth best practices.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 09:56:01 +01:00
“alexvisualmakers” 13c086275c feat: Add Supabase auth best practices to Frontend Dev
- Simplify workflow section structure
- Add Auth/Login Best Practices for Supabase + Next.js
  - Hard redirect after login (window.location.href)
  - Session validation before redirect
  - Proper loading state handling
  - Debugging tips for auth issues
- Remove redundant design-vorgaben checkpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 09:54:41 +01:00
“alexvisualmakers” b957bca346 feat: Add security testing focus to QA Engineer role
Extend QA Engineer responsibilities to include security analysis
and permission checks with a Red Team pentester approach.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 09:52:33 +01:00
“alexvisualmakers” 5c55902b6e feat: Requirements Engineer updates PROJECT_CONTEXT.md after writing specs
- New Phase 5: Update PROJECT_CONTEXT.md with current status and roadmap
- Updates "Aktueller Status", "Features Roadmap", optionally "Vision"
- New checklist item ensures PROJECT_CONTEXT.md stays current

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:27:48 +01:00
“alexvisualmakers” 84f177872b feat: Frontend Dev asks for design input when no mockups exist
- New workflow step: Check for design files before implementing
- Interactive questions for style, colors, inspiration
- Uses AskUserQuestion for structured input
- New checklist item for design clarification

Also: Refactored TEMPLATE_CHANGELOG to compact bullet-point format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:18:21 +01:00
“alexvisualmakers” c87a360f2e feat: Add feature granularity guidelines to Requirements Engineer
Enforce Single Responsibility Principle for feature specifications:
- Each feature file should be one testable, deployable unit
- Clear rules on what NOT to combine in one file
- 5 decision criteria for splitting features
- Dependency documentation between features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:04:27 +01:00
“alexvisualmakers” 1c3a81156a refactor: Migrate to Git-based workflow (v1.4.0)
BREAKING CHANGE: Removed FEATURE_CHANGELOG.md and test-reports/

**What changed:**
- All 6 agents now use Git commands to check existing features/components
- Feature specs include test results and deployment status (no separate files)
- Git commits are the single source of truth for implementation details
- Git tags for deployment versioning (e.g., v1.0.0-PROJ-1)

**Why:**
- Prevents context bloat (no growing FEATURE_CHANGELOG.md)
- Scales better (Git is built for large projects)
- No manual changelog maintenance
- Better developer experience (native Git workflow)

**Migration:**
- Requirements Engineer: Uses `ls features/` and `git ls-files` instead of FEATURE_CHANGELOG
- Solution Architect: Uses `git ls-files src/components/` to check existing code
- Frontend/Backend Devs: Use `git log --grep="PROJ-X"` to see feature history
- QA Engineer: Adds test results directly to feature spec
- DevOps: Updates feature spec with deployment status + creates Git tags

**Files changed:**
- Updated all 6 agent instructions (.claude/agents/*.md)
- Deleted FEATURE_CHANGELOG.md
- Deleted test-reports/ folder
- Updated PROJECT_CONTEXT.md (removed references)
- Updated README.md (v1.4.0, updated workflow)
- Updated features/README.md (new format with QA + Deployment sections)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 14:57:19 +01:00
“alexvisualmakers” f035934f42 fix: Add missing SVG assets for Next.js starter page 2026-01-12 09:00:44 +01:00
“alexvisualmakers” a73df5ea26 docs: Remove redundant TEMPLATE_OVERVIEW.md (duplicates README.md content) 2026-01-12 08:46:25 +01:00
“alexvisualmakers” b4da197850 docs: Remove unnecessary CHECKLIST.md file 2026-01-12 08:45:05 +01:00
“alexvisualmakers” 9195df186c Initial commit: AI Coding Starter Kit v1.3.0 (Production-Ready)
Features:
- Next.js 16 + TypeScript + Tailwind CSS
- 6 Production-Ready AI Agents (Requirements → Deployment)
- Production Guides (Error Tracking, Security, Performance, Scaling)
- Feature Changelog System (Code Reuse)
- PM-Friendly Documentation
- Supabase-Ready (optional)
- shadcn/ui-Ready
- Vercel Deployment-Ready

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 08:41:31 +01:00