fixos 2.2.53__tar.gz → 2.2.55__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fixos-2.2.53 → fixos-2.2.55}/PKG-INFO +1 -1
- fixos-2.2.55/VERSION +1 -0
- fixos-2.2.55/fixos/cli/_cleanup_docker_volumes.py +221 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/_cleanup_snap.py +10 -6
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/_cleanup_space.py +1 -1
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/_cleanup_system.py +10 -6
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/cleanup_cmd.py +38 -2
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/projects_cmd.py +7 -3
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/quickfix_cmd.py +10 -7
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/scan_cmd.py +1 -1
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/shell_cmd.py +2 -1
- {fixos-2.2.53 → fixos-2.2.55}/fixos/config.py +1 -1
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/_storage_container_mixin.py +8 -4
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/_storage_system_mixin.py +1 -1
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/_storage_user_mixin.py +12 -6
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/quick_snapshot.py +2 -2
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/service_cleanup.py +20 -14
- {fixos-2.2.53 → fixos-2.2.55}/fixos/orchestrator/rollback.py +11 -7
- {fixos-2.2.53 → fixos-2.2.55}/fixos/providers/llm.py +11 -3
- {fixos-2.2.53 → fixos-2.2.55}/fixos/utils/web_search.py +1 -1
- {fixos-2.2.53 → fixos-2.2.55}/fixos.egg-info/PKG-INFO +1 -1
- {fixos-2.2.53 → fixos-2.2.55}/fixos.egg-info/SOURCES.txt +2 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos.egg-info/top_level.txt +0 -1
- {fixos-2.2.53 → fixos-2.2.55}/pyproject.toml +1 -1
- fixos-2.2.55/tests/unit/test_cleanup_docker_volumes.py +161 -0
- fixos-2.2.53/VERSION +0 -1
- {fixos-2.2.53 → fixos-2.2.55}/.env.example +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/CHANGELOG.md +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/LICENSE +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/MANIFEST.in +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/README.md +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/README.md +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/TEST_RESULTS.md +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/TEST_RESULTS_V2.md +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/alpine/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/arch/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/base/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/broken-audio/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/broken-full/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/broken-network/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/broken-thumbnails/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/debian/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/docker-compose.multi-system.yml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/docker-compose.yml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/fedora/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/test-multi-system.sh +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/test-scenarios.sh +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/ubuntu/Dockerfile +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docker/validate-scenario.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docs/examples/advanced_usage.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/docs/examples/quickstart.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/__main__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/agent/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/agent/autonomous.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/agent/autonomous_session.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/agent/hitl.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/agent/hitl_session.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/agent/session_core.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/agent/session_handlers.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/agent/session_io.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/anonymizer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/__main__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/_cleanup_flatpak.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/_cleanup_home.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/_cleanup_utils.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/_cleanup_venvs.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/ask_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/config_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/dashboard.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/features_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/fix_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/history_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/jetbrains_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/main.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/orchestrate_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/output_formatter.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/profile_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/provider_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/quick_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/report_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/rollback_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/shared.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/token_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli/watch_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/cli.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/config_interactive.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/constants.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/_flatpak_analysis_mixin.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/_flatpak_execution_mixin.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/_flatpak_recommendations_mixin.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/cache_discovery.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/_shared.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/audio.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/file_analysis.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/hardware.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/packages.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/resources.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/security.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/storage_optimization.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/system_core.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/checks/thumbnails.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/dev_project_analyzer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/disk_analyzer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/docker_network_cleanup.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/docker_startup_optimizer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/flatpak_analyzer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/jetbrains_ai.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/jetbrains_recovery.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/native_scan.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/orphaned_workloads.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/process_chains.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/project_scanner.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/service_details.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/service_scanner.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/storage_analyzer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/system_checks.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/utils.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/diagnostics/venv_cleanup.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/endpoint_refresh.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/auditor.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/catalog.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/data/packages.yaml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/data/profiles/developer.yaml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/data/profiles/office.yaml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/data/profiles/sysadmin.yaml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/installer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/profiles.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/features/renderer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/fixes/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/interactive/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/interactive/cleanup_planner.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/llm_shell.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/orchestrator/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/orchestrator/executor.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/orchestrator/graph.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/orchestrator/orchestrator.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/orphan_pins.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/platform_utils.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/base.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/builtin/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/builtin/audio.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/builtin/disk.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/builtin/hardware.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/builtin/resources.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/builtin/security.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/builtin/thumbnails.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/plugins/registry.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/profiles/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/profiles/desktop.yaml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/profiles/developer.yaml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/profiles/minimal.yaml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/profiles/server.yaml +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/providers/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/providers/gemini_native.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/providers/llm_analyzer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/providers/schemas.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/system_checks.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/utils/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/utils/anonymizer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/utils/terminal.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/utils/timeout.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos/watch.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos.egg-info/dependency_links.txt +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos.egg-info/entry_points.txt +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/fixos.egg-info/requires.txt +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/pytest.ini +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/requirements-dev.txt +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/requirements.txt +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/scripts/pyqual-calibrate.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/setup.cfg +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/setup.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/conftest.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/e2e/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/e2e/test_anonymization_layers.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/e2e/test_audio_broken.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/e2e/test_cli.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/e2e/test_diagnostics_integration.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/e2e/test_executor.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/e2e/test_multi_system.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/e2e/test_network_broken.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/e2e/test_thumbnails_broken.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/test_fixos.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/__init__.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_anonymizer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_ask_and_nl_group.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cache_discovery.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cleanup_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cleanup_effectiveness.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cleanup_planner.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cleanup_retention.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cleanup_safety.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cleanup_space.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cleanup_tmp.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cleanup_utils.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_cli_main.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_core.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_dashboard.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_dev_project_analyzer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_disk_analyzer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_docker_network_cleanup.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_docker_startup_optimizer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_endpoint_refresh.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_executor.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_gemini_native_client.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_jetbrains_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_jetbrains_recovery.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_llm_auth_stop.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_llm_provider.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_native_scan.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_ollama_endpoint.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_orchestrator.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_orphan_pins.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_orphaned_workloads.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_packaging_data.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_process_chains.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_project_scanner.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_projects_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_quick_cmd.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_quick_snapshot.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_resources_quick.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_security_quick.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_service_cleanup.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_service_scanner.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_shell_ux.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_storage_analyzer.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_system_checks_parallel.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_venv_cleanup.py +0 -0
- {fixos-2.2.53 → fixos-2.2.55}/tests/unit/test_version_parity.py +0 -0
fixos-2.2.55/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.2.55
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"""Selective removal of unused (dangling) Docker volumes.
|
|
2
|
+
|
|
3
|
+
Volumes hold real data, so nothing here is bulk: candidates are listed with
|
|
4
|
+
name, Compose project and age, the user picks them, and each one is checked
|
|
5
|
+
again right before ``docker volume rm``. ``--yes`` never selects volumes whose
|
|
6
|
+
name looks like stored data (databases, git mirrors, backups, ...).
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import json
|
|
12
|
+
import os
|
|
13
|
+
import re
|
|
14
|
+
import subprocess
|
|
15
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
16
|
+
from datetime import datetime, timezone
|
|
17
|
+
|
|
18
|
+
import click
|
|
19
|
+
|
|
20
|
+
from fixos.cli import _cleanup_space as space
|
|
21
|
+
from fixos.cli._cleanup_utils import _format_bytes
|
|
22
|
+
|
|
23
|
+
# Name tokens that usually mean irreplaceable data rather than a cache.
|
|
24
|
+
_DATA_TOKENS = re.compile(
|
|
25
|
+
r"(?:^|[_.-])(mirror|git|gitea|onedev|repo|repos|postgres|postgresql|pg|"
|
|
26
|
+
r"mysql|mariadb|mongo|mongodb|redis|db|database|backup|backups|minio|s3|"
|
|
27
|
+
r"vault|secrets?|keycloak|grafana|prometheus|influx|elastic|opensearch|"
|
|
28
|
+
r"nextcloud|uploads|media|webui|openwebui|open-webui|n8n|storage|certs|"
|
|
29
|
+
r"letsencrypt|wordpress|mattermost|synapse|chat-history)(?:$|[_.-])",
|
|
30
|
+
re.IGNORECASE,
|
|
31
|
+
)
|
|
32
|
+
_INSPECT_BATCH = 100
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _docker_lines(args: list[str], timeout: int = 30) -> list[str] | None:
|
|
36
|
+
try:
|
|
37
|
+
result = space._run_cmd(["docker", *args], timeout=timeout)
|
|
38
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
39
|
+
return None
|
|
40
|
+
if result.returncode != 0:
|
|
41
|
+
return None
|
|
42
|
+
return [line for line in result.stdout.splitlines() if line.strip()]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _is_unused(name: str) -> bool:
|
|
46
|
+
"""Re-check right before removal: still dangling and no container (even stopped)."""
|
|
47
|
+
dangling = _docker_lines(["volume", "ls", "-q", "-f", "dangling=true", "-f", f"name=^{name}$"])
|
|
48
|
+
containers = _docker_lines(["ps", "-aq", "--filter", f"volume={name}"])
|
|
49
|
+
return dangling is not None and name in dangling and containers == []
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _age_days(created_at: str, now: datetime) -> float | None:
|
|
53
|
+
try:
|
|
54
|
+
created = datetime.fromisoformat(created_at.replace("Z", "+00:00"))
|
|
55
|
+
except ValueError:
|
|
56
|
+
return None
|
|
57
|
+
if created.tzinfo is None:
|
|
58
|
+
created = created.replace(tzinfo=timezone.utc)
|
|
59
|
+
return (now - created).total_seconds() / 86400
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
_SIZE_WORKERS = 8
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _du_batch(command: list[str], paths: list[str]) -> dict[str, int]:
|
|
66
|
+
sizes: dict[str, int] = {}
|
|
67
|
+
try:
|
|
68
|
+
result = space._run_cmd([*command, "-sbl0", "--", *paths], timeout=300)
|
|
69
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
70
|
+
return sizes
|
|
71
|
+
for record in result.stdout.split("\0"):
|
|
72
|
+
size, sep, path = record.partition("\t")
|
|
73
|
+
if sep and size.isdigit():
|
|
74
|
+
sizes[path] = int(size)
|
|
75
|
+
return sizes
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _volume_sizes(mountpoints: list[str]) -> dict[str, int]:
|
|
79
|
+
"""Sizes via ``du`` in parallel batches; root-owned volumes use ``sudo -n``.
|
|
80
|
+
|
|
81
|
+
``sudo -n`` never prompts: without passwordless sudo the size stays unknown.
|
|
82
|
+
Unreadable mountpoints go straight to ``sudo -n``, so a partial size of an
|
|
83
|
+
unreadable directory is never reported.
|
|
84
|
+
"""
|
|
85
|
+
readable = [m for m in mountpoints if os.access(m, os.R_OK | os.X_OK)]
|
|
86
|
+
privileged = [m for m in mountpoints if m not in set(readable)]
|
|
87
|
+
jobs = [(["du"], readable[i::_SIZE_WORKERS]) for i in range(_SIZE_WORKERS)]
|
|
88
|
+
jobs += [(["sudo", "-n", "du"], privileged[i::_SIZE_WORKERS]) for i in range(_SIZE_WORKERS)]
|
|
89
|
+
jobs = [(command, paths) for command, paths in jobs if paths]
|
|
90
|
+
sizes: dict[str, int] = {}
|
|
91
|
+
if not jobs:
|
|
92
|
+
return sizes
|
|
93
|
+
with ThreadPoolExecutor(max_workers=min(_SIZE_WORKERS, len(jobs))) as pool:
|
|
94
|
+
for result in pool.map(lambda job: _du_batch(*job), jobs):
|
|
95
|
+
sizes.update(result)
|
|
96
|
+
return sizes
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _unused_volumes(
|
|
100
|
+
days: float | None, match: list[str], now: datetime | None = None
|
|
101
|
+
) -> list[dict] | None:
|
|
102
|
+
names = _docker_lines(["volume", "ls", "-q", "-f", "dangling=true"])
|
|
103
|
+
if names is None:
|
|
104
|
+
return None
|
|
105
|
+
now = now or datetime.now(timezone.utc)
|
|
106
|
+
records: list[dict] = []
|
|
107
|
+
for start in range(0, len(names), _INSPECT_BATCH):
|
|
108
|
+
raw = _docker_lines(["volume", "inspect", *names[start : start + _INSPECT_BATCH]], timeout=60)
|
|
109
|
+
if raw is None:
|
|
110
|
+
return None
|
|
111
|
+
records.extend(json.loads("\n".join(raw)))
|
|
112
|
+
candidates = []
|
|
113
|
+
for record in records:
|
|
114
|
+
name = record.get("Name", "")
|
|
115
|
+
if match and not any(token.lower() in name.lower() for token in match):
|
|
116
|
+
continue
|
|
117
|
+
age = _age_days(record.get("CreatedAt", ""), now)
|
|
118
|
+
if days is not None and (age is None or age < days):
|
|
119
|
+
continue
|
|
120
|
+
labels = record.get("Labels") or {}
|
|
121
|
+
project = labels.get("com.docker.compose.project") or "(bez projektu)"
|
|
122
|
+
protected = bool(_DATA_TOKENS.search(name))
|
|
123
|
+
candidates.append(
|
|
124
|
+
{
|
|
125
|
+
"name": name,
|
|
126
|
+
"description": name,
|
|
127
|
+
"project": project,
|
|
128
|
+
"age_days": age,
|
|
129
|
+
"mountpoint": record.get("Mountpoint", ""),
|
|
130
|
+
"protected": protected,
|
|
131
|
+
"size_bytes": 0,
|
|
132
|
+
"size_known": False,
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
sizes = _volume_sizes([c["mountpoint"] for c in candidates if c["mountpoint"]])
|
|
136
|
+
for candidate in candidates:
|
|
137
|
+
if candidate["mountpoint"] in sizes:
|
|
138
|
+
candidate["size_bytes"] = sizes[candidate["mountpoint"]]
|
|
139
|
+
candidate["size_known"] = True
|
|
140
|
+
age = candidate["age_days"]
|
|
141
|
+
size = _format_bytes(candidate["size_bytes"]) if candidate["size_known"] else "rozmiar nieznany"
|
|
142
|
+
candidate["note"] = (
|
|
143
|
+
f"{candidate['project']}, {age:.0f} dni" if age is not None else candidate["project"]
|
|
144
|
+
) + (" — wygląda na DANE, tylko ręczny wybór" if candidate["protected"] else "")
|
|
145
|
+
candidate["size_label"] = size
|
|
146
|
+
candidates.sort(key=lambda c: (c["size_known"], c["size_bytes"]), reverse=True)
|
|
147
|
+
return candidates
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def _cleanup_docker_volumes(
|
|
151
|
+
json_output: bool,
|
|
152
|
+
dry_run: bool,
|
|
153
|
+
list_only: bool,
|
|
154
|
+
yes: bool,
|
|
155
|
+
days: float | None = None,
|
|
156
|
+
match: list[str] | None = None,
|
|
157
|
+
) -> None:
|
|
158
|
+
"""List unused Docker volumes and remove the selected ones."""
|
|
159
|
+
candidates = _unused_volumes(days, match or [], now=None)
|
|
160
|
+
if json_output:
|
|
161
|
+
space._echo_json(
|
|
162
|
+
{
|
|
163
|
+
"error": None if candidates is not None else "docker volume ls failed",
|
|
164
|
+
"candidates": [
|
|
165
|
+
{k: c[k] for k in ("name", "project", "age_days", "size_bytes", "size_known", "protected")}
|
|
166
|
+
for c in candidates or []
|
|
167
|
+
],
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
return
|
|
171
|
+
if candidates is None:
|
|
172
|
+
click.echo(click.style("Błąd: nie udało się odczytać wolumenów Dockera.", fg="red"))
|
|
173
|
+
return
|
|
174
|
+
if not candidates:
|
|
175
|
+
click.echo(click.style("Brak nieużywanych wolumenów Dockera dla podanych filtrów.", fg="green"))
|
|
176
|
+
return
|
|
177
|
+
known = sum(c["size_bytes"] for c in candidates if c["size_known"])
|
|
178
|
+
click.echo(
|
|
179
|
+
f"\n{click.style('DOCKER — nieużywane wolumeny (dane!):', fg='magenta', bold=True)} "
|
|
180
|
+
f"{len(candidates)}, znany rozmiar {_format_bytes(known)}"
|
|
181
|
+
)
|
|
182
|
+
for index, item in enumerate(candidates, 1):
|
|
183
|
+
color = "red" if item["protected"] else "yellow"
|
|
184
|
+
click.echo(
|
|
185
|
+
f" [{index:3d}] {click.style(item['name'], fg=color)}: {item['size_label']} — {item['note']}"
|
|
186
|
+
)
|
|
187
|
+
if list_only:
|
|
188
|
+
return
|
|
189
|
+
if yes:
|
|
190
|
+
selected = [i for i, c in enumerate(candidates) if not c["protected"]]
|
|
191
|
+
skipped = len(candidates) - len(selected)
|
|
192
|
+
if skipped:
|
|
193
|
+
click.echo(f" --yes pomija {skipped} wolumenów wyglądających na dane; wybierz je ręcznie.")
|
|
194
|
+
else:
|
|
195
|
+
selected = space._choose(candidates, "Numery wolumenów do usunięcia (np. 1,2, all)")
|
|
196
|
+
if not selected:
|
|
197
|
+
click.echo("Pominięto.")
|
|
198
|
+
return
|
|
199
|
+
if dry_run:
|
|
200
|
+
space._show_dry_run_commands([["docker", "volume", "rm", candidates[i]["name"]] for i in selected])
|
|
201
|
+
return
|
|
202
|
+
if not yes and not space._confirm_remove():
|
|
203
|
+
click.echo("Anulowano.")
|
|
204
|
+
return
|
|
205
|
+
freed = 0
|
|
206
|
+
for index in selected:
|
|
207
|
+
name = candidates[index]["name"]
|
|
208
|
+
if not _is_unused(name):
|
|
209
|
+
click.echo(f" ⏭️ {name}: jest już używany albo nie istnieje — pominięto")
|
|
210
|
+
continue
|
|
211
|
+
try:
|
|
212
|
+
result = space._run_cmd(["docker", "volume", "rm", name], timeout=120)
|
|
213
|
+
except (OSError, subprocess.TimeoutExpired) as exc:
|
|
214
|
+
click.echo(click.style(f" ❌ {name}: {exc}", fg="red"))
|
|
215
|
+
continue
|
|
216
|
+
if result.returncode == 0:
|
|
217
|
+
freed += candidates[index]["size_bytes"]
|
|
218
|
+
click.echo(click.style(f" ✅ {name}", fg="green"))
|
|
219
|
+
else:
|
|
220
|
+
click.echo(click.style(f" ❌ {name}: {result.stderr.strip()[:120]}", fg="red"))
|
|
221
|
+
click.echo(f"Usunięto wolumeny o znanym rozmiarze łącznie {_format_bytes(freed)}.")
|
|
@@ -40,6 +40,15 @@ def _snap_fetch_packages(analyzer) -> list:
|
|
|
40
40
|
return packages
|
|
41
41
|
|
|
42
42
|
|
|
43
|
+
def _run_snap_remove(pkg_name: str) -> subprocess.CompletedProcess:
|
|
44
|
+
return subprocess.run(
|
|
45
|
+
["sudo", "snap", "remove", pkg_name],
|
|
46
|
+
capture_output=True,
|
|
47
|
+
text=True,
|
|
48
|
+
timeout=120,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
43
52
|
def _snap_remove_packages(packages_to_remove: list) -> None:
|
|
44
53
|
"""Execute snap remove for each package and report results."""
|
|
45
54
|
click.echo(
|
|
@@ -48,12 +57,7 @@ def _snap_remove_packages(packages_to_remove: list) -> None:
|
|
|
48
57
|
for pkg in packages_to_remove:
|
|
49
58
|
click.echo(f"\n• {pkg['name']} (v{pkg['version']})")
|
|
50
59
|
try:
|
|
51
|
-
result =
|
|
52
|
-
["sudo", "snap", "remove", pkg["name"]],
|
|
53
|
-
capture_output=True,
|
|
54
|
-
text=True,
|
|
55
|
-
timeout=120,
|
|
56
|
-
)
|
|
60
|
+
result = _run_snap_remove(pkg["name"])
|
|
57
61
|
if result.returncode == 0:
|
|
58
62
|
click.echo(click.style(" ✅ Odinstalowano", fg="green"))
|
|
59
63
|
else:
|
|
@@ -393,7 +393,7 @@ def _cleanup_user_cache(
|
|
|
393
393
|
if not yes and not _confirm_remove():
|
|
394
394
|
click.echo("Anulowano.")
|
|
395
395
|
return
|
|
396
|
-
_remove_selected(candidates, selected)
|
|
396
|
+
_remove_selected(candidates, selected, path_key="path")
|
|
397
397
|
|
|
398
398
|
|
|
399
399
|
# ── JetBrains Toolbox / caches ───────────────────────────────────────────
|
|
@@ -353,6 +353,15 @@ def _select_cleanup_items_by_filter(selection: str, analyzer, safe_items: list)
|
|
|
353
353
|
# ── Execution ─────────────────────────────────────────────────────────────
|
|
354
354
|
|
|
355
355
|
|
|
356
|
+
def _run_cleanup_item_cmd(cmd_args: list[str]) -> subprocess.CompletedProcess:
|
|
357
|
+
return subprocess.run(
|
|
358
|
+
cmd_args,
|
|
359
|
+
capture_output=True,
|
|
360
|
+
text=True,
|
|
361
|
+
timeout=DEFAULT_COMMAND_TIMEOUT,
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
|
|
356
365
|
def _execute_full_cleanup(items_to_clean: list, dry_run: bool) -> None:
|
|
357
366
|
"""Execute cleanup commands for a list of StorageItems."""
|
|
358
367
|
click.echo(f"\n{click.style('=' * 60, fg='cyan')}")
|
|
@@ -377,12 +386,7 @@ def _execute_full_cleanup(items_to_clean: list, dry_run: bool) -> None:
|
|
|
377
386
|
continue
|
|
378
387
|
click.echo(f" 🚀 Wykonuję: {item.cleanup_command}")
|
|
379
388
|
try:
|
|
380
|
-
result =
|
|
381
|
-
item.cleanup_command.split(),
|
|
382
|
-
capture_output=True,
|
|
383
|
-
text=True,
|
|
384
|
-
timeout=DEFAULT_COMMAND_TIMEOUT,
|
|
385
|
-
)
|
|
389
|
+
result = _run_cleanup_item_cmd(item.cleanup_command.split())
|
|
386
390
|
if result.returncode == 0:
|
|
387
391
|
click.echo(click.style(" ✅ Sukces", fg="green"))
|
|
388
392
|
results["success"] += 1
|
|
@@ -14,6 +14,8 @@ import re
|
|
|
14
14
|
|
|
15
15
|
import click
|
|
16
16
|
|
|
17
|
+
from fixos.cli._cleanup_docker_volumes import _cleanup_docker_volumes
|
|
18
|
+
|
|
17
19
|
# Re-export public symbols used by fixos.cli (backward-compat)
|
|
18
20
|
from fixos.cli._cleanup_flatpak import _cleanup_flatpak_detailed
|
|
19
21
|
from fixos.cli._cleanup_space import (
|
|
@@ -1611,7 +1613,7 @@ def _execute_yes_cleanup(plan: dict, scanner, dry_run: bool = False) -> None:
|
|
|
1611
1613
|
"Wyczyść konkretną usługę "
|
|
1612
1614
|
"(docker, docker-all, docker-old, docker-containers, docker-networks, "
|
|
1613
1615
|
"docker-stale-services, orphaned-projects, ollama-old, snap-old, "
|
|
1614
|
-
"journal, user-cache, jetbrains, libvirt, gitive, docker-buildcache, tmp, venvs-old, "
|
|
1616
|
+
"journal, user-cache, jetbrains, libvirt, gitive, docker-buildcache, docker-volumes, tmp, venvs-old, "
|
|
1615
1617
|
"npm, ...)"
|
|
1616
1618
|
),
|
|
1617
1619
|
)
|
|
@@ -1719,6 +1721,23 @@ def _execute_yes_cleanup(plan: dict, scanner, dry_run: bool = False) -> None:
|
|
|
1719
1721
|
f"(domyślnie {DEFAULT_OLLAMA_OLD_UNUSED_DAYS}); pomija modele aktualnie uruchomione"
|
|
1720
1722
|
),
|
|
1721
1723
|
)
|
|
1724
|
+
@click.option(
|
|
1725
|
+
"--docker-volumes",
|
|
1726
|
+
"docker_volumes",
|
|
1727
|
+
is_flag=True,
|
|
1728
|
+
default=False,
|
|
1729
|
+
help=(
|
|
1730
|
+
"Wybierz i usuń nieużywane wolumeny Dockera (nazwa, projekt Compose, wiek, "
|
|
1731
|
+
"rozmiar przez du/sudo -n); filtry --days i --match; --yes pomija "
|
|
1732
|
+
"wolumeny wyglądające na dane"
|
|
1733
|
+
),
|
|
1734
|
+
)
|
|
1735
|
+
@click.option(
|
|
1736
|
+
"--match",
|
|
1737
|
+
"match",
|
|
1738
|
+
default=None,
|
|
1739
|
+
help="Dla --docker-volumes: fragmenty nazw rozdzielone przecinkami, np. ollama,huggingface",
|
|
1740
|
+
)
|
|
1722
1741
|
@click.option(
|
|
1723
1742
|
"--snap-old",
|
|
1724
1743
|
"snap_old",
|
|
@@ -1893,6 +1912,8 @@ def cleanup_services(
|
|
|
1893
1912
|
list_orphan_pins,
|
|
1894
1913
|
process_hours,
|
|
1895
1914
|
ollama_old,
|
|
1915
|
+
docker_volumes,
|
|
1916
|
+
match,
|
|
1896
1917
|
snap_old,
|
|
1897
1918
|
journal_cleanup,
|
|
1898
1919
|
user_cache,
|
|
@@ -1951,6 +1972,8 @@ def cleanup_services(
|
|
|
1951
1972
|
fixos cleanup --unpin-orphan-project /absolute/missing/project
|
|
1952
1973
|
# usuwa ochronę, ale nie zmienia Dockera ani procesów
|
|
1953
1974
|
fixos cleanup --ollama-old --days 90 --dry-run
|
|
1975
|
+
fixos cleanup --docker-volumes --list # nieużywane wolumeny: nazwa, projekt, wiek, rozmiar
|
|
1976
|
+
fixos cleanup --docker-volumes --match ollama,huggingface --days 90
|
|
1954
1977
|
# modele Ollama niezmieniane od 90+ dni
|
|
1955
1978
|
fixos cleanup -c ollama-old
|
|
1956
1979
|
fixos cleanup --snap-old # wyłączone rewizje snapów
|
|
@@ -2004,6 +2027,7 @@ def cleanup_services(
|
|
|
2004
2027
|
list_orphan_pins,
|
|
2005
2028
|
ollama_old,
|
|
2006
2029
|
snap_old,
|
|
2030
|
+
docker_volumes,
|
|
2007
2031
|
journal_cleanup,
|
|
2008
2032
|
user_cache,
|
|
2009
2033
|
jetbrains,
|
|
@@ -2053,6 +2077,7 @@ def cleanup_services(
|
|
|
2053
2077
|
ollama_old,
|
|
2054
2078
|
docker_buildcache,
|
|
2055
2079
|
snap_old,
|
|
2080
|
+
docker_volumes,
|
|
2056
2081
|
journal_cleanup,
|
|
2057
2082
|
user_cache,
|
|
2058
2083
|
jetbrains,
|
|
@@ -2106,6 +2131,17 @@ def cleanup_services(
|
|
|
2106
2131
|
"libvirt": (libvirt, _cleanup_libvirt),
|
|
2107
2132
|
"gitive": (gitive, _cleanup_gitive),
|
|
2108
2133
|
"docker-buildcache": (docker_buildcache, _cleanup_docker_buildcache),
|
|
2134
|
+
"docker-volumes": (
|
|
2135
|
+
docker_volumes,
|
|
2136
|
+
lambda j, d, lst, y: _cleanup_docker_volumes(
|
|
2137
|
+
j,
|
|
2138
|
+
d,
|
|
2139
|
+
lst,
|
|
2140
|
+
y,
|
|
2141
|
+
days=effective_days,
|
|
2142
|
+
match=[t.strip() for t in (match or "").split(",") if t.strip()],
|
|
2143
|
+
),
|
|
2144
|
+
),
|
|
2109
2145
|
"tmp": (
|
|
2110
2146
|
tmp_cleanup,
|
|
2111
2147
|
lambda j, d, lst, y: _cleanup_tmp(
|
|
@@ -2168,7 +2204,7 @@ def cleanup_services(
|
|
|
2168
2204
|
click.echo(
|
|
2169
2205
|
click.style(
|
|
2170
2206
|
"Akcje odzyskiwania miejsca (snap/journal/cache/JetBrains/"
|
|
2171
|
-
"libvirt/gitive/docker-buildcache/tmp/trash/thumbnails) uruchom jako osobną, pojedynczą akcję.",
|
|
2207
|
+
"libvirt/gitive/docker-buildcache/docker-volumes/tmp/trash/thumbnails) uruchom jako osobną, pojedynczą akcję.",
|
|
2172
2208
|
fg="red",
|
|
2173
2209
|
)
|
|
2174
2210
|
)
|
|
@@ -300,6 +300,12 @@ def _select_artifacts(artifacts: list) -> list:
|
|
|
300
300
|
return selected
|
|
301
301
|
|
|
302
302
|
|
|
303
|
+
def _run_artifact_cleanup_cmd(command: str) -> subprocess.CompletedProcess:
|
|
304
|
+
return subprocess.run(
|
|
305
|
+
command, shell=True, capture_output=True, text=True, check=False
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
|
|
303
309
|
def _execute_cleanup(artifacts: list, dry_run: bool) -> float:
|
|
304
310
|
total_freed = 0.0
|
|
305
311
|
for a in artifacts:
|
|
@@ -309,9 +315,7 @@ def _execute_cleanup(artifacts: list, dry_run: bool) -> float:
|
|
|
309
315
|
continue
|
|
310
316
|
|
|
311
317
|
click.echo(f"Czyszczenie {label}...")
|
|
312
|
-
result =
|
|
313
|
-
a.cleanup_command, shell=True, capture_output=True, text=True, check=False
|
|
314
|
-
)
|
|
318
|
+
result = _run_artifact_cleanup_cmd(a.cleanup_command)
|
|
315
319
|
if result.returncode == 0:
|
|
316
320
|
total_freed += a.size_gb
|
|
317
321
|
click.echo(click.style(f" Zwolniono {a.size_gb:.2f} GB", fg="green"))
|
|
@@ -36,6 +36,15 @@ def quickfix(dry_run, modules) -> None:
|
|
|
36
36
|
fixes_found = 0
|
|
37
37
|
fixes_applied = 0
|
|
38
38
|
|
|
39
|
+
def _run_quickfix_command(command: str) -> subprocess.CompletedProcess:
|
|
40
|
+
return subprocess.run(
|
|
41
|
+
command,
|
|
42
|
+
shell=True,
|
|
43
|
+
capture_output=True,
|
|
44
|
+
text=True,
|
|
45
|
+
timeout=60,
|
|
46
|
+
)
|
|
47
|
+
|
|
39
48
|
for result in results:
|
|
40
49
|
for finding in result.findings:
|
|
41
50
|
if finding.command:
|
|
@@ -55,13 +64,7 @@ def quickfix(dry_run, modules) -> None:
|
|
|
55
64
|
if finding.severity in (Severity.CRITICAL, Severity.WARNING):
|
|
56
65
|
if click.confirm(" Wykonać?"):
|
|
57
66
|
try:
|
|
58
|
-
proc =
|
|
59
|
-
finding.command,
|
|
60
|
-
shell=True,
|
|
61
|
-
capture_output=True,
|
|
62
|
-
text=True,
|
|
63
|
-
timeout=60,
|
|
64
|
-
)
|
|
67
|
+
proc = _run_quickfix_command(finding.command)
|
|
65
68
|
if proc.returncode == 0:
|
|
66
69
|
click.echo(click.style(" OK", fg="green"))
|
|
67
70
|
fixes_applied += 1
|
|
@@ -122,7 +122,7 @@ def scan(
|
|
|
122
122
|
data = get_full_diagnostics(selected_modules, progress_callback=fmt.progress)
|
|
123
123
|
|
|
124
124
|
if disc:
|
|
125
|
-
_run_disk_analysis(data, fmt=fmt, is_fix_mode=False)
|
|
125
|
+
_run_disk_analysis(data, fmt=fmt, json_output=False, is_fix_mode=False)
|
|
126
126
|
|
|
127
127
|
# ── Machine-parseable output (YAML / JSON) ───────────────
|
|
128
128
|
if fmt.is_machine:
|
|
@@ -284,7 +284,8 @@ def run_interactive_shell(ctx: click.Context | None = None) -> None:
|
|
|
284
284
|
if not args:
|
|
285
285
|
continue
|
|
286
286
|
click.echo()
|
|
287
|
-
|
|
287
|
+
prog_name = ctx.info_name if ctx and getattr(ctx, "info_name", None) else "fixos"
|
|
288
|
+
cli.main(args, prog_name=prog_name, standalone_mode=False)
|
|
288
289
|
click.echo()
|
|
289
290
|
except SystemExit:
|
|
290
291
|
click.echo()
|
|
@@ -143,7 +143,7 @@ _OPENROUTER_MODEL_MIGRATIONS = {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
DEFAULT_OLLAMA_HOST = "127.0.0.1:11434"
|
|
146
|
+
DEFAULT_OLLAMA_HOST = "127.0.0.1:11434" # nohardcode: allow NOHARDCODE-006 -- fallback when OLLAMA_HOST is unset or empty
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
def ollama_host_url() -> str:
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
+
from typing import ClassVar
|
|
6
7
|
|
|
7
|
-
from fixos.diagnostics.storage_analyzer import StorageItem
|
|
8
8
|
from fixos.constants import MIN_DOCKER_DANGLING_MB, MIN_PODMAN_MB
|
|
9
|
+
from fixos.diagnostics.storage_analyzer import StorageItem
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class _ContainerAnalyzerMixin:
|
|
12
13
|
"""Mixin providing container _analyze_* methods for StorageAnalyzer."""
|
|
13
14
|
|
|
14
|
-
_DOCKER_DF_SECTIONS = {
|
|
15
|
+
_DOCKER_DF_SECTIONS: ClassVar[dict[str, str]] = {
|
|
15
16
|
"Images space usage:": "images",
|
|
16
17
|
"Containers space usage:": "containers",
|
|
17
18
|
"Local Volumes space usage:": "volumes",
|
|
@@ -119,11 +120,14 @@ class _ContainerAnalyzerMixin:
|
|
|
119
120
|
size_bytes=total_docker,
|
|
120
121
|
category="containers",
|
|
121
122
|
risk="medium",
|
|
122
|
-
|
|
123
|
+
# Never a bulk volume prune: volumes are data and are
|
|
124
|
+
# chosen one by one with `fixos cleanup --docker-volumes`.
|
|
125
|
+
cleanup_command="docker builder prune --force --filter until=168h",
|
|
123
126
|
description=(
|
|
124
127
|
f"Docker łącznie: {StorageItem._format_size(total_docker)}. "
|
|
125
128
|
f"Obrazy: {total_images}, dangling: {dangling_images}. "
|
|
126
|
-
"
|
|
129
|
+
"Czyści cache buildów starszy niż 7 dni; wolumeny wybierz "
|
|
130
|
+
"ręcznie przez `fixos cleanup --docker-volumes`."
|
|
127
131
|
),
|
|
128
132
|
)
|
|
129
133
|
)
|
|
@@ -353,6 +353,17 @@ class _UserAnalyzerMixin:
|
|
|
353
353
|
large_dirs.sort(key=lambda x: -x["size"])
|
|
354
354
|
return large_dirs[:30]
|
|
355
355
|
|
|
356
|
+
@staticmethod
|
|
357
|
+
def _run_du_threshold(
|
|
358
|
+
min_size_mb: int, scan_path: str
|
|
359
|
+
) -> subprocess.CompletedProcess:
|
|
360
|
+
return subprocess.run(
|
|
361
|
+
["du", "-h", "--threshold", f"{min_size_mb}M", scan_path],
|
|
362
|
+
capture_output=True,
|
|
363
|
+
text=True,
|
|
364
|
+
timeout=120,
|
|
365
|
+
)
|
|
366
|
+
|
|
356
367
|
def get_large_directories(self, min_size_mb: int = 100) -> List[Dict[str, Any]]:
|
|
357
368
|
"""Find all directories larger than min_size_mb."""
|
|
358
369
|
large_dirs = []
|
|
@@ -364,12 +375,7 @@ class _UserAnalyzerMixin:
|
|
|
364
375
|
continue
|
|
365
376
|
|
|
366
377
|
try:
|
|
367
|
-
result =
|
|
368
|
-
["du", "-h", "--threshold", f"{min_size_mb}M", scan_path],
|
|
369
|
-
capture_output=True,
|
|
370
|
-
text=True,
|
|
371
|
-
timeout=120,
|
|
372
|
-
)
|
|
378
|
+
result = self._run_du_threshold(min_size_mb, scan_path)
|
|
373
379
|
|
|
374
380
|
if result.returncode == 0:
|
|
375
381
|
for line in result.stdout.strip().split("\n"):
|
|
@@ -481,7 +481,7 @@ def _sample_process_load(
|
|
|
481
481
|
|
|
482
482
|
def _resource_snapshot() -> dict[str, Any]:
|
|
483
483
|
logical_cpus = psutil.cpu_count() or 1
|
|
484
|
-
cpu_percent, processes = _sample_process_load(logical_cpus)
|
|
484
|
+
cpu_percent, processes = _sample_process_load(logical_cpus, interval=0.12)
|
|
485
485
|
try:
|
|
486
486
|
load_1, load_5, load_15 = os.getloadavg()
|
|
487
487
|
except (AttributeError, OSError):
|
|
@@ -854,7 +854,7 @@ def collect_quick_snapshot(
|
|
|
854
854
|
safe_items, review_items, measurement_complete = _measure_caches(
|
|
855
855
|
home_path, timeout=cache_timeout
|
|
856
856
|
)
|
|
857
|
-
docker_review = _cached_docker_review(now)
|
|
857
|
+
docker_review = _cached_docker_review(now, max_age_hours=24)
|
|
858
858
|
if docker_review:
|
|
859
859
|
review_items.append(docker_review)
|
|
860
860
|
review_items.sort(key=lambda item: item["size_bytes"], reverse=True)
|
|
@@ -288,17 +288,20 @@ class ServiceCleaner:
|
|
|
288
288
|
)
|
|
289
289
|
return result
|
|
290
290
|
|
|
291
|
+
def _run_target_cmd(cmd: list[str]) -> subprocess.CompletedProcess:
|
|
292
|
+
return subprocess.run(
|
|
293
|
+
cmd,
|
|
294
|
+
capture_output=True,
|
|
295
|
+
text=True,
|
|
296
|
+
timeout=DEFAULT_COMMAND_TIMEOUT,
|
|
297
|
+
check=False,
|
|
298
|
+
)
|
|
299
|
+
|
|
291
300
|
outputs = []
|
|
292
301
|
errors = []
|
|
293
302
|
for target in targets:
|
|
294
303
|
try:
|
|
295
|
-
proc =
|
|
296
|
-
target["command"],
|
|
297
|
-
capture_output=True,
|
|
298
|
-
text=True,
|
|
299
|
-
timeout=DEFAULT_COMMAND_TIMEOUT,
|
|
300
|
-
check=False,
|
|
301
|
-
)
|
|
304
|
+
proc = _run_target_cmd(target["command"])
|
|
302
305
|
if proc.returncode == 0:
|
|
303
306
|
outputs.append(f"{target['name']}: ok")
|
|
304
307
|
else:
|
|
@@ -514,18 +517,21 @@ class ServiceCleaner:
|
|
|
514
517
|
result["output"] = "\n".join(lines)
|
|
515
518
|
return result
|
|
516
519
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
ok = True
|
|
521
|
-
for model in selected:
|
|
522
|
-
proc = subprocess.run(
|
|
523
|
-
["ollama", "rm", model["name"]],
|
|
520
|
+
def _run_ollama_rm(model_name: str) -> subprocess.CompletedProcess:
|
|
521
|
+
return subprocess.run(
|
|
522
|
+
["ollama", "rm", model_name],
|
|
524
523
|
capture_output=True,
|
|
525
524
|
text=True,
|
|
526
525
|
timeout=DEFAULT_COMMAND_TIMEOUT,
|
|
527
526
|
check=False,
|
|
528
527
|
)
|
|
528
|
+
|
|
529
|
+
outputs: list[str] = []
|
|
530
|
+
errors: list[str] = []
|
|
531
|
+
freed_bytes = 0
|
|
532
|
+
ok = True
|
|
533
|
+
for model in selected:
|
|
534
|
+
proc = _run_ollama_rm(model["name"])
|
|
529
535
|
if proc.stdout:
|
|
530
536
|
outputs.append(proc.stdout.strip())
|
|
531
537
|
if proc.returncode != 0:
|