diff --git a/.env.docker b/.env.docker index 6347dcd4..a74d1a6c 100644 --- a/.env.docker +++ b/.env.docker @@ -150,6 +150,16 @@ PROXMOX_ENABLED=false # PROXMOX_TIMEOUT=30000 # PROXMOX_PRIORITY=7 +# ----------------------------------------------------------------------------- +# Checkmk integration +# ----------------------------------------------------------------------------- +CHECKMK_ENABLED=false +# CHECKMK_SERVER_URL=https://checkmk.example.com +# CHECKMK_SITE=mysite +# CHECKMK_USERNAME=automation +# CHECKMK_PASSWORD= # pragma: allowlist secret +# CHECKMK_SSL_VERIFY=true + # ----------------------------------------------------------------------------- # AWS integration # ----------------------------------------------------------------------------- @@ -166,6 +176,17 @@ AWS_ENABLED=false # AWS_PROFILE=default # AWS_ENDPOINT= +# ----------------------------------------------------------------------------- +# MCP (Model Context Protocol) Server +# ----------------------------------------------------------------------------- +# Enables the embedded MCP server at /mcp on the same port as the API. +# MCP_ENABLED=true + +# Static bearer token for MCP client authentication (recommended). +# Generate with: openssl rand -hex 32 +# If unset, MCP clients must use a valid JWT from /api/auth/login. +# MCP_AUTH_TOKEN= # pragma: allowlist secret + # ----------------------------------------------------------------------------- # Streaming, Cache, and Queue (advanced — defaults are usually fine) # ----------------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 4ed74193..730db99f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ dist/ build/ backend/public/ +# Crash dumps +backend/crash-dumps/ + # Environment variables .env .env.local diff --git a/.kiro/html/202606051110-feat-ansible-playbook-browser-and-misc-fixes.html b/.kiro/html/202606051110-feat-ansible-playbook-browser-and-misc-fixes.html new file mode 100644 index 00000000..d95e44f6 --- /dev/null +++ b/.kiro/html/202606051110-feat-ansible-playbook-browser-and-misc-fixes.html @@ -0,0 +1,245 @@ + + +
+ + +Generated: 2026-06-05 11:10 · Branch: 140
+ +feat(ansible): playbook browser with parameter detection
+ Add a playbook browser UI that discovers YAML playbook files in +ANSIBLE_PROJECT_PATH, displays their structure (plays, hosts, roles), +and auto-extracts parameters from vars_prompt/vars for a dynamic form. + +Backend: +- New /api/playbooks and /api/playbooks/details endpoints +- AnsibleService.listPlaybooks() scans directories recursively +- AnsibleService.getPlaybookDetails() parses YAML to extract plays + and parameters (vars_prompt → required, vars → optional) +- AnsiblePlugin exposes getAnsibleService() accessor +- BoltPlugin health check simplified to exec() for shell-wrapper compat +- Bolt/Ansible commands now pass --become / --run-as on sudo actions +- Crash handler accepts configurable dump directory via ConfigService +- Integration health checks run once synchronously at startup to warm cache + +Frontend: +- ExecutePlaybookForm rewritten as full playbook browser with + directory tree, search, content viewer, and PlaybookParameterForm +- AnsiblePlaybookInterface delegates form to ExecutePlaybookForm +- MonitorTab adds "Last Change" sort mode for Checkmk services +- Proxmox API functions unwrap nested response to return clean result + +Tests: +- BoltPlugin tests updated for exec-based health check mock
+Primary impact: ansible The new playbook browser is additive — new API endpoints, new UI components. The existing AnsiblePlaybookInterface delegates to ExecutePlaybookForm, so the execution path is preserved but the form UX is completely rewritten.
+Moderate impact: bolt BoltPlugin health check switches from raw spawn to exec(). Functionally equivalent but different code path — tests updated to match.
+Moderate impact: proxmox proxmoxApi.ts now unwraps the nested response object. If the API response shape from the backend doesn't match `{ result: { id, status, error?, results? } }`, provisioning will break.
+Low impact: checkmk MonitorTab sort mode is a new UI-only toggle. The lastStateChange field must be present in the Checkmk API response.
+Cross-cutting: IntegrationManager startup health check runs synchronously before listen — adds startup latency proportional to slowest integration health check but prevents stale-status flash. Crash handler config is a no-behavior-change refactor when env var is unset.
+feat(multi): crash dumps page, host state summary, puppet confdir
+Three unrelated improvements bundled on branch 140:
+/crash-dumps route (admin-only) with backend API for listing, viewing, downloading, and deleting crash dump JSON files. Frontend table view with detail viewer and download support.getHostStateSummary() method queries Checkmk for host state (up/down/unreachable/downtime). The monitoring overview endpoint now returns hostStateSummary and the home page renders a grid of host states instead of a plain count.buildPuppetCommand() now passes --confdir /etc/puppetlabs/puppet explicitly so puppet agent resolves config correctly even when not running as root.system to light for new users without stored preference.| Status | File | +/- |
|---|---|---|
| A | backend/src/routes/crashDumps.ts | +255 |
| A | frontend/src/pages/CrashDumpsPage.svelte | +226 |
| M | backend/src/integrations/checkmk/CheckmkService.ts | +76 |
| M | frontend/src/pages/HomePage.svelte | +38 / -4 |
| M | backend/src/routes/puppet.ts | +13 / -3 |
| M | backend/src/server.ts | +10 |
| M | backend/src/integrations/checkmk/CheckmkPlugin.ts | +8 |
| M | backend/src/integrations/checkmk/types.ts | +8 |
| M | frontend/src/lib/theme.svelte.ts | +6 / -2 |
| M | frontend/src/components/Navigation.svelte | +6 / -2 |
| M | backend/src/routes/integrations/monitoringOverview.ts | +5 / -2 |
| M | frontend/src/App.svelte | +4 / -1 |
| M | .kiro/specs/checkmk-integration/requirements.md | +1 |
/crash-dumps as an admin user — verify table loads (empty state if no dumps exist)--confdir /etc/puppetlabs/puppet appears in the command (check expert mode output)theme key, reload — verify app starts in light mode (previously would follow system preference)Fully additive. New route file + new page + server mount + navigation entry. No existing functionality is modified. Blast radius: zero — failure only affects the new page.
+ +Touches the Checkmk plugin, service, types, and the monitoring overview route. The /api/monitoring/overview response gains a new field (hostStateSummary) — additive, no breaking change for existing consumers. Home page rendering change is cosmetic.
Modifies buildPuppetCommand() which affects every Puppet agent invocation (single and multi-node). Low blast radius — additional argument is always safe; puppet accepts --confdir even when already using the default path.
Affects first-time users or users without a stored theme preference. Existing users with a stored preference are unaffected.
+
+ Generate a .env snippet to connect Pabawi to your Checkmk instance
+ for live service monitoring, host inventory discovery, and state-change event history.
+
Base URL of your Checkmk server (http:// or https://)
+The Checkmk site name (used in the API path)
+Checkmk automation user (Settings → Users)
+The automation secret for the user above
+Disable only for self-signed certificates in development
++ Livestatus enables full event history — service state-change events over the past 7 days. + Without it, Pabawi derives only the most recent transition per service from the REST API. +
++ ⚠️ The default Livestatus port (6557) uses plaintext TCP — traffic is unencrypted. + Enable TLS below if your Checkmk instance supports encrypted Livestatus. +
+Leave empty to disable Livestatus (REST fallback only)
+Default: 6557
+Wraps the TCP connection in TLS (encrypted Livestatus)
+Per-request timeout before falling back to REST (default: 5000)
+
+ Copy the generated snippet below and paste it into your backend/.env file, then restart the application.
+
{envSnippet}
+
+ Next: Paste into backend/.env and restart the application. Then check the Integration Status dashboard to verify the connection.
+
Fill in the required fields above to generate a complete snippet.
+After pasting the snippet into backend/.env, restart the backend:
Real-time service status on the Monitor tab
+Automatic inventory from Checkmk hosts
+State-change events in the node journal
+For detailed documentation, see the Checkmk Integration guide in the documentation.
+