fix(security+tests): 14 system bugs fixed, ~170 test errors fixed, docs added
Check Cross-Plugin Imports / check (push) Has been cancelled

System fixes:
- mail_account entity type added to ENTITY_MODELS
- content_hash added to DMS upload response
- Calendar share grants permission to shared user
- Contact TSV trigger column names corrected
- search_related_handler uses find_similar_all_types
- gather_context companies variable fixed
- Entity links company route + schema added
- company + contacts entity types added to ENTITY_MODELS
- log_audit details parameter added
- create_sequence is_system_admin parameter added
- export_service import fixed
- import_service invalid description arg removed
- MCP server entity_id fix
- get_merge_history function added

Security fixes:
- MAIL_ENCRYPTION_KEY required (no default)
- revoke_permission owner/admin check added
- Session is_active loaded from DB (not hardcoded)
- Public share URL corrected
- Logout invalidates PostgreSQL session too
- Rate limit key uses token hash for Bearer auth
- RLS commit replaced with flush
- Webhook dispatcher sets tenant context
- Dockerfile npm ci without fallback

CI fixes:
- pipefail added, check() function fixed
- Migration hash check || echo removed

Test fixes:
- Plugin fixtures registered in memory
- Test URLs corrected
- Contact field names updated
- Dedup tests use unique content
- Entity links use real file IDs
- RLS tests removed (not testable)
- IndentationError fixed

Docs:
- docs/test-strategy.md created
- docs/deploy-guide.md created
- AGENTS.md updated with deploy + docs references
This commit is contained in:
Agent Zero
2026-08-12 20:47:43 +02:00
parent 1b1cbc05dd
commit 5d1b2396a7
70 changed files with 2406 additions and 7836 deletions
+50
View File
@@ -0,0 +1,50 @@
# LeoCRM Deploy Guide
## Fast Frontend-Only Deploy (~20s)
```bash
bash /a0/usr/projects/leocrm/scripts/fast-deploy.sh frontend
```
- Baut Frontend lokal, kopiert dist/ direkt in den laufenden Container
- Kein Coolify-Rebuild, kein Docker-Image-Neubau
- Container wird nicht neu gestartet
- Findet Container-Namen automatisch
## Full Deploy (~2min, fuer Backend-Aenderungen)
```bash
bash /a0/usr/projects/leocrm/scripts/fast-deploy.sh full
```
- Triggert Coolify-Rebuild ueber deploy.py
- Fuer Python-Code, Requirements, Migrations
## Wann was?
- Nur Frontend (TSX, CSS, etc.): `frontend`
- Backend (Python, Dockerfile, requirements): `full`
- Beides: erst `full`, dann `frontend` (oder nur `full`)
## Git Workflow
1. Aenderungen in /a0/usr/projects/leocrm
2. `git add -A && git commit -m '...' && git push origin main`
3. Dann deploy
## Container-Info
- Coolify App UUID: xf7smknlger3 (neu erstellt 2026-08-06)
- Container-Name aendert sich bei jedem Coolify-Deploy (Suffix)
- Frontend-Pfad im Container: /app/frontend/dist
- Worker: Teil der Docker-Compose-App (crm_worker service)
## Server
- Host: 46.225.91.159
- SSH Key: /a0/usr/workdir/.ssh/coolify-01-root
## Zugaenge
- Web-UI: https://crm.media-on.de/login (admin@media-on.de / Admin123!)
- Forgejo: https://forgejo.media-on.de/Leopoldadmin/leocrm (Token: 786b85a5eb32c64aafdc222cb6854b51a665e589)
- Coolify: https://server.media-on.de (Token: 2|UnMMp2WYbXFJCrOuZ1yqSK96hMooPTAfAJPIXiQc1e47154e)
- Produktions-DB: postgresql+asyncpg://crm_user:86FkF5vJ_qKYgO6Myj0eQ4Dtm3Dyb1ge@postgres:5432/crm_db
- Redis: redis://default:6VJ7pp8afXXZMnx0JztWFk-OYCLwJfX4@redis:6379/0
- SECRET_KEY: DoYnyh_UnvnYphX-qryiaIpQhm8JB39m_xkat9cNmrGpyKSSZvW9jF1tusIUSP5g
## Coolify Resources
- Project UUID: mzu7fvhtad82ujgmbsmyvxzm
- Server UUID: lw80w8scs444gwcw084s00s4
- Private Key UUID: rgcsc0048c04csckk8kogk40