monit-docker 1.1.4__tar.gz → 1.2.0__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.
Files changed (212) hide show
  1. {monit_docker-1.1.4/monit_docker.egg-info → monit_docker-1.2.0}/PKG-INFO +6 -6
  2. {monit_docker-1.1.4 → monit_docker-1.2.0}/README.md +4 -4
  3. monit_docker-1.2.0/RELEASE +1 -0
  4. monit_docker-1.2.0/VERSION +1 -0
  5. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/audit.md +8 -3
  6. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/compose-quickstart-fr.md +35 -2
  7. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/compose-quickstart.md +33 -2
  8. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/compose.md +18 -1
  9. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/config-cli-contract.md +3 -2
  10. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/cron.md +12 -1
  11. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/http-api-contract.md +13 -3
  12. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/index.rst +1 -0
  13. monit_docker-1.2.0/docs/release-1.2.0.md +14 -0
  14. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/roadmap.md +4 -0
  15. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/compose.yaml +1 -1
  16. monit_docker-1.2.0/examples/socket-proxy/Dockerfile +10 -0
  17. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/ui/compose.journal.yaml +2 -2
  18. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/ui/compose.yaml +2 -2
  19. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/__init__.py +1 -1
  20. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/docker.py +48 -8
  21. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/filesystems.py +8 -1
  22. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/http.py +19 -12
  23. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/http_routes.py +1 -1
  24. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/http_security.py +8 -2
  25. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/rules.py +4 -0
  26. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/audit_query.py +1 -1
  27. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/cli.py +5 -3
  28. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/core/engine.py +3 -2
  29. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/domain/errors.py +7 -0
  30. {monit_docker-1.1.4 → monit_docker-1.2.0/monit_docker.egg-info}/PKG-INFO +6 -6
  31. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker.egg-info/SOURCES.txt +3 -0
  32. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker.egg-info/requires.txt +1 -1
  33. {monit_docker-1.1.4 → monit_docker-1.2.0}/requirements.txt +1 -1
  34. {monit_docker-1.1.4 → monit_docker-1.2.0}/setup.yml +2 -2
  35. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_api_contract.py +53 -1
  36. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_audit.py +29 -1
  37. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_audit_query.py +21 -0
  38. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_cli_contract.py +11 -2
  39. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_docker_integration.py +17 -0
  40. monit_docker-1.2.0/tests/test_http_token_separation.py +25 -0
  41. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_monit_docker.py +13 -0
  42. monit_docker-1.1.4/RELEASE +0 -1
  43. monit_docker-1.1.4/VERSION +0 -1
  44. {monit_docker-1.1.4 → monit_docker-1.2.0}/LICENSE +0 -0
  45. {monit_docker-1.1.4 → monit_docker-1.2.0}/MANIFEST.in +0 -0
  46. {monit_docker-1.1.4 → monit_docker-1.2.0}/bin/monit-docker +0 -0
  47. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/access-checks.md +0 -0
  48. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/alerts.md +0 -0
  49. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/architecture-review-2026-09-27.md +0 -0
  50. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/architecture.md +0 -0
  51. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/audit-migration.md +0 -0
  52. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/beta-decisions.md +0 -0
  53. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/check-config.md +0 -0
  54. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/configuration-validation.md +0 -0
  55. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/contributing.md +0 -0
  56. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/contributors.rst +0 -0
  57. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/deprecation-policy.md +0 -0
  58. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/dwho-http-notifications.md +0 -0
  59. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/filesystems.md +0 -0
  60. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/grafana.md +0 -0
  61. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/healthchecks.md +0 -0
  62. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/images/grafana-cpu.png +0 -0
  63. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/images/grafana-network.png +0 -0
  64. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/images/grafana-overview.png +0 -0
  65. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/images/terminal-containers.png +0 -0
  66. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/images/terminal-details.png +0 -0
  67. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/images/terminal-journal.png +0 -0
  68. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/images/textual-containers.png +0 -0
  69. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/images/textual-journal.png +0 -0
  70. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/images/textual-unavailable.png +0 -0
  71. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/installation-upgrades.md +0 -0
  72. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/journal-compatibility.md +0 -0
  73. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/maintenance.md +0 -0
  74. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/metrics.md +0 -0
  75. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/notifications.md +0 -0
  76. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/performance-resilience.md +0 -0
  77. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/redis-notifications.md +0 -0
  78. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/release-1.0.0.md +0 -0
  79. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/release-1.0.1.md +0 -0
  80. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/release-1.1.0.md +0 -0
  81. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/release-1.1.1.md +0 -0
  82. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/release-1.1.2.md +0 -0
  83. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/release-1.1.3.md +0 -0
  84. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/release-1.1.4.md +0 -0
  85. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/restart-limit.md +0 -0
  86. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/runtime-checks.md +0 -0
  87. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/scenarios.md +0 -0
  88. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/serve.md +0 -0
  89. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/shared-terminal.md +0 -0
  90. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/simple.md +0 -0
  91. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/supported-environments.md +0 -0
  92. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/terminal.md +0 -0
  93. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/textual-review.md +0 -0
  94. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/textual.md +0 -0
  95. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/trigger-delay.md +0 -0
  96. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/troubleshooting.md +0 -0
  97. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/tutorial-memory.md +0 -0
  98. {monit_docker-1.1.4 → monit_docker-1.2.0}/docs/ui.md +0 -0
  99. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/grafana/monit-docker.json +0 -0
  100. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/alertmanager.email-slack.yml +0 -0
  101. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/alertmanager.email.yml +0 -0
  102. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/alertmanager.redis.yml +0 -0
  103. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/alertmanager.slack.yml +0 -0
  104. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/alerts.runtime.test.yml +0 -0
  105. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/alerts.runtime.yml +0 -0
  106. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/alerts.test.yml +0 -0
  107. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/alerts.yml +0 -0
  108. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/compose.audit.yaml +0 -0
  109. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/compose.notifications.yaml +0 -0
  110. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/compose.redis.yaml +0 -0
  111. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/dwho-http/http.json +0 -0
  112. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/dwho-http/http.yml +0 -0
  113. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/dwho-http/payload.json +0 -0
  114. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/dwho-http/send.py +0 -0
  115. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/grafana/dashboards.yml +0 -0
  116. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/grafana/datasources.yml +0 -0
  117. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/prometheus-notifications.yml +0 -0
  118. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/prometheus.yml +0 -0
  119. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/redis-webhook/Dockerfile +0 -0
  120. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/redis-webhook/bridge.py +0 -0
  121. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/redis-webhook/requirements.txt +0 -0
  122. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/monitoring/start.sh +0 -0
  123. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/scenarios.yml +0 -0
  124. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/tutorial-memory/compose.yaml +0 -0
  125. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/tutorial-memory/monit-docker.yml +0 -0
  126. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/tutorial-memory/worker.py +0 -0
  127. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/ui/compose.actions.yaml +0 -0
  128. {monit_docker-1.1.4 → monit_docker-1.2.0}/examples/ui/prepare.py +0 -0
  129. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/__main__.py +0 -0
  130. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/__init__.py +0 -0
  131. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/access.py +0 -0
  132. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/audit_http.py +0 -0
  133. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/configuration.py +0 -0
  134. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/events.py +0 -0
  135. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/scenarios.py +0 -0
  136. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/selection.py +0 -0
  137. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/state.py +0 -0
  138. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/stats.py +0 -0
  139. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/syntax.py +0 -0
  140. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/validation.py +0 -0
  141. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/adapters/validation_rules.py +0 -0
  142. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/application.py +0 -0
  143. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/application_state.py +0 -0
  144. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/audit.py +0 -0
  145. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/audit_forward.py +0 -0
  146. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/audit_migrate.py +0 -0
  147. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/cli_audit.py +0 -0
  148. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/composition.py +0 -0
  149. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/core/__init__.py +0 -0
  150. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/core/manual.py +0 -0
  151. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/core/metrics.py +0 -0
  152. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/core/policy.py +0 -0
  153. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/core/rules.py +0 -0
  154. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/domain/__init__.py +0 -0
  155. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/domain/filesystems.py +0 -0
  156. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/domain/identifiers.py +0 -0
  157. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/domain/maintenance.py +0 -0
  158. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/domain/models.py +0 -0
  159. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/domain/rules.py +0 -0
  160. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/domain/runtime.py +0 -0
  161. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/job.py +0 -0
  162. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/manual_actions.py +0 -0
  163. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/notification_audit.py +0 -0
  164. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/observation.py +0 -0
  165. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/outputs/__init__.py +0 -0
  166. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/outputs/formatting.py +0 -0
  167. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/outputs/prometheus.py +0 -0
  168. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/service.py +0 -0
  169. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/textual_demo.py +0 -0
  170. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/textual_tui.py +0 -0
  171. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker/tui.py +0 -0
  172. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker.egg-info/dependency_links.txt +0 -0
  173. {monit_docker-1.1.4 → monit_docker-1.2.0}/monit_docker.egg-info/top_level.txt +0 -0
  174. {monit_docker-1.1.4 → monit_docker-1.2.0}/pyproject.toml +0 -0
  175. {monit_docker-1.1.4 → monit_docker-1.2.0}/scripts/capture_textual.py +0 -0
  176. {monit_docker-1.1.4 → monit_docker-1.2.0}/setup.cfg +0 -0
  177. {monit_docker-1.1.4 → monit_docker-1.2.0}/setup.py +0 -0
  178. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_access.py +0 -0
  179. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_access_docker.py +0 -0
  180. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_adapters.py +0 -0
  181. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_application_architecture.py +0 -0
  182. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_audit_migrate.py +0 -0
  183. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_audit_stream.py +0 -0
  184. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_beta_decisions.py +0 -0
  185. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_check_config.py +0 -0
  186. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_configuration_schema.py +0 -0
  187. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_core.py +0 -0
  188. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_cron.py +0 -0
  189. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_engine.py +0 -0
  190. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_filesystem_mode.py +0 -0
  191. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_filesystems.py +0 -0
  192. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_health.py +0 -0
  193. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_http_service_boundaries.py +0 -0
  194. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_httpdis_transport.py +0 -0
  195. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_journal_compatibility.py +0 -0
  196. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_maintenance.py +0 -0
  197. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_manual_actions.py +0 -0
  198. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_packaging.py +0 -0
  199. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_resilience.py +0 -0
  200. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_restart_limit.py +0 -0
  201. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_rule_literals.py +0 -0
  202. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_runtime_checks.py +0 -0
  203. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_runtime_docker.py +0 -0
  204. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_scenarios.py +0 -0
  205. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_service.py +0 -0
  206. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_stats_timeouts.py +0 -0
  207. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_stats_transport.py +0 -0
  208. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_terminal_docker.py +0 -0
  209. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_terminal_signals.py +0 -0
  210. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_trigger_delay.py +0 -0
  211. {monit_docker-1.1.4 → monit_docker-1.2.0}/tests/test_tui.py +0 -0
  212. {monit_docker-1.1.4 → monit_docker-1.2.0}/textual_tests/test_textual_tui.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monit-docker
3
- Version: 1.1.4
3
+ Version: 1.2.0
4
4
  Summary: monit-docker
5
5
  Home-page: https://github.com/decryptus/monit-docker
6
6
  Author: Adrien Delle Cave
@@ -23,7 +23,7 @@ License-File: LICENSE
23
23
  Requires-Dist: cryptography>=3.2.1
24
24
  Requires-Dist: bitmath>=1.3.3.1
25
25
  Requires-Dist: docker>=2.7.0
26
- Requires-Dist: HTTPdis>=0.6.28
26
+ Requires-Dist: HTTPdis>=0.6.35
27
27
  Requires-Dist: Mako
28
28
  Requires-Dist: pyOpenSSL>=20.0.0
29
29
  Requires-Dist: PyYAML>=3.10
@@ -49,8 +49,8 @@ Dynamic: summary
49
49
 
50
50
  # monit-docker project
51
51
 
52
- **Current package and image version: [1.1.4](https://github.com/decryptus/monit-docker/tree/v1.1.4)**
53
- — [Release notes and upgrade guidance](docs/release-1.1.4.md).
52
+ **Current package and image version: [1.2.0](https://github.com/decryptus/monit-docker/tree/v1.2.0)**
53
+ — [Release notes and upgrade guidance](docs/release-1.2.0.md).
54
54
 
55
55
  <p align="center">
56
56
  <img src="https://raw.githubusercontent.com/decryptus/monit-docker/v0.0.63/ui/branding/monit-docker-logo.png" alt="monit-docker logo" width="640">
@@ -66,7 +66,7 @@ Dynamic: summary
66
66
  [Documentation (EN)](https://www.monit-docker.com/docs/en/) ·
67
67
  [Live demo](https://demo.monit-docker.com/) ·
68
68
  [Release roadmap](docs/roadmap.md) ·
69
- [1.1.4 release notes](docs/release-1.1.4.md) ·
69
+ [1.2.0 release notes](docs/release-1.2.0.md) ·
70
70
  [Logos and icons](ui/branding/README.md)
71
71
 
72
72
  monit-docker is a free, open-source tool for checking Docker containers and
@@ -77,7 +77,7 @@ container or reloading PHP-FPM when memory usage is high.
77
77
  Compose v2 and curl, run:
78
78
 
79
79
  ```sh
80
- git clone --branch v1.1.4 --depth 1 https://github.com/decryptus/monit-docker.git
80
+ git clone --branch v1.2.0 --depth 1 https://github.com/decryptus/monit-docker.git
81
81
  cd monit-docker
82
82
  ./install.sh
83
83
  ```
@@ -1,7 +1,7 @@
1
1
  # monit-docker project
2
2
 
3
- **Current package and image version: [1.1.4](https://github.com/decryptus/monit-docker/tree/v1.1.4)**
4
- — [Release notes and upgrade guidance](docs/release-1.1.4.md).
3
+ **Current package and image version: [1.2.0](https://github.com/decryptus/monit-docker/tree/v1.2.0)**
4
+ — [Release notes and upgrade guidance](docs/release-1.2.0.md).
5
5
 
6
6
  <p align="center">
7
7
  <img src="https://raw.githubusercontent.com/decryptus/monit-docker/v0.0.63/ui/branding/monit-docker-logo.png" alt="monit-docker logo" width="640">
@@ -17,7 +17,7 @@
17
17
  [Documentation (EN)](https://www.monit-docker.com/docs/en/) ·
18
18
  [Live demo](https://demo.monit-docker.com/) ·
19
19
  [Release roadmap](docs/roadmap.md) ·
20
- [1.1.4 release notes](docs/release-1.1.4.md) ·
20
+ [1.2.0 release notes](docs/release-1.2.0.md) ·
21
21
  [Logos and icons](ui/branding/README.md)
22
22
 
23
23
  monit-docker is a free, open-source tool for checking Docker containers and
@@ -28,7 +28,7 @@ container or reloading PHP-FPM when memory usage is high.
28
28
  Compose v2 and curl, run:
29
29
 
30
30
  ```sh
31
- git clone --branch v1.1.4 --depth 1 https://github.com/decryptus/monit-docker.git
31
+ git clone --branch v1.2.0 --depth 1 https://github.com/decryptus/monit-docker.git
32
32
  cd monit-docker
33
33
  ./install.sh
34
34
  ```
@@ -0,0 +1 @@
1
+ 1.2.0
@@ -0,0 +1 @@
1
+ 1.2.0
@@ -14,7 +14,7 @@ stderr for collection by Docker logging drivers or an external log collector.
14
14
  | Operation | Events and results | Actor |
15
15
  | --- | --- | --- |
16
16
  | CLI `monit` invocation | Started; succeeded or failed | Local operating-system username |
17
- | Automatic rule action | Started; succeeded or failed, duration and error/exec exit code when known | `rule-engine` (`cron` for the cron subcommand) |
17
+ | Automatic rule action | Started, then succeeded, failed, or unknown when Docker did not confirm the exec outcome. Includes duration and the exit code when known | `rule-engine` (`cron` for the cron subcommand) |
18
18
  | Matched rule delayed, in cooldown or dry-run | Skipped or simulated, with reason | `rule-engine` |
19
19
  | Authenticated manual request | Queued, started, completed or rejected, including protection/cooldown/expiry | Trusted proxy username, otherwise `anonymous` |
20
20
  | Alertmanager audit webhook | Each firing/resolved alert received; delivery `not_reported` | `alertmanager` |
@@ -229,6 +229,11 @@ retains its existing case-insensitive substring matching. Queued and In progress
229
229
  both select Pending. Exports follow the applied filters and current page.
230
230
  Quick filters use the applied view and replace unsubmitted form edits.
231
231
 
232
+ When upgrading the agent from 1.1.4, add `--trust-proxy-user` to the new agent's
233
+ `serve` options to preserve per-user journal cursors behind the authenticated
234
+ proxy, including in read-only mode. Without this option all holders of the read
235
+ secret share the `anonymous` reader identity. The 1.2.0 journal overlay sets this option.
236
+
232
237
  The API is disabled by default. Enable `serve --audit-read-token-file FILE` and
233
238
  supply an explicit global `--audit-file PATH`. Use a separate 64-character hex
234
239
  secret, never the action or notification secret. An authenticated proxy must
@@ -258,8 +263,8 @@ directory (the preparation script refuses to overwrite an existing directory).
258
263
  Add global `--audit-file /var/lib/monit-docker/audit/events.jsonl` **before**
259
264
  `serve`, then append `--audit-read-token-file /run/secrets/audit-token` to the
260
265
  serve options. Reuse the token and proxy-include mounts from
261
- `compose.journal.yaml`. Add `--trust-proxy-user` if manual action attribution
262
- should use the authenticated username. Compose replaces `command` lists: do not
266
+ `compose.journal.yaml`. Add `--trust-proxy-user` to bind journal cursors and attribute manual actions
267
+ to the authenticated username. Compose replaces `command` lists: do not
263
268
  stack the journal and actions overlays without combining their command options.
264
269
 
265
270
  Since 0.0.75, **View action** opens a separate **Action history** dialog for
@@ -11,13 +11,46 @@ automatique des conteneurs surveillés.
11
11
  | Agent et interface web | Base et `docker-compose.ui.yml` | `https://localhost:8443` |
12
12
  | Historique et graphiques | `examples/monitoring/compose.yaml` | Grafana sur le port 3000 |
13
13
 
14
+ ## Socket Docker filtré en option
15
+
16
+ Avec Compose **2.24.4 ou ultérieur**, depuis la racine du dépôt :
17
+
18
+ ```sh
19
+ export DOCKER_SOCKET_GID=$(stat -c %g "${DOCKER_SOCKET_PATH:-/var/run/docker.sock}")
20
+ docker compose -f docker-compose.yml -f docker-compose.socket-proxy.yml up -d --build --wait
21
+ ```
22
+
23
+ Seul le proxy monte le socket de l’hôte. L’agent le joint sur un réseau privé et
24
+ le proxy ne publie aucun port hôte. Par défaut, l’agent peut lire la version,
25
+ la liste et les détails des conteneurs, leurs statistiques, les événements et
26
+ les détails d’une image par son empreinte. L’inspection peut révéler les
27
+ variables d’environnement et les montages. Gardez ce réseau privé.
28
+
29
+ Pour autoriser d’autres opérations, exportez la variable voulue, puis relancez
30
+ la commande Compose. Chaque valeur est une liste d’**identifiants complets**
31
+ séparés par des espaces. Obtenez un identifiant avec
32
+ `docker inspect -f '{{.Id}}' NOM`. Actualisez la liste après toute recréation
33
+ du conteneur. Pour révoquer les nouvelles requêtes, supprimez la variable avec
34
+ `unset` et réappliquez la configuration.
35
+
36
+ | Variable | Droits sur les conteneurs désignés |
37
+ | --- | --- |
38
+ | `MONIT_PROXY_EXEC_TARGETS` | Sondes de fichiers et commandes Docker exec sans le mode privilégié, y compris en tant que root dans le conteneur |
39
+ | `MONIT_PROXY_LIFECYCLE_TARGETS` | Démarrage, arrêt et redémarrage |
40
+
41
+ Choisissez uniquement des conteneurs de confiance. Une commande dans un
42
+ conteneur privilégié ou disposant du socket Docker ou du système de fichiers
43
+ hôte peut donner accès à l’hôte. Le proxy lui-même conserve le vrai socket.
44
+ Les règles de supervision et les jetons pour les actions manuelles se
45
+ configurent séparément. Utilisez les deux mêmes fichiers Compose pour `down`.
46
+
14
47
  ## Installation guidée
15
48
 
16
49
  Sur Linux amd64, installer Git, Docker Engine, son plugin Compose v2 avec
17
50
  `up --wait` et curl. Pour le tableau de bord, prévoir Python 3 et OpenSSL.
18
51
 
19
52
  ```sh
20
- git clone --branch v1.1.4 --depth 1 https://github.com/decryptus/monit-docker.git
53
+ git clone --branch v1.2.0 --depth 1 https://github.com/decryptus/monit-docker.git
21
54
  cd monit-docker
22
55
  ./install.sh
23
56
  ```
@@ -104,7 +137,7 @@ Définir `MONIT_DOCKER_PORT`, `UI_PORT` ou `DOCKER_SOCKET_PATH` dans le shell av
104
137
  Compose si nécessaire. `UI_BIND` vaut `127.0.0.1` par défaut. Garder le même nom
105
138
  de projet et le même répertoire pour réutiliser le volume.
106
139
 
107
- Les images de l’agent et de l’UI sont fixées à **1.1.4**. Pour une évolution,
140
+ Les images de l’agent et de l’UI sont fixées à **1.2.0**. Pour une évolution,
108
141
  choisir des versions correspondantes, préserver la configuration et les données,
109
142
  puis utiliser `pull` et `up -d --wait` avec la même liste de fichiers. Un simple
110
143
  `pull` ne remplace pas les conteneurs en cours d’exécution.
@@ -11,13 +11,44 @@ stack. None of these installations enables automatic container actions by defaul
11
11
  | Agent and web UI | Base plus `docker-compose.ui.yml` | `https://localhost:8443` |
12
12
  | Metrics history and dashboards | `examples/monitoring/compose.yaml` | Grafana on `http://127.0.0.1:3000` |
13
13
 
14
+ ## Optional filtered Docker socket
15
+
16
+ With Compose **2.24.4 or newer**, run these commands at the repository root:
17
+
18
+ ```sh
19
+ export DOCKER_SOCKET_GID=$(stat -c %g "${DOCKER_SOCKET_PATH:-/var/run/docker.sock}")
20
+ docker compose -f docker-compose.yml -f docker-compose.socket-proxy.yml up -d --build --wait
21
+ ```
22
+
23
+ Only the proxy mounts the host socket. The agent reaches it on a private network;
24
+ the proxy publishes no host port. Observation permits version discovery, container
25
+ listing, inspection, stats, events and image inspection by digest. Inspection can
26
+ reveal environment variables and mounts. Keep the proxy network private.
27
+
28
+ To grant additional operations, export either variable and repeat the Compose
29
+ command. Each value is a space-separated list of **full container IDs**. Get an
30
+ ID with `docker inspect -f '{{.Id}}' NAME`. Update the list after a target is recreated.
31
+ Unset the variable and reapply the command to revoke new requests.
32
+
33
+ | Variable | Grants on the listed targets |
34
+ | --- | --- |
35
+ | `MONIT_PROXY_EXEC_TARGETS` | Filesystem probes and arbitrary non-privileged Docker execs, including commands as root inside the target |
36
+ | `MONIT_PROXY_LIFECYCLE_TARGETS` | Start, stop and restart |
37
+
38
+ Choose trusted workload containers only. An exec into a privileged container or
39
+ one with a host filesystem or Docker socket mount can grant host access. The
40
+ allowlist limits the Docker API available to the agent; the proxy process itself
41
+ holds the real socket. These settings grant transport access. Configure any
42
+ monitoring rules or manual action credentials separately. Use the same pair of
43
+ Compose files for `down`.
44
+
14
45
  ## Guided installation
15
46
 
16
47
  On Linux amd64, install Git, Docker Engine, its Compose v2 plugin with
17
48
  `up --wait` support, and curl. For the web dashboard, install Python 3 and OpenSSL.
18
49
 
19
50
  ```sh
20
- git clone --branch v1.1.4 --depth 1 https://github.com/decryptus/monit-docker.git
51
+ git clone --branch v1.2.0 --depth 1 https://github.com/decryptus/monit-docker.git
21
52
  cd monit-docker
22
53
  ./install.sh
23
54
  ```
@@ -116,7 +147,7 @@ host ports. The UI binds to loopback unless `UI_BIND` is explicitly changed.
116
147
  Changing a host port does not change internal agent addresses. Keep the same
117
148
  directory/project name so Compose reuses its named volume.
118
149
 
119
- The examples pin agent and UI to **1.1.4**. When updating versions, preserve your
150
+ The examples pin agent and UI to **1.2.0**. When updating versions, preserve your
120
151
  configuration and state, choose matching agent/UI versions, then pull and recreate
121
152
  the selected stack. `docker compose pull` alone does not change a running container.
122
153
 
@@ -140,7 +140,7 @@ backups; archive them separately if you rely on this history.
140
140
 
141
141
  ## Customize
142
142
 
143
- The services are pinned to monit-docker 1.1.4, Prometheus 3.5.0 and Grafana 12.2.0.
143
+ The services are pinned to monit-docker 1.2.0, Prometheus 3.5.0 and Grafana 12.2.0.
144
144
  Update versions deliberately in `examples/monitoring/compose.yaml`, then run
145
145
  `docker compose pull` and `sh start.sh`. The repository-root `docker-compose.yml`
146
146
  runs the minimal observation agent; use the file in `examples/monitoring` for this
@@ -156,3 +156,20 @@ add explicit rules, a persistent state-directory mount and `--state-file`, and
156
156
  start with `--dry-run`. Prometheus alerts only report conditions; they do not
157
157
  execute agent actions. Notification delivery requires a separately configured
158
158
  Alertmanager; [email and Slack examples](notifications.md) are included.
159
+
160
+ ## Optional authentication for metrics
161
+
162
+ By default Prometheus can scrape `/metrics` without credentials. To protect
163
+ this endpoint, create a dedicated secret file with `(umask 077; openssl rand -hex 32 > metrics-token)` in a private directory. Mount
164
+ the resulting file read-only in both containers and pass
165
+ `--metrics-token-file /run/secrets/metrics` after `monit-docker serve`.
166
+ Add the following to the matching Prometheus scrape job:
167
+
168
+ ```yaml
169
+ authorization:
170
+ type: Bearer
171
+ credentials_file: /run/secrets/metrics
172
+ ```
173
+
174
+ Use HTTPS when scraping across an untrusted network. The token only grants
175
+ access to metrics. Configure access to `/v1/status` separately at your proxy.
@@ -222,7 +222,8 @@ a lock and audit simulated decisions while preserving durable policy state.
222
222
  | `--allow-actions` | `serve` | Off; requires state, action token and exact HTTPS origin |
223
223
  | `--action-origin`, `--action-token-file` | `serve` | Require `--allow-actions`; origin `https://host[:port]` without credentials/path/query/fragment; token file contains 64 lowercase hex characters with optional final newline |
224
224
  | `--action-cooldown` | `serve` | 30 seconds; finite and at least 1 |
225
- | `--allow-maintenance`, `--trust-proxy-user` | `serve` | Off; require `--allow-actions` |
225
+ | `--allow-maintenance` | `serve` | Off; requires `--allow-actions` |
226
+ | `--trust-proxy-user` | `serve` | Off; requires manual actions or an audit read token. Trust the authenticated proxy to supply the username. |
226
227
  | `--audit-read-token-file` | `serve` | Off; requires explicit audit path and a distinct read secret |
227
228
  | `--notification-token-file` | `serve` | Off; private notification ingestion secret |
228
229
 
@@ -269,7 +270,7 @@ execution do. Disk/inode/mount-mode resources do not require it.
269
270
  | 110 | Configuration, alias, scenario or value error handled as such |
270
271
  | 114 | No container selected |
271
272
  | 115 | Required observation unavailable |
272
- | 116 | Action failure; default for failed in-container exec |
273
+ | 116 | Action failure or unknown exec outcome. See [exec wait limits](cron.md#exit-codes-and-limits) |
273
274
  | 117 | Persistent state lock busy |
274
275
  | 118 | State read/write/validation failure |
275
276
  | 119 | Audit error, or handled OS/value errors in local administration commands |
@@ -131,7 +131,7 @@ Leave the lock file in place.
131
131
  | 110 | Invalid configuration or action |
132
132
  | 114 | No matching container |
133
133
  | 115 | Incomplete statistics |
134
- | 116 | Action failed (existing default) |
134
+ | 116 | Action failed or its outcome is unknown |
135
135
  | 117 | Another process holds this job's lock |
136
136
  | 118 | State cannot be safely loaded or saved |
137
137
  | 170 / 180 | Existing Docker connection / API errors |
@@ -141,6 +141,17 @@ can return its own code instead of 116, including values that overlap agent
141
141
  codes. Check diagnostics to distinguish them. Other existing exit codes retain
142
142
  their meaning.
143
143
 
144
+ An exec action waits up to 60 seconds for a Docker exit status. For a long
145
+ command, set `kwargs.exec_timeout` on its YAML command alias (integer seconds,
146
+ 1 to 86400). This limit also applies to rule execs in `monit` and `serve`.
147
+
148
+ On expiry the cycle stops, releases its state lock, and records `result=unknown`
149
+ in the audit journal. An interrupted connection or unavailable exit status
150
+ also produces an unknown result. Check the container before retrying: the
151
+ command may still run. Later observation cycles can proceed. The same live
152
+ executor refuses further execs while its outstanding SDK call is pending.
153
+ A separate cron process or a later rule evaluation can submit the command again.
154
+
144
155
  There is no background scheduler or HTTP listener. The optional [trigger delay](trigger-delay.md) tracks sustained conditions.
145
156
  There is no cycle-wide deadline or hysteresis. Existing Docker client timeouts still apply; a hung cycle can hold its
146
157
  lock until it exits or is terminated. [Serve mode](serve.md) reuses the same
@@ -15,6 +15,14 @@ routes, adds authentication and may return its own error responses. In
15
15
  particular, the public demo does not forward `/metrics`, `/healthz`, `/readyz`
16
16
  or the notification receiver. Use the private agent address in the examples.
17
17
 
18
+ The agent allows 5 seconds of inactivity per socket read. HTTPdis also limits
19
+ the request line and headers together to 10 seconds, even if bytes keep
20
+ arriving. It closes an incomplete request at that deadline. After authentication
21
+ and size checks, the body has a separate budget of 10 seconds plus one second
22
+ per 32 KiB of declared length (up to 12 seconds for the 64 KiB notification
23
+ route). A body timeout returns HTTP 408 and closes the connection before the
24
+ action or notification is submitted.
25
+
18
26
  Agent JSON responses use `application/json; charset=utf-8`, a trailing newline,
19
27
  and finite JSON numbers. Normal route responses and adapter errors include:
20
28
 
@@ -201,8 +209,10 @@ exposed. Reasons and state names remain English machine-readable values.
201
209
 
202
210
  ## Journal pages and exports
203
211
 
204
- Both routes require exactly one `X-Monit-Audit-Token` and one valid
205
- `X-Monit-Actor`, with the same actor length/control restrictions as above.
212
+ Both routes require exactly one `X-Monit-Audit-Token`. By default the server ignores
213
+ `X-Monit-Actor` and binds cursors to a shared `anonymous` identity. With
214
+ `--trust-proxy-user`, each request requires one valid `X-Monit-Actor` from the
215
+ authenticated proxy and cursors are bound to that user.
206
216
  Authentication applies even to an empty journal. HTTP 200 returns:
207
217
 
208
218
  | Field | Type / meaning |
@@ -226,7 +236,7 @@ policy remains a separate roadmap item.
226
236
  | `container` | Case-insensitive substring of container name or ID, not a glob or regular expression |
227
237
  | `source` | `manual` or `automatic` |
228
238
  | `category` | `action` or `notification` |
229
- | `result` | `pending`, `succeeded`, `failed`, `rejected`, `skipped`, `simulated`, `accepted`, `received` |
239
+ | `result` | `pending`, `succeeded`, `failed`, `unknown`, `rejected`, `skipped`, `simulated`, `accepted`, `received` |
230
240
  | `correlation_id` | Exact, case-sensitive ID |
231
241
  | `cursor` | Opaque signed continuation or page token |
232
242
  | `format` | `jsonl` (default) or `csv`; affects the export route, not the JSON page envelope |
@@ -55,6 +55,7 @@ For installation and the command reference, see the
55
55
  check-config
56
56
  configuration-validation
57
57
  textual
58
+ release-1.2.0
58
59
  release-1.1.4
59
60
  release-1.1.3
60
61
  release-1.1.2
@@ -0,0 +1,14 @@
1
+ # monit-docker 1.2.0
2
+
3
+ Upgrade the agent and dashboard together. Pin both images to `1.2.0`, or install the Python package with `python -m pip install --upgrade 'monit-docker==1.2.0'`. Keep the existing state volume, audit journal and backups.
4
+
5
+ ## Before restarting the agent
6
+
7
+ - If you enabled actions, notification ingestion or journal reads, use a different secret for each enabled capability. Reusing credentials can prevent startup. Update the agent and its callers together.
8
+ - For separate journal cursors behind an authenticated reverse proxy, enable `serve --trust-proxy-user`, including on read-only installations. Restrict access to the agent and make the proxy overwrite the actor header. Otherwise readers share the anonymous cursor.
9
+ - Prometheus access remains open by default. To protect `/metrics`, set `serve --metrics-token-file FILE` and configure the scraper with the matching bearer token. This does not protect `/v1/status`.
10
+ - Docker exec now waits up to 60 seconds by default. Set `exec_timeout` (1–86400 seconds) for a command that needs longer. A timeout records an unknown outcome: the command can continue inside the container. Check its result before retrying.
11
+
12
+ ## Docker access
13
+
14
+ The agent no longer changes the process-wide Docker endpoint. An optional Compose socket proxy restricts Docker API access; existing installations can continue to use their socket mount. See [Compose installation](https://github.com/decryptus/monit-docker/blob/v1.2.0/docs/compose-quickstart.md) for the overlay, required socket group and explicit action targets.
@@ -12,6 +12,10 @@ acceptance now has separate post-release evidence, recorded below. See
12
12
  scope and known limits, and inspect the tagged revision's workflow results for
13
13
  actual automated acceptance.
14
14
 
15
+ ## 1.2.0 security and reliability
16
+
17
+ See the [upgrade notes](release-1.2.0.md) before updating API credentials or the journal proxy.
18
+
15
19
  ## 1.1.4 guided installation
16
20
 
17
21
  The [1.1.4 release](release-1.1.4.md) includes the local Compose installer and repeat-installation checks.
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  monit-docker:
3
- image: decryptus/monit-docker:1.1.4
3
+ image: decryptus/monit-docker:1.2.0
4
4
  command: [monit-docker, serve, --bind, 0.0.0.0, --interval, '30']
5
5
  restart: unless-stopped
6
6
  stop_grace_period: 60s
@@ -0,0 +1,10 @@
1
+ FROM alpine@sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a AS build
2
+ RUN apk add --no-cache go
3
+ WORKDIR /src
4
+ COPY main.go .
5
+ RUN CGO_ENABLED=0 go build -trimpath -o /socket-proxy main.go
6
+
7
+ FROM scratch
8
+ COPY --from=build /socket-proxy /socket-proxy
9
+ USER 65534:65534
10
+ ENTRYPOINT ["/socket-proxy"]
@@ -1,8 +1,8 @@
1
- # Optional read-only journal example (0.0.66 or later). See docs/audit.md before combining
1
+ # Optional read-only journal example (1.2.0 or later). See docs/audit.md before combining
2
2
  # with an actions overlay: Compose replaces the agent command, not its options.
3
3
  services:
4
4
  monit-docker:
5
- command: [monit-docker, --audit-file, /var/lib/monit-docker/audit/events.jsonl, serve, --bind, 0.0.0.0, --interval, '30', --state-file, /var/lib/monit-docker/state.json, --audit-read-token-file, /run/secrets/audit-token]
5
+ command: [monit-docker, --audit-file, /var/lib/monit-docker/audit/events.jsonl, serve, --bind, 0.0.0.0, --interval, '30', --state-file, /var/lib/monit-docker/state.json, --trust-proxy-user, --audit-read-token-file, /run/secrets/audit-token]
6
6
  volumes:
7
7
  - state:/var/lib/monit-docker
8
8
  - type: bind
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  monit-docker:
3
- image: decryptus/monit-docker:1.1.4
3
+ image: decryptus/monit-docker:1.2.0
4
4
  command: [monit-docker, serve, --bind, 0.0.0.0, --interval, '30']
5
5
  restart: unless-stopped
6
6
  stop_grace_period: 60s
@@ -15,7 +15,7 @@ services:
15
15
  create_host_path: false
16
16
 
17
17
  ui:
18
- image: decryptus/monit-docker-ui:1.1.4
18
+ image: decryptus/monit-docker-ui:1.2.0
19
19
  restart: unless-stopped
20
20
  depends_on: [monit-docker]
21
21
  networks: [agent, frontend]
@@ -2,6 +2,6 @@
2
2
 
3
3
  from __future__ import absolute_import
4
4
 
5
- __version__ = '1.1.4'
5
+ __version__ = '1.2.0'
6
6
 
7
7
  __all__ = ('__version__',)
@@ -6,13 +6,18 @@ import logging
6
6
  import os
7
7
  import sys
8
8
  from collections import OrderedDict
9
+ from concurrent.futures import Future, wait
10
+ from threading import Thread
11
+ from time import monotonic
12
+
13
+ from urllib3.exceptions import ProtocolError, TimeoutError as TransportTimeout
9
14
  from numbers import Integral
10
15
 
11
16
  import docker
12
17
  from docker.errors import APIError
13
18
 
14
19
  from monit_docker.core.metrics import ResourceCalculator
15
- from monit_docker.domain.errors import CommandExecutionError, MonitoringError
20
+ from monit_docker.domain.errors import CommandExecutionError, ExecOutcomeUnknown, MonitoringError
16
21
  from monit_docker.domain.models import ContainerSnapshot, STATE_RESOURCES
17
22
  from monit_docker.adapters.selection import ContainerSelector
18
23
  from monit_docker.adapters.syntax import DOCKER_COMMANDS
@@ -25,6 +30,7 @@ from monit_docker.adapters.stats import read_stats, MAX_STATS_SAMPLES
25
30
 
26
31
  LOG = logging.getLogger('monit-docker')
27
32
 
33
+ _EXEC_TIMEOUT_SECONDS = 60
28
34
  _MANUAL_PROTECTION_LABEL = 'monit-docker.protected'
29
35
  _UNPROTECTED_LABEL_VALUES = frozenset(('false', '0', 'no', 'off'))
30
36
  _DOCKER_HEALTH_STATES = frozenset(('healthy', 'unhealthy', 'starting'))
@@ -52,9 +58,10 @@ def client_factory(config, name=None, from_env=False):
52
58
  raise MonitoringError(110, 'unknown client: %r' % name)
53
59
  if from_env or not clients:
54
60
  def connect():
55
- if not os.environ.get('DOCKER_HOST'):
56
- os.environ['DOCKER_HOST'] = 'unix:///var/run/docker.sock'
57
- return docker.from_env()
61
+ environment = os.environ.copy()
62
+ if not environment.get('DOCKER_HOST'):
63
+ environment['DOCKER_HOST'] = 'unix:///var/run/docker.sock'
64
+ return docker.from_env(environment=environment)
58
65
  return connect
59
66
  settings = copy.deepcopy(clients[name or next(iter(clients))]['config'])
60
67
 
@@ -202,6 +209,41 @@ class DockerCollector(object):
202
209
  class DockerActionExecutor(object):
203
210
  def __init__(self, collector):
204
211
  self.collector = collector
212
+ self._pending_exec = None
213
+
214
+ def _exec(self, obj, command, args, kwargs):
215
+ if self._pending_exec is not None and self._pending_exec.is_alive():
216
+ raise MonitoringError(116, 'exec not submitted: previous Docker call is still pending')
217
+ self._pending_exec = None
218
+ timeout = kwargs.pop('exec_timeout', _EXEC_TIMEOUT_SECONDS)
219
+ deadline = monotonic() + timeout
220
+ completion = Future()
221
+
222
+ def run():
223
+ try:
224
+ if monotonic() >= deadline:
225
+ raise MonitoringError(116, 'exec deadline expired before submission')
226
+ result = obj.exec_run(command, *args, **kwargs)
227
+ completion.set_result(result.exit_code)
228
+ except BaseException as error:
229
+ completion.set_exception(error)
230
+
231
+ worker = Thread(target=run, name='monit-docker-exec', daemon=True)
232
+ worker.start()
233
+ done, _ = wait((completion,), timeout=max(0, deadline - monotonic()))
234
+ if not done:
235
+ # The SDK still owns this cycle's connection. Transfer cleanup to
236
+ # the worker so the next observation can open a fresh client.
237
+ client, self.collector.client = self.collector.client, None
238
+ self._pending_exec = worker
239
+ completion.add_done_callback(lambda _: client.api.close())
240
+ raise ExecOutcomeUnknown('exec deadline expired on %s; outcome unknown' % obj.name)
241
+ try:
242
+ return completion.result()
243
+ except APIError:
244
+ raise
245
+ except (OSError, ProtocolError, TransportTimeout) as error:
246
+ raise ExecOutcomeUnknown('Docker connection interrupted on %s; exec outcome unknown' % obj.name) from error
205
247
 
206
248
  def execute(self, identifier, action):
207
249
  """Execute against this cycle's selected object, never a cached prior one."""
@@ -210,13 +252,11 @@ class DockerActionExecutor(object):
210
252
  try:
211
253
  LOG.info('execute %r on %s', action.command, obj.name)
212
254
  if action.kind == 'exec':
213
- result = obj.exec_run(action.command, *args, **kwargs)
214
- LOG.info('%r executed in %s: %r', action.command, obj.name, result)
215
- exit_code = result.exit_code
255
+ exit_code = self._exec(obj, action.command, args, kwargs)
216
256
  if isinstance(exit_code, bool) or not isinstance(exit_code, Integral) or not 0 <= exit_code <= 255:
217
257
  # Detached/streaming execs have no completed status. Never
218
258
  # propagate an unavailable or invalid status as success.
219
- return False
259
+ raise ExecOutcomeUnknown('Docker returned no valid exit status on %s; exec outcome unknown' % obj.name)
220
260
  if exit_code:
221
261
  raise CommandExecutionError(exit_code, 'command failed on %s: %r (exit code %s)' %
222
262
  (obj.name, action.command, exit_code))
@@ -126,7 +126,14 @@ def _exec_output(api, identifier, command, max_output=_MAX_OUTPUT, user=None):
126
126
  return bytes(output)
127
127
  finally:
128
128
  try:
129
- connection.close()
129
+ # Close the response before its underlying SocketIO. Otherwise
130
+ # http.client can try to flush an already closed stream on GC.
131
+ response = getattr(connection, '_response', None)
132
+ try:
133
+ if response is not None:
134
+ response.close()
135
+ finally:
136
+ connection.close()
130
137
  finally:
131
138
  # Docker may return SocketIO: closing the file wrapper alone does
132
139
  # not close its socket owner until garbage collection.
@@ -70,18 +70,22 @@ class StatusHandler(httpdis.HttpReqHandler):
70
70
  def authenticate(self, auth_users = None):
71
71
  path = self._path
72
72
  security = self.server.security
73
+ if path == '/metrics':
74
+ if security.metrics_token:
75
+ tokens = self.headers.get_all('Authorization') or []
76
+ expected = ('Bearer ' + security.metrics_token).encode('ascii')
77
+ if len(tokens) != 1 or not hmac.compare_digest(tokens[0].encode('utf-8'), expected):
78
+ raise self.req_error(403, 'forbidden')
79
+ return
73
80
  if path in _AUDIT_READ_PATHS:
74
81
  reader = self.server.monitor.audit_reader
75
82
  if reader is None:
76
83
  raise self.req_error(404)
77
84
  tokens = self.headers.get_all('X-Monit-Audit-Token')
78
- actors = self.headers.get_all('X-Monit-Actor')
79
85
  if (not security.audit_token or not tokens or len(tokens) != 1
80
- or not hmac.compare_digest(tokens[0].encode('utf-8'), security.audit_token.encode('ascii'))
81
- or not actors or len(actors) != 1 or not actors[0].strip() or len(actors[0]) > 128
82
- or any(ord(c) < 32 or ord(c) == 127 for c in actors[0])):
86
+ or not hmac.compare_digest(tokens[0].encode('utf-8'), security.audit_token.encode('ascii'))):
83
87
  raise self.req_error(403, 'forbidden')
84
- self.audit_actor = actors[0]
88
+ self.audit_actor = self._proxy_actor()
85
89
  return
86
90
  if path == '/v1/notifications':
87
91
  receiver = self.server.monitor.notification_audit
@@ -101,13 +105,16 @@ class StatusHandler(httpdis.HttpReqHandler):
101
105
  raise self.req_error(403, 'forbidden')
102
106
  if not origins or len(origins) != 1 or origins[0] != security.action_origin:
103
107
  raise self.req_error(403, 'origin_rejected')
104
- self.audit_actor = 'anonymous'
105
- if security.trust_actor:
106
- actors = self.headers.get_all('X-Monit-Actor')
107
- if (not actors or len(actors) != 1 or not actors[0].strip() or len(actors[0]) > 128
108
- or any(ord(c) < 32 or ord(c) == 127 for c in actors[0])):
109
- raise self.req_error(403, 'forbidden')
110
- self.audit_actor = actors[0]
108
+ self.audit_actor = self._proxy_actor()
109
+
110
+ def _proxy_actor(self):
111
+ if not self.server.security.trust_actor:
112
+ return 'anonymous'
113
+ actors = self.headers.get_all('X-Monit-Actor')
114
+ if (not actors or len(actors) != 1 or not actors[0].strip() or len(actors[0]) > 128
115
+ or any(ord(c) < 32 or ord(c) == 127 for c in actors[0])):
116
+ raise self.req_error(403, 'forbidden')
117
+ return actors[0]
111
118
 
112
119
  def data_from_payload(self, cmd):
113
120
  # Tighten HTTPdis's general-purpose parser for this small JSON API.
@@ -101,7 +101,7 @@ _ROUTES = ({'name': 'v1/audit', 'op': _READ_METHODS, 'handler': audit_page, 'to_
101
101
  {'name': 'healthz', 'op': _READ_METHODS, 'handler': health},
102
102
  {'name': 'readyz', 'op': _READ_METHODS, 'handler': readiness},
103
103
  {'name': 'v1/status', 'op': _READ_METHODS, 'handler': status},
104
- {'name': 'metrics', 'op': _READ_METHODS, 'handler': metrics},
104
+ {'name': 'metrics', 'op': _READ_METHODS, 'handler': metrics, 'to_auth': True},
105
105
  {'name': 'v1/actions', 'op': _WRITE_METHODS, 'handler': submit_action,
106
106
  'to_auth': True, 'max_body_size': _ACTION_MAX_BODY_SIZE})
107
107