Metadata-Version: 2.4
Name: odoo-server-optimizer
Version: 0.3.0
Summary: Odoo 19 Enterprise – Server Diagnose & Automatische Optimierung
Project-URL: Repository, https://github.com/BERNHARD-KRENN-R-D/odoo-server-optimizer
Project-URL: Documentation, https://github.com/BERNHARD-KRENN-R-D/odoo-server-optimizer/docs
Author-email: Bernhard Krenn <office@bernhardkrenn.cc>
License: MIT License
        
        Copyright (c) 2026 Bernhard Krenn
        BERNHARD KRENN, Hairstyling & Barbershop
        Wien, Österreich
        https://bernhardkrenn.cc
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
        ---
        
        Dieses Projekt verwendet folgende Open-Source-Bibliotheken:
        
        - Typer (MIT) – https://github.com/tiangolo/typer
        - Rich (MIT) – https://github.com/Textualize/rich
        - Paramiko (LGPL-2.1) – https://github.com/paramiko/paramiko
        - PyYAML (MIT) – https://github.com/yaml/pyyaml
        - Jinja2 (BSD-3) – https://github.com/pallets/jinja
        - psutil (BSD-3) – https://github.com/giampaolo/psutil
License-File: LICENSE
Keywords: austria,devops,odoo,optimization,server
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.11
Requires-Dist: jinja2>=3.1.4
Requires-Dist: paramiko>=3.4.0
Requires-Dist: psutil>=5.9.8
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: rich>=13.7.0
Requires-Dist: typer[all]>=0.12.0
Provides-Extra: api
Requires-Dist: fastapi>=0.111.0; extra == 'api'
Requires-Dist: httpx>=0.27.0; extra == 'api'
Requires-Dist: uvicorn>=0.30.0; extra == 'api'
Provides-Extra: dev
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.14.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Requires-Dist: types-paramiko>=3.4.0; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# odoo-server-optimizer

**Odoo 19 Enterprise – Server Diagnose & Automatische Optimierung**

Ein Python-basiertes CLI-Tool, das Odoo-Installationen auf Konfigurationsprobleme prüft
und die Optimierung halbautomatisch (mit Bestätigung pro Schritt) durchführt.

[![Python](https://img.shields.io/badge/Python-3.11+-blue)](https://python.org)
[![Odoo](https://img.shields.io/badge/Odoo-19%20Enterprise-purple)](https://odoo.com)
[![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
[![Tests](https://img.shields.io/badge/Tests-112%2F112-brightgreen)]()

---

## Funktionsumfang

| Command | Beschreibung |
|---------|--------------|
| `analyze` | Server prüfen – alle Befunde anzeigen |
| `plan` | Optimalen Zielzustand berechnen (ohne Änderungen) |
| `apply` | Fixes halbautomatisch anwenden (Bestätigung pro Schritt) |
| `report` | Diagnose-Bericht als Markdown oder Konsole ausgeben |

## Unterstützte Checks (alle 10 Befunde)

| # | Check | Schwere |
|---|-------|---------|
| 1 | Workers aktiv? (Single-Threaded vs. Multi-Worker) | Kritisch |
| 2 | Config-Datei korrekt? (`.odoorc` vs. `odoo.conf`) | Kritisch |
| 3 | `db_maxconn` vs. PostgreSQL `max_connections` | Kritisch |
| 4 | Timeout-Werte (`limit_time_cpu`, `limit_time_real`) | Warnung |
| 5 | `max_cron_threads` Optimierung | Warnung |
| 6 | Veraltete Parameter (`longpolling_port`) | Warnung |
| 7 | `db_host = False` erkennen | Warnung |
| 8 | `addons_path` gesetzt? | Warnung |
| 9 | `pdfminer.six` installiert? | Warnung |
| 10 | `http_interface = 127.0.0.1`? | Kritisch |

## Fixer (Plan-Apply-Pattern)

| Fixer | Beschreibung |
|-------|-------------|
| `ConfigFixer` | odoo.conf Parameter optimieren (workers, timeouts, memory, ...) |
| `OdooRcFixer` | `.odoorc` deaktivieren (umbenennen) |
| `SystemdFixer` | Service-Datei um `-c /etc/odoo/odoo.conf` ergänzen |
| `NginxFixer` | Nginx Proxy-Timeouts an Odoo-Werte anpassen |
| `SwapFixer` | Swap-Datei einrichten/vergrößern für OOM-Schutz |

Jeder Fixer folgt dem 5-Schritte-Lifecycle: **plan → backup → apply → verify → rollback**

## Schnellstart

```bash
# Installation
pip install odoo-server-optimizer

# Lokale Analyse
odoo-optimizer analyze

# Remote-Analyse (via SSH)
odoo-optimizer analyze --server=prod

# Plan anzeigen (keine Änderungen)
odoo-optimizer plan --server=prod

# Halbautomatisch anwenden
odoo-optimizer apply --server=prod

# Markdown-Bericht erstellen
odoo-optimizer report --server=prod --format=md
```

## Server-Profile

Server werden in `config/servers.yml` konfiguriert:

```yaml
servers:
  prod:
    host: bernhardkrenn.cc
    user: adminbk
    ssh_key: ~/.ssh/id_ed25519
    odoo_conf: /etc/odoo/odoo.conf
    service_name: odoo
```

## Architektur

Siehe [`docs/architecture.md`](docs/architecture.md)

## Entwicklung

Siehe [`docs/contributing.md`](docs/contributing.md)

---

*Entwickelt für BERNHARD KRENN, Hairstyling & Barbershop*
*Odoo 19 Enterprise · Hetzner CCX23 · Ubuntu 24.04*
