Replaces manual .env editing with a guided setup script. Auto-discovers: - Odoo container name and database (via `docker ps` + odoo.conf inspection) - Ollama endpoint (scans 192.168.2.10/9, 192.168.2.1, localhost on port 11434) - Ollama model list (lets user pick from available, auto-selects if only one) Auto-generates (idempotent — preserves on re-run): - POSTGRES_PASSWORD (openssl rand -hex 24) - AGENT_API_KEY (openssl rand -hex 32) - WEBHOOK_SECRET (openssl rand -hex 32) Postgres constants always written correctly: - POSTGRES_HOST=agent-db, POSTGRES_DB=activeblue_ai, POSTGRES_USER=activeblue (fixes previous issue where these were blank or wrong in .env) Odoo API key: - Attempts auto-creation via Odoo HTTP session + res.users.apikeys.description wizard (works on Odoo 16/17/18 with valid admin credentials) - Falls back to clear manual instructions + paste prompt on failure Writes .env with chmod 600. Offers to `docker compose up -d` when done. Usage: cd /root/odoo/odoo-ai bash setup.sh Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 KiB
17 KiB