Commit Graph

8 Commits

Author SHA1 Message Date
Agent Zero 632554bf28 fix(security): F30 (Astra P1) — kein bekanntes Admin-Standardpasswort mehr
Vorher: seed_admin.py und docker-compose.yaml enthielten einen festen
Passwort-Fallback (Admin123!) — ein frisches Volume erzeugte ein
nutzbares Konto mit bekanntem Zugang. Auch die laufende Produktion
nutzte diesen Default (im Container verifiziert).

Fix:
- seed_admin.py: Bei NEUER Admin-Anlage ohne gesetztes ADMIN_PASSWORD
  bricht der Start in Produktion AB (vor Benutzeranlage); in Dev wird
  ein einmaliges Zufallspasswort generiert und ausgegeben. Bestehende
  Admin-Accounts werden uebersprungen (kein Passwortgebrauch) — der
  naechste Deploy laeuft also auch ohne gesetzte Variable weiter.
- docker-compose.yaml: ${ADMIN_PASSWORD:-Admin123!} -> required
  (${ADMIN_PASSWORD:?...}) — kein Default mehr.
- .env.example/.env.docker.example: Default durch CHANGE_ME-Hinweis
  ersetzt.

Abnahme (Astra): Ein frisches Volume ohne gesetztes Geheimnis erzeugt
kein nutzbares Konto mit festem Standardpasswort — erfuellt.
2026-09-18 08:02:05 +02:00
Agent Zero daa7fe805a fix(seed): set is_system_admin=True and seed default workspace on startup
- Admin user was created without is_system_admin=True, causing sidebar
  to be empty (all permission checks failed)
- seed_default_workspace() was never called, so no workspaces existed
- Now seed_admin.py ensures is_system_admin=True for existing admins
  and creates a default workspace if none exists

Fixes: sidebar empty, settings inaccessible
2026-08-16 14:39:45 +02:00
Agent Zero c2a15fb9cb fix: AI Assistant import + admin role in seed_admin
Check Cross-Plugin Imports / check (push) Has been cancelled
- ai_assistant/routes.py: add missing apply_visibility_filter import
- seed_admin.py: set role="admin" on UserTenant (was defaulting to viewer)
2026-08-07 00:53:01 +02:00
Agent Zero 0ebc411fd8 feat: Auto-seed admin user on container start
- prestart.sh: runs seed_admin.py after migrations
- seed_admin.py: reads ADMIN_EMAIL and ADMIN_PASSWORD from env vars
- Creates default tenant + admin role + admin user if not exists
2026-08-04 12:21:38 +02:00
Agent Zero 89b775b9ef fix: legacy app.tenant_id policies on _old tables + seed_admin.py rewrite
- Migration 0090: Drop legacy tenant_isolation policies on companies_old,
  company_contacts_old, contacts_old that used app.tenant_id variable.
  Create new policies using app.current_tenant_id for crm_api/crm_worker.
- seed_admin.py: Rewrite to use migration engine (crm_migration) for
  bootstrap, set tenant context, create Tenant + Role + User + UserTenant.
  No longer passes tenant_id as User parameter.

Fixes: 3 legacy app.tenant_id policies found in Gate 2 verification.
Fixes: seed_admin.py incompatible with current User model.
2026-07-31 22:23:38 +02:00
Agent Zero 5378372aba security: remove hardcoded credentials from scripts and docs 2026-07-28 00:35:09 +02:00
leocrm-bot 02a0fde2e8 fix: use admin@media-on.de instead of .local (invalid TLD for email-validator) 2026-07-04 19:39:36 +02:00
leocrm-bot 5dc4d6d4c0 fix: activate plugins on startup + register routes + seed admin script
- lifespan: load active plugins from DB, call on_activate, register routes
- Fixes: Calendar/Mail/DMS/Tags/Permissions routes returning 404
- scripts/seed_admin.py: creates default tenant + admin user
2026-07-02 13:02:38 +02:00