monit-docker 0.0.78__tar.gz → 0.0.80__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.
- {monit_docker-0.0.78/monit_docker.egg-info → monit_docker-0.0.80}/PKG-INFO +5 -2
- {monit_docker-0.0.78 → monit_docker-0.0.80}/README.md +3 -1
- monit_docker-0.0.80/RELEASE +1 -0
- monit_docker-0.0.80/VERSION +1 -0
- monit_docker-0.0.80/docs/architecture-review-2026-09-27.md +188 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/architecture.md +26 -6
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/audit.md +23 -3
- monit_docker-0.0.80/docs/beta-decisions.md +87 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/check-config.md +3 -4
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/config-cli-contract.md +37 -47
- monit_docker-0.0.80/docs/deprecation-policy.md +128 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/http-api-contract.md +23 -23
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/index.rst +5 -0
- monit_docker-0.0.80/docs/installation-upgrades.md +89 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/journal-compatibility.md +3 -0
- monit_docker-0.0.80/docs/performance-resilience.md +128 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/roadmap.md +20 -5
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/scenarios.md +4 -2
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/__init__.py +1 -1
- monit_docker-0.0.80/monit_docker/adapters/audit_http.py +37 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/docker.py +4 -4
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/http.py +36 -21
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/http_routes.py +5 -3
- monit_docker-0.0.80/monit_docker/adapters/http_security.py +40 -0
- monit_docker-0.0.80/monit_docker/adapters/scenarios.py +109 -0
- monit_docker-0.0.80/monit_docker/adapters/selection.py +85 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/validation.py +21 -106
- monit_docker-0.0.80/monit_docker/adapters/validation_rules.py +103 -0
- monit_docker-0.0.80/monit_docker/application.py +80 -0
- monit_docker-0.0.80/monit_docker/application_state.py +61 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/audit.py +45 -1
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/audit_query.py +36 -39
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/cli.py +121 -198
- monit_docker-0.0.80/monit_docker/composition.py +56 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/core/rules.py +2 -2
- monit_docker-0.0.80/monit_docker/job.py +102 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/manual_actions.py +2 -4
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/notification_audit.py +3 -2
- {monit_docker-0.0.78 → monit_docker-0.0.80/monit_docker.egg-info}/PKG-INFO +5 -2
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker.egg-info/SOURCES.txt +17 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker.egg-info/requires.txt +1 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/requirements.txt +1 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/setup.yml +2 -2
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_adapters.py +29 -7
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_api_contract.py +11 -9
- monit_docker-0.0.80/tests/test_application_architecture.py +110 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_audit.py +9 -4
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_audit_query.py +41 -35
- monit_docker-0.0.80/tests/test_audit_stream.py +84 -0
- monit_docker-0.0.80/tests/test_beta_decisions.py +108 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_check_config.py +3 -2
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_cli_contract.py +4 -4
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_docker_integration.py +22 -0
- monit_docker-0.0.80/tests/test_http_service_boundaries.py +150 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_httpdis_transport.py +17 -2
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_journal_compatibility.py +11 -9
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_maintenance.py +5 -4
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_manual_actions.py +11 -9
- monit_docker-0.0.80/tests/test_resilience.py +111 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_restart_limit.py +4 -3
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_scenarios.py +7 -3
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_service.py +7 -3
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_trigger_delay.py +3 -2
- monit_docker-0.0.78/RELEASE +0 -1
- monit_docker-0.0.78/VERSION +0 -1
- monit_docker-0.0.78/monit_docker/adapters/scenarios.py +0 -207
- monit_docker-0.0.78/monit_docker/adapters/selection.py +0 -61
- {monit_docker-0.0.78 → monit_docker-0.0.80}/LICENSE +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/MANIFEST.in +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/bin/monit-docker +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/access-checks.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/alerts.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/audit-migration.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/compose.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/cron.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/dockerhub.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/dwho-http-notifications.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/filesystems.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/grafana.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/healthchecks.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/images/grafana-cpu.png +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/images/grafana-network.png +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/images/grafana-overview.png +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/maintenance.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/metrics.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/notifications.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/pypi.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/redis-notifications.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/restart-limit.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/runtime-checks.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/serve.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/simple.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/supported-environments.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/trigger-delay.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/troubleshooting.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/docs/ui.md +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/grafana/monit-docker.json +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/alertmanager.email-slack.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/alertmanager.email.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/alertmanager.redis.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/alertmanager.slack.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/alerts.runtime.test.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/alerts.runtime.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/alerts.test.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/alerts.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/compose.audit.yaml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/compose.notifications.yaml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/compose.redis.yaml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/compose.yaml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/dwho-http/http.json +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/dwho-http/http.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/dwho-http/payload.json +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/dwho-http/send.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/grafana/dashboards.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/grafana/datasources.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/prometheus-notifications.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/prometheus.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/redis-webhook/Dockerfile +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/redis-webhook/bridge.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/redis-webhook/requirements.txt +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/monitoring/start.sh +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/scenarios.yml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/ui/compose.actions.yaml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/ui/compose.journal.yaml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/ui/compose.yaml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/examples/ui/prepare.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/__main__.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/__init__.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/access.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/configuration.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/events.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/filesystems.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/rules.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/state.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/adapters/syntax.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/audit_forward.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/audit_migrate.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/core/__init__.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/core/engine.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/core/manual.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/core/metrics.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/core/policy.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/domain/__init__.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/domain/errors.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/domain/filesystems.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/domain/maintenance.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/domain/models.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/domain/rules.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/domain/runtime.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/outputs/__init__.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/outputs/formatting.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/outputs/prometheus.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker/service.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker.egg-info/dependency_links.txt +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/monit_docker.egg-info/top_level.txt +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/pyproject.toml +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/setup.cfg +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/setup.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_access.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_access_docker.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_audit_migrate.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_core.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_cron.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_engine.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_filesystem_mode.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_filesystems.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_health.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_monit_docker.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_packaging.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_runtime_checks.py +0 -0
- {monit_docker-0.0.78 → monit_docker-0.0.80}/tests/test_runtime_docker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: monit-docker
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.80
|
|
4
4
|
Summary: monit-docker
|
|
5
5
|
Home-page: https://github.com/decryptus/monit-docker
|
|
6
6
|
Author: Adrien Delle Cave
|
|
@@ -29,6 +29,7 @@ Requires-Dist: pyOpenSSL>=20.0.0
|
|
|
29
29
|
Requires-Dist: PyYAML>=3.10
|
|
30
30
|
Requires-Dist: six>=1.13.0
|
|
31
31
|
Requires-Dist: sonicprobe>=0.3.53
|
|
32
|
+
Requires-Dist: regex>=2024.5.15
|
|
32
33
|
Dynamic: author
|
|
33
34
|
Dynamic: author-email
|
|
34
35
|
Dynamic: classifier
|
|
@@ -61,7 +62,9 @@ Dynamic: summary
|
|
|
61
62
|
|
|
62
63
|
The [configuration and CLI compatibility baseline](docs/config-cli-contract.md)
|
|
63
64
|
records current option precedence, selectors, scenario fields and exit codes,
|
|
64
|
-
with the open decisions to resolve before 1.0.
|
|
65
|
+
with the open decisions to resolve before 1.0. The
|
|
66
|
+
[deprecation and migration policy](docs/deprecation-policy.md) defines advance
|
|
67
|
+
notices, replacements, migration evidence and rollback limits for future changes.
|
|
65
68
|
|
|
66
69
|
The [journal compatibility baseline](docs/journal-compatibility.md) covers retained
|
|
67
70
|
schemas, exports and upgrade/rollback limits without rewriting archives.
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
The [configuration and CLI compatibility baseline](docs/config-cli-contract.md)
|
|
20
20
|
records current option precedence, selectors, scenario fields and exit codes,
|
|
21
|
-
with the open decisions to resolve before 1.0.
|
|
21
|
+
with the open decisions to resolve before 1.0. The
|
|
22
|
+
[deprecation and migration policy](docs/deprecation-policy.md) defines advance
|
|
23
|
+
notices, replacements, migration evidence and rollback limits for future changes.
|
|
22
24
|
|
|
23
25
|
The [journal compatibility baseline](docs/journal-compatibility.md) covers retained
|
|
24
26
|
schemas, exports and upgrade/rollback limits without rewriting archives.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.80
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.80
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Architecture and coding-contract review — 2026-09-27
|
|
2
|
+
|
|
3
|
+
Reviewed commit: `67837c48238c5f62e95e03432d9cc09cf2b5ef2c` on `master`.
|
|
4
|
+
Status: **M1/M2/M3 corrected on this branch; M4/M5 remain open follow-ups**.
|
|
5
|
+
The findings below describe the pinned original snapshot. The follow-up extracts
|
|
6
|
+
neutral JobOptions/scenario validation, composition, MonitoringApplication and
|
|
7
|
+
StateOperations. CLI classes retain input/output and transport startup only.
|
|
8
|
+
State and clock dependencies are injected; no shared service imports the CLI.
|
|
9
|
+
New AST and fresh-process tests exercise composition, cycles, manual cooldown,
|
|
10
|
+
maintenance expiry, restart rearm and dry-run with CLI imports blocked.
|
|
11
|
+
|
|
12
|
+
Local follow-up validation: **341 tests and 504 subtests passed**, including the
|
|
13
|
+
application and transport-independence tests; 15 opt-in Docker integration tests
|
|
14
|
+
were skipped locally. The 50 MiB journal benchmark also completed successfully.
|
|
15
|
+
CI results are recorded on the PR. No Docker daemon action
|
|
16
|
+
was performed locally. The second implementation lot corrects M3: per-server HttpSecurity owns proxy
|
|
17
|
+
secrets/origin/header policy, while AuditQuery carries neutral filters and cursor.
|
|
18
|
+
HTTP parsing/export selection/error status mapping live in adapters/audit_http.py.
|
|
19
|
+
Four additional tests exercise real service operations with transport/CLI imports
|
|
20
|
+
blocked, service-side request validation, per-server secret isolation, and rejection
|
|
21
|
+
of private HTTP access without configured credentials. M4/M5 remain open.
|
|
22
|
+
|
|
23
|
+
## Scope and method
|
|
24
|
+
|
|
25
|
+
The maintainer requires independent business/application services with CLI, HTTP
|
|
26
|
+
and visual interfaces as clients. The review scanned all Python package imports,
|
|
27
|
+
including function-local imports, then traced scenario validation/execution,
|
|
28
|
+
cron/serve composition, manual actions, audit reads, selectors and HTTP routes.
|
|
29
|
+
The web UI's action availability was compared with server-side checks. This is
|
|
30
|
+
an architecture/validation review, not a complete security or capacity audit.
|
|
31
|
+
|
|
32
|
+
Sources were fetched at the pinned commit. Checks used fake collectors and
|
|
33
|
+
test HTTP servers; no Docker daemon operation or production change was made.
|
|
34
|
+
|
|
35
|
+
## Findings
|
|
36
|
+
|
|
37
|
+
### M1 — High: scenario validation and execution go through the CLI
|
|
38
|
+
|
|
39
|
+
[adapters/scenarios.py:126–188](https://github.com/decryptus/monit-docker/blob/67837c48238c5f62e95e03432d9cc09cf2b5ef2c/monit_docker/adapters/scenarios.py#L126-L188)
|
|
40
|
+
imports `monit_docker.cli` inside `validate_scenario` and `run_scenario`.
|
|
41
|
+
`scenario_arguments` turns YAML into argument strings, validation calls
|
|
42
|
+
`cli.argv_parse_check`, and execution calls `cli.main`. The scenario adapter also
|
|
43
|
+
prints results/errors and defines an argparse subclass. `adapters.validation`
|
|
44
|
+
imports the scenario adapter, whose functions import validation helpers back.
|
|
45
|
+
|
|
46
|
+
Thus offline scenario validation needs the command interface, and application
|
|
47
|
+
execution cannot be reused independently of CLI dispatch. This is a Python call
|
|
48
|
+
chain, not a shell invocation or an API launching a terminal. Blocking the CLI
|
|
49
|
+
import reproduces failure for a valid minimal stats scenario before any Docker
|
|
50
|
+
connection.
|
|
51
|
+
|
|
52
|
+
**Correction:** parse YAML and CLI input independently into a validated neutral
|
|
53
|
+
scenario/request model. One application service resolves and runs that model.
|
|
54
|
+
Keep argument construction, output and exit-code mapping in the CLI adapter;
|
|
55
|
+
remove the validation/scenario circular dependency through shared neutral rules.
|
|
56
|
+
|
|
57
|
+
**Acceptance:** validate and execute a scenario with fake adapters while CLI
|
|
58
|
+
imports are blocked; compare behavior with normal CLI execution, including
|
|
59
|
+
selection, policies, dry-run and rendered configuration reuse.
|
|
60
|
+
|
|
61
|
+
### M2 — High: cron/serve application behavior is still owned by CLI classes
|
|
62
|
+
|
|
63
|
+
[cli.py:540–563](https://github.com/decryptus/monit-docker/blob/67837c48238c5f62e95e03432d9cc09cf2b5ef2c/monit_docker/cli.py#L540-L563)
|
|
64
|
+
performs maintenance expiry and its audit lifecycle in `_rule_policy`.
|
|
65
|
+
[cli.py:688–753](https://github.com/decryptus/monit-docker/blob/67837c48238c5f62e95e03432d9cc09cf2b5ef2c/monit_docker/cli.py#L688-L753)
|
|
66
|
+
owns the state-locked monitoring cycle, manual cooldown reservation, restart reset,
|
|
67
|
+
maintenance changes and Docker exception translation. The CLI creates
|
|
68
|
+
`MonitorService(self._cycle, ...)` and `ManualActions(self._manual_action, ...)`.
|
|
69
|
+
|
|
70
|
+
The service and HTTP modules do not import CLI directly, but their configured
|
|
71
|
+
callbacks still execute application logic implemented on CLI command objects.
|
|
72
|
+
A top-level import check therefore misses this coupling. Composition in a process
|
|
73
|
+
entry point is legitimate; maintenance and action-state semantics inside that
|
|
74
|
+
entry point are the part that needs extraction.
|
|
75
|
+
|
|
76
|
+
**Correction:** move cycle/manual-operation orchestration to an application service
|
|
77
|
+
with explicit state, engine, clock, audit and policy inputs. A neutral composition
|
|
78
|
+
module wires it to cron, serve and HTTP. CLI remains responsible for parsing,
|
|
79
|
+
presentation, process launch and exit status.
|
|
80
|
+
|
|
81
|
+
**Acceptance:** direct service and CLI paths give the same cooldown, maintenance,
|
|
82
|
+
restart-budget and audit results without constructing a CLI command object.
|
|
83
|
+
|
|
84
|
+
### M3 — Medium: business services carry HTTP credentials and wire semantics
|
|
85
|
+
|
|
86
|
+
[manual_actions.py:26–34](https://github.com/decryptus/monit-docker/blob/67837c48238c5f62e95e03432d9cc09cf2b5ef2c/monit_docker/manual_actions.py#L26-L34)
|
|
87
|
+
requires/stores browser origin, proxy token and trusted-header mode in the action
|
|
88
|
+
queue. `NotificationAudit` and `AuditReader` also hold HTTP tokens. The HTTP
|
|
89
|
+
handler reaches into these objects to authenticate requests.
|
|
90
|
+
[audit_query.py:37–77](https://github.com/decryptus/monit-docker/blob/67837c48238c5f62e95e03432d9cc09cf2b5ef2c/monit_docker/audit_query.py#L37-L77)
|
|
91
|
+
combines URL query parsing and HTTP-coded errors with reusable journal filtering;
|
|
92
|
+
`AuditReader.page` takes a raw query string.
|
|
93
|
+
|
|
94
|
+
This couples otherwise reusable operations to one transport and makes their
|
|
95
|
+
constructors carry irrelevant secrets for non-HTTP use. No credential disclosure
|
|
96
|
+
or authentication bypass is asserted by this finding.
|
|
97
|
+
|
|
98
|
+
**Correction:** keep secrets, origin/header checks, query decoding, export format
|
|
99
|
+
selection and HTTP status mapping in transport/auth adapters. Pass validated
|
|
100
|
+
filter values and caller identity to services. Keep action authorization,
|
|
101
|
+
selection/protection checks and cursor scope enforcement server-side.
|
|
102
|
+
|
|
103
|
+
**Acceptance:** action, notification and journal operations work with no HTTP
|
|
104
|
+
token or URL input, while existing transport authentication tests still pass.
|
|
105
|
+
|
|
106
|
+
### M4 — Medium: user regex selectors have no execution bound
|
|
107
|
+
|
|
108
|
+
[adapters/selection.py:37–41,54–62](https://github.com/decryptus/monit-docker/blob/67837c48238c5f62e95e03432d9cc09cf2b5ef2c/monit_docker/adapters/selection.py#L37-L62)
|
|
109
|
+
compiles `~` expressions with Python `re` and evaluates them in the monitoring
|
|
110
|
+
process. There is no expression length/work/time bound in this adapter.
|
|
111
|
+
|
|
112
|
+
A selector `~(a+)+$` against the valid name `"a" * 30 + "b"` exceeded a one-second
|
|
113
|
+
deadline in an isolated subprocess; the review harness terminated that process.
|
|
114
|
+
This is a reproducible reliability risk for operator-provided configuration,
|
|
115
|
+
not a claim that untrusted HTTP callers can currently submit selectors. A stuck
|
|
116
|
+
selector prevents its monitoring cycle from progressing.
|
|
117
|
+
|
|
118
|
+
**Correction:** define a bounded selector implementation, explicit failure behavior
|
|
119
|
+
and limits, retaining the documented regex-prefix matching semantics. Merely
|
|
120
|
+
limiting pattern length or moving matching to a Python thread does not establish
|
|
121
|
+
a hard execution bound. Rejected/timed-out selectors must not select everything.
|
|
122
|
+
|
|
123
|
+
**Acceptance:** pathological input terminates within a defined budget; valid exact,
|
|
124
|
+
glob, regex and group selectors keep their documented behavior.
|
|
125
|
+
|
|
126
|
+
### M5 — Low: alias validation and fixed patterns are inconsistent
|
|
127
|
+
|
|
128
|
+
[adapters/validation.py:138–139](https://github.com/decryptus/monit-docker/blob/67837c48238c5f62e95e03432d9cc09cf2b5ef2c/monit_docker/adapters/validation.py#L138-L139)
|
|
129
|
+
uses inline `re.match('^...$', name)`. Python `$` can match before a final newline:
|
|
130
|
+
`CheckedConfiguration._entries({'invalid\n': {'exec': ['restart']}}, 'command')`
|
|
131
|
+
accepts that key. The complete `check_configuration` path later rejects the
|
|
132
|
+
command as an unknown rule alias, so this is an inconsistent intermediate
|
|
133
|
+
validator/diagnostic, not acceptance of an executable invalid configuration.
|
|
134
|
+
|
|
135
|
+
Fixed container-ID/token regexes are also repeated inline in `cli.py` and
|
|
136
|
+
`adapters/state.py`, while `manual_actions.py` has compiled constants; alias grammar
|
|
137
|
+
is repeated across syntax, validation and filesystem definitions. Some fixed field
|
|
138
|
+
sets/mappings remain inside methods. Routes in `http_routes.py` and many existing
|
|
139
|
+
module constants already follow the requested style.
|
|
140
|
+
|
|
141
|
+
**Correction:** neutral shared validation constants/functions, full matching for
|
|
142
|
+
identifiers, uppercase module constants for fixed schemas and mappings. Preserve
|
|
143
|
+
the existing project's alias grammar and selector contract; do not substitute
|
|
144
|
+
another project's naming convention. Dynamic result objects stay local.
|
|
145
|
+
|
|
146
|
+
**Acceptance:** newline, Unicode and length-boundary fixtures agree across relevant
|
|
147
|
+
entry points; existing CLI/API contract tests remain unchanged in meaning.
|
|
148
|
+
|
|
149
|
+
## Positive evidence and limits
|
|
150
|
+
|
|
151
|
+
- `domain/` and `core/` have no CLI, HTTP or Docker imports. The existing
|
|
152
|
+
`test_core_and_domain_import_without_third_party_dependencies` passed using
|
|
153
|
+
Python `-S`. The calculation/rule engine separation is real and worth preserving.
|
|
154
|
+
- HTTPdis routes are centralized in `adapters/http_routes.py`; Sonicprobe provides
|
|
155
|
+
the worker infrastructure. Requests call services, not shell commands or UI.
|
|
156
|
+
- The web UI's disabled buttons are not the sole protection: `ManualActions`
|
|
157
|
+
validates the request/selection/protection and `MonitoringEngine` reselects the
|
|
158
|
+
exact container and checks current state before execution.
|
|
159
|
+
- Local YAML, cron/serve, separate optional UI and English stable error codes
|
|
160
|
+
remain the intended product model. This review requires no Redis/Centrex change.
|
|
161
|
+
|
|
162
|
+
## Verification evidence
|
|
163
|
+
|
|
164
|
+
Targeted Python 3.12 suite: **96 passed, 1 skipped, 102 subtests passed** across
|
|
165
|
+
`test_core`, `test_engine`, `test_service`, `test_scenarios`, `test_check_config`,
|
|
166
|
+
`test_httpdis_transport` and `test_api_contract`. The skipped case requires example
|
|
167
|
+
files not downloaded into the review checkout; it is not counted as a pass.
|
|
168
|
+
Dependency warnings concern deprecated `cgi`/`crypt`. This is not a full Docker
|
|
169
|
+
integration or release validation run.
|
|
170
|
+
|
|
171
|
+
Additional checks: all-package AST imports, callback tracing, blocked-CLI scenario
|
|
172
|
+
validation, the bounded external regex reproduction, intermediate alias validation
|
|
173
|
+
and complete configuration rejection for that same alias.
|
|
174
|
+
|
|
175
|
+
Existing tests protect core independence but do not prevent M1/M2 at the
|
|
176
|
+
application layer. `AGENTS.md` records requirements; automatic enforcement still
|
|
177
|
+
needs to accompany the refactor, not be claimed from documentation alone.
|
|
178
|
+
|
|
179
|
+
## Required correction order
|
|
180
|
+
|
|
181
|
+
1. Extract neutral scenario/request validation and application orchestration
|
|
182
|
+
(M1/M2), with import-blocking and direct-service parity tests.
|
|
183
|
+
2. Separate transport/auth configuration from action/notification/journal services
|
|
184
|
+
(M3), retaining the HTTP contract and server-side checks.
|
|
185
|
+
3. Bound selectors and centralize validation/constants (M4/M5), with regression
|
|
186
|
+
cases for timeout, matching semantics and newline boundaries.
|
|
187
|
+
4. Extend architecture enforcement beyond core/domain, including lazy calls and
|
|
188
|
+
callback ownership. Update `architecture.md` to describe the corrected layers.
|
|
@@ -8,7 +8,8 @@ used from cron, a local HTTP server, or an external control plane.
|
|
|
8
8
|
|
|
9
9
|
```mermaid
|
|
10
10
|
flowchart TD
|
|
11
|
-
CLI["Interfaces: CLI and HTTP"] -->
|
|
11
|
+
CLI["Interfaces: CLI and HTTP"] --> App["Application services"]
|
|
12
|
+
App --> Core["Core: cycles, rules, decisions"]
|
|
12
13
|
Core --> Domain["Domain models"]
|
|
13
14
|
Adapters["Docker, YAML, state adapters"] --> Domain
|
|
14
15
|
CLI --> Adapters
|
|
@@ -64,8 +65,26 @@ The original application was a single executable. Refactoring is incremental:
|
|
|
64
65
|
|
|
65
66
|
## Current implementation and remaining work
|
|
66
67
|
|
|
67
|
-
`cli.py`
|
|
68
|
-
|
|
68
|
+
`cli.py` handles argument parsing, presentation, PID files and exit codes.
|
|
69
|
+
`composition.py` assembles validated `JobOptions`, adapters and the application.
|
|
70
|
+
YAML scenarios produce the same neutral job values without argparse or CLI calls.
|
|
71
|
+
`MonitoringApplication` owns monitoring cycles and manual-action orchestration,
|
|
72
|
+
with injected state and clock; `StateOperations` owns offline maintenance and
|
|
73
|
+
restart rearming. HTTP scheduler callbacks are bound to the application instance.
|
|
74
|
+
|
|
75
|
+
HTTP credentials, browser origin and trusted-header mode are owned by a per-server
|
|
76
|
+
`HttpSecurity` value. `ManualActions`, `NotificationAudit` and `AuditReader` take
|
|
77
|
+
no transport credentials. Private HTTP operations reject requests if their server
|
|
78
|
+
has no corresponding secret, even when the underlying service is available.
|
|
79
|
+
|
|
80
|
+
`AuditReader.page(AuditQuery(filters, cursor), actor)` validates application filters
|
|
81
|
+
and returns a page dictionary; its `QueryError` exposes a domain reason. The
|
|
82
|
+
`adapters/audit_http.py` adapter alone decodes URL queries, chooses an export format
|
|
83
|
+
and maps reasons to HTTP status codes. Cursor scope still binds filters and caller
|
|
84
|
+
identity. Existing HTTP routes, response envelopes and error codes are unchanged.
|
|
85
|
+
|
|
86
|
+
Dynamic selector bounds and shared validation cleanup remain M4/M5 in the dated
|
|
87
|
+
review. They are separate from the interface extraction.
|
|
69
88
|
|
|
70
89
|
- `core/engine.py` coordinates a cycle and preserves the two-phase rule order.
|
|
71
90
|
- `core/rules.py` evaluates conditions against snapshots, without Docker or CLI imports.
|
|
@@ -199,9 +218,9 @@ lifecycle changes are:
|
|
|
199
218
|
- invalid non-mapping configuration reports 110;
|
|
200
219
|
- resources are released deterministically, including on errors.
|
|
201
220
|
|
|
202
|
-
The
|
|
203
|
-
|
|
204
|
-
|
|
221
|
+
The extraction initially preserved the historical chained-comparison bug. The
|
|
222
|
+
[approved beta changes](beta-decisions.md) correct the left operand order to
|
|
223
|
+
match Python. Memory accounting is unchanged.
|
|
205
224
|
|
|
206
225
|
Tests cover repeated cycles, replacement containers, selectors, configuration
|
|
207
226
|
imports, rule semantics, action failure, stream exhaustion and cleanup. Core and
|
|
@@ -261,3 +280,4 @@ queue does not promise exactly-once execution across process restarts.
|
|
|
261
280
|
The component is Community-only single-host software. A future commercial
|
|
262
281
|
control plane is still a separate process/product for fleet management, teams
|
|
263
282
|
and long-term history; it must use the versioned protocol as well.
|
|
283
|
+
|
|
@@ -61,7 +61,7 @@ visible escapes back into controls or formulas.
|
|
|
61
61
|
|
|
62
62
|
Schema 1 journals remain readable: values are converted to schema 2 in memory
|
|
63
63
|
without rewriting archives. Schema 2 records are validated, not escaped again.
|
|
64
|
-
New exporters must consume `AuditJournal.read()` / `prepare_record()` output and
|
|
64
|
+
New exporters must consume `AuditJournal.iter_records()` / `AuditJournal.read()` / `prepare_record()` output and
|
|
65
65
|
preserve these values. Continue using the target format's serializer (for example,
|
|
66
66
|
`csv.DictWriter`); this common policy does not replace HTML or other contextual
|
|
67
67
|
escaping required by a destination.
|
|
@@ -306,8 +306,8 @@ snapshot. Externally rewriting/truncating journal files is unsupported.
|
|
|
306
306
|
`GET /v1/audit/export` with its page cursor and filters. It preserves the common
|
|
307
307
|
escaped text representation. This bounds browser memory and server response size;
|
|
308
308
|
use administrative `audit-export` for a complete retained-history export. The
|
|
309
|
-
|
|
310
|
-
not
|
|
309
|
+
CLI full export now uses a validated streaming snapshot; web page limits do
|
|
310
|
+
not limit the full CLI export. An expired snapshot must be refreshed before export.
|
|
311
311
|
|
|
312
312
|
The regression suite checks rotation, malformed files, filter/cursor tampering,
|
|
313
313
|
proxy identity replacement, writer progress during reads and browser error states.
|
|
@@ -326,3 +326,23 @@ character-by-character work while preserving the canonical escaping rules.
|
|
|
326
326
|
Compiled regular expressions process escape sequences and ASCII control runs;
|
|
327
327
|
printable Unicode is preserved, with detailed checks limited to unusual Unicode
|
|
328
328
|
runs. Malformed and noncanonical escape sequences are still rejected.
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
### Full CLI export memory and consistency
|
|
332
|
+
|
|
333
|
+
`audit-export` opens the retained files under the journal lock, captures their
|
|
334
|
+
sizes, then releases the lock. It validates every record before writing output
|
|
335
|
+
and rereads the same descriptors to export incrementally, oldest first. JSONL/CSV
|
|
336
|
+
encoding and category/date filters remain unchanged. Memory is bounded by record
|
|
337
|
+
size and the configured number of retained files, not total journal bytes.
|
|
338
|
+
|
|
339
|
+
Cooperating appends after capture are excluded; rotations do not change the open
|
|
340
|
+
snapshot. Slow output does not hold the writer lock. Descriptors close on success,
|
|
341
|
+
errors or an interrupted consumer. A truncated, invalid or oversized record is
|
|
342
|
+
rejected during validation before output. External in-place edits of journal
|
|
343
|
+
files are unsupported; do not edit/truncate them during export. Output-device or
|
|
344
|
+
second-pass read errors can still leave partial output: always check exit status
|
|
345
|
+
and use a temporary destination before renaming an export into place.
|
|
346
|
+
|
|
347
|
+
`AuditJournal.read()` remains the materialized compatibility API. `audit-send`
|
|
348
|
+
retains its existing batch forwarding behavior. The paginated HTTP API is unchanged.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Beta behavior cleanup — approved 2026-09-27
|
|
2
|
+
|
|
3
|
+
Status: **introduced in 0.0.80**, following 0.0.79. This is an explicit maintainer-approved
|
|
4
|
+
beta adjustment, not a frozen 1.0 contract or an additional API version. The
|
|
5
|
+
maintainer chose to correct these behaviors now rather than preserve accidental
|
|
6
|
+
semantics through an extra notice release. No deployment or data-upgrade rehearsal
|
|
7
|
+
is claimed by this document.
|
|
8
|
+
|
|
9
|
+
## Configuration and target selection
|
|
10
|
+
|
|
11
|
+
- All monitoring modes and scenario inspection/execution validate the entire
|
|
12
|
+
YAML configuration, including dormant aliases and scenarios, before Docker
|
|
13
|
+
access. Unknown sections/fields, malformed imports and invalid values fail
|
|
14
|
+
with configuration error 110. Missing configuration remains permitted for simple
|
|
15
|
+
CLI-only monitoring; `check-config`, `scenario` and `run` still require a source.
|
|
16
|
+
- A named but unknown Docker client fails, including when `--client-from-env` is
|
|
17
|
+
supplied. Omitting `--client` retains normal default selection; a valid name
|
|
18
|
+
with explicit `--client-from-env` still uses the environment.
|
|
19
|
+
- Selected groups form a union. Direct name/ID/image/label patterns form another
|
|
20
|
+
union. If both are present, their intersection is selected; status is an
|
|
21
|
+
additional filter. This is identical in CLI and YAML scenarios.
|
|
22
|
+
- Commas never split selector values. Replace `--name 'web-*,api-*'` with
|
|
23
|
+
`--name 'web-*' --name 'api-*'`, or YAML `name: ['web-*', 'api-*']`.
|
|
24
|
+
A regex such as `~worker-[0-9]{1,3}$` is now preserved directly.
|
|
25
|
+
Membership conditions such as `status in (running,paused)` are unaffected.
|
|
26
|
+
- Selector regexes retain Python syntax checking and start matching. Bounded
|
|
27
|
+
matching uses the `regex` dependency (VERSION0), with 50 ms per comparison and
|
|
28
|
+
a 4096-character pattern limit. Timeout or rejection is an error, not an
|
|
29
|
+
unrestricted selection. This does not bound total monitoring-cycle duration.
|
|
30
|
+
|
|
31
|
+
Example: `--ctn-group production --name 'web-*'` now chooses web containers in
|
|
32
|
+
production. Previously the direct name filter was ignored. Removing the direct
|
|
33
|
+
filter restores group-only selection if that is what the operator intended.
|
|
34
|
+
|
|
35
|
+
## Chained comparisons
|
|
36
|
+
|
|
37
|
+
`10 < cpu_percent < 90` now means `10 < cpu_percent and cpu_percent < 90`, as in
|
|
38
|
+
Python. Previously the first comparison was reversed (`cpu_percent < 10`). This
|
|
39
|
+
bug was reproduced from the first available 2019 commit and from 0.0.50 (2023).
|
|
40
|
+
The fix applies to inline and aliased conditions, supported numerical resources
|
|
41
|
+
and byte-unit bounds. Equality, inequality, inclusive/exclusive bounds and
|
|
42
|
+
ascending/descending comparisons keep their written operand order.
|
|
43
|
+
|
|
44
|
+
Review existing chained rules: their matching set may change. To intentionally
|
|
45
|
+
preserve the former example's behavior, use a condition alias containing
|
|
46
|
+
`cpu_percent < 10` and `cpu_percent < 90`. Do not assume the fix merely changes
|
|
47
|
+
presentation: it can change which actions execute.
|
|
48
|
+
|
|
49
|
+
## HTTP
|
|
50
|
+
|
|
51
|
+
- `/v1` stays in place; there is no `/v2` or new authentication mechanism.
|
|
52
|
+
- Actions and notifications both accept a single JSON content-type header with
|
|
53
|
+
optional parameters. The body remains UTF-8; duplicate headers are rejected.
|
|
54
|
+
- Supported but incorrect methods on active known routes return 405 and `Allow`.
|
|
55
|
+
- Unknown/noncanonical paths and disabled protected capabilities return 404.
|
|
56
|
+
Trailing slashes, duplicate path separators and encoded path aliases are not
|
|
57
|
+
supported aliases. OPTIONS remains disabled; no CORS endpoint is added.
|
|
58
|
+
- Existing authentication, body limits and action authorization remain enforced.
|
|
59
|
+
|
|
60
|
+
Clients that expect 404 for GET on an active `/v1/actions` must handle 405. Clients
|
|
61
|
+
that expect 405 for disabled actions/notifications must now handle 404. API field
|
|
62
|
+
names/types and persisted data schemas are unchanged by this cleanup.
|
|
63
|
+
|
|
64
|
+
## Deployment review
|
|
65
|
+
|
|
66
|
+
Before applying this beta version, run `check-config` with the new version against
|
|
67
|
+
copies of each configuration; review group/direct combinations, comma-separated
|
|
68
|
+
selectors and chained expressions. Use `stats` to inspect target selection, then
|
|
69
|
+
`--dry-run` for rules before enabling actions. Fix dormant invalid entries too.
|
|
70
|
+
|
|
71
|
+
Retain the previous image/package and configuration. A rollback to 0.0.79 restores
|
|
72
|
+
its old selection/comparison behavior, so restore/review matching configuration as
|
|
73
|
+
well. This change does not rewrite state or audit data, reset counters or replay
|
|
74
|
+
actions. Cross-version backup/rollback rehearsals remain a separate roadmap task.
|
|
75
|
+
|
|
76
|
+
## Scope and verification
|
|
77
|
+
|
|
78
|
+
Keep standalone local YAML, existing DWho/HTTPdis/Sonicprobe foundations, and no
|
|
79
|
+
extra login for local CLI usage. Centrex and its proposed shared library remain
|
|
80
|
+
outside this release.
|
|
81
|
+
|
|
82
|
+
Regression coverage compares every supported comparison-operator pair against
|
|
83
|
+
Python, tests unit bounds/aliases, selection intersection and comma preservation,
|
|
84
|
+
strict offline/runtime validation, unknown clients, regex failure bounds, HTTP
|
|
85
|
+
methods/paths/content types and application composition without CLI imports.
|
|
86
|
+
Docker integration and deployment checks remain required CI/release evidence;
|
|
87
|
+
local fake-adapter tests do not substitute for real Docker tests.
|
|
@@ -42,7 +42,7 @@ An empty mapping (`{}`) is valid; an empty file, `null` or a list is not.
|
|
|
42
42
|
- Existing import directives, relative file paths and Mako rendering. The same
|
|
43
43
|
import scope and override behavior as the runtime is used.
|
|
44
44
|
- Client configuration mappings and basic TLS shape; explicit client names.
|
|
45
|
-
|
|
45
|
+
An explicitly unknown `--client` always fails, even with `--client-from-env`.
|
|
46
46
|
- Every group match and regular expression, CLI selectors and selected group names.
|
|
47
47
|
- Every command/condition alias, supported Docker action, action argument shape,
|
|
48
48
|
rule syntax, resource name, unit conversion and condition value conversion.
|
|
@@ -55,9 +55,8 @@ entry or supplied rule; YAML syntax errors also include line and column numbers.
|
|
|
55
55
|
Messages avoid dumping rendered configuration, command contents and credentials.
|
|
56
56
|
Fix the reported error and rerun to reveal any later errors.
|
|
57
57
|
|
|
58
|
-
Checks
|
|
59
|
-
|
|
60
|
-
are unchanged, except for the scenario validation correction noted above.
|
|
58
|
+
Checks and monitoring execution now use the same strict validation, including
|
|
59
|
+
dormant entries. See [beta changes](beta-decisions.md).
|
|
61
60
|
|
|
62
61
|
See the [configuration and CLI contract](config-cli-contract.md) for precedence,
|
|
63
62
|
selection semantics and the remaining compatibility decisions before 1.0.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Configuration and CLI compatibility contract
|
|
2
2
|
|
|
3
|
-
**Status:
|
|
3
|
+
**Status: beta baseline, including the 0.0.80 decisions approved on 2026-09-27.** This reference
|
|
4
4
|
records the current public behavior and the decisions still needed before 1.0.
|
|
5
5
|
It does not declare the HTTP API, metrics or journal schema stable. Follow the
|
|
6
6
|
[roadmap](roadmap.md) for the complete release criteria.
|
|
@@ -26,9 +26,10 @@ monit-docker -c config.yml run web-guard --dry-run
|
|
|
26
26
|
|
|
27
27
|
The root must be a YAML mapping. `{}` is valid; an empty document, `null` or a
|
|
28
28
|
list is not. The checked loader requires string keys and mapping-valued sections.
|
|
29
|
-
It rejects unknown sections and entry fields.
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
It rejects unknown sections and entry fields. Every monitoring command validates all configured aliases and scenarios, including
|
|
30
|
+
dormant entries, before Docker access. Configuration errors return 110. The file
|
|
31
|
+
is rendered once; runtime and offline checks use the same validation. See the
|
|
32
|
+
[beta change notice](beta-decisions.md) before upgrading.
|
|
32
33
|
|
|
33
34
|
| Section | Entry structure | Meaning |
|
|
34
35
|
| --- | --- | --- |
|
|
@@ -74,17 +75,17 @@ Linux container; see [access checks](access-checks.md) for runtime restrictions.
|
|
|
74
75
|
Otherwise, `--client NAME` selects an entry, or the first loaded client is used.
|
|
75
76
|
With no configured clients the historical runtime uses Docker environment
|
|
76
77
|
settings, defaulting `DOCKER_HOST` to `unix:///var/run/docker.sock` when absent.
|
|
77
|
-
An
|
|
78
|
-
|
|
78
|
+
An explicitly named unknown client is always rejected, even if `--client-from-env`
|
|
79
|
+
is also supplied. With a known name, `--client-from-env` still selects the environment.
|
|
79
80
|
|
|
80
81
|
## Container selectors
|
|
81
82
|
|
|
82
83
|
| Input | Current behavior |
|
|
83
84
|
| --- | --- |
|
|
84
|
-
| `--name`, `--id`, `--image`, `--label` | Repeatable;
|
|
85
|
+
| `--name`, `--id`, `--image`, `--label` | Repeatable; one pattern per value, surrounding whitespace removed; commas are never separators |
|
|
85
86
|
| Several patterns or kinds | OR: any name, ID, image tag or label value can select the container |
|
|
86
87
|
| `-s STATUS` | Repeatable status alternatives, applied in addition to the pattern selection |
|
|
87
|
-
| `--ctn-group NAME` | Repeatable exact group names; their patterns form a union
|
|
88
|
+
| `--ctn-group NAME` | Repeatable exact group names; their patterns form a union, intersected with the union of direct name/ID/image/label patterns when supplied |
|
|
88
89
|
| No patterns/groups | All containers allowed by the status filter, including stopped containers |
|
|
89
90
|
| Ordinary pattern | Case-sensitive shell-style glob, matching the whole value |
|
|
90
91
|
| `~EXPRESSION` | Case-sensitive Python regular expression matched from the start; add `$` for an end anchor or `.*` for a leading search |
|
|
@@ -92,19 +93,17 @@ legacy discrepancy under [open decisions](#open-decisions-before-10).
|
|
|
92
93
|
| Label pattern | Matches label **values**, not keys or Docker's `key=value` filter syntax |
|
|
93
94
|
| Image pattern | Matches image tags, not image IDs/digests |
|
|
94
95
|
|
|
95
|
-
Quote patterns to prevent shell expansion.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
Quote patterns to prevent shell expansion. Repeat options for several patterns:
|
|
97
|
+
`--name 'web-*' --name 'api-*'`. YAML uses a list. Regex quantifiers such as
|
|
98
|
+
`--name '~worker-[0-9]{1,3}$'` remain intact. Group matches and direct patterns
|
|
99
|
+
use the same matching semantics; `-s` or `select.status` is an additional filter.
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
A pattern is at most 4096 characters. Regex syntax is checked with Python `re`;
|
|
102
|
+
matching uses `regex` VERSION0 with a 50 ms limit per pattern/value comparison.
|
|
103
|
+
Invalid, oversized or timed-out patterns fail explicitly, never selecting all
|
|
104
|
+
containers as a fallback. This is not a total cycle deadline. Globs retain
|
|
105
|
+
case-sensitive whole-value matching; regexes retain start-of-value matching.
|
|
105
106
|
|
|
106
|
-
Use `--ctn-group workers`, or scenario `select: {group: workers}`. Group matches
|
|
107
|
-
do not support status expressions; use `-s` or scenario `select.status`.
|
|
108
107
|
An empty result is error 114, not a successful no-op. Container iteration order
|
|
109
108
|
comes from Docker and is not promised to be sorted.
|
|
110
109
|
|
|
@@ -154,8 +153,9 @@ group. Separate groups and ordinary conditions are combined with AND.
|
|
|
154
153
|
Rules requiring only status/PID/health run before metric-dependent rules, even
|
|
155
154
|
when their CLI order is interleaved. Within each phase, input order is preserved.
|
|
156
155
|
Metric rules only run when the container is running or paused. This two-phase
|
|
157
|
-
behavior
|
|
158
|
-
|
|
156
|
+
behavior remains when converting commands into scenarios. Chained numeric
|
|
157
|
+
comparisons follow Python operand order: `10 < cpu_percent < 90` means
|
|
158
|
+
`10 < cpu_percent and cpu_percent < 90`. Bounds can include supported byte units.
|
|
159
159
|
|
|
160
160
|
## Subcommands and outputs
|
|
161
161
|
|
|
@@ -198,8 +198,7 @@ The first action failure aborts the remaining actions and containers.
|
|
|
198
198
|
Errors contain `location` and `message`; validation stops at the first error.
|
|
199
199
|
Summary counts `clients`, `groups`, `commands`, `conditions`, `rules`, plus
|
|
200
200
|
`scenarios` when present. It validates dormant aliases/groups/scenarios as well
|
|
201
|
-
as supplied rules. `scenario list
|
|
202
|
-
validate the selected scenario after checking configuration shapes. Their
|
|
201
|
+
as supplied rules. `scenario list`, `show` and `run` validate all configured scenarios and aliases. Their
|
|
203
202
|
configuration errors go to stderr and return 110.
|
|
204
203
|
|
|
205
204
|
These inspection commands do not connect to Docker or create agent state/log
|
|
@@ -237,7 +236,7 @@ Scenario mode defaults to `cron`. All modes allow `mode`, `description`,
|
|
|
237
236
|
`select` or `all: true`, `client`, `client-from-env`, `event-window`, `audit-file`,
|
|
238
237
|
`audit-max-bytes`, `audit-files`. Selection fields are `name`, `id`, `image`,
|
|
239
238
|
`label`, `group`, `status`, each a string or nonempty string list. Choose `select`
|
|
240
|
-
or `all: true`, exclusively. Group selection
|
|
239
|
+
or `all: true`, exclusively. Group selection intersects direct patterns; status is applied in addition.
|
|
241
240
|
|
|
242
241
|
| Mode | Additional fields |
|
|
243
242
|
| --- | --- |
|
|
@@ -294,33 +293,24 @@ Use an exact container selector for a process-status check. `--propagate-exit-co
|
|
|
294
293
|
in `monit`/`cron` returns a failed completed exec's 1..255 status instead of 116;
|
|
295
294
|
it can overlap every other status family. Check command mode and diagnostics.
|
|
296
295
|
|
|
297
|
-
##
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
`cpu_percent < 90`; do not reinterpret existing expressions without migration.
|
|
311
|
-
- Resolve Python support metadata: CI currently covers Python 3.10/3.12, while
|
|
312
|
-
package metadata still advertises older interpreters that this code cannot run on.
|
|
313
|
-
- Define the supported Docker/platform matrix, deprecation process and migration
|
|
314
|
-
policy; separately review HTTP fields, metrics and journal schema compatibility.
|
|
315
|
-
|
|
316
|
-
No internal Python class, diagnostic wording, implicit argparse abbreviation,
|
|
317
|
-
Docker enumeration order or undocumented YAML behavior is declared a stable API
|
|
318
|
-
by this baseline. Existing DWho, HTTPdis and Sonicprobe foundations remain in use.
|
|
296
|
+
## Beta decisions and 1.0 status
|
|
297
|
+
|
|
298
|
+
The five CLI/YAML choices were approved on 2026-09-27: shared strict validation,
|
|
299
|
+
unknown-client rejection, group/direct intersection, literal selector commas,
|
|
300
|
+
and Python-order chained comparisons. Their implementation is included in 0.0.80;
|
|
301
|
+
see [migration examples and limits](beta-decisions.md).
|
|
302
|
+
|
|
303
|
+
These decisions do not complete the installation, upgrade, resilience or
|
|
304
|
+
stabilization milestones. Local YAML remains the configuration model; the local
|
|
305
|
+
CLI adds no login. Protected remote access retains its authentication.
|
|
306
|
+
|
|
307
|
+
Internal Python classes, diagnostic wording, implicit argparse abbreviations,
|
|
308
|
+
Docker enumeration order and undocumented YAML behavior are not stable APIs.
|
|
319
309
|
|
|
320
310
|
## Verification
|
|
321
311
|
|
|
322
312
|
`test_cli_contract.py` covers target selection, label values/image tags, regular
|
|
323
|
-
expression boundaries, group
|
|
313
|
+
expression boundaries, group/direct intersection, import replacement, client precedence
|
|
324
314
|
and option placement. `test_scenarios.py` covers scenario overrides, offline
|
|
325
315
|
inspection, single rendering, state continuity and access-resource validation.
|
|
326
316
|
Existing `test_check_config.py`, `test_monit_docker.py`, `test_cron.py`,
|