Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Refactor: Code cleanup and localStorage consolidation
rcourtman6eb1a10d9bb4
diff --git a/.dockerignore b/.dockerignoreindex 78c0ef4229..d0faeeef59 100644--- a/.dockerignore+++ b/.dockerignore@@ -10,8 +10,17 @@ dev-docs/# Binaries and build artifactspulsebackend+/pulse-host-agent+/pulse-host-agent-*+/pulse-docker-agent+/pulse-serverbin/dist/+frontend/+frontend-modern/public/download/+frontend-modern/public/pulse-host-agent*+frontend-modern/dist/+scripts/macos/dist/*.exe*.dll*.so@@ -45,4 +54,4 @@ testing-tools/# Temporary files*.tmp*.temp-*~\ No newline at end of file+*~diff --git a/.gitignore b/.gitignoreindex abf9781ffe..43ff3ba838 100644--- a/.gitignore+++ b/.gitignore@@ -1,6 +1,12 @@# Binaries/bin//pulse+/pulse-docker-agent+/pulse-sensor-proxy+/pulse-server+/pulse-test+/pulse-host-agent+/pulse-host-agent-*# Logs*.log@@ -28,7 +34,6 @@ Thumbs.db*.test*.outvendor/-pulse-testtest-pulse# Node.js (for frontend-modern)@@ -36,6 +41,9 @@ node_modules/.npm/.yarn/frontend-modern/.vite/+frontend/+frontend-modern/public/download/+data/# Environment.env@@ -47,6 +55,8 @@ dist/build/*.tar.gzpulse-fixes*.tar.gz+release/pulse-host-agent-*.tar.gz+scripts/macos/dist/# Frontend copy for embedding (generated during build)# Frontend build artifact for Go embeddingdiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdnew file mode 100644index 0000000000..0a31a9390f--- /dev/null+++ b/CONTRIBUTING.md@@ -0,0 +1,139 @@+# Contributing to Pulse++Thanks for investing time in Pulse! This document collects the essentials you+need to be productive across the Go backend, React/TypeScript frontend, and the+installer tooling.++---++## Project Overview++- **Backend (`cmd/`, `internal/`, `pkg/`)** – Go 1.23+ web server that embeds+ the built frontend and exposes REST + WebSocket APIs.+- **Frontend (`frontend-modern/`)** – Vite + React app built with TypeScript.+- **Agents (`cmd/pulse-*-agent`)** – Go binaries distributed alongside Pulse for+ host and Docker telemetry.+- **Documentation (`docs/`)** – Markdown-based guides published to users and+ referenced from the README.+- **Scripts (`scripts/`)** – Bash installers and helpers bundled for+ curl-based distribution.++---++## Getting Started++```bash+git clone https://github.com/rcourtman/Pulse.git+cd Pulse++# Install dependencies+brew install go node npm # or use your distro equivalents++# Install JS deps+cd frontend-modern+npm install+cd ..+```++### Hot Reload Dev Loop++```bash+./scripts/hot-dev.sh # Backend on :7656, frontend on :7655+npm run mock:on # Optional: enable mock data+```++See `docs/development/MOCK_MODE.md` for tips on synthetic fixtures.++---++## Backend Workflow++- Build: `go build ./cmd/pulse`+- Tests: `go test ./...`+- Lint: `golangci-lint run ./...` (install via `go install` if missing)+- Formatting: `gofmt -w ./cmd ./internal ./pkg`++Key entry points:+- HTTP router lives in `internal/api`.+- Monitoring engines live under `internal/monitor`.+- Configuration parsing resides in `internal/config`.++When adding new API endpoints, document them in `docs/API.md` and provide+examples where possible.++---++## Frontend Workflow++- Dev server: `cd frontend-modern && npm run dev`+- Tests: `npm run test`+- Lint: `npm run lint`+- Format: `npm run format`+- Production build: `npm run build` (copied into `internal/api/frontend-modern`+ via the Makefile).++Use modern React patterns (hooks, function components) and prefer TanStack Query+for data fetching. Add Storybook stories or screenshots when introducing new+UI-heavy features.++---++## Installers & Scripts++- Centralised guidance: `docs/script-library-guide.md`+- Bundling: `make bundle-scripts`+- Tests: `scripts/tests/run.sh` plus integration suites under+ `scripts/tests/integration/`++Document rollout plans and kill switches in `docs/installer-v2-rollout.md` and+`MIGRATION_SCAFFOLDING.md`.++---++## Documentation Standards++- Author or update guides in `docs/` when behaviour changes.+- Organise new topics through `docs/README.md` so they appear in the docs index.+- Avoid marketing copy in technical docs—save that for `README.md` or+ external sites.+- Keep instructions evergreen; put release-specific notes in+ `docs/RELEASE_NOTES.md`.++Run a quick link check (`npm run lint-docs` if available, or `markdownlint`)+before submitting large doc updates.++---++## Testing Expectations++- Every PR should note the tests run (`go test`, `npm test`, `scripts/tests/run.sh`).+- Add regression coverage when fixing bugs.+- Mention manual verification steps (e.g., “Proxmox LXC installer tested on+ PVE 8.1”) if automated coverage is not feasible.++---++## Coding Guidelines++- Adhere to existing formatting tools (`gofmt`, `prettier`, `eslint`).+- Name Go packages with short, meaningful identifiers (avoid `util`).+- Keep functions focused; prefer small helpers over large monoliths.+- Prefer context-aware logging (`logger.Named("component")`) in new Go code.+- Ensure secrets never reach logs and redact sensitive fields in API responses.++---++## Submitting Changes++1. Fork + branch (`git checkout -b feature/my-change`).+2. Make your edits and run relevant tests.+3. Update docs and changelog entries as needed.+4. Open a PR describing:+ - What changed+ - Why it changed+ - Testing performed+ - Rollout / migration concerns++Reviewers will focus on correctness, security, and upgrade paths, so call out+anything unusual up front. Thanks again for contributing!+diff --git a/DEV-QUICK-START.md b/DEV-QUICK-START.mdindex 4c5218fe10..fb980f711c 100644--- a/DEV-QUICK-START.md+++ b/DEV-QUICK-START.md@@ -1,5 +1,11 @@# Development Quick Start+## Prerequisites++- Go **1.24.9** or newer+- Node.js 20++- pnpm 9+ (for frontend work)+## Hot-Reload Development ModeStart the development environment with hot-reload:diff --git a/Dockerfile b/Dockerfileindex 8ec5133688..68e0c5eafd 100644--- a/Dockerfile+++ b/Dockerfile@@ -2,7 +2,7 @@ARG BUILD_AGENT=1# Build stage for frontend (must be built first for embedding)-FROM node:20-alpine AS frontend-builder+FROM node:20.16.0-alpine3.19 AS frontend-builderWORKDIR /app/frontend-modern@@ -19,7 +19,7 @@ RUN --mount=type=cache,id=pulse-npm-cache,target=/root/.npm \npm run build# Build stage for Go backend-FROM golang:1.24-alpine AS backend-builder+FROM golang:1.24.9-alpine3.19 AS backend-builderARG BUILD_AGENTWORKDIR /app@@ -86,7 +86,7 @@ RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \-o pulse-sensor-proxy ./cmd/pulse-sensor-proxy# Runtime image for the Docker agent (offered via --target agent_runtime)-FROM alpine:latest AS agent_runtime+FROM alpine:3.19.1 AS agent_runtime# Use TARGETARCH to select the correct binary for the build platformARG TARGETARCH@@ -118,7 +118,7 @@ ENV PULSE_NO_AUTO_UPDATE=trueENTRYPOINT ["/usr/local/bin/pulse-docker-agent"]# Final stage (Pulse server runtime)-FROM alpine:latest+FROM alpine:3.19.1RUN apk --no-cache add ca-certificates tzdata su-exec openssh-clientdiff --git a/MIGRATION_SCAFFOLDING.md b/MIGRATION_SCAFFOLDING.mdindex d8844f1525..424366fd5d 100644--- a/MIGRATION_SCAFFOLDING.md+++ b/MIGRATION_SCAFFOLDING.md@@ -8,41 +8,9 @@ This document tracks temporary code added to handle migration paths between vers## Active Migration Code-### Legacy SSH Detection Banner (Added: v4.23.0)--**Why it exists**: Users who set up temperature monitoring before v4.23.0 used SSH keys directly in the container. The new secure architecture uses `pulse-sensor-proxy` on the host with Unix socket communication. Users with the old setup need to remove and re-add their nodes to upgrade.--**Files involved**:-- Backend: `/opt/pulse/internal/api/router.go` - `detectLegacySSH()` function-- Backend: `/opt/pulse/internal/api/types.go` - `HealthResponse.LegacySSHDetected` fields-- Frontend: `/opt/pulse/frontend-modern/src/components/LegacySSHBanner.tsx`-- Frontend: `/opt/pulse/frontend-modern/src/App.tsx` - Banner integration--**Removal criteria** (ANY of these):-- Version reaches v5.0 or later-- Telemetry shows <1% detection rate for 30+ consecutive days-- 6 months after v4.23.0 release (whichever comes first)--**How to remove**:-1. Delete `LegacySSHBanner.tsx` component-2. Remove import and usage from `App.tsx`-3. Delete `detectLegacySSH()` function from `router.go`-4. Remove `LegacySSHDetected`, `RecommendProxyUpgrade`, `ProxyInstallScriptAvailable` from `types.go` HealthResponse-5. Remove banner logic from `handleHealth()` in `router.go`-6. Delete this entry from this document--**Manual override**: Set `PULSE_LEGACY_DETECTION=false` environment variable to disable detection without code changes.--**Telemetry notes**: Currently no telemetry implemented. Consider adding metrics to track:-- How often the banner is shown-- How many users still have legacy SSH setup-- When detection rate drops below threshold------## Removed Migration Code-(None yet - this document was created v4.23.0)+- Legacy SSH detection banner (removed in cleanup)---diff --git a/Makefile b/Makefileindex d8965b2d4b..365d91f8f7 100644--- a/Makefile+++ b/Makefile@@ -1,20 +1,24 @@# Pulse Makefile for development-.PHONY: build run dev frontend backend all clean dev-hot lint lint-backend lint-frontend format format-backend format-frontend+.PHONY: build run dev frontend backend all clean distclean dev-hot lint lint-backend lint-frontend format format-backend format-frontend++FRONTEND_DIR := frontend-modern+FRONTEND_DIST := $(FRONTEND_DIR)/dist+FRONTEND_EMBED_DIR := internal/api/frontend-modern# Build everythingall: frontend backend# Build frontend onlyfrontend:- cd frontend-modern && npm run build+ npm --prefix $(FRONTEND_DIR) run build@echo "================================================"@echo "Copying frontend to internal/api/ for Go embed"@echo "This is REQUIRED - Go cannot embed external paths"@echo "================================================"- rm -rf internal/api/frontend-modern- mkdir -p internal/api/frontend-modern- cp -r frontend-modern/dist internal/api/frontend-modern/+ rm -rf $(FRONTEND_EMBED_DIR)+ mkdir -p $(FRONTEND_EMBED_DIR)+ cp -r $(FRONTEND_DIST) $(FRONTEND_EMBED_DIR)/@echo "✓ Frontend copied for embedding"# Build backend only (includes embedded frontend)@@ -38,7 +42,10 @@ dev-hot:# Clean build artifactsclean:rm -f pulse- rm -rf frontend-modern/dist+ rm -rf $(FRONTEND_DIST) $(FRONTEND_EMBED_DIR)++distclean: clean+ ./scripts/cleanup.sh# Quick rebuild and restart for developmentrestart: frontend backend@@ -51,7 +58,7 @@ lint-backend:golangci-lint run ./...lint-frontend:- cd frontend-modern && npm run lint+ npm --prefix $(FRONTEND_DIR) run lint# Apply formattersformat: format-backend format-frontend@@ -60,4 +67,4 @@ format-backend:gofmt -w cmd internal pkgformat-frontend:- cd frontend-modern && npm run format+ npm --prefix $(FRONTEND_DIR) run formatdiff --git a/README.md b/README.mdindex ba71b9982c..739e1667ed 100644--- a/README.md+++ b/README.md@@ -108,10 +108,13 @@ helm install pulse oci://ghcr.io/rcourtman/pulse-chart \### Initial Setup**Option A: Interactive Setup (UI)**-1. Open `http://<your-server>:7655`-2. **Complete the mandatory security setup** (first-time only)-3. Create your admin username and password-4. Use **Settings → Security → API tokens** to mint dedicated tokens for automation. Assign scopes so each token only has the permissions it needs (e.g. `docker:report`, `host-agent:report`). Legacy tokens default to full access until you edit and save new scopes.+1. On the host, read the bootstrap token that protects the first-time setup screen:+ - Standard install: `cat /etc/pulse/.bootstrap_token`+ - Docker/Helm: `cat /data/.bootstrap_token` inside the container or mounted volume+2. Open `http://<your-server>:7655`+3. When prompted, paste the bootstrap token to unlock the wizard, then **complete the mandatory security setup** (first-time only)+4. Create your admin username and password and store the generated API token safely (the token file is removed after setup)+5. Use **Settings → Security → API tokens** to mint dedicated tokens for automation. Assign scopes so each token only has the permissions it needs (e.g. `docker:report`, `host-agent:report`). Legacy tokens default to full access until you edit and save new scopes.**Option B: Automated Setup (No UI)**For automated deployments, configure authentication via environment variables:diff --git a/SECURITY.md b/SECURITY.mdindex a8cc3fa0b6..f305edf6f3 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -396,8 +396,8 @@ docker run -e API_TOKENS=ansible-token,docker-agent-token rcourtman/pulse:latest# Include the ORIGINAL token (not hash) in X-API-Token headercurl -H "X-API-Token: your-original-token" http://localhost:7655/api/health-# Or in query parameter for export/import-curl "http://localhost:7655/api/export?token=your-original-token"+# or in Authorization header (preferred for shared tooling)+curl -H "Authorization: Bearer your-original-token" http://localhost:7655/api/export```### Auto-Registration Securitydiff --git a/cmd/pulse-docker-agent/main.go b/cmd/pulse-docker-agent/main.goindex 9d31bbfef6..f78eb1d02a 100644--- a/cmd/pulse-docker-agent/main.go+++ b/cmd/pulse-docker-agent/main.go@@ -11,6 +11,7 @@ import ("time""github.com/rcourtman/pulse-go-rewrite/internal/dockeragent"+ "github.com/rcourtman/pulse-go-rewrite/internal/utils""github.com/rs/zerolog")@@ -57,20 +58,21 @@ func main() {}func loadConfig() dockeragent.Config {- envURL := strings.TrimSpace(os.Getenv("PULSE_URL"))- envToken := strings.TrimSpace(os.Getenv("PULSE_TOKEN"))- envInterval := strings.TrimSpace(os.Getenv("PULSE_INTERVAL"))- envHostname := strings.TrimSpace(os.Getenv("PULSE_HOSTNAME"))- envAgentID := strings.TrimSpace(os.Getenv("PULSE_AGENT_ID"))- envInsecure := strings.TrimSpace(os.Getenv("PULSE_INSECURE_SKIP_VERIFY"))- envNoAutoUpdate := strings.TrimSpace(os.Getenv("PULSE_NO_AUTO_UPDATE"))- envTargets := strings.TrimSpace(os.Getenv("PULSE_TARGETS"))- envContainerStates := strings.TrimSpace(os.Getenv("PULSE_CONTAINER_STATES"))- envSwarmScope := strings.TrimSpace(os.Getenv("PULSE_SWARM_SCOPE"))- envSwarmServices := strings.TrimSpace(os.Getenv("PULSE_SWARM_SERVICES"))- envSwarmTasks := strings.TrimSpace(os.Getenv("PULSE_SWARM_TASKS"))- envIncludeContainers := strings.TrimSpace(os.Getenv("PULSE_INCLUDE_CONTAINERS"))- envCollectDisk := strings.TrimSpace(os.Getenv("PULSE_COLLECT_DISK"))+ envURL := utils.GetenvTrim("PULSE_URL")+ envToken := utils.GetenvTrim("PULSE_TOKEN")+ envInterval := utils.GetenvTrim("PULSE_INTERVAL")+ envHostname := utils.GetenvTrim("PULSE_HOSTNAME")+ envAgentID := utils.GetenvTrim("PULSE_AGENT_ID")+ envInsecure := utils.GetenvTrim("PULSE_INSECURE_SKIP_VERIFY")+ envNoAutoUpdate := utils.GetenvTrim("PULSE_NO_AUTO_UPDATE")+ envTargets := utils.GetenvTrim("PULSE_TARGETS")+ envRuntime := utils.GetenvTrim("PULSE_RUNTIME")+ envContainerStates := utils.GetenvTrim("PULSE_CONTAINER_STATES")+ envSwarmScope := utils.GetenvTrim("PULSE_SWARM_SCOPE")+ envSwarmServices := utils.GetenvTrim("PULSE_SWARM_SERVICES")+ envSwarmTasks := utils.GetenvTrim("PULSE_SWARM_TASKS")+ envIncludeContainers := utils.GetenvTrim("PULSE_INCLUDE_CONTAINERS")+ envCollectDisk := utils.GetenvTrim("PULSE_COLLECT_DISK")defaultInterval := 30 * time.Secondif envInterval != "" {@@ -86,22 +88,22 @@ func loadConfig() dockeragent.Config {includeServicesDefault := trueif envSwarmServices != "" {- includeServicesDefault = parseBool(envSwarmServices)+ includeServicesDefault = utils.ParseBool(envSwarmServices)}includeTasksDefault := trueif envSwarmTasks != "" {- includeTasksDefault = parseBool(envSwarmTasks)+ includeTasksDefault = utils.ParseBool(envSwarmTasks)}includeContainersDefault := trueif envIncludeContainers != "" {- includeContainersDefault = parseBool(envIncludeContainers)+ includeContainersDefault = utils.ParseBool(envIncludeContainers)}collectDiskDefault := trueif envCollectDisk != "" {- collectDiskDefault = parseBool(envCollectDisk)+ collectDiskDefault = utils.ParseBool(envCollectDisk)}urlFlag := flag.String("url", envURL, "Pulse server URL (e.g. http://pulse:7655)")@@ -109,8 +111,9 @@ func loadConfig() dockeragent.Config {intervalFlag := flag.Duration("interval", defaultInterval, "Reporting interval (e.g. 30s)")hostnameFlag := flag.String("hostname", envHostname, "Override hostname reported to Pulse")agentIDFlag := flag.String("agent-id", envAgentID, "Override agent identifier")- insecureFlag := flag.Bool("insecure", parseBool(envInsecure), "Skip TLS certificate verification")- noAutoUpdateFlag := flag.Bool("no-auto-update", parseBool(envNoAutoUpdate), "Disable automatic agent updates")+ insecureFlag := flag.Bool("insecure", utils.ParseBool(envInsecure), "Skip TLS certificate verification")+ noAutoUpdateFlag := flag.Bool("no-auto-update", utils.ParseBool(envNoAutoUpdate), "Disable automatic agent updates")+ runtimeFlag := flag.String("runtime", envRuntime, "Container runtime to expect (auto, docker, podman)")var targetFlags stringFlagListflag.Var(&targetFlags, "target", "Pulse target in url|token[|insecure] format. Repeat to send to multiple Pulse instances")var containerStateFlags stringFlagList@@ -182,6 +185,7 @@ func loadConfig() dockeragent.Config {Targets: targets,ContainerStates: containerStates,SwarmScope: strings.ToLower(strings.TrimSpace(*swarmScopeFlag)),+ Runtime: strings.ToLower(strings.TrimSpace(*runtimeFlag)),IncludeServices: *includeServicesFlag,IncludeTasks: *includeTasksFlag,IncludeContainers: *includeContainersFlag,@@ -189,15 +193,6 @@ func loadConfig() dockeragent.Config {}}-func parseBool(value string) bool {- switch strings.ToLower(strings.TrimSpace(value)) {- case "1", "true", "yes", "y", "on":- return true- default:- return false- }-}-func parseTargetSpecs(specs []string) ([]dockeragent.TargetConfig, error) {targets := make([]dockeragent.TargetConfig, 0, len(specs))for _, spec := range specs {diff --git a/cmd/pulse-host-agent/main.go b/cmd/pulse-host-agent/main.goindex b8ec5afbdf..379761d70f 100644--- a/cmd/pulse-host-agent/main.go+++ b/cmd/pulse-host-agent/main.go@@ -11,6 +11,7 @@ import ("time""github.com/rcourtman/pulse-go-rewrite/internal/hostagent"+ "github.com/rcourtman/pulse-go-rewrite/internal/utils""github.com/rs/zerolog")@@ -60,14 +61,14 @@ func main() {}func loadConfig() hostagent.Config {- envURL := strings.TrimSpace(os.Getenv("PULSE_URL"))- envToken := strings.TrimSpace(os.Getenv("PULSE_TOKEN"))- envInterval := strings.TrimSpace(os.Getenv("PULSE_INTERVAL"))- envHostname := strings.TrimSpace(os.Getenv("PULSE_HOSTNAME"))- envAgentID := strings.TrimSpace(os.Getenv("PULSE_AGENT_ID"))- envInsecure := strings.TrimSpace(os.Getenv("PULSE_INSECURE_SKIP_VERIFY"))- envTags := strings.TrimSpace(os.Getenv("PULSE_TAGS"))- envRunOnce := strings.TrimSpace(os.Getenv("PULSE_ONCE"))+ envURL := utils.GetenvTrim("PULSE_URL")+ envToken := utils.GetenvTrim("PULSE_TOKEN")+ envInterval := utils.GetenvTrim("PULSE_INTERVAL")+ envHostname := utils.GetenvTrim("PULSE_HOSTNAME")+ envAgentID := utils.GetenvTrim("PULSE_AGENT_ID")+ envInsecure := utils.GetenvTrim("PULSE_INSECURE_SKIP_VERIFY")+ envTags := utils.GetenvTrim("PULSE_TAGS")+ envRunOnce := utils.GetenvTrim("PULSE_ONCE")defaultInterval := 30 * time.Secondif envInterval != "" {@@ -81,8 +82,8 @@ func loadConfig() hostagent.Config {intervalFlag := flag.Duration("interval", defaultInterval, "Reporting interval (e.g. 30s, 1m)")hostnameFlag := flag.String("hostname", envHostname, "Override hostname reported to Pulse")agentIDFlag := flag.String("agent-id", envAgentID, "Override agent identifier")- insecureFlag := flag.Bool("insecure", parseBool(envInsecure), "Skip TLS certificate verification")- runOnceFlag := flag.Bool("once", parseBool(envRunOnce), "Collect and send a single report, then exit")+ insecureFlag := flag.Bool("insecure", utils.ParseBool(envInsecure), "Skip TLS certificate verification")+ runOnceFlag := flag.Bool("once", utils.ParseBool(envRunOnce), "Collect and send a single report, then exit")showVersion := flag.Bool("version", false, "Print the agent version and exit")var tagFlags multiValue@@ -143,12 +144,3 @@ func gatherTags(env string, flags []string) []string {}return tags}--func parseBool(value string) bool {- switch strings.ToLower(strings.TrimSpace(value)) {- case "1", "true", "yes", "y", "on":- return true- default:- return false- }-}diff --git a/cmd/pulse/main.go b/cmd/pulse/main.goindex 082d975ecd..42931d58d2 100644--- a/cmd/pulse/main.go+++ b/cmd/pulse/main.go@@ -239,10 +239,9 @@ func runServer() {// Reload system.jsonpersistence := config.NewConfigPersistence(cfg.DataPath)if persistence != nil {- if sysConfig, err := persistence.LoadSystemSettings(); err == nil {+ if _, err := persistence.LoadSystemSettings(); err == nil {// Note: Polling interval is now hardcoded to 10s, no longer configurable// Could reload other system.json settings here- _ = sysConfig // Avoid unused variable warninglog.Info().Msg("Reloaded system configuration")} else {log.Error().Err(err).Msg("Failed to reload system.json")diff --git a/docker-compose.parallel.yml b/docker-compose.parallel.ymldeleted file mode 100644index 6744eed780..0000000000--- a/docker-compose.parallel.yml+++ /dev/null@@ -1,43 +0,0 @@-version: "3.8"--x-codex-mcp-http: &codex_mcp_http- build: .- image: codex-mcp-server:latest- entrypoint: /bin/sh- command: >- -c 'pip install --quiet --disable-pip-version-check uvicorn starlette sse-starlette &&- mkdir -p /root/.config &&- cp -r /gh-config-source /root/.config/gh &&- exec python /app/server.py'- volumes:- - /usr/local/bin/codex:/usr/local/bin/codex:ro- - /usr/local/lib/node_modules/@openai/codex:/usr/local/lib/node_modules/@openai/codex:ro- - /usr/local/lib/node_modules/@openai/codex/vendor:/usr/local/vendor:ro- - /tmp:/tmp- - /home/pulse/.codex:/root/.codex- - /home/pulse/.config/gh:/gh-config-source:ro- - /opt/pulse:/opt/pulse- - /opt/pulse/.mcp-servers/codex/server_http_fixed.py:/app/server.py:ro- environment:- HOME: /root- labels:- com.pulse.project: "codex-mcp"--services:- codex-parallel-1:- <<: *codex_mcp_http- container_name: codex-parallel-1- ports:- - "18765:8765"-- codex-parallel-2:- <<: *codex_mcp_http- container_name: codex-parallel-2- ports:- - "18766:8765"-- codex-parallel-3:- <<: *codex_mcp_http- container_name: codex-parallel-3- ports:- - "18767:8765"diff --git a/docker-entrypoint.sh b/docker-entrypoint.shold mode 100644new mode 100755diff --git a/docs/API.md b/docs/API.mdindex ce4c720991..62676d83ec 100644--- a/docs/API.md+++ b/docs/API.md@@ -49,8 +49,10 @@ docker run -e API_TOKENS=token-a,token-b rcourtman/pulse:latest# With API token (header)curl -H "X-API-Token: your-secure-token" http://localhost:7655/api/health-# With API Token (query parameter, for export/import)-curl "http://localhost:7655/api/export?token=your-secure-token"+# With API token (Authorization header)+curl -H "Authorization: Bearer your-secure-token" http://localhost:7655/api/health++# (Query parameters are rejected to avoid leaking tokens in logs or referrers.)# With session cookie (after login)curl -b cookies.txt http://localhost:7655/api/health@@ -125,8 +127,6 @@ Response:"status": "healthy","timestamp": 1754995749,"uptime": 166.187561244,- "legacySSHDetected": false,- "recommendProxyUpgrade": false,"proxyInstallScriptAvailable": true,"devModeSSH": false}@@ -218,7 +218,7 @@ Each service entry lists offline daemons in `message` when present (for example,### Scheduler Health-**New in v4.24.0:** Monitor Pulse's internal adaptive polling scheduler and circuit breaker status.+Monitor Pulse's internal adaptive polling scheduler and circuit breaker status.```bashGET /api/monitoring/scheduler/health@@ -479,15 +479,22 @@ Quick setup for authentication (first-time setup).POST /api/security/quick-setup```+Authentication:+- Provide the bootstrap token in the `X-Setup-Token` header (or in the JSON payload) when no auth is configured yet.+- Once credentials exist, an authenticated admin session or API token with `settings:write` is required.+Request body:```json{"username": "admin","password": "secure-password",- "generateApiToken": true+ "apiToken": "raw-token-value",+ "setupToken": "<bootstrap-token>"}```+The bootstrap token can be read from `/.bootstrap_token` in the data directory (for example `/etc/pulse/.bootstrap_token` on bare metal or `/data/.bootstrap_token` in Docker). The token file is removed automatically after a successful setup run.+#### API Token ManagementManage API tokens for automation workflows, Docker agents, and tool integrations.diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.mdindex c39fc60df5..02bfb2f6c1 100644--- a/docs/CONFIGURATION.md+++ b/docs/CONFIGURATION.md@@ -286,7 +286,7 @@ PROXY_AUTH_LOGOUT_URL=/logout # URL for SSO logout- Set a metric to `-1` to disable it globally or per-resource (the UI shows “Off” and adds a **Custom** badge).- `timeThresholds` apply a grace period before an alert fires; `metricTimeThresholds` allow per-metric overrides (e.g., delay network alerts longer than CPU).- `overrides` are indexed by the stable resource ID returned from `/api/state` (VMs: `instance/qemu/vmid`, containers: `instance/lxc/ctid`, nodes: `instance/node`).-- `dockerIgnoredContainerPrefixes` lets you silence state/metric/restart alerts for ephemeral containers whose names or IDs share a common, case-insensitive prefix. The Docker tab in the UI keeps this list in sync.+- `dockerIgnoredContainerPrefixes` lets you silence state/metric/restart alerts for ephemeral containers whose names or IDs share a common, case-insensitive prefix. The Containers tab in the UI keeps this list in sync.- Swarm service alerts track missing replicas: `serviceWarnGapPercent` defines when a warning fires, and `serviceCriticalGapPercent` must be greater than or equal to the warning gap (Pulse automatically clamps the critical value upward if an older client submits something smaller).- Docker container state controls live in `dockerDefaults`: flip `stateDisableConnectivity` to silence exit/offline alerts globally, or change `statePoweredOffSeverity` to `critical` when you want exiting containers to page immediately. Per-container overrides still take precedence.- `dockerDefaults.disk` defines the writable-layer usage threshold (% of the container's upper filesystem compared to its base image). Defaults trigger at 85% and clear at 80%, and can be overridden per container or host when noisy workloads need a different window.diff --git a/docs/DOCKER.md b/docs/DOCKER.mdindex 2886c06665..f3f66212c8 100644--- a/docs/DOCKER.md+++ b/docs/DOCKER.md@@ -13,9 +13,10 @@ docker run -d \rcourtman/pulse:latest```-1. Access at `http://your-server:7655`-2. **Complete the mandatory security setup** on first access-3. Save your credentials - they won't be shown again!+1. Inspect the bootstrap token generated inside the container: `docker exec -it pulse cat /data/.bootstrap_token`+2. Access `http://your-server:7655`+3. Paste the bootstrap token when prompted, then **complete the mandatory security setup**+4. Save the generated credentials and API token—they are shown only once and the bootstrap file is deleted after success## First-Time Setup@@ -207,7 +208,7 @@ If a host remains offline, review [Troubleshooting → Docker Agent Shows Hosts## Network Discovery-**New in v4.5.0+**: Pulse automatically scans common home/office networks when running in Docker!+Pulse automatically scans common home/office networks when running in Docker.### How It Works1. Detects Docker environment automaticallydiff --git a/docs/DOCKER_MONITORING.md b/docs/DOCKER_MONITORING.mdindex 9b8f0ad1d7..b444400f68 100644--- a/docs/DOCKER_MONITORING.md+++ b/docs/DOCKER_MONITORING.md@@ -1,6 +1,6 @@-# Docker Monitoring Agent+# Docker & Podman Monitoring Agent-Pulse is focused on Proxmox VE and PBS, but many homelabs also run application stacks in Docker. The optional Pulse Docker agent turns container health and resource usage into first-class metrics that show up alongside your hypervisor data. The recommended deployment is the bundled, least-privilege systemd service that runs the static `pulse-docker-agent` binary directly on the host. That path lets the installer lock down permissions, manage upgrades automatically, and integrate with the native init system. Containerising the agent is still available for orchestrated environments, but it trades away some of those controls (and still needs the Docker socket) so treat that option as advanced.+Pulse is focused on Proxmox VE and PBS, but many homelabs also run application stacks in container runtimes such as Docker and Podman. The optional Pulse container agent turns runtime health and resource usage into first-class metrics that show up alongside your hypervisor data. The recommended deployment is the bundled, least-privilege systemd service that runs the static `pulse-docker-agent` binary directly on the host. That path lets the installer lock down permissions, manage upgrades automatically, and integrate with the native init system. Containerising the agent is still available for orchestrated environments, but it trades away some of those controls (and still needs the runtime socket) so treat that option as advanced.## What the agent reports@@ -11,7 +11,7 @@ Every check interval (30s by default) the agent collects:- Restart counters and exit codes- CPU usage, memory consumption and limits- Images, port mappings, network addresses, and start times-- Writable layer size, root filesystem size, block I/O totals, and mount metadata (shown in the Docker table drawer)+- Writable layer size, root filesystem size, block I/O totals, and mount metadata (shown in the Containers table drawer)- Read/write throughput derived from Docker block I/O counters so you can spot noisy workloads at a glance- Health-check failures, restart-loop windows, and recent exit codes (displayed in the UI under each container drawer)@@ -21,8 +21,8 @@ Data is pushed to Pulse over HTTPS using your existing API token – no inbound- Pulse v4.22.0 or newer with an API token enabled (`Settings → Security`)- API token with the `docker:report` scope (add `docker:manage` if you use remote lifecycle commands)-- Docker 20.10+ on Linux (the agent uses the Docker Engine API via the local socket)-- Access to the Docker socket (`/var/run/docker.sock`) or a configured `DOCKER_HOST`+- Docker 20.10+ **or** Podman 4.7+ on Linux (the agent talks to the runtime API socket)+- Access to the runtime socket (`/var/run/docker.sock`, `/run/podman/podman.sock`, or a `unix://` URI)- Go 1.24+ if you plan to build the binary from source## Installation@@ -44,8 +44,9 @@ Copy the binary to your Docker host (e.g. `/usr/local/bin/pulse-docker-agent`) aUse the bundled installation script (ships with Pulse v4.22.0+) to deploy and manage the agent. Replace the token placeholder with an API token generated in **Settings → Security**. Create a dedicated token for each Docker host so you can revoke individual credentials without touching others—sharing one token across many hosts makes incident response much harder. Tokens used here should include the `docker:report` scope so the agent can submit telemetry (add `docker:manage` only if you plan to issue lifecycle commands remotely).```bash-curl -fsSL http://pulse.example.com/install-docker-agent.sh \- | sudo bash -s -- --url http://pulse.example.com --token <api-token>+curl -fSL http://pulse.example.com/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \+ sudo bash /tmp/pulse-install-docker-agent.sh --url http://pulse.example.com --token <api-token> && \+ rm -f /tmp/pulse-install-docker-agent.sh```> **Why sudo?** The installer needs to drop binaries under `/usr/local/bin`, create a systemd service, and start it—actions that require root privileges. Piping to `sudo bash …` saves you from retrying if you run the command as an unprivileged user.@@ -59,12 +60,45 @@ Running the one-liner again from another Pulse server (with its own URL/token) wTo report to more than one Pulse instance from the same Docker host, repeat the `--target` flag (format: `https://pulse.example.com|<api-token>`) or export `PULSE_TARGETS` before running the script:```bash-curl -fsSL http://pulse.example.com/install-docker-agent.sh \- | sudo bash -s -- \+curl -fSL http://pulse.example.com/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \+ sudo bash /tmp/pulse-install-docker-agent.sh -- \--target https://pulse.example.com|<primary-token> \- --target https://pulse-dr.example.com|<dr-token>+ --target https://pulse-dr.example.com|<dr-token> && \+ rm -f /tmp/pulse-install-docker-agent.sh```+### Quick install for Podman (system service)++Use the multi-runtime installer when you want the agent to run against Podman as a systemd service. The script takes care of enabling `podman.socket`, creating a dedicated service account, and wiring the correct runtime socket automatically:++```bash+curl -fSL http://pulse.example.com/install-container-agent.sh -o /tmp/pulse-install-container-agent.sh && \+ sudo bash /tmp/pulse-install-container-agent.sh --runtime podman --url http://pulse.example.com --token <api-token> && \+ rm -f /tmp/pulse-install-container-agent.sh+```++The environment file lives at `/etc/pulse/pulse-docker-agent.env` and the unit is still named `pulse-docker-agent.service` for backwards compatibility. The agent exports `PULSE_RUNTIME=podman` and points both `CONTAINER_HOST` and `DOCKER_HOST` at the Podman socket (`/run/podman/podman.sock` by default). Restart the service after editing the env file with `sudo systemctl restart pulse-docker-agent`.++> **What's new for Podman?** The agent now sends pod- and compose-aware metadata for Podman hosts. Pulse surfaces pod names, infra-container markers, compose project/service identifiers, auto-update policies, and user namespace hints so you can see how containers relate without leaving the UI.++### Quick install for Podman (rootless user service)++Podman’s rootless mode works too. Run the installer as the target user and add the `--rootless` flag — no sudo required:++```bash+curl -fSL http://pulse.example.com/install-container-agent.sh -o /tmp/pulse-install-container-agent.sh && \+ bash /tmp/pulse-install-container-agent.sh --runtime podman --rootless --url http://pulse.example.com --token <api-token> && \+ rm -f /tmp/pulse-install-container-agent.sh+```++The agent binary is dropped into `~/.local/bin`, configuration lives under `~/.config/pulse`, and a user-level service (`~/.config/systemd/user/pulse-docker-agent.service`) is created. Enable lingering so the agent keeps running after you log out:++```bash+sudo loginctl enable-linger "$USER"+```++If `systemctl --user` is unavailable, the installer will print the exact command you can place in a cron job or another init system.+## Running the agentThe agent needs to know where Pulse lives and which API token to use.@@ -106,7 +140,7 @@ Use the new flags to tune the payload:If a manager cannot reach the Swarm API the agent automatically falls back to node scope so updates keep flowing.-Adjust warning and critical replica gaps (or disable service alerts entirely) under **Alerts → Thresholds → Docker** in the Pulse UI.+Adjust warning and critical replica gaps (or disable service alerts entirely) under **Alerts → Thresholds → Containers** in the Pulse UI.### Multiple Pulse instances@@ -186,6 +220,9 @@ docker run -d \| `--token`, `PULSE_TOKEN`| Pulse API token with `docker:report` scope (required). | — || `--target`, `PULSE_TARGETS` | One or more `url|token[|insecure]` entries to fan-out reports to multiple Pulse servers. Separate entries with `;` or repeat the flag. | — || `--interval`, `PULSE_INTERVAL` | Reporting cadence (supports `30s`, `1m`, etc.). | `30s` |+| `--runtime`, `PULSE_RUNTIME` | Container runtime to target (`docker`, `podman`, `auto`). | `docker` |+| `--container-socket`, `PULSE_CONTAINER_SOCKET` / `CONTAINER_HOST` | Explicit runtime socket path or `unix://` URI. | Runtime default |+| `--rootless`, `PULSE_RUNTIME_ROOTLESS` | Install/manage the agent as a user service (Podman). | Auto (rootful) || `--container-state`, `PULSE_CONTAINER_STATES` | Limit reports to specific Docker statuses (`created`, `running`, `restarting`, `removing`, `paused`, `exited`, `dead`). Separate multiple values with commas/semicolons or repeat the flag. | — || `--swarm-scope`, `PULSE_SWARM_SCOPE` | Swarm data scope: `node`, `cluster`, or `auto` (auto picks cluster on managers, node on workers). | `node` || `--swarm-services`, `PULSE_SWARM_SERVICES` | Include Swarm service summaries in reports. | `true` |@@ -200,20 +237,20 @@ The agent automatically discovers the Docker socket via the usual environment va### Disk usage monitoring & alerts-When `--collect-disk` is enabled (the default), Pulse records each container’s writable layer and root filesystem sizes. The Alerts engine treats the proportion of writable data to total filesystem as the disk usage percentage for that container. A fleet-wide threshold lives under **Alerts → Thresholds → Docker Containers** and defaults to 85% trigger / 80% clear; adjust or disable it per host/container when your workload makes heavy use of copy-on-write layers. Containers that stop reporting disk metrics (for example when size queries are disabled) automatically skip the disk alert evaluation.+When `--collect-disk` is enabled (the default), Pulse records each container’s writable layer and root filesystem sizes. The Alerts engine treats the proportion of writable data to total filesystem as the disk usage percentage for that container. A fleet-wide threshold lives under **Alerts → Thresholds → Containers** and defaults to 85% trigger / 80% clear; adjust or disable it per host/container when your workload makes heavy use of copy-on-write layers. Containers that stop reporting disk metrics (for example when size queries are disabled) automatically skip the disk alert evaluation.### Suppressing ephemeral containers-CI runners and short-lived build containers can generate noisy state alerts when they exit on schedule. In Pulse v4.24.0 and later you can provide a list of prefixes to ignore under **Alerts → Thresholds → Docker → Ignored container prefixes**. Any container whose name *or* ID begins with a configured prefix is skipped for state, health, metric, restart-loop, and OOM alerts. Matching is case-insensitive and the list is saved as `dockerIgnoredContainerPrefixes` inside `alerts.json`. Use one entry per family of ephemeral containers (for example, `runner-` or `gitlab-job-`).+CI runners and short-lived build containers can generate noisy state alerts when they exit on schedule. In Pulse v4.24.0 and later you can provide a list of prefixes to ignore under **Alerts → Thresholds → Containers → Ignored container prefixes**. Any container whose name *or* ID begins with a configured prefix is skipped for state, health, metric, restart-loop, and OOM alerts. Matching is case-insensitive and the list is saved as `dockerIgnoredContainerPrefixes` inside `alerts.json`. Use one entry per family of ephemeral containers (for example, `runner-` or `gitlab-job-`).-Need the alerts but at a different tone? The same Docker tab exposes global controls for the container state detector. Flip **Disable container state alerts** (`stateDisableConnectivity`) to mute powered-off/offline warnings across the fleet, or change **Default severity** (`statePoweredOffSeverity`) to `critical` so unexpected exits page immediately. Individual host/container overrides still win when you need exceptions.+Need the alerts but at a different tone? The same Containers tab exposes global controls for the container state detector. Flip **Disable container state alerts** (`stateDisableConnectivity`) to mute powered-off/offline warnings across the fleet, or change **Default severity** (`statePoweredOffSeverity`) to `critical` so unexpected exits page immediately. Individual host/container overrides still win when you need exceptions.## Testing and troubleshooting- Run with `--interval 15s --insecure` in a terminal to see log output while testing.- Ensure the Pulse API token has not expired or been regenerated.- If `pulse-docker-agent` reports `Cannot connect to the Docker daemon`, verify the socket path and permissions.-- Check Pulse (`/docker` tab) for the latest heartbeat time. Hosts are marked offline if they stop reporting for >4× the configured interval.+- Check Pulse (`/containers` tab) for the latest heartbeat time. Hosts are marked offline if they stop reporting for >4× the configured interval.- Use the search box above the host grid to filter by host name, stack label, or container name. Restart loops surface in the “Issues” column and display the last five exit codes.## Removing the agentdiff --git a/docs/FAQ.md b/docs/FAQ.mdindex 83e34c7ecc..a43c166836 100644--- a/docs/FAQ.md+++ b/docs/FAQ.md@@ -93,9 +93,7 @@ Yes! When you add one cluster node, Pulse automatically discovers and monitors aReduce `metricsRetentionDays` in settings and restart### How do I monitor adaptive polling?-**New in v4.25.0:** The adaptive scheduler now exposes staleness scores, circuit breaker state, and per-resource poll metrics so you can trace why work was delayed.--**New in v4.24.0:** Pulse includes adaptive polling that automatically adjusts polling intervals based on system load.+The adaptive scheduler exposes staleness scores, circuit breaker state, and per-resource poll metrics so you can trace why work was delayed. Adaptive polling automatically adjusts polling intervals based on system load.**Monitor adaptive polling:**- **Dashboard**: Settings → System → Monitoring shows scheduler health status@@ -114,8 +112,7 @@ Reduce `metricsRetentionDays` in settings and restartSee [Adaptive Polling Documentation](monitoring/ADAPTIVE_POLLING.md) for complete details.### What's new about rate limiting in v4.25.0?-**New in v4.25.0:** Adaptive polling metrics and circuit breaker states are now exposed alongside rate-limit headers, making throttling decisions easier to interpret.-Pulse now returns standard rate limit headers with all API responses:+Adaptive polling metrics and circuit breaker states are exposed alongside rate-limit headers, making throttling decisions easier to interpret. Pulse returns standard rate limit headers with all API responses:**Response Headers:**- `X-RateLimit-Limit`: Maximum requests allowed per window (e.g., 500)@@ -219,8 +216,8 @@ Open **Alerts → History** and click an entry. The right-hand panel now shows aYes. When Ceph-backed storage (RBD or CephFS) is detected, Pulse queries `/cluster/ceph/status` and `/cluster/ceph/df` and surfaces the results on the **Storage → Ceph** drawer and via `/api/state` → `cephClusters`. You get cluster health, daemon counts, placement groups, and per-pool capacity without any additional configuration.If those sections stay empty, follow [Troubleshooting → Ceph Cluster Data Missing](TROUBLESHOOTING.md#ceph-cluster-data-missing).-### Why does a Docker host show as offline in the Docker tab?-First, confirm the agent is still running (`systemctl status pulse-docker-agent` or `docker ps`). If it is, check the Issues column for restart-loop notes and verify the host’s last heartbeat under **Details**. Still stuck? Walk through [Troubleshooting → Docker Agent Shows Hosts Offline](TROUBLESHOOTING.md#docker-agent-shows-hosts-offline) for a step-by-step checklist.+### Why does a container host show as offline in the Containers tab?+First, confirm the agent is still running (`systemctl status pulse-docker-agent` or `docker ps`). If it is, check the Issues column for restart-loop notes and verify the host’s last heartbeat under **Details**. Still stuck? Walk through [Troubleshooting → Container Agent Shows Hosts Offline](TROUBLESHOOTING.md#container-agent-shows-hosts-offline) for a step-by-step checklist.## Updates@@ -229,7 +226,7 @@ First, confirm the agent is still running (`systemctl status pulse-docker-agent`- **Manual/systemd**: Run the install script again: `curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash`### Can I roll back if an update misbehaves?-**New in v4.24.0:** Yes! Pulse now retains previous versions and provides easy rollback.+Pulse retains previous versions and provides easy rollback.**Via UI (Recommended):**1. Navigate to **Settings → System → Updates**@@ -265,7 +262,7 @@ Check rollback logs: `journalctl -u pulse | grep rollback`- **Docker**: launch with a versioned tag instead of `latest`, e.g. `docker run -d --name pulse -p 7655:7655 rcourtman/pulse:v4.24.0`### How do I adjust logging without restarting?-**New in v4.24.0:** Pulse supports runtime logging configuration—no restart required!+Pulse supports runtime logging configuration—no restart required.**Via UI:**1. Navigate to **Settings → System → Logging**diff --git a/docs/HOST_AGENT.md b/docs/HOST_AGENT.mdindex e73150e814..5f95921331 100644--- a/docs/HOST_AGENT.md+++ b/docs/HOST_AGENT.md@@ -3,14 +3,14 @@The Pulse host agent extends monitoring to standalone servers that do not exposeProxmox or Docker APIs. With it you can surface uptime, OS metadata, CPU load,memory/disk utilisation, and connection health for any Linux, macOS, or Windows-machine alongside the rest of your infrastructure. Beginning with the upcoming-release the installer now handshakes with Pulse in real time so you can confirm-registration directly from the UI and receive host-agent alerts alongside your-existing Docker/Proxmox notifications.+machine alongside the rest of your infrastructure. Starting in v4.26.0 the+installer handshakes with Pulse in real time so you can confirm registration+from the UI and receive host-agent alerts alongside your existing+Docker/Proxmox notifications.## Prerequisites-- Pulse `main` (or a release that includes `/api/agents/host/report`)+- Pulse v4.26.0 or newer (host agent reporting shipped with `/api/agents/host/report`)- An API token with the `host-agent:report` scope (create under **Settings → Security**)- Outbound HTTP/HTTPS connectivity from the host back to Pulsediff --git a/docs/INSTALL.md b/docs/INSTALL.mdindex cac0acaf28..3fc0e681e5 100644--- a/docs/INSTALL.md+++ b/docs/INSTALL.md@@ -13,6 +13,23 @@ The installer will prompt you for the port (default: 7655). To skip the prompt,FRONTEND_PORT=8080 curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash```+### First-Time Authentication Bootstrap++Pulse protects the initial Quick Security Setup screen with a one-time bootstrap token. After the service starts, read the token from the data directory before opening the UI:++| Deployment | Token Path |+|------------|------------|+| Standard install / Proxmox LXC | `/etc/pulse/.bootstrap_token` |+| Docker container | `/data/.bootstrap_token` inside the container or the mounted host volume |+| Helm / Kubernetes | The persistent volume mounted at `/data` |++1. SSH to the host (or `docker exec` into the container).+2. Display the token: `cat /etc/pulse/.bootstrap_token` (adjust the path per the table).+3. When the UI prompts for setup, paste the token into the dialog or send it as the `X-Setup-Token` header for API calls.+4. The token is deleted automatically after setup succeeds; remove the file manually if you abort the wizard and need a new token.++If you preconfigure `PULSE_AUTH_USER`/`PULSE_AUTH_PASS`, OIDC, or proxy auth, the bootstrap token is ignored because authentication is already in place.+## Installation Methods### Proxmox VE Hosts@@ -107,8 +124,8 @@ systemctl status pulse-update.timer # Check status- Creates backup before updating- Automatically rolls back if update fails- Logs all activity to systemd journal-- **New in v4.25.0**: Adaptive monitoring now ships with circuit breakers, staleness tracking, and richer poll metrics while the Helm chart streamlines Kubernetes installs bundled with the binary.-- **New in v4.24.0**: Rollback history is retained in Settings → System → Updates; use the new 'Restore previous version' button if the latest build regresses+- Adaptive monitoring ships with circuit breakers, staleness tracking, and richer poll metrics, and the bundled Helm chart mirrors these defaults for Kubernetes clusters.+- Rollback history is retained in Settings → System → Updates; use the **Restore previous version** button if the latest build regresses.#### View Update Logs```bash@@ -139,7 +156,7 @@ docker run -d --name pulse -p 7655:7655 -v pulse_data:/data rcourtman/pulse:late### Rollback to Previous Version-**New in v4.25.0:** Pulse retains previous versions and allows easy rollback if an update causes issues, now backed by detailed scheduler metrics so you can see why a rollback triggered.+Pulse retains previous versions and allows easy rollback if an update causes issues, backed by detailed scheduler metrics so you can see why a rollback triggered.#### Via UI (Recommended)1. Navigate to **Settings → System → Updates**@@ -188,7 +205,7 @@ curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | b### Runtime Logging Configuration-**New in v4.25.0:** Adjust logging settings without restarting Pulse; the structured logging subsystem now centralizes format, destinations, and rotation controls.+Adjust logging settings without restarting Pulse; the structured logging subsystem centralizes format, destinations, and rotation controls.#### Via UINavigate to **Settings → System → Logging** to configure:@@ -210,7 +227,7 @@ docker run -e LOG_LEVEL=debug -e LOG_FORMAT=json rcourtman/pulse:latest### Adaptive Polling-**New in v4.25.0:** Adaptive polling now publishes staleness scores, circuit breaker states, and poll timings in `/api/monitoring/scheduler/health`, giving operators context when the scheduler slows down.+Adaptive polling publishes staleness scores, circuit breaker states, and poll timings in `/api/monitoring/scheduler/health`, giving operators context when the scheduler slows down.## Troubleshootingdiff --git a/docs/KUBERNETES.md b/docs/KUBERNETES.mdindex 95b1839092..83e3da20fa 100644--- a/docs/KUBERNETES.md+++ b/docs/KUBERNETES.md@@ -2,7 +2,7 @@Deploy Pulse to Kubernetes with the bundled Helm chart under `deploy/helm/pulse`. The chart provisions the Pulse hub (web UI + API) and can optionally run the Docker monitoring agent alongside it. Stable builds are published automatically to the GitHub Container Registry (GHCR) whenever a Pulse release goes out.-> **New in v4.25.0:** The Helm chart is shipped with the release archives and pairs with the upgraded monitoring engine (staleness tracking, circuit breakers, detailed poll metrics) so Kubernetes clusters benefit from the same adaptive scheduling improvements as bare-metal installs.+> The Helm chart ships with the release archives and pairs with the upgraded monitoring engine (staleness tracking, circuit breakers, detailed poll metrics) so Kubernetes clusters benefit from the same adaptive scheduling improvements as bare-metal installs.## Prerequisitesdiff --git a/docs/PORT_CONFIGURATION.md b/docs/PORT_CONFIGURATION.mdindex 7c95024f79..745dc4e828 100644--- a/docs/PORT_CONFIGURATION.md+++ b/docs/PORT_CONFIGURATION.md@@ -2,7 +2,7 @@Pulse supports multiple ways to configure the frontend port (default: 7655).-> **Development tip:** The hot-reload scripts (`scripts/dev-hot.sh`, `scripts/hot-dev.sh`, and `make dev-hot`) load `.env`, `.env.local`, and `.env.dev`. Set `FRONTEND_PORT` or `PULSE_DEV_API_PORT` there to run the backend on a different port while keeping the generated `curl` commands and Vite proxy in sync.+> **Development tip:** The hot-reload workflow (`scripts/hot-dev.sh` or `make dev-hot`) loads `.env`, `.env.local`, and `.env.dev`. Set `FRONTEND_PORT` or `PULSE_DEV_API_PORT` there to run the backend on a different port while keeping the generated `curl` commands and Vite proxy in sync.## Recommended Methodsdiff --git a/docs/README.md b/docs/README.mdnew file mode 100644index 0000000000..f29a8fb6e1--- /dev/null+++ b/docs/README.md@@ -0,0 +1,59 @@+# Pulse Documentation Index++Use this index to navigate the documentation bundled with the repository. Each+section groups related guides so you can jump straight to the material you need.++---++## Getting Started++- [INSTALL.md](INSTALL.md) – Installation guide covering script, Docker, and Helm paths.+- [FAQ.md](FAQ.md) – Common questions and troubleshooting quick answers.+- [MIGRATION.md](MIGRATION.md) – Export/import process for moving between hosts.+- [DEV-QUICK-START.md](../DEV-QUICK-START.md) – Hot reload workflow for local development.++## Deployment Guides++- [DOCKER.md](DOCKER.md) – Container deployment walkthroughs and compose samples.+- [KUBERNETES.md](KUBERNETES.md) – Helm chart usage, ingress, persistence.+- [REVERSE_PROXY.md](REVERSE_PROXY.md) – nginx, Caddy, Apache, Traefik, HAProxy recipes.+- [DOCKER_MONITORING.md](DOCKER_MONITORING.md) – Docker/Podman agent installation.+- [HOST_AGENT.md](HOST_AGENT.md) – Host agent installers for Linux, macOS, Windows.+- [PORT_CONFIGURATION.md](PORT_CONFIGURATION.md) – Changing default ports and listeners.++## Operations & Monitoring++- [CONFIGURATION.md](CONFIGURATION.md) – Detailed breakdown of config files and env vars.+- [TEMPERATURE_MONITORING.md](TEMPERATURE_MONITORING.md) – Sensor proxy setup and hardening.+- [VM_DISK_MONITORING.md](VM_DISK_MONITORING.md) – Enabling guest-agent disk telemetry.+- [monitoring/](monitoring/) – Adaptive polling and Prometheus metric references.+- [WEBHOOKS.md](WEBHOOKS.md) – Notification providers and payload templates.+- [TROUBLESHOOTING.md](TROUBLESHOOTING.md) – Deep dive into common operational issues.++## Security++- [SECURITY.md](../SECURITY.md) – Canonical security policy (root-level document).+- [docs/security/](security/) – Sensor proxy network and hardening guidance.+- [PROXY_AUTH.md](PROXY_AUTH.md) – Authenticating via Authentik, Authelia, etc.+- [TEMPERATURE_MONITORING_SECURITY.md](TEMPERATURE_MONITORING_SECURITY.md) – Legacy SSH considerations.++## Reference++- [API.md](API.md) – REST API overview with examples.+- [api/SCHEDULER_HEALTH.md](api/SCHEDULER_HEALTH.md) – Adaptive scheduler API schema.+- [RELEASE_NOTES.md](RELEASE_NOTES.md) – Latest feature highlights and changes.+- [SCREENSHOTS.md](SCREENSHOTS.md) – UI tour with annotated screenshots.+- [DOCKER_HUB_README.md](DOCKER_HUB_README.md) – Summarised feature list for registries.++## Development & Contribution++- [CONTRIBUTING.md](../CONTRIBUTING.md) – Repository-wide contribution guide.+- [CONTRIBUTING-SCRIPTS.md](CONTRIBUTING-SCRIPTS.md) – Expectations for installer contributors.+- [script-library-guide.md](script-library-guide.md) – Working with shared Bash modules.+- [installer-v2-rollout.md](installer-v2-rollout.md) – Process for shipping major installer updates.+- [development/MOCK_MODE.md](development/MOCK_MODE.md) – Using mock data while developing.+- [MIGRATION_SCAFFOLDING.md](../MIGRATION_SCAFFOLDING.md) – Tracking temporary migration code.++Have an idea for a new guide? Update this index when you add documentation so+discoverability stays high.+diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.mdindex e0d397d358..9cd9a86667 100644--- a/docs/TROUBLESHOOTING.md+++ b/docs/TROUBLESHOOTING.md@@ -300,9 +300,9 @@ Or if Pulse is installed:**Tip**: Selecting bars in the chart cross-highlights matching rows. If that does not happen, confirm you do not have browser extensions that block pointer events on canvas elements.-### Docker Agent Shows Hosts Offline+### Container Agent Shows Hosts Offline-**Symptoms**: `/docker` tab marks hosts as offline or missing container metrics.+**Symptoms**: `/containers` tab marks hosts as offline or missing container metrics.**Checklist:**1. Run the agent manually with verbose logs:@@ -318,7 +318,7 @@ Or if Pulse is installed:4. Verify Pulse shows a recent heartbeat (`lastSeen`) in `/api/state` → `dockerHosts`. Hosts are marked offline after 4× the configured interval with no update.5. For reverse proxies/TLS issues, append `--insecure` temporarily to confirm whether certificate validation is the culprit.-**Restart loops**: The Docker workspace Issues column lists the last exit codes. Investigate recurring non-zero codes in `docker logs <container>` and adjust restart policy if needed.+**Restart loops**: The Containers workspace Issues column lists the last exit codes. Investigate recurring non-zero codes in `docker logs <container>` and adjust restart policy if needed.**Step 3: Check Pulse logs**diff --git a/docs/api/SCHEDULER_HEALTH.md b/docs/api/SCHEDULER_HEALTH.mdindex 6d95aa07ff..2b2332fb2b 100644--- a/docs/api/SCHEDULER_HEALTH.md+++ b/docs/api/SCHEDULER_HEALTH.md@@ -1,6 +1,6 @@# Scheduler Health API-**New in v4.24.0**+Adaptive scheduler health endpointEndpoint: `GET /api/monitoring/scheduler/health`@@ -86,7 +86,7 @@ Each element gives a complete view of one instance.| `lastSuccess` | timestamp nullable | RFC 3339 timestamp of most recent successful poll || `lastError` | object nullable | `{ at, message, category }` where `at` is RFC 3339, `message` describes the error, and `category` is `transient` (network issues, timeouts) or `permanent` (auth failures, invalid config) || `consecutiveFailures` | integer | Current failure streak length (resets on successful poll) |-| `firstFailureAt` | timestamp nullable | **New in v4.24.0**: RFC 3339 timestamp when the current failure streak began. Useful for calculating failure duration |+| `firstFailureAt` | timestamp nullable | RFC 3339 timestamp when the current failure streak began. Useful for calculating failure duration |**Timing Metadata (v4.24.0+):**- `firstFailureAt`: Tracks when a failure streak started, enabling "failing for X minutes" calculations@@ -98,10 +98,10 @@ Each element gives a complete view of one instance.| Field | Type | Description ||-------|------|-------------|| `state` | string | `closed` (healthy), `open` (failing), `half_open` (testing recovery), or `unknown` (not initialized) |-| `since` | timestamp nullable | **New in v4.24.0**: RFC 3339 timestamp when the current state began. Use to calculate how long a breaker has been open |-| `lastTransition` | timestamp nullable | **New in v4.24.0**: RFC 3339 timestamp of the most recent state change (e.g., closed → open) |-| `retryAt` | timestamp nullable | **New in v4.24.0**: RFC 3339 timestamp of next scheduled retry attempt when breaker is open or half-open |-| `failureCount` | integer | **New in v4.24.0**: Number of failures in the current breaker cycle. Resets when breaker closes |+| `since` | timestamp nullable | RFC 3339 timestamp when the current state began. Use to calculate how long a breaker has been open |+| `lastTransition` | timestamp nullable | RFC 3339 timestamp of the most recent state change (e.g., closed → open) |+| `retryAt` | timestamp nullable | RFC 3339 timestamp of next scheduled retry attempt when breaker is open or half-open |+| `failureCount` | integer | Number of failures in the current breaker cycle. Resets when breaker closes |**Circuit Breaker Timing (v4.24.0+):**- `since`: When did the current state start? (e.g., "breaker has been open for 5 minutes")diff --git a/docs/development/MOCK_MODE.md b/docs/development/MOCK_MODE.mdnew file mode 100644index 0000000000..0516821b58--- /dev/null+++ b/docs/development/MOCK_MODE.md@@ -0,0 +1,106 @@+# Mock Mode Development Guide++Pulse ships with a mock data pipeline so you can iterate on UI and backend+changes without touching real infrastructure. This guide collects everything you+need to know about running in mock mode during development.++---++## Why Mock Mode?++- Exercise dashboards, alert timelines, and charts with predictable sample data.+- Reproduce edge cases (offline nodes, noisy containers, backup failures) by+ tweaking configuration values rather than waiting for production incidents.+- Swap between synthetic and live data without rebuilding services.++---++## Starting the Dev Stack++```bash+# Launch backend + frontend with hot reload+./scripts/hot-dev.sh+```++The script exposes:+- Frontend: `http://localhost:7655` (Vite hot module reload)+- Backend API: `http://localhost:7656`++---++## Toggling Mock Data++The npm helpers and `toggle-mock.sh` wrapper point the backend at different+`.env` files and restart the relevant services automatically.++```bash+npm run mock:on # Enable mock mode+npm run mock:off # Return to real data+npm run mock:status # Display current state+npm run mock:edit # Open mock.env in $EDITOR+```++Equivalent shell invocations:++```bash+./scripts/toggle-mock.sh on+./scripts/toggle-mock.sh off+./scripts/toggle-mock.sh status+```++When switching:+- `mock.env` (or `mock.env.local`) feeds configuration values to the backend.+- `PULSE_DATA_DIR` swaps between `/opt/pulse/tmp/mock-data` (synthetic) and+ `/etc/pulse` (real data) so test credentials never mix with production ones.+- The backend process restarts; the frontend stays hot-reloading.++---++## Customising Mock Fixtures++`mock.env` exposes the knobs most developers care about:++```bash+PULSE_MOCK_MODE=false # Enable/disable mock mode+PULSE_MOCK_NODES=7 # Number of synthetic nodes+PULSE_MOCK_VMS_PER_NODE=5 # Average VM count per node+PULSE_MOCK_LXCS_PER_NODE=8 # Average container count per node+PULSE_MOCK_RANDOM_METRICS=true # Toggle metric jitter+PULSE_MOCK_STOPPED_PERCENT=20 # Percentage of guests stopped/offline+```++Create `mock.env.local` for personal tweaks that should not be committed:++```bash+cp mock.env mock.env.local+$EDITOR mock.env.local+```++The toggle script prioritises `.local` files, falling back to the shared+defaults when none are present.++---++## Troubleshooting++- **Backend did not restart:** flip mock mode off/on again (`npm run mock:off`,+ then `npm run mock:on`) to force a reload.+- **Ports already in use:** confirm nothing else is listening on `7655`/`7656`+ (`lsof -i :7655` / `lsof -i :7656`) and kill stray processes.+- **Data feels stale:** delete `/opt/pulse/tmp/mock-data` and toggle mock mode+ back on to regenerate fixtures.++---++## Limitations++- Mock data focuses on happy-path flows; use real Proxmox/PBS environments+ before shipping changes that touch API integrations.+- Webhook payloads are synthetically generated and omit provider-specific+ quirks—test with real channels for production rollouts.+- Encrypt/decrypt flows still use the local crypto stack; do not treat mock mode+ as a sandbox for experimenting with credential formats.++For more advanced scenarios, inspect `scripts/hot-dev.sh` and the mock seeders+under `internal/mock` for additional entry points.+diff --git a/docs/images/01-dashboard.png b/docs/images/01-dashboard.pngindex 90cf6060ab..dd2c9f93dc 100644Binary files a/docs/images/01-dashboard.png and b/docs/images/01-dashboard.png differdiff --git a/docs/images/02-storage.png b/docs/images/02-storage.pngindex d0c2cb9ee3..2e403928a6 100644Binary files a/docs/images/02-storage.png and b/docs/images/02-storage.png differdiff --git a/docs/images/03-backups.png b/docs/images/03-backups.pngindex 2374c57fd2..daf6f58d98 100644Binary files a/docs/images/03-backups.png and b/docs/images/03-backups.png differdiff --git a/docs/images/04-alerts.png b/docs/images/04-alerts.pngindex d9a1c8da91..c929ab6274 100644Binary files a/docs/images/04-alerts.png and b/docs/images/04-alerts.png differdiff --git a/docs/images/05-alert-history.png b/docs/images/05-alert-history.pngindex 407835591d..8749659bca 100644Binary files a/docs/images/05-alert-history.png and b/docs/images/05-alert-history.png differdiff --git a/docs/images/06-settings.png b/docs/images/06-settings.pngindex 6e43f369be..54f00fbdb1 100644Binary files a/docs/images/06-settings.png and b/docs/images/06-settings.png differdiff --git a/docs/images/08-mobile.png b/docs/images/08-mobile.pngindex 05c9334541..e8550386b3 100644Binary files a/docs/images/08-mobile.png and b/docs/images/08-mobile.png differdiff --git a/docs/installer-v2-rollout.md b/docs/installer-v2-rollout.mdnew file mode 100644index 0000000000..e44e350135--- /dev/null+++ b/docs/installer-v2-rollout.md@@ -0,0 +1,97 @@+# Installer v2 Rollout Playbook++This playbook captures the agreed rollout process for major installer updates+(`install.sh`, host/agent installers, and supporting bundles). Use it when+cutting a new installer generation or deprecating legacy flows.++---++## 1. Define Objectives++- Document the functional changes (new flags, platforms, security updates).+- Outline compatibility expectations (supported OS versions, container+ runtimes, Proxmox releases).+- Decide which behaviours remain behind feature flags or environment toggles.++Create a tracking issue with:+- Summary of the change+- Owners for implementation, docs, and QA+- Planned release milestone++---++## 2. Build in Parallel++While the existing installer continues shipping:++1. Implement changes under `scripts/install-*-v2.sh` (keep the original script+ untouched).+2. Gate sensitive logic behind `PULSE_INSTALLER_V2` or similar flags so you can+ exercise new code paths without breaking production users.+3. Add migration scaffolding to handle legacy configs—record details in+ `MIGRATION_SCAFFOLDING.md`.++---++## 3. Testing Matrix++Cover these scenarios before merging:++| Scenario | Notes |+|----------|-------|+| Fresh install on Debian/Ubuntu | Include root + non-root invocation, interactive + `--force`. |+| Proxmox LXC creation | Validate resource sizing, storage defaults, and rollback on failure. |+| Docker / Compose flow | Ensure bind mounts, auto-hash, and setup wizard paths remain intact. |+| Upgrade in place | Re-run installer on an existing deployment; preserve data and services. |+| Air-gapped mode | Exercise `--offline` or pre-downloaded assets if supported. |+| Uninstall / cleanup | Confirm services and temp files are removed where promised. |++Automate what you can with `scripts/tests/integration/`. Record any manual+checks in the tracking issue.++---++## 4. Documentation Updates++- Update end-user docs (`docs/INSTALL.md`, Docker/Kubernetes guides) with new+ flags and workflows.+- Refresh quick-start snippets in `README.md`.+- Note behavioural changes in `docs/RELEASE_NOTES.md` under the relevant+ version once the rollout ships.+- For script contributors, update `docs/CONTRIBUTING-SCRIPTS.md` and+ `docs/script-library-guide.md` with new patterns.++---++## 5. Staged Rollout++1. Merge v2 into `main` behind a feature flag or version guard.+2. Ask beta testers to opt-in via `--use-installer-v2` (or similar).+3. Monitor GitHub issues / Discord for feedback.+4. Iterate quickly on regressions—keep the old installer intact until v2 is+ stable.++When metrics show low regression risk, switch the default path to v2 but keep+the v1 flag available for at least one stable release.++---++## 6. Sunset Legacy Paths++- Announce deprecation in release notes at least one version before removal.+- Remove the legacy flag after the deprecation window.+- Delete scaffolding and update `MIGRATION_SCAFFOLDING.md` to reflect the+ cleanup.++---++## 7. Post-Rollout Checklist++- Audit bundled artifacts (`dist/*.sh`) for unexpected diffs.+- Regenerate checksums and publish updated hashes if distributing binaries.+- Close the tracking issue with a summary of lessons learned and follow-up+ tasks (e.g., telemetry improvements).++Keeping this playbook up to date ensures future installer iterations follow the+same predictable rollout process and reduces duplicate tribal knowledge.+diff --git a/docs/monitoring/ADAPTIVE_POLLING.md b/docs/monitoring/ADAPTIVE_POLLING.mdindex 826f5ca12c..fe8a786279 100644--- a/docs/monitoring/ADAPTIVE_POLLING.md+++ b/docs/monitoring/ADAPTIVE_POLLING.md@@ -63,8 +63,8 @@ Exposed via Prometheus (`:9091/metrics`):| `pulse_monitor_poll_staleness_seconds` | gauge | `instance_type`, `instance` | Age since last success (0 on success) || `pulse_monitor_poll_queue_depth` | gauge | — | Size of priority queue || `pulse_monitor_poll_inflight` | gauge | `instance_type` | Concurrent tasks per type |-| `pulse_monitor_poll_errors_total` | counter | `instance_type`, `instance`, `category` | **New in v4.24.0**: Error counts by category (transient/permanent) |-| `pulse_monitor_poll_last_success_timestamp` | gauge | `instance_type`, `instance` | **New in v4.24.0**: Unix timestamp of last successful poll |+| `pulse_monitor_poll_errors_total` | counter | `instance_type`, `instance`, `category` | Error counts by category (transient/permanent) |+| `pulse_monitor_poll_last_success_timestamp` | gauge | `instance_type`, `instance` | Unix timestamp of last successful poll |**Alerting Recommendations:**- Alert when `pulse_monitor_poll_staleness_seconds` > 120 for critical instances@@ -185,4 +185,3 @@ Returns comprehensive scheduler health data (authentication required).- Task 8: expose scheduler health & dead-letter statistics via API and UI panels.- Task 9: add dedicated unit/integration harness for the scheduler & workers.-diff --git a/docs/script-library-guide.md b/docs/script-library-guide.mdnew file mode 100644index 0000000000..4874dd1086--- /dev/null+++ b/docs/script-library-guide.md@@ -0,0 +1,144 @@+# Pulse Script Library Guide++This guide expands on `scripts/lib/README.md` and explains how the shared Bash+modules fit together when you are building or refactoring installer scripts.++---++## Library Structure++```+scripts/+ lib/+ common.sh # Logging, error handling, retry helpers, temp dirs+ http.sh # Curl/wget wrappers, GitHub release helpers+ systemd.sh # Systemd unit management helpers+ README.md # API-level reference+```++Key conventions:++- **Namespaces:** Exported functions are declared as `module::function` (for+ example `common::run`, `systemd::create_service`). Avoid referencing private+ helpers (`module::__helper`) from other modules.+- **Development vs Bundled mode:** During local development scripts source+ modules from `scripts/lib`. Bundled artifacts produced by+ `make bundle-scripts` contain the modules inline, so the source guards remain+ but resolve to no-ops.+- **Compatibility:** The library targets Bash 5 but must run on Debian 11++ (Pulse LXC), Ubuntu LTS, and minimal container images. Stick to POSIX shell+ built-ins or guarded GNU extensions.++---++## Recommended Script Skeleton++```bash+#!/usr/bin/env bash+set -euo pipefail++LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/lib" && pwd)"+# shellcheck source=../../scripts/lib/common.sh+source "${LIB_DIR}/common.sh"+# shellcheck source=../../scripts/lib/systemd.sh+source "${LIB_DIR}/systemd.sh"++common::init "$@"+common::require_command curl tar++main() {+ common::log_info "Starting installer..."+ common::temp_dir WORKDIR --prefix pulse-+ download_payload+ install_service+}++download_payload() {+ http::download --url "${PULSE_DOWNLOAD_URL}" --output "${WORKDIR}/pulse.tar.gz"+}++install_service() {+ systemd::create_service /etc/systemd/system/pulse.service <<'UNIT'+[Unit]+Description=Pulse Monitoring+After=network-online.target+UNIT++ systemd::enable_and_start pulse.service+}++main "$@"+```++**Why this layout works**++- `common::init` centralises logging/traps and stores the original CLI args so+ you can re-exec under sudo if required (`common::ensure_root`).+- `common::temp_dir` registers a cleanup handler automatically to keep `/tmp`+ tidy.+- `systemd::create_service` respects `--dry-run` flags and prevents partial+ writes on failure.++---++## Logging and Dry-Run Practices++- Respect `PULSE_LOG_LEVEL` and `PULSE_DEBUG`—they are already wired into+ `common::log_*`.+- Wrap mutating commands in `common::run` or `common::run_capture` to inherit+ retry/backoff logic and `--dry-run` behaviour.+- Provide meaningful `--label` values on long-running steps to improve CI log+ readability.++Example:++```bash+common::run --label "Extract Pulse binary" \+ -- tar -xzf "${ARCHIVE}" -C "${TARGET_DIR}" --strip-components=1+```++When invoked with `--dry-run`, the command prints the operation instead of+executing and exits successfully—keep this in mind when writing tests.++---++## Testing Strategy++- **Smoke tests:** `scripts/tests/run.sh` lints scripts, validates manifests, and+ exercises bundle generation.+- **Integration tests:** Place scenario-specific scripts under+ `scripts/tests/integration/`. They should run quickly (<30s) and clean up+ after themselves.+- **Manual verification:** For destructive operations (e.g., provisioning an LXC+ container), run the script with `--dry-run` to confirm the steps before+ executing against real infrastructure.++When adding new library helpers, accompany them with unit coverage using+`bats` (found under `testing-tools/bats`) or an integration script that covers+the happy path and a failure case.++---++## Bundling Checklist++1. Update `scripts/bundle.manifest` with any newly created scripts.+2. Run `make bundle-scripts` (or `./scripts/bundle.sh`) to regenerate `dist/*`.+3. Inspect the diff to ensure only intentional changes appear.+4. Re-run `scripts/tests/run.sh` to catch lint and shellcheck regressions.++Bundled files embed provenance metadata (timestamp + manifest path). Do not edit+bundled artifacts by hand—always rebuild from sources.++---++## When to Extend the Library++- You need to reuse logic across two or more scripts.+- A helper hides platform-specific differences (e.g., `systemctl` vs `service`+ on legacy systems).+- The code is complex enough that centralised unit tests provide value.++Document new functions in `scripts/lib/README.md` and update this guide if usage+patterns change. Keeping these references in sync helps future contributors+avoid copy/paste or undocumented conventions.+diff --git a/frontend-modern/alert_settings_tabs.png b/frontend-modern/alert_settings_tabs.pngdeleted file mode 100644index c4a1b7db6f..0000000000Binary files a/frontend-modern/alert_settings_tabs.png and /dev/null differdiff --git a/frontend-modern/package-lock.json b/frontend-modern/package-lock.jsonindex 6d2dbcaab7..536434d71a 100644--- a/frontend-modern/package-lock.json+++ b/frontend-modern/package-lock.json@@ -11,9 +11,7 @@"dependencies": {"@solidjs/router": "^0.10.10","lucide-solid": "^0.545.0",- "simple-icons": "^13.21.0",- "solid-js": "^1.8.0",- "ws": "^8.18.3"+ "solid-js": "^1.8.0"},"devDependencies": {"@solidjs/testing-library": "^0.8.5",@@ -28,7 +26,7 @@"jsdom": "^24.1.0","postcss": "^8.4.0","prettier": "^3.3.0",- "tailwindcss": "^3.4.0",+ "tailwindcss": "^3.4.18","typescript": "^5.3.0","vite": "^6.4.1","vite-plugin-solid": "^2.8.0",@@ -4854,19 +4852,6 @@"url": "https://github.com/sponsors/isaacs"}},- "node_modules/simple-icons": {- "version": "13.21.0",- "resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-13.21.0.tgz",- "integrity": "sha512-LI5pVJPBv6oc79OMsffwb6kEqnmB8P1Cjg1crNUlhsxPETQ5UzbCKQdxU+7MW6+DD1qfPkla/vSKlLD4IfyXpQ==",- "license": "CC0-1.0",- "engines": {- "node": ">=0.12.18"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/simple-icons"- }- },"node_modules/solid-js": {"version": "1.9.7","resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.9.7.tgz",@@ -5122,10 +5107,11 @@"license": "MIT"},"node_modules/tailwindcss": {- "version": "3.4.17",- "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz",- "integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==",+ "version": "3.4.18",+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.18.tgz",+ "integrity": "sha512-6A2rnmW5xZMdw11LYjhcI5846rt9pbLSabY5XPxo+XWdxwZaFEn47Go4NzFiHu9sNNmr/kXivP1vStfvMaK1GQ==","dev": true,+ "license": "MIT","dependencies": {"@alloc/quick-lru": "^5.2.0","arg": "^5.0.2",@@ -5135,7 +5121,7 @@"fast-glob": "^3.3.2","glob-parent": "^6.0.2","is-glob": "^4.0.3",- "jiti": "^1.21.6",+ "jiti": "^1.21.7","lilconfig": "^3.1.3","micromatch": "^4.0.8","normalize-path": "^3.0.0",@@ -5144,7 +5130,7 @@"postcss": "^8.4.47","postcss-import": "^15.1.0","postcss-js": "^4.0.1",- "postcss-load-config": "^4.0.2",+ "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0","postcss-nested": "^6.2.0","postcss-selector-parser": "^6.1.2","resolve": "^1.22.8",@@ -5906,6 +5892,7 @@"version": "8.18.3","resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz","integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",+ "dev": true,"engines": {"node": ">=10.0.0"},diff --git a/frontend-modern/package.json b/frontend-modern/package.jsonindex 4ce5856e37..666c8a95d7 100644--- a/frontend-modern/package.json+++ b/frontend-modern/package.json@@ -28,11 +28,11 @@"dependencies": {"@solidjs/router": "^0.10.10","lucide-solid": "^0.545.0",- "simple-icons": "^13.21.0",- "solid-js": "^1.8.0",- "ws": "^8.18.3"+ "solid-js": "^1.8.0"},"devDependencies": {+ "@solidjs/testing-library": "^0.8.5",+ "@testing-library/jest-dom": "^6.5.0","@types/node": "^20.10.0","@typescript-eslint/eslint-plugin": "^8.0.0","@typescript-eslint/parser": "^8.0.0",@@ -40,12 +40,10 @@"eslint": "^8.57.0","eslint-config-prettier": "^9.0.0","eslint-plugin-solid": "^0.14.0",- "@solidjs/testing-library": "^0.8.5",- "@testing-library/jest-dom": "^6.5.0","jsdom": "^24.1.0","postcss": "^8.4.0","prettier": "^3.3.0",- "tailwindcss": "^3.4.0",+ "tailwindcss": "^3.4.18","typescript": "^5.3.0","vite": "^6.4.1","vite-plugin-solid": "^2.8.0",diff --git a/frontend-modern/pnpm-lock.yaml b/frontend-modern/pnpm-lock.yamldeleted file mode 100644index 847fae7ea2..0000000000--- a/frontend-modern/pnpm-lock.yaml+++ /dev/null@@ -1,3788 +0,0 @@-lockfileVersion: '9.0'--settings:- autoInstallPeers: true- excludeLinksFromLockfile: false--importers:-- .:- dependencies:- '@solidjs/router':- specifier: ^0.10.10- version: 0.10.10([email protected])- lucide-solid:- specifier: ^0.545.0- version: 0.545.0([email protected])- simple-icons:- specifier: ^13.21.0- version: 13.21.0- solid-js:- specifier: ^1.8.0- version: 1.9.10- ws:- specifier: ^8.18.3- version: 8.18.3- devDependencies:- '@solidjs/testing-library':- specifier: ^0.8.5- '@testing-library/jest-dom':- specifier: ^6.5.0- version: 6.9.1- '@types/node':- specifier: ^20.10.0- version: 20.19.24- '@typescript-eslint/eslint-plugin':- specifier: ^8.0.0- version: 8.46.2(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])- '@typescript-eslint/parser':- specifier: ^8.0.0- version: 8.46.2([email protected])([email protected])- autoprefixer:- specifier: ^10.4.0- version: 10.4.21([email protected])- eslint:- specifier: ^8.57.0- version: 8.57.1- eslint-config-prettier:- specifier: ^9.0.0- version: 9.1.2([email protected])- eslint-plugin-solid:- specifier: ^0.14.0- version: 0.14.5([email protected])([email protected])- jsdom:- specifier: ^24.1.0- version: 24.1.3- postcss:- specifier: ^8.4.0- version: 8.5.6- prettier:- specifier: ^3.3.0- version: 3.6.2- tailwindcss:- specifier: ^3.4.0- version: 3.4.18- typescript:- specifier: ^5.3.0- version: 5.9.3- vite:- specifier: ^6.4.1- version: 6.4.1(@types/[email protected])([email protected])- vite-plugin-solid:- specifier: ^2.8.0- version: 2.11.10(@testing-library/[email protected])([email protected])([email protected](@types/[email protected])([email protected]))- vitest:- specifier: ^3.2.4--packages:-- '@adobe/[email protected]':- resolution: {integrity: sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==}-- '@alloc/[email protected]':- resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}- engines: {node: '>=10'}-- '@asamuzakjp/[email protected]':- resolution: {integrity: sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==}-- '@babel/[email protected]':- resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==}- engines: {node: '>=6.9.0'}- peerDependencies:- '@babel/core': ^7.0.0-- '@babel/[email protected]':- resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==}- engines: {node: '>=6.0.0'}- hasBin: true-- '@babel/[email protected]':- resolution: {integrity: sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==}- engines: {node: '>=6.9.0'}- peerDependencies:- '@babel/core': ^7.0.0-0-- '@babel/[email protected]':- resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==}- engines: {node: '>=6.9.0'}-- '@babel/[email protected]':- resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}- engines: {node: '>=6.9.0'}-- '@csstools/[email protected]':- resolution: {integrity: sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==}- engines: {node: '>=18'}-- '@csstools/[email protected]':- resolution: {integrity: sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==}- engines: {node: '>=18'}- peerDependencies:- '@csstools/css-parser-algorithms': ^3.0.5- '@csstools/css-tokenizer': ^3.0.4-- '@csstools/[email protected]':- resolution: {integrity: sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==}- engines: {node: '>=18'}- peerDependencies:- '@csstools/css-parser-algorithms': ^3.0.5- '@csstools/css-tokenizer': ^3.0.4-- '@csstools/[email protected]':- resolution: {integrity: sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==}- engines: {node: '>=18'}- peerDependencies:- '@csstools/css-tokenizer': ^3.0.4-- '@csstools/[email protected]':- resolution: {integrity: sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==}- engines: {node: '>=18'}-- '@esbuild/[email protected]':- resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==}- engines: {node: '>=18'}- cpu: [ppc64]- os: [aix]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==}- engines: {node: '>=18'}- cpu: [arm64]- os: [android]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==}- engines: {node: '>=18'}- cpu: [arm]- os: [android]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==}- engines: {node: '>=18'}- cpu: [x64]- os: [android]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==}- engines: {node: '>=18'}- cpu: [arm64]- os: [darwin]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==}- engines: {node: '>=18'}- cpu: [x64]- os: [darwin]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==}- engines: {node: '>=18'}- cpu: [arm64]- os: [freebsd]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==}- engines: {node: '>=18'}- cpu: [x64]- os: [freebsd]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==}- engines: {node: '>=18'}- cpu: [arm64]- os: [linux]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==}- engines: {node: '>=18'}- cpu: [arm]- os: [linux]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==}- engines: {node: '>=18'}- cpu: [ia32]- os: [linux]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==}- engines: {node: '>=18'}- cpu: [loong64]- os: [linux]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==}- engines: {node: '>=18'}- cpu: [mips64el]- os: [linux]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==}- engines: {node: '>=18'}- cpu: [ppc64]- os: [linux]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==}- engines: {node: '>=18'}- cpu: [riscv64]- os: [linux]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==}- engines: {node: '>=18'}- cpu: [s390x]- os: [linux]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==}- engines: {node: '>=18'}- cpu: [x64]- os: [linux]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==}- engines: {node: '>=18'}- cpu: [arm64]- os: [netbsd]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==}- engines: {node: '>=18'}- cpu: [x64]- os: [netbsd]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==}- engines: {node: '>=18'}- cpu: [arm64]- os: [openbsd]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==}- engines: {node: '>=18'}- cpu: [x64]- os: [openbsd]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==}- engines: {node: '>=18'}- cpu: [arm64]- os: [openharmony]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==}- engines: {node: '>=18'}- cpu: [x64]- os: [sunos]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==}- engines: {node: '>=18'}- cpu: [arm64]- os: [win32]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==}- engines: {node: '>=18'}- cpu: [ia32]- os: [win32]-- '@esbuild/[email protected]':- resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==}- engines: {node: '>=18'}- cpu: [x64]- os: [win32]-- '@eslint-community/[email protected]':- resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==}- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}- peerDependencies:- eslint: ^6.0.0 || ^7.0.0 || >=8.0.0-- '@eslint-community/[email protected]':- resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==}- engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}-- '@eslint/[email protected]':- resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==}- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}-- '@eslint/[email protected]':- resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==}- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}-- '@humanwhocodes/[email protected]':- resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==}- engines: {node: '>=10.10.0'}- deprecated: Use @eslint/config-array instead-- '@humanwhocodes/[email protected]':- resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==}- engines: {node: '>=12.22'}-- '@humanwhocodes/[email protected]':- resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==}- deprecated: Use @eslint/object-schema instead-- '@isaacs/[email protected]':- resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}- engines: {node: '>=12'}-- '@jridgewell/[email protected]':- resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}-- '@jridgewell/[email protected]':- resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==}-- '@jridgewell/[email protected]':- resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}- engines: {node: '>=6.0.0'}-- '@jridgewell/[email protected]':- resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}-- '@jridgewell/[email protected]':- resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}-- '@nodelib/[email protected]':- resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}- engines: {node: '>= 8'}-- '@nodelib/[email protected]':- resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}- engines: {node: '>= 8'}-- '@nodelib/[email protected]':- resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}- engines: {node: '>= 8'}-- '@pkgjs/[email protected]':- resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}- engines: {node: '>=14'}-- '@rollup/[email protected]':- resolution: {integrity: sha512-8c1vW4ocv3UOMp9K+gToY5zL2XiiVw3k7f1ksf4yO1FlDFQ1C2u72iACFnSOceJFsWskc2WZNqeRhFRPzv+wtQ==}- cpu: [arm]- os: [android]-- '@rollup/[email protected]':- resolution: {integrity: sha512-mQGfsIEFcu21mvqkEKKu2dYmtuSZOBMmAl5CFlPGLY94Vlcm+zWApK7F/eocsNzp8tKmbeBP8yXyAbx0XHsFNA==}- cpu: [arm64]- os: [android]-- '@rollup/[email protected]':- resolution: {integrity: sha512-takF3CR71mCAGA+v794QUZ0b6ZSrgJkArC+gUiG6LB6TQty9T0Mqh3m2ImRBOxS2IeYBo4lKWIieSvnEk2OQWA==}- cpu: [arm64]- os: [darwin]-- '@rollup/[email protected]':- resolution: {integrity: sha512-W901Pla8Ya95WpxDn//VF9K9u2JbocwV/v75TE0YIHNTbhqUTv9w4VuQ9MaWlNOkkEfFwkdNhXgcLqPSmHy0fA==}- cpu: [x64]- os: [darwin]-- '@rollup/[email protected]':- resolution: {integrity: sha512-QofO7i7JycsYOWxe0GFqhLmF6l1TqBswJMvICnRUjqCx8b47MTo46W8AoeQwiokAx3zVryVnxtBMcGcnX12LvA==}- cpu: [arm64]- os: [freebsd]-- '@rollup/[email protected]':- resolution: {integrity: sha512-jr21b/99ew8ujZubPo9skbrItHEIE50WdV86cdSoRkKtmWa+DDr6fu2c/xyRT0F/WazZpam6kk7IHBerSL7LDQ==}- cpu: [x64]- os: [freebsd]-- '@rollup/[email protected]':- resolution: {integrity: sha512-PsNAbcyv9CcecAUagQefwX8fQn9LQ4nZkpDboBOttmyffnInRy8R8dSg6hxxl2Re5QhHBf6FYIDhIj5v982ATQ==}- cpu: [arm]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-Fw4tysRutyQc/wwkmcyoqFtJhh0u31K+Q6jYjeicsGJJ7bbEq8LwPWV/w0cnzOqR2m694/Af6hpFayLJZkG2VQ==}- cpu: [arm]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-a+3wVnAYdQClOTlyapKmyI6BLPAFYs0JM8HRpgYZQO02rMR09ZcV9LbQB+NL6sljzG38869YqThrRnfPMCDtZg==}- cpu: [arm64]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-AvttBOMwO9Pcuuf7m9PkC1PUIKsfaAJ4AYhy944qeTJgQOqJYJ9oVl2nYgY7Rk0mkbsuOpCAYSs6wLYB2Xiw0Q==}- cpu: [arm64]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-DkDk8pmXQV2wVrF6oq5tONK6UHLz/XcEVow4JTTerdeV1uqPeHxwcg7aFsfnSm9L+OO8WJsWotKM2JJPMWrQtA==}- cpu: [loong64]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-W/b9ZN/U9+hPQVvlGwjzi+Wy4xdoH2I8EjaCkMvzpI7wJUs8sWJ03Rq96jRnHkSrcHTpQe8h5Tg3ZzUPGauvAw==}- cpu: [ppc64]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-sjQLr9BW7R/ZiXnQiWPkErNfLMkkWIoCz7YMn27HldKsADEKa5WYdobaa1hmN6slu9oWQbB6/jFpJ+P2IkVrmw==}- cpu: [riscv64]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-hq3jU/kGyjXWTvAh2awn8oHroCbrPm8JqM7RUpKjalIRWWXE01CQOf/tUNWNHjmbMHg/hmNCwc/Pz3k1T/j/Lg==}- cpu: [riscv64]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-gn8kHOrku8D4NGHMK1Y7NA7INQTRdVOntt1OCYypZPRt6skGbddska44K8iocdpxHTMMNui5oH4elPH4QOLrFQ==}- cpu: [s390x]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-hXGLYpdhiNElzN770+H2nlx+jRog8TyynpTVzdlc6bndktjKWyZyiCsuDAlpd+j+W+WNqfcyAWz9HxxIGfZm1Q==}- cpu: [x64]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-arCGIcuNKjBoKAXD+y7XomR9gY6Mw7HnFBv5Rw7wQRvwYLR7gBAgV7Mb2QTyjXfTveBNFAtPt46/36vV9STLNg==}- cpu: [x64]- os: [linux]-- '@rollup/[email protected]':- resolution: {integrity: sha512-QoFqB6+/9Rly/RiPjaomPLmR/13cgkIGfA40LHly9zcH1S0bN2HVFYk3a1eAyHQyjs3ZJYlXvIGtcCs5tko9Cw==}- cpu: [arm64]- os: [openharmony]-- '@rollup/[email protected]':- resolution: {integrity: sha512-w0cDWVR6MlTstla1cIfOGyl8+qb93FlAVutcor14Gf5Md5ap5ySfQ7R9S/NjNaMLSFdUnKGEasmVnu3lCMqB7w==}- cpu: [arm64]- os: [win32]-- '@rollup/[email protected]':- resolution: {integrity: sha512-Aufdpzp7DpOTULJCuvzqcItSGDH73pF3ko/f+ckJhxQyHtp67rHw3HMNxoIdDMUITJESNE6a8uh4Lo4SLouOUg==}- cpu: [ia32]- os: [win32]-- '@rollup/[email protected]':- resolution: {integrity: sha512-UGBUGPFp1vkj6p8wCRraqNhqwX/4kNQPS57BCFc8wYh0g94iVIW33wJtQAx3G7vrjjNtRaxiMUylM0ktp/TRSQ==}- cpu: [x64]- os: [win32]-- '@rollup/[email protected]':- resolution: {integrity: sha512-TAcgQh2sSkykPRWLrdyy2AiceMckNf5loITqXxFI5VuQjS5tSuw3WlwdN8qv8vzjLAUTvYaH/mVjSFpbkFbpTg==}- cpu: [x64]- os: [win32]-- '@solidjs/[email protected]':- resolution: {integrity: sha512-nGl7gMgsojuaupI5MAK2cFtkndmWWSAPhill/8La3IjujY3vMBamcQFymBsA2ejzxEYJjkOlEQHYgp2jNFkwuQ==}- peerDependencies:- solid-js: ^1.8.6-- '@solidjs/[email protected]':- resolution: {integrity: sha512-qdeuIerwyq7oQTIrrKvV0aL9aFeuwTd86VYD3afdq5HYEwoox1OBTJy4y8A3TFZr8oAR0nujYgCzY/8wgHGfeQ==}- engines: {node: '>= 14'}- peerDependencies:- '@solidjs/router': '>=0.9.0'- solid-js: '>=1.0.0'- peerDependenciesMeta:- '@solidjs/router':- optional: true-- '@testing-library/[email protected]':- resolution: {integrity: sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==}- engines: {node: '>=18'}-- '@testing-library/[email protected]':- resolution: {integrity: sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==}- engines: {node: '>=14', npm: '>=6', yarn: '>=1'}-- '@types/[email protected]':- resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==}-- '@types/[email protected]':- resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}-- '@types/[email protected]':- resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==}-- '@types/[email protected]':- resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==}-- '@types/[email protected]':- resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==}-- '@types/[email protected]':- resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==}-- '@types/[email protected]':- resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}-- '@types/[email protected]':- resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}-- '@types/[email protected]':- resolution: {integrity: sha512-FE5u0ezmi6y9OZEzlJfg37mqqf6ZDSF2V/NLjUyGrR9uTZ7Sb9F7bLNZ03S4XVUNRWGA7Ck4c1kK+YnuWjl+DA==}-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-ZGBMToy857/NIPaaCucIUQgqueOiq7HeAKkhlvqVV4lm089zUFW6ikRySx2v+cAhKeUCPuWVHeimyk6Dw1iY3w==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- '@typescript-eslint/parser': ^8.46.2- eslint: ^8.57.0 || ^9.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-BnOroVl1SgrPLywqxyqdJ4l3S2MsKVLDVxZvjI1Eoe8ev2r3kGDo+PcMihNmDE+6/KjkTubSJnmqGZZjQSBq/g==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-PULOLZ9iqwI7hXcmL4fVfIsBi6AN9YxRc0frbvmg8f+4hQAjQ5GYNKK0DIArNo+rOKmR/iBYwkpBmnIwin4wBg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-LF4b/NmGvdWEHD2H4MsHD8ny6JpiVNDzrSZr3CsckEgCbAGZbYM4Cqxvi9L+WqDMT+51Ozy7lt2M+d0JLEuBqA==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-a7QH6fw4S57+F5y2FIxxSDyi5M4UfGF+Jl1bCGd7+L4KsaUY80GsiF/t0UoRFDHAguKlBaACWJRmdrc6Xfkkag==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-HbPM4LbaAAt/DjxXaG9yiS9brOOz6fabal4uvUmaUYe6l3K1phQDMQKBRUrr06BQkxkvIZVVHttqiybM9nJsLA==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-lNCWCbq7rpg7qDsQrd3D6NyWYu+gkTENkG5IKYhUIcxSb59SQC/hEQ+MrG4sTgBVghTonNWq42bA/d4yYumldQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-f7rW7LJ2b7Uh2EiQ+7sza6RDZnajbNbemn54Ob6fRwQbgcIn+GWfyuHDHRYgRoZu1P4AayVScrRW+YfbTvPQoQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-sExxzucx0Tud5tE0XqR0lT0psBQvEpnpiul9XbGUB1QwpWJJAps1O/Z7hJxLGiZLBKMCutjTzDgmd1muEhBnVg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-tUFMXI4gxzzMXt4xpGJEsBsTox0XbNQ1y94EwlD/CuZwFcQP79xfQqMhau9HsRc/J0cAPA/HZt1dZPtGn9V/7w==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@ungap/[email protected]':- resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==}- peerDependencies:- msw: ^2.4.9- vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0- peerDependenciesMeta:- msw:- optional: true- vite:- optional: true-- '@vitest/[email protected]':- resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==}-- resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}- peerDependencies:- acorn: ^6.0.0 || ^7.0.0 || ^8.0.0-- resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==}- engines: {node: '>=0.4.0'}- hasBin: true-- resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==}- engines: {node: '>= 14'}-- resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}-- resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==}-- resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}- engines: {node: '>= 8'}-- resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}-- resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}-- resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==}-- resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}-- resolution: {integrity: sha512-O+A6LWV5LDHSJD3LjHYoNi4VLsj/Whi7k6zG12xTYaU4cQ8oxQGckXNX8cRHK5yOZ/ppVHe0ZBXGzSV9jXdVbQ==}- engines: {node: ^10 || ^12 || >=14}- hasBin: true- peerDependencies:- postcss: ^8.1.0-- resolution: {integrity: sha512-5HOwwt0BYiv/zxl7j8Pf2bGL6rDXfV6nUhLs8ygBX+EFJXzBPHM/euj9j/6deMZ6wa52Wb2PBaAV5U/jKwIY1w==}- peerDependencies:- '@babel/core': ^7.20.12-- resolution: {integrity: sha512-HCelrgua/Y+kqO8RyL04JBWS/cVdrtUv/h45GntgQY+cJl4eBcKkCDV3TdMjtKx1nXwRaR9QXslM/Npm1dxdZQ==}- peerDependencies:- '@babel/core': ^7.0.0- solid-js: ^1.9.10- peerDependenciesMeta:- solid-js:- optional: true-- resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}-- resolution: {integrity: sha512-616V5YX4bepJFzNyOfce5Fa8fDJMfoxzOIzDCZwaGL8MKVpFrXqfNUoIpRn9YMI5pXf/VKgzjB4htFMsFKKdiQ==}- hasBin: true-- resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==}-- resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==}-- resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==}- engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}- hasBin: true-- resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}- engines: {node: '>=6'}-- resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}- engines: {node: '>= 6'}-- resolution: {integrity: sha512-Bj5H35MD/ebaOV4iDLqPEtiliTN29qkGtEHCwawWn4cYm+bPJM2NsaP30vtZcnERClMzp52J4+aw2UNbK4o+zw==}-- resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==}- engines: {node: '>= 16'}-- resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}- engines: {node: '>= 8.10.0'}-- resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}- engines: {node: '>=7.0.0'}-- resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}-- resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}- engines: {node: '>= 0.8'}-- resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}- engines: {node: '>= 6'}-- resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}-- resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}-- resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}- engines: {node: '>= 8'}-- resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==}-- resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}- engines: {node: '>=4'}- hasBin: true-- resolution: {integrity: sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}-- resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}- engines: {node: '>=6.0'}- peerDependencies:- supports-color: '*'- peerDependenciesMeta:- supports-color:- optional: true-- resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==}-- resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==}- engines: {node: '>=6'}-- resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}-- resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}- engines: {node: '>=0.4.0'}-- resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}- engines: {node: '>=6'}-- resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}-- resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}-- resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}- engines: {node: '>=6.0.0'}-- resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==}-- resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==}-- resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}-- resolution: {integrity: sha512-OszpBN7xZX4vWMPJwB9illkN/znA8M36GQqQxi6MNy9axWxhOfJyZZJtSLQCpEFLHP2xK33BiWx9aIuIEXVCcw==}-- resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}-- resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}-- resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==}- engines: {node: '>=0.12'}-- resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==}-- resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==}- engines: {node: '>=18'}- hasBin: true-- resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}- engines: {node: '>=6'}-- resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-iI1f+D2ViGn+uvv5HuHVUamg8ll4tN+JRHGc6IJi4TP9Kl976C57fzPXgseXNs8v0iA8aSJpHsTWjDb9QJamGQ==}- hasBin: true- peerDependencies:- eslint: '>=7.0.0'-- resolution: {integrity: sha512-nfuYK09ah5aJG/oEN6P1qziy1zLgW4PDWe75VNPi4CEFYk1x2AEqwFeQfEPR7gNn0F2jOeqKhx2E+5oNCOBYWQ==}- engines: {node: '>=18.0.0'}- peerDependencies:- eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0- typescript: '>=4.8.4'-- resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==}- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}-- resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}-- resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==}- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}- deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.- hasBin: true-- resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}-- resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==}- engines: {node: '>=0.10'}-- resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}- engines: {node: '>=4.0'}-- resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}- engines: {node: '>=4.0'}-- resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}-- resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==}- engines: {node: '>=12.0.0'}-- resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}-- resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}- engines: {node: '>=8.6.0'}-- resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}-- resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}-- resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==}-- resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}- engines: {node: '>=12.0.0'}- peerDependencies:- picomatch: ^3 || ^4- peerDependenciesMeta:- picomatch:- optional: true-- resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}- engines: {node: ^10.12.0 || >=12.0.0}-- resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==}- engines: {node: ^10.12.0 || >=12.0.0}-- resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==}-- resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==}- engines: {node: '>=14'}-- resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==}- engines: {node: '>= 6'}-- resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==}-- resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}-- resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}- engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}- os: [darwin]-- resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}-- resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}- engines: {node: '>=6.9.0'}-- resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}- engines: {node: '>= 6'}-- resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}- engines: {node: '>=10.13.0'}-- resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}- hasBin: true-- resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}- deprecated: Glob versions prior to v9 are no longer supported-- resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}-- resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==}-- resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==}- engines: {node: '>= 14'}-- resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==}- engines: {node: '>= 14'}-- resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}- engines: {node: '>= 4'}-- resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==}- engines: {node: '>= 4'}-- resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==}- engines: {node: '>=6'}-- resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}- engines: {node: '>=0.8.19'}-- resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}- deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.-- resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}-- resolution: {integrity: sha512-gtGXVaBdl5mAes3rPcMedEBm12ibjt1kDMFfheul1wUAOVEJW60voNdMVzVkfLN06O7ZaD/rxhfKgtlgtTbMjg==}-- resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-S+OpgB5i7wzIue/YSE5hg0e5ZYfG3hhpNh9KGl6ayJ38p7ED6wxQLd1TV91xHpcTvw90KMJ9EwN3F/iNflHBVg==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}- engines: {node: '>=0.12.0'}-- resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==}-- resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==}- engines: {node: '>=12.13'}-- resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}-- resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}-- resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==}- hasBin: true-- resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}-- resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==}-- resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}- hasBin: true-- resolution: {integrity: sha512-MyL55p3Ut3cXbeBEG7Hcv0mVM8pp8PBNWxRqchZnSfAiES1v1mRnMeFfaHWIPULpwsYfvO+ZmMZz5tGCnjzDUQ==}- engines: {node: '>=18'}- peerDependencies:- canvas: ^2.11.2- peerDependenciesMeta:- canvas:- optional: true-- resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==}- engines: {node: '>=6'}- hasBin: true-- resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}-- resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}-- resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}-- resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}- engines: {node: '>=6'}- hasBin: true-- resolution: {integrity: sha512-7n6wXq4gNgBELfDCpzKc+mRrZFs7D+wgfF5WRFLNAr4DA/qtr9Js8uOAVAfHhuLMfAcQ0pRKqbpjx+TcJVdE1Q==}-- resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}-- resolution: {integrity: sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ==}-- resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}- engines: {node: '>= 0.8.0'}-- resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==}- engines: {node: '>=14'}-- resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}-- resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}-- resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==}-- resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}-- resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}-- resolution: {integrity: sha512-VAzoU/4aLECC/9yGg0RfYPPtgbwpu+DVo5EysU64pGuDT6n59NRIAZanu8O9D4xlcyW3PcigvZv7kBHPN7JItQ==}- peerDependencies:- solid-js: ^1.4.7-- resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==}- hasBin: true-- resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}-- resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ==}- engines: {node: '>=12.13'}-- resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}- engines: {node: '>= 8'}-- resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}- engines: {node: '>=8.6'}-- resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}- engines: {node: '>= 0.6'}-- resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}- engines: {node: '>= 0.6'}-- resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}- engines: {node: '>=4'}-- resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}-- resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==}- engines: {node: '>=16 || 14 >=14.17'}-- resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}- engines: {node: '>=16 || 14 >=14.17'}-- resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}-- resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}-- resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}- engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}- hasBin: true-- resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}-- resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==}-- resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ==}-- resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==}- engines: {node: '>= 6'}-- resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}-- resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}- engines: {node: '>= 0.8.0'}-- resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}-- resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}- engines: {node: '>=6'}-- resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==}-- resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}-- resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==}- engines: {node: '>=16 || 14 >=14.18'}-- resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}-- resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==}- engines: {node: '>= 14.16'}-- resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}-- resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}- engines: {node: '>=8.6'}-- resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==}- engines: {node: '>= 6'}-- resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}- engines: {node: '>=14.0.0'}- peerDependencies:- postcss: ^8.0.0-- resolution: {integrity: sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==}- engines: {node: ^12 || ^14 || >= 16}- peerDependencies:- postcss: ^8.4.21-- resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==}- engines: {node: '>= 18'}- peerDependencies:- jiti: '>=1.21.0'- postcss: '>=8.0.9'- tsx: ^4.8.1- yaml: ^2.4.2- peerDependenciesMeta:- jiti:- optional: true- postcss:- optional: true- tsx:- optional: true- yaml:- optional: true-- resolution: {integrity: sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==}- engines: {node: '>=12.0'}- peerDependencies:- postcss: ^8.2.14-- resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==}- engines: {node: '>=4'}-- resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}-- resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}- engines: {node: ^10 || ^12 || >=14}-- resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}- engines: {node: '>= 0.8.0'}-- resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==}- engines: {node: '>=14'}- hasBin: true-- resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}- engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}-- resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==}-- resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}- engines: {node: '>=6'}-- resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==}-- resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}-- resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}-- resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==}-- resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}- engines: {node: '>=8.10.0'}-- resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}-- resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}- engines: {node: '>=4'}-- resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==}- engines: {node: '>= 0.4'}- hasBin: true-- resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}- engines: {iojs: '>=1.0.0', node: '>=0.10.0'}-- resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}- deprecated: Rimraf versions prior to v4 are no longer supported- hasBin: true-- resolution: {integrity: sha512-3GuObel8h7Kqdjt0gxkEzaifHTqLVW56Y/bjN7PSQtkKr0w3V/QYSdt6QWYtd7A1xUtYQigtdUfgj1RvWVtorw==}- engines: {node: '>=18.0.0', npm: '>=8.0.0'}- hasBin: true-- resolution: {integrity: sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==}-- resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==}-- resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}-- resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}-- resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}- engines: {node: '>=v12.22.7'}-- resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}- hasBin: true-- resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==}- engines: {node: '>=10'}- hasBin: true-- resolution: {integrity: sha512-16OL3NnUBw8JG1jBLUoZJsLnQq0n5Ua6aHalhJK4fMQkz1lqR7Osz1sA30trBtd9VUDc2NgkuRCn8+/pBwqZ+w==}- engines: {node: '>=10'}- peerDependencies:- seroval: ^1.0-- resolution: {integrity: sha512-RbcPH1n5cfwKrru7v7+zrZvjLurgHhGyso3HTyGtRivGWgYjbOmGuivCQaORNELjNONoK35nj28EoWul9sb1zQ==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}-- resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}- engines: {node: '>=14'}-- resolution: {integrity: sha512-LI5pVJPBv6oc79OMsffwb6kEqnmB8P1Cjg1crNUlhsxPETQ5UzbCKQdxU+7MW6+DD1qfPkla/vSKlLD4IfyXpQ==}- engines: {node: '>=0.12.18'}-- resolution: {integrity: sha512-Coz956cos/EPDlhs6+jsdTxKuJDPT7B5SVIWgABwROyxjY7Xbr8wkzD68Et+NxnV7DLJ3nJdAC2r9InuV/4Jew==}-- resolution: {integrity: sha512-F3aPsX6hVw9ttm5LYlth8Q15x6MlI/J3Dn+o3EQyRTtTxidepSTwAYdozt01/YA+7ObcciagGEyXIopGZzQtbA==}- peerDependencies:- solid-js: ^1.3-- resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}-- resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==}-- resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==}-- resolution: {integrity: sha512-ddJqYnoT4t97QvN2C95bCgt+m7AAgXjVnkk/jxAfmp7EAB8nnqqZYEbMd3em7/vEomDb2LAQKAy1RFfv41mdNw==}-- resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==}- engines: {node: '>=16 || 14 >=14.17'}- hasBin: true-- resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}-- resolution: {integrity: sha512-6A2rnmW5xZMdw11LYjhcI5846rt9pbLSabY5XPxo+XWdxwZaFEn47Go4NzFiHu9sNNmr/kXivP1vStfvMaK1GQ==}- engines: {node: '>=14.0.0'}- hasBin: true-- resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}-- resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}- engines: {node: '>=0.8'}-- resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}-- resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}-- resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==}-- resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==}- engines: {node: '>=12.0.0'}-- resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==}- engines: {node: ^18.0.0 || >=20.0.0}-- resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==}- engines: {node: '>=14.0.0'}-- resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==}- engines: {node: '>=14.0.0'}-- resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}- engines: {node: '>=8.0'}-- resolution: {integrity: sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==}- engines: {node: '>=6'}-- resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==}- engines: {node: '>=18.12'}- peerDependencies:- typescript: '>=4.8.4'-- resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}-- resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}- engines: {node: '>= 0.8.0'}-- resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}- engines: {node: '>=14.17'}- hasBin: true-- resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}-- resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==}- engines: {node: '>= 4.0.0'}-- resolution: {integrity: sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==}- hasBin: true- peerDependencies:- browserslist: '>= 4.21.0'-- resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}-- resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}-- resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}-- resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==}- engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}- hasBin: true-- resolution: {integrity: sha512-Yr1dQybmtDtDAHkii6hXuc1oVH9CPcS/Zb2jN/P36qqcrkNnVPsMTzQ06jyzFPFjj3U1IYKMVt/9ZqcwGCEbjw==}- peerDependencies:- '@testing-library/jest-dom': ^5.16.6 || ^5.17.0 || ^6.*- solid-js: ^1.7.2- vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0- peerDependenciesMeta:- '@testing-library/jest-dom':- optional: true-- resolution: {integrity: sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==}- engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}- hasBin: true- peerDependencies:- '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0- jiti: '>=1.21.0'- less: '*'- lightningcss: ^1.21.0- sass: '*'- sass-embedded: '*'- stylus: '*'- sugarss: '*'- terser: ^5.16.0- tsx: ^4.8.1- yaml: ^2.4.2- peerDependenciesMeta:- '@types/node':- optional: true- jiti:- optional: true- less:- optional: true- lightningcss:- optional: true- sass:- optional: true- sass-embedded:- optional: true- stylus:- optional: true- sugarss:- optional: true- terser:- optional: true- tsx:- optional: true- yaml:- optional: true-- resolution: {integrity: sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ==}- peerDependencies:- vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0- peerDependenciesMeta:- vite:- optional: true-- resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==}- engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}- hasBin: true- peerDependencies:- '@edge-runtime/vm': '*'- '@types/debug': ^4.1.12- '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0- '@vitest/browser': 3.2.4- '@vitest/ui': 3.2.4- happy-dom: '*'- jsdom: '*'- peerDependenciesMeta:- '@edge-runtime/vm':- optional: true- '@types/debug':- optional: true- '@types/node':- optional: true- '@vitest/browser':- optional: true- '@vitest/ui':- optional: true- happy-dom:- optional: true- jsdom:- optional: true-- resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}- engines: {node: '>= 8'}- hasBin: true-- resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==}- engines: {node: '>=8'}- hasBin: true-- resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}-- resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==}- engines: {node: '>=10.0.0'}- peerDependencies:- bufferutil: ^4.0.1- utf-8-validate: '>=5.0.2'- peerDependenciesMeta:- bufferutil:- optional: true- utf-8-validate:- optional: true-- resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}-- resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}-- resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}- engines: {node: '>=10'}--snapshots:-- '@adobe/[email protected]': {}-- '@alloc/[email protected]': {}-- '@asamuzakjp/[email protected]':- dependencies:- '@csstools/css-calc': 2.1.4(@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])- '@csstools/css-color-parser': 3.1.0(@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])- '@csstools/css-parser-algorithms': 3.0.5(@csstools/[email protected])- '@csstools/css-tokenizer': 3.0.4- lru-cache: 10.4.3-- '@babel/[email protected]':- dependencies:- '@babel/helper-validator-identifier': 7.28.5- js-tokens: 4.0.0- picocolors: 1.1.1-- '@babel/[email protected]': {}-- '@babel/[email protected]':- dependencies:- '@babel/code-frame': 7.27.1- '@babel/generator': 7.28.5- '@babel/helper-compilation-targets': 7.27.2- '@babel/helper-module-transforms': 7.28.3(@babel/[email protected])- '@babel/helpers': 7.28.4- '@babel/parser': 7.28.5- '@babel/template': 7.27.2- '@babel/traverse': 7.28.5- '@babel/types': 7.28.5- '@jridgewell/remapping': 2.3.5- convert-source-map: 2.0.0- debug: 4.4.3- gensync: 1.0.0-beta.2- json5: 2.2.3- semver: 6.3.1- transitivePeerDependencies:- - supports-color-- '@babel/[email protected]':- dependencies:- '@babel/parser': 7.28.5- '@babel/types': 7.28.5- '@jridgewell/gen-mapping': 0.3.13- '@jridgewell/trace-mapping': 0.3.31- jsesc: 3.1.0-- '@babel/[email protected]':- dependencies:- '@babel/compat-data': 7.28.5- '@babel/helper-validator-option': 7.27.1- browserslist: 4.27.0- lru-cache: 5.1.1- semver: 6.3.1-- '@babel/[email protected]': {}-- '@babel/[email protected]':- dependencies:- '@babel/types': 7.28.5-- '@babel/[email protected]':- dependencies:- '@babel/traverse': 7.28.5- '@babel/types': 7.28.5- transitivePeerDependencies:- - supports-color-- '@babel/[email protected](@babel/[email protected])':- dependencies:- '@babel/core': 7.28.5- '@babel/helper-module-imports': 7.27.1- '@babel/helper-validator-identifier': 7.28.5- '@babel/traverse': 7.28.5- transitivePeerDependencies:- - supports-color-- '@babel/[email protected]': {}-- '@babel/[email protected]': {}-- '@babel/[email protected]': {}-- '@babel/[email protected]': {}-- '@babel/[email protected]':- dependencies:- '@babel/template': 7.27.2- '@babel/types': 7.28.5-- '@babel/[email protected]':- dependencies:- '@babel/types': 7.28.5-- '@babel/[email protected](@babel/[email protected])':- dependencies:- '@babel/core': 7.28.5- '@babel/helper-plugin-utils': 7.27.1-- '@babel/[email protected]': {}-- '@babel/[email protected]':- dependencies:- '@babel/code-frame': 7.27.1- '@babel/parser': 7.28.5- '@babel/types': 7.28.5-- '@babel/[email protected]':- dependencies:- '@babel/code-frame': 7.27.1- '@babel/generator': 7.28.5- '@babel/helper-globals': 7.28.0- '@babel/parser': 7.28.5- '@babel/template': 7.27.2- '@babel/types': 7.28.5- debug: 4.4.3- transitivePeerDependencies:- - supports-color-- '@babel/[email protected]':- dependencies:- '@babel/helper-string-parser': 7.27.1- '@babel/helper-validator-identifier': 7.28.5-- '@csstools/[email protected]': {}-- '@csstools/[email protected](@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])':- dependencies:- '@csstools/css-parser-algorithms': 3.0.5(@csstools/[email protected])- '@csstools/css-tokenizer': 3.0.4-- '@csstools/[email protected](@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])':- dependencies:- '@csstools/color-helpers': 5.1.0- '@csstools/css-calc': 2.1.4(@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])- '@csstools/css-parser-algorithms': 3.0.5(@csstools/[email protected])- '@csstools/css-tokenizer': 3.0.4-- '@csstools/[email protected](@csstools/[email protected])':- dependencies:- '@csstools/css-tokenizer': 3.0.4-- '@csstools/[email protected]': {}-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@esbuild/[email protected]':- optional: true-- '@eslint-community/[email protected]([email protected])':- dependencies:- eslint: 8.57.1- eslint-visitor-keys: 3.4.3-- '@eslint-community/[email protected]': {}-- '@eslint/[email protected]':- dependencies:- ajv: 6.12.6- debug: 4.4.3- espree: 9.6.1- globals: 13.24.0- ignore: 5.3.2- import-fresh: 3.3.1- js-yaml: 4.1.0- minimatch: 3.1.2- strip-json-comments: 3.1.1- transitivePeerDependencies:- - supports-color-- '@eslint/[email protected]': {}-- '@humanwhocodes/[email protected]':- dependencies:- '@humanwhocodes/object-schema': 2.0.3- debug: 4.4.3- minimatch: 3.1.2- transitivePeerDependencies:- - supports-color-- '@humanwhocodes/[email protected]': {}-- '@humanwhocodes/[email protected]': {}-- '@isaacs/[email protected]':- dependencies:- string-width: 5.1.2- string-width-cjs: [email protected]- strip-ansi: 7.1.2- strip-ansi-cjs: [email protected]- wrap-ansi: 8.1.0- wrap-ansi-cjs: [email protected]-- '@jridgewell/[email protected]':- dependencies:- '@jridgewell/sourcemap-codec': 1.5.5- '@jridgewell/trace-mapping': 0.3.31-- '@jridgewell/[email protected]':- dependencies:- '@jridgewell/gen-mapping': 0.3.13- '@jridgewell/trace-mapping': 0.3.31-- '@jridgewell/[email protected]': {}-- '@jridgewell/[email protected]': {}-- '@jridgewell/[email protected]':- dependencies:- '@jridgewell/resolve-uri': 3.1.2- '@jridgewell/sourcemap-codec': 1.5.5-- '@nodelib/[email protected]':- dependencies:- '@nodelib/fs.stat': 2.0.5- run-parallel: 1.2.0-- '@nodelib/[email protected]': {}-- '@nodelib/[email protected]':- dependencies:- '@nodelib/fs.scandir': 2.1.5- fastq: 1.19.1-- '@pkgjs/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@rollup/[email protected]':- optional: true-- '@solidjs/[email protected]([email protected])':- dependencies:- solid-js: 1.9.10-- dependencies:- '@testing-library/dom': 10.4.1- solid-js: 1.9.10- optionalDependencies:- '@solidjs/router': 0.10.10([email protected])-- '@testing-library/[email protected]':- dependencies:- '@babel/code-frame': 7.27.1- '@babel/runtime': 7.28.4- '@types/aria-query': 5.0.4- aria-query: 5.3.0- dom-accessibility-api: 0.5.16- lz-string: 1.5.0- picocolors: 1.1.1- pretty-format: 27.5.1-- '@testing-library/[email protected]':- dependencies:- '@adobe/css-tools': 4.4.4- aria-query: 5.3.2- css.escape: 1.5.1- dom-accessibility-api: 0.6.3- picocolors: 1.1.1- redent: 3.0.0-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@babel/parser': 7.28.5- '@babel/types': 7.28.5- '@types/babel__generator': 7.27.0- '@types/babel__template': 7.4.4- '@types/babel__traverse': 7.28.0-- '@types/[email protected]':- dependencies:- '@babel/types': 7.28.5-- '@types/[email protected]':- dependencies:- '@babel/parser': 7.28.5- '@babel/types': 7.28.5-- '@types/[email protected]':- dependencies:- '@babel/types': 7.28.5-- '@types/[email protected]':- dependencies:- '@types/deep-eql': 4.0.2- assertion-error: 2.0.1-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- undici-types: 6.21.0-- '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])':- dependencies:- '@eslint-community/regexpp': 4.12.2- '@typescript-eslint/parser': 8.46.2([email protected])([email protected])- '@typescript-eslint/scope-manager': 8.46.2- '@typescript-eslint/type-utils': 8.46.2([email protected])([email protected])- '@typescript-eslint/utils': 8.46.2([email protected])([email protected])- '@typescript-eslint/visitor-keys': 8.46.2- eslint: 8.57.1- graphemer: 1.4.0- ignore: 7.0.5- natural-compare: 1.4.0- ts-api-utils: 2.1.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- dependencies:- '@typescript-eslint/scope-manager': 8.46.2- '@typescript-eslint/types': 8.46.2- '@typescript-eslint/typescript-estree': 8.46.2([email protected])- '@typescript-eslint/visitor-keys': 8.46.2- debug: 4.4.3- eslint: 8.57.1- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- '@typescript-eslint/[email protected]([email protected])':- dependencies:- '@typescript-eslint/tsconfig-utils': 8.46.2([email protected])- '@typescript-eslint/types': 8.46.2- debug: 4.4.3- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- '@typescript-eslint/[email protected]':- dependencies:- '@typescript-eslint/types': 8.46.2- '@typescript-eslint/visitor-keys': 8.46.2-- '@typescript-eslint/[email protected]([email protected])':- dependencies:- typescript: 5.9.3-- dependencies:- '@typescript-eslint/types': 8.46.2- '@typescript-eslint/typescript-estree': 8.46.2([email protected])- '@typescript-eslint/utils': 8.46.2([email protected])([email protected])- debug: 4.4.3- eslint: 8.57.1- ts-api-utils: 2.1.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- '@typescript-eslint/[email protected]': {}-- '@typescript-eslint/[email protected]([email protected])':- dependencies:- '@typescript-eslint/project-service': 8.46.2([email protected])- '@typescript-eslint/tsconfig-utils': 8.46.2([email protected])- '@typescript-eslint/types': 8.46.2- '@typescript-eslint/visitor-keys': 8.46.2- debug: 4.4.3- fast-glob: 3.3.3- is-glob: 4.0.3- minimatch: 9.0.5- semver: 7.7.3- ts-api-utils: 2.1.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- dependencies:- '@eslint-community/eslint-utils': 4.9.0([email protected])- '@typescript-eslint/scope-manager': 8.46.2- '@typescript-eslint/types': 8.46.2- '@typescript-eslint/typescript-estree': 8.46.2([email protected])- eslint: 8.57.1- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- '@typescript-eslint/[email protected]':- dependencies:- '@typescript-eslint/types': 8.46.2- eslint-visitor-keys: 4.2.1-- '@ungap/[email protected]': {}-- '@vitest/[email protected]':- dependencies:- '@types/chai': 5.2.3- '@vitest/spy': 3.2.4- '@vitest/utils': 3.2.4- chai: 5.3.3- tinyrainbow: 2.0.0-- dependencies:- '@vitest/spy': 3.2.4- estree-walker: 3.0.3- magic-string: 0.30.21- optionalDependencies:- vite: 6.4.1(@types/[email protected])([email protected])-- '@vitest/[email protected]':- dependencies:- tinyrainbow: 2.0.0-- '@vitest/[email protected]':- dependencies:- '@vitest/utils': 3.2.4- pathe: 2.0.3- strip-literal: 3.1.0-- '@vitest/[email protected]':- dependencies:- '@vitest/pretty-format': 3.2.4- magic-string: 0.30.21- pathe: 2.0.3-- '@vitest/[email protected]':- dependencies:- tinyspy: 4.0.4-- '@vitest/[email protected]':- dependencies:- '@vitest/pretty-format': 3.2.4- loupe: 3.2.1- tinyrainbow: 2.0.0-- dependencies:- acorn: 8.15.0-- [email protected]: {}-- [email protected]: {}-- dependencies:- fast-deep-equal: 3.1.3- fast-json-stable-stringify: 2.1.0- json-schema-traverse: 0.4.1- uri-js: 4.4.1-- [email protected]: {}-- [email protected]: {}-- dependencies:- color-convert: 2.0.1-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- normalize-path: 3.0.0- picomatch: 2.3.1-- [email protected]: {}-- [email protected]: {}-- dependencies:- dequal: 2.0.3-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- browserslist: 4.27.0- caniuse-lite: 1.0.30001753- fraction.js: 4.3.7- normalize-range: 0.1.2- picocolors: 1.1.1- postcss: 8.5.6- postcss-value-parser: 4.2.0-- [email protected](@babel/[email protected]):- dependencies:- '@babel/core': 7.28.5- '@babel/helper-module-imports': 7.18.6- '@babel/plugin-syntax-jsx': 7.27.1(@babel/[email protected])- '@babel/types': 7.28.5- html-entities: 2.3.3- parse5: 7.3.0-- dependencies:- '@babel/core': 7.28.5- babel-plugin-jsx-dom-expressions: 0.40.3(@babel/[email protected])- optionalDependencies:- solid-js: 1.9.10-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- balanced-match: 1.0.2- concat-map: 0.0.1-- dependencies:- balanced-match: 1.0.2-- dependencies:- fill-range: 7.1.1-- dependencies:- baseline-browser-mapping: 2.8.23- caniuse-lite: 1.0.30001753- electron-to-chromium: 1.5.244- node-releases: 2.0.27- update-browserslist-db: 1.1.4([email protected])-- [email protected]: {}-- dependencies:- es-errors: 1.3.0- function-bind: 1.1.2-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- assertion-error: 2.0.1- check-error: 2.1.1- deep-eql: 5.0.2- loupe: 3.2.1- pathval: 2.0.1-- dependencies:- ansi-styles: 4.3.0- supports-color: 7.2.0-- [email protected]: {}-- dependencies:- anymatch: 3.1.3- braces: 3.0.3- glob-parent: 5.1.2- is-binary-path: 2.1.0- is-glob: 4.0.3- normalize-path: 3.0.0- readdirp: 3.6.0- optionalDependencies:- fsevents: 2.3.3-- dependencies:- color-name: 1.1.4-- [email protected]: {}-- dependencies:- delayed-stream: 1.0.0-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- path-key: 3.1.1- shebang-command: 2.0.0- which: 2.0.2-- [email protected]: {}-- [email protected]: {}-- dependencies:- '@asamuzakjp/css-color': 3.2.0- rrweb-cssom: 0.8.0-- [email protected]: {}-- dependencies:- whatwg-mimetype: 4.0.0- whatwg-url: 14.2.0-- dependencies:- ms: 2.1.3-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- esutils: 2.0.3-- [email protected]: {}-- [email protected]: {}-- dependencies:- call-bind-apply-helpers: 1.0.2- es-errors: 1.3.0- gopd: 1.2.0-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- es-errors: 1.3.0-- dependencies:- es-errors: 1.3.0- get-intrinsic: 1.3.0- has-tostringtag: 1.0.2- hasown: 2.0.2-- optionalDependencies:- '@esbuild/aix-ppc64': 0.25.12- '@esbuild/android-arm': 0.25.12- '@esbuild/android-arm64': 0.25.12- '@esbuild/android-x64': 0.25.12- '@esbuild/darwin-arm64': 0.25.12- '@esbuild/darwin-x64': 0.25.12- '@esbuild/freebsd-arm64': 0.25.12- '@esbuild/freebsd-x64': 0.25.12- '@esbuild/linux-arm': 0.25.12- '@esbuild/linux-arm64': 0.25.12- '@esbuild/linux-ia32': 0.25.12- '@esbuild/linux-loong64': 0.25.12- '@esbuild/linux-mips64el': 0.25.12- '@esbuild/linux-ppc64': 0.25.12- '@esbuild/linux-riscv64': 0.25.12- '@esbuild/linux-s390x': 0.25.12- '@esbuild/linux-x64': 0.25.12- '@esbuild/netbsd-arm64': 0.25.12- '@esbuild/netbsd-x64': 0.25.12- '@esbuild/openbsd-arm64': 0.25.12- '@esbuild/openbsd-x64': 0.25.12- '@esbuild/openharmony-arm64': 0.25.12- '@esbuild/sunos-x64': 0.25.12- '@esbuild/win32-arm64': 0.25.12- '@esbuild/win32-ia32': 0.25.12- '@esbuild/win32-x64': 0.25.12-- [email protected]: {}-- [email protected]: {}-- dependencies:- eslint: 8.57.1-- dependencies:- '@typescript-eslint/utils': 8.46.2([email protected])([email protected])- eslint: 8.57.1- estraverse: 5.3.0- is-html: 2.0.0- kebab-case: 1.0.2- known-css-properties: 0.30.0- style-to-object: 1.0.12- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- dependencies:- esrecurse: 4.3.0- estraverse: 5.3.0-- [email protected]: {}-- [email protected]: {}-- dependencies:- '@eslint-community/eslint-utils': 4.9.0([email protected])- '@eslint-community/regexpp': 4.12.2- '@eslint/eslintrc': 2.1.4- '@eslint/js': 8.57.1- '@humanwhocodes/config-array': 0.13.0- '@humanwhocodes/module-importer': 1.0.1- '@nodelib/fs.walk': 1.2.8- '@ungap/structured-clone': 1.3.0- ajv: 6.12.6- chalk: 4.1.2- cross-spawn: 7.0.6- debug: 4.4.3- doctrine: 3.0.0- escape-string-regexp: 4.0.0- eslint-scope: 7.2.2- eslint-visitor-keys: 3.4.3- espree: 9.6.1- esquery: 1.6.0- esutils: 2.0.3- fast-deep-equal: 3.1.3- file-entry-cache: 6.0.1- find-up: 5.0.0- glob-parent: 6.0.2- globals: 13.24.0- graphemer: 1.4.0- ignore: 5.3.2- imurmurhash: 0.1.4- is-glob: 4.0.3- is-path-inside: 3.0.3- js-yaml: 4.1.0- json-stable-stringify-without-jsonify: 1.0.1- levn: 0.4.1- lodash.merge: 4.6.2- minimatch: 3.1.2- natural-compare: 1.4.0- optionator: 0.9.4- strip-ansi: 6.0.1- text-table: 0.2.0- transitivePeerDependencies:- - supports-color-- dependencies:- acorn: 8.15.0- acorn-jsx: 5.3.2([email protected])- eslint-visitor-keys: 3.4.3-- dependencies:- estraverse: 5.3.0-- dependencies:- estraverse: 5.3.0-- [email protected]: {}-- dependencies:- '@types/estree': 1.0.8-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- '@nodelib/fs.stat': 2.0.5- '@nodelib/fs.walk': 1.2.8- glob-parent: 5.1.2- merge2: 1.4.1- micromatch: 4.0.8-- [email protected]: {}-- [email protected]: {}-- dependencies:- reusify: 1.1.0-- optionalDependencies:- picomatch: 4.0.3-- dependencies:- flat-cache: 3.2.0-- dependencies:- to-regex-range: 5.0.1-- dependencies:- locate-path: 6.0.0- path-exists: 4.0.0-- dependencies:- flatted: 3.3.3- keyv: 4.5.4- rimraf: 3.0.2-- [email protected]: {}-- dependencies:- cross-spawn: 7.0.6- signal-exit: 4.1.0-- dependencies:- asynckit: 0.4.0- combined-stream: 1.0.8- es-set-tostringtag: 2.1.0- hasown: 2.0.2- mime-types: 2.1.35-- [email protected]: {}-- [email protected]: {}-- optional: true-- [email protected]: {}-- [email protected]: {}-- dependencies:- call-bind-apply-helpers: 1.0.2- es-define-property: 1.0.1- es-errors: 1.3.0- es-object-atoms: 1.1.1- function-bind: 1.1.2- get-proto: 1.0.1- gopd: 1.2.0- has-symbols: 1.1.0- hasown: 2.0.2- math-intrinsics: 1.1.0-- dependencies:- dunder-proto: 1.0.1- es-object-atoms: 1.1.1-- dependencies:- is-glob: 4.0.3-- dependencies:- is-glob: 4.0.3-- dependencies:- foreground-child: 3.3.1- jackspeak: 3.4.3- minimatch: 9.0.5- minipass: 7.1.2- package-json-from-dist: 1.0.1- path-scurry: 1.11.1-- dependencies:- fs.realpath: 1.0.0- inflight: 1.0.6- inherits: 2.0.4- minimatch: 3.1.2- once: 1.4.0- path-is-absolute: 1.0.1-- dependencies:- type-fest: 0.20.2-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- has-symbols: 1.1.0-- dependencies:- function-bind: 1.1.2-- dependencies:- whatwg-encoding: 3.1.1-- [email protected]: {}-- [email protected]: {}-- dependencies:- agent-base: 7.1.4- debug: 4.4.3- transitivePeerDependencies:- - supports-color-- dependencies:- agent-base: 7.1.4- debug: 4.4.3- transitivePeerDependencies:- - supports-color-- dependencies:- safer-buffer: 2.1.2-- [email protected]: {}-- [email protected]: {}-- dependencies:- parent-module: 1.0.1- resolve-from: 4.0.0-- [email protected]: {}-- [email protected]: {}-- dependencies:- once: 1.4.0- wrappy: 1.0.2-- [email protected]: {}-- [email protected]: {}-- dependencies:- binary-extensions: 2.3.0-- dependencies:- hasown: 2.0.2-- [email protected]: {}-- [email protected]: {}-- dependencies:- is-extglob: 2.1.1-- dependencies:- html-tags: 3.3.1-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- '@isaacs/cliui': 8.0.2- optionalDependencies:- '@pkgjs/parseargs': 0.11.0-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- argparse: 2.0.1-- dependencies:- cssstyle: 4.6.0- data-urls: 5.0.0- decimal.js: 10.6.0- form-data: 4.0.4- html-encoding-sniffer: 4.0.0- http-proxy-agent: 7.0.2- https-proxy-agent: 7.0.6- is-potential-custom-element-name: 1.0.1- nwsapi: 2.2.22- parse5: 7.3.0- rrweb-cssom: 0.7.1- saxes: 6.0.0- symbol-tree: 3.2.4- tough-cookie: 4.1.4- w3c-xmlserializer: 5.0.0- webidl-conversions: 7.0.0- whatwg-encoding: 3.1.1- whatwg-mimetype: 4.0.0- whatwg-url: 14.2.0- ws: 8.18.3- xml-name-validator: 5.0.0- transitivePeerDependencies:- - bufferutil- - supports-color- - utf-8-validate-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- json-buffer: 3.0.1-- [email protected]: {}-- dependencies:- prelude-ls: 1.2.1- type-check: 0.4.0-- [email protected]: {}-- [email protected]: {}-- dependencies:- p-locate: 5.0.0-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- yallist: 3.1.1-- dependencies:- solid-js: 1.9.10-- [email protected]: {}-- dependencies:- '@jridgewell/sourcemap-codec': 1.5.5-- [email protected]: {}-- dependencies:- is-what: 4.1.16-- [email protected]: {}-- dependencies:- braces: 3.0.3- picomatch: 2.3.1-- [email protected]: {}-- dependencies:- mime-db: 1.52.0-- [email protected]: {}-- dependencies:- brace-expansion: 1.1.12-- dependencies:- brace-expansion: 2.0.2-- [email protected]: {}-- [email protected]: {}-- dependencies:- any-promise: 1.3.0- object-assign: 4.1.1- thenify-all: 1.6.0-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- wrappy: 1.0.2-- dependencies:- deep-is: 0.1.4- fast-levenshtein: 2.0.6- levn: 0.4.1- prelude-ls: 1.2.1- type-check: 0.4.0- word-wrap: 1.2.5-- dependencies:- yocto-queue: 0.1.0-- dependencies:- p-limit: 3.1.0-- [email protected]: {}-- dependencies:- callsites: 3.1.0-- dependencies:- entities: 6.0.1-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- lru-cache: 10.4.3- minipass: 7.1.2-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- postcss: 8.5.6- postcss-value-parser: 4.2.0- read-cache: 1.0.0- resolve: 1.22.11-- dependencies:- camelcase-css: 2.0.1- postcss: 8.5.6-- dependencies:- lilconfig: 3.1.3- optionalDependencies:- jiti: 1.21.7- postcss: 8.5.6-- dependencies:- postcss: 8.5.6- postcss-selector-parser: 6.1.2-- dependencies:- cssesc: 3.0.0- util-deprecate: 1.0.2-- [email protected]: {}-- dependencies:- nanoid: 3.3.11- picocolors: 1.1.1- source-map-js: 1.2.1-- [email protected]: {}-- [email protected]: {}-- dependencies:- ansi-regex: 5.0.1- ansi-styles: 5.2.0- react-is: 17.0.2-- dependencies:- punycode: 2.3.1-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- pify: 2.3.0-- dependencies:- picomatch: 2.3.1-- dependencies:- indent-string: 4.0.0- strip-indent: 3.0.0-- [email protected]: {}-- [email protected]: {}-- dependencies:- is-core-module: 2.16.1- path-parse: 1.0.7- supports-preserve-symlinks-flag: 1.0.0-- [email protected]: {}-- dependencies:- glob: 7.2.3-- dependencies:- '@types/estree': 1.0.8- optionalDependencies:- '@rollup/rollup-android-arm-eabi': 4.52.5- '@rollup/rollup-android-arm64': 4.52.5- '@rollup/rollup-darwin-arm64': 4.52.5- '@rollup/rollup-darwin-x64': 4.52.5- '@rollup/rollup-freebsd-arm64': 4.52.5- '@rollup/rollup-freebsd-x64': 4.52.5- '@rollup/rollup-linux-arm-gnueabihf': 4.52.5- '@rollup/rollup-linux-arm-musleabihf': 4.52.5- '@rollup/rollup-linux-arm64-gnu': 4.52.5- '@rollup/rollup-linux-arm64-musl': 4.52.5- '@rollup/rollup-linux-loong64-gnu': 4.52.5- '@rollup/rollup-linux-ppc64-gnu': 4.52.5- '@rollup/rollup-linux-riscv64-gnu': 4.52.5- '@rollup/rollup-linux-riscv64-musl': 4.52.5- '@rollup/rollup-linux-s390x-gnu': 4.52.5- '@rollup/rollup-linux-x64-gnu': 4.52.5- '@rollup/rollup-linux-x64-musl': 4.52.5- '@rollup/rollup-openharmony-arm64': 4.52.5- '@rollup/rollup-win32-arm64-msvc': 4.52.5- '@rollup/rollup-win32-ia32-msvc': 4.52.5- '@rollup/rollup-win32-x64-gnu': 4.52.5- '@rollup/rollup-win32-x64-msvc': 4.52.5- fsevents: 2.3.3-- [email protected]: {}-- [email protected]: {}-- dependencies:- queue-microtask: 1.2.3-- [email protected]: {}-- dependencies:- xmlchars: 2.2.0-- [email protected]: {}-- [email protected]: {}-- dependencies:- seroval: 1.3.2-- [email protected]: {}-- dependencies:- shebang-regex: 3.0.0-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- csstype: 3.1.3- seroval: 1.3.2- seroval-plugins: 1.3.3([email protected])-- dependencies:- '@babel/generator': 7.28.5- '@babel/helper-module-imports': 7.27.1- '@babel/types': 7.28.5- solid-js: 1.9.10- transitivePeerDependencies:- - supports-color-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- emoji-regex: 8.0.0- is-fullwidth-code-point: 3.0.0- strip-ansi: 6.0.1-- dependencies:- eastasianwidth: 0.2.0- emoji-regex: 9.2.2- strip-ansi: 7.1.2-- dependencies:- ansi-regex: 5.0.1-- dependencies:- ansi-regex: 6.2.2-- dependencies:- min-indent: 1.0.1-- [email protected]: {}-- dependencies:- js-tokens: 9.0.1-- dependencies:- inline-style-parser: 0.2.6-- dependencies:- '@jridgewell/gen-mapping': 0.3.13- commander: 4.1.1- glob: 10.4.5- lines-and-columns: 1.2.4- mz: 2.7.0- pirates: 4.0.7- ts-interface-checker: 0.1.13-- dependencies:- has-flag: 4.0.0-- [email protected]: {}-- [email protected]: {}-- dependencies:- '@alloc/quick-lru': 5.2.0- arg: 5.0.2- chokidar: 3.6.0- didyoumean: 1.2.2- dlv: 1.1.3- fast-glob: 3.3.3- glob-parent: 6.0.2- is-glob: 4.0.3- jiti: 1.21.7- lilconfig: 3.1.3- micromatch: 4.0.8- normalize-path: 3.0.0- object-hash: 3.0.0- picocolors: 1.1.1- postcss: 8.5.6- postcss-import: 15.1.0([email protected])- postcss-js: 4.1.0([email protected])- postcss-load-config: 6.0.1([email protected])([email protected])- postcss-nested: 6.2.0([email protected])- postcss-selector-parser: 6.1.2- resolve: 1.22.11- sucrase: 3.35.0- transitivePeerDependencies:- - tsx- - yaml-- [email protected]: {}-- dependencies:- thenify: 3.3.1-- dependencies:- any-promise: 1.3.0-- [email protected]: {}-- [email protected]: {}-- dependencies:- fdir: 6.5.0([email protected])- picomatch: 4.0.3-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- is-number: 7.0.0-- dependencies:- psl: 1.15.0- punycode: 2.3.1- universalify: 0.2.0- url-parse: 1.5.10-- dependencies:- punycode: 2.3.1-- dependencies:- typescript: 5.9.3-- [email protected]: {}-- dependencies:- prelude-ls: 1.2.1-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- browserslist: 4.27.0- escalade: 3.2.0- picocolors: 1.1.1-- dependencies:- punycode: 2.3.1-- dependencies:- querystringify: 2.2.0- requires-port: 1.0.0-- [email protected]: {}-- dependencies:- cac: 6.7.14- debug: 4.4.3- es-module-lexer: 1.7.0- pathe: 2.0.3- vite: 6.4.1(@types/[email protected])([email protected])- transitivePeerDependencies:- - '@types/node'- - jiti- - less- - lightningcss- - sass- - sass-embedded- - stylus- - sugarss- - supports-color- - terser- - tsx- - yaml-- [email protected](@testing-library/[email protected])([email protected])([email protected](@types/[email protected])([email protected])):- dependencies:- '@babel/core': 7.28.5- '@types/babel__core': 7.20.5- babel-preset-solid: 1.9.10(@babel/[email protected])([email protected])- merge-anything: 5.1.7- solid-js: 1.9.10- solid-refresh: 0.6.3([email protected])- vite: 6.4.1(@types/[email protected])([email protected])- optionalDependencies:- '@testing-library/jest-dom': 6.9.1- transitivePeerDependencies:- - supports-color-- dependencies:- esbuild: 0.25.12- fdir: 6.5.0([email protected])- picomatch: 4.0.3- postcss: 8.5.6- rollup: 4.52.5- tinyglobby: 0.2.15- optionalDependencies:- '@types/node': 20.19.24- fsevents: 2.3.3- jiti: 1.21.7-- optionalDependencies:- vite: 6.4.1(@types/[email protected])([email protected])-- dependencies:- '@types/chai': 5.2.3- '@vitest/expect': 3.2.4- '@vitest/pretty-format': 3.2.4- '@vitest/runner': 3.2.4- '@vitest/snapshot': 3.2.4- '@vitest/spy': 3.2.4- '@vitest/utils': 3.2.4- chai: 5.3.3- debug: 4.4.3- expect-type: 1.2.2- magic-string: 0.30.21- pathe: 2.0.3- picomatch: 4.0.3- std-env: 3.10.0- tinybench: 2.9.0- tinyexec: 0.3.2- tinyglobby: 0.2.15- tinypool: 1.1.1- tinyrainbow: 2.0.0- vite: 6.4.1(@types/[email protected])([email protected])- vite-node: 3.2.4(@types/[email protected])([email protected])- why-is-node-running: 2.3.0- optionalDependencies:- '@types/node': 20.19.24- jsdom: 24.1.3- transitivePeerDependencies:- - jiti- - less- - lightningcss- - msw- - sass- - sass-embedded- - stylus- - sugarss- - supports-color- - terser- - tsx- - yaml-- dependencies:- xml-name-validator: 5.0.0-- [email protected]: {}-- dependencies:- iconv-lite: 0.6.3-- [email protected]: {}-- dependencies:- tr46: 5.1.1- webidl-conversions: 7.0.0-- dependencies:- isexe: 2.0.0-- dependencies:- siginfo: 2.0.0- stackback: 0.0.2-- [email protected]: {}-- dependencies:- ansi-styles: 4.3.0- string-width: 4.2.3- strip-ansi: 6.0.1-- dependencies:- ansi-styles: 6.2.3- string-width: 5.1.2- strip-ansi: 7.1.2-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}diff --git a/frontend-modern/public/download/pulse-host-agent-windows-amd64 b/frontend-modern/public/download/pulse-host-agent-windows-amd64deleted file mode 100755index f95d628cf7..0000000000Binary files a/frontend-modern/public/download/pulse-host-agent-windows-amd64 and /dev/null differdiff --git a/frontend-modern/scripts/build-release.sh b/frontend-modern/scripts/build-release.shdeleted file mode 100755index 3d3481a507..0000000000--- a/frontend-modern/scripts/build-release.sh+++ /dev/null@@ -1,98 +0,0 @@-#!/bin/bash-set -e--# Get version from VERSION file-VERSION=$(cat VERSION)--# Colors-GREEN='\033[0;32m'-BLUE='\033[0;34m'-NC='\033[0m' # No Color--echo -e "${BLUE}Building Pulse v${VERSION} release binaries${NC}"--# Create release directory-mkdir -p release--# Build frontend first-echo -e "${BLUE}Building frontend...${NC}"-cd frontend-modern-npm run build-cd ..--# Copy frontend to internal/api for embedding-echo -e "${BLUE}Copying frontend for embedding...${NC}"-rm -rf internal/api/frontend-modern-mkdir -p internal/api/frontend-modern-cp -r frontend-modern/dist internal/api/frontend-modern/--# Build for multiple architectures-echo -e "${BLUE}Building linux/amd64...${NC}"-GOOS=linux GOARCH=amd64 go build -o release/pulse-linux-amd64 ./cmd/pulse--echo -e "${BLUE}Building linux/arm64...${NC}"-GOOS=linux GOARCH=arm64 go build -o release/pulse-linux-arm64 ./cmd/pulse--echo -e "${BLUE}Building linux/arm (v7)...${NC}"-GOOS=linux GOARCH=arm GOARM=7 go build -o release/pulse-linux-armv7 ./cmd/pulse--# Create tarballs for each architecture-echo -e "${BLUE}Creating architecture-specific tarballs...${NC}"--# AMD64-cd release-mkdir -p temp-amd64-cp pulse-linux-amd64 temp-amd64/pulse-cp ../VERSION temp-amd64/VERSION-mkdir -p temp-amd64/frontend-modern-cp -r ../internal/api/frontend-modern/dist/* temp-amd64/frontend-modern/-tar -czf pulse-v${VERSION}-linux-amd64.tar.gz -C temp-amd64 .-rm -rf temp-amd64--# ARM64-mkdir -p temp-arm64-cp pulse-linux-arm64 temp-arm64/pulse-cp ../VERSION temp-arm64/VERSION-mkdir -p temp-arm64/frontend-modern-cp -r ../internal/api/frontend-modern/dist/* temp-arm64/frontend-modern/-tar -czf pulse-v${VERSION}-linux-arm64.tar.gz -C temp-arm64 .-rm -rf temp-arm64--# ARMv7-mkdir -p temp-armv7-cp pulse-linux-armv7 temp-armv7/pulse-cp ../VERSION temp-armv7/VERSION-mkdir -p temp-armv7/frontend-modern-cp -r ../internal/api/frontend-modern/dist/* temp-armv7/frontend-modern/-tar -czf pulse-v${VERSION}-linux-armv7.tar.gz -C temp-armv7 .-rm -rf temp-armv7--# Create universal tarball with all binaries-echo -e "${BLUE}Creating universal tarball...${NC}"-mkdir -p temp-universal-cp pulse-linux-amd64 temp-universal/-cp pulse-linux-arm64 temp-universal/-cp pulse-linux-armv7 temp-universal/-ln -sf pulse-linux-amd64 temp-universal/pulse-cp ../VERSION temp-universal/VERSION-mkdir -p temp-universal/frontend-modern-cp -r ../internal/api/frontend-modern/dist/* temp-universal/frontend-modern/-tar -czf pulse-v${VERSION}.tar.gz -C temp-universal .-rm -rf temp-universal--# Generate checksums-echo -e "${BLUE}Generating checksums...${NC}"-sha256sum pulse-v${VERSION}-linux-amd64.tar.gz > checksums.txt-sha256sum pulse-v${VERSION}-linux-arm64.tar.gz >> checksums.txt-sha256sum pulse-v${VERSION}-linux-armv7.tar.gz >> checksums.txt-sha256sum pulse-v${VERSION}.tar.gz >> checksums.txt--cd ..--echo -e "${GREEN}✓ Build complete!${NC}"-echo ""-echo "Release files:"-ls -lh release/-echo ""-echo "Checksums:"-cat release/checksums.txtdiff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsxindex a9329a9242..459d8aaf50 100644--- a/frontend-modern/src/App.tsx+++ b/frontend-modern/src/App.tsx@@ -17,12 +17,12 @@ import type { JSX } from 'solid-js';import { Router, Route, Navigate, useNavigate, useLocation } from '@solidjs/router';import { getGlobalWebSocketStore } from './stores/websocket-global';import { ToastContainer } from './components/Toast/Toast';-import NotificationContainer from './components/NotificationContainer';import { ErrorBoundary } from './components/ErrorBoundary';import { SecurityWarning } from './components/SecurityWarning';import { Login } from './components/Login';import { logger } from './utils/logger';-import { POLLING_INTERVALS, STORAGE_KEYS } from './constants';+import { POLLING_INTERVALS } from './constants';+import { STORAGE_KEYS } from '@/utils/localStorage';import { UpdatesAPI } from './api/updates';import type { VersionInfo } from './api/updates';import { apiFetch } from './utils/apiClient';@@ -30,15 +30,14 @@ import { SettingsAPI } from './api/settings';import { eventBus } from './stores/events';import { updateStore } from './stores/updates';import { UpdateBanner } from './components/UpdateBanner';-import { LegacySSHBanner } from './components/LegacySSHBanner';import { DemoBanner } from './components/DemoBanner';import { createTooltipSystem } from './components/shared/Tooltip';import type { State } from '@/types/api';import { ProxmoxIcon } from '@/components/icons/ProxmoxIcon';-import { DockerIcon } from '@/components/icons/DockerIcon';-import { HostsIcon } from '@/components/icons/HostsIcon';-import { AlertsIcon } from '@/components/icons/AlertsIcon';-import { SettingsGearIcon } from '@/components/icons/SettingsGearIcon';+import BoxesIcon from 'lucide-solid/icons/boxes';+import MonitorIcon from 'lucide-solid/icons/monitor';+import BellIcon from 'lucide-solid/icons/bell';+import SettingsIcon from 'lucide-solid/icons/settings';import { TokenRevealDialog } from './components/TokenRevealDialog';import { useAlertsActivation } from './stores/alertsActivation';@@ -138,7 +137,7 @@ function App() {loaders.forEach((load) => {void load().catch((error) => {- console.warn('[App] Failed to preload route module', error);+ logger.warn('Preloading route module failed', error);});});};@@ -264,7 +263,7 @@ function App() {updateStore.checkForUpdates();}).catch((error) => {- console.error('Failed to load version:', error);+ logger.error('Failed to load version', error);});});@@ -362,13 +361,13 @@ function App() {// Check auth on mountonMount(async () => {- console.log('[App] Starting auth check...');+ logger.debug('[App] Starting auth check...');// Check if we just logged out - if so, always show login pageconst justLoggedOut = localStorage.getItem('just_logged_out');if (justLoggedOut) {localStorage.removeItem('just_logged_out');- console.log('[App] Just logged out, showing login page');+ logger.debug('[App] User logged out, showing login page');setHasAuth(true); // Force showing login instead of setupsetNeedsAuth(true);setIsLoading(false);@@ -380,14 +379,14 @@ function App() {const securityRes = await apiFetch('/api/security/status');if (securityRes.status === 401) {- console.warn(+ logger.warn('[App] Security status request returned 401. Clearing stored credentials and showing login.',);try {const { clearAuth } = await import('./utils/apiClient');clearAuth();} catch (clearError) {- console.warn('[App] Failed to clear stored auth after 401:', clearError);+ logger.warn('[App] Failed to clear stored auth after 401', clearError);}setHasAuth(false);setNeedsAuth(true);@@ -399,13 +398,13 @@ function App() {}const securityData = await securityRes.json();- console.log('[App] Security status:', securityData);+ logger.debug('[App] Security status fetched', securityData);// Detect legacy DISABLE_AUTH flag (now ignored) so we can surface a warningif (securityData.deprecatedDisableAuth === true) {- console.warn(- '[App] Legacy DISABLE_AUTH flag detected; authentication remains enabled. Remove the flag and restart Pulse to silence this warning.',- );+ logger.warn(+ '[App] Legacy DISABLE_AUTH flag detected; authentication remains enabled. Remove the flag and restart Pulse to silence this warning.',+ );}const authConfigured = securityData.hasAuthentication || false;@@ -413,7 +412,7 @@ function App() {// Check for proxy authif (securityData.hasProxyAuth && securityData.proxyAuthUsername) {- console.log('[App] Proxy auth detected, user:', securityData.proxyAuthUsername);+ logger.info('[App] Proxy auth detected', { user: securityData.proxyAuthUsername });setProxyAuthInfo({username: securityData.proxyAuthUsername,logoutURL: securityData.proxyAuthLogoutURL,@@ -439,7 +438,7 @@ function App() {}setHasLoadedServerTheme(true);} catch (error) {- console.error('Failed to load theme from server:', error);+ logger.error('Failed to load theme from server', error);}}@@ -450,7 +449,7 @@ function App() {// Check for updates after loading version info (non-blocking)updateStore.checkForUpdates();})- .catch((error) => console.error('Failed to load version:', error));+ .catch((error) => logger.error('Failed to load version', error));setIsLoading(false);return;@@ -458,7 +457,7 @@ function App() {// Check for OIDC sessionif (securityData.oidcEnabled && securityData.oidcUsername) {- console.log('[App] OIDC session detected, user:', securityData.oidcUsername);+ logger.info('[App] OIDC session detected', { user: securityData.oidcUsername });setHasAuth(true); // OIDC is enabled, so auth is configuredsetProxyAuthInfo({username: securityData.oidcUsername,@@ -485,7 +484,7 @@ function App() {}setHasLoadedServerTheme(true);} catch (error) {- console.error('Failed to load theme from server:', error);+ logger.error('Failed to load theme from server', error);}}@@ -496,7 +495,7 @@ function App() {// Check for updates after loading version info (non-blocking)updateStore.checkForUpdates();})- .catch((error) => console.error('Failed to load version:', error));+ .catch((error) => logger.error('Failed to load version', error));setIsLoading(false);return;@@ -504,7 +503,7 @@ function App() {// If no auth is configured, show FirstRunSetupif (!authConfigured) {- console.log('[App] No auth configured, showing Login/FirstRunSetup');+ logger.info('[App] No auth configured, showing Login/FirstRunSetup');setNeedsAuth(true); // This will show the Login component which shows FirstRunSetupsetIsLoading(false);return;@@ -542,7 +541,7 @@ function App() {}setHasLoadedServerTheme(true);} catch (error) {- console.error('Failed to load theme from server:', error);+ logger.error('Failed to load theme from server', error);}} else {// We have a local preference, just mark that we've checked the server@@ -550,12 +549,12 @@ function App() {}}} catch (error) {- console.error('Auth check error:', error);+ logger.error('Auth check error', error);try {const { clearAuth } = await import('./utils/apiClient');clearAuth();} catch (clearError) {- console.warn('[App] Failed to clear stored auth after auth check error:', clearError);+ logger.warn('[App] Failed to clear stored auth after auth check error', clearError);}setHasAuth(false);setNeedsAuth(true);@@ -587,13 +586,13 @@ function App() {});if (!response.ok) {- console.error('Logout failed:', response.status);+ logger.error('Logout failed', { status: response.status });}// Clear auth from apiClientclearAuth();} catch (error) {- console.error('Logout error:', error);+ logger.error('Logout error', error);}// Clear all local storage EXCEPT theme preference and logout flag@@ -645,7 +644,6 @@ function App() {<SecurityWarning /><DemoBanner /><UpdateBanner />- <LegacySSHBanner /><div class="min-h-screen bg-gray-100 dark:bg-gray-900 text-gray-800 dark:text-gray-200 font-sans py-4 sm:py-6"><AppLayoutconnected={connected}@@ -663,7 +661,6 @@ function App() {</AppLayout></div><ToastContainer />- <NotificationContainer /><TokenRevealDialog /><TooltipRoot /></DarkModeContext.Provider>@@ -766,12 +763,11 @@ function AppLayout(props: {}) {const navigate = useNavigate();const location = useLocation();- const PLATFORM_SEEN_STORAGE_KEY = 'pulse-platforms-seen';const readSeenPlatforms = (): Record<string, boolean> => {if (typeof window === 'undefined') return {};try {- const stored = window.localStorage.getItem(PLATFORM_SEEN_STORAGE_KEY);+ const stored = window.localStorage.getItem(STORAGE_KEYS.PLATFORMS_SEEN);if (stored) {const parsed = JSON.parse(stored) as Record<string, boolean>;if (parsed && typeof parsed === 'object') {@@ -779,7 +775,7 @@ function AppLayout(props: {}}} catch (error) {- console.warn('Failed to parse stored platform visibility preferences', error);+ logger.warn('Failed to parse stored platform visibility preferences', error);}return {};};@@ -789,9 +785,9 @@ function AppLayout(props: {const persistSeenPlatforms = (map: Record<string, boolean>) => {if (typeof window === 'undefined') return;try {- window.localStorage.setItem(PLATFORM_SEEN_STORAGE_KEY, JSON.stringify(map));+ window.localStorage.setItem(STORAGE_KEYS.PLATFORMS_SEEN, JSON.stringify(map));} catch (error) {- console.warn('Failed to persist platform visibility preferences', error);+ logger.warn('Failed to persist platform visibility preferences', error);}};@@ -867,7 +863,7 @@ function AppLayout(props: {enabled: hasDockerHosts() || !!seenPlatforms()['docker'],live: hasDockerHosts(),icon: (- <DockerIcon class="w-4 h-4 shrink-0" />+ <BoxesIcon class="w-4 h-4 shrink-0" />),},{@@ -879,7 +875,7 @@ function AppLayout(props: {enabled: hasHosts() || !!seenPlatforms()['hosts'],live: hasHosts(),icon: (- <HostsIcon class="w-4 h-4 shrink-0" />+ <MonitorIcon class="w-4 h-4 shrink-0" />),},];@@ -910,7 +906,7 @@ function AppLayout(props: {badge: null as 'update' | null,count: activeAlertCount,breakdown,- icon: <AlertsIcon class="w-4 h-4 shrink-0" />,+ icon: <BellIcon class="w-4 h-4 shrink-0" />,},{id: 'settings' as const,@@ -920,7 +916,7 @@ function AppLayout(props: {badge: updateStore.isUpdateVisible() ? ('update' as const) : null,count: undefined,breakdown: undefined,- icon: <SettingsGearIcon class="w-4 h-4 shrink-0" />,+ icon: <SettingsIcon class="w-4 h-4 shrink-0" />,},];});diff --git a/frontend-modern/src/SimpleApp.tsx b/frontend-modern/src/SimpleApp.tsxdeleted file mode 100644index 4f07372c21..0000000000--- a/frontend-modern/src/SimpleApp.tsx+++ /dev/null@@ -1,69 +0,0 @@-import { createSignal, onMount } from 'solid-js';--export default function SimpleApp() {- const [status, setStatus] = createSignal('Initializing...');- const [data, setData] = createSignal<any>(null);- const [wsStatus, setWsStatus] = createSignal('Not connected');-- onMount(() => {- setStatus('Testing API connection...');-- // Test API- fetch('/api/health')- .then((res) => {- setStatus(`API Status: ${res.status}`);- return res.json();- })- .then((d) => {- setData(d);- setStatus('API Connected! Testing WebSocket...');-- // Test WebSocket- const ws = new WebSocket(`ws://${window.location.host}/ws`);-- ws.onopen = () => {- setWsStatus('WebSocket CONNECTED');- setStatus('Everything working!');- };-- ws.onerror = (e) => {- setWsStatus('WebSocket ERROR');- console.error('WS Error:', e);- };-- ws.onclose = (e) => {- setWsStatus(`WebSocket CLOSED: ${e.code} - ${e.reason}`);- };-- ws.onmessage = (e) => {- setWsStatus('WebSocket receiving data!');- try {- const msg = JSON.parse(e.data);- setData((prev) => ({ ...prev, lastMessage: msg.type }));- } catch (err) {- console.error('Parse error:', err);- }- };- })- .catch((err) => {- setStatus(`API Error: ${err}`);- console.error(err);- });- });-- return (- <div style={{ padding: '20px', 'font-family': 'monospace' }}>- <h1>Pulse System Test</h1>- <hr />- <p>- <strong>Status:</strong> {status()}- </p>- <p>- <strong>WebSocket:</strong> {wsStatus()}- </p>- <hr />- <h3>API Data:</h3>- <pre>{JSON.stringify(data(), null, 2)}</pre>- </div>- );-}diff --git a/frontend-modern/src/Test.tsx b/frontend-modern/src/Test.tsxdeleted file mode 100644index 93fac58a27..0000000000--- a/frontend-modern/src/Test.tsx+++ /dev/null@@ -1,8 +0,0 @@-export default function Test() {- return (- <div style={{ padding: '20px', 'font-size': '24px' }}>- <h1>TEST - APP IS WORKING!</h1>- <p>If you see this, the basic app infrastructure works.</p>- </div>- );-}diff --git a/frontend-modern/src/api/alerts.ts b/frontend-modern/src/api/alerts.tsindex 6df3c9abba..0e92d397ff 100644--- a/frontend-modern/src/api/alerts.ts+++ b/frontend-modern/src/api/alerts.ts@@ -1,8 +1,6 @@import type { Alert } from '@/types/api';import type { AlertConfig } from '@/types/alerts';import { apiFetchJSON } from '@/utils/apiClient';-// Error handling utilities available for future use-// import { handleError, createErrorBoundary } from '@/utils/errorHandler';export class AlertsAPI {private static baseUrl = '/api/alerts';@@ -31,8 +29,6 @@ export class AlertsAPI {return apiFetchJSON(`${this.baseUrl}/history?${queryParams}`);}- // Removed unused config methods - not implemented in backend-static async acknowledge(alertId: string, user?: string): Promise<{ success: boolean }> {return apiFetchJSON(`${this.baseUrl}/${encodeURIComponent(alertId)}/acknowledge`, {method: 'POST',@@ -64,12 +60,6 @@ export class AlertsAPI {});}- static async clearAlert(alertId: string): Promise<{ success: boolean }> {- return apiFetchJSON(`${this.baseUrl}/${encodeURIComponent(alertId)}/clear`, {- method: 'POST',- });- }-static async clearHistory(): Promise<{ success: boolean }> {return apiFetchJSON(`${this.baseUrl}/history`, {method: 'DELETE',@@ -86,12 +76,4 @@ export class AlertsAPI {});}- static async bulkClear(- alertIds: string[],- ): Promise<{ results: Array<{ alertId: string; success: boolean; error?: string }> }> {- return apiFetchJSON(`${this.baseUrl}/bulk/clear`, {- method: 'POST',- body: JSON.stringify({ alertIds }),- });- }}diff --git a/frontend-modern/src/api/settings.ts b/frontend-modern/src/api/settings.tsindex 1f4dd12f58..87d9a7bbe4 100644--- a/frontend-modern/src/api/settings.ts+++ b/frontend-modern/src/api/settings.ts@@ -1,47 +1,23 @@-import type { SettingsResponse, SettingsUpdateRequest } from '@/types/settings';import type { SystemConfig } from '@/types/config';import { apiFetchJSON } from '@/utils/apiClient';-// Response types-export interface ApiResponse<T = unknown> {- success?: boolean;- status?: string;- message?: string;- data?: T;+export interface SystemSettingsResponse extends SystemConfig {+ envOverrides?: Record<string, boolean>;}export class SettingsAPI {private static baseUrl = '/api';- static async getSettings(): Promise<SettingsResponse> {- return apiFetchJSON(`${this.baseUrl}/settings`) as Promise<SettingsResponse>;- }-- // Full settings update (legacy - avoid using)- static async updateSettings(settings: SettingsUpdateRequest): Promise<ApiResponse> {- return apiFetchJSON(`${this.baseUrl}/settings/update`, {- method: 'POST',- body: JSON.stringify(settings),- }) as Promise<ApiResponse>;- }-// System settings update (preferred) - uses SystemConfig type from config.ts- static async updateSystemSettings(settings: Partial<SystemConfig>): Promise<ApiResponse> {- return apiFetchJSON(`${this.baseUrl}/system/settings/update`, {+ static async updateSystemSettings(settings: Partial<SystemConfig>): Promise<void> {+ await apiFetchJSON(`${this.baseUrl}/system/settings/update`, {method: 'POST',body: JSON.stringify(settings),- }) as Promise<ApiResponse>;+ });}// Get system settings - returns SystemConfig- static async getSystemSettings(): Promise<SystemConfig> {- return apiFetchJSON(`${this.baseUrl}/system/settings`) as Promise<SystemConfig>;- }-- static async validateSettings(settings: SettingsUpdateRequest): Promise<ApiResponse> {- return apiFetchJSON(`${this.baseUrl}/settings/validate`, {- method: 'POST',- body: JSON.stringify(settings),- }) as Promise<ApiResponse>;+ static async getSystemSettings(): Promise<SystemSettingsResponse> {+ return apiFetchJSON(`${this.baseUrl}/system/settings`) as Promise<SystemSettingsResponse>;}}diff --git a/frontend-modern/src/api/system.ts b/frontend-modern/src/api/system.tsdeleted file mode 100644index a5205b9e66..0000000000--- a/frontend-modern/src/api/system.ts+++ /dev/null@@ -1,27 +0,0 @@-// System API for managing system settings-import { apiFetchJSON } from '@/utils/apiClient';--export interface SystemSettings {- // Note: PVE polling is hardcoded to 10s server-side- updateChannel?: string;- autoUpdateEnabled: boolean;- autoUpdateCheckInterval?: number;- autoUpdateTime?: string;- backupPollingInterval?: number;- backupPollingEnabled?: boolean;- // apiToken removed - now handled via security API-}--export class SystemAPI {- // System Settings- static async getSystemSettings(): Promise<SystemSettings> {- return apiFetchJSON('/api/system/settings');- }-- static async updateSystemSettings(settings: Partial<SystemSettings>): Promise<void> {- await apiFetchJSON('/api/system/settings/update', {- method: 'POST',- body: JSON.stringify(settings),- });- }-}diff --git a/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx b/frontend-modern/src/components/Alerts/EmailProviderSelect.tsxindex 7e4c004b69..6a044323d1 100644--- a/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx+++ b/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx@@ -1,5 +1,6 @@import { createSignal, createEffect, Show, For } from 'solid-js';import { NotificationsAPI } from '@/api/notifications';+import { logger } from '@/utils/logger';import {formField,labelClass,@@ -53,7 +54,7 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) {const data = await NotificationsAPI.getEmailProviders();setProviders(data);} catch (err) {- console.error('Failed to load email providers:', err);+ logger.error('Failed to load email providers', err);}});diff --git a/frontend-modern/src/components/Alerts/ResourceTable.tsx b/frontend-modern/src/components/Alerts/ResourceTable.tsxindex ea5064f619..9673eb6d56 100644--- a/frontend-modern/src/components/Alerts/ResourceTable.tsx+++ b/frontend-modern/src/components/Alerts/ResourceTable.tsx@@ -5,6 +5,7 @@ import type { Alert } from '@/types/api';import { Card } from '@/components/shared/Card';import { SectionHeader } from '@/components/shared/SectionHeader';import { ThresholdSlider } from '@/components/Dashboard/ThresholdSlider';+import { logger } from '@/utils/logger';const COLUMN_TOOLTIP_LOOKUP: Record<string, string> = {'cpu %': 'Percent CPU utilization allowed before an alert fires.',@@ -173,7 +174,7 @@ export function ResourceTable(props: ResourceTableProps) {// Track changes to global defaults and factory defaults for debuggingcreateEffect(() => {- console.log('[ResourceTable] createEffect triggered - props changed:', {+ logger.debug('[ResourceTable] props changed', {title: props.title,globalDefaults: props.globalDefaults,factoryDefaults: props.factoryDefaults,@@ -183,13 +184,13 @@ export function ResourceTable(props: ResourceTableProps) {// Check if global defaults have been customized from factory defaultsconst hasCustomGlobalDefaults = () => {- console.log('[ResourceTable] hasCustomGlobalDefaults check:', {+ logger.debug('[ResourceTable] hasCustomGlobalDefaults check', {globalDefaults: props.globalDefaults,factoryDefaults: props.factoryDefaults,title: props.title,});if (!props.globalDefaults || !props.factoryDefaults) {- console.log('[ResourceTable] Missing props, returning false');+ logger.debug('[ResourceTable] Missing props, returning false');return false;}const result = Object.keys(props.factoryDefaults).some((key) => {@@ -197,13 +198,15 @@ export function ResourceTable(props: ResourceTableProps) {const factory = props.factoryDefaults?.[key];const differs = current !== undefined && current !== factory;if (differs) {- console.log(- `[ResourceTable] Difference found: ${key} current=${current} factory=${factory}`,- );+ logger.debug('[ResourceTable] Difference found', {+ key,+ current,+ factory,+ });}return differs;});- console.log(`[ResourceTable] hasCustomGlobalDefaults result: ${result}`);+ logger.debug('[ResourceTable] hasCustomGlobalDefaults result', { result });return result;};diff --git a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx b/frontend-modern/src/components/Alerts/ThresholdsTable.tsxindex 545b9c68c9..4f273a6773 100644--- a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx+++ b/frontend-modern/src/components/Alerts/ThresholdsTable.tsx@@ -29,6 +29,7 @@ import type {} from '@/types/alerts';import { ResourceTable, Resource, GroupHeaderMeta } from './ResourceTable';import { useAlertsActivation } from '@/stores/alertsActivation';+import { logger } from '@/utils/logger';type OverrideType =| 'guest'| 'node'@@ -336,7 +337,8 @@ const [editingThresholds, setEditingThresholds] = createSignal<// Determine active tab from URLconst getActiveTabFromRoute = (): 'proxmox' | 'pmg' | 'hosts' | 'docker' => {const path = location.pathname;- if (path.includes('/thresholds/docker')) return 'docker';+ if (path.includes('/thresholds/containers')) return 'docker';+ if (path.includes('/thresholds/docker')) return 'docker'; // Legacy supportif (path.includes('/thresholds/hosts')) return 'hosts';if (path.includes('/thresholds/mail-gateway')) return 'pmg';return 'proxmox'; // default@@ -357,12 +359,21 @@ const [editingThresholds, setEditingThresholds] = createSignal<}});+ createEffect(() => {+ if (location.pathname.startsWith('/alerts/thresholds/docker')) {+ navigate(+ location.pathname.replace('/alerts/thresholds/docker', '/alerts/thresholds/containers'),+ { replace: true, scroll: false },+ );+ }+ });+const handleTabClick = (tab: 'proxmox' | 'pmg' | 'hosts' | 'docker') => {const tabRoutes = {proxmox: '/alerts/thresholds/proxmox',pmg: '/alerts/thresholds/mail-gateway',hosts: '/alerts/thresholds/hosts',- docker: '/alerts/thresholds/docker',+ docker: '/alerts/thresholds/containers',};navigate(tabRoutes[tab]);};@@ -731,7 +742,7 @@ const [editingThresholds, setEditingThresholds] = createSignal<displayName: friendlyName,rawName: originalName,type: 'dockerHost' as const,- resourceType: 'Docker Host',+ resourceType: 'Container Host',node: host.hostname,instance: host.displayName,status,@@ -754,7 +765,7 @@ const [editingThresholds, setEditingThresholds] = createSignal<displayName: friendlyName,rawName: originalName,type: 'dockerHost',- resourceType: 'Docker Host',+ resourceType: 'Container Host',node: override.node || '',instance: override.instance || '',status: 'unknown',@@ -844,7 +855,7 @@ const [editingThresholds, setEditingThresholds] = createSignal<id: resourceId,name: containerName,type: 'dockerContainer',- resourceType: 'Docker Container',+ resourceType: 'Container',node: groupKey,instance: host.hostname,status,@@ -871,7 +882,7 @@ const [editingThresholds, setEditingThresholds] = createSignal<.filter((override) => override.type === 'dockerContainer' && !seen.has(override.id)).forEach((override) => {const fallbackName = override.name || override.id.split('/').pop() || override.id;- const group = 'Unassigned Docker Containers';+ const group = 'Unassigned Containers';if (!groups[group]) {groups[group] = [];}@@ -879,7 +890,7 @@ const [editingThresholds, setEditingThresholds] = createSignal<id: override.id,name: fallbackName,type: 'dockerContainer',- resourceType: 'Docker Container',+ resourceType: 'Container',status: 'unknown',hasOverride: true,disabled: override.disabled || false,@@ -934,8 +945,8 @@ const [editingThresholds, setEditingThresholds] = createSignal<});});- meta['Unassigned Docker Containers'] = {- displayName: 'Unassigned Docker Containers',+ meta['Unassigned Containers'] = {+ displayName: 'Unassigned Containers',status: 'unknown',};@@ -1448,7 +1459,7 @@ const [editingThresholds, setEditingThresholds] = createSignal<},{key: 'dockerHosts' as const,- label: 'Docker Hosts',+ label: 'Container Hosts',total: props.dockerHosts?.length ?? 0,overrides: countOverrides(dockerHostsWithOverrides()),tab: 'docker' as const,@@ -1497,7 +1508,7 @@ const [editingThresholds, setEditingThresholds] = createSignal<},{key: 'dockerContainers' as const,- label: 'Docker Containers',+ label: 'Containers',total: totalDockerContainers() ?? 0,overrides: countOverrides(dockerContainersFlat()),tab: 'docker' as const,@@ -1514,7 +1525,7 @@ const [editingThresholds, setEditingThresholds] = createSignal<const filtered = items.filter((item) => item.total > 0 || item.overrides > 0);return filtered.filter((item) => item.tab === activeTab());} catch (err) {- console.error('Error in summaryItems memo:', err);+ logger.error('Error in summaryItems memo:', err);return [];}});@@ -2245,7 +2256,7 @@ const cancelEdit = () => {: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300'}`}>- Docker+ Containers</button></nav></div>@@ -2270,6 +2281,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDefaults={props.nodeDefaults}@@ -2309,6 +2322,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDefaults={{ cpu: props.nodeDefaults.cpu, memory: props.nodeDefaults.memory }}@@ -2382,6 +2397,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDefaults={props.guestDefaults}@@ -2444,6 +2461,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDefaults={backupDefaultsRecord()}@@ -2516,6 +2535,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDefaults={snapshotDefaultsRecord()}@@ -2591,6 +2612,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDefaults={{ usage: props.storageDefault() }}@@ -2664,6 +2687,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDefaults={pmgGlobalDefaults()}@@ -2699,6 +2724,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDefaults={props.hostDefaults}@@ -2725,7 +2752,7 @@ const cancelEdit = () => {Ignored container prefixes</h3><p class="mt-1 text-xs text-gray-600 dark:text-gray-400">- Containers whose name or ID starts with any prefix below are skipped for Docker+ Containers whose name or ID starts with any prefix below are skipped for containeralerts. Enter one prefix per line; matching is case-insensitive.</p></div>@@ -2836,11 +2863,11 @@ const cancelEdit = () => {<Show when={hasSection('dockerHosts')}><div ref={registerSection('dockerHosts')} class="scroll-mt-24"><ResourceTable- title="Docker Hosts"+ title="Container Hosts"resources={dockerHostsWithOverrides()}columns={[]}activeAlerts={props.activeAlerts}- emptyMessage="No Docker hosts match the current filters."+ emptyMessage="No container hosts match the current filters."onEdit={startEditing}onSaveEdit={saveEdit}onCancelEdit={cancelEdit}@@ -2851,6 +2878,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDisableFlag={props.disableAllDockerHosts}@@ -2868,7 +2897,7 @@ const cancelEdit = () => {<Show when={hasSection('dockerContainers')}><div ref={registerSection('dockerContainers')} class="scroll-mt-24"><ResourceTable- title="Docker Containers"+ title="Containers"groupedResources={dockerContainersGroupedByHost()}groupHeaderMeta={dockerHostGroupMeta()}columns={[@@ -2881,7 +2910,7 @@ const cancelEdit = () => {'Memory Critical %',]}activeAlerts={props.activeAlerts}- emptyMessage="No Docker containers match the current filters."+ emptyMessage="No containers match the current filters."onEdit={startEditing}onSaveEdit={saveEdit}onCancelEdit={cancelEdit}@@ -2891,6 +2920,8 @@ const cancelEdit = () => {editingId={editingId}editingThresholds={editingThresholds}setEditingThresholds={setEditingThresholds}+ editingNote={editingNote}+ setEditingNote={setEditingNote}formatMetricValue={formatMetricValue}hasActiveAlert={hasActiveAlert}globalDefaults={{diff --git a/frontend-modern/src/components/Alerts/WebhookConfig.tsx b/frontend-modern/src/components/Alerts/WebhookConfig.tsxindex 9886aeb6b7..a4a353a37b 100644--- a/frontend-modern/src/components/Alerts/WebhookConfig.tsx+++ b/frontend-modern/src/components/Alerts/WebhookConfig.tsx@@ -1,5 +1,6 @@import { createSignal, createEffect, Show, For, Index } from 'solid-js';import { NotificationsAPI, Webhook } from '@/api/notifications';+import { logger } from '@/utils/logger';import {formField,labelClass,@@ -164,7 +165,7 @@ export function WebhookConfig(props: WebhookConfigProps) {const data = await NotificationsAPI.getWebhookTemplates();setTemplates(data);} catch (err) {- console.error('Failed to load webhook templates:', err);+ logger.error('Failed to load webhook templates:', err);}});diff --git a/frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsx b/frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsxindex 75fea388eb..35a852aebc 100644--- a/frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsx+++ b/frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsx@@ -6,7 +6,7 @@ import { ThresholdsTable, normalizeDockerIgnoredInput } from '../ThresholdsTableimport type { PMGThresholdDefaults, SnapshotAlertConfig, BackupAlertConfig } from '@/types/alerts';import type { Host } from '@/types/api';-let mockPathname = '/alerts/thresholds/docker';+let mockPathname = '/alerts/thresholds/containers';vi.mock('@solidjs/router', () => ({useNavigate: () => vi.fn(),@@ -26,7 +26,7 @@ afterEach(() => {});beforeEach(() => {- mockPathname = '/alerts/thresholds/docker';+ mockPathname = '/alerts/thresholds/containers';});const DEFAULT_PMG_THRESHOLDS: PMGThresholdDefaults = {diff --git a/frontend-modern/src/components/Backups/UnifiedBackups.tsx b/frontend-modern/src/components/Backups/UnifiedBackups.tsxindex 1d702da838..e9dd169bf6 100644--- a/frontend-modern/src/components/Backups/UnifiedBackups.tsx+++ b/frontend-modern/src/components/Backups/UnifiedBackups.tsx@@ -13,6 +13,7 @@ import { SectionHeader } from '@/components/shared/SectionHeader';import { showTooltip, hideTooltip } from '@/components/shared/Tooltip';import type { BackupType, GuestType, UnifiedBackup } from '@/types/backups';import { usePersistentSignal } from '@/hooks/usePersistentSignal';+import { logger } from '@/utils/logger';type BackupSortKey = keyof Pick<UnifiedBackup,@@ -42,10 +43,6 @@ const BACKUP_SORT_KEY_VALUES: readonly BackupSortKey[] = [type FilterableGuestType = 'VM' | 'LXC' | 'Host';-// Types for PBS backups - temporarily disabled to avoid unused warnings-// type PBSBackup = any;-// type PBSSnapshot = any;-interface DateGroup {label: string;items: UnifiedBackup[];@@ -243,7 +240,7 @@ const UnifiedBackups: Component = () => {seenBackups.add(backupKey);if (debugMode) {- console.log(+ logger.debug(`PBS backup: vmid=${backup.vmid}, time=${backupTimeSeconds}, key=${backupKey}, verified=${backup.verified}`,);}@@ -273,7 +270,7 @@ const UnifiedBackups: Component = () => {const isVmidZero = vmidAsNumber === 0;if (debugMode && isVmidZero) {- console.log('[PMG Debug] PBS backup with VMID=0:', {+ logger.debug('[PMG Debug] PBS backup with VMID=0:', {vmid: backup.vmid,vmidType: typeof backup.vmid,backupType: backup.backupType,@@ -363,7 +360,7 @@ const UnifiedBackups: Component = () => {// Skip if we've already seen this backup (PBS or local duplicate)if (seenBackups.has(backupKey)) {if (debugMode) {- console.log(+ logger.debug(`PVE storage backup duplicate skipped: vmid=${backup.vmid}, ctime=${backup.ctime}, key=${backupKey}, storage=${backup.storage}`,);}@@ -381,7 +378,7 @@ const UnifiedBackups: Component = () => {const isVmidZero = vmidAsNumber === 0;if (debugMode && isVmidZero) {- console.log('[PMG Debug] Storage backup with VMID=0:', {+ logger.debug('[PMG Debug] Storage backup with VMID=0:', {vmid: backup.vmid,vmidType: typeof backup.vmid,type: backup.type,@@ -426,86 +423,6 @@ const UnifiedBackups: Component = () => {});});- // Normalize PBS backups- // NOTE: Legacy code - PBS backups are now handled differently in the Go backend- // The 'backups' field doesn't exist on PBSInstance anymore, and 'snapshots' field- // doesn't exist on PBSDatastore. This code is kept for reference but commented out.-- /*- state.pbs?.forEach((pbsInstance) => {- // Check if backups are at the instance level- if (pbsInstance.backups && Array.isArray(pbsInstance.backups)) {- pbsInstance.backups.forEach((backup: PBSBackup) => {- // Determine display type - VMID 0 indicates host backup (e.g., PMG)- let displayType: GuestType;- if (backup.vmid === 0) {- displayType = 'Host';- } else if (backup.type === 'vm' || backup.type === 'qemu') {- displayType = 'VM';- } else {- displayType = 'LXC';- }-- unified.push({- backupType: 'remote',- vmid: backup.vmid || 0,- name: backup.guestName || '',- type: displayType,- node: pbsInstance.name || 'PBS',- instance: pbsInstance.id || 'PBS',- backupTime: backup.ctime || backup.backupTime || 0,- backupName: `${backup.vmid}/${new Date((backup.ctime || backup.backupTime || 0) * 1000).toISOString().split('T')[0]}`,- description: backup.notes || backup.comment || '',- status: backup.verified ? 'verified' : 'unverified',- size: backup.size || null,- storage: null,- datastore: backup.datastore || null,- namespace: backup.namespace || 'root',- verified: backup.verified || false,- protected: backup.protected || false- });- });- }-- // Also check datastores for snapshots (original JS structure)- if (pbsInstance.datastores && Array.isArray(pbsInstance.datastores)) {- pbsInstance.datastores?.forEach((datastore) => {- if (datastore.snapshots && Array.isArray(datastore.snapshots)) {- datastore.snapshots.forEach((backup: PBSSnapshot) => {- let totalSize = 0;- if (backup.files && Array.isArray(backup.files)) {- totalSize = backup.files.reduce((sum: number, file) => sum + (file.size || 0), 0);- }-- unified.push({- backupType: 'remote',- vmid: backup['backup-id'] || 0,- name: backup.comment || '',- type: backup['backup-type'] === 'vm' || backup['backup-type'] === 'qemu'- ? 'VM'- : backup['backup-type'] === 'host'- ? 'Host'- : 'LXC',- node: pbsInstance.name || 'PBS',- instance: pbsInstance.id || 'PBS',- backupTime: backup['backup-time'] || 0,- backupName: `${backup['backup-id']}/${new Date((backup['backup-time'] || 0) * 1000).toISOString().split('T')[0]}`,- description: backup.comment || '',- status: backup.verified ? 'verified' : 'unverified',- size: totalSize || null,- storage: null,- datastore: datastore.name || null,- namespace: backup.namespace || 'root',- verified: backup.verified || false,- protected: backup.protected || false- });- });- }- });- }- });- */-return unified;});diff --git a/frontend-modern/src/components/Dashboard/CompactNodeCard.tsx b/frontend-modern/src/components/Dashboard/CompactNodeCard.tsxdeleted file mode 100644index 2921e8074a..0000000000--- a/frontend-modern/src/components/Dashboard/CompactNodeCard.tsx+++ /dev/null@@ -1,237 +0,0 @@-import { Component, Show, createMemo } from 'solid-js';-import type { Node } from '@/types/api';-import { formatUptime } from '@/utils/format';-import { getAlertStyles, getResourceAlerts } from '@/utils/alerts';-import { AlertIndicator } from '@/components/shared/AlertIndicators';-import { useWebSocket } from '@/App';-import { Card } from '@/components/shared/Card';-import { getNodeDisplayName, hasAlternateDisplayName } from '@/utils/nodes';-import { useAlertsActivation } from '@/stores/alertsActivation';--interface CompactNodeCardProps {- node: Node;- variant: 'compact' | 'ultra-compact';- onClick?: () => void;- isSelected?: boolean;-}--const CompactNodeCard: Component<CompactNodeCardProps> = (props) => {- const { activeAlerts } = useWebSocket();- const alertsActivation = useAlertsActivation();- const alertsEnabled = createMemo(() => alertsActivation.activationState() === 'active');-- const isOnline = () => props.node.status === 'online' && props.node.uptime > 0;-- const cpuPercent = createMemo(() => Math.round(props.node.cpu * 100));- const memPercent = createMemo(() => Math.round(props.node.memory?.usage || 0));- const diskPercent = createMemo(() => {- if (!props.node.disk || props.node.disk.total === 0) return 0;- return Math.round((props.node.disk.used / props.node.disk.total) * 100);- });-- const displayName = () => getNodeDisplayName(props.node);- const showActualName = () => hasAlternateDisplayName(props.node);-- const alertStyles = createMemo(() =>- getAlertStyles(props.node.id || props.node.name, activeAlerts, alertsEnabled()),- );- const nodeAlerts = createMemo(() =>- getResourceAlerts(props.node.id || props.node.name, activeAlerts, alertsEnabled()),- );- const unacknowledgedNodeAlerts = createMemo(() =>- nodeAlerts().filter((alert) => !alert.acknowledged),- );-- // Get status color- const getMetricColor = (value: number, type: 'cpu' | 'mem' | 'disk') => {- const thresholds = {- cpu: { high: 90, warn: 80 },- mem: { high: 85, warn: 75 },- disk: { high: 90, warn: 80 },- };- const t = thresholds[type];- if (value >= t.high) return 'text-red-500';- if (value >= t.warn) return 'text-yellow-500';- return 'text-gray-600 dark:text-gray-400';- };-- // Mini progress bar for compact mode- const MiniProgressBar = (props: { value: number; type: 'cpu' | 'mem' | 'disk' }) => (- <div class="w-[80px] h-2 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden">- <div- class={`h-full transition-all ${- props.value >= 90 ? 'bg-red-500' : props.value >= 75 ? 'bg-yellow-500' : 'bg-green-500'- }`}- style={{ width: `${props.value}%` }}- />- </div>- );-- if (props.variant === 'ultra-compact') {- // Single line format for 10+ nodes- return (- <Card- padding="none"- border={false}- hoverable- class={`flex items-center gap-2 px-3 py-1.5 ${- props.isSelected- ? 'border-blue-500 bg-blue-50 dark:bg-blue-900/20'- : !isOnline()- ? 'border-red-500'- : alertStyles().hasUnacknowledgedAlert- ? 'border-orange-500'- : alertStyles().hasAcknowledgedOnlyAlert- ? 'border-gray-400 dark:border-gray-600'- : 'border-gray-200 dark:border-gray-700'- } border transition-all cursor-pointer hover:scale-[1.01]`}- onClick={props.onClick}- >- {/* Status dot */}- <span- class={`w-2 h-2 rounded-full ${- props.node.connectionHealth === 'degraded'- ? 'bg-yellow-500'- : isOnline()- ? 'bg-green-500'- : 'bg-red-500'- }`}- />-- {/* Node name */}- <a- href={props.node.host || `https://${props.node.name}:8006`}- target="_blank"- class="font-medium text-sm w-24 truncate hover:text-blue-600 dark:hover:text-blue-400"- title={- showActualName()- ? `${displayName()} • ${props.node.name}`- : props.node.name- }- >- {displayName()}- </a>-- {/* Cluster/Standalone indicator */}- <Show when={props.node.isClusterMember !== undefined}>- <span- class={`text-[9px] px-1 py-0.5 rounded-full font-medium ${- props.node.isClusterMember- ? 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400'- : 'bg-gray-100 text-gray-600 dark:bg-gray-700/50 dark:text-gray-400'- }`}- >- {props.node.isClusterMember ? props.node.clusterName?.slice(0, 3).toUpperCase() : 'SA'}- </span>- </Show>-- {/* Alert indicator */}- <Show when={alertStyles().hasUnacknowledgedAlert}>- <AlertIndicator severity={alertStyles().severity} alerts={unacknowledgedNodeAlerts()} />- </Show>-- {/* Metrics */}- <div class="flex gap-4 text-xs font-mono">- <span class={getMetricColor(cpuPercent(), 'cpu')}>- C:{cpuPercent().toString().padStart(3)}%- </span>- <span class={getMetricColor(memPercent(), 'mem')}>- M:{memPercent().toString().padStart(3)}%- </span>- <span class={getMetricColor(diskPercent(), 'disk')}>- D:{diskPercent().toString().padStart(3)}%- </span>- </div>-- {/* Uptime */}- <span class="ml-auto text-xs text-gray-500 dark:text-gray-400">- ↑{formatUptime(props.node.uptime)}- </span>- </Card>- );- }-- // Compact bar format for 5-9 nodes- return (- <Card- padding="sm"- border={false}- hoverable- class={`border ${- props.isSelected- ? 'border-blue-500 bg-blue-50 dark:bg-blue-900/20'- : !isOnline()- ? 'border-red-500'- : alertStyles().hasUnacknowledgedAlert- ? 'border-orange-500'- : alertStyles().hasAcknowledgedOnlyAlert- ? 'border-gray-400 dark:border-gray-600'- : 'border-gray-200 dark:border-gray-700'- } cursor-pointer transition-all hover:scale-[1.02]`}- onClick={props.onClick}- >- <div class="flex items-center justify-between mb-2">- <div class="flex items-center gap-2">- <span- class={`w-2 h-2 rounded-full ${- props.node.connectionHealth === 'degraded'- ? 'bg-yellow-500'- : isOnline()- ? 'bg-green-500'- : 'bg-red-500'- }`}- />- <a- href={props.node.host || `https://${props.node.name}:8006`}- target="_blank"- class="font-semibold text-sm hover:text-blue-600 dark:hover:text-blue-400"- >- {displayName()}- </a>- <Show when={showActualName()}>- <span class="text-[10px] text-gray-500 dark:text-gray-400">({props.node.name})</span>- </Show>- {/* Cluster/Standalone indicator */}- <Show when={props.node.isClusterMember !== undefined}>- <span- class={`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${- props.node.isClusterMember- ? 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400'- : 'bg-gray-100 text-gray-600 dark:bg-gray-700/50 dark:text-gray-400'- }`}- >- {props.node.isClusterMember ? props.node.clusterName : 'Standalone'}- </span>- </Show>- <Show when={alertStyles().hasUnacknowledgedAlert}>- <AlertIndicator severity={alertStyles().severity} alerts={unacknowledgedNodeAlerts()} />- </Show>- </div>- <span class="text-xs text-gray-500 dark:text-gray-400">- {formatUptime(props.node.uptime)}- </span>- </div>-- {/* Metric bars */}- <div class="space-y-1.5">- <div class="flex items-center gap-2">- <span class="text-xs w-8 text-gray-600 dark:text-gray-400">CPU</span>- <MiniProgressBar value={cpuPercent()} type="cpu" />- <span class={`text-xs ${getMetricColor(cpuPercent(), 'cpu')}`}>{cpuPercent()}%</span>- </div>- <div class="flex items-center gap-2">- <span class="text-xs w-8 text-gray-600 dark:text-gray-400">Mem</span>- <MiniProgressBar value={memPercent()} type="mem" />- <span class={`text-xs ${getMetricColor(memPercent(), 'mem')}`}>{memPercent()}%</span>- </div>- <div class="flex items-center gap-2">- <span class="text-xs w-8 text-gray-600 dark:text-gray-400">Disk</span>- <MiniProgressBar value={diskPercent()} type="disk" />- <span class={`text-xs ${getMetricColor(diskPercent(), 'disk')}`}>{diskPercent()}%</span>- </div>- </div>- </Card>- );-};--export default CompactNodeCard;diff --git a/frontend-modern/src/components/Dashboard/Dashboard.tsx b/frontend-modern/src/components/Dashboard/Dashboard.tsxindex e4da198edd..c416b1359f 100644--- a/frontend-modern/src/components/Dashboard/Dashboard.tsx+++ b/frontend-modern/src/components/Dashboard/Dashboard.tsx@@ -18,9 +18,9 @@ import { NodeGroupHeader } from '@/components/shared/NodeGroupHeader';import { ProxmoxSectionNav } from '@/components/Proxmox/ProxmoxSectionNav';import { isNodeOnline } from '@/utils/status';import { getNodeDisplayName } from '@/utils/nodes';+import { logger } from '@/utils/logger';import { usePersistentSignal } from '@/hooks/usePersistentSignal';--const GUEST_METADATA_STORAGE_KEY = 'pulseGuestMetadata';+import { STORAGE_KEYS } from '@/utils/localStorage';type GuestMetadataRecord = Record<string, GuestMetadata>;type IdleCallbackHandle = number;@@ -49,7 +49,7 @@ const readGuestMetadataCache = (): GuestMetadataRecord => {}try {- const raw = window.localStorage.getItem(GUEST_METADATA_STORAGE_KEY);+ const raw = window.localStorage.getItem(STORAGE_KEYS.GUEST_METADATA);if (!raw) {cachedGuestMetadata = {};lastPersistedGuestMetadataJSON = null;@@ -62,7 +62,7 @@ const readGuestMetadataCache = (): GuestMetadataRecord => {return cachedGuestMetadata;}} catch (err) {- console.warn('Failed to parse cached guest metadata:', err);+ logger.warn('Failed to parse cached guest metadata', err);}cachedGuestMetadata = {};@@ -110,7 +110,7 @@ const runGuestMetadataPersist = () => {performance.clearMarks(`${markBase}:end`);performance.clearMeasures(markBase);}- console.warn('Failed to serialize guest metadata cache:', err);+ logger.warn('Failed to serialize guest metadata cache', err);return;}@@ -121,9 +121,9 @@ const runGuestMetadataPersist = () => {const entries = performance.getEntriesByName(markBase);const entry = entries[entries.length - 1];if (entry) {- console.debug(- `[guestMetadataCache] skipped persist (unchanged) in ${entry.duration.toFixed(2)}ms`,- );+ logger.debug('[guestMetadataCache] skipped persist (unchanged)', {+ durationMs: entry.duration,+ });}performance.clearMarks(`${markBase}:start`);performance.clearMarks(`${markBase}:end`);@@ -133,7 +133,7 @@ const runGuestMetadataPersist = () => {}try {- window.localStorage.setItem(GUEST_METADATA_STORAGE_KEY, serialized);+ window.localStorage.setItem(STORAGE_KEYS.GUEST_METADATA, serialized);lastPersistedGuestMetadataJSON = serialized;if (markBase) {performance.mark(`${markBase}:end`);@@ -141,9 +141,10 @@ const runGuestMetadataPersist = () => {const entries = performance.getEntriesByName(markBase);const entry = entries[entries.length - 1];if (entry) {- console.debug(- `[guestMetadataCache] persisted ${Object.keys(metadata).length} entries in ${entry.duration.toFixed(2)}ms`,- );+ logger.debug('[guestMetadataCache] persisted entries', {+ count: Object.keys(metadata).length,+ durationMs: entry.duration,+ });}performance.clearMarks(`${markBase}:start`);performance.clearMarks(`${markBase}:end`);@@ -157,7 +158,7 @@ const runGuestMetadataPersist = () => {performance.clearMarks(`${markBase}:end`);performance.clearMeasures(markBase);}- console.warn('Failed to persist guest metadata cache:', err);+ logger.warn('Failed to persist guest metadata cache', err);}};@@ -264,7 +265,7 @@ export function Dashboard(props: DashboardProps) {updateGuestMetadataState(() => metadata || {});} catch (err) {// Silently fail - metadata is optional for display- console.debug('Failed to load guest metadata:', err);+ logger.debug('Failed to load guest metadata', err);}});@@ -694,11 +695,11 @@ export function Dashboard(props: DashboardProps) {});const handleNodeSelect = (nodeId: string | null, nodeType: 'pve' | 'pbs' | 'pmg' | null) => {- console.log('handleNodeSelect called:', nodeId, nodeType);+ logger.debug('handleNodeSelect called', { nodeId, nodeType });// Track selected node for filtering (independent of search)if (nodeType === 'pve' || nodeType === null) {setSelectedNode(nodeId);- console.log('Set selected node to:', nodeId);+ logger.debug('Set selected node', { nodeId });// Show filters if a node is selectedif (nodeId && !showFilters()) {setShowFilters(true);diff --git a/frontend-modern/src/components/Dashboard/DiskHealthSummary.tsx b/frontend-modern/src/components/Dashboard/DiskHealthSummary.tsxdeleted file mode 100644index af1de1f824..0000000000--- a/frontend-modern/src/components/Dashboard/DiskHealthSummary.tsx+++ /dev/null@@ -1,139 +0,0 @@-import { Component, createMemo, Show } from 'solid-js';-import type { PhysicalDisk } from '@/types/api';-import { Card } from '@/components/shared/Card';-import { SectionHeader } from '@/components/shared/SectionHeader';--interface DiskHealthSummaryProps {- disks: PhysicalDisk[];-}--export const DiskHealthSummary: Component<DiskHealthSummaryProps> = (props) => {- const diskStats = createMemo(() => {- const disks = props.disks || [];- const total = disks.length;- const healthy = disks.filter((d) => d.health === 'PASSED').length;- const failing = disks.filter((d) => d.health === 'FAILED').length;- const unknown = disks.filter((d) => d.health === 'UNKNOWN' || !d.health).length;- const lowLife = disks.filter((d) => d.wearout > 0 && d.wearout < 10).length;- const avgWearout =- disks.filter((d) => d.wearout > 0).reduce((sum, d) => sum + d.wearout, 0) /- disks.filter((d) => d.wearout > 0).length || 0;-- // Group by node- const byNode: Record<string, number> = {};- disks.forEach((d) => {- byNode[d.node] = (byNode[d.node] || 0) + 1;- });-- return {- total,- healthy,- failing,- unknown,- lowLife,- avgWearout,- byNode,- };- });-- const healthColor = createMemo(() => {- const stats = diskStats();- if (stats.failing > 0) return 'text-red-600 dark:text-red-400';- if (stats.lowLife > 0) return 'text-yellow-600 dark:text-yellow-400';- if (stats.unknown > 0) return 'text-gray-600 dark:text-gray-400';- return 'text-green-600 dark:text-green-400';- });-- const healthBg = createMemo(() => {- const stats = diskStats();- if (stats.failing > 0) return 'bg-red-50 dark:bg-red-950/20 border-red-200 dark:border-red-800';- if (stats.lowLife > 0)- return 'bg-yellow-50 dark:bg-yellow-950/20 border-yellow-200 dark:border-yellow-800';- return 'bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700';- });-- return (- <Show when={diskStats().total > 0}>- <Card padding="md" border={false} class={`${healthBg()}`}>- <div class="flex items-center justify-between mb-3">- <SectionHeader- title="Disk health summary"- size="sm"- class="flex-1"- titleClass="text-gray-900 dark:text-gray-100"- />- <span class={`text-2xl font-bold ${healthColor()}`}>- {diskStats().healthy}/{diskStats().total}- </span>- </div>-- <div class="space-y-2">- {/* Health Status */}- <div class="flex items-center justify-between text-xs">- <span class="text-gray-600 dark:text-gray-400">Status</span>- <div class="flex gap-2">- <Show when={diskStats().healthy > 0}>- <span class="px-1.5 py-0.5 text-xs rounded bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400">- {diskStats().healthy} healthy- </span>- </Show>- <Show when={diskStats().failing > 0}>- <span class="px-1.5 py-0.5 text-xs rounded bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400">- {diskStats().failing} failed- </span>- </Show>- <Show when={diskStats().lowLife > 0}>- <span class="px-1.5 py-0.5 text-xs rounded bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-400">- {diskStats().lowLife} low- </span>- </Show>- <Show when={diskStats().unknown > 0}>- <span class="px-1.5 py-0.5 text-xs rounded bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-400">- {diskStats().unknown} unknown- </span>- </Show>- </div>- </div>-- {/* Average SSD Life */}- <Show when={diskStats().avgWearout > 0}>- <div class="flex items-center justify-between text-xs">- <span class="text-gray-600 dark:text-gray-400">Avg SSD Life</span>- <div class="flex items-center gap-2">- <div class="w-24 bg-gray-200 dark:bg-gray-700 rounded-full h-1.5">- <div- class={`h-1.5 rounded-full transition-all ${- diskStats().avgWearout >= 50- ? 'bg-green-500'- : diskStats().avgWearout >= 20- ? 'bg-yellow-500'- : diskStats().avgWearout >= 10- ? 'bg-orange-500'- : 'bg-red-500'- }`}- style={`width: ${diskStats().avgWearout}%`}- />- </div>- <span class="text-gray-700 dark:text-gray-300 font-medium">- {Math.round(diskStats().avgWearout)}%- </span>- </div>- </div>- </Show>-- {/* Disk Distribution */}- <div class="pt-2 mt-2 border-t border-gray-200 dark:border-gray-700">- <div class="text-xs text-gray-600 dark:text-gray-400 mb-1">Distribution</div>- <div class="flex flex-wrap gap-1">- {Object.entries(diskStats().byNode).map(([node, count]) => (- <span class="px-1.5 py-0.5 bg-gray-100 dark:bg-gray-700 rounded text-xs">- {node}: {count}- </span>- ))}- </div>- </div>- </div>- </Card>- </Show>- );-};diff --git a/frontend-modern/src/components/Dashboard/GuestRow.tsx b/frontend-modern/src/components/Dashboard/GuestRow.tsxindex 24515d4e71..fbef9e6276 100644--- a/frontend-modern/src/components/Dashboard/GuestRow.tsx+++ b/frontend-modern/src/components/Dashboard/GuestRow.tsx@@ -5,9 +5,10 @@ import { MetricBar } from './MetricBar';import { IOMetric } from './IOMetric';import { TagBadges } from './TagBadges';import { DiskList } from './DiskList';-import { isGuestRunning, shouldDisplayGuestMetrics } from '@/utils/status';+import { isGuestRunning } from '@/utils/status';import { GuestMetadataAPI } from '@/api/guestMetadata';import { showSuccess, showError } from '@/utils/toast';+import { logger } from '@/utils/logger';type Guest = VM | Container;@@ -286,7 +287,7 @@ export function GuestRow(props: GuestRowProps) {showSuccess('Guest URL cleared');}} catch (err: any) {- console.error('Failed to save guest URL:', err);+ logger.error('Failed to save guest URL:', err);showError(err.message || 'Failed to save guest URL');}};@@ -313,7 +314,7 @@ export function GuestRow(props: GuestRowProps) {showSuccess('Guest URL removed');} catch (err: any) {- console.error('Failed to remove guest URL:', err);+ logger.error('Failed to remove guest URL:', err);showError(err.message || 'Failed to remove guest URL');}}@@ -342,7 +343,6 @@ export function GuestRow(props: GuestRowProps) {const parentOnline = createMemo(() => props.parentNodeOnline !== false);const isRunning = createMemo(() => isGuestRunning(props.guest, parentOnline()));- const showGuestMetrics = createMemo(() => shouldDisplayGuestMetrics(props.guest, parentOnline()));const lockLabel = createMemo(() => (props.guest.lock || '').trim());// Get helpful tooltip for disk status@@ -581,7 +581,7 @@ export function GuestRow(props: GuestRowProps) {{/* CPU */}<td class="py-0.5 px-2 w-[100px] sm:w-[110px] lg:w-[130px] xl:w-[150px] 2xl:w-[180px]">- <Show when={showGuestMetrics()} fallback={<span class="text-sm text-gray-400">-</span>}>+ <Show when={isRunning()} fallback={<span class="text-sm text-gray-400">-</span>}><MetricBarvalue={cpuPercent()}label={formatPercent(cpuPercent())}@@ -598,7 +598,7 @@ export function GuestRow(props: GuestRowProps) {{/* Memory */}<td class="py-0.5 px-2 w-[100px] sm:w-[110px] lg:w-[130px] xl:w-[150px] 2xl:w-[180px]"><div title={memoryTooltip() ?? undefined}>- <Show when={showGuestMetrics()} fallback={<span class="text-sm text-gray-400">-</span>}>+ <Show when={isRunning()} fallback={<span class="text-sm text-gray-400">-</span>}><MetricBarvalue={memPercent()}label={formatPercent(memPercent())}diff --git a/frontend-modern/src/components/Docker/DockerFilter.tsx b/frontend-modern/src/components/Docker/DockerFilter.tsxindex 84681c5417..45ce05d621 100644--- a/frontend-modern/src/components/Docker/DockerFilter.tsx+++ b/frontend-modern/src/components/Docker/DockerFilter.tsx@@ -138,7 +138,7 @@ export const DockerFilter: Component<DockerFilterProps> = (props) => {? historyMenuRef?.contains(next) || historyToggleRef?.contains(next): false;const interactingWithTips =- next?.getAttribute('aria-controls') === 'docker-search-help';+ next?.getAttribute('aria-controls') === 'container-search-help';if (!interactingWithHistory && !interactingWithTips) {commitSearchToHistory(e.currentTarget.value);}@@ -212,8 +212,8 @@ export const DockerFilter: Component<DockerFilterProps> = (props) => {<span class="sr-only">Show search history</span></button><SearchTipsPopover- popoverId="docker-search-help"- intro="Filter Docker containers quickly"+ popoverId="container-search-help"+ intro="Filter containers quickly"tips={[{ code: 'name:api', description: 'Match containers with "api" in the name' },{ code: 'image:postgres', description: 'Find containers running a specific image' },diff --git a/frontend-modern/src/components/Docker/DockerHostSummaryTable.tsx b/frontend-modern/src/components/Docker/DockerHostSummaryTable.tsxindex e10e2e7bcd..7e3ec656c7 100644--- a/frontend-modern/src/components/Docker/DockerHostSummaryTable.tsx+++ b/frontend-modern/src/components/Docker/DockerHostSummaryTable.tsx@@ -3,6 +3,7 @@ import type { DockerHost } from '@/types/api';import { Card } from '@/components/shared/Card';import { MetricBar } from '@/components/Dashboard/MetricBar';import { renderDockerStatusBadge } from './DockerStatusBadge';+import { resolveHostRuntime } from './runtimeDisplay';import { formatPercent, formatUptime } from '@/utils/format';import { ScrollableTable } from '@/components/shared/ScrollableTable';@@ -234,6 +235,8 @@ export const DockerHostSummaryTable: Component<DockerHostSummaryTableProps> = (p};const agentOutdated = isAgentOutdated(summary.host.agentVersion);+ const runtimeInfo = resolveHostRuntime(summary.host);+ const runtimeVersion = summary.host.runtimeVersion || summary.host.dockerVersion;return (<tr@@ -251,12 +254,15 @@ export const DockerHostSummaryTable: Component<DockerHostSummaryTableProps> = (p({summary.host.hostname})</span></Show>- <span class="text-[9px] px-1 py-0 rounded text-[8px] font-medium bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400 whitespace-nowrap">- Docker+ <span+ class={`text-[9px] px-1 py-0 rounded font-medium whitespace-nowrap ${runtimeInfo.badgeClass}`}+ title={runtimeInfo.raw || runtimeInfo.label}+ >+ {runtimeInfo.label}</span>- <Show when={summary.host.dockerVersion}>+ <Show when={runtimeVersion}><span class="text-[9px] text-gray-500 dark:text-gray-400 whitespace-nowrap">- v{summary.host.dockerVersion}+ v{runtimeVersion}</span></Show></div>diff --git a/frontend-modern/src/components/Docker/DockerHosts.tsx b/frontend-modern/src/components/Docker/DockerHosts.tsxindex 1701cdf39d..35db880ae8 100644--- a/frontend-modern/src/components/Docker/DockerHosts.tsx+++ b/frontend-modern/src/components/Docker/DockerHosts.tsx@@ -11,6 +11,8 @@ import { useWebSocket } from '@/App';import { useDebouncedValue } from '@/hooks/useDebouncedValue';import { formatBytes, formatRelativeTime } from '@/utils/format';import { DockerMetadataAPI, type DockerMetadata } from '@/api/dockerMetadata';+import { logger } from '@/utils/logger';+import { STORAGE_KEYS } from '@/utils/localStorage';const OFFLINE_HOST_STATUSES = new Set(['offline', 'error', 'unreachable', 'down', 'disconnected']);const DEGRADED_HOST_STATUSES = new Set([@@ -22,8 +24,6 @@ const DEGRADED_HOST_STATUSES = new Set(['unknown',]);-const DOCKER_METADATA_STORAGE_KEY = 'pulseDockerMetadata';-type DockerMetadataRecord = Record<string, DockerMetadata>;interface DockerHostsProps {@@ -36,17 +36,21 @@ export const DockerHosts: Component<DockerHostsProps> = (props) => {const { initialDataReceived, reconnecting, connected } = useWebSocket();// Load docker metadata from localStorage or API- const [dockerMetadata, setDockerMetadata] = createSignal<DockerMetadataRecord>(() => {+ const loadInitialDockerMetadata = (): DockerMetadataRecord => {try {- const cached = localStorage.getItem(DOCKER_METADATA_STORAGE_KEY);+ const cached = localStorage.getItem(STORAGE_KEYS.DOCKER_METADATA);if (cached) {return JSON.parse(cached);}} catch (err) {- console.warn('Failed to parse cached docker metadata:', err);+ logger.warn('Failed to parse cached docker metadata', err);}return {};- });+ };++ const [dockerMetadata, setDockerMetadata] = createSignal<DockerMetadataRecord>(+ loadInitialDockerMetadata(),+ );const sortedHosts = createMemo(() => {const hosts = props.hosts || [];@@ -167,13 +171,13 @@ export const DockerHosts: Component<DockerHostsProps> = (props) => {.then((metadata) => {setDockerMetadata(metadata || {});try {- localStorage.setItem(DOCKER_METADATA_STORAGE_KEY, JSON.stringify(metadata || {}));+ localStorage.setItem(STORAGE_KEYS.DOCKER_METADATA, JSON.stringify(metadata || {}));} catch (err) {- console.warn('Failed to cache docker metadata:', err);+ logger.warn('Failed to cache docker metadata', err);}}).catch((err) => {- console.debug('Failed to load docker metadata:', err);+ logger.debug('Failed to load docker metadata', err);});});onCleanup(() => document.removeEventListener('keydown', handleKeyDown));@@ -196,9 +200,9 @@ export const DockerHosts: Component<DockerHostsProps> = (props) => {// Cache to localStoragetry {- localStorage.setItem(DOCKER_METADATA_STORAGE_KEY, JSON.stringify(updated));+ localStorage.setItem(STORAGE_KEYS.DOCKER_METADATA, JSON.stringify(updated));} catch (err) {- console.warn('Failed to cache docker metadata:', err);+ logger.warn('Failed to cache docker metadata', err);}return updated;@@ -283,12 +287,12 @@ export const DockerHosts: Component<DockerHostsProps> = (props) => {/></svg>}- title={reconnecting() ? 'Reconnecting to Docker agents...' : 'Loading Docker data...'}+ title={reconnecting() ? 'Reconnecting to container agents...' : 'Loading container data...'}description={reconnecting()? 'Re-establishing metrics from the monitoring service.': connected()- ? 'Waiting for the first Docker update.'+ ? 'Waiting for the first container update.': 'Connecting to the monitoring service.'}/>@@ -313,15 +317,15 @@ export const DockerHosts: Component<DockerHostsProps> = (props) => {/></svg>}- title="No Docker hosts configured"- description="Deploy the Pulse Docker agent on at least one Docker host to light up this tab. As soon as an agent reports in, container metrics appear automatically."+ title="No container runtimes reporting"+ description="Deploy the Pulse container agent (Docker or Podman) on at least one host to light up this tab. As soon as an agent reports in, runtime metrics appear automatically."actions={<buttontype="button"- onClick={() => navigate('/settings/docker')}+ onClick={() => navigate('/settings/containers')}class="inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700">- <span>Set up Docker agent</span>+ <span>Set up container agent</span><svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" /></svg>diff --git a/frontend-modern/src/components/Docker/DockerTree.tsx b/frontend-modern/src/components/Docker/DockerTree.tsxdeleted file mode 100644index c20bd352c1..0000000000--- a/frontend-modern/src/components/Docker/DockerTree.tsx+++ /dev/null@@ -1,331 +0,0 @@-import { Component, For, Show } from 'solid-js';-import type {- DockerContainer,- DockerHost,- DockerService,- DockerTask,-} from '@/types/api';-import { Card } from '@/components/shared/Card';--export type DockerTreeSelection =- | { type: 'host'; hostId: string; id: string }- | { type: 'service'; hostId: string; id: string }- | { type: 'task'; hostId: string; serviceKey: string; id: string }- | { type: 'container'; hostId: string; id: string };--export interface DockerTreeTaskEntry {- nodeId: string;- task: DockerTask;-}--export interface DockerTreeServiceEntry {- key: string;- service: DockerService;- tasks: DockerTreeTaskEntry[];-}--export interface DockerTreeContainerEntry {- nodeId: string;- container: DockerContainer;-}--export interface DockerTreeHostEntry {- host: DockerHost;- hostId: string;- containers: DockerContainer[];- services: DockerTreeServiceEntry[];- standaloneContainers: DockerTreeContainerEntry[];-}--interface ExpandState {- isExpanded: () => boolean;- toggle: () => void;- setExpanded: (value: boolean) => void;-}--interface DockerTreeProps {- hosts: DockerTreeHostEntry[];- selected?: DockerTreeSelection | null;- onSelect?: (selection: DockerTreeSelection) => void;- getHostState: (hostId: string) => ExpandState;- getServiceState: (serviceKey: string) => ExpandState;-}--export const DockerTree: Component<DockerTreeProps> = (props) => {- const isNodeSelected = (node: DockerTreeSelection) => {- const current = props.selected;- if (!current) return false;- return (- current.type === node.type &&- current.hostId === node.hostId &&- current.id === node.id- );- };-- const hostDisplayName = (host: DockerHost) =>- host.displayName || host.hostname || host.id || 'Unknown host';-- const hostStatusVariant = (host: DockerHost) => {- const status = host.status?.toLowerCase() ?? 'unknown';- if (status === 'online') {- return 'bg-green-500';- }- if (- status === 'offline' ||- status === 'error' ||- status === 'down' ||- status === 'unreachable'- ) {- return 'bg-red-500';- }- return 'bg-yellow-500';- };-- const taskStatusVariant = (task: DockerTask) => {- const state = task.currentState?.toLowerCase() ?? '';- if (state === 'running') return 'bg-green-500';- if (state === 'failed' || state === 'error') return 'bg-red-500';- return 'bg-yellow-500';- };-- const describeTaskLabel = (task: DockerTask) => {- if (task.slot !== undefined && task.slot !== null) {- return `${task.containerName || task.containerId || 'Task'}:${task.slot}`;- }- return task.containerName || task.containerId || task.id?.slice(0, 12) || 'Task';- };-- return (- <Card- padding="none"- class="bg-white dark:bg-slate-900/60 p-2"- >- <nav class="space-y-1.5 text-xs">- <For each={props.hosts}>- {(entry) => {- const hostState = props.getHostState(entry.hostId);-- const selectHost = () => {- hostState.setExpanded(true);- props.onSelect?.({- type: 'host',- hostId: entry.hostId,- id: entry.hostId,- });- };-- return (- <div class="space-y-0.5">- <div class="flex items-start gap-1.5">- {/*- Small expand/collapse control for the host section. We avoid re-rendering- the entire row by leaving the host summary text in a separate button.- */}- <button- type="button"- onClick={() => hostState.toggle()}- aria-label={- hostState.isExpanded() ? 'Collapse host section' : 'Expand host section'- }- class="mt-0 h-4 w-4 flex items-center justify-center rounded border border-transparent text-slate-500 hover:text-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-sky-500"- >- <svg- class={`h-3 w-3 transition-transform duration-150 ${- hostState.isExpanded() ? 'rotate-90' : ''- }`}- viewBox="0 0 20 20"- fill="currentColor"- >- <path d="M6 4l6 6-6 6" />- </svg>- </button>-- <button- type="button"- onClick={selectHost}- class={`flex w-full items-center gap-2 truncate rounded border border-transparent px-1.5 py-0.5 text-left text-[12px] font-medium transition-colors ${- isNodeSelected({ type: 'host', hostId: entry.hostId, id: entry.hostId })- ? 'bg-sky-100 text-sky-800 dark:bg-sky-900/40 dark:text-sky-200'- : 'hover:bg-slate-100 dark:hover:bg-slate-800/50'- }`}- >- <span- class={`h-2 w-2 flex-shrink-0 rounded-full ${hostStatusVariant(entry.host)}`}- aria-hidden="true"- />- <span class="truncate text-slate-700 dark:text-slate-100">{hostDisplayName(entry.host)}</span>- </button>- </div>-- <Show when={hostState.isExpanded()}>- <div class="space-y-1 border-l border-slate-200 pl-2 dark:border-slate-700">- <Show when={entry.services.length > 0}>- <div class="space-y-0.5">- <div class="text-[11px] font-semibold uppercase tracking-tight text-slate-400 dark:text-slate-500">- Services- </div>- <div class="space-y-0.5">- <For each={entry.services}>- {(serviceEntry) => {- const serviceState = props.getServiceState(serviceEntry.key);-- const selectService = () => {- hostState.setExpanded(true);- props.onSelect?.({- type: 'service',- hostId: entry.hostId,- id: serviceEntry.key,- });- };-- const selectTask = (taskNodeId: string) => {- hostState.setExpanded(true);- serviceState.setExpanded(true);- props.onSelect?.({- type: 'task',- hostId: entry.hostId,- serviceKey: serviceEntry.key,- id: taskNodeId,- });- };-- return (- <div class="space-y-0.5">- <div class="flex items-start gap-1.5">- <Show when={serviceEntry.tasks.length > 0}>- <button- type="button"- aria-label={- serviceState.isExpanded()- ? 'Collapse task list'- : 'Expand task list'- }- class="mt-0.5 h-3.5 w-3.5 flex items-center justify-center rounded border border-transparent text-slate-400 hover:text-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-sky-500"- onClick={(event) => {- event.stopPropagation();- serviceState.toggle();- }}- >- <svg- class={`h-3 w-3 transition-transform duration-150 ${- serviceState.isExpanded() ? 'rotate-90' : ''- }`}- viewBox="0 0 20 20"- fill="currentColor"- >- <path d="M6 4l6 6-6 6" />- </svg>- </button>- </Show>- <button- type="button"- onClick={selectService}- class={`flex min-h-[24px] w-full items-center gap-1.5 rounded px-1.5 py-0.5 text-left text-[11px] transition-colors ${- isNodeSelected({- type: 'service',- hostId: entry.hostId,- id: serviceEntry.key,- })- ? 'bg-sky-50 text-sky-700 dark:bg-sky-900/30 dark:text-sky-200'- : 'hover:bg-slate-100 dark:hover:bg-slate-800/50'- }`}- >- <span class="truncate text-slate-600 dark:text-slate-200">- {serviceEntry.service.name || serviceEntry.service.id}- </span>- </button>- </div>-- <Show when={serviceEntry.tasks.length > 0 && serviceState.isExpanded()}>- <div class="space-y-0.5 border-l border-slate-200 pl-2 dark:border-slate-700">- <For each={serviceEntry.tasks}>- {(taskEntry) => {- const task = taskEntry.task;- return (- <button- type="button"- onClick={() => selectTask(taskEntry.nodeId)}- class={`flex w-full items-center gap-1.5 rounded px-1.5 py-0.5 text-left text-[11px] transition-colors ${- isNodeSelected({- type: 'task',- hostId: entry.hostId,- serviceKey: serviceEntry.key,- id: taskEntry.nodeId,- })- ? 'bg-sky-100 text-sky-700 dark:bg-sky-900/40 dark:text-sky-200'- : 'hover:bg-slate-100 dark:hover:bg-slate-800/50'- }`}- >- <span- class={`h-1.5 w-1.5 flex-shrink-0 rounded-full ${taskStatusVariant(task)}`}- aria-hidden="true"- />- <span class="truncate text-slate-500 dark:text-slate-300">- {describeTaskLabel(task)}- </span>- </button>- );- }}- </For>- </div>- </Show>- </div>- );- }}- </For>- </div>- </div>- </Show>-- <Show when={entry.standaloneContainers.length > 0}>- <div class="space-y-0.5">- <div class="text-[11px] font-semibold uppercase tracking-tight text-slate-400 dark:text-slate-500">- Standalone Containers- </div>- <div class="space-y-0.5">- <For each={entry.standaloneContainers}>- {(containerEntry) => {- const container = containerEntry.container;- const selectContainer = () => {- hostState.setExpanded(true);- props.onSelect?.({- type: 'container',- hostId: entry.hostId,- id: containerEntry.nodeId,- });- };-- return (- <button- type="button"- onClick={selectContainer}- class={`flex w-full items-center gap-1.5 rounded px-1.5 py-0.5 text-left text-[11px] transition-colors ${- isNodeSelected({- type: 'container',- hostId: entry.hostId,- id: containerEntry.nodeId,- })- ? 'bg-sky-50 text-sky-700 dark:bg-sky-900/30 dark:text-sky-200'- : 'hover:bg-slate-100 dark:hover:bg-slate-800/50'- }`}- >- <span class="truncate text-slate-600 dark:text-slate-200">- {container.name || container.id || 'Unknown container'}- </span>- </button>- );- }}- </For>- </div>- </div>- </Show>- </div>- </Show>- </div>- );- }}- </For>- </nav>- </Card>- );-};diff --git a/frontend-modern/src/components/Docker/DockerUnifiedTable.tsx b/frontend-modern/src/components/Docker/DockerUnifiedTable.tsxindex 296225f88b..ced68f5ef6 100644--- a/frontend-modern/src/components/Docker/DockerUnifiedTable.tsx+++ b/frontend-modern/src/components/Docker/DockerUnifiedTable.tsx@@ -4,10 +4,12 @@ import { Card } from '@/components/shared/Card';import { ScrollableTable } from '@/components/shared/ScrollableTable';import { EmptyState } from '@/components/shared/EmptyState';import { MetricBar } from '@/components/Dashboard/MetricBar';-import { formatBytes, formatPercent, formatUptime, formatRelativeTime } from '@/utils/format';+import { formatBytes, formatPercent, formatUptime, formatRelativeTime, formatAbsoluteTime } from '@/utils/format';import type { DockerMetadata } from '@/api/dockerMetadata';import { DockerMetadataAPI } from '@/api/dockerMetadata';+import { resolveHostRuntime } from './runtimeDisplay';import { showSuccess, showError } from '@/utils/toast';+import { logger } from '@/utils/logger';const OFFLINE_HOST_STATUSES = new Set(['offline', 'error', 'unreachable', 'down', 'disconnected']);const DEGRADED_HOST_STATUSES = new Set([@@ -108,6 +110,214 @@ const parseSearchTerm = (term?: string): SearchToken[] => {});};+interface PodmanMetadataItem {+ label: string;+ value?: string;+}++interface PodmanMetadataSection {+ title: string;+ items: PodmanMetadataItem[];+}++const PODMAN_METADATA_GROUPS: Array<{+ title: string;+ prefixes?: string[];+ keys?: string[];+}> = [+ {+ title: 'Pod',+ prefixes: ['io.podman.annotations.pod.', 'io.podman.pod.', 'net.containers.podman.pod.'],+ },+ {+ title: 'Compose',+ prefixes: ['io.podman.compose.'],+ },+ {+ title: 'Auto Update',+ prefixes: ['io.containers.autoupdate.'],+ keys: ['io.containers.autoupdate'],+ },+ {+ title: 'User Namespace',+ keys: ['io.podman.annotations.userns', 'io.containers.userns'],+ },+ {+ title: 'Capabilities',+ keys: ['io.containers.capabilities', 'io.containers.selinux', 'io.containers.seccomp'],+ },+ {+ title: 'Podman Annotations',+ prefixes: ['io.podman.annotations.'],+ },+ {+ title: 'Container Settings',+ prefixes: ['io.containers.'],+ },+];++const humanizePodmanKey = (raw: string): string => {+ if (!raw) return 'Value';+ const cleaned = raw.replace(/[_\-.]+/g, ' ').trim();+ if (!cleaned) return 'Value';+ return cleaned+ .split(' ')+ .map((segment) => {+ if (!segment) return segment;+ if (segment.toUpperCase() === segment) return segment;+ return segment.charAt(0).toUpperCase() + segment.slice(1);+ })+ .join(' ')+ .replace(/\bId\b/g, 'ID')+ .replace(/\bUrl\b/g, 'URL');+};++const stripPrefix = (key: string, prefixes: string[] = []): string => {+ for (const prefix of prefixes) {+ if (prefix && key.startsWith(prefix)) {+ const stripped = key.slice(prefix.length);+ if (stripped) {+ return stripped;+ }+ }+ }+ const lastDot = key.lastIndexOf('.');+ if (lastDot >= 0 && lastDot < key.length - 1) {+ return key.slice(lastDot + 1);+ }+ return key;+};++const buildPodmanMetadataSections = (+ metadata?: DockerContainer['podman'],+ labels?: Record<string, string>,+): PodmanMetadataSection[] => {+ const sections: PodmanMetadataSection[] = [];+ const consumed = new Set<string>();+ const markConsumed = (...keys: (string | undefined)[]) => {+ keys.forEach((key) => {+ if (key) consumed.add(key);+ });+ };++ const pushSection = (title: string, items: PodmanMetadataItem[]) => {+ if (items.length > 0) {+ sections.push({ title, items });+ }+ };++ if (metadata) {+ const podItems: PodmanMetadataItem[] = [];+ if (metadata.podName) {+ podItems.push({ label: 'Pod Name', value: metadata.podName });+ markConsumed('io.podman.annotations.pod.name');+ }+ if (metadata.podId) {+ podItems.push({ label: 'Pod ID', value: metadata.podId });+ markConsumed('io.podman.annotations.pod.id');+ }+ if (metadata.infra !== undefined) {+ podItems.push({ label: 'Infra Container', value: metadata.infra ? 'true' : 'false' });+ markConsumed('io.podman.annotations.pod.infra');+ }+ pushSection('Pod', podItems);++ const composeItems: PodmanMetadataItem[] = [];+ if (metadata.composeProject) {+ composeItems.push({ label: 'Project', value: metadata.composeProject });+ markConsumed('io.podman.compose.project');+ }+ if (metadata.composeService) {+ composeItems.push({ label: 'Service', value: metadata.composeService });+ markConsumed('io.podman.compose.service');+ }+ if (metadata.composeWorkdir) {+ composeItems.push({ label: 'Working Dir', value: metadata.composeWorkdir });+ markConsumed('io.podman.compose.working_dir');+ }+ if (metadata.composeConfigHash) {+ composeItems.push({ label: 'Config Hash', value: metadata.composeConfigHash });+ markConsumed('io.podman.compose.config-hash');+ }+ pushSection('Compose', composeItems);++ const autoUpdateItems: PodmanMetadataItem[] = [];+ if (metadata.autoUpdatePolicy) {+ autoUpdateItems.push({ label: 'Policy', value: metadata.autoUpdatePolicy });+ markConsumed('io.containers.autoupdate');+ }+ if (metadata.autoUpdateRestart) {+ autoUpdateItems.push({ label: 'Restart', value: metadata.autoUpdateRestart });+ markConsumed('io.containers.autoupdate.restart');+ }+ pushSection('Auto Update', autoUpdateItems);++ const namespaceItems: PodmanMetadataItem[] = [];+ if (metadata.userNamespace) {+ namespaceItems.push({ label: 'User Namespace', value: metadata.userNamespace });+ markConsumed('io.podman.annotations.userns', 'io.containers.userns');+ }+ pushSection('Security', namespaceItems);+ }++ if (!labels || Object.keys(labels).length === 0) {+ return sections;+ }++ const entries = Object.entries(labels);+ const remaining = entries.filter(+ ([key]) =>+ !consumed.has(key) && (key.includes('podman') || key.startsWith('io.containers.')),+ );+ if (remaining.length === 0) {+ return sections;+ }++ const used = new Set<string>();+ const addSection = (title: string, prefixes: string[] = [], keys: string[] = []) => {+ const items: Array<[string, string]> = [];++ for (const [key, value] of remaining) {+ if (used.has(key)) continue;++ const matchesPrefix = prefixes.some((prefix) => prefix && key.startsWith(prefix));+ const matchesKey = keys.includes(key);++ if (!matchesPrefix && !matchesKey) continue;++ items.push([key, value]);+ used.add(key);+ }++ if (items.length === 0) return;++ sections.push({+ title,+ items: items.map(([key, value]) => ({+ label: humanizePodmanKey(stripPrefix(key, prefixes)),+ value: value || undefined,+ })),+ });+ };++ for (const group of PODMAN_METADATA_GROUPS) {+ addSection(group.title, group.prefixes ?? [], group.keys ?? []);+ }++ const leftovers = remaining.filter(([key]) => !used.has(key));+ if (leftovers.length > 0) {+ sections.push({+ title: 'Additional Podman Labels',+ items: leftovers.map(([key, value]) => ({+ label: humanizePodmanKey(stripPrefix(key)),+ value: value || undefined,+ })),+ });+ }++ return sections;+};+const findContainerForTask = (containers: DockerContainer[], task: DockerTask) => {if (!containers.length) return undefined;@@ -194,6 +404,17 @@ const containerMatchesToken = (return hostName.includes(token.value);}+ if (token.key === 'pod') {+ const pod = container.podman?.podName?.toLowerCase() ?? '';+ return pod.includes(token.value);+ }++ if (token.key === 'compose') {+ const project = container.podman?.composeProject?.toLowerCase() ?? '';+ const service = container.podman?.composeService?.toLowerCase() ?? '';+ return project.includes(token.value) || service.includes(token.value);+ }+if (token.key === 'state') {return state.includes(token.value) || health.includes(token.value);}@@ -212,6 +433,19 @@ const containerMatchesToken = (.filter(Boolean).map((value) => value!.toLowerCase());+ if (container.podman) {+ [+ container.podman.podName,+ container.podman.podId,+ container.podman.composeProject,+ container.podman.composeService,+ container.podman.autoUpdatePolicy,+ container.podman.userNamespace,+ ]+ .filter(Boolean)+ .forEach((value) => fields.push(value!.toLowerCase()));+ }+if (container.labels) {Object.entries(container.labels).forEach(([key, value]) => {fields.push(key.toLowerCase());@@ -312,7 +546,6 @@ const GROUPED_RESOURCE_INDENT = 'pl-5 sm:pl-6 lg:pl-8';const DockerHostGroupHeader: Component<{ host: DockerHost; colspan: number }> = (props) => {const displayName = props.host.displayName || props.host.hostname || props.host.id;-return (<tr class="bg-gray-50 dark:bg-gray-900/40"><td colSpan={props.colspan} class="py-0.5 pr-2 pl-4">@@ -336,6 +569,8 @@ const DockerContainerRow: Component<{onCustomUrlUpdate?: (resourceId: string, url: string) => void;}> = (props) => {const { host, container } = props.row;+ const runtimeInfo = resolveHostRuntime(host);+ const runtimeVersion = () => host.runtimeVersion || host.dockerVersion || null;const rowId = buildRowId(host, props.row);const resourceId = () => `${host.id}:container:${container.id || container.name}`;const isEditingUrl = createMemo(() => currentlyEditingDockerResourceId() === resourceId());@@ -369,6 +604,14 @@ const DockerContainerRow: Component<{if (!total || total <= 0) return undefined;return `${diskUsageLabel()} / ${formatBytes(total, 0)}`;});+ const createdRelative = createMemo(() => (container.createdAt ? formatRelativeTime(container.createdAt) : null));+ const createdAbsolute = createMemo(() => (container.createdAt ? formatAbsoluteTime(container.createdAt) : null));+ const startedRelative = createMemo(() =>+ container.startedAt ? formatRelativeTime(container.startedAt) : null,+ );+ const startedAbsolute = createMemo(() =>+ container.startedAt ? formatAbsoluteTime(container.startedAt) : null,+ );const mounts = createMemo(() => container.mounts || []);const hasMounts = createMemo(() => mounts().length > 0);const blockIo = createMemo(() => container.blockIo);@@ -384,6 +627,15 @@ const DockerContainerRow: Component<{};const blockIoReadRateLabel = createMemo(() => formatIoRate(blockIoReadRate()));const blockIoWriteRateLabel = createMemo(() => formatIoRate(blockIoWriteRate()));+ const podmanMetadata = createMemo(() => container.podman);+ const podName = createMemo(() => podmanMetadata()?.podName?.trim() || undefined);+ const isPodInfra = createMemo(() => podmanMetadata()?.infra ?? false);+ const podmanMetadataSections = createMemo(() =>+ buildPodmanMetadataSections(podmanMetadata(), container.labels),+ );+ const hasPodmanMetadata = createMemo(+ () => !!podmanMetadata() || podmanMetadataSections().length > 0,+ );const hasBlockIo = createMemo(() => {const stats = blockIo();if (!stats) return false;@@ -393,15 +645,14 @@ const DockerContainerRow: Component<{const writeRate = stats.writeRateBytesPerSecond ?? 0;return read > 0 || write > 0 || readRate > 0 || writeRate > 0;});- const hasBlockIoRates = createMemo(() => !!blockIoReadRateLabel() || !!blockIoWriteRateLabel());-const hasDrawerContent = createMemo(() => {return ((container.ports && container.ports.length > 0) ||(container.labels && Object.keys(container.labels).length > 0) ||(container.networks && container.networks.length > 0) ||hasMounts() ||- hasBlockIo()+ hasBlockIo() ||+ hasPodmanMetadata());});@@ -531,7 +782,7 @@ const DockerContainerRow: Component<{showSuccess('Container URL cleared');}} catch (err: any) {- console.error('Failed to save container URL:', err);+ logger.error('Failed to save container URL:', err);showError(err.message || 'Failed to save container URL');// Revert on errorsetCustomUrl(hadUrl ? customUrl() : undefined);@@ -562,7 +813,7 @@ const DockerContainerRow: Component<{showSuccess('Container URL removed');} catch (err: any) {- console.error('Failed to remove container URL:', err);+ logger.error('Failed to remove container URL:', err);showError(err.message || 'Failed to remove container URL');}}@@ -646,6 +897,18 @@ const DockerContainerRow: Component<{>{container.name || container.id}</span>+ <Show when={podName()}>+ {(name) => (+ <span class="inline-flex items-center gap-1 rounded bg-purple-100 px-1.5 py-0.5 text-[10px] font-medium text-purple-700 dark:bg-purple-900/40 dark:text-purple-200">+ Pod: {name()}+ <Show when={isPodInfra()}>+ <span class="rounded bg-purple-200 px-1 py-0.5 text-[9px] uppercase text-purple-800 dark:bg-purple-800/50 dark:text-purple-200">+ infra+ </span>+ </Show>+ </span>+ )}+ </Show><Show when={customUrl()}><ahref={customUrl()}@@ -726,11 +989,14 @@ const DockerContainerRow: Component<{</td><td class="px-2 py-0.5"><span- class={`inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap ${typeBadgeClass(- 'container',- )}`}+ class={`inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap ${runtimeInfo.badgeClass}`}+ title={+ runtimeVersion()+ ? `${runtimeInfo.label} ${runtimeVersion()}`+ : runtimeInfo.raw || runtimeInfo.label+ }>- Container+ {runtimeInfo.label}</span></td><td class="px-2 py-0.5 text-xs text-gray-700 dark:text-gray-300">@@ -764,7 +1030,7 @@ const DockerContainerRow: Component<{/></Show></td>- <td class="px-2 py-0.5 min-w-[180px]">+ <td class="px-2 py-0.5 min-w-[200px]"><Show when={hasDiskStats()} fallback={<span class="text-xs text-gray-400">—</span>}><Showwhen={diskPercent() !== null}@@ -778,19 +1044,6 @@ const DockerContainerRow: Component<{/></Show></Show>- <Show when={hasBlockIoRates()}>- <div class="mt-1 text-[11px] text-gray-500 dark:text-gray-400">- <Show when={blockIoReadRateLabel()}>- <span>R {blockIoReadRateLabel()}</span>- </Show>- <Show when={blockIoReadRateLabel() && blockIoWriteRateLabel()}>- <span class="mx-1 text-gray-300 dark:text-gray-600">•</span>- </Show>- <Show when={blockIoWriteRateLabel()}>- <span>W {blockIoWriteRateLabel()}</span>- </Show>- </div>- </Show></td><td class="px-2 py-0.5 text-xs text-gray-700 dark:text-gray-300"><Show when={isRunning()} fallback={<span class="text-gray-400">—</span>}>@@ -809,6 +1062,134 @@ const DockerContainerRow: Component<{<tr class="bg-gray-50 dark:bg-gray-900/50"><td colSpan={props.columns} class="px-4 py-3"><div class="flex flex-wrap justify-start gap-3">+ <div class="min-w-[220px] rounded border border-gray-200 bg-white/70 p-2 shadow-sm dark:border-gray-600/70 dark:bg-gray-900/30">+ <div class="text-[11px] font-medium uppercase tracking-wide text-gray-700 dark:text-gray-200">+ Summary+ </div>+ <div class="mt-2 space-y-1 text-[11px] text-gray-600 dark:text-gray-300">+ <div class="flex items-center justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">Runtime</span>+ <span+ class={`inline-flex items-center gap-2 rounded-full px-2 py-0.5 text-[10px] font-semibold ${runtimeInfo.badgeClass}`}+ title={runtimeInfo.raw || runtimeInfo.label}+ >+ {runtimeInfo.label}+ <Show when={runtimeVersion()}>+ {(version) => (+ <span class="text-[10px] text-gray-500 dark:text-gray-400">{version()}</span>+ )}+ </Show>+ </span>+ </div>+ <div class="flex items-start justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">Image</span>+ <span class="flex-1 truncate text-right text-gray-600 dark:text-gray-300" title={container.image}>+ {container.image || '—'}+ </span>+ </div>+ <Show when={podName()}>+ {(name) => (+ <div class="flex items-center justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">Pod</span>+ <span class="text-right text-gray-600 dark:text-gray-300">+ {name()}+ <Show when={isPodInfra()}>+ <span class="ml-2 rounded bg-purple-100 px-1.5 py-0.5 text-[10px] font-semibold text-purple-700 dark:bg-purple-900/40 dark:text-purple-200">+ infra+ </span>+ </Show>+ </span>+ </div>+ )}+ </Show>+ <Show when={podmanMetadata()?.composeProject}>+ {(project) => (+ <div class="flex items-center justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">Compose Project</span>+ <span class="text-right text-gray-600 dark:text-gray-300">{project()}</span>+ </div>+ )}+ </Show>+ <Show when={podmanMetadata()?.composeService}>+ {(service) => (+ <div class="flex items-center justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">Compose Service</span>+ <span class="text-right text-gray-600 dark:text-gray-300">{service()}</span>+ </div>+ )}+ </Show>+ <Show when={podmanMetadata()?.autoUpdatePolicy}>+ {(policy) => (+ <div class="flex items-center justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">Auto Update</span>+ <span class="text-right text-gray-600 dark:text-gray-300">+ {policy()}+ <Show when={podmanMetadata()?.autoUpdateRestart}>+ {(restart) => (+ <span class="ml-2 text-[10px] text-gray-500 dark:text-gray-400">restart: {restart()}</span>+ )}+ </Show>+ </span>+ </div>+ )}+ </Show>+ <Show when={podmanMetadata()?.userNamespace}>+ {(userns) => (+ <div class="flex items-center justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">User Namespace</span>+ <span class="text-right text-gray-600 dark:text-gray-300">{userns()}</span>+ </div>+ )}+ </Show>+ <div class="flex items-center justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">State</span>+ <span class="text-right text-gray-600 dark:text-gray-300">{statusLabel()}</span>+ </div>+ <div class="flex items-center justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">Restarts</span>+ <span class="text-right text-gray-600 dark:text-gray-300">{restarts()}</span>+ </div>+ <Show when={createdRelative()}>+ {(created) => (+ <div class="flex flex-col gap-0.5">+ <span class="font-medium text-gray-700 dark:text-gray-200">Created</span>+ <div class="text-right text-gray-600 dark:text-gray-300">+ {created()}+ <Show when={createdAbsolute()}>+ {(abs) => (+ <div class="text-[10px] text-gray-500 dark:text-gray-400">{abs()}</div>+ )}+ </Show>+ </div>+ </div>+ )}+ </Show>+ <Show when={startedRelative()}>+ {(started) => (+ <div class="flex flex-col gap-0.5">+ <span class="font-medium text-gray-700 dark:text-gray-200">Started</span>+ <div class="text-right text-gray-600 dark:text-gray-300">+ {started()}+ <Show when={startedAbsolute()}>+ {(abs) => (+ <div class="text-[10px] text-gray-500 dark:text-gray-400">{abs()}</div>+ )}+ </Show>+ </div>+ </div>+ )}+ </Show>+ <div class="flex items-center justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">Uptime</span>+ <span class="text-right text-gray-600 dark:text-gray-300">{uptime()}</span>+ </div>+ </div>+ <Show when={runtimeInfo.id === 'podman'}>+ <div class="mt-3 rounded border border-dashed border-purple-200 px-2 py-1 text-[10px] text-purple-700 dark:border-purple-700/60 dark:text-purple-200">+ Podman hosts report container metrics, but Swarm services and tasks are unavailable. Runtime annotations and compose metadata appear below when present.+ </div>+ </Show>+ </div><Show when={container.ports && container.ports.length > 0}><div class="min-w-[220px] rounded border border-gray-200 bg-white/70 p-2 shadow-sm dark:border-gray-600/70 dark:bg-gray-900/30"><div class="text-[11px] font-medium uppercase tracking-wide text-gray-700 dark:text-gray-200">@@ -856,6 +1237,40 @@ const DockerContainerRow: Component<{</div></Show>+ <Show when={hasPodmanMetadata()}>+ <div class="min-w-[220px] rounded border border-purple-200 bg-white/70 p-2 shadow-sm dark:border-purple-700/60 dark:bg-purple-950/20">+ <div class="text-[11px] font-medium uppercase tracking-wide text-purple-700 dark:text-purple-200">+ Podman Metadata+ </div>+ <div class="mt-1 space-y-2 text-[11px] text-gray-600 dark:text-gray-300">+ <For each={podmanMetadataSections()}>+ {(section) => (+ <div class="space-y-1 border-b border-purple-100 pb-1 last:border-b-0 last:pb-0 dark:border-purple-800/30">+ <div class="text-[10px] font-semibold uppercase tracking-wide text-purple-600 dark:text-purple-300">+ {section.title}+ </div>+ <div class="space-y-1">+ <For each={section.items}>+ {(item) => (+ <div class="flex items-start justify-between gap-2">+ <span class="font-medium text-gray-700 dark:text-gray-200">{item.label}</span>+ <span+ class="max-w-[220px] break-all text-right text-gray-600 dark:text-gray-300"+ title={item.value || '—'}+ >+ {item.value || '—'}+ </span>+ </div>+ )}+ </For>+ </div>+ </div>+ )}+ </For>+ </div>+ </div>+ </Show>+<Show when={hasBlockIo()}><div class="min-w-[220px] rounded border border-gray-200 bg-white/70 p-2 shadow-sm dark:border-gray-600/70 dark:bg-gray-900/30"><div class="text-[11px] font-medium uppercase tracking-wide text-gray-700 dark:text-gray-200">@@ -1129,7 +1544,7 @@ const DockerServiceRow: Component<{showSuccess('Service URL cleared');}} catch (err: any) {- console.error('Failed to save service URL:', err);+ logger.error('Failed to save service URL:', err);showError(err.message || 'Failed to save service URL');// Revert on errorsetCustomUrl(hadUrl ? customUrl() : undefined);@@ -1160,7 +1575,7 @@ const DockerServiceRow: Component<{showSuccess('Service URL removed');} catch (err: any) {- console.error('Failed to remove service URL:', err);+ logger.error('Failed to remove service URL:', err);showError(err.message || 'Failed to remove service URL');}}@@ -1318,7 +1733,7 @@ const DockerServiceRow: Component<{</td><td class="px-2 py-0.5 text-xs text-gray-400 dark:text-gray-500 min-w-[150px]">—</td><td class="px-2 py-0.5 text-xs text-gray-400 dark:text-gray-500 min-w-[210px]">—</td>- <td class="px-2 py-0.5 text-xs text-gray-400 dark:text-gray-500 min-w-[180px]">—</td>+ <td class="px-2 py-0.5 text-xs text-gray-400 dark:text-gray-500 min-w-[200px]">—</td><td class="px-2 py-0.5 text-xs text-gray-700 dark:text-gray-300 whitespace-nowrap"><span class="font-semibold text-gray-900 dark:text-gray-100">{(service.runningTasks ?? 0)}/{service.desiredTasks ?? 0}@@ -1628,48 +2043,48 @@ const DockerUnifiedTable: Component<DockerUnifiedTableProps> = (props) => {fallback={<Card padding="lg"><EmptyState- title="No Docker workloads found"+ title="No container workloads found"description={totalContainers() === 0 && totalServices() === 0- ? 'Add a Docker agent in Settings to start gathering container and service metrics.'+ ? 'Add a container agent in Settings to start gathering container and service metrics.': props.searchTerm || props.statsFilter- ? 'No Docker containers or services match your current filters.'- : 'Docker data is currently unavailable.'+ ? 'No containers or services match your current filters.'+ : 'Container runtime data is currently unavailable.'}/></Card>}><Card padding="none" class="overflow-hidden">- <ScrollableTable minWidth="1024px">- <table class="w-full min-w-[1024px] table-fixed border-collapse whitespace-nowrap">+ <ScrollableTable minWidth="1080px">+ <table class="w-full min-w-[1080px] table-fixed border-collapse whitespace-nowrap"><thead><tr class="bg-gray-50 dark:bg-gray-700/50 text-gray-600 dark:text-gray-300 border-b border-gray-200 dark:border-gray-600">- <th class="pl-4 pr-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[24%]">+ <th class="pl-4 pr-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[22%]">Resource</th>- <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[11%]">+ <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[10%]">Type</th>- <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[17%]">+ <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[16%]">Image / Stack</th>- <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[15%]">+ <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[14%]">Status</th>- <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[14%] min-w-[150px]">+ <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[13%] min-w-[150px]">CPU</th>- <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[16%] min-w-[210px]">+ <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[15%] min-w-[210px]">Memory</th>- <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[15%] min-w-[180px]">+ <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[16%] min-w-[200px]">Disk</th><th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[9%]">Tasks / Restarts</th>- <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[9%]">+ <th class="px-2 py-1 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[8%]">Updated / Uptime</th></tr>diff --git a/frontend-modern/src/components/Docker/runtimeDisplay.ts b/frontend-modern/src/components/Docker/runtimeDisplay.tsnew file mode 100644index 0000000000..551f6eafb2--- /dev/null+++ b/frontend-modern/src/components/Docker/runtimeDisplay.ts@@ -0,0 +1,196 @@+import type { DockerContainer, DockerHost } from '@/types/api';++export type RuntimeKind = 'docker' | 'podman' | 'containerd' | 'cri-o' | 'nerdctl' | 'unknown';++export interface RuntimeDisplayInfo {+ id: RuntimeKind;+ label: string;+ badgeClass: string;+ raw: string;+}++export interface RuntimeDisplayOptions {+ hint?: string | null;+ defaultId?: Exclude<RuntimeKind, 'unknown'> | 'unknown';+}++const BADGE_CLASSES: Record<Exclude<RuntimeKind, 'unknown'>, string> = {+ docker: 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300',+ podman: 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300',+ containerd: 'bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300',+ 'cri-o': 'bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300',+ nerdctl: 'bg-slate-200 text-slate-700 dark:bg-slate-700 dark:text-slate-200',+};++const UNKNOWN_BADGE_CLASS = 'bg-gray-200 text-gray-700 dark:bg-gray-700 dark:text-gray-300';++const LABEL_BY_KIND: Record<RuntimeKind, string> = {+ docker: 'Docker',+ podman: 'Podman',+ containerd: 'containerd',+ 'cri-o': 'CRI-O',+ nerdctl: 'nerdctl',+ unknown: 'Container runtime',+};++const normalize = (value?: string | null) => value?.trim() ?? '';++const MATCHERS: Array<{ id: Exclude<RuntimeKind, 'unknown'>; keywords: string[] }> = [+ { id: 'podman', keywords: ['podman', 'libpod'] },+ { id: 'nerdctl', keywords: ['nerdctl'] },+ { id: 'containerd', keywords: ['containerd'] },+ { id: 'cri-o', keywords: ['cri-o', 'crio'] },+ { id: 'docker', keywords: ['docker', 'moby engine', 'moby'] },+];++const detectRuntime = (value?: string | null) => {+ const raw = normalize(value);+ if (!raw) {+ return null;+ }++ const normalized = raw.toLowerCase();+ for (const matcher of MATCHERS) {+ if (matcher.keywords.some((keyword) => normalized.includes(keyword))) {+ return { id: matcher.id, raw };+ }+ }++ return null;+};++const formatRuntimeLabel = (value: string): string => {+ if (!value) return LABEL_BY_KIND.unknown;++ const cleaned = value.replace(/\s+/g, ' ').trim();++ if (/^cri-?o$/i.test(cleaned)) {+ return LABEL_BY_KIND['cri-o'];+ }++ return cleaned+ .split(/[-_\s]+/)+ .filter(Boolean)+ .map((segment) => {+ if (segment.toLowerCase() === 'cri' || segment.toLowerCase() === 'crio') {+ return 'CRI';+ }+ if (segment.toLowerCase() === 'o') {+ return 'O';+ }+ if (segment === segment.toUpperCase()) {+ return segment;+ }+ return segment.charAt(0).toUpperCase() + segment.slice(1);+ })+ .join(' ');+};++export const getRuntimeDisplay = (+ runtime?: string | null,+ options: RuntimeDisplayOptions = {},+): RuntimeDisplayInfo => {+ const candidates = [+ { value: runtime, raw: normalize(runtime) },+ { value: options.hint, raw: normalize(options.hint) },+ ];++ for (const candidate of candidates) {+ const detected = detectRuntime(candidate.value);+ if (detected) {+ const label = LABEL_BY_KIND[detected.id];+ const badgeClass = BADGE_CLASSES[detected.id];+ return {+ id: detected.id,+ label,+ badgeClass,+ raw: detected.raw,+ };+ }+ }++ const firstRaw = candidates.find((candidate) => candidate.raw !== '')?.raw ?? '';+ const defaultKind: RuntimeKind = options.defaultId ?? 'unknown';++ if (defaultKind !== 'unknown') {+ return {+ id: defaultKind,+ label: LABEL_BY_KIND[defaultKind],+ badgeClass: BADGE_CLASSES[defaultKind],+ raw: firstRaw,+ };+ }++ const label = firstRaw ? formatRuntimeLabel(firstRaw) : LABEL_BY_KIND.unknown;++ return {+ id: 'unknown',+ label,+ badgeClass: UNKNOWN_BADGE_CLASS,+ raw: firstRaw,+ };+};++const PODMAN_LABEL_PREFIXES = ['io.podman.', 'io.containers.', 'net.containers.podman'];++const hasPodmanSignature = (container?: DockerContainer | null) => {+ if (!container?.labels) return false;+ const labels = container.labels;+ return Object.keys(labels).some((key) =>+ PODMAN_LABEL_PREFIXES.some((prefix) => key.startsWith(prefix)),+ ) || Object.values(labels).some((value) => value?.toLowerCase().includes('podman'));+};++const hostHasPodmanSignature = (host?: Pick<DockerHost, 'containers'> | null) => {+ if (!host?.containers || host.containers.length === 0) return false;+ return host.containers.some((container) => hasPodmanSignature(container));+};++export interface ResolveRuntimeOptions extends RuntimeDisplayOptions {+ requireSignatureForGuess?: boolean;+}++const stripVersion = (value?: string | null) => {+ if (!value) return '';+ const match = value.match(/\d+(?:\.\d+){0,2}/);+ return match ? match[0] : value.trim();+};++const isLikelyPodmanVersion = (value?: string | null) => {+ const clean = stripVersion(value);+ if (!clean) return false;+ const parts = clean.split('.');+ const major = Number.parseInt(parts[0] || '', 10);+ if (!Number.isFinite(major)) return false;+ return major >= 2 && major <= 6;+};++export const resolveHostRuntime = (+ host: Pick<DockerHost, 'runtime' | 'runtimeVersion' | 'dockerVersion' | 'containers'>,+ options: ResolveRuntimeOptions = {},+): RuntimeDisplayInfo => {+ const hint = options.hint ?? host.runtimeVersion ?? host.dockerVersion ?? null;+ const base = getRuntimeDisplay(host.runtime, {+ ...options,+ hint,+ defaultId: options.defaultId ?? 'docker',+ });+ if (base.id !== 'docker' && base.id !== 'unknown') {+ return base;+ }++ const hasSignature = hostHasPodmanSignature(host);+ if (hasSignature) {+ return getRuntimeDisplay('podman', { hint });+ }++ if (!options.requireSignatureForGuess && isLikelyPodmanVersion(hint)) {+ return getRuntimeDisplay('podman', { hint });+ }++ if (base.id === 'unknown') {+ return getRuntimeDisplay('docker', { hint });+ }++ return base;+};diff --git a/frontend-modern/src/components/ErrorBoundary.tsx b/frontend-modern/src/components/ErrorBoundary.tsxindex 8ffaa34c37..efe7880218 100644--- a/frontend-modern/src/components/ErrorBoundary.tsx+++ b/frontend-modern/src/components/ErrorBoundary.tsx@@ -40,7 +40,9 @@ const DefaultErrorFallback: Component<{ error: Error; reset: () => void }> = (pr</div><div class="bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mb-4">- <p class="text-sm text-red-800 dark:text-red-200 font-mono">{props.error.message}</p>+ <p class="text-sm text-red-800 dark:text-red-200">+ Please try again or reload the page. If the problem persists, contact your administrator.+ </p></div><div class="flex gap-2">@@ -60,21 +62,9 @@ const DefaultErrorFallback: Component<{ error: Error; reset: () => void }> = (pr</button></div>- <button- type="button"- onClick={() => setDetails(!details())}- class="mt-4 text-sm text-gray-500 dark:text-gray-400 underline hover:text-gray-700 dark:hover:text-gray-300"- >- {details() ? 'Hide' : 'Show'} error details- </button>-- {details() && (- <div class="mt-4 p-3 bg-gray-100 dark:bg-gray-700 rounded overflow-x-auto">- <pre class="text-xs text-gray-700 dark:text-gray-300 whitespace-pre-wrap">- {props.error.stack}- </pre>- </div>- )}+ <div class="mt-4 text-xs text-gray-500 dark:text-gray-400 leading-relaxed">+ Technical details are suppressed in this view. Check server logs for full context.+ </div></div></div>);diff --git a/frontend-modern/src/components/FirstRunSetup.tsx b/frontend-modern/src/components/FirstRunSetup.tsxindex 239e4350c6..c07f5e1a5c 100644--- a/frontend-modern/src/components/FirstRunSetup.tsx+++ b/frontend-modern/src/components/FirstRunSetup.tsx@@ -1,12 +1,12 @@import { Component, createSignal, Show, onMount } from 'solid-js';import { showSuccess, showError } from '@/utils/toast';import { copyToClipboard } from '@/utils/clipboard';-import { clearStoredAPIToken } from '@/utils/tokenStorage';-import { clearApiToken as clearApiClientToken, setApiToken as setApiClientToken } from '@/utils/apiClient';-import { STORAGE_KEYS } from '@/constants';+import { clearAuth as clearApiClientAuth, setApiToken as setApiClientToken } from '@/utils/apiClient';+import { getPulseBaseUrl } from '@/utils/url';import { SectionHeader } from '@/components/shared/SectionHeader';import { showTokenReveal } from '@/stores/tokenReveal';import type { APITokenRecord } from '@/api/security';+import { STORAGE_KEYS } from '@/utils/localStorage';export const FirstRunSetup: Component<{ force?: boolean; showLegacyBanner?: boolean }> = (props,@@ -135,19 +135,7 @@ export const FirstRunSetup: Component<{ force?: boolean; showLegacyBanner?: boolsetSavedToken(token);// Clear any cached credentials from prior sessions so a reload doesn't auto-submit again- try {- sessionStorage.removeItem('pulse_auth');- sessionStorage.removeItem('pulse_auth_user');- } catch (storageError) {- console.warn('Unable to clear cached auth session storage', storageError);- }-- try {- clearStoredAPIToken();- clearApiClientToken();- } catch (storageError) {- console.warn('Unable to clear cached API token', storageError);- }+ clearApiClientAuth();const bootstrapRecord: APITokenRecord = {id: 'bootstrap-token',@@ -183,13 +171,14 @@ export const FirstRunSetup: Component<{ force?: boolean; showLegacyBanner?: bool};const downloadCredentials = () => {+ const baseUrl = getPulseBaseUrl();const credentials = `Pulse Security Credentials========================Generated: ${new Date().toISOString()}Web Interface Login:--------------------URL: ${window.location.origin}+URL: ${baseUrl}Username: ${savedUsername()}Password: ${savedPassword()}@@ -198,7 +187,7 @@ API Access:API Token: ${savedToken()}Example API Usage:-curl -H "X-API-Token: ${savedToken()}" ${window.location.origin}/api/state+curl -H "X-API-Token: ${savedToken()}" ${baseUrl}/api/stateIMPORTANT: Keep these credentials secure!`;diff --git a/frontend-modern/src/components/LegacySSHBanner.tsx b/frontend-modern/src/components/LegacySSHBanner.tsxdeleted file mode 100644index f013d21b1f..0000000000--- a/frontend-modern/src/components/LegacySSHBanner.tsx+++ /dev/null@@ -1,123 +0,0 @@-import { Show, createSignal, createEffect, onMount } from 'solid-js';-import { useNavigate } from '@solidjs/router';--/**- * ⚠️ MIGRATION SCAFFOLDING - TEMPORARY COMPONENT- *- * This banner exists only to handle migration from legacy SSH-in-container- * to the secure pulse-sensor-proxy architecture introduced in v4.23.0.- *- * REMOVAL CRITERIA: Remove after v5.0 or when backend telemetry shows <1% detection rate- * for 30+ days. This component serves no functional purpose beyond migration assistance.- *- * Can be disabled by setting PULSE_LEGACY_DETECTION=false on backend.- */-export function LegacySSHBanner() {- const navigate = useNavigate();- const [isVisible, setIsVisible] = createSignal(false);- const [isDismissed, setIsDismissed] = createSignal(false);-- // Check if previously dismissed- onMount(() => {- const dismissed = localStorage.getItem('legacySSHBannerDismissed');- if (dismissed === 'true') {- setIsDismissed(true);- setIsVisible(false);- }- });-- // Check health endpoint for legacy SSH detection- createEffect(async () => {- if (isDismissed()) return;-- try {- const response = await fetch('/api/health');- const health = await response.json();-- if (health.legacySSHDetected && health.recommendProxyUpgrade) {- setIsVisible(true);- // Log banner impression for telemetry (removal criteria tracking)- console.info('[Migration] Legacy SSH banner shown to user');- }- } catch (_error) {- // Silently fail - health check failures shouldn't break the UI- }- });-- const handleDismiss = () => {- setIsDismissed(true);- setIsVisible(false);- // Store dismissal in localStorage so it persists- localStorage.setItem('legacySSHBannerDismissed', 'true');- // Log dismissal for telemetry- console.info('[Migration] Legacy SSH banner dismissed by user');- };-- return (- <Show when={isVisible()}>- <div class="bg-orange-50 dark:bg-orange-900/20 border-b border-orange-200 dark:border-orange-800 text-orange-800 dark:text-orange-200 relative animate-slideDown">- <div class="px-4 py-2">- <div class="flex items-center justify-between gap-4">- <div class="flex items-center gap-3">- {/* Warning icon */}- <svg- class="w-5 h-5 flex-shrink-0"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <path- d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"- stroke-linecap="round"- stroke-linejoin="round"- />- <line x1="12" y1="9" x2="12" y2="13"></line>- <line x1="12" y1="17" x2="12.01" y2="17"></line>- </svg>-- <div class="flex items-center gap-3 flex-wrap">- <div class="text-sm space-x-1">- <span class="font-medium">Legacy temperature monitoring detected.</span>- <span>Remove each node and re-add it using the installer script in Settings → Nodes (advanced: rerun the host installer script directly).</span>- <a- href="https://github.com/rcourtman/Pulse/blob/main/docs/PULSE_SENSOR_PROXY_HARDENING.md#upgrading-existing-installations"- target="_blank"- rel="noreferrer"- class="underline decoration-dashed underline-offset-2 hover:decoration-solid"- >- View upgrade guide ↗- </a>- </div>- <button- onClick={() => navigate('/settings/nodes')}- class="px-3 py-1 text-xs font-medium bg-orange-600 hover:bg-orange-700 dark:bg-orange-700 dark:hover:bg-orange-800 text-white rounded transition-colors"- >- Go to Nodes →- </button>- </div>- </div>-- {/* Dismiss button */}- <button- onClick={handleDismiss}- class="p-1 hover:bg-orange-100 dark:hover:bg-orange-800/30 rounded transition-colors flex-shrink-0"- title="Dismiss"- >- <svg- class="w-4 h-4"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <line x1="18" y1="6" x2="6" y2="18"></line>- <line x1="6" y1="6" x2="18" y2="18"></line>- </svg>- </button>- </div>- </div>- </div>- </Show>- );-}diff --git a/frontend-modern/src/components/Login.tsx b/frontend-modern/src/components/Login.tsxindex b351cdad36..20f994b8ba 100644--- a/frontend-modern/src/components/Login.tsx+++ b/frontend-modern/src/components/Login.tsx@@ -1,8 +1,7 @@import { Component, createSignal, Show, onMount, lazy, Suspense } from 'solid-js';-import { setBasicAuth } from '@/utils/apiClient';-import { STORAGE_KEYS } from '@/constants';+import { logger } from '@/utils/logger';+import { STORAGE_KEYS } from '@/utils/localStorage';-// Force include FirstRunSetup with lazy loadingconst FirstRunSetup = lazy(() =>import('./FirstRunSetup').then((m) => ({ default: m.FirstRunSetup })),);@@ -95,29 +94,29 @@ export const Login: Component<LoginProps> = (props) => {window.history.replaceState({}, document.title, newUrl);}- console.log('[Login] Starting auth check...');+ logger.debug('[Login] Starting auth check...');try {const response = await fetch('/api/security/status');- console.log('[Login] Auth check response:', response.status);+ logger.debug('[Login] Auth check response', { status: response.status });if (response.ok) {const data = await response.json();- console.log('[Login] Auth status data:', data);+ logger.debug('[Login] Auth status data', data);setAuthStatus(data);} else if (response.status === 429) {// Rate limited - wait a bit and assume auth is configured- console.log('[Login] Rate limited, assuming auth is configured');+ logger.debug('[Login] Rate limited, assuming auth is configured');setAuthStatus({ hasAuthentication: true });} else {- console.log('[Login] Auth check failed, assuming no auth');+ logger.debug('[Login] Auth check failed, assuming no auth');// On error, assume no auth configuredsetAuthStatus({ hasAuthentication: false });}} catch (err) {- console.error('[Login] Failed to check auth status:', err);+ logger.error('[Login] Failed to check auth status:', err);// On error, assume no auth configuredsetAuthStatus({ hasAuthentication: false });} finally {- console.log('[Login] Auth check complete, setting loading to false');+ logger.debug('[Login] Auth check complete, setting loading to false');setLoadingAuth(false);}});@@ -156,7 +155,7 @@ export const Login: Component<LoginProps> = (props) => {throw new Error('OIDC response missing authorization URL');} catch (err) {- console.error('[Login] Failed to start OIDC login:', err);+ logger.error('[Login] Failed to start OIDC login:', err);setOidcError('Failed to start single sign-on. Please try again.');} finally {if (!redirecting) {@@ -165,14 +164,8 @@ export const Login: Component<LoginProps> = (props) => {}};- // Only auto-redirect to OIDC if password auth is disabled- // This prevents redirect loops when both password and OIDC are configured- // createEffect(() => {- // if (!loadingAuth() && supportsOIDC() && !autoOidcTriggered()) {- // setAutoOidcTriggered(true);- // startOidcLogin();- // }- // });+ // Auto-redirect to OIDC is intentionally disabled to prevent redirect loops+ // when both password and OIDC are configured. Users must manually click OIDC button.const handleSubmit = async (e: Event) => {e.preventDefault();@@ -197,8 +190,12 @@ export const Login: Component<LoginProps> = (props) => {const data = await response.json();if (response.ok && data.success) {- // Credentials are valid, save them and notify parent- setBasicAuth(username(), password());+ // Credentials are valid; persist username for convenience and rely on session cookie+ try {+ sessionStorage.setItem('pulse_auth_user', username());+ } catch (_err) {+ // Ignore storage failures (private browsing, etc.)+ }props.onLogin();} else if (response.status === 403) {// Account is locked@@ -245,7 +242,11 @@ export const Login: Component<LoginProps> = (props) => {});if (response.ok) {- setBasicAuth(username(), password());+ try {+ sessionStorage.setItem('pulse_auth_user', username());+ } catch (_storageErr) {+ // Ignore storage issues+ }props.onLogin();} else if (response.status === 401) {setError('Invalid username or password');@@ -263,7 +264,10 @@ export const Login: Component<LoginProps> = (props) => {};// Debug logging- console.log('[Login] Render - loadingAuth:', loadingAuth(), 'authStatus:', authStatus());+ logger.debug('[Login] Render', {+ loadingAuth: loadingAuth(),+ authStatus: authStatus(),+ });const legacyDisableAuth = () => authStatus()?.deprecatedDisableAuth === true;const showFirstRunSetup = () =>diff --git a/frontend-modern/src/components/NotificationContainer.tsx b/frontend-modern/src/components/NotificationContainer.tsxdeleted file mode 100644index f9c93aaf1f..0000000000--- a/frontend-modern/src/components/NotificationContainer.tsx+++ /dev/null@@ -1,5 +0,0 @@-import type { Component } from 'solid-js';--const NotificationContainer: Component = () => null;--export default NotificationContainer;diff --git a/frontend-modern/src/components/SecurityWarning.tsx b/frontend-modern/src/components/SecurityWarning.tsxindex 26f099a345..a037852ad4 100644--- a/frontend-modern/src/components/SecurityWarning.tsx+++ b/frontend-modern/src/components/SecurityWarning.tsx@@ -1,6 +1,8 @@import { Component, createSignal, Show, onMount } from 'solid-js';import { Portal } from 'solid-js/web';import { SectionHeader } from '@/components/shared/SectionHeader';+import { isPulseHttps } from '@/utils/url';+import { logger } from '@/utils/logger';interface SecurityStatus {hasAuthentication: boolean;@@ -42,15 +44,17 @@ export const SecurityWarning: Component = () => {let score = 0;const maxScore = 5;+ const runningOverHttps = isPulseHttps();+if (data.credentialsEncrypted !== false) score++; // Always true currentlyif (data.exportProtected) score++;if (data.apiTokenConfigured) score++;- if (data.hasHTTPS || window.location.protocol === 'https:') score++;+ if (data.hasHTTPS || runningOverHttps) score++;if (data.hasAuthentication) score++;setStatus({hasAuthentication: data.hasAuthentication || false,- hasHTTPS: window.location.protocol === 'https:',+ hasHTTPS: runningOverHttps,hasAPIToken: data.apiTokenConfigured || false,hasAuditLogging: data.hasAuditLogging || false,credentialsEncrypted: true, // Always true in current implementation@@ -63,7 +67,7 @@ export const SecurityWarning: Component = () => {});}} catch (error) {- console.error('Failed to fetch security status:', error);+ logger.error('Failed to fetch security status:', error);}});diff --git a/frontend-modern/src/components/Settings/APITokenManager.tsx b/frontend-modern/src/components/Settings/APITokenManager.tsxindex 1fea366a5e..f75d5e8949 100644--- a/frontend-modern/src/components/Settings/APITokenManager.tsx+++ b/frontend-modern/src/components/Settings/APITokenManager.tsx@@ -5,11 +5,11 @@ import { formatRelativeTime } from '@/utils/format';import { useWebSocket } from '@/App';import type { DockerHost, Host } from '@/types/api';import { showTokenReveal, useTokenRevealState } from '@/stores/tokenReveal';-import { setStoredAPIToken } from '@/utils/tokenStorage';import { setApiToken as setApiClientToken } from '@/utils/apiClient';+import { logger } from '@/utils/logger';import { Card } from '@/components/shared/Card';import { SectionHeader } from '@/components/shared/SectionHeader';-import { ApiIcon } from '@/components/icons/ApiIcon';+import BadgeCheck from 'lucide-solid/icons/badge-check';import {API_SCOPE_LABELS,API_SCOPE_OPTIONS,@@ -125,14 +125,14 @@ export const APITokenManager: Component<APITokenManagerProps> = (props) => {description: 'Allow pulse-host-agent to submit OS, CPU, and disk metrics.',},{- label: 'Docker report',+ label: 'Container report',scopes: [DOCKER_REPORT_SCOPE],- description: 'Permits Docker agents to stream host and container telemetry only.',+ description: 'Permits container agents (Docker or Podman) to stream host and container telemetry only.',},{- label: 'Docker manage',+ label: 'Container manage',scopes: [DOCKER_REPORT_SCOPE, DOCKER_MANAGE_SCOPE],- description: 'Extends Docker reporting with lifecycle actions (restart, stop, etc.).',+ description: 'Extends container reporting with lifecycle actions (restart, stop, etc.).',},{label: 'Settings read',@@ -189,7 +189,7 @@ export const APITokenManager: Component<APITokenManagerProps> = (props) => {setTokens(list);setTokensLoaded(true);} catch (err) {- console.error('Failed to load API tokens', err);+ logger.error('Failed to load API tokens', err);showError('Failed to load API tokens');} finally {setLoading(false);@@ -263,10 +263,9 @@ export const APITokenManager: Component<APITokenManagerProps> = (props) => {showSuccess('New API token generated. Copy it below while it is still visible.');props.onTokensChanged?.();- setStoredAPIToken(token);setApiClientToken(token);} catch (err) {- console.error('Failed to generate API token', err);+ logger.error('Failed to generate API token', err);showError('Failed to generate API token');} finally {setIsGenerating(false);@@ -309,7 +308,7 @@ export const APITokenManager: Component<APITokenManagerProps> = (props) => {const hostSummary =extraCount > 0 ? `${hostListPreview}, +${extraCount} more` : hostListPreview;const hostCountLabel =- dockerUsage.count === 1 ? 'Docker host' : `${dockerUsage.count} Docker hosts`;+ dockerUsage.count === 1 ? 'container host' : `${dockerUsage.count} container hosts`;messageChunks.push(`${hostCountLabel}: ${hostSummary}`);}if (hostUsage) {@@ -346,7 +345,7 @@ export const APITokenManager: Component<APITokenManagerProps> = (props) => {setNewTokenRecord(null);}} catch (err) {- console.error('Failed to revoke API token', err);+ logger.error('Failed to revoke API token', err);showError('Failed to revoke API token');}};@@ -379,7 +378,7 @@ export const APITokenManager: Component<APITokenManagerProps> = (props) => {<div class="flex flex-wrap items-center justify-between gap-4"><div class="flex flex-wrap items-center gap-3"><div class="flex h-10 w-10 items-center justify-center rounded-xl bg-blue-600/10 text-blue-600 dark:bg-blue-500/20 dark:text-blue-200">- <ApiIcon class="h-5 w-5" />+ <BadgeCheck class="h-5 w-5" /></div><SectionHeaderlabel="Token inventory"@@ -561,11 +560,11 @@ export const APITokenManager: Component<APITokenManagerProps> = (props) => {if (dockerUsageEntry) {usageSegments.push(dockerUsageEntry.count === 1- ? dockerUsageEntry.hosts[0]?.label ?? 'Docker host'- : `${dockerUsageEntry.count} Docker hosts`,+ ? dockerUsageEntry.hosts[0]?.label ?? 'Container host'+ : `${dockerUsageEntry.count} container hosts`,);usageTitleSegments.push(- `Docker hosts: ${dockerUsageEntry.hosts.map((host) => host.label).join(', ')}`,+ `Container hosts: ${dockerUsageEntry.hosts.map((host) => host.label).join(', ')}`,);}if (hostUsageEntry) {@@ -690,7 +689,7 @@ export const APITokenManager: Component<APITokenManagerProps> = (props) => {type="text"value={nameInput()}onInput={(e) => setNameInput(e.currentTarget.value)}- placeholder="e.g. Docker pipeline"+ placeholder="e.g. Container pipeline"class="w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:focus:border-blue-400 dark:focus:ring-blue-500/40"/></div>diff --git a/frontend-modern/src/components/Settings/AgentStepSection.tsx b/frontend-modern/src/components/Settings/AgentStepSection.tsxdeleted file mode 100644index 0857ae2f02..0000000000--- a/frontend-modern/src/components/Settings/AgentStepSection.tsx+++ /dev/null@@ -1,34 +0,0 @@-import type { Component, JSX } from 'solid-js';-import { Show } from 'solid-js';--interface AgentStepSectionProps {- step: string;- title: string;- description?: string;- children: JSX.Element;-}--export const AgentStepSection: Component<AgentStepSectionProps> = (props) => {- return (- <section class="space-y-5">- <header class="space-y-2">- <div class="flex items-center gap-2">- <span class="inline-flex items-center justify-center w-7 h-7 rounded-full bg-blue-100 dark:bg-blue-900/30 text-xs font-bold text-blue-700 dark:text-blue-300">- {props.step.replace('Step ', '')}- </span>- <h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">- {props.title}- </h3>- </div>- <Show when={props.description}>- <p class="text-sm text-gray-600 dark:text-gray-400 leading-relaxed ml-9">- {props.description}- </p>- </Show>- </header>- <div class="ml-9">{props.children}</div>- </section>- );-};--export default AgentStepSection;diff --git a/frontend-modern/src/components/Settings/BatchCredentialModal.tsx b/frontend-modern/src/components/Settings/BatchCredentialModal.tsxdeleted file mode 100644index 12cdfb2e01..0000000000--- a/frontend-modern/src/components/Settings/BatchCredentialModal.tsx+++ /dev/null@@ -1,359 +0,0 @@-import { Component, Show, createSignal, For } from 'solid-js';-import { Portal } from 'solid-js/web';-import { showSuccess, showError } from '@/utils/toast';-import { NodesAPI } from '@/api/nodes';-import type { NodeConfig } from '@/types/nodes';-import { SectionHeader } from '@/components/shared/SectionHeader';-import { formField, labelClass, controlClass, formHelpText } from '@/components/shared/Form';--interface DiscoveredServer {- ip: string;- port: number;- type: 'pve' | 'pbs';- version: string;- hostname?: string;- release?: string;-}--interface BatchCredentialModalProps {- isOpen: boolean;- onClose: () => void;- servers: DiscoveredServer[];- onComplete: () => void;-}--export const BatchCredentialModal: Component<BatchCredentialModalProps> = (props) => {- const [authType, setAuthType] = createSignal<'password' | 'token'>('token');- const [username, setUsername] = createSignal('');- const [password, setPassword] = createSignal('');- const [tokenName, setTokenName] = createSignal('');- const [tokenValue, setTokenValue] = createSignal('');- const [isAdding, setIsAdding] = createSignal(false);- const [progress, setProgress] = createSignal<{- current: number;- total: number;- currentServer?: string;- }>({ current: 0, total: 0 });-- const handleBatchAdd = async () => {- // Validate inputs- if (authType() === 'password') {- if (!username() || !password()) {- showError('Username and password are required');- return;- }- } else {- if (!tokenName() || !tokenValue()) {- showError('Token ID and value are required');- return;- }- }-- setIsAdding(true);- const total = props.servers.length;- setProgress({ current: 0, total });-- let successCount = 0;- let failedServers: string[] = [];-- for (let i = 0; i < props.servers.length; i++) {- const server = props.servers[i];- setProgress({ current: i + 1, total, currentServer: server.hostname || server.ip });-- try {- const nodeData: NodeConfig = {- id: '', // Will be generated by backend- type: server.type,- name: server.hostname || server.ip,- host: `https://${server.ip}:${server.port}`,- verifySSL: false,- ...(authType() === 'password'- ? { user: username(), password: password() }- : { tokenName: tokenName(), tokenValue: tokenValue() }),- // Add default monitoring options based on type- ...(server.type === 'pve'- ? {- monitorVMs: true,- monitorContainers: true,- monitorStorage: true,- monitorBackups: true,- monitorPhysicalDisks: false,- }- : {- monitorDatastores: true,- monitorSyncJobs: true,- monitorVerifyJobs: true,- monitorPruneJobs: true,- monitorGarbageJobs: false,- }),- } as NodeConfig;-- await NodesAPI.addNode(nodeData);- successCount++;- } catch (error) {- console.error(`Failed to add ${server.hostname || server.ip}:`, error);- failedServers.push(server.hostname || server.ip);- }- }-- setIsAdding(false);-- if (successCount === total) {- showSuccess(`Successfully added all ${total} servers`);- props.onComplete();- props.onClose();- } else if (successCount > 0) {- showError(`Added ${successCount} of ${total} servers. Failed: ${failedServers.join(', ')}`);- props.onComplete();- } else {- showError('Failed to add any servers. Check your credentials.');- }- };-- return (- <Portal>- <Show when={props.isOpen}>- <div class="fixed inset-0 z-50 overflow-y-auto">- <div class="flex min-h-screen items-center justify-center p-4">- {/* Backdrop */}- <div- class="fixed inset-0 bg-black/50 transition-opacity"- onClick={!isAdding() ? props.onClose : undefined}- />-- {/* Modal */}- <div class="relative w-full max-w-2xl bg-white dark:bg-gray-800 rounded-lg shadow-xl">- {/* Header */}- <div class="flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700">- <SectionHeader- title={`Add ${props.servers.length} discovered servers`}- size="md"- class="flex-1"- />- <Show when={!isAdding()}>- <button- type="button"- onClick={props.onClose}- class="text-gray-400 hover:text-gray-500 dark:hover:text-gray-300"- >- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <line x1="18" y1="6" x2="6" y2="18"></line>- <line x1="6" y1="6" x2="18" y2="18"></line>- </svg>- </button>- </Show>- </div>-- {/* Body */}- <div class="p-6 space-y-6">- {/* Server List */}- <div>- <h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">- Servers to Add- </h4>- <div class="bg-gray-50 dark:bg-gray-700/50 rounded-lg p-3 max-h-32 overflow-y-auto">- <div class="flex flex-wrap gap-2">- <For each={props.servers}>- {(server) => (- <span class="inline-flex items-center gap-1 px-2 py-1 text-xs bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded">- <span- class={`w-2 h-2 rounded-full ${server.type === 'pve' ? 'bg-orange-500' : 'bg-green-500'}`}- ></span>- {server.hostname || server.ip}- </span>- )}- </For>- </div>- </div>- </div>-- {/* Shared Credentials */}- <div>- <h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">- Shared Credentials- <span class="text-xs text-gray-500 dark:text-gray-400 ml-2">- (Same credentials will be used for all servers)- </span>- </h4>-- {/* Auth Type Selector */}- <div class="mb-4">- <div class="flex gap-4">- <label class="flex items-center">- <input- type="radio"- name="batchAuthType"- value="token"- checked={authType() === 'token'}- onChange={() => setAuthType('token')}- disabled={isAdding()}- class="mr-2"- />- <span class="text-sm text-gray-700 dark:text-gray-300">- API Token (Recommended)- </span>- </label>- <label class="flex items-center">- <input- type="radio"- name="batchAuthType"- value="password"- checked={authType() === 'password'}- onChange={() => setAuthType('password')}- disabled={isAdding()}- class="mr-2"- />- <span class="text-sm text-gray-700 dark:text-gray-300">- Username & Password- </span>- </label>- </div>- </div>-- {/* Token Auth Fields */}- <Show when={authType() === 'token'}>- <div class="space-y-4">- <div class={formField}>- <label class={labelClass()}>- Token ID <span class="text-red-500">*</span>- </label>- <input- type="text"- value={tokenName()}- onInput={(e) => setTokenName(e.currentTarget.value)}- placeholder="user@realm!tokenname"- disabled={isAdding()}- class={controlClass('font-mono')}- />- <p class={`${formHelpText} mt-1`}>- Example: pulse-monitor@pam!pulse-token or pulse-monitor@pbs!pulse-token- </p>- </div>-- <div class={formField}>- <label class={labelClass()}>- Token Value <span class="text-red-500">*</span>- </label>- <input- type="password"- value={tokenValue()}- onInput={(e) => setTokenValue(e.currentTarget.value)}- placeholder="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"- disabled={isAdding()}- class={controlClass('font-mono')}- />- </div>- </div>- </Show>-- {/* Password Auth Fields */}- <Show when={authType() === 'password'}>- <div class="space-y-4">- <div class={formField}>- <label class={labelClass()}>- Username <span class="text-red-500">*</span>- </label>- <input- type="text"- value={username()}- onInput={(e) => setUsername(e.currentTarget.value)}- placeholder="root@pam or admin@pbs"- disabled={isAdding()}- class={controlClass()}- />- </div>-- <div class={formField}>- <label class={labelClass()}>- Password <span class="text-red-500">*</span>- </label>- <input- type="password"- value={password()}- onInput={(e) => setPassword(e.currentTarget.value)}- placeholder="Password"- disabled={isAdding()}- class={controlClass()}- />- </div>- </div>- </Show>- </div>-- {/* Progress */}- <Show when={isAdding()}>- <div class="p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg">- <div class="flex items-center gap-3 mb-2">- <svg- class="animate-spin h-5 w-5 text-blue-600 dark:text-blue-400"- viewBox="0 0 24 24"- fill="none"- >- <circle- class="opacity-25"- cx="12"- cy="12"- r="10"- stroke="currentColor"- stroke-width="4"- ></circle>- <path- class="opacity-75"- fill="currentColor"- d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"- ></path>- </svg>- <div>- <p class="text-sm font-medium text-blue-800 dark:text-blue-200">- Adding servers... ({progress().current}/{progress().total})- </p>- <Show when={progress().currentServer}>- <p class="text-xs text-blue-700 dark:text-blue-300">- Currently adding: {progress().currentServer}- </p>- </Show>- </div>- </div>- <div class="w-full bg-blue-200 dark:bg-blue-800 rounded-full h-2">- <div- class="bg-blue-600 dark:bg-blue-400 h-2 rounded-full transition-all"- style={`width: ${(progress().current / progress().total) * 100}%`}- ></div>- </div>- </div>- </Show>- </div>-- {/* Footer */}- <div class="flex items-center justify-end gap-3 px-6 py-4 border-t border-gray-200 dark:border-gray-700">- <button- type="button"- onClick={props.onClose}- disabled={isAdding()}- class="px-4 py-2 text-sm border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"- >- Cancel- </button>- <button- type="button"- onClick={handleBatchAdd}- disabled={isAdding()}- class="px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"- >- {isAdding() ? 'Adding...' : `Add ${props.servers.length} Servers`}- </button>- </div>- </div>- </div>- </div>- </Show>- </Portal>- );-};diff --git a/frontend-modern/src/components/Settings/CommandBuilder.tsx b/frontend-modern/src/components/Settings/CommandBuilder.tsxdeleted file mode 100644index 990bfef989..0000000000--- a/frontend-modern/src/components/Settings/CommandBuilder.tsx+++ /dev/null@@ -1,623 +0,0 @@-import { Component, createSignal, Show, createMemo, createEffect } from 'solid-js';-import { apiFetch } from '@/utils/apiClient';-import { SecurityAPI, type APITokenRecord } from '@/api/security';-import { showTokenReveal, useTokenRevealState } from '@/stores/tokenReveal';-import { setStoredAPIToken } from '@/utils/tokenStorage';-import { setApiToken as setApiClientToken } from '@/utils/apiClient';--interface CommandBuilderProps {- command: string;- placeholder: string;- storedToken?: string | null;- currentTokenHint?: string; // Masked token preview (e.g., "abc12***...xyz89")- onTokenChange?: (token: string) => void;- onTokenGenerated?: (token: string, record: APITokenRecord) => void;- requiresToken: boolean;- hasExistingToken?: boolean;- canManageTokens?: boolean;-}--export const CommandBuilder: Component<CommandBuilderProps> = (props) => {- const [tokenInput, setTokenInput] = createSignal('');- const [showToken, setShowToken] = createSignal(false);- const [isValidating, setIsValidating] = createSignal(false);- const [validationResult, setValidationResult] = createSignal<'valid' | 'invalid' | null>(null);- const [copied, setCopied] = createSignal(false);-- // Token generation/revocation state- const [showGenerateModal, setShowGenerateModal] = createSignal(false);- const [isGenerating, setIsGenerating] = createSignal(false);- const [tokenLabel, setTokenLabel] = createSignal('Docker agent token');- const [latestGeneratedToken, setLatestGeneratedToken] = createSignal<string | null>(null);- const [latestGeneratedRecord, setLatestGeneratedRecord] = createSignal<APITokenRecord | null>(null);- const tokenRevealState = useTokenRevealState();-- const defaultTokenLabel = () => `Docker agent token ${new Date().toISOString().slice(0, 10)}`;- const canManageTokens = () => props.canManageTokens !== false;- const openGenerateModal = () => {- if (!canManageTokens()) return;- setTokenLabel(defaultTokenLabel());- setShowGenerateModal(true);- };-- const isRevealActiveForLatestToken = () => {- const token = latestGeneratedToken();- const active = tokenRevealState();- if (!token || !active) return false;- return active.token === token;- };-- const reopenLatestTokenDialog = () => {- const token = latestGeneratedToken();- const record = latestGeneratedRecord();- if (!token || !record) return;- showTokenReveal({- token,- record,- source: 'docker-command',- note: 'Copy this token now. Close the dialog once you have stored it securely.',- });- };-- // Initialize with stored token if available- createEffect(() => {- if (props.storedToken && tokenInput() === '') {- setTokenInput(props.storedToken);- // Don't auto-validate stored tokens to avoid unnecessary API calls- }- });-- // Computed command with token substitution- const finalCommand = createMemo(() => {- const token = tokenInput().trim();- if (!props.requiresToken) {- return props.command;- }- if (token) {- return props.command.replace(props.placeholder, token);- }- return props.command;- });-- // Check if placeholder is still present- const hasPlaceholder = createMemo(() => {- return props.requiresToken && finalCommand().includes(props.placeholder);- });-- // Determine state (warning, success, or neutral)- const commandState = createMemo<'warning' | 'success' | 'neutral'>(() => {- if (!props.requiresToken) return 'success'; // No token needed, always ready- if (hasPlaceholder()) return 'warning'; // Placeholder still present- if (validationResult() === 'valid') return 'success'; // Token validated- if (tokenInput().trim().length > 0) return 'neutral'; // Token entered but not validated- return 'warning'; // No token entered- });-- // Validate token via API- const validateToken = async () => {- const token = tokenInput().trim();- if (!token || !props.requiresToken) return;-- setIsValidating(true);- setValidationResult(null);-- try {- const response = await apiFetch('/api/security/validate-token', {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ token }),- });-- // Handle different HTTP status codes appropriately- if (!response.ok) {- if (response.status === 401) {- window.showToast('error', 'Authentication required - please log in');- return;- }- if (response.status === 403) {- window.showToast('error', 'Permission denied - admin access required');- return;- }- if (response.status === 429) {- window.showToast('error', 'Rate limit exceeded - please try again later');- return;- }- // Other server errors- window.showToast('error', `Server error (${response.status}) - please try again`);- return;- }-- const data = await response.json();- setValidationResult(data.valid ? 'valid' : 'invalid');-- if (data.valid) {- window.showToast('success', 'Token is valid ✓');- } else {- window.showToast('error', 'Token is invalid');- }- } catch (error) {- // Network or parsing error- console.error('Token validation failed:', error);- window.showToast('error', 'Network error - failed to validate token');- } finally {- setIsValidating(false);- }- };-- // Copy command to clipboard- const copyCommand = async () => {- // Warn if placeholder is still present- if (hasPlaceholder()) {- window.showToast(- 'warning',- `Please replace ${props.placeholder} with your API token before running the command`,- );- return;- }-- const command = finalCommand();- try {- if (navigator.clipboard && navigator.clipboard.writeText) {- await navigator.clipboard.writeText(command);- } else {- // Fallback- const textarea = document.createElement('textarea');- textarea.value = command;- textarea.style.position = 'fixed';- textarea.style.left = '-999999px';- document.body.appendChild(textarea);- textarea.select();- document.execCommand('copy');- document.body.removeChild(textarea);- }-- setCopied(true);- setTimeout(() => setCopied(false), 2000);- window.showToast('success', 'Command copied to clipboard');- } catch (error) {- console.error('Failed to copy:', error);- window.showToast('error', 'Failed to copy to clipboard');- }- };-- // Handle token input change- const handleTokenChange = (value: string) => {- setTokenInput(value);- setValidationResult(null); // Clear validation when token changes- if (props.onTokenChange) {- props.onTokenChange(value);- }- };-- // Generate new token- const generateNewToken = async () => {- if (!canManageTokens()) return;- if (isGenerating()) return;- setIsGenerating(true);-- try {- const desiredName = tokenLabel().trim() || undefined;- const { token: newToken, record } = await SecurityAPI.createToken(desiredName);-- setShowGenerateModal(false);- setLatestGeneratedToken(newToken);- setLatestGeneratedRecord(record);-- reopenLatestTokenDialog();- // Auto-populate the command builder- setTokenInput(newToken);- if (props.onTokenGenerated) {- props.onTokenGenerated(newToken, record);- }-- setStoredAPIToken(newToken);- setApiClientToken(newToken);-- window.showToast('success', 'New API token generated. Copy it from the dialog while it is visible.');- } catch (error) {- console.error('Token generation failed:', error);- window.showToast('error', error instanceof Error ? error.message : 'Failed to generate token');- } finally {- setIsGenerating(false);- }- };-- // Use existing token- const useExistingToken = () => {- if (props.storedToken) {- setTokenInput(props.storedToken);- window.showToast('success', 'Using stored token');- }- };-- // Copy existing token to clipboard- const copyExistingToken = async () => {- if (!props.storedToken) return;-- try {- if (navigator.clipboard && navigator.clipboard.writeText) {- await navigator.clipboard.writeText(props.storedToken);- } else {- const textarea = document.createElement('textarea');- textarea.value = props.storedToken;- textarea.style.position = 'fixed';- textarea.style.left = '-999999px';- document.body.appendChild(textarea);- textarea.select();- document.execCommand('copy');- document.body.removeChild(textarea);- }-- window.showToast('success', 'Token copied to clipboard');- } catch (error) {- console.error('Failed to copy token:', error);- window.showToast('error', 'Failed to copy token');- }- };-- // Visual styling based on state- const borderColor = createMemo(() => {- switch (commandState()) {- case 'warning':- return 'border-yellow-500 dark:border-yellow-600';- case 'success':- return 'border-green-500 dark:border-green-600';- default:- return 'border-gray-300 dark:border-gray-600';- }- });-- const bgColor = createMemo(() => {- switch (commandState()) {- case 'warning':- return 'bg-yellow-50 dark:bg-yellow-900/10';- case 'success':- return 'bg-green-50 dark:bg-green-900/10';- default:- return 'bg-gray-50 dark:bg-gray-900';- }- });-- const indicatorIcon = createMemo(() => {- switch (commandState()) {- case 'warning':- return (- <svg class="w-5 h-5 text-yellow-600 dark:text-yellow-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />- </svg>- );- case 'success':- return (- <svg class="w-5 h-5 text-green-600 dark:text-green-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />- </svg>- );- default:- return null;- }- });-- return (- <div class="space-y-3">- {/* Token Status Section */}- <Show when={props.requiresToken}>- <Show- when={props.hasExistingToken}- fallback={- /* No token exists - offer to generate */- <div class="bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-3">- <div class="flex items-start justify-between gap-3">- <div class="flex-1">- <div class="flex items-center gap-2 mb-1">- <svg class="w-5 h-5 text-yellow-600 dark:text-yellow-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />- </svg>- <span class="text-sm font-semibold text-yellow-800 dark:text-yellow-300">No API token configured</span>- </div>- <p class="text-xs text-yellow-700 dark:text-yellow-400">Generate a token to secure your Docker agents.</p>- </div>- <Show when={canManageTokens()}>- <button- type="button"- onClick={openGenerateModal}- disabled={isGenerating()}- class="px-3 py-1.5 text-xs font-medium text-white bg-blue-600 rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors whitespace-nowrap"- >- {isGenerating() ? 'Generating...' : 'Generate API Token'}- </button>- </Show>- </div>- <Show when={!canManageTokens()}>- <p class="mt-3 text-xs text-yellow-700 dark:text-yellow-400">- Sign in with an administrator account to create tokens from the browser.- </p>- </Show>- </div>- }- >- {/* Token exists - show status and actions */}- <div class="bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3">- <div class="flex items-start justify-between gap-3">- <div class="flex-1">- <div class="flex items-center gap-2 mb-1">- <svg class="w-5 h-5 text-green-600 dark:text-green-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />- </svg>- <span class="text-sm font-semibold text-green-800 dark:text-green-300">API token configured</span>- </div>- <Show when={props.currentTokenHint}>- <code class="text-xs font-mono text-green-700 dark:text-green-400 bg-green-100 dark:bg-green-900/40 px-2 py-0.5 rounded">- {props.currentTokenHint}- </code>- </Show>- </div>- <div class="flex gap-2">- <button- type="button"- onClick={useExistingToken}- disabled={!props.storedToken}- class="px-3 py-1.5 text-xs font-medium text-green-700 dark:text-green-300 bg-green-100 dark:bg-green-900/40 rounded hover:bg-green-200 dark:hover:bg-green-900/60 disabled:opacity-50 disabled:cursor-not-allowed transition-colors whitespace-nowrap"- title={props.storedToken ? "Fill the command with your existing token" : "Token not saved in browser - use the token input below instead"}- >- Use This Token- </button>- <button- type="button"- onClick={copyExistingToken}- disabled={!props.storedToken}- class="px-3 py-1.5 text-xs font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-800 rounded hover:bg-gray-200 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"- title={props.storedToken ? "Copy token to clipboard" : "Token not saved in browser - generate a new one if needed"}- >- Copy- </button>- <Show when={canManageTokens()}>- <button- type="button"- onClick={openGenerateModal}- disabled={isGenerating()}- class="px-3 py-1.5 text-xs font-medium text-blue-700 dark:text-blue-300 bg-blue-100 dark:bg-blue-900/40 rounded hover:bg-blue-200 dark:hover:bg-blue-900/60 disabled:opacity-50 disabled:cursor-not-allowed transition-colors whitespace-nowrap"- title="Generate another token for a new host or automation workflow"- >- Generate Token- </button>- </Show>- </div>- </div>- <p class="mt-2 text-xs text-gray-600 dark:text-gray-400">- Manage or revoke tokens from the table above whenever a credential is no longer needed.- </p>- </div>- </Show>- </Show>-- {/* Security explanation */}- <Show when={props.requiresToken}>- <div class="flex items-start gap-2 text-xs text-gray-600 dark:text-gray-400 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded p-2">- <svg class="w-4 h-4 text-blue-600 dark:text-blue-400 mt-0.5 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />- </svg>- <div>- <span class="font-medium text-blue-800 dark:text-blue-300">Security Note:</span>{' '}- <span class="text-blue-700 dark:text-blue-400">- Tokens are not auto-inserted to prevent accidental exposure. Paste your token below to build the command.- </span>- </div>- </div>- </Show>-- {/* Token input field */}- <Show when={props.requiresToken}>- <div class="space-y-2">- <label class="block text-sm font-medium text-gray-700 dark:text-gray-300">- API Token- <Show when={props.storedToken}>- <span class="ml-2 text-xs text-gray-500 dark:text-gray-400">- (prefilled from saved token)- </span>- </Show>- </label>- <div class="flex gap-2">- <div class="flex-1 relative">- <input- type={showToken() ? 'text' : 'password'}- value={tokenInput()}- onInput={(e) => handleTokenChange(e.currentTarget.value)}- placeholder="Paste your API token here"- class="w-full px-3 py-2 pr-10 text-sm font-mono border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-blue-500 focus:border-blue-500"- />- <button- type="button"- onClick={() => setShowToken(!showToken())}- class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300"- title={showToken() ? 'Hide token' : 'Show token'}- >- <Show- when={showToken()}- fallback={- <svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />- </svg>- }- >- <svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />- </svg>- </Show>- </button>- </div>- <button- type="button"- onClick={validateToken}- disabled={isValidating() || !tokenInput().trim()}- class="px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"- title="Test if this token is valid"- >- {isValidating() ? 'Testing...' : 'Test Token'}- </button>- </div>- {/* Validation result */}- <Show when={validationResult()}>- <div class={`text-xs ${validationResult() === 'valid' ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400'}`}>- {validationResult() === 'valid' ? '✓ Token is valid' : '✗ Token is invalid'}- </div>- </Show>- </div>- </Show>-- {/* Command preview */}- <div class="space-y-2">- <div class="flex items-center justify-between">- <div class="flex items-center gap-2">- <span class="text-sm font-medium text-gray-700 dark:text-gray-300">Command Preview</span>- {indicatorIcon()}- </div>- <button- type="button"- onClick={copyCommand}- disabled={hasPlaceholder()}- class={`px-3 py-1 text-xs font-medium rounded transition-colors ${- hasPlaceholder()- ? 'bg-gray-300 dark:bg-gray-700 text-gray-500 dark:text-gray-400 cursor-not-allowed'- : 'bg-blue-600 text-white hover:bg-blue-700'- }`}- title={hasPlaceholder() ? `Replace ${props.placeholder} with your token first` : 'Copy to clipboard'}- >- {copied() ? 'Copied!' : 'Copy'}- </button>- </div>- <div class={`relative rounded border-2 ${borderColor()} ${bgColor()} p-3 overflow-x-auto transition-colors`}>- <code class="text-sm text-gray-900 dark:text-gray-100 font-mono break-all">- {finalCommand()}- </code>- </div>- </div>-- {/* Status message */}- <Show when={hasPlaceholder()}>- <div class="text-xs text-yellow-700 dark:text-yellow-400 flex items-center gap-2">- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />- </svg>- <span>Paste your API token above to enable the copy button</span>- </div>- </Show>- <Show when={!hasPlaceholder() && commandState() === 'success'}>- <div class="text-xs text-green-700 dark:text-green-400 flex items-center gap-2">- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />- </svg>- <span>Ready to copy! Your command is complete.</span>- </div>- </Show>-- {/* Generate Token Confirmation Modal */}- <Show when={showGenerateModal()}>- <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4">- <div class="bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full p-6">- <h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-3">Generate API Token</h3>- <div class="space-y-3 mb-6">- <p class="text-sm text-gray-600 dark:text-gray-400">- Create a dedicated token for this host or automation workflow. Tokens remain active until you revoke them from the API tokens list.- </p>- <div class="space-y-2">- <label class="text-xs font-medium text-gray-600 dark:text-gray-400" for="command-builder-token-name">- Token name (optional)- </label>- <input- id="command-builder-token-name"- type="text"- value={tokenLabel()}- onInput={(event) => setTokenLabel(event.currentTarget.value)}- class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500"- placeholder={defaultTokenLabel()}- />- </div>- <div class="bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded p-3">- <p class="text-xs text-blue-800 dark:text-blue-300 font-medium">- Tip: Issue one token per host so you can revoke compromised credentials without affecting other agents.- </p>- </div>- </div>- <div class="flex gap-3 justify-end">- <button- type="button"- onClick={() => setShowGenerateModal(false)}- class="px-4 py-2 text-sm text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors"- >- Cancel- </button>- <button- type="button"- onClick={generateNewToken}- disabled={isGenerating()}- class="px-4 py-2 text-sm text-white bg-blue-600 rounded hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"- >- {isGenerating() ? 'Generating…' : 'Generate Token'}- </button>- </div>- </div>- </div>- </Show>-- {/* New Token Display Modal */}- <Show- when={latestGeneratedToken() && !isRevealActiveForLatestToken()}- >- <div class="mt-4 space-y-3 rounded-lg border border-blue-200 dark:border-blue-700 bg-blue-50 dark:bg-blue-900/20 p-4">- <div class="flex items-start gap-2">- <div class="flex-shrink-0 text-blue-600 dark:text-blue-300">- <svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />- </svg>- </div>- <div class="space-y-1">- <p class="text-sm font-semibold text-blue-800 dark:text-blue-200">- New token ready- </p>- <p class="text-xs text-blue-700 dark:text-blue-300 leading-snug">- Reopen the secure dialog if you still need to copy the value before you leave this page. The command above already includes it.- </p>- <Show when={latestGeneratedRecord()}>- <div class="text-xs text-blue-700/80 dark:text-blue-300/90">- Label{' '}- <span class="font-semibold">- {latestGeneratedRecord()?.name || 'Untitled token'}- </span>- <Show when={latestGeneratedRecord()?.prefix || latestGeneratedRecord()?.suffix}>- {' '}· Hint{' '}- <code class="rounded bg-blue-100 dark:bg-blue-900/40 px-1.5 py-0.5 font-mono text-[11px] text-blue-700 dark:text-blue-200">- {latestGeneratedRecord()?.prefix}…{latestGeneratedRecord()?.suffix}- </code>- </Show>- </div>- </Show>- </div>- </div>- <div class="flex flex-wrap gap-2">- <button- type="button"- onClick={reopenLatestTokenDialog}- class="inline-flex items-center gap-1 rounded-md bg-blue-600 hover:bg-blue-700 text-white text-xs font-semibold px-3 py-2 transition-colors"- >- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />- </svg>- Show token dialog- </button>- <button- type="button"- onClick={() => {- setLatestGeneratedToken(null);- setLatestGeneratedRecord(null);- }}- class="inline-flex items-center rounded-md border border-blue-300 dark:border-blue-700 px-3 py-2 text-xs font-medium text-blue-800 dark:text-blue-200 hover:bg-blue-100 dark:hover:bg-blue-900/40 transition-colors"- >- Dismiss reminder- </button>- </div>- </div>- </Show>- </div>- );-};diff --git a/frontend-modern/src/components/Settings/DiscoveryModal.tsx b/frontend-modern/src/components/Settings/DiscoveryModal.tsxdeleted file mode 100644index aa5ca702f8..0000000000--- a/frontend-modern/src/components/Settings/DiscoveryModal.tsx+++ /dev/null@@ -1,518 +0,0 @@-import { Component, Show, createSignal, For, createEffect, on } from 'solid-js';-import { Portal } from 'solid-js/web';-import { showSuccess, showError } from '@/utils/toast';-import { SectionHeader } from '@/components/shared/SectionHeader';-import Loader from 'lucide-solid/icons/loader';--interface DiscoveredServer {- ip: string;- port: number;- type: 'pve' | 'pbs' | 'pmg';- version: string;- hostname?: string;- release?: string;-}--interface DiscoveryResult {- servers: DiscoveredServer[];- errors?: string[];-}--interface DiscoveryModalProps {- isOpen: boolean;- onClose: () => void;- onAddServers: (servers: DiscoveredServer[]) => void;-}--export const DiscoveryModal: Component<DiscoveryModalProps> = (props) => {- const [isScanning, setIsScanning] = createSignal(false);- const [subnet, setSubnet] = createSignal('auto');- const [discoveryResult, setDiscoveryResult] = createSignal<DiscoveryResult | null>(null);- const [hasScanned, setHasScanned] = createSignal(false);-- // Load cached results when modal opens and reset when it closes- createEffect(on(- () => props.isOpen,- (isOpen) => {- if (isOpen && !hasScanned()) {- setHasScanned(true);- loadCachedResults();- } else if (!isOpen) {- setHasScanned(false);- // Keep cached results, don't clear them- }- }- ));-- // Listen for real-time WebSocket updates when modal is open and scanning- createEffect(on(- () => props.isOpen,- (isOpen) => {- if (!isOpen) return;-- const handleWsMessage = (event: MessageEvent) => {- try {- const message = JSON.parse(event.data);-- // Handle discovery server found (real-time updates)- if (message.type === 'discovery_server_found' && message.data?.server) {- const server: DiscoveredServer = message.data.server;-- // Add server to results immediately- setDiscoveryResult((prev) => {- if (!prev) {- return { servers: [server], errors: [] };- }-- // Check if server already exists (by IP and port)- const exists = prev.servers.some(- (s) => s.ip === server.ip && s.port === server.port- );-- if (!exists) {- return {- ...prev,- servers: [...prev.servers, server],- };- }- return prev;- });- }-- // Handle discovery started- if (message.type === 'discovery_started') {- setIsScanning(true);- }-- // Handle discovery complete- if (message.type === 'discovery_complete') {- setIsScanning(false);- }- } catch (error) {- console.error('Error parsing WebSocket message:', error);- }- };-- // Get WebSocket from global state- const ws = (window as any).__pulseWs;- if (ws && ws.readyState === WebSocket.OPEN) {- ws.addEventListener('message', handleWsMessage);-- return () => {- ws.removeEventListener('message', handleWsMessage);- };- }- }- ));-- const loadCachedResults = async () => {- try {- const { apiFetch } = await import('@/utils/apiClient');- // Fetch cached results with GET request- const response = await apiFetch('/api/discover', {- method: 'GET',- headers: {- 'Content-Type': 'application/json',- },- });-- if (response.ok) {- const data = await response.json();-- // If we have cached results, show them immediately- if (data.servers && data.servers.length > 0) {- setDiscoveryResult({- servers: data.servers,- errors: data.errors || [],- });- } else {- // No cached results, start a background scan- handleScan();- }- } else {- // Fallback to scanning- handleScan();- }- } catch (error) {- console.error('Failed to load cached discovery results:', error);- // Fallback to scanning- handleScan();- }- };-- const handleRefresh = async () => {- // First try to get cached results immediately- try {- const { apiFetch } = await import('@/utils/apiClient');- const response = await apiFetch('/api/discover', {- method: 'GET',- headers: {- 'Content-Type': 'application/json',- },- });-- if (response.ok) {- const data = await response.json();-- // If we have cached results, show them immediately- if (data.servers && data.servers.length > 0) {- setDiscoveryResult({- servers: data.servers,- errors: data.errors || [],- });- showSuccess(`Showing ${data.servers.length} cached server(s)`);- return; // Don't start a new scan- }- }- } catch (error) {- console.error('Failed to load cached results:', error);- }-- // If no cached results or error, start a new scan- handleScan();- };-- const handleScan = async () => {- setIsScanning(true);- setDiscoveryResult(null);-- // Set a timeout for the scan (30 seconds)- const controller = new AbortController();- const timeoutId = setTimeout(() => {- controller.abort();- }, 30000);-- try {- const { apiFetch } = await import('@/utils/apiClient');- const response = await apiFetch('/api/discover', {- method: 'POST',- headers: {- 'Content-Type': 'application/json',- },- body: JSON.stringify({ subnet: subnet() }),- signal: controller.signal,- });-- clearTimeout(timeoutId);-- if (!response.ok) {- throw new Error(await response.text());- }-- const result: DiscoveryResult = await response.json();- setDiscoveryResult(result);-- if (result.servers.length === 0) {- showError('No Proxmox servers found on the network');- } else {- showSuccess(`Found ${result.servers.length} server(s)`);- }- } catch (error) {- clearTimeout(timeoutId);-- if (error instanceof Error && error.name === 'AbortError') {- showError('Scan timeout - try a smaller subnet range');- } else {- showError(`Discovery failed: ${error instanceof Error ? error.message : 'Unknown error'}`);- }- } finally {- setIsScanning(false);- }- };-- const handleAddServer = (server: DiscoveredServer) => {- props.onAddServers([server]);- };-- const getServerIcon = (type: string) => {- if (type === 'pve') {- return (- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect>- <rect x="9" y="9" width="6" height="6"></rect>- <line x1="9" y1="1" x2="9" y2="4"></line>- <line x1="15" y1="1" x2="15" y2="4"></line>- <line x1="9" y1="20" x2="9" y2="23"></line>- <line x1="15" y1="20" x2="15" y2="23"></line>- <line x1="20" y1="9" x2="23" y2="9"></line>- <line x1="20" y1="14" x2="23" y2="14"></line>- <line x1="1" y1="9" x2="4" y2="9"></line>- <line x1="1" y1="14" x2="4" y2="14"></line>- </svg>- );- }- if (type === 'pmg') {- return (- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path>- <polyline points="22,6 12,13 2,6"></polyline>- </svg>- );- }- return (- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 01-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 011-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 011.52 0C14.51 3.81 17 5 19 5a1 1 0 011 1v7z"></path>- <path d="M9 12l2 2 4-4"></path>- </svg>- );- };-- return (- <Portal>- <Show when={props.isOpen}>- <div class="fixed inset-0 z-50 overflow-y-auto">- <div class="flex min-h-screen items-center justify-center p-4">- {/* Backdrop */}- <div class="fixed inset-0 bg-black/50 transition-opacity" onClick={props.onClose} />-- {/* Modal */}- <div class="relative w-full max-w-3xl bg-white dark:bg-gray-800 rounded-lg shadow-xl">- {/* Header */}- <div class="flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700">- <SectionHeader title="Network discovery" size="md" class="flex-1" />- <button- type="button"- onClick={props.onClose}- class="text-gray-400 hover:text-gray-500 dark:hover:text-gray-300"- >- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <line x1="18" y1="6" x2="6" y2="18"></line>- <line x1="6" y1="6" x2="18" y2="18"></line>- </svg>- </button>- </div>-- {/* Body */}- <div class="p-6">- {/* Quick Actions Bar */}- <div class="flex justify-between items-center mb-6">- <div class="flex items-center gap-3">- <h4 class="text-sm font-medium text-gray-700 dark:text-gray-300">- <Show when={isScanning()} fallback="Network Servers">- Scanning Network...- </Show>- </h4>- <Show when={discoveryResult() && !isScanning()}>- <span class="text-xs bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-2 py-1 rounded-full">- {discoveryResult()!.servers.length} found- </span>- </Show>- </div>-- <div class="flex items-center gap-2">- {/* Subnet selector */}- <select- value={subnet()}- onChange={(e) => {- setSubnet(e.currentTarget.value);- setHasScanned(false);- handleScan();- }}- class="px-3 py-1.5 text-xs border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 focus:ring-2 focus:ring-blue-500 focus:border-blue-500"- disabled={isScanning()}- >- <option value="auto">Auto-detect</option>- <option value="192.168.1.0/24">192.168.1.x</option>- <option value="192.168.0.0/24">192.168.0.x</option>- <option value="10.0.0.0/24">10.0.0.x</option>- <option value="172.16.0.0/24">172.16.0.x</option>- </select>-- {/* Refresh button */}- <button- type="button"- onClick={handleRefresh}- disabled={isScanning()}- title="Refresh scan"- class="p-1.5 text-sm border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"- >- <Show- when={isScanning()}- fallback={- <svg- width="16"- height="16"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <polyline points="23 4 23 10 17 10"></polyline>- <polyline points="1 20 1 14 7 14"></polyline>- <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path>- </svg>- }- >- <Loader class="animate-spin h-4 w-4" />- </Show>- </button>- </div>- </div>-- {/* Show loading message when scanning with no results yet */}- <Show when={isScanning() && !discoveryResult()}>- <div class="text-center py-8 text-gray-500 dark:text-gray-400">- <Loader class="animate-spin h-12 w-12 mx-auto mb-4 text-blue-500" />- <p>Scanning network...</p>- <p class="text-xs mt-2">Servers will appear here as they're discovered</p>- </div>- </Show>-- {/* Discovery Results - show even while scanning */}- <Show when={discoveryResult()}>- <div class="space-y-4">- {/* Server Cards */}- <Show- when={discoveryResult()!.servers.length > 0}- fallback={- <div class="text-center py-8 text-gray-500 dark:text-gray-400">- <svg- width="48"- height="48"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="1.5"- class="mx-auto mb-3 opacity-50"- >- <circle cx="11" cy="11" r="8"></circle>- <path d="m21 21-4.35-4.35"></path>- <path d="M11 8v3m0 4h.01"></path>- </svg>- <p>No Proxmox servers found on this network</p>- <p class="text-xs mt-2">- Try a different subnet or check if servers are online- </p>- </div>- }- >- <div class="grid grid-cols-1 md:grid-cols-2 gap-3">- <For each={discoveryResult()!.servers}>- {(server) => (- <div- class="border border-gray-200 dark:border-gray-700 rounded-lg p-4 cursor-pointer transition-all hover:shadow-md hover:border-blue-300 dark:hover:border-blue-600 hover:bg-gray-50 dark:hover:bg-gray-700/30 group"- onClick={() => handleAddServer(server)}- >- <div class="flex items-start justify-between">- <div class="flex items-start gap-3">- {/* Server Icon */}- <div- class={`mt-0.5 ${- server.type === 'pve'- ? 'text-orange-500'- : server.type === 'pmg'- ? 'text-purple-500'- : 'text-green-500'- }`}- >- {getServerIcon(server.type)}- </div>-- {/* Server Details */}- <div class="flex-1">- <div class="font-medium text-gray-900 dark:text-gray-100">- {server.hostname || server.ip}- </div>- <div class="text-sm text-gray-500 dark:text-gray-400 mt-1">- {server.ip}:{server.port}- </div>- <div class="flex items-center gap-2 mt-2">- <span class="text-xs px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400">- {server.type === 'pve'- ? 'Proxmox VE'- : server.type === 'pmg'- ? 'PMG'- : 'PBS'}- </span>- <Show when={server.version !== 'Unknown'}>- <span class="text-xs text-gray-500 dark:text-gray-400">- v{server.version}- </span>- </Show>- </div>- </div>- </div>-- {/* Add Arrow */}- <div class="text-gray-400 group-hover:text-blue-500 transition-colors">- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <line x1="12" y1="5" x2="12" y2="19"></line>- <line x1="5" y1="12" x2="19" y2="12"></line>- </svg>- </div>- </div>- </div>- )}- </For>- </div>- </Show>-- {/* Errors */}- <Show when={discoveryResult()!.errors && discoveryResult()!.errors!.length > 0}>- <div class="mt-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">- <h5 class="text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-2">- Discovery Warnings- </h5>- <ul class="text-xs text-yellow-700 dark:text-yellow-300 space-y-1">- <For each={discoveryResult()!.errors}>- {(error) => <li>• {error}</li>}- </For>- </ul>- </div>- </Show>- </div>- </Show>- </div>-- {/* Footer */}- <div class="flex items-center justify-center px-6 py-4 border-t border-gray-200 dark:border-gray-700">- <button- type="button"- onClick={props.onClose}- class="px-4 py-2 text-sm border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"- >- Close- </button>- </div>- </div>- </div>- </div>- </Show>- </Portal>- );-};diff --git a/frontend-modern/src/components/Settings/DockerAgents.tsx b/frontend-modern/src/components/Settings/DockerAgents.tsxindex 95cde0c03a..fb1b06e641 100644--- a/frontend-modern/src/components/Settings/DockerAgents.tsx+++ b/frontend-modern/src/components/Settings/DockerAgents.tsx@@ -9,6 +9,11 @@ import type { SecurityStatus } from '@/types/config';import type { DockerHost } from '@/types/api';import type { APITokenRecord } from '@/api/security';import { DOCKER_REPORT_SCOPE } from '@/constants/apiScopes';+import { resolveHostRuntime } from '@/components/Docker/runtimeDisplay';+import { copyToClipboard } from '@/utils/clipboard';+import { getPulseBaseUrl } from '@/utils/url';+import { logger } from '@/utils/logger';+export const DockerAgents: Component = () => {const { state } = useWebSocket();@@ -66,15 +71,7 @@ export const DockerAgents: Component = () => {const [commandQueuedTime, setCommandQueuedTime] = createSignal<Date | null>(null);const [elapsedSeconds, setElapsedSeconds] = createSignal(0);- const pulseUrl = () => {- if (typeof window !== 'undefined') {- const protocol = window.location.protocol;- const hostname = window.location.hostname;- const port = window.location.port;- return `${protocol}//${hostname}${port ? `:${port}` : ''}`;- }- return 'http://localhost:7655';- };+ const pulseUrl = () => getPulseBaseUrl();const TOKEN_PLACEHOLDER = '<api-token>';@@ -88,6 +85,12 @@ export const DockerAgents: Component = () => {return host.displayName || host.hostname || host.id;};+ const describeRuntime = (host: DockerHost) => {+ const runtimeInfo = resolveHostRuntime(host);+ const version = host.runtimeVersion || host.dockerVersion || '';+ return version ? `${runtimeInfo.label} ${version}` : runtimeInfo.label;+ };+const modalDisplayName = () => {const host = hostToRemove();return host ? getDisplayName(host) : '';@@ -149,7 +152,7 @@ const modalCommandTimedOut = createMemo(() => {const modalLastHeartbeat = createMemo(() => {const host = hostToRemove();- return host?.lastReportTime ? formatRelativeTime(new Date(host.lastReportTime)) : null;+ return host?.lastSeen ? formatRelativeTime(host.lastSeen) : null;});const modalHostPendingUninstall = createMemo(() => Boolean(hostToRemove()?.pendingUninstall));@@ -295,7 +298,7 @@ const getRemovalStatusInfo = (host: DockerHost): { label: string; tone: RemovalS} catch (err) {if (!hasLoggedSecurityStatusError) {hasLoggedSecurityStatusError = true;- console.error('Failed to load security status', err);+ logger.error('Failed to load security status', err);}}};@@ -304,43 +307,11 @@ const getRemovalStatusInfo = (host: DockerHost): { label: string; tone: RemovalSconst showInstallCommand = () => !requiresToken() || Boolean(currentToken());- // Find the token record that matches the currently stored token- const copyToClipboard = async (text: string): Promise<boolean> => {- try {- if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {- await navigator.clipboard.writeText(text);- return true;- }-- if (typeof document === 'undefined') {- return false;- }-- const textarea = document.createElement('textarea');- textarea.value = text;- textarea.style.position = 'fixed';- textarea.style.left = '-999999px';- textarea.style.top = '-999999px';- document.body.appendChild(textarea);- textarea.focus();- textarea.select();-- try {- return document.execCommand('copy');- } finally {- document.body.removeChild(textarea);- }- } catch (err) {- console.error('Failed to copy to clipboard', err);- return false;- }- };-const handleGenerateToken = async () => {if (isGeneratingToken()) return;setIsGeneratingToken(true);try {- const name = tokenName().trim() || `Docker host ${new Date().toISOString().slice(0, 10)}`;+ const name = tokenName().trim() || `Container host ${new Date().toISOString().slice(0, 10)}`;const { token, record } = await SecurityAPI.createToken(name, [DOCKER_REPORT_SCOPE]);setCurrentToken(token);@@ -348,8 +319,9 @@ const getRemovalStatusInfo = (host: DockerHost): { label: string; tone: RemovalSsetTokenName('');notificationStore.success('Token generated and inserted into the command below.', 4000);} catch (err) {- console.error('Failed to generate API token', err);- notificationStore.error('Failed to generate API token. Confirm you are signed in as an administrator.', 6000);+ logger.error('Failed to generate API token', err);+ const errorMsg = err instanceof Error ? err.message : 'Unknown error';+ notificationStore.error(`Failed to generate API token: ${errorMsg}`, 8000);} finally {setIsGeneratingToken(false);}@@ -366,15 +338,14 @@ const getRemovalStatusInfo = (host: DockerHost): { label: string; tone: RemovalS// Always return command template with placeholder; the UI replaces it with the selected token.const getInstallCommandTemplate = () => {const url = pulseUrl();- if (!requiresToken()) {- return `curl -fsSL ${url}/install-docker-agent.sh | bash -s -- --url ${url} --token disabled`;- }- return `curl -fsSL ${url}/install-docker-agent.sh | bash -s -- --url ${url} --token ${TOKEN_PLACEHOLDER}`;+ const tokenValue = requiresToken() ? TOKEN_PLACEHOLDER : 'disabled';+ const tokenSegment = `--token '${tokenValue}'`;+ return `curl -fSL '${url}/install-docker-agent.sh' -o /tmp/pulse-install-docker-agent.sh && sudo bash /tmp/pulse-install-docker-agent.sh --url '${url}' ${tokenSegment} && rm -f /tmp/pulse-install-docker-agent.sh`;};const getUninstallCommand = () => {const url = pulseUrl();- return `curl -fsSL ${url}/install-docker-agent.sh | bash -s -- --uninstall`;+ return `curl -fSL '${url}/install-docker-agent.sh' -o /tmp/pulse-install-docker-agent.sh && sudo bash /tmp/pulse-install-docker-agent.sh --uninstall && rm -f /tmp/pulse-install-docker-agent.sh`;};const getSystemdService = () => {@@ -405,8 +376,11 @@ WantedBy=multi-user.target`;await MonitoringAPI.allowDockerHostReenroll(hostId);notificationStore.success(`Allowed ${label} to report again`, 4000);} catch (error) {- console.error('Failed to allow Docker host re-enroll', error);- const message = error instanceof Error ? error.message : 'Failed to clear the removal block. Confirm your account has docker:manage access.';+ logger.error('Failed to allow host re-enroll', error);+ const message =+ error instanceof Error+ ? error.message+ : 'Failed to clear the removal block. Confirm your account has docker:manage access.';notificationStore.error(message, 8000);}};@@ -454,7 +428,7 @@ WantedBy=multi-user.target`;notificationStore.success(`Stop command sent to ${displayName}`, 3500);setRemoveActionLoading('awaitingCommand');} catch (error) {- console.error('Failed to queue Docker host stop command', error);+ logger.error('Failed to queue host stop command', error);const message = error instanceof Error ? error.message : 'Failed to send stop command';notificationStore.error(message, 8000);setRemoveActionLoading(null);@@ -473,11 +447,11 @@ WantedBy=multi-user.target`;try {await MonitoringAPI.deleteDockerHost(host.id, { hide: true });- notificationStore.success(`Hidden Docker host ${displayName}`, 3500);+ notificationStore.success(`Hidden host ${displayName}`, 3500);closeRemoveModal();} catch (error) {- console.error('Failed to hide Docker host', error);- const message = error instanceof Error ? error.message : 'Failed to hide Docker host';+ logger.error('Failed to hide host', error);+ const message = error instanceof Error ? error.message : 'Failed to hide host';notificationStore.error(message, 8000);} finally {setRemovingHostId(null);@@ -495,11 +469,11 @@ WantedBy=multi-user.target`;try {await MonitoringAPI.deleteDockerHost(host.id, { force: true });- notificationStore.success(`Removed Docker host ${displayName}`, 3500);+ notificationStore.success(`Removed host ${displayName}`, 3500);closeRemoveModal();} catch (error) {- console.error('Failed to remove Docker host', error);- const message = error instanceof Error ? error.message : 'Failed to remove Docker host';+ logger.error('Failed to remove host', error);+ const message = error instanceof Error ? error.message : 'Failed to remove host';notificationStore.error(message, 8000);} finally {setRemovingHostId(null);@@ -514,13 +488,13 @@ WantedBy=multi-user.target`;try {await MonitoringAPI.deleteDockerHost(hostId, { force: true });- notificationStore.success(`Removed Docker host ${displayName}`, 3500);+ notificationStore.success(`Removed host ${displayName}`, 3500);if (hostToRemoveId() === hostId) {closeRemoveModal();}} catch (error) {- console.error('Failed to remove Docker host', error);- const message = error instanceof Error ? error.message : 'Failed to remove Docker host';+ logger.error('Failed to remove host', error);+ const message = error instanceof Error ? error.message : 'Failed to remove host';notificationStore.error(message, 8000);} finally {setRemovingHostId(null);@@ -534,10 +508,10 @@ WantedBy=multi-user.target`;try {await MonitoringAPI.unhideDockerHost(hostId);- notificationStore.success(`Unhidden Docker host ${displayName}`, 3500);+ notificationStore.success(`Unhidden host ${displayName}`, 3500);} catch (error) {- console.error('Failed to unhide Docker host', error);- const message = error instanceof Error ? error.message : 'Failed to unhide Docker host';+ logger.error('Failed to unhide host', error);+ const message = error instanceof Error ? error.message : 'Failed to unhide host';notificationStore.error(message, 8000);} finally {setRemovingHostId(null);@@ -552,7 +526,7 @@ WantedBy=multi-user.target`;class="space-y-4 border border-amber-300 bg-amber-50 text-amber-900 shadow-sm dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100"><div class="space-y-1">- <h3 class="text-sm font-semibold">Recently removed Docker hosts</h3>+ <h3 class="text-sm font-semibold">Recently removed container hosts</h3><p class="text-sm text-amber-800 dark:text-amber-200">Pulse is currently blocking these hosts because they were explicitly removed. Allow them to re-enroll orcopy the command below and run it with a token that includes the <code>docker:manage</code> scope.@@ -603,10 +577,10 @@ WantedBy=multi-user.target`;</Show><Card padding="lg" class="space-y-5">- <div class="space-y-1">- <h3 class="text-base font-semibold text-gray-900 dark:text-gray-100">Add a Docker host</h3>+ <div class="space-y-2">+ <h3 class="text-base font-semibold text-gray-900 dark:text-gray-100">Enroll a container runtime</h3><p class="text-sm text-gray-600 dark:text-gray-400">- Run this command as root on your Docker host to start monitoring.+ Run the command below on any host running Docker or Podman. The installer will automatically detect your container runtime.</p></div>@@ -678,7 +652,7 @@ WantedBy=multi-user.target`;<code>{getInstallCommandTemplate().replace(TOKEN_PLACEHOLDER, currentToken() || TOKEN_PLACEHOLDER)}</code></pre><p class="text-xs text-gray-500 dark:text-gray-400">- Run as root on your Docker host. The installer downloads the agent, creates a systemd service, and starts reporting automatically.+ The installer downloads the agent, detects your container runtime, configures a systemd service, and starts reporting automatically.</p></div></Show>@@ -773,13 +747,13 @@ WantedBy=multi-user.target`;</details></Card>- {/* Remove Docker Host Modal */}+ {/* Remove Container Host Modal */}<Show when={showRemoveModal()}><div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4"><div class="w-full max-w-2xl rounded-lg bg-white p-6 shadow-xl dark:bg-gray-800"><div class="space-y-2"><h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">- Remove Docker host "{modalDisplayName()}"+ Remove container host "{modalDisplayName()}"</h3><p class="text-sm text-gray-600 dark:text-gray-400">Pulse guides you through uninstalling the agent and safely cleaning up the host entry.@@ -1161,7 +1135,7 @@ WantedBy=multi-user.target`;</div></Show>- {/* Active Docker Hosts */}+ {/* Active container hosts */}<Card><div class="space-y-4">{/* Pending hosts banner */}@@ -1248,21 +1222,21 @@ WantedBy=multi-user.target`;<div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between"><div><h3 class="text-base font-semibold text-gray-900 dark:text-gray-100">- Reporting Docker hosts ({dockerHosts().length})+ Reporting container hosts ({dockerHosts().length})</h3><p class="mt-1 text-xs text-gray-500 dark:text-gray-400">- Use this list to enroll or retire agents. For live health and troubleshooting, open the Docker monitoring view.+ Use this list to enroll or retire agents. For live health and troubleshooting, open the container monitoring view.</p></div><div class="flex flex-wrap items-center justify-end gap-2"><a- href="/docker"+ href="/containers"class="inline-flex items-center gap-2 rounded-lg border border-blue-200 bg-blue-50 px-3 py-1.5 text-xs font-semibold text-blue-700 transition-colors hover:bg-blue-100 dark:border-blue-600/60 dark:bg-blue-900/30 dark:text-blue-200 dark:hover:bg-blue-900/50"><svg class="h-3.5 w-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" /></svg>- Open Docker monitoring+ Open container monitoring</a><Show when={hiddenCount() > 0}><button@@ -1291,7 +1265,7 @@ WantedBy=multi-user.target`;</svg></div><p class="text-sm text-gray-600 dark:text-gray-400">- No Docker agents are currently reporting.+ No container agents are currently reporting.</p><p class="text-xs text-gray-500 dark:text-gray-500 mt-1">Click "Show deployment instructions" above to get started.@@ -1305,7 +1279,7 @@ WantedBy=multi-user.target`;<tr class="border-b border-gray-200 dark:border-gray-700"><th class="text-left py-3 px-4 font-medium text-gray-600 dark:text-gray-400">Host</th><th class="text-left py-3 px-4 font-medium text-gray-600 dark:text-gray-400">Status</th>- <th class="text-left py-3 px-4 font-medium text-gray-600 dark:text-gray-400">Agent & Docker</th>+ <th class="text-left py-3 px-4 font-medium text-gray-600 dark:text-gray-400">Agent & runtime</th><th class="text-left py-3 px-4 font-medium text-gray-600 dark:text-gray-400">Last Seen</th><th class="text-right py-3 px-4 font-medium text-gray-600 dark:text-gray-400">Actions</th></tr>@@ -1317,6 +1291,7 @@ WantedBy=multi-user.target`;const displayName = getDisplayName(host);const commandStatus = host.command?.status ?? null;const removalStatusInfo = getRemovalStatusInfo(host);+ const runtimeInfo = resolveHostRuntime(host);const commandInProgress =commandStatus === 'queued' ||commandStatus === 'dispatched' ||@@ -1339,6 +1314,14 @@ WantedBy=multi-user.target`;<td class="py-3 px-4 align-top"><div class="font-medium text-gray-900 dark:text-gray-100">{displayName}</div><div class="text-xs text-gray-500 dark:text-gray-400">{host.hostname}</div>+ <div class="mt-1 text-[10px] uppercase tracking-wide">+ <span+ class={`inline-flex items-center rounded-full px-2 py-0.5 font-semibold ${runtimeInfo.badgeClass}`}+ title={runtimeInfo.raw || runtimeInfo.label}+ >+ {runtimeInfo.label}+ </span>+ </div><Show when={host.os || host.architecture}><div class="mt-1 text-xs text-gray-400 dark:text-gray-500">{host.os}@@ -1396,16 +1379,19 @@ WantedBy=multi-user.target`;</Show></div><Show when={removalStatusInfo}>- {(info) => (- <div class={`mt-2 text-xs ${removalTextClassMap[info.tone]}`}>- {info.label}- </div>- )}+ {(info) => {+ const details = info();+ return (+ <div class={`mt-2 text-xs ${removalTextClassMap[details.tone]}`}>+ {details.label}+ </div>+ );+ }}</Show></td><td class="py-3 px-4 align-top"><div class="text-sm font-medium text-gray-900 dark:text-gray-100">- {host.dockerVersion ? `Docker ${host.dockerVersion}` : 'Docker version unavailable'}+ {describeRuntime(host)}</div><div class="text-xs text-gray-500 dark:text-gray-400">Agent {host.agentVersion ? `v${host.agentVersion}` : 'not reporting'}diff --git a/frontend-modern/src/components/Settings/HostAgents.tsx b/frontend-modern/src/components/Settings/HostAgents.tsxindex 4d8e3e724a..dd33f2693a 100644--- a/frontend-modern/src/components/Settings/HostAgents.tsx+++ b/frontend-modern/src/components/Settings/HostAgents.tsx@@ -4,19 +4,18 @@ import { useWebSocket } from '@/App';import type { Host, HostLookupResponse } from '@/types/api';import { Card } from '@/components/shared/Card';import { formatBytes, formatRelativeTime, formatUptime, formatAbsoluteTime } from '@/utils/format';+import { copyToClipboard } from '@/utils/clipboard';+import { getPulseBaseUrl } from '@/utils/url';import { notificationStore } from '@/stores/notifications';import { HOST_AGENT_SCOPE } from '@/constants/apiScopes';import type { SecurityStatus } from '@/types/config';import type { APITokenRecord } from '@/api/security';import { SecurityAPI } from '@/api/security';import { MonitoringAPI } from '@/api/monitoring';+import { logger } from '@/utils/logger';const TOKEN_PLACEHOLDER = '<api-token>';-const pulseUrl = () => {- if (typeof window === 'undefined') return 'http://localhost:7655';- const { protocol, hostname, port } = window.location;- return `${protocol}//${hostname}${port ? `:${port}` : ''}`;-};+const pulseUrl = () => getPulseBaseUrl();const buildDefaultTokenName = () => {const now = new Date();@@ -283,7 +282,7 @@ export const HostAgents: Component = () => {notificationStore.success(`Host "${displayName}" removed`, 4000);closeRemoveModal();} catch (error) {- console.error('Failed to remove host agent', error);+ logger.error('Failed to remove host agent', error);const message = error instanceof Error ? error.message : 'Failed to remove host. Please try again.';notificationStore.error(message, 6000);} finally {@@ -402,7 +401,7 @@ export const HostAgents: Component = () => {} catch (err) {if (!hasLoggedSecurityStatusError) {hasLoggedSecurityStatusError = true;- console.error('Failed to load security status', err);+ logger.error('Failed to load security status', err);}}};@@ -453,41 +452,13 @@ export const HostAgents: Component = () => {setConfirmedNoToken(false);notificationStore.success('Token generated and inserted into the command below.', 4000);} catch (err) {- console.error('Failed to generate host agent token', err);+ logger.error('Failed to generate host agent token', err);notificationStore.error('Failed to generate host agent token. Confirm you are signed in as an administrator.', 6000);} finally {setIsGeneratingToken(false);}};- const copyToClipboard = async (text: string): Promise<boolean> => {- try {- if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {- await navigator.clipboard.writeText(text);- return true;- }- if (typeof document === 'undefined') {- return false;- }- const textarea = document.createElement('textarea');- textarea.value = text;- textarea.style.position = 'fixed';- textarea.style.left = '-999999px';- textarea.style.top = '-999999px';- document.body.appendChild(textarea);- textarea.focus();- textarea.select();- try {- return document.execCommand('copy');- } finally {- document.body.removeChild(textarea);- }- } catch (err) {- console.error('Failed to copy to clipboard', err);- return false;- }- };-const resolvedToken = () => {if (requiresToken()) {return currentToken() || TOKEN_PLACEHOLDER;diff --git a/frontend-modern/src/components/Settings/HostsSectionNav.tsx b/frontend-modern/src/components/Settings/HostsSectionNav.tsxdeleted file mode 100644index d14bceb20a..0000000000--- a/frontend-modern/src/components/Settings/HostsSectionNav.tsx+++ /dev/null@@ -1,77 +0,0 @@-import type { Component } from 'solid-js';-import { For } from 'solid-js';-import SquareTerminal from 'lucide-solid/icons/square-terminal';--type HostsSection = 'linux' | 'macos' | 'windows';--interface HostsSectionNavProps {- current: HostsSection;- onSelect: (section: HostsSection) => void;- class?: string;-}--const AppleIcon = () => (- <svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor">- <path d="M14.94 5.19A4.38 4.38 0 0 0 16 2a4.44 4.44 0 0 0-3 1.52 4.17 4.17 0 0 0-1 3.09 3.69 3.69 0 0 0 2.94-1.42zm2.52 7.44a4.51 4.51 0 0 1 2.16-3.81 4.66 4.66 0 0 0-3.66-2c-1.56-.16-3 .91-3.83.91s-2-.89-3.3-.87A4.92 4.92 0 0 0 4.69 9.39C2.93 12.45 4.24 17 6 19.47c.8 1.21 1.8 2.58 3.12 2.53s1.75-.82 3.28-.82 2 .82 3.3.79 2.22-1.24 3.06-2.45a11 11 0 0 0 1.38-2.85 4.41 4.41 0 0 1-2.68-4.08z" />- </svg>-);--const WindowsIcon = () => (- <svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor">- <path d="M0 3.449L9.75 2.1v9.451H0m10.949-9.602L24 0v11.4H10.949M0 12.6h9.75v9.451L0 20.699M10.949 12.6H24V24l-12.9-1.801" />- </svg>-);--const allSections: Array<{- id: HostsSection;- label: string;- icon: Component<{ size?: number; 'stroke-width'?: number }>;-}> = [- {- id: 'linux',- label: 'Linux',- icon: SquareTerminal,- },- {- id: 'macos',- label: 'macOS',- icon: AppleIcon,- },- {- id: 'windows',- label: 'Windows',- icon: WindowsIcon,- },-];--export const HostsSectionNav: Component<HostsSectionNavProps> = (props) => {- const baseClasses =- 'inline-flex items-center gap-2 px-2 sm:px-3 py-1 text-xs sm:text-sm font-medium border-b-2 border-transparent text-gray-600 dark:text-gray-400 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900';-- return (- <div class={`flex flex-wrap items-center gap-3 sm:gap-4 ${props.class ?? ''}`} aria-label="Host platform sections">- <For each={allSections}>- {(section) => {- const isActive = () => section.id === props.current;- const classes = () => isActive()- ? `${baseClasses} text-blue-600 dark:text-blue-300 border-blue-500 dark:border-blue-400`- : `${baseClasses} hover:text-blue-500 dark:hover:text-blue-300 hover:border-blue-300/70 dark:hover:border-blue-500/50`;-- const Icon = section.icon;-- return (- <button- type="button"- class={classes()}- onClick={() => props.onSelect(section.id)}- aria-pressed={isActive()}- >- <Icon size={16} stroke-width={2} />- <span>{section.label}</span>- </button>- );- }}- </For>- </div>- );-};diff --git a/frontend-modern/src/components/Settings/NodeModal.tsx b/frontend-modern/src/components/Settings/NodeModal.tsxindex 666fecc836..552a33b351 100644--- a/frontend-modern/src/components/Settings/NodeModal.tsx+++ b/frontend-modern/src/components/Settings/NodeModal.tsx@@ -4,6 +4,7 @@ import type { NodeConfig } from '@/types/nodes';import type { SecurityStatus } from '@/types/config';import { copyToClipboard } from '@/utils/clipboard';import { showSuccess, showError } from '@/utils/toast';+import { getPulseBaseUrl } from '@/utils/url';import { NodesAPI } from '@/api/nodes';import { SectionHeader } from '@/components/shared/SectionHeader';import {@@ -13,6 +14,7 @@ import {labelClass,formCheckbox,} from '@/components/shared/Form';+import { logger } from '@/utils/logger';interface NodeModalProps {isOpen: boolean;@@ -298,7 +300,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {message: result.message || 'Connection successful',});} catch (error) {- console.error('Test existing node error:', error);+ logger.error('Test existing node error:', error);let errorMessage = 'Connection failed';if (error instanceof Error) {// Remove "API request failed: XXX " prefix if present@@ -360,7 +362,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {isCluster: result.isCluster,});} catch (error) {- console.error('Test connection error:', error);+ logger.error('Test connection error:', error);let errorMessage = 'Connection failed';if (error instanceof Error) {// Remove "API request failed: XXX " prefix if present@@ -651,16 +653,18 @@ export const NodeModal: Component<NodeModalProps> = (props) => {<buttontype="button"onClick={async () => {- console.log('[Quick Setup] Copy button clicked');+ logger.debug('[Quick Setup] Copy button clicked');try {// Check if host is populatedif (!formData().host || formData().host.trim() === '') {- console.log('[Quick Setup] No host entered');+ logger.debug('[Quick Setup] No host entered');showError('Please enter the Host URL first');return;}- console.log('[Quick Setup] Generating setup URL for host:', formData().host);+ logger.debug('[Quick Setup] Generating setup URL for host', {+ host: formData().host,+ });// Always regenerate URL when host changesconst { apiFetch } = await import('@/utils/apiClient');const response = await apiFetch('/api/setup-script-url', {@@ -673,10 +677,13 @@ export const NodeModal: Component<NodeModalProps> = (props) => {}),});- console.log('[Quick Setup] API response:', response.status, response.ok);+ logger.debug('[Quick Setup] API response', {+ status: response.status,+ ok: response.ok,+ });if (response.ok) {const data = await response.json();- console.log('[Quick Setup] Setup data received:', data);+ logger.debug('[Quick Setup] Setup data received', data);setQuickSetupToken(data.setupToken ?? '');setQuickSetupExpiry(typeof data.expires === 'number' ? data.expires : null);@@ -684,17 +691,17 @@ export const NodeModal: Component<NodeModalProps> = (props) => {// Backend returns url, command, and expires// Just copy the command - don't show the modalif (data.command) {- console.log('[Quick Setup] Copying command to clipboard:', data.command);+ logger.debug('[Quick Setup] Copying command to clipboard');setQuickSetupCommand(data.command);const copied = await copyToClipboard(data.command);- console.log('[Quick Setup] Copy result:', copied);+ logger.debug('[Quick Setup] Copy result', copied);if (copied) {showSuccess('Command copied to clipboard! Paste the setup token shown below when prompted.');} else {showError('Failed to copy to clipboard');}} else {- console.log('[Quick Setup] No command in response');+ logger.debug('[Quick Setup] No command in response');}} else {setQuickSetupToken('');@@ -702,7 +709,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {showError('Failed to generate setup URL');}} catch (error) {- console.error('[Quick Setup] Error:', error);+ logger.error('[Quick Setup] Error:', error);setQuickSetupToken('');setQuickSetupExpiry(null);showError('Failed to copy command');@@ -799,7 +806,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {const hostValue = formData().host || '';const encodedHost = encodeURIComponent(hostValue);const pulseUrl = encodeURIComponent(- window.location.origin,+ getPulseBaseUrl(),);const scriptUrl = `/api/setup-script?type=pve&host=${encodedHost}&pulse_url=${pulseUrl}&backup_perms=true`;@@ -827,7 +834,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {'Script downloaded! Upload it to your server and run: bash pulse-setup.sh',);} catch (error) {- console.error('Failed to download script:', error);+ logger.error('Failed to download script:', error);showSuccess('Failed to download script. Please check your connection.',);@@ -1173,7 +1180,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {showError('Failed to generate setup URL');}} catch (error) {- console.error('Failed to copy command:', error);+ logger.error('Failed to copy command:', error);showError('Failed to copy command');}}}@@ -1269,7 +1276,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {const hostValue = formData().host || '';const encodedHost = encodeURIComponent(hostValue);const pulseUrl = encodeURIComponent(- window.location.origin,+ getPulseBaseUrl(),);const scriptUrl = `/api/setup-script?type=pbs&host=${encodedHost}&pulse_url=${pulseUrl}`;@@ -1297,7 +1304,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {'Script downloaded! Upload it to your PBS and run: bash pulse-pbs-setup.sh',);} catch (error) {- console.error('Failed to download script:', error);+ logger.error('Failed to download script:', error);showSuccess('Failed to download script. Please check your connection.',);@@ -1801,7 +1808,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {<Show when={testResult()}>{(() => {const result = testResult();- console.log('Test result display:', {+ logger.debug('Test result display', {status: result?.status,message: result?.message,});diff --git a/frontend-modern/src/components/Settings/OIDCPanel.tsx b/frontend-modern/src/components/Settings/OIDCPanel.tsxindex 524301c11c..908fb21ec9 100644--- a/frontend-modern/src/components/Settings/OIDCPanel.tsx+++ b/frontend-modern/src/components/Settings/OIDCPanel.tsx@@ -5,6 +5,7 @@ import { SectionHeader } from '@/components/shared/SectionHeader';import { Toggle } from '@/components/shared/Toggle';import { formField, labelClass, controlClass, formHelpText } from '@/components/shared/Form';import { notificationStore } from '@/stores/notifications';+import { logger } from '@/utils/logger';interface OIDCConfigResponse {enabled: boolean;@@ -115,7 +116,7 @@ export const OIDCPanel: Component<Props> = (props) => {resetForm(data);props.onConfigUpdated?.(data);} catch (error) {- console.error('[OIDCPanel] Failed to load config:', error);+ logger.error('[OIDCPanel] Failed to load config:', error);notificationStore.error('Failed to load OIDC settings');setConfig(null);resetForm(null);@@ -177,7 +178,7 @@ export const OIDCPanel: Component<Props> = (props) => {notificationStore.success('OIDC settings updated');props.onConfigUpdated?.(updated);} catch (error) {- console.error('[OIDCPanel] Failed to save config:', error);+ logger.error('[OIDCPanel] Failed to save config:', error);notificationStore.error('Failed to save OIDC settings');} finally {setSaving(false);diff --git a/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx b/frontend-modern/src/components/Settings/QuickSecuritySetup.tsxindex 5615e2eeb6..4e00f05be9 100644--- a/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx+++ b/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx@@ -1,8 +1,7 @@import { Component, createSignal, Show } from 'solid-js';import { showSuccess, showError } from '@/utils/toast';import { copyToClipboard } from '@/utils/clipboard';-import { clearStoredAPIToken } from '@/utils/tokenStorage';-import { clearApiToken as clearApiClientToken } from '@/utils/apiClient';+import { clearAuth as clearApiClientAuth } from '@/utils/apiClient';import { SectionHeader } from '@/components/shared/SectionHeader';import { formField, labelClass, controlClass, formHelpText } from '@/components/shared/Form';@@ -124,19 +123,7 @@ export const QuickSecuritySetup: Component<QuickSecuritySetupProps> = (props) =>setCredentials(newCredentials);setShowCredentials(true);- try {- sessionStorage.removeItem('pulse_auth');- sessionStorage.removeItem('pulse_auth_user');- } catch (storageError) {- console.warn('Unable to clear cached auth session storage', storageError);- }-- try {- clearStoredAPIToken();- clearApiClientToken();- } catch (storageError) {- console.warn('Unable to clear cached API token', storageError);- }+ clearApiClientAuth();// Show success messageshowSuccess(@@ -146,9 +133,6 @@ export const QuickSecuritySetup: Component<QuickSecuritySetupProps> = (props) =>);// DON'T notify parent yet - wait until user dismisses credentials- // if (props.onConfigured) {- // props.onConfigured();- // }} catch (error) {showError(`Failed to setup security: ${error}`);} finally {diff --git a/frontend-modern/src/components/Settings/Settings.tsx b/frontend-modern/src/components/Settings/Settings.tsxindex e96b84e2aa..33f6c6a09a 100644--- a/frontend-modern/src/components/Settings/Settings.tsx+++ b/frontend-modern/src/components/Settings/Settings.tsx@@ -14,9 +14,11 @@ import { useNavigate, useLocation } from '@solidjs/router';import { useWebSocket } from '@/App';import { showSuccess, showError } from '@/utils/toast';import { copyToClipboard } from '@/utils/clipboard';-import { clearStoredAPIToken, getStoredAPIToken, setStoredAPIToken } from '@/utils/tokenStorage';+import { getPulsePort, getPulseWebSocketUrl } from '@/utils/url';+import { logger } from '@/utils/logger';import {clearApiToken as clearApiClientToken,+ getApiToken as getApiClientToken,setApiToken as setApiClientToken,} from '@/utils/apiClient';import { NodeModal } from './NodeModal';@@ -50,9 +52,9 @@ import Monitor from 'lucide-solid/icons/monitor';import Sliders from 'lucide-solid/icons/sliders-horizontal';import RefreshCw from 'lucide-solid/icons/refresh-cw';import Clock from 'lucide-solid/icons/clock';-import { ApiIcon } from '@/components/icons/ApiIcon';import { ProxmoxIcon } from '@/components/icons/ProxmoxIcon';-import { DockerIcon } from '@/components/icons/DockerIcon';+import Boxes from 'lucide-solid/icons/boxes';+import BadgeCheck from 'lucide-solid/icons/badge-check';import type { NodeConfig } from '@/types/nodes';import type { UpdateInfo, VersionInfo } from '@/api/updates';import type { APITokenRecord } from '@/api/security';@@ -272,7 +274,7 @@ type SettingsTab =| 'diagnostics'| 'updates';-type AgentKey = 'pve' | 'pbs' | 'pmg' | 'docker' | 'host';+type AgentKey = 'pve' | 'pbs' | 'pmg';const SETTINGS_HEADER_META: Record<SettingsTab, { title: string; description: string }> = {proxmox: {@@ -370,7 +372,10 @@ const Settings: Component<SettingsProps> = (props) => {if (path.includes('/settings/hosts') ||path.includes('/settings/host-agents') ||- path.includes('/settings/servers')+ path.includes('/settings/servers') ||+ path.includes('/settings/linuxServers') ||+ path.includes('/settings/windowsServers') ||+ path.includes('/settings/macServers'))return 'hosts';if (path.includes('/settings/system-general')) return 'system-general';@@ -404,16 +409,6 @@ const Settings: Component<SettingsProps> = (props) => {if (path.includes('/settings/pve')) return 'pve';if (path.includes('/settings/pbs')) return 'pbs';if (path.includes('/settings/pmg')) return 'pmg';- if (path.includes('/settings/docker')) return 'docker';- if (- path.includes('/settings/host') ||- path.includes('/settings/host-agents') ||- path.includes('/settings/linuxServers') ||- path.includes('/settings/windowsServers') ||- path.includes('/settings/macServers')- ) {- return 'host';- }return null;};@@ -428,8 +423,6 @@ const Settings: Component<SettingsProps> = (props) => {pve: '/settings/pve',pbs: '/settings/pbs',pmg: '/settings/pmg',- docker: '/settings/docker',- host: '/settings/host-agents',};const handleSelectAgent = (agent: AgentKey) => {@@ -444,10 +437,9 @@ const Settings: Component<SettingsProps> = (props) => {};const setActiveTab = (tab: SettingsTab) => {- if (tab === 'proxmox' && !['pve', 'pbs', 'pmg', 'docker', 'host'].includes(selectedAgent())) {+ if (tab === 'proxmox' && deriveAgentFromPath(location.pathname) === null) {setSelectedAgent('pve');}-const targetPath = `/settings/${tab}`;if (location.pathname !== targetPath) {navigate(targetPath, { scroll: false });@@ -496,6 +488,18 @@ const Settings: Component<SettingsProps> = (props) => {return;}+ if (+ path.startsWith('/settings/linuxServers') ||+ path.startsWith('/settings/windowsServers') ||+ path.startsWith('/settings/macServers')+ ) {+ navigate('/settings/hosts', {+ replace: true,+ scroll: false,+ });+ return;+ }+const resolved = deriveTabFromPath(path);if (resolved !== currentTab()) {setCurrentTab(resolved);@@ -503,11 +507,7 @@ const Settings: Component<SettingsProps> = (props) => {if (resolved === 'proxmox') {const agentFromPath = deriveAgentFromPath(path);- if (agentFromPath) {- setSelectedAgent(agentFromPath);- } else if (!['pve', 'pbs', 'pmg', 'docker', 'host'].includes(selectedAgent())) {- setSelectedAgent('pve');- }+ setSelectedAgent(agentFromPath ?? 'pve');}},),@@ -776,7 +776,7 @@ const Settings: Component<SettingsProps> = (props) => {const diag = await response.json();setDiagnosticsData(diag);} catch (err) {- console.error('Failed to fetch diagnostics:', err);+ logger.error('Failed to fetch diagnostics', err);showError('Failed to run diagnostics');} finally {setRunningDiagnostics(false);@@ -810,7 +810,7 @@ const Settings: Component<SettingsProps> = (props) => {showSuccess('Queried proxy node registration state');await runDiagnostics();} catch (err) {- console.error('Failed to query proxy node registration state:', err);+ logger.error('Failed to query proxy node registration state', err);showError('Failed to query proxy nodes');} finally {setProxyActionLoading(null);@@ -874,7 +874,7 @@ const Settings: Component<SettingsProps> = (props) => {showSuccess(`Generated dedicated token for ${hostName}`);await runDiagnostics();} catch (err) {- console.error('Failed to prepare Docker token', err);+ logger.error('Failed to prepare Docker token', err);showError('Failed to prepare Docker token');} finally {setDockerActionLoading(null);@@ -893,26 +893,33 @@ const Settings: Component<SettingsProps> = (props) => {const tabGroups: {id: 'platforms' | 'operations' | 'system' | 'security';label: string;- items: { id: SettingsTab; label: string; icon: JSX.Element; disabled?: boolean }[];+ items: {+ id: SettingsTab;+ label: string;+ icon: Component<{ class?: string; strokeWidth?: number }>;+ iconProps?: { strokeWidth?: number };+ disabled?: boolean;+ }[];}[] = [{id: 'platforms',label: 'Platforms',items: [- { id: 'proxmox', label: 'Proxmox', icon: <ProxmoxIcon class="w-4 h-4" /> },- { id: 'docker', label: 'Docker', icon: <DockerIcon class="w-4 h-4" /> },- { id: 'hosts', label: 'Hosts', icon: <Monitor class="w-4 h-4" strokeWidth={2} /> },+ { id: 'proxmox', label: 'Proxmox', icon: ProxmoxIcon },+ { id: 'docker', label: 'Docker', icon: Boxes },+ { id: 'hosts', label: 'Hosts', icon: Monitor, iconProps: { strokeWidth: 2 } },],},{id: 'operations',label: 'Operations',items: [- { id: 'api', label: 'API Tokens', icon: <ApiIcon class="w-4 h-4" /> },+ { id: 'api', label: 'API Tokens', icon: BadgeCheck },{id: 'diagnostics',label: 'Diagnostics',- icon: <Activity class="w-4 h-4" strokeWidth={2} />,+ icon: Activity,+ iconProps: { strokeWidth: 2 },},],},@@ -923,19 +930,27 @@ const Settings: Component<SettingsProps> = (props) => {{id: 'system-general',label: 'General',- icon: <Sliders class="w-4 h-4" strokeWidth={2} />,+ icon: Sliders,+ iconProps: { strokeWidth: 2 },},{id: 'system-network',label: 'Network',- icon: <Network class="w-4 h-4" strokeWidth={2} />,+ icon: Network,+ iconProps: { strokeWidth: 2 },},{id: 'system-updates',label: 'Updates',- icon: <RefreshCw class="w-4 h-4" strokeWidth={2} />,+ icon: RefreshCw,+ iconProps: { strokeWidth: 2 },+ },+ {+ id: 'system-backups',+ label: 'Backups',+ icon: Clock,+ iconProps: { strokeWidth: 2 },},- { id: 'system-backups', label: 'Backups', icon: <Clock class="w-4 h-4" strokeWidth={2} /> },],},{@@ -945,17 +960,20 @@ const Settings: Component<SettingsProps> = (props) => {{id: 'security-overview',label: 'Overview',- icon: <Shield class="w-4 h-4" strokeWidth={2} />,+ icon: Shield,+ iconProps: { strokeWidth: 2 },},{id: 'security-auth',label: 'Authentication',- icon: <Lock class="w-4 h-4" strokeWidth={2} />,+ icon: Lock,+ iconProps: { strokeWidth: 2 },},{id: 'security-sso',label: 'Single Sign-On',- icon: <Key class="w-4 h-4" strokeWidth={2} />,+ icon: Key,+ iconProps: { strokeWidth: 2 },},],},@@ -1002,13 +1020,13 @@ const Settings: Component<SettingsProps> = (props) => {});setNodes(nodesWithStatus);} catch (error) {- console.error('Failed to load nodes:', error);+ logger.error('Failed to load nodes', error);// If we get a 429 or network error, retry after a delayif (error instanceof Error &&(error.message.includes('429') || error.message.includes('fetch'))) {- console.log('Retrying node load after delay...');+ logger.info('Retrying node load after delay');setTimeout(() => loadNodes(), 3000);}}@@ -1022,13 +1040,13 @@ const Settings: Component<SettingsProps> = (props) => {const response = await apiFetch('/api/security/status');if (response.ok) {const status = await response.json();- console.log('Security status loaded:', status);+ logger.debug('Security status loaded', status);setSecurityStatus(status);} else {- console.error('Failed to fetch security status:', response.status);+ logger.error('Failed to fetch security status', { status: response.status });}} catch (err) {- console.error('Failed to fetch security status:', err);+ logger.error('Failed to fetch security status', err);} finally {setSecurityStatusLoading(false);}@@ -1182,7 +1200,7 @@ const Settings: Component<SettingsProps> = (props) => {}}} catch (error) {- console.error('Failed to load discovered nodes:', error);+ logger.error('Failed to load discovered nodes', error);}};@@ -1216,7 +1234,7 @@ const Settings: Component<SettingsProps> = (props) => {notificationStore.info('Discovery scan started', 2000);}} catch (error) {- console.error('Failed to start discovery scan:', error);+ logger.error('Failed to start discovery scan', error);notificationStore.error('Failed to start discovery scan');setDiscoveryScanStatus((prev) => ({...prev,@@ -1285,7 +1303,7 @@ const Settings: Component<SettingsProps> = (props) => {return true;} catch (error) {- console.error('Failed to update discovery setting:', error);+ logger.error('Failed to update discovery setting', error);notificationStore.error('Failed to update discovery setting');setDiscoveryEnabled(previousEnabled);applySavedDiscoverySubnet(previousSubnet);@@ -1348,7 +1366,7 @@ const Settings: Component<SettingsProps> = (props) => {}return true;} catch (error) {- console.error('Failed to update discovery subnet:', error);+ logger.error('Failed to update discovery subnet', error);notificationStore.error('Failed to update discovery subnet');applySavedDiscoverySubnet(previousSubnet);setDiscoverySubnetDraft(previousSubnet === 'auto' ? '' : normalizeSubnetList(previousSubnet));@@ -1388,7 +1406,7 @@ const Settings: Component<SettingsProps> = (props) => {4000,);} catch (error) {- console.error('Failed to update discovery subnet:', error);+ logger.error('Failed to update discovery subnet', error);notificationStore.error('Failed to update discovery subnet');applySavedDiscoverySubnet(previousSubnet);} finally {@@ -1539,50 +1557,43 @@ const Settings: Component<SettingsProps> = (props) => {// Load system settingstry {- const systemResponse = await fetch('/api/config/system');- if (systemResponse.ok) {- const systemSettings = await systemResponse.json();- // PBS polling interval is now fixed at 10 seconds- setAllowedOrigins(systemSettings.allowedOrigins || '*');- // Connection timeout is backend-only- // Load discovery settings- // Backend defaults to false, so we should respect that- setDiscoveryEnabled(systemSettings.discoveryEnabled ?? false); // Default to false if undefined- applySavedDiscoverySubnet(systemSettings.discoverySubnet);- // Load embedding settings- setAllowEmbedding(systemSettings.allowEmbedding ?? false);- setAllowedEmbedOrigins(systemSettings.allowedEmbedOrigins || '');- // Backup polling controls- if (typeof systemSettings.backupPollingEnabled === 'boolean') {- setBackupPollingEnabled(systemSettings.backupPollingEnabled);- } else {- setBackupPollingEnabled(true);- }- const intervalSeconds =- typeof systemSettings.backupPollingInterval === 'number'- ? Math.max(0, Math.floor(systemSettings.backupPollingInterval))- : 0;- setBackupPollingInterval(intervalSeconds);- if (intervalSeconds > 0) {- setBackupPollingCustomMinutes(Math.max(1, Math.round(intervalSeconds / 60)));- }- // Load auto-update settings- setAutoUpdateEnabled(systemSettings.autoUpdateEnabled || false);- setAutoUpdateCheckInterval(systemSettings.autoUpdateCheckInterval || 24);- setAutoUpdateTime(systemSettings.autoUpdateTime || '03:00');- if (systemSettings.updateChannel) {- setUpdateChannel(systemSettings.updateChannel as 'stable' | 'rc');- }- // Track environment variable overrides- if (systemSettings.envOverrides) {- setEnvOverrides(systemSettings.envOverrides);- }+ const systemSettings = await SettingsAPI.getSystemSettings();+ // PBS polling interval is now fixed at 10 seconds+ setAllowedOrigins(systemSettings.allowedOrigins || '*');+ // Connection timeout is backend-only+ // Load discovery settings (default to false when unset)+ setDiscoveryEnabled(systemSettings.discoveryEnabled ?? false);+ applySavedDiscoverySubnet(systemSettings.discoverySubnet);+ // Load embedding settings+ setAllowEmbedding(systemSettings.allowEmbedding ?? false);+ setAllowedEmbedOrigins(systemSettings.allowedEmbedOrigins || '');+ // Backup polling controls+ if (typeof systemSettings.backupPollingEnabled === 'boolean') {+ setBackupPollingEnabled(systemSettings.backupPollingEnabled);} else {- // Fallback to old endpoint- await SettingsAPI.getSettings();+ setBackupPollingEnabled(true);+ }+ const intervalSeconds =+ typeof systemSettings.backupPollingInterval === 'number'+ ? Math.max(0, Math.floor(systemSettings.backupPollingInterval))+ : 0;+ setBackupPollingInterval(intervalSeconds);+ if (intervalSeconds > 0) {+ setBackupPollingCustomMinutes(Math.max(1, Math.round(intervalSeconds / 60)));+ }+ // Load auto-update settings+ setAutoUpdateEnabled(systemSettings.autoUpdateEnabled || false);+ setAutoUpdateCheckInterval(systemSettings.autoUpdateCheckInterval || 24);+ setAutoUpdateTime(systemSettings.autoUpdateTime || '03:00');+ if (systemSettings.updateChannel) {+ setUpdateChannel(systemSettings.updateChannel as 'stable' | 'rc');+ }+ // Track environment variable overrides+ if (systemSettings.envOverrides) {+ setEnvOverrides(systemSettings.envOverrides);}} catch (error) {- console.error('Failed to load settings:', error);+ logger.error('Failed to load settings', error);}// Load version information@@ -1595,10 +1606,10 @@ const Settings: Component<SettingsProps> = (props) => {setUpdateChannel(version.channel as 'stable' | 'rc');}} catch (error) {- console.error('Failed to load version:', error);+ logger.error('Failed to load version', error);}} catch (error) {- console.error('Failed to load configuration:', error);+ logger.error('Failed to load configuration', error);} finally {// Mark initial load as complete even if there were errorssetInitialLoadComplete(true);@@ -1766,7 +1777,7 @@ const Settings: Component<SettingsProps> = (props) => {}} catch (error) {showError('Failed to check for updates');- console.error('Update check error:', error);+ logger.error('Update check error', error);} finally {setCheckingForUpdates(false);}@@ -1795,7 +1806,7 @@ const Settings: Component<SettingsProps> = (props) => {// Only check for API token if user is not authenticated via password// If user is logged in with password, session auth is sufficientconst hasPasswordAuth = securityStatus()?.hasAuthentication;- if (!hasPasswordAuth && securityStatus()?.apiTokenConfigured && !getStoredAPIToken()) {+ if (!hasPasswordAuth && securityStatus()?.apiTokenConfigured && !getApiClientToken()) {setApiTokenModalSource('export');setShowApiTokenModal(true);return;@@ -1818,7 +1829,7 @@ const Settings: Component<SettingsProps> = (props) => {}// Add API token if configured- const apiToken = getStoredAPIToken();+ const apiToken = getApiClientToken();if (apiToken) {headers['X-API-Token'] = apiToken;}@@ -1838,9 +1849,8 @@ const Settings: Component<SettingsProps> = (props) => {const hasPasswordAuth = securityStatus()?.hasAuthentication;if (!hasPasswordAuth) {// Clear invalid token if we had one- const hadToken = getStoredAPIToken();+ const hadToken = getApiClientToken();if (hadToken) {- clearStoredAPIToken();clearApiClientToken();showError('Invalid or expired API token. Please re-enter.');setApiTokenModalSource('export');@@ -1878,7 +1888,7 @@ const Settings: Component<SettingsProps> = (props) => {const errorMessage =error instanceof Error ? error.message : 'Failed to export configuration';showError(errorMessage);- console.error('Export error:', error);+ logger.error('Export error', error);}};@@ -1896,7 +1906,7 @@ const Settings: Component<SettingsProps> = (props) => {// Only check for API token if user is not authenticated via password// If user is logged in with password, session auth is sufficientconst hasPasswordAuth = securityStatus()?.hasAuthentication;- if (!hasPasswordAuth && securityStatus()?.apiTokenConfigured && !getStoredAPIToken()) {+ if (!hasPasswordAuth && securityStatus()?.apiTokenConfigured && !getApiClientToken()) {setApiTokenModalSource('import');setShowApiTokenModal(true);return;@@ -1909,7 +1919,7 @@ const Settings: Component<SettingsProps> = (props) => {exportData = JSON.parse(fileContent);} catch (parseError) {showError('Invalid JSON file format');- console.error('JSON parse error:', parseError);+ logger.error('JSON parse error', parseError);return;}@@ -1929,7 +1939,7 @@ const Settings: Component<SettingsProps> = (props) => {}// Add API token if configured- const apiToken = getStoredAPIToken();+ const apiToken = getApiClientToken();if (apiToken) {headers['X-API-Token'] = apiToken;}@@ -1952,9 +1962,8 @@ const Settings: Component<SettingsProps> = (props) => {const hasPasswordAuth = securityStatus()?.hasAuthentication;if (!hasPasswordAuth) {// Clear invalid token if we had one- const hadToken = getStoredAPIToken();+ const hadToken = getApiClientToken();if (hadToken) {- clearStoredAPIToken();clearApiClientToken();showError('Invalid or expired API token. Please re-enter.');setApiTokenModalSource('import');@@ -1981,7 +1990,7 @@ const Settings: Component<SettingsProps> = (props) => {setTimeout(() => window.location.reload(), 2000);} catch (error) {showError('Failed to import configuration');- console.error('Import error:', error);+ logger.error('Import error', error);}};@@ -2136,7 +2145,7 @@ const Settings: Component<SettingsProps> = (props) => {}}title={sidebarCollapsed() ? item.label : undefined}>- {item.icon}+ <item.icon class="w-4 h-4" {...(item.iconProps || {})} /><Show when={!sidebarCollapsed()}><span class="truncate">{item.label}</span></Show>@@ -3059,13 +3068,6 @@ const Settings: Component<SettingsProps> = (props) => {</div></div></Show>- {/* Docker Tab */}- <Show when={activeTab() === 'proxmox' && selectedAgent() === 'docker'}>- <div class="space-y-6 mt-6">- <DockerAgents />- </div>- </Show>-{/* Docker Platform Tab */}<Show when={activeTab() === 'docker'}><DockerAgents />@@ -3076,13 +3078,6 @@ const Settings: Component<SettingsProps> = (props) => {<HostAgents /></Show>- {/* Host Agents */}- <Show when={activeTab() === 'proxmox' && selectedAgent() === 'host'}>- <div class="space-y-6 mt-6">- <HostAgents />- </div>- </Show>-{/* System General Tab */}<Show when={activeTab() === 'system-general'}><div class="space-y-6">@@ -4265,7 +4260,7 @@ const Settings: Component<SettingsProps> = (props) => {<div class="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 px-6 py-4 border-b border-gray-200 dark:border-gray-700"><div class="flex items-center gap-3"><div class="p-2 bg-blue-100 dark:bg-blue-900/40 rounded-lg">- <ApiIcon class="w-5 h-5 text-blue-600 dark:text-blue-300" />+ <BadgeCheck class="w-5 h-5 text-blue-600 dark:text-blue-300" /></div><SectionHeadertitle="API Access"@@ -5448,8 +5443,7 @@ const Settings: Component<SettingsProps> = (props) => {<div class="flex justify-between"><span class="text-gray-600 dark:text-gray-400">Server Port:</span><span class="font-medium">- {window.location.port ||- (window.location.protocol === 'https:' ? '443' : '80')}+ {getPulsePort()}</span></div></div>@@ -6163,7 +6157,7 @@ const Settings: Component<SettingsProps> = (props) => {},websocket: {connected: connected(),- url: `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws`,+ url: getPulseWebSocketUrl(),},// Include backend diagnostics if availablebackendDiagnostics: diagnosticsData() || null,@@ -6888,7 +6882,6 @@ const Settings: Component<SettingsProps> = (props) => {onClick={() => {if (apiTokenInput()) {const tokenValue = apiTokenInput()!;- setStoredAPIToken(tokenValue);setApiClientToken(tokenValue);const source = apiTokenModalSource();setShowApiTokenModal(false);diff --git a/frontend-modern/src/components/Settings/SettingsSectionNav.tsx b/frontend-modern/src/components/Settings/SettingsSectionNav.tsxindex 461b15dfa6..ea1c62754a 100644--- a/frontend-modern/src/components/Settings/SettingsSectionNav.tsx+++ b/frontend-modern/src/components/Settings/SettingsSectionNav.tsx@@ -4,7 +4,7 @@ import Server from 'lucide-solid/icons/server';import HardDrive from 'lucide-solid/icons/hard-drive';import Mail from 'lucide-solid/icons/mail';-type SettingsSection = 'pve' | 'pbs' | 'pmg' | 'docker' | 'host';+type SettingsSection = 'pve' | 'pbs' | 'pmg';interface SettingsSectionNavProps {current: SettingsSection;diff --git a/frontend-modern/src/components/Settings/UpdateHistoryPanel.tsx b/frontend-modern/src/components/Settings/UpdateHistoryPanel.tsxdeleted file mode 100644index 101b188980..0000000000--- a/frontend-modern/src/components/Settings/UpdateHistoryPanel.tsx+++ /dev/null@@ -1,204 +0,0 @@-import { createSignal, onMount, For, Show, createMemo } from 'solid-js';-import { UpdatesAPI, type UpdateHistoryEntry } from '@/api/updates';-import { Card } from '@/components/shared/Card';-import { SectionHeader } from '@/components/shared/SectionHeader';--export function UpdateHistoryPanel() {- const [history, setHistory] = createSignal<UpdateHistoryEntry[]>([]);- const [loading, setLoading] = createSignal(true);- const [error, setError] = createSignal<string | null>(null);- const [filterStatus, setFilterStatus] = createSignal<string>('all');-- const filteredHistory = createMemo(() => {- const filter = filterStatus();- if (filter === 'all') return history();- return history().filter((entry) => entry.status === filter);- });-- const loadHistory = async () => {- setLoading(true);- setError(null);- try {- const data = await UpdatesAPI.getUpdateHistory(50); // Get last 50 updates- setHistory(data);- } catch (err) {- console.error('Failed to load update history:', err);- setError('Failed to load update history');- } finally {- setLoading(false);- }- };-- onMount(() => {- loadHistory();- });-- const getStatusBadge = (status: string) => {- switch (status) {- case 'success':- return (- <span class="px-2 py-1 text-xs font-medium bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-200 rounded">- Success- </span>- );- case 'failed':- return (- <span class="px-2 py-1 text-xs font-medium bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-200 rounded">- Failed- </span>- );- case 'in_progress':- return (- <span class="px-2 py-1 text-xs font-medium bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-200 rounded">- In Progress- </span>- );- case 'rolled_back':- return (- <span class="px-2 py-1 text-xs font-medium bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-200 rounded">- Rolled Back- </span>- );- case 'cancelled':- return (- <span class="px-2 py-1 text-xs font-medium bg-gray-100 dark:bg-gray-900/30 text-gray-800 dark:text-gray-200 rounded">- Cancelled- </span>- );- default:- return <span class="px-2 py-1 text-xs font-medium bg-gray-100 dark:bg-gray-900/30 text-gray-800 dark:text-gray-200 rounded">{status}</span>;- }- };-- const formatDate = (timestamp: string) => {- const date = new Date(timestamp);- return date.toLocaleString();- };-- const formatDuration = (durationMs: number) => {- if (durationMs === 0) return '-';- const seconds = Math.floor(durationMs / 1000);- const minutes = Math.floor(seconds / 60);- if (minutes > 0) {- return `${minutes}m ${seconds % 60}s`;- }- return `${seconds}s`;- };-- return (- <div class="space-y-6">- <SectionHeader title="Update History" />-- <Card>- <div class="p-6">- {/* Filter Controls */}- <div class="mb-4 flex items-center gap-2">- <label class="text-sm font-medium text-gray-700 dark:text-gray-300">- Filter by status:- </label>- <select- value={filterStatus()}- onChange={(e) => setFilterStatus(e.currentTarget.value)}- class="px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"- >- <option value="all">All</option>- <option value="success">Success</option>- <option value="failed">Failed</option>- <option value="in_progress">In Progress</option>- <option value="rolled_back">Rolled Back</option>- <option value="cancelled">Cancelled</option>- </select>- </div>-- {/* Loading State */}- <Show when={loading()}>- <div class="text-center py-8 text-gray-500 dark:text-gray-400">- Loading update history...- </div>- </Show>-- {/* Error State */}- <Show when={error()}>- <div class="text-center py-8">- <div class="text-red-600 dark:text-red-400">{error()}</div>- <button- onClick={loadHistory}- class="mt-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded"- >- Retry- </button>- </div>- </Show>-- {/* Empty State */}- <Show when={!loading() && !error() && filteredHistory().length === 0}>- <div class="text-center py-8 text-gray-500 dark:text-gray-400">- No update history available- </div>- </Show>-- {/* History Table */}- <Show when={!loading() && !error() && filteredHistory().length > 0}>- <div class="overflow-x-auto">- <table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">- <thead class="bg-gray-50 dark:bg-gray-800">- <tr>- <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">- Timestamp- </th>- <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">- Action- </th>- <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">- Version- </th>- <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">- Status- </th>- <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">- Duration- </th>- <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">- Deployment- </th>- </tr>- </thead>- <tbody class="bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700">- <For each={filteredHistory()}>- {(entry) => (- <tr class="hover:bg-gray-50 dark:hover:bg-gray-800">- <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100">- {formatDate(entry.timestamp)}- </td>- <td class="px-4 py-3 whitespace-nowrap text-sm">- <span class="capitalize">{entry.action}</span>- </td>- <td class="px-4 py-3 whitespace-nowrap text-sm font-mono text-gray-700 dark:text-gray-300">- {entry.version_from} → {entry.version_to}- </td>- <td class="px-4 py-3 whitespace-nowrap text-sm">- {getStatusBadge(entry.status)}- </td>- <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400">- {formatDuration(entry.duration_ms)}- </td>- <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400">- <span class="capitalize">{entry.deployment_type}</span>- </td>- </tr>- )}- </For>- </tbody>- </table>- </div>-- {/* Details Section - Could be expanded with more info */}- <div class="mt-4 text-sm text-gray-500 dark:text-gray-400">- Showing {filteredHistory().length} {filteredHistory().length === 1 ? 'entry' : 'entries'}- </div>- </Show>- </div>- </Card>- </div>- );-}diff --git a/frontend-modern/src/components/Settings/__tests__/DockerAgents.test.tsx b/frontend-modern/src/components/Settings/__tests__/DockerAgents.test.tsxindex 4d8e95fa01..b1cd5ed650 100644--- a/frontend-modern/src/components/Settings/__tests__/DockerAgents.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/DockerAgents.test.tsx@@ -108,11 +108,11 @@ describe('DockerAgents removed hosts', () => {allowDockerHostReenrollMock.mockResolvedValue(undefined);const clipboardSpy = vi.fn().mockResolvedValue(undefined);- vi.stubGlobal('navigator', { clipboard: { writeText: clipboardSpy } } as Navigator);+ vi.stubGlobal('navigator', { clipboard: { writeText: clipboardSpy } } as unknown as Navigator);setupComponent([], [createRemovedHost()]);- expect(screen.getByText('Recently removed Docker hosts')).toBeInTheDocument();+ expect(screen.getByText('Recently removed container hosts')).toBeInTheDocument();const allowButton = screen.getByRole('button', { name: 'Allow re-enroll' });fireEvent.click(allowButton);@@ -149,7 +149,7 @@ describe('DockerAgents removed hosts', () => {const removeButton = screen.getByRole('button', { name: 'Remove' });fireEvent.click(removeButton);- await screen.findByText('Remove Docker host "Host One"');+ await screen.findByText('Remove container host "Host One"');expect(screen.getByText('acknowledged')).toBeInTheDocument();const progressHeading = screen.getByText('Progress');@@ -202,7 +202,7 @@ describe('DockerAgents removed hosts', () => {const removeButton = screen.getByRole('button', { name: 'Remove' });fireEvent.click(removeButton);- await screen.findByText('Remove Docker host "Host One"');+ await screen.findByText('Remove container host "Host One"');const stopButton = screen.getByRole('button', { name: 'Stop agent now' });fireEvent.click(stopButton);diff --git a/frontend-modern/src/components/UpdateBanner.tsx b/frontend-modern/src/components/UpdateBanner.tsxindex ca76975fc2..d986dfa794 100644--- a/frontend-modern/src/components/UpdateBanner.tsx+++ b/frontend-modern/src/components/UpdateBanner.tsx@@ -5,6 +5,8 @@ import { UpdatesAPI, type UpdatePlan } from '@/api/updates';import { UpdateConfirmationModal } from './UpdateConfirmationModal';import { UpdateProgressModal } from './UpdateProgressModal';import { WebSocketContext } from '@/App';+import { copyToClipboard } from '@/utils/clipboard';+import { logger } from '@/utils/logger';export function UpdateBanner() {const navigate = useNavigate();@@ -24,7 +26,7 @@ export function UpdateBanner() {const plan = await UpdatesAPI.getUpdatePlan(info.latestVersion);setUpdatePlan(plan);} catch (error) {- console.error('Failed to fetch update plan:', error);+ logger.error('Failed to fetch update plan', error);}}});@@ -44,21 +46,21 @@ export function UpdateBanner() {setShowConfirmModal(false);setShowProgressModal(true);} catch (error) {- console.error('Failed to start update:', error);+ logger.error('Failed to start update', error);alert('Failed to start update. Please try again.');} finally {setIsApplying(false);}};- const copyToClipboard = async (text: string, index: number) => {- try {- await navigator.clipboard.writeText(text);- setCopiedIndex(index);- setTimeout(() => setCopiedIndex(null), 2000);- } catch (error) {- console.error('Failed to copy:', error);+ const handleCopy = async (text: string, index: number) => {+ const success = await copyToClipboard(text);+ if (!success) {+ logger.error('Failed to copy update instruction to clipboard', new Error('clipboard copy failed'));+ return;}+ setCopiedIndex(index);+ setTimeout(() => setCopiedIndex(null), 2000);};// Get deployment type message@@ -223,7 +225,7 @@ export function UpdateBanner() {{instruction}</code><button- onClick={() => copyToClipboard(instruction, index())}+ onClick={() => handleCopy(instruction, index())}class="flex-shrink-0 p-1 hover:bg-blue-100 dark:hover:bg-blue-800/30 rounded transition-colors"title="Copy to clipboard">diff --git a/frontend-modern/src/components/UpdateProgressModal.tsx b/frontend-modern/src/components/UpdateProgressModal.tsxindex d1d1bf8738..4ef273d53e 100644--- a/frontend-modern/src/components/UpdateProgressModal.tsx+++ b/frontend-modern/src/components/UpdateProgressModal.tsx@@ -1,5 +1,6 @@import { createSignal, Show, onMount, onCleanup, createEffect } from 'solid-js';import { UpdatesAPI, type UpdateStatus } from '@/api/updates';+import { logger } from '@/utils/logger';interface UpdateProgressModalProps {isOpen: boolean;@@ -57,7 +58,7 @@ export function UpdateProgressModal(props: UpdateProgressModalProps) {}}} catch (error) {- console.error('Failed to poll update status:', error);+ logger.error('Failed to poll update status', error);// If we get errors during update, assume we're restartingconst currentStatus = status();const shouldAssumeRestart =@@ -95,12 +96,12 @@ export function UpdateProgressModal(props: UpdateProgressModalProps) {isHealthy = true;}} catch (error) {- console.warn('Health check request failed, will retry', error);+ logger.warn('Health check request failed, will retry', error);}if (isHealthy) {// Backend is back! Reload the page to get the new version- console.log('Backend is healthy again, reloading...');+ logger.info('Backend is healthy again, reloading...');window.location.reload();return;}@@ -130,17 +131,17 @@ export function UpdateProgressModal(props: UpdateProgressModalProps) {// If websocket reconnected after being disconnected, the backend is likely backif (wsDisconnected() && connected === true && !reconnecting) {- console.log('WebSocket reconnected after restart, verifying health...');+ logger.info('WebSocket reconnected after restart, verifying health...');// Give it a moment for the backend to fully initializesetTimeout(async () => {try {const response = await fetch('/api/health', { cache: 'no-store' });if (response.ok) {- console.log('Backend healthy after websocket reconnect, reloading...');+ logger.info('Backend healthy after websocket reconnect, reloading...');window.location.reload();}} catch (_error) {- console.warn('Health check failed after websocket reconnect, will keep trying');+ logger.warn('Health check failed after websocket reconnect, will keep trying');}}, 1000);}diff --git a/frontend-modern/src/components/icons/AlertsIcon.tsx b/frontend-modern/src/components/icons/AlertsIcon.tsxdeleted file mode 100644index eab71c43e2..0000000000--- a/frontend-modern/src/components/icons/AlertsIcon.tsx+++ /dev/null@@ -1,11 +0,0 @@-import type { Component } from 'solid-js';-import Bell from 'lucide-solid/icons/bell';--interface AlertsIconProps {- class?: string;- title?: string;-}--export const AlertsIcon: Component<AlertsIconProps> = (props) => (- <Bell {...props} strokeWidth={2} />-);diff --git a/frontend-modern/src/components/icons/ApiIcon.tsx b/frontend-modern/src/components/icons/ApiIcon.tsxdeleted file mode 100644index 87672abf83..0000000000--- a/frontend-modern/src/components/icons/ApiIcon.tsx+++ /dev/null@@ -1,27 +0,0 @@-import type { Component } from 'solid-js';--interface ApiIconProps {- class?: string;-}--export const ApiIcon: Component<ApiIconProps> = (props) => (- <svg- class={props.class}- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="1.8"- stroke-linecap="round"- stroke-linejoin="round"- aria-hidden="true"- >- <path d="M4 7v10" />- <path d="M20 7v10" />- <path d="M9 12h6" />- <path d="M12 9v6" />- <rect x="2.5" y="5" width="19" height="14" rx="2" />- </svg>-);--export default ApiIcon;diff --git a/frontend-modern/src/components/icons/DockerIcon.tsx b/frontend-modern/src/components/icons/DockerIcon.tsxdeleted file mode 100644index cadd9a87b1..0000000000--- a/frontend-modern/src/components/icons/DockerIcon.tsx+++ /dev/null@@ -1,20 +0,0 @@-import type { Component } from 'solid-js';-import { siDocker } from 'simple-icons';--interface DockerIconProps {- class?: string;- title?: string;-}--export const DockerIcon: Component<DockerIconProps> = (props) => (- <svg- class={props.class}- role="img"- viewBox="0 0 24 24"- xmlns="http://www.w3.org/2000/svg"- aria-label={props.title ?? 'Docker'}- >- <title>{props.title ?? 'Docker'}</title>- <path d={siDocker.path} fill="currentColor" />- </svg>-);diff --git a/frontend-modern/src/components/icons/HostsIcon.tsx b/frontend-modern/src/components/icons/HostsIcon.tsxdeleted file mode 100644index e589e66616..0000000000--- a/frontend-modern/src/components/icons/HostsIcon.tsx+++ /dev/null@@ -1,10 +0,0 @@-import type { Component } from 'solid-js';-import Monitor from 'lucide-solid/icons/monitor';--interface HostsIconProps {- class?: string;-}--export const HostsIcon: Component<HostsIconProps> = (props) => (- <Monitor class={props.class} />-);diff --git a/frontend-modern/src/components/icons/ProxmoxBackupIcon.tsx b/frontend-modern/src/components/icons/ProxmoxBackupIcon.tsxdeleted file mode 100644index eba22e175b..0000000000--- a/frontend-modern/src/components/icons/ProxmoxBackupIcon.tsx+++ /dev/null@@ -1,20 +0,0 @@-import type { Component } from 'solid-js';-import { siProxmox } from 'simple-icons';--interface ProxmoxBackupIconProps {- class?: string;- title?: string;-}--export const ProxmoxBackupIcon: Component<ProxmoxBackupIconProps> = (props) => (- <svg- class={props.class}- role="img"- viewBox="0 0 24 24"- xmlns="http://www.w3.org/2000/svg"- aria-label={props.title ?? 'Proxmox Backup'}- >- <title>{props.title ?? 'Proxmox Backup'}</title>- <path d={siProxmox.path} fill="currentColor" />- </svg>-);diff --git a/frontend-modern/src/components/icons/ProxmoxIcon.tsx b/frontend-modern/src/components/icons/ProxmoxIcon.tsxindex d6be853ab0..f84b810182 100644--- a/frontend-modern/src/components/icons/ProxmoxIcon.tsx+++ b/frontend-modern/src/components/icons/ProxmoxIcon.tsx@@ -1,11 +1,14 @@import type { Component } from 'solid-js';-import { siProxmox } from 'simple-icons';interface ProxmoxIconProps {class?: string;title?: string;}+// Path data sourced from simple-icons (CC0); inlined to avoid pulling the full dependency.+const PROXMOX_PATH =+ 'M4.928 1.825c-1.09.553-1.09.64-.07 1.78 5.655 6.295 7.004 7.782 7.107 7.782.139.017 7.971-8.542 8.058-8.801.034-.07-.208-.312-.519-.536-.415-.312-.864-.433-1.712-.467-1.59-.104-2.144.242-4.115 2.455-.899 1.003-1.66 1.833-1.66 1.833-.017 0-.76-.813-1.642-1.798S8.473 2.1 8.127 1.91c-.796-.45-2.421-.484-3.2-.086zM1.297 4.367C.45 4.695 0 5.007 0 5.248c0 .121 1.331 1.678 2.94 3.459 1.625 1.78 2.939 3.268 2.939 3.302 0 .035-1.331 1.522-2.94 3.303C1.314 17.11.017 18.683.035 18.822c.086.467 1.504 1.055 2.541 1.055 1.678-.018 2.058-.312 5.603-4.202 1.78-1.954 3.233-3.614 3.233-3.666 0-.069-1.435-1.694-3.199-3.63-2.3-2.508-3.423-3.632-3.96-3.874-.812-.398-2.126-.467-2.956-.138zm18.467.12c-.502.26-1.764 1.505-3.943 3.891-1.763 1.937-3.199 3.562-3.199 3.631 0 .07 1.453 1.712 3.234 3.666 3.544 3.89 3.925 4.184 5.602 4.202 1.038 0 2.455-.588 2.542-1.055.017-.156-1.28-1.712-2.905-3.493-1.608-1.78-2.94-3.285-2.94-3.32 0-.034 1.332-1.539 2.94-3.32C22.72 6.91 24.017 5.352 24 5.214c-.087-.45-1.366-.968-2.473-1.038-.795-.034-1.21.035-1.763.312zM7.954 16.973c-2.144 2.369-3.908 4.374-3.943 4.46-.034.07.208.312.52.537.414.311.864.432 1.711.467 1.574.103 2.161-.26 4.15-2.508.864-.968 1.608-1.78 1.625-1.78s.761.812 1.643 1.798c2.023 2.248 2.559 2.576 4.132 2.49.848-.035 1.297-.156 1.712-.467.311-.225.553-.467.519-.536-.087-.26-7.92-8.819-8.058-8.801-.069 0-1.867 1.954-4.011 4.34z';+export const ProxmoxIcon: Component<ProxmoxIconProps> = (props) => (<svgclass={props.class}@@ -15,6 +18,6 @@ export const ProxmoxIcon: Component<ProxmoxIconProps> = (props) => (aria-label={props.title ?? 'Proxmox'}><title>{props.title ?? 'Proxmox'}</title>- <path d={siProxmox.path} fill="currentColor" />+ <path d={PROXMOX_PATH} fill="currentColor" /></svg>);diff --git a/frontend-modern/src/components/icons/SettingsGearIcon.tsx b/frontend-modern/src/components/icons/SettingsGearIcon.tsxdeleted file mode 100644index 56eb365b20..0000000000--- a/frontend-modern/src/components/icons/SettingsGearIcon.tsx+++ /dev/null@@ -1,11 +0,0 @@-import type { Component } from 'solid-js';-import Settings from 'lucide-solid/icons/settings';--interface SettingsGearIconProps {- class?: string;- title?: string;-}--export const SettingsGearIcon: Component<SettingsGearIconProps> = (props) => (- <Settings {...props} strokeWidth={2} />-);diff --git a/frontend-modern/src/components/shared/AlertIndicators.tsx b/frontend-modern/src/components/shared/AlertIndicators.tsxdeleted file mode 100644index 52cd1387b7..0000000000--- a/frontend-modern/src/components/shared/AlertIndicators.tsx+++ /dev/null@@ -1,156 +0,0 @@-import { Component, createMemo } from 'solid-js';-import type { Alert } from '@/types/api';-import { showTooltip, hideTooltip } from '@/components/shared/Tooltip';-import { useAlertsActivation } from '@/stores/alertsActivation';--const getMetadataUnit = (alert: Alert): string | undefined => {- const rawUnit = alert.metadata?.['unit'];- if (typeof rawUnit === 'string') {- const trimmed = rawUnit.trim();- if (trimmed.length > 0) {- return trimmed;- }- }- return undefined;-};--const formatAlertValue = (alert: Alert): string => {- const metric = alert.type.toLowerCase();- const unitFromMetadata = getMetadataUnit(alert);-- switch (metric) {- case 'temperature':- return `${alert.value.toFixed(1)}°C`;- case 'diskread':- case 'diskwrite':- case 'networkin':- case 'networkout':- return `${alert.value.toFixed(1)} MB/s`;- case 'cpu':- case 'memory':- case 'disk':- case 'usage':- return `${alert.value.toFixed(1)}%`;- default:- if (unitFromMetadata) {- return `${alert.value.toFixed(1)} ${unitFromMetadata}`;- }- return alert.value.toFixed(1);- }-};--const formatAlertThreshold = (alert: Alert): string => {- const metric = alert.type.toLowerCase();- const unitFromMetadata = getMetadataUnit(alert);-- switch (metric) {- case 'temperature':- return `${alert.threshold.toFixed(0)}°C`;- case 'diskread':- case 'diskwrite':- case 'networkin':- case 'networkout':- return `${alert.threshold.toFixed(0)} MB/s`;- case 'cpu':- case 'memory':- case 'disk':- case 'usage':- return `${alert.threshold.toFixed(0)}%`;- default:- if (unitFromMetadata) {- return `${alert.threshold.toFixed(0)} ${unitFromMetadata}`;- }- return alert.threshold.toFixed(0);- }-};--interface AlertIndicatorProps {- severity: 'critical' | 'warning' | null;- alerts?: Alert[];-}--export const AlertIndicator: Component<AlertIndicatorProps> = (props) => {- const alertsActivation = useAlertsActivation();- const alertsEnabled = createMemo(() => alertsActivation.activationState() === 'active');- if (!alertsEnabled() || !props.severity) return null;-- const dotClass = props.severity === 'critical' ? 'bg-red-500 animate-pulse' : 'bg-orange-500';-- const handleMouseEnter = (e: MouseEvent) => {- if (!props.alerts || props.alerts.length === 0) return;- const rect = (e.target as HTMLElement).getBoundingClientRect();- const content = props.alerts- .map(- (alert) => `${alert.type}: ${formatAlertValue(alert)} (threshold: ${formatAlertThreshold(alert)})`,- )- .join('\n');- showTooltip(content, rect.left + rect.width / 2, rect.top, {- align: 'center',- direction: 'up',- maxWidth: 260,- });- };-- const handleMouseLeave = () => {- hideTooltip();- };-- return (- <>- <span- class={`inline-block w-2 h-2 rounded-full ${dotClass}`}- onMouseEnter={handleMouseEnter}- onMouseLeave={handleMouseLeave}- />- </>- );-};--interface AlertCountBadgeProps {- count: number;- severity: 'critical' | 'warning';- alerts?: Alert[];-}--export const AlertCountBadge: Component<AlertCountBadgeProps> = (props) => {- const alertsActivation = useAlertsActivation();- const alertsEnabled = createMemo(() => alertsActivation.activationState() === 'active');- if (!alertsEnabled()) return null;-- const badgeClass =- props.severity === 'critical' ? 'bg-red-500 text-white' : 'bg-orange-500 text-white';-- const handleMouseEnter = (e: MouseEvent) => {- if (!props.alerts || props.alerts.length === 0) return;- const rect = (e.target as HTMLElement).getBoundingClientRect();- const header = `${props.count} Active Alert${props.count === 1 ? '' : 's'}:`;- const details = props.alerts- .map(- (alert, index) =>- `${index + 1}. ${alert.type}: ${formatAlertValue(alert)} (threshold: ${formatAlertThreshold(alert)})`,- )- .join('\n');- const content = [header, details].filter(Boolean).join('\n');- showTooltip(content, rect.left + rect.width / 2, rect.top, {- align: 'center',- direction: 'up',- maxWidth: 300,- });- };-- const handleMouseLeave = () => {- hideTooltip();- };-- return (- <>- <span- class={`inline-flex items-center justify-center min-w-[20px] h-5 px-1 text-xs font-medium rounded-full ${badgeClass}`}- onMouseEnter={handleMouseEnter}- onMouseLeave={handleMouseLeave}- >- {props.count}- </span>- </>- );-};diff --git a/frontend-modern/src/components/shared/AnimatedMetric.tsx b/frontend-modern/src/components/shared/AnimatedMetric.tsxdeleted file mode 100644index a273ea34c1..0000000000--- a/frontend-modern/src/components/shared/AnimatedMetric.tsx+++ /dev/null@@ -1,83 +0,0 @@-import { Component, createEffect, createSignal, onCleanup } from 'solid-js';-import { formatBytes } from '@/utils/format';--interface AnimatedMetricProps {- value: number;- formatter?: (value: number) => string;- className?: string;-}--export const AnimatedMetric: Component<AnimatedMetricProps> = (props) => {- const [displayValue, setDisplayValue] = createSignal(props.value);- const [oldValue, setOldValue] = createSignal(props.value);- const [showGhost, setShowGhost] = createSignal(false);- const [animClass, setAnimClass] = createSignal('');- let timeoutId: number;- let hasInitialized = false;-- createEffect(() => {- const newVal = props.value;- const prevVal = displayValue();-- // Skip first render- if (!hasInitialized) {- hasInitialized = true;- setDisplayValue(newVal);- setOldValue(newVal);- return;- }-- // Only animate if value changed- if (newVal !== prevVal) {- clearTimeout(timeoutId);-- // Store old value for ghost- setOldValue(prevVal);- setShowGhost(true);-- // Set animation direction- if (newVal > prevVal) {- setAnimClass('up');- console.log('[AnimatedMetric] Going UP:', prevVal, '->', newVal);- } else {- setAnimClass('down');- console.log('[AnimatedMetric] Going DOWN:', prevVal, '->', newVal);- }-- // Update to new value- setDisplayValue(newVal);-- // Remove ghost after animation- timeoutId = window.setTimeout(() => {- setShowGhost(false);- setAnimClass('');- }, 500);- }- });-- onCleanup(() => clearTimeout(timeoutId));-- const format = props.formatter || ((v: number) => formatBytes(v) + '/s');-- return (- <div- class="metric-container"- style="position: relative; display: inline-block; overflow: visible;"- >- {showGhost() && (- <span- class={`metric-ghost metric-ghost-${animClass()}`}- style="position: absolute; top: 0; left: 0; z-index: 1;"- >- {format(oldValue())}- </span>- )}- <span- class={`metric-value ${showGhost() ? `metric-entering-${animClass()}` : ''}`}- style="position: relative; z-index: 2; display: inline-block;"- >- {format(displayValue())}- </span>- </div>- );-};diff --git a/frontend-modern/src/components/shared/CopyButton.tsx b/frontend-modern/src/components/shared/CopyButton.tsxindex 8272c75b36..d6b9309693 100644--- a/frontend-modern/src/components/shared/CopyButton.tsx+++ b/frontend-modern/src/components/shared/CopyButton.tsx@@ -1,5 +1,7 @@import { createSignal, onCleanup, splitProps } from 'solid-js';import type { JSX } from 'solid-js';+import { copyToClipboard } from '@/utils/clipboard';+import { logger } from '@/utils/logger';interface CopyButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {text: string;@@ -12,39 +14,6 @@ export function CopyButton(props: CopyButtonProps) {const [copied, setCopied] = createSignal(false);let resetTimeout: number | undefined;- const copyText = async (text: string): Promise<boolean> => {- if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {- try {- await navigator.clipboard.writeText(text);- return true;- } catch (error) {- console.warn('Clipboard API copy failed, attempting fallback copy.', error);- }- }-- if (typeof document === 'undefined') {- return false;- }-- const textarea = document.createElement('textarea');- textarea.value = text;- textarea.style.position = 'fixed';- textarea.style.left = '-999999px';- textarea.style.top = '-999999px';- document.body.appendChild(textarea);- textarea.focus();- textarea.select();-- try {- return document.execCommand('copy');- } catch (error) {- console.error('Fallback copy failed', error);- return false;- } finally {- document.body.removeChild(textarea);- }- };-const handleClick = async (event: MouseEvent) => {const handler = local.onClick as| ((event: MouseEvent) => void)@@ -60,7 +29,7 @@ export function CopyButton(props: CopyButtonProps) {return;}- const success = await copyText(local.text);+ const success = await copyToClipboard(local.text);if (success) {setCopied(true);window.clearTimeout(resetTimeout);@@ -69,7 +38,7 @@ export function CopyButton(props: CopyButtonProps) {try {local.onCopied();} catch (error) {- console.error('onCopied handler failed', error);+ logger.error('onCopied handler failed', error);}}}diff --git a/frontend-modern/src/components/shared/Form.ts b/frontend-modern/src/components/shared/Form.tsindex 1121186f4b..0ea50c186c 100644--- a/frontend-modern/src/components/shared/Form.ts+++ b/frontend-modern/src/components/shared/Form.ts@@ -35,10 +35,6 @@ export function controlClass(extra?: string) {return join(baseControl, extra);}-export function helpTextClass(extra?: string) {- return join(baseHelp, extra);-}-export default {formSection,formField,@@ -54,5 +50,4 @@ export default {formCheckbox,labelClass,controlClass,- helpTextClass,};diff --git a/frontend-modern/src/constants.ts b/frontend-modern/src/constants.tsindex e0f9fa677a..2ccda07438 100644--- a/frontend-modern/src/constants.ts+++ b/frontend-modern/src/constants.ts@@ -9,31 +9,6 @@ export const POLLING_INTERVALS = {TOAST_DURATION: 5000, // 5 seconds - default toast notification duration} as const;-// Display thresholds (percentages)-export const THRESHOLDS = {- WARNING: 60, // Yellow warning threshold- CRITICAL: 80, // Orange critical threshold- DANGER: 90, // Red danger threshold-} as const;--// Network and I/O metrics thresholds (MB/s)-export const IO_THRESHOLDS = {- LOW: 1,- MEDIUM: 10,- HIGH: 50,- VERY_HIGH: 100,-} as const;--// Animation durations (in milliseconds)-export const ANIMATIONS = {- TOAST_SLIDE: 300, // Toast slide in/out animation-} as const;--// UI configuration-export const UI = {- DEBOUNCE_DELAY: 300, // 300ms - input debounce delay-} as const;-// WebSocket configurationexport const WEBSOCKET = {PING_INTERVAL: 25000, // 25 seconds - WebSocket ping interval@@ -43,27 +18,3 @@ export const WEBSOCKET = {ERROR: 'error',} as const,} as const;--// Storage keys for localStorage-export const STORAGE_KEYS = {- DARK_MODE: 'darkMode',- VIEW_MODE: 'viewMode',- DISPLAY_MODE: 'displayMode',- SORT_KEY: 'sortKey',- SORT_DIRECTION: 'sortDirection',- ALERT_THRESHOLDS: 'alertThresholds',- ACTIVE_TAB: 'activeTab',-} as const;--// File size units-export const FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'] as const;--// Log levels for the logger-export const LOG_LEVELS = {- DEBUG: 0,- INFO: 1,- WARN: 2,- ERROR: 3,-} as const;--export type LogLevel = keyof typeof LOG_LEVELS;diff --git a/frontend-modern/src/constants/apiScopes.ts b/frontend-modern/src/constants/apiScopes.tsindex d4f9639a9d..b0788583ad 100644--- a/frontend-modern/src/constants/apiScopes.ts+++ b/frontend-modern/src/constants/apiScopes.ts@@ -28,14 +28,14 @@ export const API_SCOPE_OPTIONS: APIScopeOption[] = [},{value: DOCKER_REPORT_SCOPE,- label: 'Docker agent reporting',- description: 'Allow the Docker agent to submit host and container telemetry.',+ label: 'Container agent reporting',+ description: 'Allow the container agent to submit host and runtime telemetry.',group: 'Agents',},{value: DOCKER_MANAGE_SCOPE,- label: 'Docker lifecycle management',- description: 'Enable agent-triggered container commands and host actions.',+ label: 'Container lifecycle management',+ description: 'Enable agent-triggered runtime commands and host actions.',group: 'Agents',},{diff --git a/frontend-modern/src/hooks/useIntersectionObserver.ts b/frontend-modern/src/hooks/useIntersectionObserver.tsdeleted file mode 100644index 02e380cca9..0000000000--- a/frontend-modern/src/hooks/useIntersectionObserver.ts+++ /dev/null@@ -1,45 +0,0 @@-import { onMount, onCleanup, createSignal } from 'solid-js';--interface UseIntersectionObserverOptions {- threshold?: number;- rootMargin?: string;- root?: Element | null;-}--export function useIntersectionObserver(- ref: () => HTMLElement | undefined,- options: UseIntersectionObserverOptions = {},-) {- const [isIntersecting, setIsIntersecting] = createSignal(false);- let observer: IntersectionObserver | undefined;-- onMount(() => {- const element = ref();- if (!element || typeof window === 'undefined' || !window.IntersectionObserver) {- // If IntersectionObserver is not supported, assume element is visible- setIsIntersecting(true);- return;- }-- observer = new IntersectionObserver(- ([entry]) => {- setIsIntersecting(entry.isIntersecting);- },- {- threshold: options.threshold || 0,- rootMargin: options.rootMargin || '50px',- root: options.root || null,- },- );-- observer.observe(element);- });-- onCleanup(() => {- if (observer) {- observer.disconnect();- }- });-- return isIntersecting;-}diff --git a/frontend-modern/src/hooks/usePersistentSignal.ts b/frontend-modern/src/hooks/usePersistentSignal.tsindex 7f3a0e9cd3..c27bce7ee8 100644--- a/frontend-modern/src/hooks/usePersistentSignal.ts+++ b/frontend-modern/src/hooks/usePersistentSignal.ts@@ -1,4 +1,5 @@import { Accessor, Setter, createEffect, createSignal } from 'solid-js';+import { logger } from '@/utils/logger';export type PersistentSignalOptions<T> = {/**@@ -45,7 +46,7 @@ export function usePersistentSignal<T>(}return deserialize(raw);} catch (err) {- console.warn(`[usePersistentSignal] Failed to read "${key}" from storage`, err);+ logger.warn(`[usePersistentSignal] Failed to read "${key}" from storage`, err);return defaultValue;}})();@@ -66,10 +67,9 @@ export function usePersistentSignal<T>(storage.setItem(key, serialize(current));}} catch (err) {- console.warn(`[usePersistentSignal] Failed to persist "${key}"`, err);+ logger.warn(`[usePersistentSignal] Failed to persist "${key}"`, err);}});return [value, setValue];}-diff --git a/frontend-modern/src/hooks/useScopedTokenManager.ts b/frontend-modern/src/hooks/useScopedTokenManager.tsdeleted file mode 100644index fa029f2544..0000000000--- a/frontend-modern/src/hooks/useScopedTokenManager.ts+++ /dev/null@@ -1,189 +0,0 @@-import { createEffect, createMemo, createSignal, onCleanup } from 'solid-js';-import type { APITokenRecord, CreateAPITokenResponse } from '@/api/security';-import { SecurityAPI } from '@/api/security';--export interface UseScopedTokenManagerOptions {- scope: string | readonly string[];- storageKey: string;- legacyKeys?: readonly string[];-}--export interface ScopedTokenManager {- token: () => string | null;- setToken: (value: string | null) => void;- hasStoredToken: () => boolean;- availableTokens: () => APITokenRecord[];- loadingTokens: () => boolean;- tokensLoaded: () => boolean;- tokensError: () => boolean;- tokenAccessDenied: () => boolean;- loadTokens: () => Promise<void>;- retryLoadTokens: () => Promise<void>;- isGeneratingToken: () => boolean;- generateToken: (name: string) => Promise<CreateAPITokenResponse>;-}--const tokenMatchesScopes = (token: APITokenRecord, requiredScopes: string[]): boolean => {- const scopes = token.scopes ?? [];- if (scopes.length === 0) {- // Legacy tokens without scopes behave as wildcard.- return true;- }- if (scopes.includes('*')) {- return true;- }- return requiredScopes.every((scope) => scopes.includes(scope));-};--const readStoredToken = (primaryKey: string, legacyKeys: readonly string[] = []) => {- if (typeof window === 'undefined') {- return null;- }- let storage: Storage | undefined;- try {- storage = window.sessionStorage;- } catch {- storage = undefined;- }- if (!storage) {- return null;- }- const primary = storage.getItem(primaryKey);- if (primary) {- return primary;- }- for (const key of legacyKeys) {- const value = storage.getItem(key);- if (value) {- return value;- }- }- return null;-};--export const useScopedTokenManager = (options: UseScopedTokenManagerOptions): ScopedTokenManager => {- const requiredScopes = Array.isArray(options.scope) ? [...options.scope] : [options.scope];- const { storageKey, legacyKeys = [] } = options;-- const [token, setTokenState] = createSignal<string | null>(readStoredToken(storageKey, legacyKeys));- const [availableTokens, setAvailableTokens] = createSignal<APITokenRecord[]>([]);- const [loadingTokens, setLoadingTokens] = createSignal(false);- const [tokensLoaded, setTokensLoaded] = createSignal(false);- const [tokensError, setTokensError] = createSignal(false);- const [tokenAccessDenied, setTokenAccessDenied] = createSignal(false);- const [isGeneratingToken, setIsGeneratingToken] = createSignal(false);-- createEffect(() => {- const current = token();- if (typeof window === 'undefined') {- return;- }- let storage: Storage | undefined;- try {- storage = window.sessionStorage;- } catch {- storage = undefined;- }- try {- if (current) {- storage?.setItem(storageKey, current);- try {- window.dispatchEvent(new StorageEvent('storage', { key: storageKey, newValue: current }));- } catch (eventErr) {- console.debug('Unable to dispatch storage event for token update', eventErr);- }- } else {- storage?.removeItem(storageKey);- try {- window.dispatchEvent(new StorageEvent('storage', { key: storageKey, newValue: null }));- } catch (eventErr) {- console.debug('Unable to dispatch storage event for token removal', eventErr);- }- }- } catch (err) {- console.warn('Unable to persist API token in sessionStorage', err);- }- });-- if (typeof window !== 'undefined') {- const handleStorage = (event: StorageEvent) => {- if (!event.key) return;- if (event.key === storageKey || legacyKeys.includes(event.key)) {- const updated = readStoredToken(storageKey, legacyKeys);- setTokenState(updated);- }- };- window.addEventListener('storage', handleStorage);- onCleanup(() => window.removeEventListener('storage', handleStorage));- }-- const loadTokens = async () => {- if (loadingTokens()) return;- setLoadingTokens(true);- setTokensError(false);- setTokensLoaded(false);- try {- const tokens = await SecurityAPI.listTokens();- const filtered = tokens.filter((candidate) => tokenMatchesScopes(candidate, requiredScopes));- filtered.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());- setAvailableTokens(filtered);- setTokenAccessDenied(false);- setTokensLoaded(true);- } catch (err) {- setTokensError(true);- if (err instanceof Error && /authentication required/i.test(err.message)) {- setTokenAccessDenied(true);- }- throw err;- } finally {- setLoadingTokens(false);- }- };-- const retryLoadTokens = async () => {- setTokensLoaded(false);- await loadTokens();- };-- const generateToken = async (name: string) => {- if (isGeneratingToken()) {- throw new Error('Token generation already in progress');- }- setIsGeneratingToken(true);- try {- const response = await SecurityAPI.createToken(name, requiredScopes);- const { token: newToken, record } = response;- setTokenState(newToken);- setAvailableTokens((current) => {- const filtered = current.filter((item) => item.id !== record.id);- return [record, ...filtered];- });- setTokenAccessDenied(false);- return response;- } catch (err) {- if (err instanceof Error && /authentication required|forbidden/i.test(err.message)) {- setTokenAccessDenied(true);- }- throw err;- } finally {- setIsGeneratingToken(false);- }- };-- const hasStoredToken = createMemo(() => Boolean(token()));-- return {- token,- setToken: setTokenState,- hasStoredToken,- availableTokens,- loadingTokens,- tokensLoaded,- tokensError,- tokenAccessDenied,- loadTokens,- retryLoadTokens,- isGeneratingToken,- generateToken,- };-};diff --git a/frontend-modern/src/index.tsx b/frontend-modern/src/index.tsxindex 16b2ff849c..6dbdac4c39 100644--- a/frontend-modern/src/index.tsx+++ b/frontend-modern/src/index.tsx@@ -3,8 +3,6 @@ import { render } from 'solid-js/web';import './index.css';import './styles/animations.css';import App from './App';-// import App from './Test';-// import App from './SimpleApp';import { logger } from './utils/logger';const root = document.getElementById('root');@@ -15,17 +13,15 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) {);}-// Initialize app with logging-console.log('[Index] Starting Pulse app...');logger.info('Pulse monitoring dashboard starting');if (root) {- console.log('[Index] Root element found, rendering App...');+ logger.debug('[Index] Root element found, rendering App...');try {render(() => <App />, root);- console.log('[Index] Render call completed');+ logger.debug('[Index] Render call completed');} catch (error) {- console.error('[Index] Render error:', error);+ logger.error('[Index] Render error', error);// Show error on pageroot.innerHTML = `<div style="color: red; padding: 20px;"><h1>Error Loading App</h1>@@ -33,5 +29,5 @@ if (root) {</div>`;}} else {- console.error('[Index] Root element not found!');+ logger.error('[Index] Root element not found', new Error('root element missing'));}diff --git a/frontend-modern/src/pages/Alerts.tsx b/frontend-modern/src/pages/Alerts.tsxindex 5778f9dc8c..c8671c2b32 100644--- a/frontend-modern/src/pages/Alerts.tsx+++ b/frontend-modern/src/pages/Alerts.tsx@@ -21,6 +21,7 @@ import type { HysteresisThreshold } from '@/types/alerts';import type { Alert, State, VM, Container, DockerHost, DockerContainer, Host } from '@/types/api';import { useNavigate, useLocation } from '@solidjs/router';import { useAlertsActivation } from '@/stores/alertsActivation';+import { logger } from '@/utils/logger';import LayoutDashboard from 'lucide-solid/icons/layout-dashboard';import History from 'lucide-solid/icons/history';import Gauge from 'lucide-solid/icons/gauge';@@ -349,7 +350,7 @@ export function Alerts() {try {await alertsActivation.refreshActiveAlerts();} catch (error) {- console.error('Failed to refresh alerts after activation', error);+ logger.error('Failed to refresh alerts after activation', error);}} else {showError('Unable to activate alerts. Please try again.');@@ -371,13 +372,13 @@ export function Alerts() {try {await alertsActivation.refreshActiveAlerts();} catch (error) {- console.error('Failed to refresh alerts after deactivation', error);+ logger.error('Failed to refresh alerts after deactivation', error);}} else {showError('Unable to deactivate alerts. Please try again.');}} catch (error) {- console.error('Deactivate alerts failed', error);+ logger.error('Deactivate alerts failed', error);showError('Unable to deactivate alerts. Please try again.');} finally {setIsSwitchingActivation(false);@@ -550,7 +551,7 @@ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>(id: key,name: dockerHost.displayName?.trim() || dockerHost.hostname || dockerHost.id,type: 'dockerHost',- resourceType: 'Docker Host',+ resourceType: 'Container Host',disableConnectivity: thresholds.disableConnectivity || false,thresholds: extractTriggerValues(thresholds),});@@ -566,7 +567,7 @@ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>(id: key,name: containerName,type: 'dockerContainer',- resourceType: 'Docker Container',+ resourceType: 'Container',node: host.hostname,instance: host.displayName,disabled: thresholds.disabled || false,@@ -592,7 +593,7 @@ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>(id: key,name: containerId,type: 'dockerContainer',- resourceType: 'Docker Container',+ resourceType: 'Container',node: hostId,disabled: thresholds.disabled || false,disableConnectivity: thresholds.disableConnectivity || false,@@ -611,7 +612,7 @@ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>(id: hostId || key,name: hostId || key,type: 'dockerHost',- resourceType: 'Docker Host',+ resourceType: 'Container Host',disableConnectivity: thresholds.disableConnectivity || false,thresholds: extractTriggerValues(thresholds),});@@ -1069,7 +1070,7 @@ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>(rateLimit: 60,});} catch (emailErr) {- console.error('Failed to load email configuration:', emailErr);+ logger.error('Failed to load email configuration:', emailErr);}try {@@ -1090,14 +1091,14 @@ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>(skipTlsVerify: Boolean(appriseData.skipTlsVerify),});} catch (appriseErr) {- console.error('Failed to load Apprise configuration:', appriseErr);+ logger.error('Failed to load Apprise configuration:', appriseErr);}if (options.notify) {showSuccess('Changes discarded');}} catch (err) {- console.error('Failed to load alert configuration:', err);+ logger.error('Failed to load alert configuration:', err);if (options.notify) {showError('Failed to reload configuration');}@@ -1135,7 +1136,7 @@ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>(});}).catch((err) => {- console.error('Failed to reload email configuration:', err);+ logger.error('Failed to reload email configuration:', err);});NotificationsAPI.getAppriseConfig()@@ -1157,7 +1158,7 @@ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>(});}).catch((err) => {- console.error('Failed to reload Apprise configuration:', err);+ logger.error('Failed to reload Apprise configuration:', err);});}});@@ -1630,7 +1631,7 @@ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>(setHasUnsavedChanges(false);showSuccess('Configuration saved successfully!');} catch (err) {- console.error('Failed to save configuration:', err);+ logger.error('Failed to save configuration:', err);showError(err instanceof Error ? err.message : 'Failed to save configuration');}}}@@ -2111,7 +2112,7 @@ function OverviewTab(props: {);}} catch (error) {- console.error('Bulk acknowledge failed', error);+ logger.error('Bulk acknowledge failed', error);showError('Failed to acknowledge alerts');} finally {setBulkAckProcessing(false);@@ -2263,7 +2264,7 @@ function OverviewTab(props: {showSuccess('Alert acknowledged');}} catch (err) {- console.error(+ logger.error(`Failed to ${wasAcknowledged ? 'unacknowledge' : 'acknowledge'} alert:`,err,);@@ -2312,6 +2313,7 @@ interface ThresholdsTabProps {dockerDefaults: () => {cpu: number;memory: number;+ disk: number;restartCount: number;restartWindow: number;memoryWarnPct: number;@@ -2357,6 +2359,7 @@ interface ThresholdsTabProps {| {cpu: number;memory: number;+ disk: number;restartCount: number;restartWindow: number;memoryWarnPct: number;@@ -2367,6 +2370,7 @@ interface ThresholdsTabProps {| ((prev: {cpu: number;memory: number;+ disk: number;restartCount: number;restartWindow: number;memoryWarnPct: number;@@ -2376,6 +2380,7 @@ interface ThresholdsTabProps {}) => {cpu: number;memory: number;+ disk: number;restartCount: number;restartWindow: number;memoryWarnPct: number;@@ -2591,7 +2596,7 @@ function DestinationsTab(props: DestinationsTabProps) {})),);} catch (err) {- console.error('Failed to load webhooks:', err);+ logger.error('Failed to load webhooks:', err);}});@@ -2606,7 +2611,7 @@ function DestinationsTab(props: DestinationsTabProps) {});showSuccess('Test email sent successfully!', 'Check your inbox.');} catch (err) {- console.error('Failed to send test email:', err);+ logger.error('Failed to send test email:', err);showError('Failed to send test email', err instanceof Error ? err.message : 'Unknown error');} finally {setTestingEmail(false);@@ -2862,7 +2867,7 @@ mailto://[email protected]`}setWebhooks([...webhooks(), created]);showSuccess('Webhook added successfully');} catch (err) {- console.error('Failed to add webhook:', err);+ logger.error('Failed to add webhook:', err);showError(err instanceof Error ? err.message : 'Failed to add webhook');}}}@@ -2872,7 +2877,7 @@ mailto://[email protected]`}setWebhooks(webhooks().map((w) => (w.id === webhook.id ? updated : w)));showSuccess('Webhook updated successfully');} catch (err) {- console.error('Failed to update webhook:', err);+ logger.error('Failed to update webhook:', err);showError(err instanceof Error ? err.message : 'Failed to update webhook');}}}@@ -2882,7 +2887,7 @@ mailto://[email protected]`}setWebhooks(webhooks().filter((w) => w.id !== id));showSuccess('Webhook deleted successfully');} catch (err) {- console.error('Failed to delete webhook:', err);+ logger.error('Failed to delete webhook:', err);showError(err instanceof Error ? err.message : 'Failed to delete webhook');}}}@@ -3746,7 +3751,7 @@ function HistoryTab() {}} catch (err) {if (requestId === fetchRequestId) {- console.error('Failed to load alert history:', err);+ logger.error('Failed to load alert history:', err);}} finally {if (requestId === fetchRequestId) {@@ -3917,13 +3922,13 @@ function HistoryTab() {host.agentId === resourceName ||host.id === resourceName,);- if (dockerHost) return 'Docker Host';+ if (dockerHost) return 'Container Host';// Docker containers (via known hosts)const dockerContainer = state.dockerHosts?.flatMap((host) => host.containers || []).find((c) => c.name === resourceName || c.id === resourceName);- if (dockerContainer) return 'Docker Container';+ if (dockerContainer) return 'Container';// PBS instancesconst pbsInstance = state.pbs?.find(@@ -4776,7 +4781,7 @@ function HistoryTab() {setAlertHistory([]);// Alert history cleared successfully} catch (err) {- console.error('Error clearing alert history:', err);+ logger.error('Error clearing alert history:', err);showError('Error clearing alert history','Please check your connection and try again.',diff --git a/frontend-modern/src/stores/alertsActivation.ts b/frontend-modern/src/stores/alertsActivation.tsindex d61e229d97..e20349dd24 100644--- a/frontend-modern/src/stores/alertsActivation.ts+++ b/frontend-modern/src/stores/alertsActivation.ts@@ -3,6 +3,7 @@ import { AlertsAPI } from '@/api/alerts';import type { AlertConfig, ActivationState as ActivationStateType } from '@/types/alerts';import type { Alert } from '@/types/api';import { setGlobalActivationState } from '@/utils/alertsActivation';+import { logger } from '@/utils/logger';// Create signals for activation stateconst [config, setConfig] = createSignal<AlertConfig | null>(null);@@ -34,7 +35,7 @@ const refreshConfig = async (): Promise<void> => {setConfig(alertConfig);applyActivationState(alertConfig.activationState || 'active');} catch (error) {- console.error('Failed to fetch alert config:', error);+ logger.error('Failed to fetch alert config:', error);setLastError(error instanceof Error ? error.message : 'Unknown error');} finally {setIsLoading(false);@@ -47,7 +48,7 @@ const refreshActiveAlerts = async (): Promise<void> => {const alerts = await AlertsAPI.getActive();setActiveAlerts(alerts);} catch (error) {- console.error('Failed to fetch active alerts:', error);+ logger.error('Failed to fetch active alerts:', error);// Don't set error state for this - it's not critical}};@@ -66,7 +67,7 @@ const activate = async (): Promise<boolean> => {}return false;} catch (error) {- console.error('Failed to activate alerts:', error);+ logger.error('Failed to activate alerts:', error);setLastError(error instanceof Error ? error.message : 'Unknown error');return false;} finally {@@ -91,7 +92,7 @@ const updateActivationState = async (state: ActivationStateType): Promise<booleaapplyActivationState(state);return true;} catch (error) {- console.error('Failed to update activation state:', error);+ logger.error('Failed to update activation state:', error);setLastError(error instanceof Error ? error.message : 'Unknown error');return false;} finally {diff --git a/frontend-modern/src/stores/updates.ts b/frontend-modern/src/stores/updates.tsindex c20643ea53..633604cd07 100644--- a/frontend-modern/src/stores/updates.ts+++ b/frontend-modern/src/stores/updates.ts@@ -1,8 +1,10 @@import { createSignal } from 'solid-js';import { UpdatesAPI } from '@/api/updates';import type { UpdateInfo, VersionInfo } from '@/api/updates';+import { getPulseHostname } from '@/utils/url';+import { logger } from '@/utils/logger';+import { STORAGE_KEYS } from '@/utils/localStorage';-const STORAGE_KEY = 'pulse-updates';const CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24 hoursinterface UpdateState {@@ -14,12 +16,12 @@ interface UpdateState {// Load state from localStorageconst loadState = (): UpdateState => {try {- const stored = localStorage.getItem(STORAGE_KEY);+ const stored = localStorage.getItem(STORAGE_KEYS.UPDATES);if (stored) {return JSON.parse(stored);}} catch (e) {- console.error('Failed to load update state:', e);+ logger.error('Failed to load update state:', e);}return { lastCheck: 0 };};@@ -27,9 +29,9 @@ const loadState = (): UpdateState => {// Save state to localStorageconst saveState = (state: UpdateState) => {try {- localStorage.setItem(STORAGE_KEY, JSON.stringify(state));+ localStorage.setItem(STORAGE_KEYS.UPDATES, JSON.stringify(state));} catch (e) {- console.error('Failed to save update state:', e);+ logger.error('Failed to save update state:', e);}};@@ -76,7 +78,7 @@ const checkForUpdates = async (force = false): Promise<void> => {}} catch (e) {// If we can't get version, continue with normal check- console.error('Failed to verify version for cache:', e);+ logger.error('Failed to verify version for cache:', e);}} else {return;@@ -134,7 +136,7 @@ const checkForUpdates = async (force = false): Promise<void> => {updateInfo: info,});} catch (error) {- console.error('Failed to check for updates:', error);+ logger.error('Failed to check for updates:', error);setLastError(error instanceof Error ? error.message : 'Failed to check for updates');setUpdateAvailable(false);} finally {@@ -206,10 +208,12 @@ declare global {}}+const pulseHostname = getPulseHostname();+if (import.meta.env.DEV ||- window.location.hostname === 'localhost' ||- window.location.hostname.startsWith('192.168')+ pulseHostname === 'localhost' ||+ pulseHostname.startsWith('192.168')) {window.updateStore = updateStore;}diff --git a/frontend-modern/src/stores/websocket-global.ts b/frontend-modern/src/stores/websocket-global.tsindex 484d34e88e..799f8c2cbe 100644--- a/frontend-modern/src/stores/websocket-global.ts+++ b/frontend-modern/src/stores/websocket-global.ts@@ -1,4 +1,5 @@import { createWebSocketStore } from './websocket';+import { getPulseWebSocketUrl } from '@/utils/url';// Store the instance on window to survive hot reloadsdeclare global {@@ -9,9 +10,7 @@ declare global {export function getGlobalWebSocketStore() {if (!window.__pulseWsStore) {- const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';- // Use relative URL that works behind proxies- const wsUrl = `${protocol}//${window.location.host}/ws`;+ const wsUrl = getPulseWebSocketUrl();window.__pulseWsStore = createWebSocketStore(wsUrl);}diff --git a/frontend-modern/src/stores/websocket.ts b/frontend-modern/src/stores/websocket.tsindex 129727fd7a..722fbd584f 100644--- a/frontend-modern/src/stores/websocket.ts+++ b/frontend-modern/src/stores/websocket.ts@@ -331,7 +331,9 @@ export function createWebSocketStore(url: string) {// Only update if we have actual data, don't overwrite with empty arraysif (message.data.nodes !== undefined) {- console.log('[WebSocket] Updating nodes:', message.data.nodes?.length || 0);+ logger.debug('[WebSocket] Updating nodes', {+ count: message.data.nodes?.length || 0,+ });setState('nodes', message.data.nodes);}if (message.data.vms !== undefined) {@@ -405,25 +407,30 @@ export function createWebSocketStore(url: string) {message.type === WEBSOCKET.MESSAGE_TYPES.INITIAL_STATE;if (shouldApplyEmptyState) {- console.log('[WebSocket] Updating dockerHosts:', incomingHosts.length, 'hosts');+ logger.debug('[WebSocket] Updating dockerHosts', {+ count: incomingHosts.length,+ });setState('dockerHosts', mergeDockerHostRevocations(incomingHosts));} else {- console.debug(- '[WebSocket] Skipping transient empty dockerHosts payload',- consecutiveEmptyDockerUpdates,- );+ logger.debug('[WebSocket] Skipping transient empty dockerHosts payload', {+ streak: consecutiveEmptyDockerUpdates,+ });}} else {consecutiveEmptyDockerUpdates = 0;hasReceivedNonEmptyDockerHosts = true;- console.log('[WebSocket] Updating dockerHosts:', incomingHosts.length, 'hosts');+ logger.debug('[WebSocket] Updating dockerHosts', {+ count: incomingHosts.length,+ });setState('dockerHosts', mergeDockerHostRevocations(incomingHosts));}} else {- console.warn('[WebSocket] Received non-array dockerHosts:', typeof message.data.dockerHosts);+ logger.warn('[WebSocket] Received non-array dockerHosts payload', {+ type: typeof message.data.dockerHosts,+ });}} else if (message.data.dockerHosts === null) {- console.log('[WebSocket] Received null dockerHosts, ignoring');+ logger.debug('[WebSocket] Received null dockerHosts payload');}if (message.data.hosts !== undefined && message.data.hosts !== null) {if (Array.isArray(message.data.hosts)) {diff --git a/frontend-modern/src/types/api.ts b/frontend-modern/src/types/api.tsindex d4475aa94d..1d9a885599 100644--- a/frontend-modern/src/types/api.ts+++ b/frontend-modern/src/types/api.ts@@ -134,6 +134,8 @@ export interface DockerHost {os?: string;kernelVersion?: string;architecture?: string;+ runtime?: string;+ runtimeVersion?: string;dockerVersion?: string;cpus: number;totalMemoryBytes: number;@@ -261,6 +263,7 @@ export interface DockerContainer {rootFilesystemBytes?: number;blockIo?: DockerContainerBlockIO;mounts?: DockerContainerMount[];+ podman?: PodmanContainerMetadata;}export interface DockerContainerPort {@@ -294,6 +297,19 @@ export interface DockerContainerMount {driver?: string;}+export interface PodmanContainerMetadata {+ podName?: string;+ podId?: string;+ infra?: boolean;+ composeProject?: string;+ composeService?: string;+ composeWorkdir?: string;+ composeConfigHash?: string;+ autoUpdatePolicy?: string;+ autoUpdateRestart?: string;+ userNamespace?: string;+}+export interface Host {id: string;hostname: string;diff --git a/frontend-modern/src/types/monitoring.ts b/frontend-modern/src/types/monitoring.tsdeleted file mode 100644index c7775ec45c..0000000000--- a/frontend-modern/src/types/monitoring.ts+++ /dev/null@@ -1,193 +0,0 @@-// Monitoring data types--export interface CPUInfo {- usage: number;- cores: number;- sockets: number;- model: string;-}--export interface MemoryInfo {- used: number;- total: number;- free: number;- usage: number;-}--export interface DiskInfo {- used: number;- total: number;- free: number;- usage: number;- device?: string;- filesystem?: string;-}--export interface NetworkInfo {- in: number;- out: number;- device?: string;-}--export interface Node {- id: string;- name: string;- displayName?: string;- type: string;- status: 'online' | 'offline' | 'unknown';- instance: string;- uptime: number;- cpu: CPUInfo;- memory: MemoryInfo;- disk?: DiskInfo;- network?: NetworkInfo;- loadAverage?: [number, number, number];- kernelVersion?: string;-}--export interface GuestNetworkInterface {- name?: string;- mac?: string;- addresses?: string[];- rxBytes?: number;- txBytes?: number;-}--export interface Guest {- id: string;- vmid: number;- name: string;- node: string;- type: 'qemu' | 'lxc';- status: 'running' | 'stopped' | 'paused' | 'suspended';- instance: string;- uptime?: number;- cpu: {- usage: number;- cores: number;- limit?: number;- };- memory: {- used: number;- total: number;- usage: number;- };- disk: {- read: number;- write: number;- used?: number;- total?: number;- };- network: {- in: number;- out: number;- };- osName?: string;- osVersion?: string;- agentVersion?: string;- ipAddresses?: string[];- networkInterfaces?: GuestNetworkInterface[];- template?: boolean;- haState?: string;- protection?: boolean;- tags?: string[];-}--export type VM = Guest & { type: 'qemu' };-export type Container = Guest & { type: 'lxc' };--export interface Storage {- id: string;- name: string;- type: string;- status: 'online' | 'offline' | 'unknown';- node: string;- instance: string;- used: number;- total: number;- available: number;- usage: number;- content: string[];- shared?: boolean;- enabled?: boolean;-}--export interface CephCluster {- id: string;- instance: string;- name: string;- fsid?: string;- health: string;- healthMessage?: string;- totalBytes: number;- usedBytes: number;- availableBytes: number;- usagePercent: number;- numMons: number;- numMgrs: number;- numOsds: number;- numOsdsUp: number;- numOsdsIn: number;- numPGs: number;- pools?: CephPool[];- services?: CephServiceStatus[];- lastUpdated: number;-}--export interface CephPool {- id: number;- name: string;- storedBytes: number;- availableBytes: number;- objects: number;- percentUsed: number;-}--export interface CephServiceStatus {- type: string;- running: number;- total: number;- message?: string;-}--export interface Backup {- id: string;- vmid: number;- name: string;- type: 'VM' | 'CT';- size: number;- backupTime: number;- node: string;- storage?: string;- instance: string;- notes?: string;- protected?: boolean;- encrypted?: boolean;- verified?: boolean;- format?: string;-}--export interface PBSBackup extends Backup {- datastore: string;- snapshotTime: number;- owner?: string;- fingerprint?: string;-}--export interface Alert {- id: string;- resourceId: string;- resourceName: string;- node: string;- instance: string;- type: string;- level: 'warning' | 'critical';- message: string;- value: number;- threshold: number;- startTime: string;- lastSeen?: string;- acknowledged: boolean;- acknowledgedBy?: string;- acknowledgedAt?: string;-}diff --git a/frontend-modern/src/types/settings.ts b/frontend-modern/src/types/settings.tsdeleted file mode 100644index e6fca5b711..0000000000--- a/frontend-modern/src/types/settings.ts+++ /dev/null@@ -1,69 +0,0 @@-// Settings API Types - Keep in sync with Go backend--export interface ServerSettings {- backend: {- port: number;- host: string;- };- frontend: {- port: number;- host: string;- };-}--export interface MonitoringSettings {- // Note: PVE polling is hardcoded to 10s server-side- concurrentPolling: boolean;- backupPollingCycles: number;- backupPollingIntervalMs: number;- backupPollingEnabled: boolean;- metricsRetentionDays: number;-}--export interface LoggingSettings {- level: string;- file: string;- maxSize: number;- maxBackups: number;- maxAge: number;- compress: boolean;-}--export interface SecuritySettings {- apiToken: string;- allowedOrigins: string[];- iframeEmbedding: string;- enableAuthentication: boolean;-}--export interface Settings {- server: ServerSettings;- monitoring: MonitoringSettings;- logging: LoggingSettings;- security: SecuritySettings;-}--export interface SettingsCapabilities {- canRestart: boolean;- canValidatePorts: boolean;- requiresRestart: boolean;-}--export interface SettingsResponse {- current: Settings;- defaults: Settings;- capabilities: SettingsCapabilities;-}--export interface SettingsUpdateRequest {- server?: Partial<ServerSettings>;- monitoring?: Partial<MonitoringSettings>;- logging?: Partial<LoggingSettings>;- security?: Partial<SecuritySettings>;-}--export interface SettingsUpdateResponse {- success: boolean;- requiresRestart: boolean;- message?: string;-}diff --git a/frontend-modern/src/utils/apiClient.ts b/frontend-modern/src/utils/apiClient.tsindex e3a8e9cee8..21060c4e97 100644--- a/frontend-modern/src/utils/apiClient.ts+++ b/frontend-modern/src/utils/apiClient.ts@@ -1,13 +1,26 @@// Centralized API client with authentication support// This replaces the three separate auth utilities (api.ts, auth.ts, authInterceptor.ts)+import { logger } from '@/utils/logger';+import { STORAGE_KEYS } from '@/utils/localStorage';++const getSessionStorage = (): Storage | undefined => {+ if (typeof window === 'undefined') {+ return undefined;+ }+ try {+ return window.sessionStorage;+ } catch {+ return undefined;+ }+};+interface FetchOptions extends Omit<RequestInit, 'headers'> {headers?: Record<string, string>;skipAuth?: boolean;}class ApiClient {- private authHeader: string | null = null;private apiToken: string | null = null;private csrfToken: string | null = null;@@ -18,6 +31,35 @@ class ApiClient {this.loadCSRFToken();}+ private persistToken(token: string) {+ const storage = getSessionStorage();+ if (!storage) return;++ try {+ storage.setItem(+ STORAGE_KEYS.AUTH,+ JSON.stringify({+ type: 'token',+ value: token,+ }),+ );+ } catch {+ // Ignore storage quota errors+ }+ }++ private removeStoredToken() {+ const storage = getSessionStorage();+ if (!storage) return;++ try {+ storage.removeItem(AUTH_STORAGE_KEY);+ storage.removeItem(STORAGE_KEYS.LEGACY_TOKEN);+ } catch {+ // Ignore storage quota errors+ }+ }+private loadCSRFToken() {// Read CSRF token from cookieconst cookies = document.cookie.split(';');@@ -32,79 +74,107 @@ class ApiClient {private loadStoredAuth() {try {- // Try to load from session storage (survives page refresh but not tab close)- const stored = sessionStorage.getItem('pulse_auth');+ const storage = getSessionStorage();+ if (!storage) return;++ const stored = storage.getItem(AUTH_STORAGE_KEY);if (stored) {const { type, value } = JSON.parse(stored);- if (type === 'basic') {- this.authHeader = value;- } else if (type === 'token') {+ if (type === 'token') {this.apiToken = value;}+ return;+ }++ // Legacy storage key used before apiClient refactor+ const legacyToken = storage.getItem(STORAGE_KEYS.LEGACY_TOKEN);+ if (legacyToken) {+ this.apiToken = legacyToken;+ this.persistToken(legacyToken);+ storage.removeItem(STORAGE_KEYS.LEGACY_TOKEN);}} catch (_err) {// Invalid stored auth, ignore}}- // Set basic auth credentials- setBasicAuth(username: string, password: string) {- const encoded = btoa(`${username}:${password}`);- this.authHeader = `Basic ${encoded}`;-- // Store in session storage- sessionStorage.setItem(- 'pulse_auth',- JSON.stringify({- type: 'basic',- value: this.authHeader,- }),- );-- // Also store username for password change functionality- sessionStorage.setItem('pulse_auth_user', username);- }-// Set API tokensetApiToken(token: string) {this.apiToken = token;- // Store in session storage- sessionStorage.setItem(- 'pulse_auth',- JSON.stringify({- type: 'token',- value: token,- }),- );+ this.persistToken(token);}- // Clear all authentication- clearAuth() {- this.authHeader = null;- this.apiToken = null;- sessionStorage.removeItem('pulse_auth');- sessionStorage.removeItem('pulse_auth_user');- }+ getApiToken(): string | null {+ if (this.apiToken) {+ return this.apiToken;+ }++ const storage = getSessionStorage();+ if (!storage) {+ return null;+ }- clearApiToken() {- this.apiToken = null;try {- const stored = sessionStorage.getItem('pulse_auth');+ const stored = storage.getItem(AUTH_STORAGE_KEY);if (stored) {const parsed = JSON.parse(stored);- if (parsed?.type === 'token') {- sessionStorage.removeItem('pulse_auth');+ if (parsed?.type === 'token' && typeof parsed.value === 'string') {+ this.apiToken = parsed.value;+ return parsed.value;}}++ const legacyToken = storage.getItem(STORAGE_KEYS.LEGACY_TOKEN);+ if (legacyToken) {+ this.apiToken = legacyToken;+ this.persistToken(legacyToken);+ storage.removeItem(STORAGE_KEYS.LEGACY_TOKEN);+ return legacyToken;+ }+ } catch {+ // Ignore parsing/storage errors+ }++ return null;+ }++ // Clear all authentication+ clearAuth() {+ this.apiToken = null;+ this.removeStoredToken();++ const storage = getSessionStorage();+ if (!storage) return;+ try {+ storage.removeItem('pulse_auth_user');} catch {- sessionStorage.removeItem('pulse_auth');+ // Ignore storage quota errors}}+ clearApiToken() {+ this.apiToken = null;+ this.removeStoredToken();+ }+// Check if we have any auth configuredhasAuth(): boolean {- return !!(this.authHeader || this.apiToken);+ if (this.apiToken) {+ return true;+ }++ if (typeof document !== 'undefined') {+ const cookies = document.cookie.split(';');+ for (const cookie of cookies) {+ const [name] = cookie.trim().split('=');+ if (name === 'pulse_session') {+ return true;+ }+ }+ }++ return false;}// Main fetch wrapper that adds authentication@@ -124,9 +194,6 @@ class ApiClient {// Add authentication if available and not skippedif (!skipAuth) {- if (this.authHeader) {- finalHeaders['Authorization'] = this.authHeader;- }if (this.apiToken) {finalHeaders['X-API-Token'] = this.apiToken;}@@ -150,7 +217,7 @@ class ApiClient {// If we get a 401, our auth might be invalidif (response.status === 401 && this.hasAuth()) {// Could trigger a re-login flow here- console.warn('Authentication failed - credentials may be incorrect');+ logger.warn('Authentication failed - credentials may be incorrect');// Don't clear auth automatically - let the user retry}@@ -177,7 +244,7 @@ class ApiClient {const retryAfter = response.headers.get('Retry-After');const waitTime = retryAfter ? parseInt(retryAfter) * 1000 : 2000; // Default 2 seconds- console.warn(`Rate limit hit, retrying after ${waitTime}ms`);+ logger.warn(`Rate limit hit, retrying after ${waitTime}ms`);// Wait and retry onceawait new Promise((resolve) => setTimeout(resolve, waitTime));@@ -232,39 +299,11 @@ class ApiClient {try {return JSON.parse(text) as T;} catch (_err) {- console.error('Failed to parse JSON response:', text);+ logger.error('Failed to parse JSON response', text);throw new Error('Invalid JSON response from server');}}- // Check if authentication is required- async checkAuthRequired(): Promise<boolean> {- try {- // Try to access a protected endpoint without auth- const response = await fetch('/api/state', {- method: 'GET',- credentials: 'omit', // Don't send cookies or auth- });-- // If we get 401, auth is required- if (response.status === 401) {- return true;- }-- // If we get 200, no auth required- return false;- } catch (_err) {- // Network error - try the security status endpoint- try {- const response = await fetch('/api/security/status');- const data = await response.json();- return data.hasAuthentication || data.requiresAuth || false;- } catch (_fallbackErr) {- // Can't determine, assume no auth- return false;- }- }- }}// Create singleton instance@@ -274,10 +313,8 @@ export const apiClient = new ApiClient();export const apiFetch = (url: string, options?: FetchOptions) => apiClient.fetch(url, options);export const apiFetchJSON = <T = unknown>(url: string, options?: FetchOptions) =>apiClient.fetchJSON<T>(url, options);-export const setBasicAuth = (username: string, password: string) =>- apiClient.setBasicAuth(username, password);export const setApiToken = (token: string) => apiClient.setApiToken(token);+export const getApiToken = () => apiClient.getApiToken();export const clearAuth = () => apiClient.clearAuth();export const clearApiToken = () => apiClient.clearApiToken();export const hasAuth = () => apiClient.hasAuth();-export const checkAuthRequired = () => apiClient.checkAuthRequired();diff --git a/frontend-modern/src/utils/clipboard.ts b/frontend-modern/src/utils/clipboard.tsindex 7b662de1a6..26bac8b96c 100644--- a/frontend-modern/src/utils/clipboard.ts+++ b/frontend-modern/src/utils/clipboard.ts@@ -1,24 +1,39 @@+import { logger } from '@/utils/logger';+export async function copyToClipboard(text: string): Promise<boolean> {try {- if (navigator.clipboard && window.isSecureContext) {- await navigator.clipboard.writeText(text);- return true;- } else {- // Fallback for older browsers- const textArea = document.createElement('textarea');- textArea.value = text;- textArea.style.position = 'fixed';- textArea.style.left = '-999999px';- textArea.style.top = '-999999px';- document.body.appendChild(textArea);- textArea.focus();- textArea.select();- const successful = document.execCommand('copy');+ if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {+ try {+ await navigator.clipboard.writeText(text);+ return true;+ } catch (error) {+ logger.warn('Clipboard API copy failed, attempting fallback copy.', error);+ }+ }++ if (typeof document === 'undefined') {+ return false;+ }++ const textArea = document.createElement('textarea');+ textArea.value = text;+ textArea.style.position = 'fixed';+ textArea.style.left = '-999999px';+ textArea.style.top = '-999999px';+ document.body.appendChild(textArea);+ textArea.focus();+ textArea.select();++ try {+ return document.execCommand('copy');+ } catch (error) {+ logger.error('Fallback copy failed', error);+ return false;+ } finally {document.body.removeChild(textArea);- return successful;}} catch (err) {- console.error('Failed to copy to clipboard:', err);+ logger.error('Failed to copy to clipboard', err);return false;}}diff --git a/frontend-modern/src/utils/errorHandler.ts b/frontend-modern/src/utils/errorHandler.tsdeleted file mode 100644index a1e98e468c..0000000000--- a/frontend-modern/src/utils/errorHandler.ts+++ /dev/null@@ -1,52 +0,0 @@-import { logger } from './logger';--export interface ErrorContext {- component?: string;- action?: string;- data?: unknown;-}--export class AppError extends Error {- public readonly context: ErrorContext;- public readonly isOperational: boolean;-- constructor(message: string, context: ErrorContext = {}, isOperational = true) {- super(message);- this.name = 'AppError';- this.context = context;- this.isOperational = isOperational;- }-}--export function handleError(error: unknown, context: ErrorContext = {}): void {- if (error instanceof AppError) {- logger.error(`[${context.component || 'Unknown'}] ${error.message}`, {- ...error.context,- ...context,- error: error.stack,- });- } else if (error instanceof Error) {- logger.error(`[${context.component || 'Unknown'}] ${error.message}`, {- ...context,- error: error.stack,- });- } else {- logger.error(`[${context.component || 'Unknown'}] Unknown error`, {- ...context,- error: String(error),- });- }-}--export function handleAsyncError<T>(promise: Promise<T>, context: ErrorContext = {}): Promise<T> {- return promise.catch((error) => {- handleError(error, context);- throw error;- });-}--export function createErrorBoundary(component: string) {- return (action: string) => (error: unknown) => {- handleError(error, { component, action });- };-}diff --git a/frontend-modern/src/utils/localStorage.ts b/frontend-modern/src/utils/localStorage.tsindex c0cde2a435..ba9afbc60c 100644--- a/frontend-modern/src/utils/localStorage.ts+++ b/frontend-modern/src/utils/localStorage.ts@@ -7,7 +7,7 @@ import { createSignal, createEffect, Signal } from 'solid-js';* @param parse - Optional parser function for complex types* @param stringify - Optional stringify function for complex types*/-export function createLocalStorageSignal<T>(+function createLocalStorageSignal<T>(key: string,defaultValue: T,parse?: (value: string) => T,@@ -55,26 +55,26 @@ export function createLocalStorageBooleanSignal(* @param key - The localStorage key* @param defaultValue - Default value if nothing in localStorage*/-export function createLocalStorageNumberSignal(- key: string,- defaultValue: number = 0,-): Signal<number> {- return createLocalStorageSignal(- key,- defaultValue,- (val) => Number(val),- (val) => String(val),- );-}--/**- * Storage keys used throughout the application- */+// Storage keys used throughout the applicationexport const STORAGE_KEYS = {+ // Authentication+ AUTH: 'pulse_auth',+ LEGACY_TOKEN: 'pulse_api_token',+// UI preferencesDARK_MODE: 'darkMode',SIDEBAR_COLLAPSED: 'sidebarCollapsed',+ // Metadata+ GUEST_METADATA: 'pulseGuestMetadata',+ DOCKER_METADATA: 'pulseDockerMetadata',++ // Platform tracking+ PLATFORMS_SEEN: 'pulse-platforms-seen',++ // Updates+ UPDATES: 'pulse-updates',+// Alert settingsALERT_HISTORY_TIME_FILTER: 'alertHistoryTimeFilter',ALERT_HISTORY_SEVERITY_FILTER: 'alertHistorySeverityFilter',@@ -105,7 +105,4 @@ export const STORAGE_KEYS = {// Alerts searchALERTS_SEARCH_HISTORY: 'alertsSearchHistory',-- // API token- API_TOKEN: 'apiToken',} as const;diff --git a/frontend-modern/src/utils/searchHistory.ts b/frontend-modern/src/utils/searchHistory.tsindex 800feb21eb..8f5caa2037 100644--- a/frontend-modern/src/utils/searchHistory.ts+++ b/frontend-modern/src/utils/searchHistory.ts@@ -1,3 +1,5 @@+import { logger } from '@/utils/logger';+const DEFAULT_MAX_HISTORY = 10;type HistoryEntry = string;@@ -21,7 +23,7 @@ function readHistory(key: string): HistoryEntry[] {}return parsed.filter((value): value is string => typeof value === 'string');} catch (error) {- console.warn(`[searchHistory] Failed to parse history for key "${key}":`, error);+ logger.warn(`[searchHistory] Failed to parse history for key "${key}":`, error);return [];}}@@ -33,7 +35,7 @@ function writeHistory(key: string, history: HistoryEntry[]): void {try {window.localStorage.setItem(key, JSON.stringify(history));} catch (error) {- console.warn(`[searchHistory] Failed to persist history for key "${key}":`, error);+ logger.warn(`[searchHistory] Failed to persist history for key "${key}":`, error);}}diff --git a/frontend-modern/src/utils/searchQuery.ts b/frontend-modern/src/utils/searchQuery.tsindex 88bdd97bd8..24f9bd5ff0 100644--- a/frontend-modern/src/utils/searchQuery.ts+++ b/frontend-modern/src/utils/searchQuery.ts@@ -23,14 +23,6 @@ export interface TextCondition {value: string;}-export type Condition = MetricCondition | TextCondition;--export interface ParsedQuery {- conditions: Condition[];- logicalOperator: LogicalOperator;- rawText?: string; // Fallback for simple text search-}-// New interfaces for stackable filtersexport interface ParsedFilter {type: 'metric' | 'text' | 'raw';@@ -122,80 +114,6 @@ export function parseFilterStack(searchString: string): FilterStack {return { filters, operators, logicalOperator };}-function parseCondition(conditionStr: string): Condition | null {- // Try to parse metric condition (e.g., "cpu>80")- const metricMatch = conditionStr.match(- /^(cpu|memory|disk|diskRead|diskWrite|networkIn|networkOut)\s*(>|<|>=|<=|=|==)\s*(\d+(?:\.\d+)?)$/i,- );- if (metricMatch) {- const [, field, operator, value] = metricMatch;- return {- field: field.toLowerCase() as MetricCondition['field'],- operator: operator as ComparisonOperator,- value: (() => {- const parsed = parseFloat(value);- return isNaN(parsed) ? 0 : parsed;- })(),- } as MetricCondition;- }-- // Try to parse text condition (e.g., "name:prod", "tags:production", "storage:local", etc.)- const textMatch = conditionStr.match(/^(\w+)\s*:\s*(.+)$/i);- if (textMatch) {- const [, field, value] = textMatch;- return {- field: field.toLowerCase() as 'name' | 'node' | 'vmid' | 'tags',- value: value.trim(),- } as TextCondition;- }-- return null;-}--export function parseSearchQuery(query: string): ParsedQuery {- query = query.trim();-- // Check for logical operators- const hasAnd = /\bAND\b/i.test(query);- const hasOr = /\bOR\b/i.test(query);-- // If no operators or invalid query, treat as simple text search- if (!hasAnd && !hasOr && !query.match(/[><=:]/)) {- return {- conditions: [],- logicalOperator: 'AND',- rawText: query,- };- }-- // Split by logical operator- const logicalOperator: LogicalOperator = hasAnd ? 'AND' : 'OR';- const parts = query.split(hasAnd ? /\bAND\b/i : /\bOR\b/i);-- const conditions: Condition[] = [];-- for (const part of parts) {- const condition = parseCondition(part.trim());- if (condition) {- conditions.push(condition);- }- }-- // If no valid conditions parsed, fall back to text search- if (conditions.length === 0) {- return {- conditions: [],- logicalOperator: 'AND',- rawText: query,- };- }-- return {- conditions,- logicalOperator,- };-}-type FilterableItem = VM | Container | PBSBackup | StorageBackup | BackupTask | UnifiedBackup;function evaluateMetricCondition(guest: FilterableItem, condition: MetricCondition): boolean {@@ -298,45 +216,6 @@ function evaluateTextCondition(guest: FilterableItem, condition: TextCondition):}}-export function evaluateSearchQuery(guest: FilterableItem, query: ParsedQuery): boolean {- // If it's a simple text search- if (query.rawText) {- const searchTerms = query.rawText- .toLowerCase()- .split(',')- .map((term) => term.trim())- .filter((term) => term.length > 0);- return searchTerms.some(- (term) =>- ('name' in guest && guest.name && guest.name.toLowerCase().includes(term)) ||- ('vmid' in guest && guest.vmid && guest.vmid.toString().includes(term)) ||- ('node' in guest && guest.node && guest.node.toLowerCase().includes(term)) ||- ('status' in guest && guest.status && guest.status.toLowerCase().includes(term)),- );- }-- // If no conditions, match all- if (query.conditions.length === 0) {- return true;- }-- // Evaluate conditions- const results = query.conditions.map((condition) => {- if ('operator' in condition) {- return evaluateMetricCondition(guest, condition);- } else {- return evaluateTextCondition(guest, condition);- }- });-- // Apply logical operator- if (query.logicalOperator === 'AND') {- return results.every((result) => result);- } else {- return results.some((result) => result);- }-}-// Evaluate a filter stack against a guest or backup itemexport function evaluateFilterStack(guest: FilterableItem, stack: FilterStack): boolean {if (stack.filters.length === 0) {diff --git a/frontend-modern/src/utils/status.ts b/frontend-modern/src/utils/status.tsindex c74b09cd4a..b061aaee32 100644--- a/frontend-modern/src/utils/status.ts+++ b/frontend-modern/src/utils/status.ts@@ -20,10 +20,3 @@ export function isGuestRunning(if (!parentNodeOnline) return false;return guest.status === RUNNING_STATUS;}--export function shouldDisplayGuestMetrics(- guest: Partial<VM | Container> | undefined | null,- parentNodeOnline = true,-): boolean {- return isGuestRunning(guest, parentNodeOnline);-}diff --git a/frontend-modern/src/utils/tagColors.ts b/frontend-modern/src/utils/tagColors.tsindex a41883939b..0f9dd89421 100644--- a/frontend-modern/src/utils/tagColors.ts+++ b/frontend-modern/src/utils/tagColors.ts@@ -18,8 +18,9 @@ function hashString(str: string): number {/*** Generate a color for a tag based on its text* Uses HSL to ensure good visibility and consistent saturation/lightness+ * (Internal helper - use getTagColorWithSpecial instead)*/-export function getTagColor(tag: string): { bg: string; text: string; border: string } {+function getTagColor(tag: string): { bg: string; text: string; border: string } {// Get a hash of the tagconst hash = hashString(tag.toLowerCase());@@ -43,8 +44,9 @@ export function getTagColor(tag: string): { bg: string; text: string; border: st/*** Get tag colors adjusted for dark mode+ * (Internal helper - use getTagColorWithSpecial instead)*/-export function getTagColorDark(tag: string): { bg: string; text: string; border: string } {+function getTagColorDark(tag: string): { bg: string; text: string; border: string } {const hash = hashString(tag.toLowerCase());const hue = hash % 360;const saturation = 55; // Moderate saturation in dark modediff --git a/frontend-modern/src/utils/temperature.ts b/frontend-modern/src/utils/temperature.tsindex dc8a11029b..137bd257c3 100644--- a/frontend-modern/src/utils/temperature.ts+++ b/frontend-modern/src/utils/temperature.ts@@ -28,26 +28,3 @@ export const getCpuTemperature = (temperature?: Temperature | null): number | nureturn Math.max(...candidates);};--export type NvmeTemperatureReading = {- value: number;- device?: string;-};--export const getHottestNvmeTemperature = (- temperature?: Temperature | null,-): NvmeTemperatureReading | null => {- if (!temperature?.available || !Array.isArray(temperature.nvme)) {- return null;- }-- const readings = temperature.nvme- .filter((nvme) => isValidTemperature(nvme.temp))- .map((nvme) => ({ value: nvme.temp, device: nvme.device }));-- if (readings.length === 0) {- return null;- }-- return readings.reduce((max, current) => (current.value > max.value ? current : max));-};diff --git a/frontend-modern/src/utils/toast.ts b/frontend-modern/src/utils/toast.tsindex b5a065605a..b8aadff041 100644--- a/frontend-modern/src/utils/toast.ts+++ b/frontend-modern/src/utils/toast.ts@@ -1,4 +1,5 @@import type { ToastType } from '@/components/Toast/Toast';+import { logger } from '@/utils/logger';// Global declaration is in Toast.tsx@@ -13,7 +14,7 @@ export const showToast = (}// Fallback to console if toast system not ready- console.log(`[${type.toUpperCase()}] ${title}${message ? `: ${message}` : ''}`);+ logger.info(`[toast:${type}] ${title}${message ? `: ${message}` : ''}`);return undefined;};@@ -22,5 +23,3 @@ export const showSuccess = (title: string, message?: string, duration?: number)showToast('success', title, message, duration);export const showError = (title: string, message?: string, duration?: number) =>showToast('error', title, message, duration);-export const showInfo = (title: string, message?: string, duration?: number) =>- showToast('info', title, message, duration);diff --git a/frontend-modern/src/utils/tokenStorage.ts b/frontend-modern/src/utils/tokenStorage.tsdeleted file mode 100644index 2258721828..0000000000--- a/frontend-modern/src/utils/tokenStorage.ts+++ /dev/null@@ -1,98 +0,0 @@-import { onCleanup } from 'solid-js';--const STORAGE_KEY = 'pulse_api_token';--let memoryToken: string | null = null;-const listeners = new Set<(value: string | null) => void>();--const getSessionStorage = (): Storage | undefined => {- if (typeof window === 'undefined') {- return undefined;- }- try {- return window.sessionStorage;- } catch {- return undefined;- }-};--const notify = (value: string | null) => {- listeners.forEach((listener) => {- try {- listener(value);- } catch {- // Ignore listener failures to avoid breaking notification flow.- }- });-- if (typeof window !== 'undefined') {- try {- window.dispatchEvent(new StorageEvent('storage', { key: STORAGE_KEY, newValue: value ?? null }));- } catch {- // Some browsers disallow programmatic StorageEvent dispatch; ignore failures.- }- }-};--const writeValue = (value: string | null) => {- memoryToken = value;- const storage = getSessionStorage();- if (!storage) {- notify(value);- return;- }-- try {- if (value === null) {- storage.removeItem(STORAGE_KEY);- } else {- storage.setItem(STORAGE_KEY, value);- }- } catch {- // If sessionStorage is unavailable (e.g., Safari private mode), fall back to memory token only.- }-- notify(value);-};--export const getStoredAPIToken = (): string | null => {- const storage = getSessionStorage();- if (!storage) {- return memoryToken;- }-- try {- const stored = storage.getItem(STORAGE_KEY);- if (stored !== null) {- memoryToken = stored;- }- return stored ?? memoryToken;- } catch {- return memoryToken;- }-};--export const setStoredAPIToken = (token: string): void => {- writeValue(token);-};--export const clearStoredAPIToken = (): void => {- writeValue(null);-};--export const subscribeAPIToken = (listener: (token: string | null) => void): (() => void) => {- listeners.add(listener);- listener(getStoredAPIToken());- return () => {- listeners.delete(listener);- };-};--export const useAPITokenSubscription = (listener: (token: string | null) => void): void => {- if (typeof window === 'undefined') {- listener(getStoredAPIToken());- return;- }- const unsubscribe = subscribeAPIToken(listener);- onCleanup(unsubscribe);-};diff --git a/frontend-modern/src/utils/url.ts b/frontend-modern/src/utils/url.tsnew file mode 100644index 0000000000..3cd88bed5a--- /dev/null+++ b/frontend-modern/src/utils/url.ts@@ -0,0 +1,61 @@+const FALLBACK_BASE_URL = 'http://localhost:7655';++export function getPulseBaseUrl(): string {+ if (typeof window === 'undefined' || !window.location) {+ return FALLBACK_BASE_URL;+ }++ const { origin, protocol, hostname, port } = window.location;++ if (origin && origin !== 'null') {+ return origin;+ }++ if (!protocol || !hostname) {+ return FALLBACK_BASE_URL;+ }++ const base = `${protocol}//${hostname}`;+ return port ? `${base}:${port}` : base;+}++function getPulseOriginUrl(): URL | null {+ try {+ return new URL(getPulseBaseUrl());+ } catch {+ return null;+ }+}++export function getPulseHostname(): string {+ const origin = getPulseOriginUrl();+ return origin?.hostname || 'localhost';+}++export function getPulsePort(): string {+ const origin = getPulseOriginUrl();+ if (!origin) {+ return '7655';+ }+ if (origin.port) {+ return origin.port;+ }+ return origin.protocol === 'https:' ? '443' : '80';+}++export function isPulseHttps(): boolean {+ const origin = getPulseOriginUrl();+ return origin?.protocol === 'https:';+}++export function getPulseWebSocketUrl(path = '/ws'): string {+ const origin = getPulseOriginUrl();+ const normalizedPath = path.startsWith('/') ? path : `/${path}`;++ if (!origin) {+ return `ws://localhost${normalizedPath}`;+ }++ const protocol = origin.protocol === 'https:' ? 'wss:' : 'ws:';+ return `${protocol}//${origin.host}${normalizedPath}`;+}diff --git a/frontend-modern/vite.config.ts b/frontend-modern/vite.config.tsindex ee53933831..8adef6c972 100644--- a/frontend-modern/vite.config.ts+++ b/frontend-modern/vite.config.ts@@ -39,17 +39,9 @@ export default defineConfig({resolve: {alias: {'@': path.resolve(__dirname, './src'),- 'lucide-solid/icons': path.resolve(__dirname, './node_modules/lucide-solid/dist/esm/icons'),},conditions: ['import', 'browser', 'default'],},- optimizeDeps: {- include: ['lucide-solid'],- force: true,- },- ssr: {- noExternal: ['lucide-solid'],- },server: {port: frontendDevPort,host: frontendDevHost, // Listen on all interfaces for remote access@@ -68,6 +60,10 @@ export default defineConfig({target: backendUrl,changeOrigin: true,},+ '/install-container-agent.sh': {+ target: backendUrl,+ changeOrigin: true,+ },'/install-host-agent.sh': {target: backendUrl,changeOrigin: true,diff --git a/go.mod b/go.modindex 46d5c16898..89b5e0bf8f 100644--- a/go.mod+++ b/go.mod@@ -12,7 +12,6 @@ require (github.com/gorilla/websocket v1.5.3github.com/joho/godotenv v1.5.1github.com/oklog/ulid/v2 v2.1.1- github.com/pkg/errors v0.9.1github.com/prometheus/client_golang v1.23.2github.com/rs/zerolog v1.34.0github.com/shirou/gopsutil/v4 v4.25.9@@ -53,6 +52,7 @@ require (github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirectgithub.com/opencontainers/go-digest v1.0.0 // indirectgithub.com/opencontainers/image-spec v1.1.1 // indirect+ github.com/pkg/errors v0.9.1 // indirectgithub.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirectgithub.com/prometheus/client_model v0.6.2 // indirectgithub.com/prometheus/common v0.66.1 // indirectdiff --git a/install.sh b/install.shindex 33939a83ea..8ce1ecb715 100755--- a/install.sh+++ b/install.sh@@ -1675,7 +1675,9 @@ download_pulse() {print_info "Detected architecture: $ARCH ($PULSE_ARCH)"# Download architecture-specific release- DOWNLOAD_URL="https://github.com/$GITHUB_REPO/releases/download/$LATEST_RELEASE/pulse-${LATEST_RELEASE}-linux-${PULSE_ARCH}.tar.gz"+ ARCHIVE_NAME="pulse-${LATEST_RELEASE}-linux-${PULSE_ARCH}.tar.gz"+ DOWNLOAD_URL="https://github.com/$GITHUB_REPO/releases/download/$LATEST_RELEASE/${ARCHIVE_NAME}"+ CHECKSUM_URL="${DOWNLOAD_URL}.sha256"print_info "Downloading from: $DOWNLOAD_URL"# Detect and stop existing service BEFORE downloading (to free the binary)@@ -1687,18 +1689,38 @@ download_pulse() {ficd /tmp++ if ! command -v sha256sum >/dev/null 2>&1; then+ print_error "sha256sum is required but not installed"+ exit 1+ fi+# Download with timeout (60 seconds should be enough for ~5MB file)- if ! wget -q --timeout=60 --tries=2 -O pulse.tar.gz "$DOWNLOAD_URL"; then+ ARCHIVE_PATH="/tmp/$ARCHIVE_NAME"+ if ! wget -q --timeout=60 --tries=2 -O "$ARCHIVE_PATH" "$DOWNLOAD_URL"; thenprint_error "Failed to download Pulse release"print_info "This can happen due to network issues or GitHub rate limiting"print_info "You can try downloading manually from: $DOWNLOAD_URL"exit 1fi++ # Download checksum and verify+ if ! wget -q --timeout=60 --tries=2 -O "${ARCHIVE_PATH}.sha256" "$CHECKSUM_URL"; then+ print_error "Failed to download checksum for Pulse release"+ print_info "Refusing to install without checksum verification"+ exit 1+ fi++ if ! (cd /tmp && sha256sum -c "${ARCHIVE_NAME}.sha256" >/dev/null 2>&1); then+ print_error "Checksum verification failed for downloaded Pulse release"+ exit 1+ fi+ rm -f "${ARCHIVE_PATH}.sha256"# Extract to temporary directory firstTEMP_EXTRACT="/tmp/pulse-extract-$$"mkdir -p "$TEMP_EXTRACT"- tar -xzf pulse.tar.gz -C "$TEMP_EXTRACT"+ tar -xzf "$ARCHIVE_PATH" -C "$TEMP_EXTRACT"# Ensure install directory and bin subdirectory existmkdir -p "$INSTALL_DIR/bin"@@ -1797,11 +1819,11 @@ download_pulse() {# Force remove and recopyrm -f "$INSTALL_DIR/bin/pulse"- if [[ -f "/tmp/pulse.tar.gz" ]]; then+ if [[ -f "$ARCHIVE_PATH" ]]; then# Re-extract and try againTEMP_EXTRACT2="/tmp/pulse-extract2-$$"mkdir -p "$TEMP_EXTRACT2"- tar -xzf /tmp/pulse.tar.gz -C "$TEMP_EXTRACT2"+ tar -xzf "$ARCHIVE_PATH" -C "$TEMP_EXTRACT2"if [[ -f "$TEMP_EXTRACT2/bin/pulse" ]]; thencp -f "$TEMP_EXTRACT2/bin/pulse" "$INSTALL_DIR/bin/pulse"@@ -1842,7 +1864,7 @@ download_pulse() {fi# Cleanup- rm -rf "$TEMP_EXTRACT" pulse.tar.gz+ rm -rf "$TEMP_EXTRACT" "$ARCHIVE_PATH"fi # End of SKIP_DOWNLOAD check}diff --git a/internal/adapters/state_adapter.go b/internal/adapters/state_adapter.godeleted file mode 100644index c632f39a39..0000000000--- a/internal/adapters/state_adapter.go+++ /dev/null@@ -1,151 +0,0 @@-package adapters--import (- "time"-- "github.com/rcourtman/pulse-go-rewrite/internal/interfaces"- "github.com/rcourtman/pulse-go-rewrite/internal/models"- "github.com/rcourtman/pulse-go-rewrite/internal/monitoring"- "github.com/rcourtman/pulse-go-rewrite/internal/types"-)--// StateAdapter adapts the concrete State to the StateStore interface-type StateAdapter struct {- state *models.State-}--// NewStateAdapter creates a new state adapter-func NewStateAdapter(state *models.State) interfaces.StateStore {- return &StateAdapter{- state: state,- }-}--// GetSnapshot implements StateStore interface-func (s *StateAdapter) GetSnapshot() models.StateSnapshot {- return s.state.GetSnapshot()-}--// UpdateNodes implements StateStore interface-func (s *StateAdapter) UpdateNodes(nodes []models.Node) {- s.state.UpdateNodes(nodes)-}--// UpdateNodesForInstance implements StateStore interface-func (s *StateAdapter) UpdateNodesForInstance(instanceName string, nodes []models.Node) {- s.state.UpdateNodesForInstance(instanceName, nodes)-}--// UpdateVMs implements StateStore interface-func (s *StateAdapter) UpdateVMs(vms []models.VM) {- s.state.UpdateVMs(vms)-}--// UpdateVMsForInstance implements StateStore interface-func (s *StateAdapter) UpdateVMsForInstance(instanceName string, vms []models.VM) {- s.state.UpdateVMsForInstance(instanceName, vms)-}--// UpdateContainers implements StateStore interface-func (s *StateAdapter) UpdateContainers(containers []models.Container) {- s.state.UpdateContainers(containers)-}--// UpdateContainersForInstance implements StateStore interface-func (s *StateAdapter) UpdateContainersForInstance(instanceName string, containers []models.Container) {- s.state.UpdateContainersForInstance(instanceName, containers)-}--// UpdateStorage implements StateStore interface-func (s *StateAdapter) UpdateStorage(storage []models.Storage) {- s.state.UpdateStorage(storage)-}--// UpdateCephClustersForInstance implements StateStore interface-func (s *StateAdapter) UpdateCephClustersForInstance(instanceName string, clusters []models.CephCluster) {- s.state.UpdateCephClustersForInstance(instanceName, clusters)-}--// UpdatePBSInstances implements StateStore interface-func (s *StateAdapter) UpdatePBSInstances(instances []models.PBSInstance) {- s.state.UpdatePBSInstances(instances)-}--// UpdatePMGInstances implements StateStore interface-func (s *StateAdapter) UpdatePMGInstances(instances []models.PMGInstance) {- s.state.UpdatePMGInstances(instances)-}--// SetConnectionHealth implements StateStore interface-func (s *StateAdapter) SetConnectionHealth(instance string, healthy bool) {- s.state.SetConnectionHealth(instance, healthy)-}--// MetricsAdapter adapts the concrete MetricsHistory to the MetricsStore interface-type MetricsAdapter struct {- metrics *monitoring.MetricsHistory-}--// NewMetricsAdapter creates a new metrics adapter-func NewMetricsAdapter(metrics *monitoring.MetricsHistory) interfaces.MetricsStore {- return &MetricsAdapter{- metrics: metrics,- }-}--// AddGuestMetric implements MetricsStore interface-func (m *MetricsAdapter) AddGuestMetric(guestID string, metricType string, value float64, timestamp time.Time) {- m.metrics.AddGuestMetric(guestID, metricType, value, timestamp)-}--// AddNodeMetric implements MetricsStore interface-func (m *MetricsAdapter) AddNodeMetric(nodeID string, metricType string, value float64, timestamp time.Time) {- m.metrics.AddNodeMetric(nodeID, metricType, value, timestamp)-}--// AddStorageMetric implements MetricsStore interface-func (m *MetricsAdapter) AddStorageMetric(storageID string, metricType string, value float64, timestamp time.Time) {- m.metrics.AddStorageMetric(storageID, metricType, value, timestamp)-}--// GetGuestMetrics implements MetricsStore interface-func (m *MetricsAdapter) GetGuestMetrics(guestID string, metricType string, duration time.Duration) []types.MetricPoint {- return m.metrics.GetGuestMetrics(guestID, metricType, duration)-}--// GetNodeMetrics implements MetricsStore interface-func (m *MetricsAdapter) GetNodeMetrics(nodeID string, metricType string, duration time.Duration) []types.MetricPoint {- return m.metrics.GetNodeMetrics(nodeID, metricType, duration)-}--// GetAllGuestMetrics implements MetricsStore interface-func (m *MetricsAdapter) GetAllGuestMetrics(guestID string, duration time.Duration) map[string][]types.MetricPoint {- return m.metrics.GetAllGuestMetrics(guestID, duration)-}--// GetAllStorageMetrics implements MetricsStore interface-func (m *MetricsAdapter) GetAllStorageMetrics(storageID string, duration time.Duration) map[string][]types.MetricPoint {- return m.metrics.GetAllStorageMetrics(storageID, duration)-}--// Cleanup implements MetricsStore interface-func (m *MetricsAdapter) Cleanup() {- m.metrics.Cleanup()-}--// RateTrackerAdapter adapts the concrete RateTracker to the interface-type RateTrackerAdapter struct {- tracker *monitoring.RateTracker-}--// NewRateTrackerAdapter creates a new rate tracker adapter-func NewRateTrackerAdapter(tracker *monitoring.RateTracker) interfaces.RateTracker {- return &RateTrackerAdapter{- tracker: tracker,- }-}--// CalculateRates implements RateTracker interface-func (r *RateTrackerAdapter) CalculateRates(guestID string, current types.IOMetrics) (diskRead, diskWrite, netIn, netOut float64) {- return r.tracker.CalculateRates(guestID, current)-}diff --git a/internal/api/auth.go b/internal/api/auth.goindex 960c804790..cbf56099ac 100644--- a/internal/api/auth.go+++ b/internal/api/auth.go@@ -26,8 +26,13 @@ const (// Global session store instancevar (- sessionStore *SessionStore- sessionOnce sync.Once+ sessionStore *SessionStore+ sessionOnce sync.Once+ adminBypassState struct {+ once sync.Once+ enabled bool+ declined bool+ })// InitSessionStore initializes the persistent session store@@ -128,7 +133,7 @@ func CheckProxyAuth(cfg *config.Config, r *http.Request) (bool, string, bool) {proxySecret := r.Header.Get("X-Proxy-Secret")if proxySecret != cfg.ProxyAuthSecret {log.Debug().- Str("provided_secret", proxySecret[:min(8, len(proxySecret))]+"...").+ Int("provided_secret_length", len(proxySecret)).Msg("Invalid proxy secret")return false, "", false}@@ -226,9 +231,6 @@ func CheckAuth(cfg *config.Config, w http.ResponseWriter, r *http.Request) boolif cfg.AuthUser == "" && cfg.AuthPass == "" && cfg.HasAPITokens() {// Check if an API token was providedprovidedToken := r.Header.Get("X-API-Token")- if providedToken == "" {- providedToken = r.URL.Query().Get("token")- }// If a token was provided, validate itif providedToken != "" {@@ -245,8 +247,8 @@ func CheckAuth(cfg *config.Config, w http.ResponseWriter, r *http.Request) bool// Require a valid token for all requests in API-only modeif w != nil {- w.Header().Set("WWW-Authenticate", `Bearer realm="API Token Required"`)- http.Error(w, "API token required", http.StatusUnauthorized)+ w.Header().Set("WWW-Authenticate", `Bearer realm="API token required; supply via Authorization header or X-API-Token header"`)+ http.Error(w, "API token required via Authorization header or X-API-Token header", http.StatusUnauthorized)}return false}@@ -281,9 +283,6 @@ func CheckAuth(cfg *config.Config, w http.ResponseWriter, r *http.Request) bool}}}- if validateToken(r.URL.Query().Get("token")) {- return true- }}// Check session cookie (for WebSocket and UI)@@ -492,7 +491,7 @@ func CheckAuth(cfg *config.Config, w http.ResponseWriter, r *http.Request) boolfunc RequireAuth(cfg *config.Config, handler http.HandlerFunc) http.HandlerFunc {return func(w http.ResponseWriter, r *http.Request) {// Dev mode bypass for all auth (disabled by default)- if os.Getenv("ALLOW_ADMIN_BYPASS") == "1" {+ if adminBypassEnabled() {log.Debug().Str("path", r.URL.Path).Msg("Auth bypass enabled for dev mode")@@ -531,12 +530,7 @@ func RequireAuth(cfg *config.Config, handler http.HandlerFunc) http.HandlerFuncfunc RequireAdmin(cfg *config.Config, handler http.HandlerFunc) http.HandlerFunc {return func(w http.ResponseWriter, r *http.Request) {// Dev mode bypass for admin endpoints (disabled by default)- bypassValue := os.Getenv("ALLOW_ADMIN_BYPASS")- log.Info().- Str("bypass_value", bypassValue).- Str("path", r.URL.Path).- Msg("=== CHECKING ADMIN BYPASS ===")- if bypassValue == "1" {+ if adminBypassEnabled() {log.Debug().Str("path", r.URL.Path).Msg("Admin bypass enabled for dev mode")@@ -672,3 +666,20 @@ func getAPITokenRecordFromRequest(r *http.Request) *config.APITokenRecord {clone := record.Clone()return &clone}+func adminBypassEnabled() bool {+ adminBypassState.once.Do(func() {+ if os.Getenv("ALLOW_ADMIN_BYPASS") != "1" {+ return+ }++ if os.Getenv("PULSE_DEV") == "true" || strings.EqualFold(os.Getenv("NODE_ENV"), "development") {+ log.Warn().Msg("Admin authentication bypass ENABLED (development mode)")+ adminBypassState.enabled = true+ return+ }++ log.Warn().Msg("Ignoring ALLOW_ADMIN_BYPASS outside development mode")+ adminBypassState.declined = true+ })+ return adminBypassState.enabled+}diff --git a/internal/api/bootstrap_token.go b/internal/api/bootstrap_token.gonew file mode 100644index 0000000000..6bfa599e30--- /dev/null+++ b/internal/api/bootstrap_token.go@@ -0,0 +1,131 @@+package api++import (+ "crypto/rand"+ "encoding/hex"+ "errors"+ "fmt"+ "os"+ "path/filepath"+ "strings"++ internalauth "github.com/rcourtman/pulse-go-rewrite/internal/auth"+ "github.com/rs/zerolog/log"+)++const (+ bootstrapTokenFilename = ".bootstrap_token"+ bootstrapTokenHeader = "X-Setup-Token"+)++func generateBootstrapToken() (string, error) {+ buf := make([]byte, 24)+ if _, err := rand.Read(buf); err != nil {+ return "", err+ }+ return hex.EncodeToString(buf), nil+}++func loadOrCreateBootstrapToken(dataPath string) (token string, created bool, fullPath string, err error) {+ if strings.TrimSpace(dataPath) == "" {+ return "", false, "", errors.New("data path required for bootstrap token")+ }++ if err := os.MkdirAll(dataPath, 0o700); err != nil {+ return "", false, "", fmt.Errorf("ensure data path: %w", err)+ }++ fullPath = filepath.Join(dataPath, bootstrapTokenFilename)++ data, readErr := os.ReadFile(fullPath)+ if readErr == nil {+ token = strings.TrimSpace(string(data))+ if token == "" {+ return "", false, fullPath, errors.New("bootstrap token file is empty")+ }+ return token, false, fullPath, nil+ }++ if !errors.Is(readErr, os.ErrNotExist) {+ return "", false, fullPath, fmt.Errorf("read existing bootstrap token: %w", readErr)+ }++ token, err = generateBootstrapToken()+ if err != nil {+ return "", false, fullPath, fmt.Errorf("generate bootstrap token: %w", err)+ }++ if writeErr := os.WriteFile(fullPath, []byte(token+"\n"), 0o600); writeErr != nil {+ return "", false, fullPath, fmt.Errorf("persist bootstrap token: %w", writeErr)+ }++ return token, true, fullPath, nil+}++func (r *Router) initializeBootstrapToken() {+ if r == nil || r.config == nil {+ return+ }++ // If any authentication mechanism is already configured, purge stale bootstrap tokens.+ if r.config.AuthUser != "" || r.config.AuthPass != "" || r.config.HasAPITokens() || r.config.ProxyAuthSecret != "" {+ r.clearBootstrapToken()+ return+ }+ if r.config.OIDC != nil && r.config.OIDC.Enabled {+ r.clearBootstrapToken()+ return+ }++ token, created, path, err := loadOrCreateBootstrapToken(r.config.DataPath)+ if err != nil {+ log.Error().Err(err).Msg("Failed to prepare bootstrap setup token")+ return+ }++ r.bootstrapTokenHash = internalauth.HashAPIToken(token)+ r.bootstrapTokenPath = path++ if created {+ log.Warn().+ Str("token_path", path).+ Msg("Bootstrap setup token generated; retrieve it from the host to complete initial authentication")+ } else {+ log.Info().+ Str("token_path", path).+ Msg("Bootstrap setup token loaded from disk")+ }+}++func (r *Router) bootstrapTokenValid(token string) bool {+ if r == nil || r.bootstrapTokenHash == "" {+ return false+ }+ token = strings.TrimSpace(token)+ if token == "" {+ return false+ }+ return internalauth.CompareAPIToken(token, r.bootstrapTokenHash)+}++func (r *Router) clearBootstrapToken() {+ if r == nil {+ return+ }++ if r.bootstrapTokenPath != "" {+ if err := os.Remove(r.bootstrapTokenPath); err != nil && !errors.Is(err, os.ErrNotExist) {+ log.Warn().+ Err(err).+ Str("token_path", r.bootstrapTokenPath).+ Msg("Failed to remove bootstrap setup token")+ } else if err == nil {+ log.Info().+ Str("token_path", r.bootstrapTokenPath).+ Msg("Bootstrap setup token removed")+ }+ }++ r.bootstrapTokenHash = ""+ r.bootstrapTokenPath = ""+}diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.goindex d6bb7e5a5d..7699149240 100644--- a/internal/api/config_handlers.go+++ b/internal/api/config_handlers.go@@ -14,6 +14,7 @@ import ("net/url""os""path/filepath"+ "regexp""strconv""strings""sync"@@ -38,6 +39,46 @@ import (const minProxyReadyVersion = "4.24.0"+var (+ setupAuthTokenPattern = regexp.MustCompile(`^[A-Fa-f0-9]{32,128}$`)+)++func sanitizeInstallerURL(raw string) (string, error) {+ trimmed := strings.TrimSpace(raw)+ if trimmed == "" {+ return "", nil+ }+ if strings.ContainsAny(trimmed, "\r\n") {+ return "", fmt.Errorf("value must not contain control characters")+ }+ parsed, err := url.Parse(trimmed)+ if err != nil {+ return "", fmt.Errorf("failed to parse URL: %w", err)+ }+ if parsed.Scheme != "http" && parsed.Scheme != "https" {+ return "", fmt.Errorf("scheme must be http or https")+ }+ if parsed.Host == "" {+ return "", fmt.Errorf("host component is required")+ }+ parsed.Fragment = ""+ return parsed.String(), nil+}++func sanitizeSetupAuthToken(token string) (string, error) {+ trimmed := strings.TrimSpace(token)+ if trimmed == "" {+ return "", nil+ }+ if strings.ContainsAny(trimmed, "\r\n") {+ return "", fmt.Errorf("token must not contain control characters")+ }+ if !setupAuthTokenPattern.MatchString(trimmed) {+ return "", fmt.Errorf("token must be hexadecimal")+ }+ return trimmed, nil+}+// SetupCode represents a one-time setup code for secure node registrationtype SetupCode struct {ExpiresAt time.Time@@ -2642,112 +2683,6 @@ func isRunningInContainer() bool {return false}-// HandleUpdateSystemSettingsOLD updates system settings in the unified config (DEPRECATED - use SystemSettingsHandler instead)-func (h *ConfigHandlers) HandleUpdateSystemSettingsOLD(w http.ResponseWriter, r *http.Request) {- var settings config.SystemSettings- if err := json.NewDecoder(r.Body).Decode(&settings); err != nil {- http.Error(w, "Invalid request body", http.StatusBadRequest)- return- }-- // Validate PBS polling interval (must be positive)- if settings.PBSPollingInterval < 0 {- http.Error(w, "PBS polling interval must be positive", http.StatusBadRequest)- return- }- if settings.BackupPollingInterval < 0 {- http.Error(w, "Backup polling interval cannot be negative", http.StatusBadRequest)- return- }-- // Update polling intervals- needsReload := false-- // Note: PVE polling is hardcoded to 10s, only PBS interval can be configured- if settings.PBSPollingInterval > 0 {- h.config.PBSPollingInterval = time.Duration(settings.PBSPollingInterval) * time.Second- needsReload = true- }- if settings.BackupPollingInterval > 0 || (settings.BackupPollingInterval == 0 && h.config.BackupPollingInterval != 0) {- h.config.BackupPollingInterval = time.Duration(settings.BackupPollingInterval) * time.Second- needsReload = true- }- if settings.BackupPollingEnabled != nil {- h.config.EnableBackupPolling = *settings.BackupPollingEnabled- needsReload = true- }-- // Trigger a monitor reload if intervals changed- if needsReload && h.reloadFunc != nil {- log.Info().- Int("pbsInterval", settings.PBSPollingInterval).- Msg("Triggering monitor reload for new PBS polling interval")- if err := h.reloadFunc(); err != nil {- log.Error().Err(err).Msg("Failed to reload monitor with new polling intervals")- // Don't fail the request, the setting was saved- }- }-- // Update allowed origins if provided- if settings.AllowedOrigins != "" {- h.config.AllowedOrigins = settings.AllowedOrigins- // Update WebSocket hub with new origins- if h.wsHub != nil {- origins := strings.Split(settings.AllowedOrigins, ",")- for i := range origins {- origins[i] = strings.TrimSpace(origins[i])- }- h.wsHub.SetAllowedOrigins(origins)- }- }-- // Update update-related settings- if settings.UpdateChannel != "" {- h.config.UpdateChannel = settings.UpdateChannel- }- h.config.AutoUpdateEnabled = settings.AutoUpdateEnabled- if settings.AutoUpdateCheckInterval > 0 {- h.config.AutoUpdateCheckInterval = time.Duration(settings.AutoUpdateCheckInterval) * time.Hour- }- if settings.AutoUpdateTime != "" {- h.config.AutoUpdateTime = settings.AutoUpdateTime- }- settings.DiscoveryConfig = config.CloneDiscoveryConfig(h.config.Discovery)-- // Save settings to persistence- if err := h.persistence.SaveSystemSettings(settings); err != nil {- log.Error().Err(err).Msg("Failed to persist system settings")- // Continue anyway - settings are applied in memory- } else if h.reloadSystemSettingsFunc != nil {- // Reload cached system settings after successful save- h.reloadSystemSettingsFunc()- }-- log.Info().- Int("pbsPollingInterval", settings.PBSPollingInterval).- Int("backendPort", settings.BackendPort).- Int("frontendPort", settings.FrontendPort).- Msg("Updated system settings in unified config")-- // Trigger monitor reload to apply new settings- if h.reloadFunc != nil {- if err := h.reloadFunc(); err != nil {- log.Error().Err(err).Msg("Failed to reload monitor after system settings update")- // Continue anyway - settings are saved- } else {- log.Info().- Int("pbsPollingInterval", settings.PBSPollingInterval).- Msg("Monitor reloaded with new PBS polling interval")- }- }-- w.WriteHeader(http.StatusOK)- json.NewEncoder(w).Encode(map[string]interface{}{- "status": "success",- "message": "Settings updated successfully",- })-}-// generateNodeID creates a unique ID for a nodefunc generateNodeID(nodeType string, index int) string {return fmt.Sprintf("%s-%d", nodeType, index)@@ -3038,10 +2973,35 @@ func (h *ConfigHandlers) HandleSetupScript(w http.ResponseWriter, r *http.Reques// Get query parametersquery := r.URL.Query()serverType := query.Get("type") // "pve" or "pbs"- serverHost := query.Get("host")- pulseURL := query.Get("pulse_url") // URL of the Pulse server for auto-registration- backupPerms := query.Get("backup_perms") == "true" // Whether to add backup management permissions- authToken := query.Get("auth_token") // Temporary auth token for auto-registration+ serverHost := strings.TrimSpace(query.Get("host"))+ pulseURL := strings.TrimSpace(query.Get("pulse_url")) // URL of the Pulse server for auto-registration+ backupPerms := query.Get("backup_perms") == "true" // Whether to add backup management permissions+ authToken := strings.TrimSpace(query.Get("auth_token")) // Temporary auth token for auto-registration++ if serverHost != "" {+ safeHost, err := sanitizeInstallerURL(serverHost)+ if err != nil {+ http.Error(w, fmt.Sprintf("Invalid host parameter: %v", err), http.StatusBadRequest)+ return+ }+ serverHost = safeHost+ }++ if pulseURL != "" {+ safeURL, err := sanitizeInstallerURL(pulseURL)+ if err != nil {+ http.Error(w, fmt.Sprintf("Invalid pulse_url parameter: %v", err), http.StatusBadRequest)+ return+ }+ pulseURL = safeURL+ }++ if sanitizedToken, err := sanitizeSetupAuthToken(authToken); err != nil {+ http.Error(w, fmt.Sprintf("Invalid auth_token parameter: %v", err), http.StatusBadRequest)+ return+ } else {+ authToken = sanitizedToken+ }// Validate required parametersif serverType == "" {@@ -3068,6 +3028,11 @@ func (h *ConfigHandlers) HandleSetupScript(w http.ResponseWriter, r *http.Requesscheme = "https"}pulseURL = fmt.Sprintf("%s://%s", scheme, r.Host)+ } else {+ // Ensure derived pulseURL is still sanitized (should already be, but double check)+ if safeURL, err := sanitizeInstallerURL(pulseURL); err == nil {+ pulseURL = safeURL+ }}log.Info().@@ -5390,9 +5355,7 @@ func (h *ConfigHandlers) HandleAutoRegister(w http.ResponseWriter, r *http.Reque}// Broadcast auto-registration success via WebSocket- fmt.Println("[AUTO-REGISTER] About to broadcast WebSocket message")if h.wsHub != nil {- fmt.Println("[AUTO-REGISTER] WebSocket hub is available")nodeInfo := map[string]interface{}{"type": req.Type,"host": req.Host,@@ -5404,13 +5367,11 @@ func (h *ConfigHandlers) HandleAutoRegister(w http.ResponseWriter, r *http.Reque}// Broadcast the auto-registration success- fmt.Printf("[AUTO-REGISTER] Broadcasting message type: node_auto_registered for host: %s\n", req.Host)h.wsHub.BroadcastMessage(websocket.Message{Type: "node_auto_registered",Data: nodeInfo,Timestamp: time.Now().Format(time.RFC3339),})- fmt.Println("[AUTO-REGISTER] Broadcast complete")// Also broadcast a discovery update to refresh the UIif h.monitor != nil && h.monitor.GetDiscoveryService() != nil {@@ -5435,7 +5396,6 @@ func (h *ConfigHandlers) HandleAutoRegister(w http.ResponseWriter, r *http.RequeStr("type", "node_auto_registered").Msg("Broadcasted auto-registration success via WebSocket")} else {- fmt.Println("[AUTO-REGISTER] ERROR: WebSocket hub is nil!")log.Warn().Msg("WebSocket hub is nil, cannot broadcast auto-registration")}diff --git a/internal/api/config_handlers_setup_script_test.go b/internal/api/config_handlers_setup_script_test.gonew file mode 100644index 0000000000..0db866b6f8--- /dev/null+++ b/internal/api/config_handlers_setup_script_test.go@@ -0,0 +1,47 @@+package api++import (+ "net/http"+ "net/http/httptest"+ "testing"++ "github.com/rcourtman/pulse-go-rewrite/internal/config"+)++func TestHandleSetupScriptRejectsUnsafeAuthToken(t *testing.T) {+ tempDir := t.TempDir()+ cfg := &config.Config{+ DataPath: tempDir,+ ConfigPath: tempDir,+ }++ handlers := newTestConfigHandlers(t, cfg)++ req := httptest.NewRequest(http.MethodGet, "/api/setup-script?type=pve&host=https://example.com&auth_token=$(touch%20/tmp/pwned)", nil)+ rr := httptest.NewRecorder()++ handlers.HandleSetupScript(rr, req)++ if rr.Code != http.StatusBadRequest {+ t.Fatalf("expected 400 bad request for unsafe auth token, got %d (%s)", rr.Code, rr.Body.String())+ }+}++func TestHandleSetupScriptRejectsUnsafePulseURL(t *testing.T) {+ tempDir := t.TempDir()+ cfg := &config.Config{+ DataPath: tempDir,+ ConfigPath: tempDir,+ }++ handlers := newTestConfigHandlers(t, cfg)++ req := httptest.NewRequest(http.MethodGet, "/api/setup-script?type=pve&host=https://example.com&pulse_url=http://example.com%5C%0Aecho%20oops", nil)+ rr := httptest.NewRecorder()++ handlers.HandleSetupScript(rr, req)++ if rr.Code != http.StatusBadRequest {+ t.Fatalf("expected 400 bad request for unsafe pulse_url, got %d (%s)", rr.Code, rr.Body.String())+ }+}diff --git a/internal/api/csrf_store.go b/internal/api/csrf_store.goindex ce2da25a86..32a7ccc693 100644--- a/internal/api/csrf_store.go+++ b/internal/api/csrf_store.go@@ -2,7 +2,10 @@ package apiimport ("crypto/rand"+ "crypto/sha256"+ "crypto/subtle""encoding/base64"+ "encoding/hex""encoding/json""os""path/filepath"@@ -12,6 +15,12 @@ import ("github.com/rs/zerolog/log")+// CSRFToken represents a hashed token with expiration metadata.+type CSRFToken struct {+ Hash string+ Expires time.Time+}+// CSRFTokenStore handles persistent CSRF token storagetype CSRFTokenStore struct {tokens map[string]*CSRFToken@@ -21,12 +30,26 @@ type CSRFTokenStore struct {stopChan chan bool}+func csrfSessionKey(sessionID string) string {+ return sessionHash(sessionID)+}++func csrfTokenHash(token string) string {+ sum := sha256.Sum256([]byte(token))+ return hex.EncodeToString(sum[:])+}+// CSRFTokenData represents CSRF token datatype CSRFTokenData struct {+ TokenHash string `json:"token_hash"`+ SessionKey string `json:"session_key"`+ ExpiresAt time.Time `json:"expires_at"`+}++type legacyCSRFTokenData struct {Token string `json:"token"`SessionID string `json:"session_id"`ExpiresAt time.Time `json:"expires_at"`- CreatedAt time.Time `json:"created_at"`}var (@@ -94,8 +117,9 @@ func (c *CSRFTokenStore) GenerateCSRFToken(sessionID string) string {c.mu.Lock()defer c.mu.Unlock()- c.tokens[sessionID] = &CSRFToken{- Token: token,+ key := csrfSessionKey(sessionID)+ c.tokens[key] = &CSRFToken{+ Hash: csrfTokenHash(token),Expires: time.Now().Add(4 * time.Hour),}@@ -110,17 +134,8 @@ func (c *CSRFTokenStore) ValidateCSRFToken(sessionID, token string) bool {c.mu.RLock()defer c.mu.RUnlock()- csrfToken, exists := c.tokens[sessionID]+ csrfToken, exists := c.tokens[csrfSessionKey(sessionID)]if !exists {- // No CSRF token for this session - could be server restart- // Generate a new one on the fly if session is valid- if ValidateSession(sessionID) {- c.mu.RUnlock()- newToken := c.GenerateCSRFToken(sessionID)- c.mu.RLock()- // Allow this request but with new token- return newToken != ""- }return false}@@ -128,20 +143,7 @@ func (c *CSRFTokenStore) ValidateCSRFToken(sessionID, token string) bool {return false}- return csrfToken.Token == token-}--// GetCSRFToken returns the CSRF token for a session if it exists-func (c *CSRFTokenStore) GetCSRFToken(sessionID string) string {- c.mu.RLock()- defer c.mu.RUnlock()-- csrfToken, exists := c.tokens[sessionID]- if !exists || time.Now().After(csrfToken.Expires) {- return ""- }-- return csrfToken.Token+ return subtle.ConstantTimeCompare([]byte(csrfToken.Hash), []byte(csrfTokenHash(token))) == 1}// ExtendCSRFToken extends the expiration of a CSRF token@@ -149,7 +151,8 @@ func (c *CSRFTokenStore) ExtendCSRFToken(sessionID string) {c.mu.Lock()defer c.mu.Unlock()- if csrfToken, exists := c.tokens[sessionID]; exists {+ key := csrfSessionKey(sessionID)+ if csrfToken, exists := c.tokens[key]; exists {csrfToken.Expires = time.Now().Add(4 * time.Hour)c.saveUnsafe()}@@ -160,7 +163,7 @@ func (c *CSRFTokenStore) DeleteCSRFToken(sessionID string) {c.mu.Lock()defer c.mu.Unlock()- delete(c.tokens, sessionID)+ delete(c.tokens, csrfSessionKey(sessionID))c.saveUnsafe()}@@ -170,10 +173,10 @@ func (c *CSRFTokenStore) cleanup() {defer c.mu.Unlock()now := time.Now()- for sessionID, token := range c.tokens {+ for sessionKey, token := range c.tokens {if now.After(token.Expires) {- delete(c.tokens, sessionID)- log.Debug().Str("session", sessionID[:8]+"...").Msg("Cleaned up expired CSRF token")+ delete(c.tokens, sessionKey)+ log.Debug().Str("sessionKey", sessionKey[:8]+"...").Msg("Cleaned up expired CSRF token")}}}@@ -196,18 +199,17 @@ func (c *CSRFTokenStore) saveUnsafe() {}// Convert to serializable format- data := make(map[string]*CSRFTokenData)- for sessionID, token := range c.tokens {- data[sessionID] = &CSRFTokenData{- Token: token.Token,- SessionID: sessionID,- ExpiresAt: token.Expires,- CreatedAt: time.Now(),- }+ persisted := make([]*CSRFTokenData, 0, len(c.tokens))+ for sessionKey, token := range c.tokens {+ persisted = append(persisted, &CSRFTokenData{+ TokenHash: token.Hash,+ SessionKey: sessionKey,+ ExpiresAt: token.Expires,+ })}// Marshal tokens- jsonData, err := json.Marshal(data)+ jsonData, err := json.Marshal(persisted)if err != nil {log.Error().Err(err).Msg("Failed to marshal CSRF tokens")return@@ -241,34 +243,48 @@ func (c *CSRFTokenStore) load() {return}- var tokens map[string]*CSRFTokenData- if err := json.Unmarshal(data, &tokens); err != nil {+ c.tokens = make(map[string]*CSRFToken)++ var current []*CSRFTokenData+ if err := json.Unmarshal(data, ¤t); err == nil {+ now := time.Now()+ for _, record := range current {+ if record == nil || now.After(record.ExpiresAt) {+ continue+ }+ c.tokens[record.SessionKey] = &CSRFToken{+ Hash: record.TokenHash,+ Expires: record.ExpiresAt,+ }+ }+ log.Info().+ Int("loaded", len(c.tokens)).+ Int("total", len(current)).+ Msg("CSRF tokens loaded from disk (hashed format)")+ return+ }++ var legacy map[string]*legacyCSRFTokenData+ if err := json.Unmarshal(data, &legacy); err != nil {log.Error().Err(err).Msg("Failed to unmarshal CSRF tokens")return}- // Filter out expired tokens and convert to internal formatnow := time.Now()loaded := 0- for sessionID, tokenData := range tokens {+ for sessionID, tokenData := range legacy {if now.Before(tokenData.ExpiresAt) {- c.tokens[sessionID] = &CSRFToken{- Token: tokenData.Token,+ key := csrfSessionKey(sessionID)+ c.tokens[key] = &CSRFToken{+ Hash: csrfTokenHash(tokenData.Token),Expires: tokenData.ExpiresAt,}loaded++}}- log.Info().Int("loaded", loaded).Int("total", len(tokens)).Msg("CSRF tokens loaded from disk")-}--// ClearAll removes all CSRF tokens (use carefully)-func (c *CSRFTokenStore) ClearAll() {- c.mu.Lock()- defer c.mu.Unlock()-- c.tokens = make(map[string]*CSRFToken)- c.saveUnsafe()- log.Info().Msg("All CSRF tokens cleared")+ log.Info().+ Int("loaded", loaded).+ Int("total", len(legacy)).+ Msg("CSRF tokens loaded from disk (legacy format migrated)")}diff --git a/internal/api/diagnostics.go b/internal/api/diagnostics.goindex 5201261ebb..1fe6322ea0 100644--- a/internal/api/diagnostics.go+++ b/internal/api/diagnostics.go@@ -54,18 +54,18 @@ type DiagnosticsInfo struct {// DiscoveryDiagnostic summarizes discovery configuration and recent activity.type DiscoveryDiagnostic struct {- Enabled bool `json:"enabled"`- ConfiguredSubnet string `json:"configuredSubnet,omitempty"`- ActiveSubnet string `json:"activeSubnet,omitempty"`- EnvironmentOverride string `json:"environmentOverride,omitempty"`- SubnetAllowlist []string `json:"subnetAllowlist"`- SubnetBlocklist []string `json:"subnetBlocklist"`- Scanning bool `json:"scanning"`- ScanInterval string `json:"scanInterval,omitempty"`- LastScanStartedAt string `json:"lastScanStartedAt,omitempty"`- LastResultTimestamp string `json:"lastResultTimestamp,omitempty"`- LastResultServers int `json:"lastResultServers,omitempty"`- LastResultErrors int `json:"lastResultErrors,omitempty"`+ Enabled bool `json:"enabled"`+ ConfiguredSubnet string `json:"configuredSubnet,omitempty"`+ ActiveSubnet string `json:"activeSubnet,omitempty"`+ EnvironmentOverride string `json:"environmentOverride,omitempty"`+ SubnetAllowlist []string `json:"subnetAllowlist"`+ SubnetBlocklist []string `json:"subnetBlocklist"`+ Scanning bool `json:"scanning"`+ ScanInterval string `json:"scanInterval,omitempty"`+ LastScanStartedAt string `json:"lastScanStartedAt,omitempty"`+ LastResultTimestamp string `json:"lastResultTimestamp,omitempty"`+ LastResultServers int `json:"lastResultServers,omitempty"`+ LastResultErrors int `json:"lastResultErrors,omitempty"`History []DiscoveryHistoryItem `json:"history,omitempty"`}@@ -234,19 +234,17 @@ type SystemDiagnostic struct {// TemperatureProxyDiagnostic summarizes proxy detection statetype TemperatureProxyDiagnostic struct {- LegacySSHDetected bool `json:"legacySSHDetected"`- RecommendProxyUpgrade bool `json:"recommendProxyUpgrade"`- SocketFound bool `json:"socketFound"`- SocketPath string `json:"socketPath,omitempty"`- SocketPermissions string `json:"socketPermissions,omitempty"`- SocketOwner string `json:"socketOwner,omitempty"`- SocketGroup string `json:"socketGroup,omitempty"`- ProxyReachable bool `json:"proxyReachable"`- ProxyVersion string `json:"proxyVersion,omitempty"`- ProxyPublicKeySHA256 string `json:"proxyPublicKeySha256,omitempty"`- ProxySSHDirectory string `json:"proxySshDirectory,omitempty"`- LegacySSHKeyCount int `json:"legacySshKeyCount,omitempty"`- Notes []string `json:"notes,omitempty"`+ SocketFound bool `json:"socketFound"`+ SocketPath string `json:"socketPath,omitempty"`+ SocketPermissions string `json:"socketPermissions,omitempty"`+ SocketOwner string `json:"socketOwner,omitempty"`+ SocketGroup string `json:"socketGroup,omitempty"`+ ProxyReachable bool `json:"proxyReachable"`+ ProxyVersion string `json:"proxyVersion,omitempty"`+ ProxyPublicKeySHA256 string `json:"proxyPublicKeySha256,omitempty"`+ ProxySSHDirectory string `json:"proxySshDirectory,omitempty"`+ LegacySSHKeyCount int `json:"legacySshKeyCount,omitempty"`+ Notes []string `json:"notes,omitempty"`}// APITokenDiagnostic reports on the state of the multi-token authentication system.@@ -396,8 +394,7 @@ func (r *Router) computeDiagnostics(ctx context.Context) DiagnosticsInfo {MemoryMB: memStats.Alloc / 1024 / 1024,}- legacySSH, recommendProxy := r.detectLegacySSH()- diag.TemperatureProxy = buildTemperatureProxyDiagnostic(r.config, legacySSH, recommendProxy)+ diag.TemperatureProxy = buildTemperatureProxyDiagnostic(r.config)diag.APITokens = buildAPITokenDiagnostic(r.config, r.monitor)// Test each configured node@@ -633,15 +630,15 @@ func buildDiscoveryDiagnostic(cfg *config.Config, monitor *monitoring.Monitor) *items := make([]DiscoveryHistoryItem, 0, len(history))for _, entry := range history {item := DiscoveryHistoryItem{- StartedAt: entry.startedAt.UTC().Format(time.RFC3339),- CompletedAt: entry.completedAt.UTC().Format(time.RFC3339),- Duration: entry.duration.Truncate(time.Millisecond).String(),- DurationMs: entry.duration.Milliseconds(),- Subnet: entry.subnet,- ServerCount: entry.serverCount,- ErrorCount: entry.errorCount,- BlocklistLength: entry.blocklistLength,- Status: entry.status,+ StartedAt: entry.StartedAt().UTC().Format(time.RFC3339),+ CompletedAt: entry.CompletedAt().UTC().Format(time.RFC3339),+ Duration: entry.Duration().Truncate(time.Millisecond).String(),+ DurationMs: entry.Duration().Milliseconds(),+ Subnet: entry.Subnet(),+ ServerCount: entry.ServerCount(),+ ErrorCount: entry.ErrorCount(),+ BlocklistLength: entry.BlocklistLength(),+ Status: entry.Status(),}items = append(items, item)}@@ -653,11 +650,8 @@ func buildDiscoveryDiagnostic(cfg *config.Config, monitor *monitoring.Monitor) *return discovery}-func buildTemperatureProxyDiagnostic(cfg *config.Config, legacyDetected, recommendProxy bool) *TemperatureProxyDiagnostic {- diag := &TemperatureProxyDiagnostic{- LegacySSHDetected: legacyDetected,- RecommendProxyUpgrade: recommendProxy,- }+func buildTemperatureProxyDiagnostic(cfg *config.Config) *TemperatureProxyDiagnostic {+ diag := &TemperatureProxyDiagnostic{}appendNote := func(note string) {if note == "" || contains(diag.Notes, note) {@@ -743,10 +737,6 @@ func buildTemperatureProxyDiagnostic(cfg *config.Config, legacyDetected, recomme}}- if diag.LegacySSHDetected && diag.RecommendProxyUpgrade {- appendNote("Legacy SSH temperature collection detected. Remove each node from Pulse and re-add it using the installer script copied from Settings → Nodes (or rerun the host installer script) to migrate to the secure proxy.")- }-return diag}diff --git a/internal/api/frontend_embed.go b/internal/api/frontend_embed.goindex 8cc0a91667..bb534298e3 100644--- a/internal/api/frontend_embed.go+++ b/internal/api/frontend_embed.go@@ -7,10 +7,10 @@ import ("net/http""net/http/httputil""net/url"- "os""strings""sync"+ "github.com/rcourtman/pulse-go-rewrite/internal/utils""github.com/rs/zerolog/log")@@ -23,12 +23,11 @@ var (devProxyOnce sync.OncedevProxy *httputil.ReverseProxydevProxyErr error- devProxyURL string)func getFrontendDevProxy() (*httputil.ReverseProxy, error) {devProxyOnce.Do(func() {- devURL := strings.TrimSpace(os.Getenv("FRONTEND_DEV_SERVER"))+ devURL := utils.GetenvTrim("FRONTEND_DEV_SERVER")if devURL == "" {return}@@ -45,8 +44,7 @@ func getFrontendDevProxy() (*httputil.ReverseProxy, error) {w.WriteHeader(http.StatusBadGateway)}devProxy = proxy- devProxyURL = target.String()- log.Warn().Str("frontend_dev_server", devProxyURL).Msg("Serving frontend via development proxy")+ log.Warn().Str("frontend_dev_server", target.String()).Msg("Serving frontend via development proxy")})if devProxyErr != nil {@@ -57,7 +55,7 @@ func getFrontendDevProxy() (*httputil.ReverseProxy, error) {// getFrontendFS returns the embedded frontend filesystemfunc getFrontendFS() (http.FileSystem, error) {- if dir := strings.TrimSpace(os.Getenv("PULSE_FRONTEND_DIR")); dir != "" {+ if dir := utils.GetenvTrim("PULSE_FRONTEND_DIR"); dir != "" {log.Warn().Str("frontend_dir", dir).Msg("Serving frontend from filesystem override")return http.Dir(dir), nil}diff --git a/internal/api/rate_limit_config.go b/internal/api/rate_limit_config.goindex c882694da2..bfab429235 100644--- a/internal/api/rate_limit_config.go+++ b/internal/api/rate_limit_config.go@@ -144,8 +144,8 @@ func UniversalRateLimitMiddleware(next http.Handler) http.Handler {// Extract client IPip := GetClientIP(r)- // Skip rate limiting for localhost/development- if ip == "127.0.0.1" || ip == "::1" || ip == "localhost" {+ // Skip rate limiting only for direct loopback requests (no proxy headers)+ if (ip == "127.0.0.1" || ip == "::1" || ip == "localhost") && isDirectLoopbackRequest(r) {next.ServeHTTP(w, r)return}diff --git a/internal/api/router.go b/internal/api/router.goindex d1e1e3e0e8..b416334637 100644--- a/internal/api/router.go+++ b/internal/api/router.go@@ -59,6 +59,28 @@ type Router struct {cachedAllowedOrigins stringpublicURLMu sync.MutexpublicURLDetected bool+ bootstrapTokenHash string+ bootstrapTokenPath string+}++func isDirectLoopbackRequest(req *http.Request) bool {+ if req == nil {+ return false+ }++ remote := extractRemoteIP(req.RemoteAddr)+ ip := net.ParseIP(remote)+ if ip == nil || !ip.IsLoopback() {+ return false+ }++ if req.Header.Get("X-Forwarded-For") != "" ||+ req.Header.Get("Forwarded") != "" ||+ req.Header.Get("X-Real-IP") != "" {+ return false+ }++ return true}// NewRouter creates a new router instance@@ -84,6 +106,8 @@ func NewRouter(cfg *config.Config, monitor *monitoring.Monitor, wsHub *websocketprojectRoot: projectRoot,}+ r.initializeBootstrapToken()+r.setupRoutes()// Start forwarding update progress to WebSocket@@ -263,9 +287,6 @@ func (r *Router) setupRoutes() {switch req.Method {case http.MethodGet:RequireAdmin(r.configHandlers.config, RequireScope(config.ScopeSettingsRead, r.configHandlers.HandleGetSystemSettings))(w, req)- case http.MethodPut:- // DEPRECATED - use /api/system/settings/update instead- RequireAdmin(r.configHandlers.config, RequireScope(config.ScopeSettingsWrite, r.configHandlers.HandleUpdateSystemSettingsOLD))(w, req)default:http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)}@@ -352,22 +373,31 @@ func (r *Router) setupRoutes() {credentialsEncrypted := true// Check network context- clientIP := utils.GetClientIP(- req.RemoteAddr,- req.Header.Get("X-Forwarded-For"),- req.Header.Get("X-Real-IP"),- )- isPrivateNetwork := utils.IsPrivateIP(clientIP)+ clientIP := GetClientIP(req)+ isPrivateNetwork := isPrivateIP(clientIP)// Get trusted networks from environmenttrustedNetworks := []string{}if nets := os.Getenv("PULSE_TRUSTED_NETWORKS"); nets != "" {trustedNetworks = strings.Split(nets, ",")}- isTrustedNetwork := utils.IsTrustedNetwork(clientIP, trustedNetworks)+ isTrustedNetwork := isTrustedNetwork(clientIP, trustedNetworks)++ // Determine whether the caller is authenticated before exposing sensitive fields+ isAuthenticated := false+ if cookie, err := req.Cookie("pulse_session"); err == nil && cookie.Value != "" && ValidateSession(cookie.Value) {+ isAuthenticated = true+ } else if token := strings.TrimSpace(req.Header.Get("X-API-Token")); token != "" {+ if _, ok := r.config.ValidateAPIToken(token); ok {+ isAuthenticated = true+ }+ }- // Create token hint if token exists- apiTokenHint := r.config.PrimaryAPITokenHint()+ // Create token hint if token exists (only revealed to authenticated callers)+ apiTokenHint := ""+ if isAuthenticated {+ apiTokenHint = r.config.PrimaryAPITokenHint()+ }// Check for proxy authhasProxyAuth := r.config.ProxyAuthSecret != ""@@ -415,11 +445,16 @@ func (r *Router) setupRoutes() {"proxyAuthLogoutURL": r.config.ProxyAuthLogoutURL,"proxyAuthUsername": proxyAuthUsername,"proxyAuthIsAdmin": proxyAuthIsAdmin,- "authUsername": r.config.AuthUser,- "authLastModified": authLastModified,+ "authUsername": "",+ "authLastModified": "","oidcUsername": oidcUsername,}+ if isAuthenticated {+ status["authUsername"] = r.config.AuthUser+ status["authLastModified"] = authLastModified+ }+if oidcCfg != nil {status["oidcEnabled"] = oidcCfg.Enabledstatus["oidcIssuer"] = oidcCfg.IssuerURL@@ -515,20 +550,21 @@ func (r *Router) setupRoutes() {// Recovery endpoint - requires localhost access OR valid recovery tokenr.mux.HandleFunc("/api/security/recovery", func(w http.ResponseWriter, req *http.Request) {// Get client IP- ip := strings.Split(req.RemoteAddr, ":")[0]- isLocalhost := ip == "127.0.0.1" || ip == "::1" || ip == "localhost"+ isLoopback := isDirectLoopbackRequest(req)+ clientIP := GetClientIP(req)// Check for recovery token in headerrecoveryToken := req.Header.Get("X-Recovery-Token")hasValidToken := falseif recoveryToken != "" {- hasValidToken = GetRecoveryTokenStore().ValidateRecoveryTokenConstantTime(recoveryToken, ip)+ hasValidToken = GetRecoveryTokenStore().ValidateRecoveryTokenConstantTime(recoveryToken, clientIP)}// Only allow from localhost OR with valid recovery token- if !isLocalhost && !hasValidToken {+ if !isLoopback && !hasValidToken {log.Warn().- Str("ip", ip).+ Str("ip", clientIP).+ Bool("direct_loopback", isLoopback).Bool("has_token", recoveryToken != "").Msg("Unauthorized recovery endpoint access attempt")http.Error(w, "Recovery endpoint requires localhost access or valid recovery token", http.StatusForbidden)@@ -552,7 +588,7 @@ func (r *Router) setupRoutes() {switch recoveryRequest.Action {case "generate_token":// Only allow token generation from localhost- if !isLocalhost {+ if !isLoopback {http.Error(w, "Token generation only allowed from localhost", http.StatusForbidden)return}@@ -573,7 +609,8 @@ func (r *Router) setupRoutes() {response["expires_in_minutes"] = durationresponse["message"] = fmt.Sprintf("Recovery token generated. Valid for %d minutes.", duration)log.Warn().- Str("ip", ip).+ Str("ip", clientIP).+ Bool("direct_loopback", isLoopback).Int("duration_minutes", duration).Msg("Recovery token generated")}@@ -581,7 +618,7 @@ func (r *Router) setupRoutes() {case "disable_auth":// Temporarily disable auth by creating recovery filerecoveryFile := filepath.Join(r.config.DataPath, ".auth_recovery")- content := fmt.Sprintf("Recovery mode enabled at %s\nAuth temporarily disabled for local access\nEnabled by: %s\n", time.Now().Format(time.RFC3339), ip)+ content := fmt.Sprintf("Recovery mode enabled at %s\nAuth temporarily disabled for local access\nEnabled by: %s\n", time.Now().Format(time.RFC3339), clientIP)if err := os.WriteFile(recoveryFile, []byte(content), 0600); err != nil {response["success"] = falseresponse["message"] = fmt.Sprintf("Failed to enable recovery mode: %v", err)@@ -589,7 +626,8 @@ func (r *Router) setupRoutes() {response["success"] = trueresponse["message"] = "Recovery mode enabled. Auth disabled for localhost. Delete .auth_recovery file to re-enable."log.Warn().- Str("ip", ip).+ Str("ip", clientIP).+ Bool("direct_loopback", isLoopback).Bool("via_token", hasValidToken).Msg("AUTH RECOVERY: Authentication disabled via recovery endpoint")}@@ -687,11 +725,9 @@ func (r *Router) setupRoutes() {return} else if !authRequired {// No auth configured - check if this is a homelab/private network- clientIP := utils.GetClientIP(req.RemoteAddr,- req.Header.Get("X-Forwarded-For"),- req.Header.Get("X-Real-IP"))+ clientIP := GetClientIP(req)- isPrivate := utils.IsPrivateIP(clientIP)+ isPrivate := isPrivateIP(clientIP)allowUnprotected := os.Getenv("ALLOW_UNPROTECTED_EXPORT") == "true"if !isPrivate && !allowUnprotected {@@ -783,11 +819,9 @@ func (r *Router) setupRoutes() {return} else if !authRequired {// No auth configured - check if this is a homelab/private network- clientIP := utils.GetClientIP(req.RemoteAddr,- req.Header.Get("X-Forwarded-For"),- req.Header.Get("X-Real-IP"))+ clientIP := GetClientIP(req)- isPrivate := utils.IsPrivateIP(clientIP)+ isPrivate := isPrivateIP(clientIP)allowUnprotected := os.Getenv("ALLOW_UNPROTECTED_EXPORT") == "true"if !isPrivate && !allowUnprotected {@@ -863,10 +897,6 @@ func (r *Router) setupRoutes() {// Notification routesr.mux.HandleFunc("/api/notifications/", RequireAdmin(r.config, r.notificationHandlers.HandleNotifications))- // Settings routes- r.mux.HandleFunc("/api/settings", RequireAdmin(r.config, RequireScope(config.ScopeSettingsRead, getSettings)))- r.mux.HandleFunc("/api/settings/update", RequireAdmin(r.config, RequireScope(config.ScopeSettingsWrite, updateSettings)))-// System settings and API token managementr.systemSettingsHandler = NewSystemSettingsHandler(r.config, r.persistence, r.wsHub, r.monitor, r.reloadSystemSettings)r.mux.HandleFunc("/api/system/settings", RequireAdmin(r.config, RequireScope(config.ScopeSettingsRead, r.systemSettingsHandler.HandleGetSystemSettings)))@@ -878,6 +908,7 @@ func (r *Router) setupRoutes() {// Docker agent download endpointsr.mux.HandleFunc("/install-docker-agent.sh", r.handleDownloadInstallScript)+ r.mux.HandleFunc("/install-container-agent.sh", r.handleDownloadContainerAgentInstallScript)r.mux.HandleFunc("/download/pulse-docker-agent", r.handleDownloadAgent)// Host agent download endpoints@@ -1160,21 +1191,23 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {// Check if we need authenticationneedsAuth := true+ clientIP := GetClientIP(req)// Recovery mechanism: Check if recovery mode is enabledrecoveryFile := filepath.Join(r.config.DataPath, ".auth_recovery")if _, err := os.Stat(recoveryFile); err == nil {// Recovery mode is enabled - allow local access only- ip := strings.Split(req.RemoteAddr, ":")[0]log.Debug().Str("recovery_file", recoveryFile).- Str("remote_ip", ip).+ Str("client_ip", clientIP).+ Str("remote_addr", req.RemoteAddr).Str("path", req.URL.Path).Bool("file_exists", err == nil).Msg("Checking auth recovery mode")- if ip == "127.0.0.1" || ip == "::1" || ip == "localhost" {+ if isDirectLoopbackRequest(req) {log.Warn().Str("recovery_file", recoveryFile).+ Str("client_ip", clientIP).Msg("AUTH RECOVERY MODE: Allowing local access without authentication")// Allow access but add a warning headerw.Header().Set("X-Auth-Recovery", "true")@@ -1198,6 +1231,7 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {"/api/oidc/login",config.DefaultOIDCCallbackPath,"/install-docker-agent.sh", // Docker agent bootstrap script must be public+ "/install-container-agent.sh", // Container agent bootstrap script must be public"/download/pulse-docker-agent", // Agent binary download should not require auth"/install-host-agent.sh", // Host agent bootstrap script must be public"/install-host-agent.ps1", // Host agent PowerShell script must be public@@ -1265,16 +1299,11 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {isPublic = true}- // Special case: quick-setup should be accessible to check if already configured- // The handler itself will verify if setup should be skipped- if normalizedPath == "/api/security/quick-setup" && req.Method == http.MethodPost {- isPublic = true- }// Dev mode bypass for admin endpoints (disabled by default)- if os.Getenv("ALLOW_ADMIN_BYPASS") == "1" {- log.Info().+ if adminBypassEnabled() {+ log.Debug().Str("path", req.URL.Path).- Msg("=== ADMIN BYPASS ENABLED - SKIPPING GLOBAL AUTH ===")+ Msg("Admin bypass enabled - skipping global auth")needsAuth = false}@@ -1333,6 +1362,7 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {strings.HasPrefix(req.URL.Path, "/download/") ||req.URL.Path == "/simple-stats" ||req.URL.Path == "/install-docker-agent.sh" ||+ req.URL.Path == "/install-container-agent.sh" ||req.URL.Path == "/install-host-agent.sh" ||req.URL.Path == "/install-host-agent.ps1" ||req.URL.Path == "/uninstall-host-agent.ps1" {@@ -1501,112 +1531,6 @@ func shouldAppendForwardedPort(port, scheme string) bool {return true}-// detectLegacySSH checks if Pulse is using legacy SSH for temperature monitoring-//-// ⚠️ MIGRATION SCAFFOLDING - TEMPORARY CODE-// This detection exists only to handle migration from legacy SSH-in-container-// to the secure pulse-sensor-proxy architecture introduced in v4.23.0.-//-// REMOVAL CRITERIA: Remove after v5.0 or when banner telemetry shows <1% fire rate-// for 30+ days. This code serves no functional purpose beyond migration assistance.-//-// Can be disabled via environment variable: PULSE_LEGACY_DETECTION=false-func (r *Router) detectLegacySSH() (legacyDetected, recommendProxy bool) {- // Check if detection is disabled via environment variable- if os.Getenv("PULSE_LEGACY_DETECTION") == "false" {- return false, false- }-- // Check if running in a container using multiple detection methods- inContainer := false-- // Method 1: Check for /.dockerenv (Docker)- if _, err := os.Stat("/.dockerenv"); err == nil {- inContainer = true- }-- // Method 2: Check /proc/1/cgroup (Docker/LXC)- if !inContainer {- if data, err := os.ReadFile("/proc/1/cgroup"); err == nil {- cgroupStr := string(data)- if strings.Contains(cgroupStr, "docker") ||- strings.Contains(cgroupStr, "lxc") ||- strings.Contains(cgroupStr, "/docker/") ||- strings.Contains(cgroupStr, "/lxc/") {- inContainer = true- }- }- }-- // Method 3: Check /run/systemd/container (systemd containers)- if !inContainer {- if _, err := os.Stat("/run/systemd/container"); err == nil {- inContainer = true- }- }-- // Method 4: Check /proc/1/environ for container indicators- if !inContainer {- if data, err := os.ReadFile("/proc/1/environ"); err == nil {- environStr := string(data)- if strings.Contains(environStr, "container=") ||- strings.Contains(environStr, "DOCKER") ||- strings.Contains(environStr, "LXC") {- inContainer = true- }- }- }-- // If not in container, no need for proxy- if !inContainer {- return false, false- }-- // Check if SSH keys are configured in the data directory- sshKeysConfigured := false-- // Check for SSH keys in the configured data directory- dataDir := r.config.DataPath- if dataDir == "" {- dataDir = "/etc/pulse"- }-- sshPrivKeyPath := filepath.Join(dataDir, ".ssh", "id_ed25519")- if _, err := os.Stat(sshPrivKeyPath); err == nil {- sshKeysConfigured = true- }-- // Also check for RSA keys- sshPrivKeyPathRSA := filepath.Join(dataDir, ".ssh", "id_rsa")- if _, err := os.Stat(sshPrivKeyPathRSA); err == nil {- sshKeysConfigured = true- }-- // If SSH keys exist, check if proxy is configured vs just temporarily down- if sshKeysConfigured {- // Check if pulse-sensor-proxy is available via unix socket- proxySocket := "/run/pulse-sensor-proxy/sensor.sock"- proxyBinary := "/usr/local/bin/pulse-sensor-proxy"-- // If socket doesn't exist, need to distinguish:- // - Legacy setup: proxy never installed (binary doesn't exist)- // - Migrated setup: proxy installed but temporarily down- if _, err := os.Stat(proxySocket); err != nil {- // Socket missing - check if proxy was ever installed- if _, err := os.Stat(proxyBinary); err != nil {- // Proxy binary doesn't exist - this is legacy SSH setup- // User needs to remove nodes and re-add them- return true, true- }- // Proxy binary exists but socket is missing - likely just restarting/down- // Don't show banner - this is a transient issue, not a configuration problem- return false, false- }- }-- return false, false-}-// handleHealth handles health check requestsfunc (r *Router) handleHealth(w http.ResponseWriter, req *http.Request) {if req.Method != http.MethodGet && req.Method != http.MethodHead {@@ -1614,28 +1538,12 @@ func (r *Router) handleHealth(w http.ResponseWriter, req *http.Request) {return}- // Detect legacy SSH setup- legacySSH, recommendProxy := r.detectLegacySSH()-- // Log when legacy SSH is detected for telemetry/metrics- // This helps track removal criteria: <1% detection rate for 30+ days- if legacySSH && recommendProxy {- log.Warn().- Str("detection_type", "legacy_ssh_migration").- Msg("Legacy SSH configuration detected - user should migrate to proxy architecture")- }-- // Check for dev mode SSH override (FOR TESTING ONLY - NEVER in production)- devModeSSH := os.Getenv("PULSE_DEV_ALLOW_CONTAINER_SSH") == "true"-response := HealthResponse{Status: "healthy",Timestamp: time.Now().Unix(),Uptime: time.Since(r.monitor.GetStartTime()).Seconds(),- LegacySSHDetected: legacySSH,- RecommendProxyUpgrade: recommendProxy,- ProxyInstallScriptAvailable: true, // Install script is always available- DevModeSSH: devModeSSH,+ ProxyInstallScriptAvailable: true,+ DevModeSSH: os.Getenv("PULSE_DEV_ALLOW_CONTAINER_SSH") == "true",}if err := utils.WriteJSONResponse(w, response); err != nil {@@ -2185,6 +2093,13 @@ func (r *Router) handleResetLockout(w http.ResponseWriter, req *http.Request) {return}+ if !CheckAuth(r.config, w, req) {+ return+ }+ if !ensureSettingsWriteScope(w, req) {+ return+ }+// Parse requestvar resetReq struct {Identifier string `json:"identifier"` // Can be username or IP@@ -2228,14 +2143,12 @@ func (r *Router) handleResetLockout(w http.ResponseWriter, req *http.Request) {// handleState handles state requestsfunc (r *Router) handleState(w http.ResponseWriter, req *http.Request) {- log.Debug().Msg("[DEBUG] handleState: START")if req.Method != http.MethodGet {writeErrorResponse(w, http.StatusMethodNotAllowed, "method_not_allowed","Only GET method is allowed", nil)return}- log.Debug().Msg("[DEBUG] handleState: Before auth check")// Use standard auth check (supports both basic auth and API tokens) unless auth is disabledif !CheckAuth(r.config, w, req) {writeErrorResponse(w, http.StatusUnauthorized, "unauthorized",@@ -2248,18 +2161,14 @@ func (r *Router) handleState(w http.ResponseWriter, req *http.Request) {return}- log.Debug().Msg("[DEBUG] handleState: Before GetState")state := r.monitor.GetState()- log.Debug().Msg("[DEBUG] handleState: After GetState, before ToFrontend")frontendState := state.ToFrontend()- log.Debug().Msg("[DEBUG] handleState: Before WriteJSONResponse")if err := utils.WriteJSONResponse(w, frontendState); err != nil {log.Error().Err(err).Msg("Failed to encode state response")writeErrorResponse(w, http.StatusInternalServerError, "encoding_error","Failed to encode state data", nil)}- log.Debug().Msg("[DEBUG] handleState: END")}// handleVersion handles version requests@@ -3163,6 +3072,22 @@ func (r *Router) handleDownloadInstallScript(w http.ResponseWriter, req *http.Rehttp.ServeFile(w, req, scriptPath)}+// handleDownloadContainerAgentInstallScript serves the container agent install script+func (r *Router) handleDownloadContainerAgentInstallScript(w http.ResponseWriter, req *http.Request) {+ if req.Method != http.MethodGet {+ http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)+ return+ }++ // Prevent caching - always serve the latest version+ w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")+ w.Header().Set("Pragma", "no-cache")+ w.Header().Set("Expires", "0")++ scriptPath := "/opt/pulse/scripts/install-container-agent.sh"+ http.ServeFile(w, req, scriptPath)+}+// handleDownloadAgent serves the Docker agent binaryfunc (r *Router) handleDownloadAgent(w http.ResponseWriter, req *http.Request) {if req.Method != http.MethodGet {@@ -3465,7 +3390,7 @@ func (r *Router) handleDiagnosticsDockerPrepareToken(w http.ResponseWriter, req}baseURL := strings.TrimRight(r.resolvePublicURL(req), "/")- installCommand := fmt.Sprintf("curl -fsSL %s/install-docker-agent.sh | bash -s -- --url %s --token %s", baseURL, baseURL, rawToken)+ installCommand := fmt.Sprintf("curl -fSL '%s/install-docker-agent.sh' -o /tmp/pulse-install-docker-agent.sh && sudo bash /tmp/pulse-install-docker-agent.sh --url '%s' --token '%s' && rm -f /tmp/pulse-install-docker-agent.sh", baseURL, baseURL, rawToken)systemdSnippet := fmt.Sprintf("[Service]\nType=simple\nEnvironment=\"PULSE_URL=%s\"\nEnvironment=\"PULSE_TOKEN=%s\"\nExecStart=/usr/local/bin/pulse-docker-agent --url %s --interval 30s\nRestart=always\nRestartSec=5s\nUser=root", baseURL, rawToken, baseURL)response := map[string]any{diff --git a/internal/api/router_integration_test.go b/internal/api/router_integration_test.goindex d58f300577..5b1b68005e 100644--- a/internal/api/router_integration_test.go+++ b/internal/api/router_integration_test.go@@ -495,6 +495,81 @@ func TestAuthenticatedEndpointsRequireToken(t *testing.T) {}}+func TestAPITokenQueryParameterRejected(t *testing.T) {+ const apiToken = "query-token-1234567890"++ srv := newIntegrationServerWithConfig(t, func(cfg *config.Config) {+ cfg.APITokenEnabled = true+ record, err := config.NewAPITokenRecord(apiToken, "Query token test", nil)+ if err != nil {+ t.Fatalf("create API token record: %v", err)+ }+ cfg.APITokens = []config.APITokenRecord{*record}+ cfg.SortAPITokens()+ })++ queryURL := srv.server.URL + "/api/state?token=" + apiToken+ res, err := http.Get(queryURL)+ if err != nil {+ t.Fatalf("query parameter request failed: %v", err)+ }+ res.Body.Close()+ if res.StatusCode != http.StatusUnauthorized {+ t.Fatalf("expected 401 when token supplied via query string, got %d", res.StatusCode)+ }++ req, err := http.NewRequest(http.MethodGet, srv.server.URL+"/api/state", nil)+ if err != nil {+ t.Fatalf("create header-auth request: %v", err)+ }+ req.Header.Set("X-API-Token", apiToken)+ res, err = http.DefaultClient.Do(req)+ if err != nil {+ t.Fatalf("header-auth request failed: %v", err)+ }+ defer res.Body.Close()+ if res.StatusCode != http.StatusOK {+ t.Fatalf("expected 200 with header token, got %d", res.StatusCode)+ }+}++func TestRecoveryEndpointRequiresDirectLoopback(t *testing.T) {+ srv := newIntegrationServer(t)++ generateBody := strings.NewReader(`{"action":"generate_token"}`)+ req, err := http.NewRequest(http.MethodPost, srv.server.URL+"/api/security/recovery", generateBody)+ if err != nil {+ t.Fatalf("create generate token request: %v", err)+ }+ req.Header.Set("Content-Type", "application/json")++ res, err := http.DefaultClient.Do(req)+ if err != nil {+ t.Fatalf("generate token request failed: %v", err)+ }+ defer res.Body.Close()+ if res.StatusCode != http.StatusOK {+ t.Fatalf("expected 200 generating token from loopback, got %d", res.StatusCode)+ }++ forwardedBody := strings.NewReader(`{"action":"generate_token"}`)+ reqForwarded, err := http.NewRequest(http.MethodPost, srv.server.URL+"/api/security/recovery", forwardedBody)+ if err != nil {+ t.Fatalf("create forwarded request: %v", err)+ }+ reqForwarded.Header.Set("Content-Type", "application/json")+ reqForwarded.Header.Set("X-Forwarded-For", "198.51.100.42")++ resForwarded, err := http.DefaultClient.Do(reqForwarded)+ if err != nil {+ t.Fatalf("forwarded recovery request failed: %v", err)+ }+ defer resForwarded.Body.Close()+ if resForwarded.StatusCode != http.StatusForbidden {+ t.Fatalf("expected 403 when forwarded headers present, got %d", resForwarded.StatusCode)+ }+}+func TestWebSocketSendsInitialState(t *testing.T) {srv := newIntegrationServer(t)diff --git a/internal/api/security.go b/internal/api/security.goindex 0ba4d7bc98..0d09eeac42 100644--- a/internal/api/security.go+++ b/internal/api/security.go@@ -1,24 +1,18 @@package apiimport (+ "net""net/http""strings""sync""time"+ "github.com/rcourtman/pulse-go-rewrite/internal/utils""github.com/rs/zerolog/log")// Security improvements for Pulse-// CSRF Protection-type CSRFToken struct {- Token string- Expires time.Time-}--// CSRF tokens are now managed by the persistent CSRFTokenStore-// generateCSRFToken creates a new CSRF token for a sessionfunc generateCSRFToken(sessionID string) string {return GetCSRFStore().GenerateCSRFToken(sessionID)@@ -60,67 +54,43 @@ func CheckCSRF(w http.ResponseWriter, r *http.Request) bool {csrfToken = r.FormValue("csrf_token")}- // If no CSRF token is provided, check if this is a valid session- // This handles the case where the server restarted and lost CSRF tokens+ // No CSRF token means request is not eligible for mutationif csrfToken == "" {- // No CSRF token provided - this is definitely invalidlog.Warn().Str("path", r.URL.Path).Str("session", cookie.Value[:8]+"...").Msg("Missing CSRF token")+ clearCSRFCookie(w)return false}// Check if the CSRF token validatesif !validateCSRFToken(cookie.Value, csrfToken) {- // CSRF validation failed, but check if session is still valid- // If session is valid but CSRF token doesn't match, it might be due to server restart- if ValidateSession(cookie.Value) {- // Valid session but mismatched CSRF - likely server restart- // Generate a new CSRF token for this session- newToken := generateCSRFToken(cookie.Value)-- // Detect if we're behind a proxy/tunnel- isProxied := r.Header.Get("X-Forwarded-For") != "" ||- r.Header.Get("X-Real-IP") != "" ||- r.Header.Get("CF-Ray") != "" ||- r.Header.Get("X-Forwarded-Proto") != ""-- sameSitePolicy := http.SameSiteStrictMode- if isProxied {- sameSitePolicy = http.SameSiteNoneMode- }-- isSecure := r.TLS != nil || r.Header.Get("X-Forwarded-Proto") == "https"-- // Set the new CSRF token as a cookie- http.SetCookie(w, &http.Cookie{- Name: "pulse_csrf",- Value: newToken,- Path: "/",- Secure: isSecure,- SameSite: sameSitePolicy,- MaxAge: 86400, // 24 hours- })- // For this request, we'll be lenient and allow it through- log.Debug().- Str("path", r.URL.Path).- Str("session", cookie.Value[:8]+"...").- Msg("Regenerated CSRF token after server restart")- return true- }-log.Warn().Str("path", r.URL.Path).Str("session", cookie.Value[:8]+"...").Str("provided_token", csrfToken[:8]+"...").Msg("Invalid CSRF token")+ clearCSRFCookie(w)return false}return true}+func clearCSRFCookie(w http.ResponseWriter) {+ if w == nil {+ return+ }+ http.SetCookie(w, &http.Cookie{+ Name: "pulse_csrf",+ Value: "",+ Path: "/",+ MaxAge: -1,+ HttpOnly: false,+ })+}+// Rate Limiting - using existing RateLimiter from ratelimit.govar (// Auth endpoints: 10 attempts per minute@@ -132,28 +102,23 @@ var (// GetClientIP extracts the client IP from the requestfunc GetClientIP(r *http.Request) string {- // Check X-Forwarded-For header- xff := r.Header.Get("X-Forwarded-For")- if xff != "" {- // Take the first IP in the chain- parts := strings.Split(xff, ",")- if len(parts) > 0 {- return strings.TrimSpace(parts[0])- }+ rawRemoteIP := extractRemoteIP(r.RemoteAddr)+ if rawRemoteIP == "" {+ return ""}- // Check X-Real-IP header- xri := r.Header.Get("X-Real-IP")- if xri != "" {- return xri- }+ // Only trust proxy headers when the immediate peer is trusted.+ if isTrustedProxyIP(rawRemoteIP) {+ if forwarded := firstValidForwardedIP(r.Header.Get("X-Forwarded-For")); forwarded != "" {+ return forwarded+ }- // Fall back to RemoteAddr- addr := r.RemoteAddr- if idx := strings.LastIndex(addr, ":"); idx != -1 {- return addr[:idx]+ if realIP := strings.TrimSpace(strings.Trim(r.Header.Get("X-Real-IP"), "[]")); realIP != "" && net.ParseIP(realIP) != nil {+ return realIP+ }}- return addr++ return rawRemoteIP}// Failed Login Tracking@@ -169,8 +134,173 @@ var (maxFailedAttempts = 5lockoutDuration = 15 * time.Minute++ trustedProxyOnce sync.Once+ trustedProxyCIDRs []*net.IPNet)+func loadTrustedProxyCIDRs() {+ raw := utils.GetenvTrim("PULSE_TRUSTED_PROXY_CIDRS")+ if raw == "" {+ return+ }++ for _, entry := range strings.Split(raw, ",") {+ entry = strings.TrimSpace(entry)+ if entry == "" {+ continue+ }++ if strings.Contains(entry, "/") {+ _, network, parseErr := net.ParseCIDR(entry)+ if parseErr == nil {+ network.IP = network.IP.Mask(network.Mask)+ trustedProxyCIDRs = append(trustedProxyCIDRs, network)+ continue+ }+ log.Warn().+ Str("cidr", entry).+ Err(parseErr).+ Msg("Ignoring invalid CIDR in PULSE_TRUSTED_PROXY_CIDRS")+ continue+ }++ ip := net.ParseIP(entry)+ if ip == nil {+ log.Warn().+ Str("value", entry).+ Msg("Ignoring invalid IP in PULSE_TRUSTED_PROXY_CIDRS")+ continue+ }++ bits := 32+ if ip.To4() == nil {+ bits = 128+ }+ mask := net.CIDRMask(bits, bits)+ network := &net.IPNet{IP: ip.Mask(mask), Mask: mask}+ trustedProxyCIDRs = append(trustedProxyCIDRs, network)+ }+}++func extractRemoteIP(remoteAddr string) string {+ if remoteAddr == "" {+ return ""+ }+ if host, _, err := net.SplitHostPort(remoteAddr); err == nil {+ return strings.Trim(host, "[]")+ }+ return strings.Trim(remoteAddr, "[]")+}++func firstValidForwardedIP(header string) string {+ if header == "" {+ return ""+ }+ for _, part := range strings.Split(header, ",") {+ part = strings.TrimSpace(strings.Trim(part, "[]"))+ if part == "" {+ continue+ }++ if net.ParseIP(part) != nil {+ return part+ }+ }+ return ""+}++func isTrustedProxyIP(ipStr string) bool {+ ipStr = strings.TrimSpace(strings.Trim(ipStr, "[]"))+ if ipStr == "" {+ return false+ }+ ip := net.ParseIP(ipStr)+ if ip == nil {+ return false+ }++ trustedProxyOnce.Do(loadTrustedProxyCIDRs)+ if len(trustedProxyCIDRs) == 0 {+ return false+ }+ for _, network := range trustedProxyCIDRs {+ if network.Contains(ip) {+ return true+ }+ }++ return false+}++func isPrivateIP(ip string) bool {+ host := extractRemoteIP(ip)+ if host == "" {+ return false+ }++ parsedIP := net.ParseIP(host)+ if parsedIP == nil {+ return false+ }++ if parsedIP.IsLoopback() ||+ parsedIP.IsLinkLocalUnicast() ||+ parsedIP.IsLinkLocalMulticast() {+ return true+ }++ privateRanges := []string{+ "10.0.0.0/8",+ "172.16.0.0/12",+ "192.168.0.0/16",+ "127.0.0.0/8",+ "::1/128",+ "fc00::/7",+ "fe80::/10",+ }++ for _, cidr := range privateRanges {+ _, network, err := net.ParseCIDR(cidr)+ if err != nil {+ continue+ }+ if network.Contains(parsedIP) {+ return true+ }+ }++ return false+}++func isTrustedNetwork(ip string, trustedNetworks []string) bool {+ if len(trustedNetworks) == 0 {+ return isPrivateIP(ip)+ }++ host := extractRemoteIP(ip)+ if host == "" {+ return false+ }++ parsedIP := net.ParseIP(host)+ if parsedIP == nil {+ return false+ }++ for _, cidr := range trustedNetworks {+ _, network, err := net.ParseCIDR(strings.TrimSpace(cidr))+ if err != nil {+ continue+ }+ if network.Contains(parsedIP) {+ return true+ }+ }++ return false+}+// RecordFailedLogin tracks failed login attemptsfunc RecordFailedLogin(identifier string) {failedMu.Lock()diff --git a/internal/api/security_setup_fix.go b/internal/api/security_setup_fix.goindex 4a1657c0af..7e17074dce 100644--- a/internal/api/security_setup_fix.go+++ b/internal/api/security_setup_fix.go@@ -52,7 +52,41 @@ func isRunningAsRoot() bool {return os.Geteuid() == 0}+func ensureSettingsWriteScope(w http.ResponseWriter, req *http.Request) bool {+ record := getAPITokenRecordFromRequest(req)+ if record == nil {+ return true+ }+ if record.HasScope(config.ScopeSettingsWrite) {+ return true+ }++ log.Warn().+ Str("token_id", record.ID).+ Str("path", req.URL.Path).+ Msg("API token missing settings:write scope for privileged operation")+ respondMissingScope(w, config.ScopeSettingsWrite)+ return false+}+// handleQuickSecuritySetupFixed is the fixed version of the Quick Security Setup+type responseCapture struct {+ http.ResponseWriter+ wrote bool+}++func (rc *responseCapture) WriteHeader(statusCode int) {+ if !rc.wrote {+ rc.wrote = true+ }+ rc.ResponseWriter.WriteHeader(statusCode)+}++func (rc *responseCapture) Write(b []byte) (int, error) {+ rc.wrote = true+ return rc.ResponseWriter.Write(b)+}+func handleQuickSecuritySetupFixed(r *Router) http.HandlerFunc {return func(w http.ResponseWriter, req *http.Request) {if req.Method != http.MethodPost {@@ -76,6 +110,7 @@ func handleQuickSecuritySetupFixed(r *Router) http.HandlerFunc {EnableNotifications bool `json:"enableNotifications"`DarkMode bool `json:"darkMode"`Force bool `json:"force"`+ SetupToken string `json:"setupToken"`}if err := json.NewDecoder(req.Body).Decode(&setupRequest); err != nil {@@ -83,11 +118,91 @@ func handleQuickSecuritySetupFixed(r *Router) http.HandlerFunc {return}- if r.config.DisableAuthEnvDetected {- setupRequest.Force = true+ authConfigured := r.config.AuthUser != "" && r.config.AuthPass != ""+ setupCompleted := false+ defer func() {+ if setupCompleted {+ r.clearBootstrapToken()+ }+ }()+ forceRequested := setupRequest.Force+ if r.config.DisableAuthEnvDetected && !authConfigured {+ forceRequested = true+ }++ clientIP = GetClientIP(req)+ recoveryToken := strings.TrimSpace(req.Header.Get("X-Recovery-Token"))+ recoveryAuthorized := false+ if recoveryToken != "" {+ if GetRecoveryTokenStore().ValidateRecoveryTokenConstantTime(recoveryToken, clientIP) {+ recoveryAuthorized = true+ log.Warn().+ Str("ip", clientIP).+ Msg("Quick security setup invoked using recovery token")+ } else {+ log.Warn().+ Str("ip", clientIP).+ Msg("Invalid recovery token for quick security setup")+ }+ }++ authorized := recoveryAuthorized++ if !authorized && (authConfigured || forceRequested) {+ wrapped := &responseCapture{ResponseWriter: w}+ if CheckAuth(r.config, wrapped, req) {+ authorized = true+ } else {+ if !wrapped.wrote {+ http.Error(w, "Authentication required to modify existing security settings", http.StatusUnauthorized)+ }+ return+ }+ }++ if !authorized && !authConfigured {+ if r.bootstrapTokenHash == "" {+ log.Error().Msg("Bootstrap setup token unavailable; refusing unauthenticated quick setup")+ http.Error(w, "Bootstrap token unavailable; restart Pulse or inspect data directory", http.StatusServiceUnavailable)+ return+ }++ providedToken := strings.TrimSpace(req.Header.Get(bootstrapTokenHeader))+ if providedToken == "" {+ providedToken = strings.TrimSpace(setupRequest.SetupToken)+ }++ if providedToken == "" {+ http.Error(w, "Bootstrap setup token required", http.StatusUnauthorized)+ return+ }++ if !r.bootstrapTokenValid(providedToken) {+ log.Warn().+ Str("ip", clientIP).+ Msg("Rejected quick setup with invalid bootstrap token")+ http.Error(w, "Invalid bootstrap setup token", http.StatusUnauthorized)+ return+ }++ authorized = true}- if r.config.AuthUser != "" && r.config.AuthPass != "" && !setupRequest.Force {+ if authConfigured && !authorized {+ log.Warn().+ Str("ip", clientIP).+ Msg("Unauthorized quick security setup attempt rejected")+ http.Error(w, "Authentication required to modify existing security settings", http.StatusUnauthorized)+ return+ }++ if authorized && !ensureSettingsWriteScope(w, req) {+ return+ }++ setupRequest.Force = forceRequested && authorized++ if authConfigured && !setupRequest.Force {log.Info().Msg("Security setup skipped - password auth already configured")response := map[string]interface{}{"success": true,@@ -222,6 +337,7 @@ PULSE_AUDIT_LOG=true}w.Header().Set("Content-Type", "application/json")+ setupCompleted = truejson.NewEncoder(w).Encode(response)} else if isSystemd && !isRoot {@@ -273,6 +389,7 @@ PULSE_AUDIT_LOG=true}w.Header().Set("Content-Type", "application/json")+ setupCompleted = truejson.NewEncoder(w).Encode(response)} else if isSystemd && isRoot {@@ -321,6 +438,7 @@ Environment="PULSE_AUDIT_LOG=true"}w.Header().Set("Content-Type", "application/json")+ setupCompleted = truejson.NewEncoder(w).Encode(response)} else {@@ -364,6 +482,7 @@ PULSE_AUDIT_LOG=true}w.Header().Set("Content-Type", "application/json")+ setupCompleted = truejson.NewEncoder(w).Encode(response)}}@@ -371,46 +490,16 @@ PULSE_AUDIT_LOG=true// HandleRegenerateAPIToken generates a new API token and updates the .env filefunc (r *Router) HandleRegenerateAPIToken(w http.ResponseWriter, rq *http.Request) {- // Require authentication when password auth is configured- if (r.config.AuthUser != "" || r.config.AuthPass != "") && !CheckAuth(r.config, w, rq) {+ if rq.Method != http.MethodPost {+ http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)return}- // Check if using proxy auth and if so, verify admin status- if r.config.ProxyAuthSecret != "" {- valid, username, isAdmin := CheckProxyAuth(r.config, rq)- if !valid {- // Proxy auth is configured but validation failed - reject immediately- log.Warn().- Str("ip", rq.RemoteAddr).- Str("path", rq.URL.Path).- Str("method", rq.Method).- Msg("Proxy authentication failed for API token regeneration")-- w.Header().Set("Content-Type", "application/json")- w.WriteHeader(http.StatusUnauthorized)- w.Write([]byte(`{"error":"Authentication required"}`))- return- }- if !isAdmin {- // User is authenticated but not an admin- log.Warn().- Str("ip", rq.RemoteAddr).- Str("path", rq.URL.Path).- Str("method", rq.Method).- Str("username", username).- Msg("Non-admin user attempted to regenerate API token")-- // Return forbidden error- w.Header().Set("Content-Type", "application/json")- w.WriteHeader(http.StatusForbidden)- w.Write([]byte(`{"error":"Admin privileges required"}`))- return- }+ if !CheckAuth(r.config, w, rq) {+ return}- if rq.Method != http.MethodPost {- http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)+ if !ensureSettingsWriteScope(w, rq) {return}@@ -523,42 +612,12 @@ func (r *Router) HandleValidateAPIToken(w http.ResponseWriter, rq *http.Request)}// Require authentication to prevent unauthenticated token guessing oracle- // Use same auth logic as regenerate-token endpoint- if (r.config.AuthUser != "" || r.config.AuthPass != "") && !CheckAuth(r.config, w, rq) {+ if !CheckAuth(r.config, w, rq) {return}- // Check if using proxy auth and if so, verify admin status- if r.config.ProxyAuthSecret != "" {- valid, username, isAdmin := CheckProxyAuth(r.config, rq)- if !valid {- // Proxy auth is configured but validation failed - reject immediately- log.Warn().- Str("ip", rq.RemoteAddr).- Str("path", rq.URL.Path).- Str("method", rq.Method).- Msg("Proxy authentication failed for API token validation")-- w.Header().Set("Content-Type", "application/json")- w.WriteHeader(http.StatusUnauthorized)- w.Write([]byte(`{"error":"Authentication required"}`))- return- }- if !isAdmin {- // User is authenticated but not an admin- log.Warn().- Str("ip", rq.RemoteAddr).- Str("path", rq.URL.Path).- Str("method", rq.Method).- Str("username", username).- Msg("Non-admin user attempted to validate API token")-- // Return forbidden error- w.Header().Set("Content-Type", "application/json")- w.WriteHeader(http.StatusForbidden)- w.Write([]byte(`{"error":"Admin privileges required"}`))- return- }+ if !ensureSettingsWriteScope(w, rq) {+ return}// Apply rate limiting to prevent brute force attacksdiff --git a/internal/api/security_setup_fix_test.go b/internal/api/security_setup_fix_test.gonew file mode 100644index 0000000000..19bae19633--- /dev/null+++ b/internal/api/security_setup_fix_test.go@@ -0,0 +1,347 @@+package api++import (+ "errors"+ "net/http"+ "net/http/httptest"+ "os"+ "path/filepath"+ "strings"+ "sync"+ "testing"+ "time"++ internalauth "github.com/rcourtman/pulse-go-rewrite/internal/auth"+ "github.com/rcourtman/pulse-go-rewrite/internal/config"+)++func resetRecoveryStore() {+ recoveryStore = nil+ recoveryStoreOnce = sync.Once{}+}++func TestQuickSecuritySetupRejectsUnauthenticatedForce(t *testing.T) {+ t.Setenv("PULSE_TRUSTED_PROXY_CIDRS", "")+ resetTrustedProxyConfig()++ hashed, err := internalauth.HashPassword("OldPassword!1")+ if err != nil {+ t.Fatalf("hash password: %v", err)+ }++ cfg := &config.Config{+ AuthUser: "admin",+ AuthPass: hashed,+ DataPath: t.TempDir(),+ ConfigPath: t.TempDir(),+ }++ router := &Router{config: cfg}+ handler := handleQuickSecuritySetupFixed(router)++ // Ensure rate limiter does not block test runs+ authLimiter.Reset("198.51.100.42")++ req := httptest.NewRequest(http.MethodPost, "/api/security/quick-setup",+ strings.NewReader(`{"username":"newadmin","password":"NewPassword!1","apiToken":"abcd","force":true}`))+ req.RemoteAddr = "198.51.100.42:54321"++ rr := httptest.NewRecorder()+ handler(rr, req)++ if rr.Code != http.StatusUnauthorized {+ t.Fatalf("expected 401 unauthorized, got %d (%s)", rr.Code, rr.Body.String())+ }+}++func TestQuickSecuritySetupRequiresBootstrapToken(t *testing.T) {+ t.Setenv("PULSE_TRUSTED_PROXY_CIDRS", "")+ resetTrustedProxyConfig()++ dataDir := t.TempDir()++ cfg := &config.Config{+ DataPath: dataDir,+ ConfigPath: dataDir,+ }++ router := &Router{+ config: cfg,+ persistence: config.NewConfigPersistence(cfg.DataPath),+ }+ router.initializeBootstrapToken()++ tokenPath := filepath.Join(cfg.DataPath, bootstrapTokenFilename)+ content, err := os.ReadFile(tokenPath)+ if err != nil {+ t.Fatalf("read bootstrap token: %v", err)+ }+ bootstrapToken := strings.TrimSpace(string(content))+ if bootstrapToken == "" {+ t.Fatalf("bootstrap token is empty")+ }++ handler := handleQuickSecuritySetupFixed(router)++ authLimiter.Reset("198.51.100.80")++ payload := `{"username":"bootstrap","password":"StrongPass!1","apiToken":"` + strings.Repeat("aa", 32) + `"}`++ req := httptest.NewRequest(http.MethodPost, "/api/security/quick-setup", strings.NewReader(payload))+ req.RemoteAddr = "198.51.100.80:54321"+ rr := httptest.NewRecorder()+ handler(rr, req)+ if rr.Code != http.StatusUnauthorized {+ t.Fatalf("expected 401 unauthorized without bootstrap token, got %d (%s)", rr.Code, rr.Body.String())+ }++ authLimiter.Reset("198.51.100.80")++ reqWith := httptest.NewRequest(http.MethodPost, "/api/security/quick-setup", strings.NewReader(payload))+ reqWith.RemoteAddr = "198.51.100.80:54321"+ reqWith.Header.Set(bootstrapTokenHeader, bootstrapToken)++ rrWith := httptest.NewRecorder()+ handler(rrWith, reqWith)+ if rrWith.Code != http.StatusOK {+ t.Fatalf("expected 200 OK with valid bootstrap token, got %d (%s)", rrWith.Code, rrWith.Body.String())+ }++ if _, err := os.Stat(tokenPath); !errors.Is(err, os.ErrNotExist) {+ t.Fatalf("expected bootstrap token file to be removed after successful setup, got err=%v", err)+ }+ if router.bootstrapTokenHash != "" {+ t.Fatalf("expected bootstrap token hash to be cleared after successful setup")+ }+}++func TestQuickSecuritySetupAllowsRecoveryTokenRotation(t *testing.T) {+ t.Setenv("PULSE_TRUSTED_PROXY_CIDRS", "")+ resetTrustedProxyConfig()+ resetRecoveryStore()++ dataDir := t.TempDir()++ hashed, err := internalauth.HashPassword("OldPassword!1")+ if err != nil {+ t.Fatalf("hash password: %v", err)+ }++ cfg := &config.Config{+ AuthUser: "admin",+ AuthPass: hashed,+ DataPath: dataDir,+ ConfigPath: dataDir,+ }++ persistence := config.NewConfigPersistence(cfg.DataPath)++ router := &Router{+ config: cfg,+ persistence: persistence,+ }++ InitRecoveryTokenStore(cfg.DataPath)+ token, err := GetRecoveryTokenStore().GenerateRecoveryToken(5 * time.Minute)+ if err != nil {+ t.Fatalf("generate recovery token: %v", err)+ }++ authLimiter.Reset("127.0.0.1")++ body := `{"username":"rotated","password":"RotatedPassword!1","apiToken":"deadbeef","force":true}`+ req := httptest.NewRequest(http.MethodPost, "/api/security/quick-setup", strings.NewReader(body))+ req.Header.Set("X-Recovery-Token", token)+ req.RemoteAddr = "127.0.0.1:54321"++ rr := httptest.NewRecorder()+ handler := handleQuickSecuritySetupFixed(router)+ handler(rr, req)++ if rr.Code != http.StatusOK {+ t.Fatalf("expected 200 OK, got %d (%s)", rr.Code, rr.Body.String())+ }++ if cfg.AuthUser != "rotated" {+ t.Fatalf("expected AuthUser to be rotated, got %q", cfg.AuthUser)+ }+ if !internalauth.CheckPasswordHash("RotatedPassword!1", cfg.AuthPass) {+ t.Fatalf("stored password hash does not match new password")+ }+ if len(cfg.APITokens) != 1 {+ t.Fatalf("expected one API token, got %d", len(cfg.APITokens))+ }+}++func TestQuickSecuritySetupRequiresSettingsScopeForTokens(t *testing.T) {+ t.Setenv("PULSE_TRUSTED_PROXY_CIDRS", "")+ resetTrustedProxyConfig()++ dataDir := t.TempDir()+ hashed, err := internalauth.HashPassword("ExistingPassword!1")+ if err != nil {+ t.Fatalf("hash password: %v", err)+ }++ rawToken := strings.Repeat("ab", 32) // 64 hex chars+ record, err := config.NewAPITokenRecord(rawToken, "limited", []string{config.ScopeHostReport})+ if err != nil {+ t.Fatalf("new token record: %v", err)+ }++ cfg := &config.Config{+ AuthUser: "admin",+ AuthPass: hashed,+ DataPath: dataDir,+ ConfigPath: dataDir,+ APITokens: []config.APITokenRecord{*record},+ APITokenEnabled: true,+ }+ cfg.SortAPITokens()++ router := &Router{+ config: cfg,+ persistence: config.NewConfigPersistence(cfg.DataPath),+ }++ authLimiter.Reset("203.0.113.10")++ body := `{"username":"rotated","password":"RotatedPassword!1","apiToken":"deadbeef","force":true}`+ req := httptest.NewRequest(http.MethodPost, "/api/security/quick-setup", strings.NewReader(body))+ req.RemoteAddr = "203.0.113.10:1234"+ req.Header.Set("X-API-Token", rawToken)++ rr := httptest.NewRecorder()+ handler := handleQuickSecuritySetupFixed(router)+ handler(rr, req)++ if rr.Code != http.StatusForbidden {+ t.Fatalf("expected 403 forbidden for missing scope, got %d (%s)", rr.Code, rr.Body.String())+ }+}++func TestRegenerateAPITokenRequiresSettingsScope(t *testing.T) {+ dataDir := t.TempDir()+ hashed, err := internalauth.HashPassword("ExistingPassword!1")+ if err != nil {+ t.Fatalf("hash password: %v", err)+ }++ rawToken := strings.Repeat("cd", 32)+ record, err := config.NewAPITokenRecord(rawToken, "limited", []string{config.ScopeHostReport})+ if err != nil {+ t.Fatalf("new token record: %v", err)+ }++ cfg := &config.Config{+ AuthUser: "admin",+ AuthPass: hashed,+ DataPath: dataDir,+ ConfigPath: dataDir,+ APITokens: []config.APITokenRecord{*record},+ APITokenEnabled: true,+ }+ cfg.SortAPITokens()++ router := &Router{+ config: cfg,+ persistence: config.NewConfigPersistence(cfg.DataPath),+ }++ authLimiter.Reset("198.51.100.7")+ req := httptest.NewRequest(http.MethodPost, "/api/security/regenerate-token", nil)+ req.RemoteAddr = "198.51.100.7:44321"+ req.Header.Set("X-API-Token", rawToken)++ rr := httptest.NewRecorder()+ router.HandleRegenerateAPIToken(rr, req)++ if rr.Code != http.StatusForbidden {+ t.Fatalf("expected 403 forbidden for missing scope, got %d (%s)", rr.Code, rr.Body.String())+ }+}++func TestValidateAPITokenRequiresSettingsScope(t *testing.T) {+ dataDir := t.TempDir()+ hashed, err := internalauth.HashPassword("ExistingPassword!1")+ if err != nil {+ t.Fatalf("hash password: %v", err)+ }++ rawToken := strings.Repeat("ef", 32)+ record, err := config.NewAPITokenRecord(rawToken, "limited", []string{config.ScopeHostReport})+ if err != nil {+ t.Fatalf("new token record: %v", err)+ }++ cfg := &config.Config{+ AuthUser: "admin",+ AuthPass: hashed,+ DataPath: dataDir,+ ConfigPath: dataDir,+ APITokens: []config.APITokenRecord{*record},+ APITokenEnabled: true,+ }+ cfg.SortAPITokens()++ router := &Router{+ config: cfg,+ persistence: config.NewConfigPersistence(cfg.DataPath),+ }++ authLimiter.Reset("198.51.100.8")+ body := `{"token":"abcdef"}`+ req := httptest.NewRequest(http.MethodPost, "/api/security/validate-token", strings.NewReader(body))+ req.RemoteAddr = "198.51.100.8:54321"+ req.Header.Set("Content-Type", "application/json")+ req.Header.Set("X-API-Token", rawToken)++ rr := httptest.NewRecorder()+ router.HandleValidateAPIToken(rr, req)++ if rr.Code != http.StatusForbidden {+ t.Fatalf("expected 403 forbidden for missing scope, got %d (%s)", rr.Code, rr.Body.String())+ }+}++func TestResetLockoutRequiresSettingsScope(t *testing.T) {+ dataDir := t.TempDir()+ hashed, err := internalauth.HashPassword("ExistingPassword!1")+ if err != nil {+ t.Fatalf("hash password: %v", err)+ }++ rawToken := strings.Repeat("12", 32)+ record, err := config.NewAPITokenRecord(rawToken, "limited", []string{config.ScopeHostReport})+ if err != nil {+ t.Fatalf("new token record: %v", err)+ }++ cfg := &config.Config{+ AuthUser: "admin",+ AuthPass: hashed,+ DataPath: dataDir,+ ConfigPath: dataDir,+ APITokens: []config.APITokenRecord{*record},+ APITokenEnabled: true,+ }+ cfg.SortAPITokens()++ router := &Router{+ config: cfg,+ }++ authLimiter.Reset("198.51.100.9")+ body := `{"identifier":"admin"}`+ req := httptest.NewRequest(http.MethodPost, "/api/security/reset-lockout", strings.NewReader(body))+ req.RemoteAddr = "198.51.100.9:54321"+ req.Header.Set("Content-Type", "application/json")+ req.Header.Set("X-API-Token", rawToken)++ rr := httptest.NewRecorder()+ router.handleResetLockout(rr, req)++ if rr.Code != http.StatusForbidden {+ t.Fatalf("expected 403 forbidden for missing scope, got %d (%s)", rr.Code, rr.Body.String())+ }+}diff --git a/internal/api/security_test.go b/internal/api/security_test.gonew file mode 100644index 0000000000..bd7ed88794--- /dev/null+++ b/internal/api/security_test.go@@ -0,0 +1,83 @@+package api++import (+ "net/http/httptest"+ "sync"+ "testing"+)++func resetTrustedProxyConfig() {+ trustedProxyCIDRs = nil+ trustedProxyOnce = sync.Once{}+}++func TestGetClientIPRejectsSpoofedLoopback(t *testing.T) {+ t.Setenv("PULSE_TRUSTED_PROXY_CIDRS", "")+ resetTrustedProxyConfig()++ req := httptest.NewRequest("GET", "/", nil)+ req.RemoteAddr = "198.51.100.42:54321"+ req.Header.Set("X-Forwarded-For", "127.0.0.1")++ if got := GetClientIP(req); got != "198.51.100.42" {+ t.Fatalf("expected remote IP when proxy is untrusted, got %q", got)+ }+}++func TestGetClientIPUsesForwardedForTrustedProxy(t *testing.T) {+ t.Setenv("PULSE_TRUSTED_PROXY_CIDRS", "127.0.0.1/32")+ resetTrustedProxyConfig()++ req := httptest.NewRequest("GET", "/", nil)+ req.RemoteAddr = "127.0.0.1:54321"+ req.Header.Set("X-Forwarded-For", "203.0.113.44")++ if got := GetClientIP(req); got != "203.0.113.44" {+ t.Fatalf("expected forwarded IP for trusted proxy, got %q", got)+ }+}++func TestIsPrivateIP(t *testing.T) {+ t.Helper()+ cases := []struct {+ name string+ ip string+ want bool+ }{+ {"public IPv4", "198.51.100.42", false},+ {"private IPv4", "10.1.2.3", true},+ {"loopback IPv4", "127.0.0.1", true},+ {"link-local IPv6", "fe80::1", true},+ {"loopback IPv6 with port", "[::1]:8443", true},+ }++ for _, tc := range cases {+ tc := tc+ t.Run(tc.name, func(t *testing.T) {+ if got := isPrivateIP(tc.ip); got != tc.want {+ t.Fatalf("isPrivateIP(%q) = %v, want %v", tc.ip, got, tc.want)+ }+ })+ }+}++func TestIsTrustedNetwork(t *testing.T) {+ t.Helper()++ if !isTrustedNetwork("10.0.0.5", nil) {+ t.Fatal("expected private IP to be trusted when no networks configured")+ }++ if isTrustedNetwork("198.51.100.42", nil) {+ t.Fatal("expected public IP to be untrusted when no networks configured")+ }++ custom := []string{"203.0.113.0/24"}+ if !isTrustedNetwork("203.0.113.44:8080", custom) {+ t.Fatal("expected IP within custom CIDR to be trusted")+ }++ if isTrustedNetwork("198.51.100.42", custom) {+ t.Fatal("expected IP outside custom CIDR to be untrusted")+ }+}diff --git a/internal/api/security_tokens.go b/internal/api/security_tokens.goindex dfa0369c84..7e1d5860c5 100644--- a/internal/api/security_tokens.go+++ b/internal/api/security_tokens.go@@ -153,7 +153,11 @@ func (r *Router) handleCreateAPIToken(w http.ResponseWriter, req *http.Request)if r.persistence != nil {if err := r.persistence.SaveAPITokens(r.config.APITokens); err != nil {+ // Rollback the in-memory addition+ r.config.APITokens = r.config.APITokens[:len(r.config.APITokens)-1]log.Error().Err(err).Msg("Failed to persist API tokens after creation")+ http.Error(w, "Failed to save token to disk: "+err.Error(), http.StatusInternalServerError)+ return}}diff --git a/internal/api/session_store.go b/internal/api/session_store.goindex 36baa9a0a8..fd96aee21a 100644--- a/internal/api/session_store.go+++ b/internal/api/session_store.go@@ -1,6 +1,8 @@package apiimport (+ "crypto/sha256"+ "encoding/hex""encoding/json""os""path/filepath"@@ -19,9 +21,21 @@ type SessionStore struct {stopChan chan bool}+func sessionHash(token string) string {+ sum := sha256.Sum256([]byte(token))+ return hex.EncodeToString(sum[:])+}++type sessionPersisted struct {+ Key string `json:"key"`+ ExpiresAt time.Time `json:"expires_at"`+ CreatedAt time.Time `json:"created_at"`+ UserAgent string `json:"user_agent,omitempty"`+ IP string `json:"ip,omitempty"`+}+// SessionData represents a user sessiontype SessionData struct {- Token string `json:"token"`ExpiresAt time.Time `json:"expires_at"`CreatedAt time.Time `json:"created_at"`UserAgent string `json:"user_agent,omitempty"`@@ -72,8 +86,8 @@ func (s *SessionStore) CreateSession(token string, duration time.Duration, userAs.mu.Lock()defer s.mu.Unlock()- s.sessions[token] = &SessionData{- Token: token,+ key := sessionHash(token)+ s.sessions[key] = &SessionData{ExpiresAt: time.Now().Add(duration),CreatedAt: time.Now(),UserAgent: userAgent,@@ -89,7 +103,7 @@ func (s *SessionStore) ValidateSession(token string) bool {s.mu.RLock()defer s.mu.RUnlock()- session, exists := s.sessions[token]+ session, exists := s.sessions[sessionHash(token)]if !exists {return false}@@ -102,7 +116,7 @@ func (s *SessionStore) ExtendSession(token string, duration time.Duration) {s.mu.Lock()defer s.mu.Unlock()- if session, exists := s.sessions[token]; exists {+ if session, exists := s.sessions[sessionHash(token)]; exists {session.ExpiresAt = time.Now().Add(duration)s.saveUnsafe()}@@ -113,7 +127,7 @@ func (s *SessionStore) DeleteSession(token string) {s.mu.Lock()defer s.mu.Unlock()- delete(s.sessions, token)+ delete(s.sessions, sessionHash(token))s.saveUnsafe()}@@ -122,7 +136,7 @@ func (s *SessionStore) GetSession(token string) *SessionData {s.mu.RLock()defer s.mu.RUnlock()- session, exists := s.sessions[token]+ session, exists := s.sessions[sessionHash(token)]if !exists || time.Now().After(session.ExpiresAt) {return nil}@@ -136,10 +150,10 @@ func (s *SessionStore) cleanup() {defer s.mu.Unlock()now := time.Now()- for token, session := range s.sessions {+ for key, session := range s.sessions {if now.After(session.ExpiresAt) {- delete(s.sessions, token)- log.Debug().Str("token", token[:8]+"...").Msg("Cleaned up expired session")+ delete(s.sessions, key)+ log.Debug().Str("sessionKey", key[:8]+"...").Msg("Cleaned up expired session")}}}@@ -162,7 +176,18 @@ func (s *SessionStore) saveUnsafe() {}// Marshal sessions- data, err := json.Marshal(s.sessions)+ persisted := make([]sessionPersisted, 0, len(s.sessions))+ for key, session := range s.sessions {+ persisted = append(persisted, sessionPersisted{+ Key: key,+ ExpiresAt: session.ExpiresAt,+ CreatedAt: session.CreatedAt,+ UserAgent: session.UserAgent,+ IP: session.IP,+ })+ }++ data, err := json.Marshal(persisted)if err != nil {log.Error().Err(err).Msg("Failed to marshal sessions")return@@ -196,31 +221,44 @@ func (s *SessionStore) load() {return}- var sessions map[string]*SessionData- if err := json.Unmarshal(data, &sessions); err != nil {- log.Error().Err(err).Msg("Failed to unmarshal sessions")+ now := time.Now()+ s.sessions = make(map[string]*SessionData)++ var persisted []sessionPersisted+ if err := json.Unmarshal(data, &persisted); err == nil {+ for _, entry := range persisted {+ if now.After(entry.ExpiresAt) {+ continue+ }+ s.sessions[entry.Key] = &SessionData{+ ExpiresAt: entry.ExpiresAt,+ CreatedAt: entry.CreatedAt,+ UserAgent: entry.UserAgent,+ IP: entry.IP,+ }+ }+ log.Info().Int("loaded", len(s.sessions)).Int("total", len(persisted)).Msg("Sessions loaded from disk (hashed format)")+ return+ }++ // Legacy map format fallback (keys stored as raw tokens)+ var legacy map[string]*SessionData+ if err := json.Unmarshal(data, &legacy); err != nil {+ log.Error().Err(err).Msg("Failed to unmarshal legacy sessions")return}- // Filter out expired sessions- now := time.Now()loaded := 0- for token, session := range sessions {- if now.Before(session.ExpiresAt) {- s.sessions[token] = session- loaded+++ for token, session := range legacy {+ if now.After(session.ExpiresAt) {+ continue}+ s.sessions[sessionHash(token)] = session+ loaded++}- log.Info().Int("loaded", loaded).Int("total", len(sessions)).Msg("Sessions loaded from disk")-}--// ClearAll removes all sessions (use carefully)-func (s *SessionStore) ClearAll() {- s.mu.Lock()- defer s.mu.Unlock()-- s.sessions = make(map[string]*SessionData)- s.saveUnsafe()- log.Info().Msg("All sessions cleared")+ log.Info().+ Int("loaded", loaded).+ Int("total", len(legacy)).+ Msg("Sessions loaded from disk (legacy format migrated)")}diff --git a/internal/api/settings.go b/internal/api/settings.godeleted file mode 100644index e563a7481f..0000000000--- a/internal/api/settings.go+++ /dev/null@@ -1,186 +0,0 @@-package api--import (- "encoding/json"- "net/http"- "os"- "path/filepath"- "time"-- "github.com/rcourtman/pulse-go-rewrite/internal/config"- "github.com/rcourtman/pulse-go-rewrite/internal/utils"- "github.com/rs/zerolog/log"- "gopkg.in/yaml.v3"-)--// SettingsResponse represents the current settings and capabilities-type SettingsResponse struct {- Current *config.Settings `json:"current"`- Defaults *config.Settings `json:"defaults"`- Capabilities Capabilities `json:"capabilities"`-}--// Capabilities represents what can be configured-type Capabilities struct {- CanRestart bool `json:"canRestart"`- CanValidatePorts bool `json:"canValidatePorts"`- RequiresRestart bool `json:"requiresRestart"`-}--// SettingsUpdate represents a settings update request-type SettingsUpdate struct {- Settings *config.Settings `json:"settings"`- RestartNow bool `json:"restartNow"`- ValidateOnly bool `json:"validateOnly"`-}--// getSettings returns current settings and configuration capabilities-func getSettings(w http.ResponseWriter, r *http.Request) {- if r.Method != http.MethodGet {- http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)- return- }-- // Create current settings from running config- // Note: This endpoint seems to be for UI settings, not node configuration- current := &config.Settings{- Server: config.ServerSettings{- Backend: config.PortSettings{- Port: 3000, // These are fixed in our new system- Host: "0.0.0.0",- },- Frontend: config.PortSettings{- Port: 7655,- Host: "0.0.0.0",- },- },- Monitoring: config.MonitoringSettings{- PollingInterval: 3, // seconds- },- }-- response := SettingsResponse{- Current: current,- Defaults: config.DefaultSettings(),- Capabilities: Capabilities{- CanRestart: true,- CanValidatePorts: true,- RequiresRestart: true,- },- }-- if err := utils.WriteJSONResponse(w, response); err != nil {- log.Error().Err(err).Msg("Failed to write settings response")- }-}--// updateSettings updates the configuration-func updateSettings(w http.ResponseWriter, r *http.Request) {- if r.Method != http.MethodPost {- http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)- return- }-- var update SettingsUpdate- if err := json.NewDecoder(r.Body).Decode(&update); err != nil {- http.Error(w, "Invalid request body", http.StatusBadRequest)- return- }-- // Validate settings- if err := update.Settings.Validate(); err != nil {- log.Error().Err(err).Msg("Settings validation failed")- http.Error(w, err.Error(), http.StatusBadRequest)- return- }-- // Check port availability- if !update.ValidateOnly {- if !config.IsPortAvailable(update.Settings.Server.Backend.Host, update.Settings.Server.Backend.Port) {- http.Error(w, "Backend port is not available", http.StatusConflict)- return- }- if !config.IsPortAvailable(update.Settings.Server.Frontend.Host, update.Settings.Server.Frontend.Port) {- http.Error(w, "Frontend port is not available", http.StatusConflict)- return- }- }-- // If validate only, return success- if update.ValidateOnly {- if err := utils.WriteJSONResponse(w, map[string]interface{}{- "valid": true,- "message": "Configuration is valid",- }); err != nil {- log.Error().Err(err).Msg("Failed to write validation response")- }- return- }-- // Save configuration to file- if err := saveSettings(update.Settings); err != nil {- log.Error().Err(err).Msg("Failed to save settings")- http.Error(w, "Failed to save settings", http.StatusInternalServerError)- return- }-- // Prepare response- response := map[string]interface{}{- "success": true,- "message": "Settings saved successfully",- "requiresRestart": true,- }-- // Handle restart if requested- if update.RestartNow {- // Schedule a graceful restart after response is sent- go func() {- log.Info().Msg("Scheduling graceful restart due to configuration change")- // Use a more graceful shutdown mechanism- // The systemd service will handle the restart- time.Sleep(1 * time.Second) // Give time for response to be sent- log.Info().Msg("Initiating graceful shutdown")- os.Exit(0)- }()- response["restarting"] = true- }-- if err := utils.WriteJSONResponse(w, response); err != nil {- log.Error().Err(err).Msg("Failed to write settings update response")- }-}--// saveSettings persists settings to the configuration file-func saveSettings(settings *config.Settings) error {- // Determine config path - prefer /etc/pulse if writable- configPath := "./pulse.yml"- if _, err := os.Stat("/etc/pulse"); err == nil {- // Check if we can write to /etc/pulse- testFile := "/etc/pulse/.write-test"- if f, err := os.Create(testFile); err == nil {- f.Close()- os.Remove(testFile)- configPath = "/etc/pulse/pulse.yml"- }- }-- // Marshal to YAML- data, err := yaml.Marshal(settings)- if err != nil {- return err- }-- // Create directory if needed- dir := filepath.Dir(configPath)- if err := os.MkdirAll(dir, 0755); err != nil {- return err- }-- // Write file- if err := os.WriteFile(configPath, data, 0644); err != nil {- return err- }-- log.Info().Str("path", configPath).Msg("Configuration saved")- return nil-}diff --git a/internal/api/system_settings.go b/internal/api/system_settings.goindex d09b4b2905..7228e78523 100644--- a/internal/api/system_settings.go+++ b/internal/api/system_settings.go@@ -407,8 +407,10 @@ func (h *SystemSettingsHandler) HandleUpdateSystemSettings(w http.ResponseWriterStr("username", username).Msg("Non-admin user attempted to update system settings")- // Return forbidden error- utils.WriteJSONError(w, "Admin privileges required", http.StatusForbidden)+ // Return forbidden error+ w.Header().Set("Content-Type", "application/json")+ w.WriteHeader(http.StatusForbidden)+ _ = json.NewEncoder(w).Encode(map[string]string{"error": "Admin privileges required"})return}}diff --git a/internal/api/types.go b/internal/api/types.goindex c76ae51aa8..5df2f808a0 100644--- a/internal/api/types.go+++ b/internal/api/types.go@@ -14,8 +14,6 @@ type HealthResponse struct {Status string `json:"status"`Timestamp int64 `json:"timestamp"`Uptime float64 `json:"uptime"`- LegacySSHDetected bool `json:"legacySSHDetected,omitempty"`- RecommendProxyUpgrade bool `json:"recommendProxyUpgrade,omitempty"`ProxyInstallScriptAvailable bool `json:"proxyInstallScriptAvailable,omitempty"`DevModeSSH bool `json:"devModeSSH,omitempty"` // DEV/TEST ONLY: SSH keys allowed in containers}diff --git a/internal/auth/password.go b/internal/auth/password.goindex 10c929cb3b..d8eee6a2a3 100644--- a/internal/auth/password.go+++ b/internal/auth/password.go@@ -37,17 +37,6 @@ func IsPasswordHashed(password string) bool {return strings.HasPrefix(password, "$2") && len(password) == 60}-// MigratePassword takes a password that might be plain text or hashed-// and returns a properly hashed version-func MigratePassword(password string) (string, error) {- if IsPasswordHashed(password) {- // Already hashed, return as-is- return password, nil- }- // Plain text password, hash it- return HashPassword(password)-}-// ValidatePasswordComplexity checks if a password meets complexity requirementsfunc ValidatePasswordComplexity(password string) error {if len(password) < MinPasswordLength {diff --git a/internal/config/config.go b/internal/config/config.goindex 664f39fbe7..74aaab4a61 100644--- a/internal/config/config.go+++ b/internal/config/config.go@@ -22,9 +22,9 @@ import ("github.com/google/uuid""github.com/joho/godotenv"- "github.com/pkg/errors""github.com/rcourtman/pulse-go-rewrite/internal/auth""github.com/rcourtman/pulse-go-rewrite/internal/logging"+ "github.com/rcourtman/pulse-go-rewrite/internal/utils""github.com/rs/zerolog/log")@@ -652,7 +652,7 @@ func Load() (*Config, error) {// Limited environment variable support// NOTE: Node configuration is NOT done via env vars - use the web UI instead- if cyclesStr := strings.TrimSpace(os.Getenv("BACKUP_POLLING_CYCLES")); cyclesStr != "" {+ if cyclesStr := utils.GetenvTrim("BACKUP_POLLING_CYCLES"); cyclesStr != "" {if cycles, err := strconv.Atoi(cyclesStr); err == nil {if cycles < 0 {log.Warn().Str("value", cyclesStr).Msg("Ignoring negative BACKUP_POLLING_CYCLES from environment")@@ -666,7 +666,7 @@ func Load() (*Config, error) {}}- if intervalStr := strings.TrimSpace(os.Getenv("BACKUP_POLLING_INTERVAL")); intervalStr != "" {+ if intervalStr := utils.GetenvTrim("BACKUP_POLLING_INTERVAL"); intervalStr != "" {if dur, err := time.ParseDuration(intervalStr); err == nil {if dur < 0 {log.Warn().Str("value", intervalStr).Msg("Ignoring negative BACKUP_POLLING_INTERVAL from environment")@@ -688,7 +688,7 @@ func Load() (*Config, error) {}}- if enabledStr := strings.TrimSpace(os.Getenv("ENABLE_BACKUP_POLLING")); enabledStr != "" {+ if enabledStr := utils.GetenvTrim("ENABLE_BACKUP_POLLING"); enabledStr != "" {switch strings.ToLower(enabledStr) {case "0", "false", "no", "off":cfg.EnableBackupPolling = false@@ -699,7 +699,7 @@ func Load() (*Config, error) {log.Info().Bool("enabled", cfg.EnableBackupPolling).Msg("Overriding backup polling enabled flag from environment")}- if adaptiveEnabled := strings.TrimSpace(os.Getenv("ADAPTIVE_POLLING_ENABLED")); adaptiveEnabled != "" {+ if adaptiveEnabled := utils.GetenvTrim("ADAPTIVE_POLLING_ENABLED"); adaptiveEnabled != "" {switch strings.ToLower(adaptiveEnabled) {case "0", "false", "no", "off":cfg.AdaptivePollingEnabled = false@@ -710,7 +710,7 @@ func Load() (*Config, error) {log.Info().Bool("enabled", cfg.AdaptivePollingEnabled).Msg("Adaptive polling feature flag overridden by environment")}- if baseInterval := strings.TrimSpace(os.Getenv("ADAPTIVE_POLLING_BASE_INTERVAL")); baseInterval != "" {+ if baseInterval := utils.GetenvTrim("ADAPTIVE_POLLING_BASE_INTERVAL"); baseInterval != "" {if dur, err := time.ParseDuration(baseInterval); err == nil {cfg.AdaptivePollingBaseInterval = durcfg.EnvOverrides["ADAPTIVE_POLLING_BASE_INTERVAL"] = true@@ -720,7 +720,7 @@ func Load() (*Config, error) {}}- if minInterval := strings.TrimSpace(os.Getenv("ADAPTIVE_POLLING_MIN_INTERVAL")); minInterval != "" {+ if minInterval := utils.GetenvTrim("ADAPTIVE_POLLING_MIN_INTERVAL"); minInterval != "" {if dur, err := time.ParseDuration(minInterval); err == nil {cfg.AdaptivePollingMinInterval = durcfg.EnvOverrides["ADAPTIVE_POLLING_MIN_INTERVAL"] = true@@ -730,7 +730,7 @@ func Load() (*Config, error) {}}- if maxInterval := strings.TrimSpace(os.Getenv("ADAPTIVE_POLLING_MAX_INTERVAL")); maxInterval != "" {+ if maxInterval := utils.GetenvTrim("ADAPTIVE_POLLING_MAX_INTERVAL"); maxInterval != "" {if dur, err := time.ParseDuration(maxInterval); err == nil {cfg.AdaptivePollingMaxInterval = durcfg.EnvOverrides["ADAPTIVE_POLLING_MAX_INTERVAL"] = true@@ -740,7 +740,7 @@ func Load() (*Config, error) {}}- if minRefresh := strings.TrimSpace(os.Getenv("GUEST_METADATA_MIN_REFRESH_INTERVAL")); minRefresh != "" {+ if minRefresh := utils.GetenvTrim("GUEST_METADATA_MIN_REFRESH_INTERVAL"); minRefresh != "" {if dur, err := time.ParseDuration(minRefresh); err == nil {if dur <= 0 {log.Warn().Str("value", minRefresh).Msg("Ignoring non-positive GUEST_METADATA_MIN_REFRESH_INTERVAL from environment")@@ -754,7 +754,7 @@ func Load() (*Config, error) {}}- if jitter := strings.TrimSpace(os.Getenv("GUEST_METADATA_REFRESH_JITTER")); jitter != "" {+ if jitter := utils.GetenvTrim("GUEST_METADATA_REFRESH_JITTER"); jitter != "" {if dur, err := time.ParseDuration(jitter); err == nil {if dur < 0 {log.Warn().Str("value", jitter).Msg("Ignoring negative GUEST_METADATA_REFRESH_JITTER from environment")@@ -768,7 +768,7 @@ func Load() (*Config, error) {}}- if backoff := strings.TrimSpace(os.Getenv("GUEST_METADATA_RETRY_BACKOFF")); backoff != "" {+ if backoff := utils.GetenvTrim("GUEST_METADATA_RETRY_BACKOFF"); backoff != "" {if dur, err := time.ParseDuration(backoff); err == nil {if dur <= 0 {log.Warn().Str("value", backoff).Msg("Ignoring non-positive GUEST_METADATA_RETRY_BACKOFF from environment")@@ -782,7 +782,7 @@ func Load() (*Config, error) {}}- if concurrent := strings.TrimSpace(os.Getenv("GUEST_METADATA_MAX_CONCURRENT")); concurrent != "" {+ if concurrent := utils.GetenvTrim("GUEST_METADATA_MAX_CONCURRENT"); concurrent != "" {if val, err := strconv.Atoi(concurrent); err == nil {if val <= 0 {log.Warn().Str("value", concurrent).Msg("Ignoring non-positive GUEST_METADATA_MAX_CONCURRENT from environment")@@ -810,7 +810,7 @@ func Load() (*Config, error) {}}envTokens := make([]string, 0, 4)- if list := strings.TrimSpace(os.Getenv("API_TOKENS")); list != "" {+ if list := utils.GetenvTrim("API_TOKENS"); list != "" {for _, part := range strings.Split(list, ",") {part = strings.TrimSpace(part)if part != "" {@@ -818,7 +818,7 @@ func Load() (*Config, error) {}}}- if token := strings.TrimSpace(os.Getenv("API_TOKEN")); token != "" {+ if token := utils.GetenvTrim("API_TOKEN"); token != "" {envTokens = append(envTokens, token)}@@ -1047,7 +1047,7 @@ func Load() (*Config, error) {cfg.EnvOverrides["discoverySubnet"] = truelog.Info().Str("subnet", discoverySubnet).Msg("Discovery subnet overridden by DISCOVERY_SUBNET env var")}- if envOverride := strings.TrimSpace(os.Getenv("DISCOVERY_ENVIRONMENT_OVERRIDE")); envOverride != "" {+ if envOverride := utils.GetenvTrim("DISCOVERY_ENVIRONMENT_OVERRIDE"); envOverride != "" {if IsValidDiscoveryEnvironment(envOverride) {cfg.Discovery.EnvironmentOverride = strings.ToLower(envOverride)cfg.EnvOverrides["discoveryEnvironmentOverride"] = true@@ -1056,19 +1056,19 @@ func Load() (*Config, error) {log.Warn().Str("value", envOverride).Msg("Ignoring invalid DISCOVERY_ENVIRONMENT_OVERRIDE value")}}- if allowlistEnv := strings.TrimSpace(os.Getenv("DISCOVERY_SUBNET_ALLOWLIST")); allowlistEnv != "" {+ if allowlistEnv := utils.GetenvTrim("DISCOVERY_SUBNET_ALLOWLIST"); allowlistEnv != "" {parts := splitAndTrim(allowlistEnv)cfg.Discovery.SubnetAllowlist = sanitizeCIDRList(parts)cfg.EnvOverrides["discoverySubnetAllowlist"] = truelog.Info().Int("allowlistCount", len(cfg.Discovery.SubnetAllowlist)).Msg("Discovery subnet allowlist overridden by DISCOVERY_SUBNET_ALLOWLIST")}- if blocklistEnv := strings.TrimSpace(os.Getenv("DISCOVERY_SUBNET_BLOCKLIST")); blocklistEnv != "" {+ if blocklistEnv := utils.GetenvTrim("DISCOVERY_SUBNET_BLOCKLIST"); blocklistEnv != "" {parts := splitAndTrim(blocklistEnv)cfg.Discovery.SubnetBlocklist = sanitizeCIDRList(parts)cfg.EnvOverrides["discoverySubnetBlocklist"] = truelog.Info().Int("blocklistCount", len(cfg.Discovery.SubnetBlocklist)).Msg("Discovery subnet blocklist overridden by DISCOVERY_SUBNET_BLOCKLIST")}- if maxHostsEnv := strings.TrimSpace(os.Getenv("DISCOVERY_MAX_HOSTS_PER_SCAN")); maxHostsEnv != "" {+ if maxHostsEnv := utils.GetenvTrim("DISCOVERY_MAX_HOSTS_PER_SCAN"); maxHostsEnv != "" {if v, err := strconv.Atoi(maxHostsEnv); err == nil && v > 0 {cfg.Discovery.MaxHostsPerScan = vcfg.EnvOverrides["discoveryMaxHostsPerScan"] = true@@ -1077,7 +1077,7 @@ func Load() (*Config, error) {log.Warn().Str("value", maxHostsEnv).Msg("Ignoring invalid DISCOVERY_MAX_HOSTS_PER_SCAN value")}}- if maxConcurrentEnv := strings.TrimSpace(os.Getenv("DISCOVERY_MAX_CONCURRENT")); maxConcurrentEnv != "" {+ if maxConcurrentEnv := utils.GetenvTrim("DISCOVERY_MAX_CONCURRENT"); maxConcurrentEnv != "" {if v, err := strconv.Atoi(maxConcurrentEnv); err == nil && v > 0 {cfg.Discovery.MaxConcurrent = vcfg.EnvOverrides["discoveryMaxConcurrent"] = true@@ -1086,7 +1086,7 @@ func Load() (*Config, error) {log.Warn().Str("value", maxConcurrentEnv).Msg("Ignoring invalid DISCOVERY_MAX_CONCURRENT value")}}- if reverseDNSEnv := strings.TrimSpace(os.Getenv("DISCOVERY_ENABLE_REVERSE_DNS")); reverseDNSEnv != "" {+ if reverseDNSEnv := utils.GetenvTrim("DISCOVERY_ENABLE_REVERSE_DNS"); reverseDNSEnv != "" {switch strings.ToLower(reverseDNSEnv) {case "0", "false", "no", "off":cfg.Discovery.EnableReverseDNS = false@@ -1096,7 +1096,7 @@ func Load() (*Config, error) {cfg.EnvOverrides["discoveryEnableReverseDns"] = truelog.Info().Bool("enableReverseDNS", cfg.Discovery.EnableReverseDNS).Msg("Discovery reverse DNS setting overridden by DISCOVERY_ENABLE_REVERSE_DNS")}- if scanGatewaysEnv := strings.TrimSpace(os.Getenv("DISCOVERY_SCAN_GATEWAYS")); scanGatewaysEnv != "" {+ if scanGatewaysEnv := utils.GetenvTrim("DISCOVERY_SCAN_GATEWAYS"); scanGatewaysEnv != "" {switch strings.ToLower(scanGatewaysEnv) {case "0", "false", "no", "off":cfg.Discovery.ScanGateways = false@@ -1106,7 +1106,7 @@ func Load() (*Config, error) {cfg.EnvOverrides["discoveryScanGateways"] = truelog.Info().Bool("scanGateways", cfg.Discovery.ScanGateways).Msg("Discovery gateway scanning overridden by DISCOVERY_SCAN_GATEWAYS")}- if dialTimeoutEnv := strings.TrimSpace(os.Getenv("DISCOVERY_DIAL_TIMEOUT_MS")); dialTimeoutEnv != "" {+ if dialTimeoutEnv := utils.GetenvTrim("DISCOVERY_DIAL_TIMEOUT_MS"); dialTimeoutEnv != "" {if v, err := strconv.Atoi(dialTimeoutEnv); err == nil && v > 0 {cfg.Discovery.DialTimeout = vcfg.EnvOverrides["discoveryDialTimeoutMs"] = true@@ -1115,7 +1115,7 @@ func Load() (*Config, error) {log.Warn().Str("value", dialTimeoutEnv).Msg("Ignoring invalid DISCOVERY_DIAL_TIMEOUT_MS value")}}- if httpTimeoutEnv := strings.TrimSpace(os.Getenv("DISCOVERY_HTTP_TIMEOUT_MS")); httpTimeoutEnv != "" {+ if httpTimeoutEnv := utils.GetenvTrim("DISCOVERY_HTTP_TIMEOUT_MS"); httpTimeoutEnv != "" {if v, err := strconv.Atoi(httpTimeoutEnv); err == nil && v > 0 {cfg.Discovery.HTTPTimeout = vcfg.EnvOverrides["discoveryHttpTimeoutMs"] = true@@ -1175,7 +1175,7 @@ func Load() (*Config, error) {// Validate configurationif err := cfg.Validate(); err != nil {- return nil, errors.Wrap(err, "load config: invalid configuration")+ return nil, fmt.Errorf("load config: invalid configuration: %w", err)}return cfg, nildiff --git a/internal/config/settings.go b/internal/config/settings.godeleted file mode 100644index de6c494824..0000000000--- a/internal/config/settings.go+++ /dev/null@@ -1,193 +0,0 @@-package config--import (- "fmt"- "net"- "strconv"-)--// Settings represents the complete application configuration-type Settings struct {- Server ServerSettings `json:"server" yaml:"server" mapstructure:"server"`- Monitoring MonitoringSettings `json:"monitoring" yaml:"monitoring" mapstructure:"monitoring"`- Logging LoggingSettings `json:"logging" yaml:"logging" mapstructure:"logging"`- Security SecuritySettings `json:"security" yaml:"security" mapstructure:"security"`-}--// ServerSettings contains all server-related configuration-type ServerSettings struct {- Backend PortSettings `json:"backend" yaml:"backend" mapstructure:"backend"`- Frontend PortSettings `json:"frontend" yaml:"frontend" mapstructure:"frontend"`-}--// PortSettings defines configuration for a network service-type PortSettings struct {- Port int `json:"port" yaml:"port" mapstructure:"port"`- Host string `json:"host" yaml:"host" mapstructure:"host"`-}--// MonitoringSettings contains monitoring-related configuration-type MonitoringSettings struct {- PollingInterval int `json:"pollingInterval" yaml:"pollingInterval" mapstructure:"pollingInterval"` // milliseconds- ConcurrentPolling bool `json:"concurrentPolling" yaml:"concurrentPolling" mapstructure:"concurrentPolling"`- BackupPollingCycles int `json:"backupPollingCycles" yaml:"backupPollingCycles" mapstructure:"backupPollingCycles"` // How often to poll backups- BackupPollingIntervalMs int `json:"backupPollingIntervalMs" yaml:"backupPollingIntervalMs" mapstructure:"backupPollingIntervalMs"` // 0 = use cycle-based scheduling- BackupPollingEnabled bool `json:"backupPollingEnabled" yaml:"backupPollingEnabled" mapstructure:"backupPollingEnabled"`- MetricsRetentionDays int `json:"metricsRetentionDays" yaml:"metricsRetentionDays" mapstructure:"metricsRetentionDays"`-}--// LoggingSettings contains logging configuration-type LoggingSettings struct {- Level string `json:"level" yaml:"level" mapstructure:"level"` // debug, info, warn, error- Format string `json:"format" yaml:"format" mapstructure:"format"` // json, console, auto- File string `json:"file" yaml:"file" mapstructure:"file"` // log file path- MaxSize int `json:"maxSize" yaml:"maxSize" mapstructure:"maxSize"` // MB- MaxBackups int `json:"maxBackups" yaml:"maxBackups" mapstructure:"maxBackups"`- MaxAge int `json:"maxAge" yaml:"maxAge" mapstructure:"maxAge"` // days- Compress bool `json:"compress" yaml:"compress" mapstructure:"compress"`-}--// SecuritySettings contains security-related configuration-type SecuritySettings struct {- APIToken string `json:"apiToken" yaml:"apiToken" mapstructure:"apiToken"`- AllowedOrigins []string `json:"allowedOrigins" yaml:"allowedOrigins" mapstructure:"allowedOrigins"`- IframeEmbedding string `json:"iframeEmbedding" yaml:"iframeEmbedding" mapstructure:"iframeEmbedding"` // DENY, SAMEORIGIN, or URL- EnableAuthentication bool `json:"enableAuthentication" yaml:"enableAuthentication" mapstructure:"enableAuthentication"`-}--// DefaultSettings returns the default configuration-func DefaultSettings() *Settings {- return &Settings{- Server: ServerSettings{- Backend: PortSettings{- Port: 3000,- Host: "0.0.0.0",- },- Frontend: PortSettings{- Port: 7655,- Host: "0.0.0.0",- },- },- Monitoring: MonitoringSettings{- PollingInterval: 5000, // 5 seconds- ConcurrentPolling: true,- BackupPollingCycles: 10, // Poll backups every 10 cycles- BackupPollingIntervalMs: 0,- BackupPollingEnabled: true,- MetricsRetentionDays: 7,- },- Logging: LoggingSettings{- Level: "info",- Format: "auto",- File: "/opt/pulse/pulse.log",- MaxSize: 100, // 100MB- MaxBackups: 5,- MaxAge: 30, // 30 days- Compress: true,- },- Security: SecuritySettings{- AllowedOrigins: []string{"*"},- IframeEmbedding: "SAMEORIGIN",- EnableAuthentication: false,- },- }-}--// Validate checks if the settings are valid-func (s *Settings) Validate() error {- // Validate backend port- if err := validatePort(s.Server.Backend.Port); err != nil {- return fmt.Errorf("invalid backend port: %w", err)- }-- // Validate frontend port- if err := validatePort(s.Server.Frontend.Port); err != nil {- return fmt.Errorf("invalid frontend port: %w", err)- }-- // Ensure ports are different- if s.Server.Backend.Port == s.Server.Frontend.Port {- return fmt.Errorf("backend and frontend ports must be different")- }-- // Validate hosts- if err := validateHost(s.Server.Backend.Host); err != nil {- return fmt.Errorf("invalid backend host: %w", err)- }-- if err := validateHost(s.Server.Frontend.Host); err != nil {- return fmt.Errorf("invalid frontend host: %w", err)- }-- // Validate monitoring settings- if s.Monitoring.PollingInterval < 1000 {- return fmt.Errorf("polling interval must be at least 1000ms (1 second)")- }-- if s.Monitoring.BackupPollingCycles < 0 {- return fmt.Errorf("backup polling cycles cannot be negative")- }-- if s.Monitoring.BackupPollingIntervalMs < 0 {- return fmt.Errorf("backup polling interval cannot be negative")- }-- // Validate logging level- validLevels := map[string]bool{"debug": true, "info": true, "warn": true, "error": true}- if !validLevels[s.Logging.Level] {- return fmt.Errorf("invalid log level: %s", s.Logging.Level)- }-- return nil-}--// validatePort checks if a port number is valid-func validatePort(port int) error {- if port < 1 || port > 65535 {- return fmt.Errorf("port must be between 1 and 65535")- }-- // Warn about privileged ports- if port < 1024 {- // This is just a warning in the validation- // The actual binding will fail if not root- return nil- }-- return nil-}--// validateHost checks if a host string is valid-func validateHost(host string) error {- if host == "" {- return fmt.Errorf("host cannot be empty")- }-- // Special cases- if host == "0.0.0.0" || host == "::" || host == "localhost" {- return nil- }-- // Try to parse as IP- if net.ParseIP(host) != nil {- return nil- }-- // Try to parse as hostname (basic check)- if len(host) > 0 && len(host) <= 253 {- return nil- }-- return fmt.Errorf("invalid host: %s", host)-}--// IsPortAvailable checks if a port is available for binding-func IsPortAvailable(host string, port int) bool {- address := net.JoinHostPort(host, strconv.Itoa(port))- listener, err := net.Listen("tcp", address)- if err != nil {- return false- }- listener.Close()- return true-}diff --git a/internal/discovery/service.go b/internal/discovery/service.goindex 5537fa2231..0615644d5a 100644--- a/internal/discovery/service.go+++ b/internal/discovery/service.go@@ -49,6 +49,38 @@ type historyEntry struct {status string}+func (h historyEntry) StartedAt() time.Time {+ return h.startedAt+}++func (h historyEntry) CompletedAt() time.Time {+ return h.completedAt+}++func (h historyEntry) Subnet() string {+ return h.subnet+}++func (h historyEntry) ServerCount() int {+ return h.serverCount+}++func (h historyEntry) ErrorCount() int {+ return h.errorCount+}++func (h historyEntry) Duration() time.Duration {+ return h.duration+}++func (h historyEntry) BlocklistLength() int {+ return h.blocklistLength+}++func (h historyEntry) Status() string {+ return h.status+}+const defaultHistoryLimit = 20type discoveryScanner interface {diff --git a/internal/dockeragent/agent.go b/internal/dockeragent/agent.goindex df8cb38ce3..cfda9c1058 100644--- a/internal/dockeragent/agent.go+++ b/internal/dockeragent/agent.go@@ -17,6 +17,7 @@ import ("os""os/exec""runtime"+ "strconv""strings""syscall""time"@@ -24,8 +25,10 @@ import ("github.com/docker/docker/api/types"containertypes "github.com/docker/docker/api/types/container""github.com/docker/docker/api/types/filters"+ systemtypes "github.com/docker/docker/api/types/system""github.com/docker/docker/client""github.com/rcourtman/pulse-go-rewrite/internal/hostmetrics"+ "github.com/rcourtman/pulse-go-rewrite/internal/utils"agentsdocker "github.com/rcourtman/pulse-go-rewrite/pkg/agents/docker""github.com/rs/zerolog")@@ -49,6 +52,7 @@ type Config struct {Targets []TargetConfigContainerStates []stringSwarmScope string+ Runtime stringIncludeServices boolIncludeTasks boolIncludeContainers bool@@ -67,10 +71,22 @@ var allowedContainerStates = map[string]string{"stopped": "exited",}+type RuntimeKind string++const (+ RuntimeAuto RuntimeKind = "auto"+ RuntimeDocker RuntimeKind = "docker"+ RuntimePodman RuntimeKind = "podman"+)+// Agent collects Docker metrics and posts them to Pulse.type Agent struct {cfg Configdocker *client.Client+ daemonHost string+ runtime RuntimeKind+ runtimeVer string+ supportsSwarm boolhttpClients map[bool]*http.Clientlogger zerolog.LoggermachineID string@@ -132,11 +148,43 @@ func New(cfg Config) (*Agent, error) {cfg.IncludeTasks = true}- dockerClient, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())+ logger := cfg.Logger+ if logger == nil {+ defaultLogger := zerolog.New(os.Stdout).With().Timestamp().Str("component", "pulse-docker-agent").Logger()+ logger = &defaultLogger+ } else {+ scoped := logger.With().Str("component", "pulse-docker-agent").Logger()+ logger = &scoped+ }++ runtimePref, err := normalizeRuntime(cfg.Runtime)if err != nil {- return nil, fmt.Errorf("failed to create docker client: %w", err)+ return nil, err+ }++ dockerClient, info, runtimeKind, err := connectRuntime(runtimePref, logger)+ if err != nil {+ return nil, err+ }+ cfg.Runtime = string(runtimeKind)++ if runtimeKind == RuntimePodman {+ if cfg.IncludeServices {+ logger.Warn().Msg("Podman runtime detected; disabling Swarm service collection")+ }+ if cfg.IncludeTasks {+ logger.Warn().Msg("Podman runtime detected; disabling Swarm task collection")+ }+ cfg.IncludeServices = false+ cfg.IncludeTasks = false}+ logger.Info().+ Str("runtime", string(runtimeKind)).+ Str("daemon_host", dockerClient.DaemonHost()).+ Str("version", info.ServerVersion).+ Msg("Connected to container runtime")+hasSecure := falsehasInsecure := falsefor _, target := range cfg.Targets {@@ -155,15 +203,6 @@ func New(cfg Config) (*Agent, error) {httpClients[true] = newHTTPClient(true)}- logger := cfg.Logger- if logger == nil {- defaultLogger := zerolog.New(os.Stdout).With().Timestamp().Str("component", "pulse-docker-agent").Logger()- logger = &defaultLogger- } else {- scoped := logger.With().Str("component", "pulse-docker-agent").Logger()- logger = &scoped- }-machineID, _ := readMachineID()hostName := cfg.HostnameOverrideif hostName == "" {@@ -175,6 +214,10 @@ func New(cfg Config) (*Agent, error) {agent := &Agent{cfg: cfg,docker: dockerClient,+ daemonHost: dockerClient.DaemonHost(),+ runtime: runtimeKind,+ runtimeVer: info.ServerVersion,+ supportsSwarm: runtimeKind == RuntimeDocker,httpClients: httpClients,logger: *logger,machineID: machineID,@@ -260,6 +303,190 @@ func normalizeContainerStates(raw []string) ([]string, error) {return normalized, nil}+func normalizeRuntime(value string) (RuntimeKind, error) {+ runtime := strings.ToLower(strings.TrimSpace(value))+ switch runtime {+ case "", string(RuntimeAuto), "default":+ return RuntimeAuto, nil+ case string(RuntimeDocker):+ return RuntimeDocker, nil+ case string(RuntimePodman):+ return RuntimePodman, nil+ default:+ return "", fmt.Errorf("unsupported runtime %q: must be auto, docker, or podman", value)+ }+}++type runtimeCandidate struct {+ host string+ label string+ applyDockerEnv bool+}++func connectRuntime(preference RuntimeKind, logger *zerolog.Logger) (*client.Client, systemtypes.Info, RuntimeKind, error) {+ candidates := buildRuntimeCandidates(preference)+ var attempts []string++ for _, candidate := range candidates {+ opts := []client.Opt{client.WithAPIVersionNegotiation()}+ if candidate.applyDockerEnv {+ opts = append(opts, client.FromEnv)+ }+ if candidate.host != "" {+ opts = append(opts, client.WithHost(candidate.host))+ }++ cli, info, err := tryRuntimeCandidate(opts)+ if err != nil {+ attempts = append(attempts, fmt.Sprintf("%s: %v", candidate.label, err))+ continue+ }++ endpoint := cli.DaemonHost()+ runtime := detectRuntime(info, endpoint, preference)++ if preference != RuntimeAuto && runtime != preference {+ attempts = append(attempts, fmt.Sprintf("%s: detected %s runtime", candidate.label, runtime))+ _ = cli.Close()+ continue+ }++ if logger != nil {+ logger.Debug().Str("host", endpoint).Str("runtime", string(runtime)).Msg("Connected to container runtime")+ }++ return cli, info, runtime, nil+ }++ if len(attempts) == 0 {+ return nil, systemtypes.Info{}, RuntimeAuto, errors.New("no container runtime endpoints to try")+ }++ return nil, systemtypes.Info{}, RuntimeAuto, fmt.Errorf("failed to connect to container runtime: %s", strings.Join(attempts, "; "))+}++func tryRuntimeCandidate(opts []client.Opt) (*client.Client, systemtypes.Info, error) {+ cli, err := client.NewClientWithOpts(opts...)+ if err != nil {+ return nil, systemtypes.Info{}, err+ }++ ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)+ defer cancel()++ info, err := cli.Info(ctx)+ if err != nil {+ _ = cli.Close()+ return nil, systemtypes.Info{}, err+ }++ return cli, info, nil+}++func buildRuntimeCandidates(preference RuntimeKind) []runtimeCandidate {+ candidates := make([]runtimeCandidate, 0, 6)+ seen := make(map[string]struct{})++ add := func(candidate runtimeCandidate) {+ hostKey := candidate.host+ if hostKey == "" {+ hostKey = "__default__"+ }+ if _, ok := seen[hostKey]; ok {+ return+ }+ seen[hostKey] = struct{}{}+ candidates = append(candidates, candidate)+ }++ add(runtimeCandidate{+ label: "environment defaults",+ applyDockerEnv: true,+ })++ if host := utils.GetenvTrim("DOCKER_HOST"); host != "" {+ add(runtimeCandidate{+ host: host,+ label: "DOCKER_HOST",+ applyDockerEnv: true,+ })+ }++ if host := utils.GetenvTrim("CONTAINER_HOST"); host != "" {+ add(runtimeCandidate{+ host: host,+ label: "CONTAINER_HOST",+ })+ }++ if host := utils.GetenvTrim("PODMAN_HOST"); host != "" {+ add(runtimeCandidate{+ host: host,+ label: "PODMAN_HOST",+ })+ }++ if preference == RuntimePodman || preference == RuntimeAuto {+ rootless := fmt.Sprintf("unix:///run/user/%d/podman/podman.sock", os.Getuid())+ add(runtimeCandidate{+ host: rootless,+ label: "podman rootless socket",+ })++ add(runtimeCandidate{+ host: "unix:///run/podman/podman.sock",+ label: "podman system socket",+ })+ }++ if preference == RuntimeDocker || preference == RuntimeAuto {+ add(runtimeCandidate{+ host: "unix:///var/run/docker.sock",+ label: "default docker socket",+ applyDockerEnv: true,+ })+ }++ return candidates+}++func detectRuntime(info systemtypes.Info, endpoint string, preference RuntimeKind) RuntimeKind {+ if preference == RuntimePodman {+ return RuntimePodman+ }++ lowerEndpoint := strings.ToLower(endpoint)+ if strings.Contains(lowerEndpoint, "podman") || strings.Contains(lowerEndpoint, "libpod") {+ return RuntimePodman+ }++ if strings.Contains(strings.ToLower(info.InitBinary), "podman") {+ return RuntimePodman+ }++ if strings.Contains(strings.ToLower(info.ServerVersion), "podman") {+ return RuntimePodman+ }++ for _, pair := range info.DriverStatus {+ if strings.Contains(strings.ToLower(pair[0]), "podman") || strings.Contains(strings.ToLower(pair[1]), "podman") {+ return RuntimePodman+ }+ }++ for _, option := range info.SecurityOptions {+ if strings.Contains(strings.ToLower(option), "podman") {+ return RuntimePodman+ }+ }++ if preference == RuntimeDocker {+ return RuntimeDocker+ }++ return RuntimeDocker+}+// Run starts the collection loop until the context is cancelled.func (a *Agent) Run(ctx context.Context) error {interval := a.cfg.Interval@@ -338,6 +565,34 @@ func (a *Agent) buildReport(ctx context.Context) (agentsdocker.Report, error) {return agentsdocker.Report{}, fmt.Errorf("failed to query docker info: %w", err)}+ a.runtimeVer = info.ServerVersion+ if a.daemonHost == "" {+ a.daemonHost = a.docker.DaemonHost()+ }++ newRuntime := detectRuntime(info, a.daemonHost, RuntimeAuto)+ if newRuntime != a.runtime {+ if a.runtime != "" {+ a.logger.Info().+ Str("runtime_previous", string(a.runtime)).+ Str("runtime_current", string(newRuntime)).+ Msg("Detected container runtime change")+ }+ a.runtime = newRuntime+ a.supportsSwarm = newRuntime == RuntimeDocker+ if newRuntime == RuntimePodman {+ if a.cfg.IncludeServices {+ a.logger.Warn().Msg("Podman runtime detected during report; disabling Swarm service collection")+ }+ if a.cfg.IncludeTasks {+ a.logger.Warn().Msg("Podman runtime detected during report; disabling Swarm task collection")+ }+ a.cfg.IncludeServices = false+ a.cfg.IncludeTasks = false+ }+ a.cfg.Runtime = string(newRuntime)+ }+a.cpuCount = info.NCPUagentID := a.cfg.AgentID@@ -393,6 +648,8 @@ func (a *Agent) buildReport(ctx context.Context) (agentsdocker.Report, error) {Name: info.Name,MachineID: a.machineID,OS: info.OperatingSystem,+ Runtime: string(a.runtime),+ RuntimeVersion: a.runtimeVer,KernelVersion: info.KernelVersion,Architecture: info.Architecture,DockerVersion: info.ServerVersion,@@ -606,6 +863,12 @@ func (a *Agent) collectContainer(ctx context.Context, summary types.Container) (Mounts: mounts,}+ if a.runtime == RuntimePodman {+ if meta := extractPodmanMetadata(labels); meta != nil {+ container.Podman = meta+ }+ }+if requestSize {a.logger.Debug().Str("container", container.Name).@@ -618,6 +881,66 @@ func (a *Agent) collectContainer(ctx context.Context, summary types.Container) (return container, nil}+func extractPodmanMetadata(labels map[string]string) *agentsdocker.PodmanContainer {+ if len(labels) == 0 {+ return nil+ }++ meta := &agentsdocker.PodmanContainer{}++ if v := strings.TrimSpace(labels["io.podman.annotations.pod.name"]); v != "" {+ meta.PodName = v+ }++ if v := strings.TrimSpace(labels["io.podman.annotations.pod.id"]); v != "" {+ meta.PodID = v+ }++ if v := strings.TrimSpace(labels["io.podman.annotations.pod.infra"]); v != "" {+ if parsed, err := strconv.ParseBool(v); err == nil {+ meta.Infra = parsed+ } else if strings.EqualFold(v, "yes") || strings.EqualFold(v, "true") {+ meta.Infra = true+ }+ }++ if v := strings.TrimSpace(labels["io.podman.compose.project"]); v != "" {+ meta.ComposeProject = v+ }++ if v := strings.TrimSpace(labels["io.podman.compose.service"]); v != "" {+ meta.ComposeService = v+ }++ if v := strings.TrimSpace(labels["io.podman.compose.working_dir"]); v != "" {+ meta.ComposeWorkdir = v+ }++ if v := strings.TrimSpace(labels["io.podman.compose.config-hash"]); v != "" {+ meta.ComposeConfig = v+ }++ if v := strings.TrimSpace(labels["io.containers.autoupdate"]); v != "" {+ meta.AutoUpdatePolicy = v+ }++ if v := strings.TrimSpace(labels["io.containers.autoupdate.restart"]); v != "" {+ meta.AutoUpdateRestart = v+ }++ if v := strings.TrimSpace(labels["io.podman.annotations.userns"]); v != "" {+ meta.UserNS = v+ } else if v := strings.TrimSpace(labels["io.containers.userns"]); v != "" {+ meta.UserNS = v+ }++ if meta.PodName == "" && meta.PodID == "" && meta.ComposeProject == "" && meta.AutoUpdatePolicy == "" && meta.UserNS == "" && !meta.Infra {+ return nil+ }++ return meta+}+func (a *Agent) sendReport(ctx context.Context, report agentsdocker.Report) error {payload, err := json.Marshal(report)if err != nil {diff --git a/internal/dockeragent/agent_internal_test.go b/internal/dockeragent/agent_internal_test.goindex e0c464b24e..142f4a482f 100644--- a/internal/dockeragent/agent_internal_test.go+++ b/internal/dockeragent/agent_internal_test.go@@ -80,3 +80,31 @@ func TestNormalizeSwarmScopeInvalid(t *testing.T) {t.Fatalf("expected error for invalid swarm scope")}}++func TestNormalizeRuntime(t *testing.T) {+ tests := map[string]RuntimeKind{+ "": RuntimeAuto,+ "auto": RuntimeAuto,+ "docker": RuntimeDocker,+ "podman": RuntimePodman,+ " Auto ": RuntimeAuto,+ "DOCKER": RuntimeDocker,+ "PODMAN": RuntimePodman,+ }++ for input, expected := range tests {+ runtime, err := normalizeRuntime(input)+ if err != nil {+ t.Fatalf("normalizeRuntime(%q) returned error: %v", input, err)+ }+ if runtime != expected {+ t.Fatalf("normalizeRuntime(%q) = %q, expected %q", input, runtime, expected)+ }+ }+}++func TestNormalizeRuntimeInvalid(t *testing.T) {+ if _, err := normalizeRuntime("containerd"); err == nil {+ t.Fatalf("expected error for unsupported runtime")+ }+}diff --git a/internal/dockeragent/swarm.go b/internal/dockeragent/swarm.goindex 59742ec411..a7ac54afa1 100644--- a/internal/dockeragent/swarm.go+++ b/internal/dockeragent/swarm.go@@ -49,6 +49,10 @@ func (a *Agent) resolvedSwarmScope(info systemtypes.Info) string {}func (a *Agent) collectSwarmData(ctx context.Context, info systemtypes.Info, containers []agentsdocker.Container) ([]agentsdocker.Service, []agentsdocker.Task, *agentsdocker.SwarmInfo) {+ if !a.supportsSwarm {+ return nil, nil, nil+ }+if info.Swarm.NodeID == "" && string(info.Swarm.LocalNodeState) == "" && strings.TrimSpace(info.Swarm.Error) == "" {return nil, nil, nil}diff --git a/internal/interfaces/interfaces.go b/internal/interfaces/interfaces.godeleted file mode 100644index fbd1d8a02f..0000000000--- a/internal/interfaces/interfaces.go+++ /dev/null@@ -1,59 +0,0 @@-package interfaces--import (- "context"- "time"-- "github.com/rcourtman/pulse-go-rewrite/internal/models"- "github.com/rcourtman/pulse-go-rewrite/internal/types"-)--// StateStore defines the interface for state management-type StateStore interface {- GetSnapshot() models.StateSnapshot- UpdateNodes(nodes []models.Node)- UpdateNodesForInstance(instanceName string, nodes []models.Node)- UpdateVMs(vms []models.VM)- UpdateVMsForInstance(instanceName string, vms []models.VM)- UpdateContainers(containers []models.Container)- UpdateContainersForInstance(instanceName string, containers []models.Container)- UpdateStorage(storage []models.Storage)- UpdateCephClustersForInstance(instanceName string, clusters []models.CephCluster)- UpdatePBSInstances(instances []models.PBSInstance)- UpdatePMGInstances(instances []models.PMGInstance)- SetConnectionHealth(instance string, healthy bool)-}--// WebSocketHub defines the interface for WebSocket hub-type WebSocketHub interface {- BroadcastState(state interface{})- GetClientCount() int- Run(ctx context.Context)-}--// MetricsStore defines the interface for metrics storage-type MetricsStore interface {- AddGuestMetric(guestID string, metricType string, value float64, timestamp time.Time)- AddNodeMetric(nodeID string, metricType string, value float64, timestamp time.Time)- AddStorageMetric(storageID string, metricType string, value float64, timestamp time.Time)- GetGuestMetrics(guestID string, metricType string, duration time.Duration) []types.MetricPoint- GetNodeMetrics(nodeID string, metricType string, duration time.Duration) []types.MetricPoint- GetAllGuestMetrics(guestID string, duration time.Duration) map[string][]types.MetricPoint- GetAllStorageMetrics(storageID string, duration time.Duration) map[string][]types.MetricPoint- Cleanup()-}--// Monitor defines the interface for the monitoring system-type Monitor interface {- Start(ctx context.Context, hub WebSocketHub)- GetState() models.StateSnapshot- GetStartTime() time.Time- GetGuestMetrics(guestID string, duration time.Duration) map[string][]types.MetricPoint- GetNodeMetrics(nodeID string, metricType string, duration time.Duration) []types.MetricPoint- GetStorageMetrics(storageID string, duration time.Duration) map[string][]types.MetricPoint-}--// RateTracker defines the interface for rate tracking-type RateTracker interface {- CalculateRates(guestID string, current types.IOMetrics) (diskRead, diskWrite, netIn, netOut float64)-}diff --git a/internal/mock/generator.go b/internal/mock/generator.goindex 9ac26f1a36..4eaebb97a1 100644--- a/internal/mock/generator.go+++ b/internal/mock/generator.go@@ -57,6 +57,17 @@ var dockerHostPrefixes = []string{"draco", "phoenix", "hydra", "pegasus", "lyra",}+type podDefinition struct {+ Name string+ ID string+ ComposeProject string+ ComposeWorkdir string+ ComposeConfigHash string+ AutoUpdatePolicy string+ AutoUpdateRestart string+ UserNamespace string+}+var dockerOperatingSystems = []string{"Debian GNU/Linux 12 (bookworm)","Ubuntu 24.04.1 LTS",@@ -80,6 +91,13 @@ var dockerVersions = []string{"25.0.6",}+var podmanVersions = []string{+ "5.0.2",+ "4.9.3",+ "4.8.1",+ "4.7.2",+}+var dockerAgentVersions = []string{"0.1.0","0.1.0-dev",@@ -1027,7 +1045,17 @@ func generateDockerHosts(config MockConfig) []models.DockerHost {interval := 30uptime := int64(86400*(3+rand.Intn(25))) + int64(rand.Intn(3600))- containers := generateDockerContainers(hostname, i, config)+ isPodman := hostCount > 1 && i%3 == 0+ runtime := "docker"+ runtimeVersion := dockerVersions[rand.Intn(len(dockerVersions))]+ dockerVersion := runtimeVersion+ if isPodman {+ runtime = "podman"+ runtimeVersion = podmanVersions[rand.Intn(len(podmanVersions))]+ dockerVersion = ""+ }++ containers := generateDockerContainers(hostname, i, config, isPodman)// Optionally ensure the second host looks degraded for UI coverageif i == 1 && len(containers) > 0 && hostCount > 1 {@@ -1093,26 +1121,29 @@ func generateDockerHosts(config MockConfig) []models.DockerHost {}}- swarmInfo := &models.DockerSwarmInfo{- NodeID: fmt.Sprintf("%s-node", hostID),- NodeRole: "worker",- LocalState: "active",- ControlAvailable: false,- Scope: "node",- }-+ var swarmInfo *models.DockerSwarmInfovar services []models.DockerServicevar tasks []models.DockerTask- if i%2 == 0 {- swarmInfo.NodeRole = "manager"- swarmInfo.ControlAvailable = true- swarmInfo.Scope = "cluster"- services, tasks = generateDockerServicesAndTasks(hostname, containers, now)- if len(services) == 0 {- swarmInfo.Scope = "node"+ if !isPodman {+ swarmInfo = &models.DockerSwarmInfo{+ NodeID: fmt.Sprintf("%s-node", hostID),+ NodeRole: "worker",+ LocalState: "active",+ ControlAvailable: false,+ Scope: "node",+ }++ if i%2 == 0 {+ swarmInfo.NodeRole = "manager"+ swarmInfo.ControlAvailable = true+ swarmInfo.Scope = "cluster"+ services, tasks = generateDockerServicesAndTasks(hostname, containers, now)+ if len(services) == 0 {+ swarmInfo.Scope = "node"+ }+ } else if i%3 == 0 {+ services, tasks = generateDockerServicesAndTasks(hostname, containers, now)}- } else if i%3 == 0 {- services, tasks = generateDockerServicesAndTasks(hostname, containers, now)}cpuUsage := clampFloat(10+rand.Float64()*70, 4, 98)@@ -1186,7 +1217,9 @@ func generateDockerHosts(config MockConfig) []models.DockerHost {OS: dockerOperatingSystems[rand.Intn(len(dockerOperatingSystems))],KernelVersion: dockerKernelVersions[rand.Intn(len(dockerKernelVersions))],Architecture: dockerArchitectures[rand.Intn(len(dockerArchitectures))],- DockerVersion: dockerVersions[rand.Intn(len(dockerVersions))],+ Runtime: runtime,+ RuntimeVersion: runtimeVersion,+ DockerVersion: dockerVersion,CPUs: cpus,TotalMemoryBytes: totalMemoryBytes,UptimeSeconds: uptime,@@ -1418,7 +1451,7 @@ func generateHosts(config MockConfig) []models.Host {return hosts}-func generateDockerContainers(hostName string, hostIdx int, config MockConfig) []models.DockerContainer {+func generateDockerContainers(hostName string, hostIdx int, config MockConfig, podman bool) []models.DockerContainer {base := config.DockerContainersPerHostif base < 1 {base = 6@@ -1433,6 +1466,57 @@ func generateDockerContainers(hostName string, hostIdx int, config MockConfig) [containers := make([]models.DockerContainer, 0, count)nameUsage := make(map[string]int)+ var podDefs []podDefinition+ infraAssigned := make(map[string]bool)+ if podman {+ maxPods := 1+ if count > 1 {+ if count < 3 {+ maxPods = count+ } else {+ maxPods = 3+ }+ }++ podCount := maxPods+ if maxPods > 1 {+ podCount = 1 + rand.Intn(maxPods)+ }++ podDefs = make([]podDefinition, podCount)+ baseProject := strings.ReplaceAll(hostName, "-", "")+ for idx := 0; idx < podCount; idx++ {+ composeProject := ""+ composeWorkdir := ""+ if rand.Float64() < 0.7 {+ composeProject = fmt.Sprintf("%s-stack", baseProject)+ composeWorkdir = fmt.Sprintf("/srv/%s", baseProject)+ }++ autoUpdatePolicy := ""+ autoUpdateRestart := ""+ if rand.Float64() < 0.35 {+ autoUpdatePolicy = []string{"image", "registry"}[rand.Intn(2)]+ if rand.Float64() < 0.5 {+ autoUpdateRestart = []string{"rolling", "daily"}[rand.Intn(2)]+ }+ }++ userNS := []string{"keep-id", "host", "private"}[rand.Intn(3)]++ podDefs[idx] = podDefinition{+ Name: fmt.Sprintf("%s-pod-%d", baseProject, idx+1),+ ID: randomHexString(24),+ ComposeProject: composeProject,+ ComposeWorkdir: composeWorkdir,+ ComposeConfigHash: randomHexString(16),+ AutoUpdatePolicy: autoUpdatePolicy,+ AutoUpdateRestart: autoUpdateRestart,+ UserNamespace: userNS,+ }+ }+ }+for i := 0; i < count; i++ {baseName := appNames[rand.Intn(len(appNames))]nameUsage[baseName]++@@ -1441,6 +1525,16 @@ func generateDockerContainers(hostName string, hostIdx int, config MockConfig) [containerName = fmt.Sprintf("%s-%d", baseName, nameUsage[baseName])}+ var pod *podDefinition+ isInfra := false+ if podman && len(podDefs) > 0 {+ pod = &podDefs[rand.Intn(len(podDefs))]+ if !infraAssigned[pod.ID] {+ isInfra = true+ infraAssigned[pod.ID] = true+ }+ }+id := fmt.Sprintf("%s-%s", hostName, randomHexString(12))running := rand.Float64() >= config.StoppedPercentif running && rand.Float64() < 0.05 {@@ -1503,6 +1597,8 @@ func generateDockerContainers(hostName string, hostIdx int, config MockConfig) [}}+ labels := generateDockerLabels(containerName, hostName, podman && pod != nil, pod, isInfra)+container := models.DockerContainer{ID: id,Name: containerName,@@ -1521,10 +1617,25 @@ func generateDockerContainers(hostName string, hostIdx int, config MockConfig) [StartedAt: startedAt,FinishedAt: finishedAt,Ports: generateDockerPorts(),- Labels: generateDockerLabels(containerName, hostName),+ Labels: labels,Networks: generateDockerNetworks(hostIdx, i),}+ if pod != nil {+ container.Podman = &models.DockerPodmanContainer{+ PodName: pod.Name,+ PodID: pod.ID,+ Infra: isInfra,+ ComposeProject: pod.ComposeProject,+ ComposeService: containerName,+ ComposeWorkdir: pod.ComposeWorkdir,+ ComposeConfigHash: pod.ComposeConfigHash,+ AutoUpdatePolicy: pod.AutoUpdatePolicy,+ AutoUpdateRestart: pod.AutoUpdateRestart,+ UserNamespace: pod.UserNamespace,+ }+ }+containers = append(containers, container)}@@ -1584,7 +1695,50 @@ func generateDockerNetworks(hostIdx, containerIdx int) []models.DockerContainerNreturn networks}-func generateDockerLabels(serviceName, hostName string) map[string]string {+func generateDockerLabels(serviceName, hostName string, podman bool, pod *podDefinition, infra bool) map[string]string {+ if podman && pod != nil {+ labels := map[string]string{+ "io.podman.annotations.pod.name": pod.Name,+ "io.podman.annotations.pod.id": pod.ID,+ }++ if infra {+ labels["io.podman.annotations.pod.infra"] = "true"+ } else {+ labels["io.podman.annotations.pod.infra"] = "false"+ }++ if pod.ComposeProject != "" {+ labels["io.podman.compose.project"] = pod.ComposeProject+ labels["io.podman.compose.service"] = serviceName+ if pod.ComposeWorkdir != "" {+ labels["io.podman.compose.working_dir"] = pod.ComposeWorkdir+ }+ if pod.ComposeConfigHash != "" {+ labels["io.podman.compose.config-hash"] = pod.ComposeConfigHash+ }+ }++ if pod.AutoUpdatePolicy != "" {+ labels["io.containers.autoupdate"] = pod.AutoUpdatePolicy+ }+ if pod.AutoUpdateRestart != "" {+ labels["io.containers.autoupdate.restart"] = pod.AutoUpdateRestart+ }+ if pod.UserNamespace != "" {+ labels["io.podman.annotations.userns"] = pod.UserNamespace+ }++ if rand.Float64() < 0.25 {+ labels["io.containers.capabilities"] = "CHOWN,DAC_OVERRIDE,SETUID,SETGID"+ }+ if rand.Float64() < 0.2 {+ labels["environment"] = []string{"production", "staging", "development"}[rand.Intn(3)]+ }++ return labels+ }+labels := map[string]string{"com.docker.compose.project": hostName,"com.docker.compose.service": serviceName,@@ -3252,7 +3406,8 @@ func updateDockerHosts(data *models.StateSnapshot, config MockConfig) {host.Status = "online"host.LastSeen = nowif len(host.Containers) == 0 {- host.Containers = generateDockerContainers(host.Hostname, i, config)+ isPodman := strings.EqualFold(host.Runtime, "podman")+ host.Containers = generateDockerContainers(host.Hostname, i, config, isPodman)}}diff --git a/internal/models/converters.go b/internal/models/converters.goindex fcb34181a8..0347b26954 100644--- a/internal/models/converters.go+++ b/internal/models/converters.go@@ -204,6 +204,8 @@ func (d DockerHost) ToFrontend() DockerHostFrontend {OS: d.OS,KernelVersion: d.KernelVersion,Architecture: d.Architecture,+ Runtime: d.Runtime,+ RuntimeVersion: d.RuntimeVersion,DockerVersion: d.DockerVersion,CPUs: d.CPUs,TotalMemoryBytes: d.TotalMemoryBytes,@@ -435,6 +437,21 @@ func (c DockerContainer) ToFrontend() DockerContainerFrontend {container.Mounts = mounts}+ if c.Podman != nil {+ container.Podman = &DockerPodmanContainerFrontend{+ PodName: c.Podman.PodName,+ PodID: c.Podman.PodID,+ Infra: c.Podman.Infra,+ ComposeProject: c.Podman.ComposeProject,+ ComposeService: c.Podman.ComposeService,+ ComposeWorkdir: c.Podman.ComposeWorkdir,+ ComposeConfigHash: c.Podman.ComposeConfigHash,+ AutoUpdatePolicy: c.Podman.AutoUpdatePolicy,+ AutoUpdateRestart: c.Podman.AutoUpdateRestart,+ UserNamespace: c.Podman.UserNamespace,+ }+ }+return container}diff --git a/internal/models/models.go b/internal/models/models.goindex 7f3c365093..52f26ff7b9 100644--- a/internal/models/models.go+++ b/internal/models/models.go@@ -199,6 +199,8 @@ type DockerHost struct {OS string `json:"os,omitempty"`KernelVersion string `json:"kernelVersion,omitempty"`Architecture string `json:"architecture,omitempty"`+ Runtime string `json:"runtime,omitempty"`+ RuntimeVersion string `json:"runtimeVersion,omitempty"`DockerVersion string `json:"dockerVersion,omitempty"`CPUs int `json:"cpus"`TotalMemoryBytes int64 `json:"totalMemoryBytes"`@@ -258,6 +260,21 @@ type DockerContainer struct {RootFilesystemBytes int64 `json:"rootFilesystemBytes,omitempty"`BlockIO *DockerContainerBlockIO `json:"blockIo,omitempty"`Mounts []DockerContainerMount `json:"mounts,omitempty"`+ Podman *DockerPodmanContainer `json:"podman,omitempty"`+}++// DockerPodmanContainer captures Podman-specific annotations for a container.+type DockerPodmanContainer struct {+ PodName string `json:"podName,omitempty"`+ PodID string `json:"podId,omitempty"`+ Infra bool `json:"infra,omitempty"`+ ComposeProject string `json:"composeProject,omitempty"`+ ComposeService string `json:"composeService,omitempty"`+ ComposeWorkdir string `json:"composeWorkdir,omitempty"`+ ComposeConfigHash string `json:"composeConfigHash,omitempty"`+ AutoUpdatePolicy string `json:"autoUpdatePolicy,omitempty"`+ AutoUpdateRestart string `json:"autoUpdateRestart,omitempty"`+ UserNamespace string `json:"userNamespace,omitempty"`}// DockerContainerPort describes an exposed container port mapping.diff --git a/internal/models/models_frontend.go b/internal/models/models_frontend.goindex 0e21db4a81..7d7e391101 100644--- a/internal/models/models_frontend.go+++ b/internal/models/models_frontend.go@@ -105,6 +105,8 @@ type DockerHostFrontend struct {OS string `json:"os,omitempty"`KernelVersion string `json:"kernelVersion,omitempty"`Architecture string `json:"architecture,omitempty"`+ Runtime string `json:"runtime"`+ RuntimeVersion string `json:"runtimeVersion,omitempty"`DockerVersion string `json:"dockerVersion,omitempty"`CPUs int `json:"cpus"`TotalMemoryBytes int64 `json:"totalMemoryBytes"`@@ -163,6 +165,7 @@ type DockerContainerFrontend struct {RootFilesystemBytes int64 `json:"rootFilesystemBytes,omitempty"`BlockIO *DockerContainerBlockIOFrontend `json:"blockIo,omitempty"`Mounts []DockerContainerMountFrontend `json:"mounts,omitempty"`+ Podman *DockerPodmanContainerFrontend `json:"podman,omitempty"`}// DockerContainerPortFrontend represents a container port mapping@@ -200,6 +203,20 @@ type DockerContainerMountFrontend struct {Driver string `json:"driver,omitempty"`}+// DockerPodmanContainerFrontend exposes podman-specific metadata.+type DockerPodmanContainerFrontend struct {+ PodName string `json:"podName,omitempty"`+ PodID string `json:"podId,omitempty"`+ Infra bool `json:"infra,omitempty"`+ ComposeProject string `json:"composeProject,omitempty"`+ ComposeService string `json:"composeService,omitempty"`+ ComposeWorkdir string `json:"composeWorkdir,omitempty"`+ ComposeConfigHash string `json:"composeConfigHash,omitempty"`+ AutoUpdatePolicy string `json:"autoUpdatePolicy,omitempty"`+ AutoUpdateRestart string `json:"autoUpdateRestart,omitempty"`+ UserNamespace string `json:"userNamespace,omitempty"`+}+// DockerServiceFrontend represents a Swarm service for the frontend.type DockerServiceFrontend struct {ID string `json:"id"`diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.goindex a8b811f3cc..85c1be237a 100644--- a/internal/monitoring/monitor.go+++ b/internal/monitoring/monitor.go@@ -1397,6 +1397,25 @@ func (m *Monitor) ApplyDockerReport(report agentsdocker.Report, tokenRecord *condisplayName = hostname}+ runtime := strings.ToLower(strings.TrimSpace(report.Host.Runtime))+ switch runtime {+ case "", "auto", "default":+ runtime = "docker"+ case "docker", "podman":+ // supported runtimes+ default:+ runtime = "docker"+ }++ runtimeVersion := strings.TrimSpace(report.Host.RuntimeVersion)+ dockerVersion := strings.TrimSpace(report.Host.DockerVersion)+ if runtimeVersion == "" {+ runtimeVersion = dockerVersion+ }+ if dockerVersion == "" {+ dockerVersion = runtimeVersion+ }+containers := make([]models.DockerContainer, 0, len(report.Containers))for _, payload := range report.Containers {container := models.DockerContainer{@@ -1563,7 +1582,9 @@ func (m *Monitor) ApplyDockerReport(report agentsdocker.Report, tokenRecord *conOS: report.Host.OS,KernelVersion: report.Host.KernelVersion,Architecture: report.Host.Architecture,- DockerVersion: report.Host.DockerVersion,+ Runtime: runtime,+ RuntimeVersion: runtimeVersion,+ DockerVersion: dockerVersion,CPUs: report.Host.TotalCPU,TotalMemoryBytes: report.Host.TotalMemoryBytes,UptimeSeconds: report.Host.UptimeSeconds,@@ -3513,10 +3534,8 @@ func (m *Monitor) Start(ctx context.Context, wsHub *websocket.Hub) {m.alertManager.SetResolvedCallback(func(alertID string) {wsHub.BroadcastAlertResolved(alertID)m.notificationMgr.CancelAlert(alertID)- // Don't broadcast full state here - it causes a cascade with many guests- // The frontend will get the updated alerts through the regular broadcast ticker- // state := m.GetState()- // wsHub.BroadcastState(state)+ // Don't broadcast full state here - it causes a cascade with many guests.+ // The frontend will get the updated alerts through the regular broadcast ticker.})m.alertManager.SetEscalateCallback(func(alert *alerts.Alert, level int) {log.Info().@@ -7456,23 +7475,6 @@ func (m *Monitor) GetConfigPersistence() *config.ConfigPersistence {return m.configPersist}-// pollStorageBackups polls backup files from storage-// Deprecated: This function should not be called directly as it causes duplicate GetNodes calls.-// Use pollStorageBackupsWithNodes instead.-func (m *Monitor) pollStorageBackups(ctx context.Context, instanceName string, client PVEClientInterface) {- log.Warn().Str("instance", instanceName).Msg("pollStorageBackups called directly - this causes duplicate GetNodes calls and syslog spam on non-clustered nodes")-- // Get all nodes- nodes, err := client.GetNodes(ctx)- if err != nil {- monErr := errors.WrapConnectionError("get_nodes_for_backups", instanceName, err)- log.Error().Err(monErr).Str("instance", instanceName).Msg("Failed to get nodes for backup polling")- return- }-- m.pollStorageBackupsWithNodes(ctx, instanceName, client, nodes)-}-// pollStorageBackupsWithNodes polls backups using a provided nodes list to avoid duplicate GetNodes callsfunc (m *Monitor) pollStorageBackupsWithNodes(ctx context.Context, instanceName string, client PVEClientInterface, nodes []proxmox.Node) {diff --git a/internal/monitoring/monitor_docker_test.go b/internal/monitoring/monitor_docker_test.goindex 4685066723..ba52885337 100644--- a/internal/monitoring/monitor_docker_test.go+++ b/internal/monitoring/monitor_docker_test.go@@ -184,3 +184,37 @@ func TestApplyDockerReportIncludesContainerDiskDetails(t *testing.T) {t.Fatalf("unexpected mount payload: %+v", mount)}}++func TestApplyDockerReportPodmanRuntimeMetadata(t *testing.T) {+ monitor := newTestMonitor(t)++ report := agentsdocker.Report{+ Agent: agentsdocker.AgentInfo{+ ID: "agent-podman",+ Version: "2.0.0",+ IntervalSeconds: 60,+ },+ Host: agentsdocker.HostInfo{+ Hostname: "podman-host",+ Runtime: "podman",+ RuntimeVersion: "4.9.3",+ DockerVersion: "",+ },+ Timestamp: time.Now().UTC(),+ }++ host, err := monitor.ApplyDockerReport(report, nil)+ if err != nil {+ t.Fatalf("ApplyDockerReport returned error: %v", err)+ }++ if host.Runtime != "podman" {+ t.Fatalf("expected runtime podman, got %q", host.Runtime)+ }+ if host.RuntimeVersion != "4.9.3" {+ t.Fatalf("expected runtime version 4.9.3, got %q", host.RuntimeVersion)+ }+ if host.DockerVersion != "4.9.3" {+ t.Fatalf("expected docker version fallback to runtime version, got %q", host.DockerVersion)+ }+}diff --git a/internal/updates/adapter_installsh.go b/internal/updates/adapter_installsh.goindex 85ad2fc86a..2eb035055a 100644--- a/internal/updates/adapter_installsh.go+++ b/internal/updates/adapter_installsh.go@@ -3,7 +3,10 @@ package updatesimport ("bufio""context"+ "crypto/sha256"+ "encoding/hex""fmt"+ "io""os""os/exec""path/filepath"@@ -16,17 +19,17 @@ import (// InstallShAdapter wraps the install.sh script for systemd/LXC deploymentstype InstallShAdapter struct {- history *UpdateHistory+ history *UpdateHistoryinstallScriptURL string- logDir string+ logDir string}// NewInstallShAdapter creates a new install.sh adapterfunc NewInstallShAdapter(history *UpdateHistory) *InstallShAdapter {return &InstallShAdapter{- history: history,+ history: history,installScriptURL: "https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh",- logDir: "/var/log/pulse",+ logDir: "/var/log/pulse",}}@@ -291,7 +294,7 @@ func (a *InstallShAdapter) executeRollback(ctx context.Context, entry *UpdateHisif err != nil {return fmt.Errorf("failed to download binary: %w", err)}- defer os.Remove(binaryPath)+ defer os.RemoveAll(filepath.Dir(binaryPath))// Step 3: Stop servicelog.Info().Msg("Stopping Pulse service")@@ -379,27 +382,69 @@ func (a *InstallShAdapter) downloadBinary(ctx context.Context, version string) (url := fmt.Sprintf("https://github.com/rcourtman/Pulse/releases/download/%s/pulse-linux-%s", version, arch)// Create temp file- tmpFile, err := os.CreateTemp("", "pulse-rollback-*")+ tmpDir, err := os.MkdirTemp("", "pulse-rollback-*")if err != nil {return "", err}- tmpPath := tmpFile.Name()- tmpFile.Close()- // Download- cmd := exec.CommandContext(ctx, "curl", "-fsSL", "-o", tmpPath, url)+ localName := fmt.Sprintf("pulse-linux-%s", arch)+ binaryPath := filepath.Join(tmpDir, localName)++ // Download binary+ cmd := exec.CommandContext(ctx, "curl", "-fsSL", "-o", binaryPath, url)if err := cmd.Run(); err != nil {- os.Remove(tmpPath)+ os.RemoveAll(tmpDir)return "", fmt.Errorf("download failed: %w", err)}- // Verify it's executable- if err := os.Chmod(tmpPath, 0755); err != nil {- os.Remove(tmpPath)+ // Download checksum+ checksumURL := url + ".sha256"+ checksumPath := binaryPath + ".sha256"+ cmd = exec.CommandContext(ctx, "curl", "-fsSL", "-o", checksumPath, checksumURL)+ if err := cmd.Run(); err != nil {+ os.RemoveAll(tmpDir)+ return "", fmt.Errorf("failed to download checksum: %w", err)+ }++ checksumData, err := os.ReadFile(checksumPath)+ if err != nil {+ os.RemoveAll(tmpDir)+ return "", fmt.Errorf("failed to read checksum file: %w", err)+ }++ expectedHash := strings.Fields(strings.TrimSpace(string(checksumData)))+ if len(expectedHash) == 0 {+ os.RemoveAll(tmpDir)+ return "", fmt.Errorf("checksum file was empty")+ }++ file, err := os.Open(binaryPath)+ if err != nil {+ os.RemoveAll(tmpDir)+ return "", fmt.Errorf("failed to open downloaded binary: %w", err)+ }+ defer file.Close()++ hasher := sha256.New()+ if _, err := io.Copy(hasher, file); err != nil {+ os.RemoveAll(tmpDir)+ return "", fmt.Errorf("failed to hash downloaded binary: %w", err)+ }+ actualHash := hex.EncodeToString(hasher.Sum(nil))++ if !strings.EqualFold(actualHash, expectedHash[0]) {+ os.RemoveAll(tmpDir)+ return "", fmt.Errorf("checksum verification failed for %s", localName)+ }++ _ = os.Remove(checksumPath)++ if err := os.Chmod(binaryPath, 0755); err != nil {+ os.RemoveAll(tmpDir)return "", err}- return tmpPath, nil+ return binaryPath, nil}// stopService stops the Pulse service@@ -472,13 +517,58 @@ func (a *InstallShAdapter) waitForHealth(ctx context.Context, timeout time.Durat// downloadInstallScript downloads the install.sh scriptfunc (a *InstallShAdapter) downloadInstallScript(ctx context.Context) (string, error) {- // Use curl to download (simpler than http.Get for script execution)- cmd := exec.CommandContext(ctx, "curl", "-fsSL", a.installScriptURL)- output, err := cmd.Output()+ tmpDir, err := os.MkdirTemp("", "pulse-installsh-*")if err != nil {return "", err}- return string(output), nil+ defer os.RemoveAll(tmpDir)++ scriptPath := filepath.Join(tmpDir, "install.sh")++ cmd := exec.CommandContext(ctx, "curl", "-fsSL", "-o", scriptPath, a.installScriptURL)+ if err := cmd.Run(); err != nil {+ return "", err+ }++ checksumURL := a.installScriptURL + ".sha256"+ checksumPath := scriptPath + ".sha256"+ cmd = exec.CommandContext(ctx, "curl", "-fsSL", "-o", checksumPath, checksumURL)+ if err := cmd.Run(); err != nil {+ return "", fmt.Errorf("failed to download install.sh checksum: %w", err)+ }++ checksumData, err := os.ReadFile(checksumPath)+ if err != nil {+ return "", fmt.Errorf("failed to read install.sh checksum: %w", err)+ }++ expectedParts := strings.Fields(strings.TrimSpace(string(checksumData)))+ if len(expectedParts) == 0 {+ return "", fmt.Errorf("install.sh checksum file was empty")+ }++ file, err := os.Open(scriptPath)+ if err != nil {+ return "", fmt.Errorf("failed to open install.sh for hashing: %w", err)+ }+ defer file.Close()++ hasher := sha256.New()+ if _, err := io.Copy(hasher, file); err != nil {+ return "", fmt.Errorf("failed to hash install.sh: %w", err)+ }++ actualHash := hex.EncodeToString(hasher.Sum(nil))+ if !strings.EqualFold(actualHash, expectedParts[0]) {+ return "", fmt.Errorf("install.sh checksum verification failed")+ }++ content, err := os.ReadFile(scriptPath)+ if err != nil {+ return "", fmt.Errorf("failed to read install.sh: %w", err)+ }++ return string(content), nil}// parseProgress attempts to parse progress from install script outputdiff --git a/internal/updates/manager.go b/internal/updates/manager.goindex 4e9cbcce78..4aaa5ca660 100644--- a/internal/updates/manager.go+++ b/internal/updates/manager.go@@ -368,11 +368,10 @@ func (m *Manager) ApplyUpdate(ctx context.Context, downloadURL string) error {// Verify checksum if availablem.updateStatus("verifying", 30, "Verifying download...")if err := m.verifyChecksum(ctx, downloadURL, tarballPath); err != nil {- // Log warning but don't fail - checksums might not be available for all releases- log.Warn().Err(err).Msg("Checksum verification failed or unavailable")- } else {- log.Info().Msg("Checksum verification passed")+ m.updateStatus("error", 30, "Failed to verify update checksum")+ return fmt.Errorf("checksum verification failed: %w", err)}+ log.Info().Msg("Checksum verification passed")m.updateStatus("extracting", 40, "Extracting update...")diff --git a/internal/updates/manager_test.go b/internal/updates/manager_test.goindex a873b2feaa..369d1a5636 100644--- a/internal/updates/manager_test.go+++ b/internal/updates/manager_test.go@@ -1,11 +1,15 @@package updatesimport (+ "archive/tar"+ "bytes"+ "compress/gzip""context""encoding/json""net/http""net/http/httptest""os"+ "strings""testing""github.com/rcourtman/pulse-go-rewrite/internal/config"@@ -243,6 +247,71 @@ func TestStableUpdateNotifications(t *testing.T) {}}+func buildDummyTarball(t *testing.T) []byte {+ t.Helper()++ var buf bytes.Buffer+ gw := gzip.NewWriter(&buf)+ tw := tar.NewWriter(gw)++ content := []byte("dummy")+ hdr := &tar.Header{+ Name: "dummy.txt",+ Mode: 0600,+ Size: int64(len(content)),+ }+ if err := tw.WriteHeader(hdr); err != nil {+ t.Fatalf("write tar header: %v", err)+ }+ if _, err := tw.Write(content); err != nil {+ t.Fatalf("write tar content: %v", err)+ }++ if err := tw.Close(); err != nil {+ t.Fatalf("close tar writer: %v", err)+ }+ if err := gw.Close(); err != nil {+ t.Fatalf("close gzip writer: %v", err)+ }++ return buf.Bytes()+}++func TestApplyUpdateFailsOnChecksumError(t *testing.T) {+ t.Setenv("PULSE_UPDATE_SERVER", "http://example.invalid")+ t.Setenv("PULSE_DATA_DIR", t.TempDir())++ tarball := buildDummyTarball(t)++ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ switch {+ case strings.HasSuffix(r.URL.Path, ".tar.gz"):+ w.WriteHeader(http.StatusOK)+ if _, err := w.Write(tarball); err != nil {+ t.Fatalf("write tarball: %v", err)+ }+ default:+ http.NotFound(w, r)+ }+ }))+ defer server.Close()++ cfg := &config.Config{DataPath: t.TempDir()}+ manager := NewManager(cfg)++ downloadURL := server.URL + "/pulse-v0.0.1-linux-amd64.tar.gz"++ err := manager.ApplyUpdate(context.Background(), downloadURL)+ if err == nil {+ t.Fatalf("expected checksum failure error, got nil")+ }++ status := manager.GetStatus()+ if status.Status != "error" {+ t.Fatalf("expected status error, got %q", status.Status)+ }+}+func TestVersionSemverOrdering(t *testing.T) {tests := []struct {name stringdiff --git a/internal/utils/command.go b/internal/utils/command.godeleted file mode 100644index 88859a65fe..0000000000--- a/internal/utils/command.go+++ /dev/null@@ -1,11 +0,0 @@-package utils--import (- "os/exec"-)--// RunCommand executes a system command-func RunCommand(name string, args ...string) error {- cmd := exec.Command(name, args...)- return cmd.Run()-}diff --git a/internal/utils/generics.go b/internal/utils/generics.godeleted file mode 100644index 8f18a6f9e9..0000000000--- a/internal/utils/generics.go+++ /dev/null@@ -1,295 +0,0 @@-package utils--import (- "sync"-)--// SafeMap is a generic thread-safe map-type SafeMap[K comparable, V any] struct {- mu sync.RWMutex- m map[K]V-}--// NewSafeMap creates a new thread-safe map-func NewSafeMap[K comparable, V any]() *SafeMap[K, V] {- return &SafeMap[K, V]{- m: make(map[K]V),- }-}--// NewSafeMapWithCapacity creates a new thread-safe map with initial capacity-func NewSafeMapWithCapacity[K comparable, V any](capacity int) *SafeMap[K, V] {- return &SafeMap[K, V]{- m: make(map[K]V, capacity),- }-}--// Get retrieves a value from the map-func (sm *SafeMap[K, V]) Get(key K) (V, bool) {- sm.mu.RLock()- defer sm.mu.RUnlock()- val, ok := sm.m[key]- return val, ok-}--// Set sets a value in the map-func (sm *SafeMap[K, V]) Set(key K, value V) {- sm.mu.Lock()- defer sm.mu.Unlock()- sm.m[key] = value-}--// Delete removes a key from the map-func (sm *SafeMap[K, V]) Delete(key K) {- sm.mu.Lock()- defer sm.mu.Unlock()- delete(sm.m, key)-}--// Len returns the number of items in the map-func (sm *SafeMap[K, V]) Len() int {- sm.mu.RLock()- defer sm.mu.RUnlock()- return len(sm.m)-}--// Keys returns all keys in the map-func (sm *SafeMap[K, V]) Keys() []K {- sm.mu.RLock()- defer sm.mu.RUnlock()- keys := make([]K, 0, len(sm.m))- for k := range sm.m {- keys = append(keys, k)- }- return keys-}--// Values returns all values in the map-func (sm *SafeMap[K, V]) Values() []V {- sm.mu.RLock()- defer sm.mu.RUnlock()- values := make([]V, 0, len(sm.m))- for _, v := range sm.m {- values = append(values, v)- }- return values-}--// Clear removes all items from the map-func (sm *SafeMap[K, V]) Clear() {- sm.mu.Lock()- defer sm.mu.Unlock()- sm.m = make(map[K]V)-}--// Range iterates over the map with a callback function-func (sm *SafeMap[K, V]) Range(f func(key K, value V) bool) {- sm.mu.RLock()- defer sm.mu.RUnlock()- for k, v := range sm.m {- if !f(k, v) {- break- }- }-}--// CircularBuffer is a generic circular buffer for storing time-series data-type CircularBuffer[T any] struct {- mu sync.RWMutex- data []T- capacity int- head int- tail int- size int-}--// NewCircularBuffer creates a new circular buffer-func NewCircularBuffer[T any](capacity int) *CircularBuffer[T] {- return &CircularBuffer[T]{- data: make([]T, capacity),- capacity: capacity,- }-}--// Push adds an item to the buffer-func (cb *CircularBuffer[T]) Push(item T) {- cb.mu.Lock()- defer cb.mu.Unlock()-- cb.data[cb.tail] = item- cb.tail = (cb.tail + 1) % cb.capacity-- if cb.size < cb.capacity {- cb.size++- } else {- cb.head = (cb.head + 1) % cb.capacity- }-}--// GetAll returns all items in the buffer in order-func (cb *CircularBuffer[T]) GetAll() []T {- cb.mu.RLock()- defer cb.mu.RUnlock()-- if cb.size == 0 {- return []T{}- }-- result := make([]T, cb.size)- if cb.head < cb.tail {- copy(result, cb.data[cb.head:cb.tail])- } else {- n := copy(result, cb.data[cb.head:])- copy(result[n:], cb.data[:cb.tail])- }-- return result-}--// Size returns the current number of items in the buffer-func (cb *CircularBuffer[T]) Size() int {- cb.mu.RLock()- defer cb.mu.RUnlock()- return cb.size-}--// Clear empties the buffer-func (cb *CircularBuffer[T]) Clear() {- cb.mu.Lock()- defer cb.mu.Unlock()- cb.head = 0- cb.tail = 0- cb.size = 0-}--// SliceContains checks if a slice contains a value-func SliceContains[T comparable](slice []T, value T) bool {- for _, v := range slice {- if v == value {- return true- }- }- return false-}--// SliceMap applies a function to each element of a slice-func SliceMap[T any, U any](slice []T, f func(T) U) []U {- result := make([]U, len(slice))- for i, v := range slice {- result[i] = f(v)- }- return result-}--// SliceFilter filters a slice based on a predicate-func SliceFilter[T any](slice []T, predicate func(T) bool) []T {- result := make([]T, 0, len(slice))- for _, v := range slice {- if predicate(v) {- result = append(result, v)- }- }- return result-}--// SliceReduce reduces a slice to a single value-func SliceReduce[T any, U any](slice []T, initial U, reducer func(U, T) U) U {- result := initial- for _, v := range slice {- result = reducer(result, v)- }- return result-}--// SliceUnique returns unique elements from a slice-func SliceUnique[T comparable](slice []T) []T {- seen := make(map[T]struct{})- result := make([]T, 0, len(slice))- for _, v := range slice {- if _, ok := seen[v]; !ok {- seen[v] = struct{}{}- result = append(result, v)- }- }- return result-}--// Ptr returns a pointer to the given value-func Ptr[T any](v T) *T {- return &v-}--// ValueOr returns the value if not nil, otherwise returns the default-func ValueOr[T any](ptr *T, defaultValue T) T {- if ptr != nil {- return *ptr- }- return defaultValue-}--// Result represents a result that can be either a value or an error-type Result[T any] struct {- value T- err error-}--// NewResult creates a new Result-func NewResult[T any](value T, err error) Result[T] {- return Result[T]{value: value, err: err}-}--// Ok creates a successful Result-func Ok[T any](value T) Result[T] {- return Result[T]{value: value}-}--// Err creates an error Result-func Err[T any](err error) Result[T] {- var zero T- return Result[T]{value: zero, err: err}-}--// Value returns the value and error-func (r Result[T]) Value() (T, error) {- return r.value, r.err-}--// IsOk returns true if the result is successful-func (r Result[T]) IsOk() bool {- return r.err == nil-}--// IsErr returns true if the result is an error-func (r Result[T]) IsErr() bool {- return r.err != nil-}--// Unwrap returns the value or panics if there's an error-// Note: Use UnwrapOr for safer error handling-func (r Result[T]) Unwrap() T {- if r.err != nil {- panic(r.err)- }- return r.value-}--// UnwrapSafe returns the value and error without panicking-func (r Result[T]) UnwrapSafe() (T, error) {- return r.value, r.err-}--// UnwrapOr returns the value or a default if there's an error-func (r Result[T]) UnwrapOr(defaultValue T) T {- if r.err != nil {- return defaultValue- }- return r.value-}--// Map transforms the value if successful-func (r Result[T]) Map(f func(T) T) Result[T] {- if r.err != nil {- return r- }- return Ok(f(r.value))-}diff --git a/internal/utils/helpers.go b/internal/utils/helpers.goindex 61273ec142..5dcb45dd56 100644--- a/internal/utils/helpers.go+++ b/internal/utils/helpers.go@@ -4,14 +4,11 @@ import ("encoding/json""fmt""net/http"+ "os"+ "strings""time")-// Float64Ptr returns a pointer to the given float64 value-func Float64Ptr(v float64) *float64 {- return &v-}-// GenerateID generates a unique ID with the given prefixfunc GenerateID(prefix string) string {return fmt.Sprintf("%s-%d", prefix, time.Now().UnixNano())@@ -29,17 +26,17 @@ func WriteJSONResponse(w http.ResponseWriter, data interface{}) error {return err}-// WriteJSONError writes a JSON error response to the http.ResponseWriter-func WriteJSONError(w http.ResponseWriter, message string, code int) {- w.Header().Set("Content-Type", "application/json")- w.WriteHeader(code)- _ = json.NewEncoder(w).Encode(map[string]string{"error": message})+// ParseBool interprets common boolean strings, returning true for typical truthy values.+func ParseBool(value string) bool {+ switch strings.ToLower(strings.TrimSpace(value)) {+ case "1", "true", "yes", "y", "on":+ return true+ default:+ return false+ }}-// DecodeJSONBody decodes a JSON request body into the given interface-func DecodeJSONBody(r *http.Request, v interface{}) error {- if err := json.NewDecoder(r.Body).Decode(v); err != nil {- return err- }- return nil+// GetenvTrim returns the environment variable value with surrounding whitespace removed.+func GetenvTrim(key string) string {+ return strings.TrimSpace(os.Getenv(key))}diff --git a/internal/utils/network.go b/internal/utils/network.godeleted file mode 100644index 647bd008a2..0000000000--- a/internal/utils/network.go+++ /dev/null@@ -1,108 +0,0 @@-package utils--import (- "net"- "strings"-)--// IsPrivateIP checks if an IP address is in private/local ranges (RFC1918)-func IsPrivateIP(ip string) bool {- // Extract IP without port- if idx := strings.LastIndex(ip, ":"); idx != -1 {- ip = ip[:idx]- }-- // Remove brackets from IPv6- ip = strings.Trim(ip, "[]")-- // Parse the IP- parsedIP := net.ParseIP(ip)- if parsedIP == nil {- return false- }-- // Check if it's loopback- if parsedIP.IsLoopback() {- return true- }-- // Check if it's link-local- if parsedIP.IsLinkLocalUnicast() || parsedIP.IsLinkLocalMulticast() {- return true- }-- // Define private IP ranges (RFC1918)- privateRanges := []string{- "10.0.0.0/8", // Class A private- "172.16.0.0/12", // Class B private- "192.168.0.0/16", // Class C private- "127.0.0.0/8", // Loopback- "::1/128", // IPv6 loopback- "fc00::/7", // IPv6 unique local- "fe80::/10", // IPv6 link-local- }-- for _, cidr := range privateRanges {- _, network, err := net.ParseCIDR(cidr)- if err != nil {- continue- }- if network.Contains(parsedIP) {- return true- }- }-- return false-}--// GetClientIP extracts the real client IP from request headers-func GetClientIP(remoteAddr string, xForwardedFor string, xRealIP string) string {- // Check X-Forwarded-For first (for proxies)- if xForwardedFor != "" {- // Take the first IP if there are multiple- if idx := strings.Index(xForwardedFor, ","); idx != -1 {- return strings.TrimSpace(xForwardedFor[:idx])- }- return strings.TrimSpace(xForwardedFor)- }-- // Check X-Real-IP- if xRealIP != "" {- return strings.TrimSpace(xRealIP)- }-- // Fall back to RemoteAddr- return remoteAddr-}--// IsTrustedNetwork checks if an IP is within trusted network ranges-func IsTrustedNetwork(ip string, trustedNetworks []string) bool {- // If no trusted networks defined, consider all private IPs as trusted- if len(trustedNetworks) == 0 {- return IsPrivateIP(ip)- }-- // Extract IP without port- if idx := strings.LastIndex(ip, ":"); idx != -1 {- ip = ip[:idx]- }- ip = strings.Trim(ip, "[]")-- parsedIP := net.ParseIP(ip)- if parsedIP == nil {- return false- }-- // Check against trusted networks- for _, cidr := range trustedNetworks {- _, network, err := net.ParseCIDR(cidr)- if err != nil {- continue- }- if network.Contains(parsedIP) {- return true- }- }-- return false-}diff --git a/internal/utils/ratelimiter.go b/internal/utils/ratelimiter.godeleted file mode 100644index e9f5335e77..0000000000--- a/internal/utils/ratelimiter.go+++ /dev/null@@ -1,236 +0,0 @@-package utils--import (- "context"- "sync"- "time"-)--// RateLimiter is a generic rate limiter using channels-type RateLimiter[T any] struct {- rate int // requests per interval- interval time.Duration // time interval- tokens chan struct{} // token bucket- stopCh chan struct{}- once sync.Once-}--// NewRateLimiter creates a new rate limiter-func NewRateLimiter[T any](rate int, interval time.Duration) *RateLimiter[T] {- rl := &RateLimiter[T]{- rate: rate,- interval: interval,- tokens: make(chan struct{}, rate),- stopCh: make(chan struct{}),- }-- // Fill initial tokens- for i := 0; i < rate; i++ {- rl.tokens <- struct{}{}- }-- // Start token refill goroutine- go rl.refillTokens()-- return rl-}--// refillTokens periodically adds tokens to the bucket-func (rl *RateLimiter[T]) refillTokens() {- ticker := time.NewTicker(rl.interval / time.Duration(rl.rate))- defer ticker.Stop()-- for {- select {- case <-ticker.C:- select {- case rl.tokens <- struct{}{}:- // Token added successfully- default:- // Bucket is full- }- case <-rl.stopCh:- return- }- }-}--// Wait blocks until a token is available-func (rl *RateLimiter[T]) Wait(ctx context.Context) error {- select {- case <-rl.tokens:- return nil- case <-ctx.Done():- return ctx.Err()- }-}--// TryAcquire attempts to acquire a token without blocking-func (rl *RateLimiter[T]) TryAcquire() bool {- select {- case <-rl.tokens:- return true- default:- return false- }-}--// Close stops the rate limiter-func (rl *RateLimiter[T]) Close() {- rl.once.Do(func() {- close(rl.stopCh)- })-}--// RateLimitedProcessor processes items with rate limiting-type RateLimitedProcessor[T any, R any] struct {- limiter *RateLimiter[T]- processor func(context.Context, T) (R, error)-}--// NewRateLimitedProcessor creates a new rate limited processor-func NewRateLimitedProcessor[T any, R any](rate int, interval time.Duration, processor func(context.Context, T) (R, error)) *RateLimitedProcessor[T, R] {- return &RateLimitedProcessor[T, R]{- limiter: NewRateLimiter[T](rate, interval),- processor: processor,- }-}--// Process processes an item with rate limiting-func (rlp *RateLimitedProcessor[T, R]) Process(ctx context.Context, item T) (R, error) {- if err := rlp.limiter.Wait(ctx); err != nil {- var zero R- return zero, err- }- return rlp.processor(ctx, item)-}--// ProcessBatch processes multiple items with rate limiting-func (rlp *RateLimitedProcessor[T, R]) ProcessBatch(ctx context.Context, items []T) []Result[R] {- results := make([]Result[R], len(items))-- for i, item := range items {- r, err := rlp.Process(ctx, item)- if err != nil {- results[i] = Err[R](err)- } else {- results[i] = Ok(r)- }- }-- return results-}--// Close closes the processor-func (rlp *RateLimitedProcessor[T, R]) Close() {- rlp.limiter.Close()-}--// Pipeline represents a generic processing pipeline-type Pipeline[T any, R any] struct {- stages []func(T) Result[T]- final func(T) Result[R]-}--// NewPipeline creates a new processing pipeline-func NewPipeline[T any, R any]() *Pipeline[T, R] {- return &Pipeline[T, R]{- stages: make([]func(T) Result[T], 0),- }-}--// AddStage adds a processing stage to the pipeline-func (p *Pipeline[T, R]) AddStage(stage func(T) Result[T]) *Pipeline[T, R] {- p.stages = append(p.stages, stage)- return p-}--// SetFinal sets the final transformation stage-func (p *Pipeline[T, R]) SetFinal(final func(T) Result[R]) *Pipeline[T, R] {- p.final = final- return p-}--// Process runs an item through the pipeline-func (p *Pipeline[T, R]) Process(input T) Result[R] {- current := Ok(input)-- // Process through each stage- for _, stage := range p.stages {- if current.IsErr() {- break- }- current = stage(current.Unwrap())- }-- // If any stage failed, return error- if current.IsErr() {- var zero R- return Result[R]{value: zero, err: current.err}- }-- // Apply final transformation- if p.final != nil {- return p.final(current.Unwrap())- }-- // If no final transformation, return error- // In a real implementation, we'd need type constraints to handle T->R conversion- return Err[R](nil)-}--// ProcessAll processes multiple items through the pipeline-func (p *Pipeline[T, R]) ProcessAll(inputs []T) []Result[R] {- return SliceMap(inputs, p.Process)-}--// Throttle is a generic throttler using channels-type Throttle[T any] struct {- input chan T- output chan T- delay time.Duration-}--// NewThrottle creates a new throttler-func NewThrottle[T any](bufferSize int, delay time.Duration) *Throttle[T] {- t := &Throttle[T]{- input: make(chan T, bufferSize),- output: make(chan T, bufferSize),- delay: delay,- }- go t.run()- return t-}--// run processes items with throttling-func (t *Throttle[T]) run() {- ticker := time.NewTicker(t.delay)- defer ticker.Stop()-- for {- select {- case item, ok := <-t.input:- if !ok {- close(t.output)- return- }- <-ticker.C- t.output <- item- }- }-}--// Send sends an item to be throttled-func (t *Throttle[T]) Send(item T) {- t.input <- item-}--// Receive receives a throttled item-func (t *Throttle[T]) Receive() <-chan T {- return t.output-}--// Close closes the throttle-func (t *Throttle[T]) Close() {- close(t.input)-}diff --git a/pkg/agents/docker/report.go b/pkg/agents/docker/report.goindex 78418be7d9..2fa7953b3e 100644--- a/pkg/agents/docker/report.go+++ b/pkg/agents/docker/report.go@@ -33,6 +33,8 @@ type HostInfo struct {Name string `json:"name,omitempty"`MachineID string `json:"machineId,omitempty"`OS string `json:"os,omitempty"`+ Runtime string `json:"runtime,omitempty"`+ RuntimeVersion string `json:"runtimeVersion,omitempty"`KernelVersion string `json:"kernelVersion,omitempty"`Architecture string `json:"architecture,omitempty"`DockerVersion string `json:"dockerVersion,omitempty"`@@ -72,6 +74,7 @@ type Container struct {RootFilesystemBytes int64 `json:"rootFilesystemBytes,omitempty"`BlockIO *ContainerBlockIO `json:"blockIo,omitempty"`Mounts []ContainerMount `json:"mounts,omitempty"`+ Podman *PodmanContainer `json:"podman,omitempty"`}// ContainerPort tracks an exposed container port mapping.@@ -95,6 +98,20 @@ type ContainerBlockIO struct {WriteBytes uint64 `json:"writeBytes,omitempty"`}+// PodmanContainer carries metadata extracted from Podman-specific annotations.+type PodmanContainer struct {+ PodName string `json:"podName,omitempty"`+ PodID string `json:"podId,omitempty"`+ Infra bool `json:"infra,omitempty"`+ ComposeProject string `json:"composeProject,omitempty"`+ ComposeService string `json:"composeService,omitempty"`+ ComposeWorkdir string `json:"composeWorkdir,omitempty"`+ ComposeConfig string `json:"composeConfigHash,omitempty"`+ AutoUpdatePolicy string `json:"autoUpdatePolicy,omitempty"`+ AutoUpdateRestart string `json:"autoUpdateRestart,omitempty"`+ UserNS string `json:"userNamespace,omitempty"`+}+// ContainerMount describes a mount point exposed inside a container.type ContainerMount struct {Type string `json:"type,omitempty"`diff --git a/pkg/proxmox/client.go b/pkg/proxmox/client.goindex 0dfcb703fe..b70f57b9d2 100644--- a/pkg/proxmox/client.go+++ b/pkg/proxmox/client.go@@ -1289,23 +1289,6 @@ func (c *Client) IsClusterMember(ctx context.Context) (bool, error) {return nodeCount > 1, nil}-// GetClusterNodes returns all nodes in the cluster with their connection info-func (c *Client) GetClusterNodes(ctx context.Context) ([]ClusterStatus, error) {- status, err := c.GetClusterStatus(ctx)- if err != nil {- return nil, err- }-- var nodes []ClusterStatus- for _, s := range status {- if s.Type == "node" {- nodes = append(nodes, s)- }- }-- return nodes, nil-}-// GetVMConfig returns the configuration for a specific VMfunc (c *Client) GetVMConfig(ctx context.Context, node string, vmid int) (map[string]interface{}, error) {resp, err := c.get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/config", node, vmid))@@ -1973,25 +1956,3 @@ func (c *Client) GetDisks(ctx context.Context, node string) ([]Disk, error) {return result.Data, nil}--// GetDiskSmart returns SMART data for a specific disk-func (c *Client) GetDiskSmart(ctx context.Context, node, disk string) (*DiskSmart, error) {- params := url.Values{- "disk": {disk},- }-- resp, err := c.request(ctx, "GET", fmt.Sprintf("/nodes/%s/disks/smart?%s", node, params.Encode()), nil)- if err != nil {- return nil, err- }- defer resp.Body.Close()-- var result struct {- Data DiskSmart `json:"data"`- }- if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {- return nil, err- }-- return &result.Data, nil-}diff --git a/pkg/proxmox/cluster_client.go b/pkg/proxmox/cluster_client.goindex 588b9676b5..d314a1e95b 100644--- a/pkg/proxmox/cluster_client.go+++ b/pkg/proxmox/cluster_client.go@@ -10,7 +10,6 @@ import ("sync""time"- "github.com/rcourtman/pulse-go-rewrite/internal/models""github.com/rs/zerolog/log")@@ -1073,42 +1072,6 @@ func (cc *ClusterClient) GetZFSPoolsWithDetails(ctx context.Context, node stringreturn result, err}-// GetClusterHealthInfo returns detailed health information about the cluster-func (cc *ClusterClient) GetClusterHealthInfo() models.ClusterHealth {- cc.mu.RLock()- defer cc.mu.RUnlock()-- health := models.ClusterHealth{- Name: cc.name,- TotalNodes: len(cc.endpoints),- OnlineNodes: 0,- OfflineNodes: 0,- NodeStatuses: make([]models.ClusterNodeStatus, 0, len(cc.endpoints)),- }-- for endpoint, isHealthy := range cc.nodeHealth {- status := models.ClusterNodeStatus{- Endpoint: endpoint,- Online: isHealthy,- }-- if isHealthy {- health.OnlineNodes++- } else {- health.OfflineNodes++- }-- health.NodeStatuses = append(health.NodeStatuses, status)- }-- // Calculate overall health percentage- if health.TotalNodes > 0 {- health.HealthPercentage = float64(health.OnlineNodes) / float64(health.TotalNodes) * 100- }-- return health-}-// Helper to check if error is auth-relatedfunc (cc *ClusterClient) GetDisks(ctx context.Context, node string) ([]Disk, error) {var result []Diskdiff --git a/pulse-docker-agent b/pulse-docker-agentdeleted file mode 100755index f0117e55e7..0000000000Binary files a/pulse-docker-agent and /dev/null differdiff --git a/pulse-server b/pulse-serverdeleted file mode 100755index d5e7c301b8..0000000000Binary files a/pulse-server and /dev/null differdiff --git a/scripts/build-release.sh b/scripts/build-release.shindex f743e2a325..9b1e07261e 100755--- a/scripts/build-release.sh+++ b/scripts/build-release.sh@@ -25,10 +25,8 @@ mkdir -p $BUILD_DIR $RELEASE_DIR# Build frontendecho "Building frontend..."-cd frontend-modern-npm ci-npm run build-cd ..+npm --prefix frontend-modern ci+npm --prefix frontend-modern run build# Copy frontend dist for embedding (required for Go embed)echo "Copying frontend dist for embedding..."diff --git a/scripts/cleanup.sh b/scripts/cleanup.shnew file mode 100755index 0000000000..74206c4ef9--- /dev/null+++ b/scripts/cleanup.sh@@ -0,0 +1,97 @@+#!/usr/bin/env bash++set -euo pipefail++ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"++TARGETS=(+ "bin"+ "build"+ "dist"+ "downloads"+ "frontend-modern/dist"+ "frontend-modern/node_modules"+ "frontend-modern/release"+ "frontend-modern/.vite"+ "frontend-modern/.cache"+ "frontend-modern/.eslintcache"+ "frontend"+ "frontend-modern/public/download"+ "frontend-modern/public/pulse-host-agent-windows-amd64.exe"+ "frontend-modern/public/pulse-host-agent-darwin-arm64.tar.gz"+ "frontend-modern/public/pulse-host-agent-darwin-amd64.tar.gz"+ "frontend-modern/public/pulse-host-agent-linux-amd64"+ "frontend-modern/public/pulse-host-agent-linux-arm64"+ "frontend-modern/public/pulse-host-agent-linux-armv7"+ "data"+ "internal/api/frontend-modern"+ "node_modules"+ "pulse"+ "pulse.log"+ "pulse-docker-agent"+ "pulse-sensor-proxy"+ "pulse-server"+ "pulse-test"+ "pulse-host-agent"+ "pulse-host-agent-linux-amd64"+ "pulse-host-agent-linux-arm64"+ "pulse-host-agent-linux-armv7"+ "pulse-host-agent-darwin-amd64"+ "pulse-host-agent-darwin-arm64"+ "pulse-host-agent-windows-amd64"+ "monitoring.test"+ "release"+ "scripts/macos/dist"+ "testing-tools/node_modules"+ "tmp"+ ".codex"+ ".claudecode-hooks"+ ".claudecode-settings.json"+ ".claude"+ ".mcp-servers"+ ".env"+ ".env.local"+ ".tmp"+ ".cache"+ ".parcel-cache"+ ".sass-cache"+ ".turbo"+ ".next"+ ".pytest_cache"+ ".gradle"+)++try_remove() {+ local path="$1"+ if [ -e "$path" ]; then+ local rel="${path#"${ROOT}/"}"+ if git -C "${ROOT}" ls-files --error-unmatch "$rel" >/dev/null 2>&1; then+ echo "Skipping tracked ${rel}"+ return+ fi+ if rm -rf "$path" 2>/dev/null; then+ echo "Removed ${path#"${ROOT}/"}"+ elif command -v sudo >/dev/null 2>&1; then+ sudo rm -rf "$path"+ echo "Removed ${path#"${ROOT}/"} (via sudo)"+ else+ echo "Warning: unable to remove ${path#"${ROOT}/"}" >&2+ fi+ fi+}++for target in "${TARGETS[@]}"; do+ try_remove "${ROOT}/${target}"+done++find "${ROOT}" -maxdepth 1 -type f -name "*.log" -print -delete+find "${ROOT}/frontend-modern" -maxdepth 1 -type f -name "*.log" -print -delete+find "${ROOT}" -maxdepth 2 -type d -name "coverage" -prune -exec rm -rf {} ++find "${ROOT}" -maxdepth 2 -type f \( -name "*.coverage" -o -name "coverage*.out" \) -delete+find "${ROOT}" -type d -name "__pycache__" -prune -exec rm -rf {} ++find "${ROOT}" -type f -name "*.pyc" -delete+find "${ROOT}" -type f \( -name "*.tmp" -o -name "*.bak" -o -name "*.backup" -o -name "*~" -o -name "*.orig" \) -delete+find "${ROOT}" -type f \( -name ".DS_Store" -o -name "Thumbs.db" \) -delete+find "${ROOT}" -maxdepth 2 -type d -empty -delete++echo "Cleanup complete."diff --git a/scripts/dev-hot.sh b/scripts/dev-hot.shdeleted file mode 100755index 4b814d907a..0000000000--- a/scripts/dev-hot.sh+++ /dev/null@@ -1,77 +0,0 @@-#!/usr/bin/env bash-set -euo pipefail--SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)-ROOT_DIR=$(cd "${SCRIPT_DIR}/.." && pwd)--load_env_file() {- local env_file=$1- if [[ -f ${env_file} ]]; then- printf "[dev-hot] Loading %s\n" "${env_file}"- set +u- set -a- # shellcheck disable=SC1090- source "${env_file}"- set +a- set -u- fi-}--load_env_file "${ROOT_DIR}/.env"-load_env_file "${ROOT_DIR}/.env.local"-load_env_file "${ROOT_DIR}/.env.dev"--FRONTEND_PORT=${FRONTEND_PORT:-${PORT:-7655}}-PORT=${PORT:-${FRONTEND_PORT}}-export FRONTEND_PORT PORT--PULSE_DEV_API_HOST=${PULSE_DEV_API_HOST:-127.0.0.1}-PULSE_DEV_API_PORT=${PULSE_DEV_API_PORT:-${FRONTEND_PORT}}-PULSE_DEV_API_URL=${PULSE_DEV_API_URL:-http://${PULSE_DEV_API_HOST}:${PULSE_DEV_API_PORT}}-export PULSE_DEV_API_HOST PULSE_DEV_API_PORT PULSE_DEV_API_URL--FRONTEND_DEV_HOST=${FRONTEND_DEV_HOST:-127.0.0.1}-FRONTEND_DEV_PORT=${FRONTEND_DEV_PORT:-5173}-FRONTEND_DEV_SERVER=${FRONTEND_DEV_SERVER:-http://${FRONTEND_DEV_HOST}:${FRONTEND_DEV_PORT}}-BACKEND_CMD=${BACKEND_CMD:-go run ./cmd/pulse}-VITE_ARGS=${VITE_ARGS:-}--printf "[dev-hot] Backend port: %s\n" "${FRONTEND_PORT}"-printf "[dev-hot] Backend API URL: %s\n" "${PULSE_DEV_API_URL}"-printf "[dev-hot] Frontend dev server target: %s\n" "${FRONTEND_DEV_SERVER}"--cleanup() {- local exit_code=${1:-$?}- trap - EXIT INT TERM- if [[ -n ${VITE_PID:-} ]] && kill -0 "$VITE_PID" >/dev/null 2>&1; then- kill "$VITE_PID" >/dev/null 2>&1 || true- fi- if [[ -n ${BACKEND_PID:-} ]] && kill -0 "$BACKEND_PID" >/dev/null 2>&1; then- kill "$BACKEND_PID" >/dev/null 2>&1 || true- fi- wait >/dev/null 2>&1 || true- exit "$exit_code"-}--trap cleanup EXIT INT TERM--export FRONTEND_DEV_HOST FRONTEND_DEV_PORT FRONTEND_DEV_SERVER--printf "[dev-hot] Starting Vite dev server at %s\n" "$FRONTEND_DEV_SERVER"-(- cd frontend-modern- npm run dev -- --host "$FRONTEND_DEV_HOST" --port "$FRONTEND_DEV_PORT" $VITE_ARGS-) &-VITE_PID=$!--# Give Vite a moment to boot up before starting the backend proxy.-sleep 2--printf "[dev-hot] Starting Pulse backend with FRONTEND_DEV_SERVER=%s\n" "$FRONTEND_DEV_SERVER"-${BACKEND_CMD} &-BACKEND_PID=$!--# Wait for either process to exit and propagate the status code.-wait -n "$VITE_PID" "$BACKEND_PID"-EXIT_STATUS=$?-cleanup "$EXIT_STATUS"diff --git a/scripts/install-container-agent.sh b/scripts/install-container-agent.shnew file mode 100755index 0000000000..52a4016468--- /dev/null+++ b/scripts/install-container-agent.sh@@ -0,0 +1,889 @@+#!/usr/bin/env bash+# Pulse Container Runtime Agent installer+set -euo pipefail++# -----------------------------------------------------------------------------+# Logging helpers (borrowed from legacy installer for consistent UX)+# -----------------------------------------------------------------------------++log_info() {+ printf '[INFO] %s\n' "$1"+}++log_warn() {+ printf '[WARN] %s\n' "$1" >&2+}++log_error() {+ printf '[ERROR] %s\n' "$1" >&2+}++log_success() {+ printf '[ OK ] %s\n' "$1"+}++log_header() {+ printf '\n== %s ==\n' "$1"+}++# -----------------------------------------------------------------------------+# Utility helpers+# -----------------------------------------------------------------------------++trim() {+ local value="$1"+ value="${value#"${value%%[![:space:]]*}"}"+ value="${value%"${value##*[![:space:]]}"}"+ printf '%s' "$value"+}++to_lower() {+ printf '%s' "$1" | tr '[:upper:]' '[:lower:]'+}++parse_bool() {+ local value+ value="$(to_lower "${1:-}")"+ case "$value" in+ 1|true|yes|y|on)+ PARSED_BOOL="true"+ return 0+ ;;+ 0|false|no|n|off|"")+ PARSED_BOOL="false"+ return 0+ ;;+ esac+ return 1+}++# -----------------------------------------------------------------------------+# Target parsing helpers (reused from legacy installer)+# -----------------------------------------------------------------------------++declare -a TARGET_SPECS=()+declare -a TARGETS=()+declare -A SEEN_TARGETS++parse_target_spec() {+ local spec="$1"+ local raw_url raw_token raw_insecure++ IFS='|' read -r raw_url raw_token raw_insecure <<< "$spec"+ raw_url=$(trim "$raw_url")+ raw_token=$(trim "$raw_token")+ raw_insecure=$(trim "$raw_insecure")++ if [[ -z "$raw_url" || -z "$raw_token" ]]; then+ log_error "Invalid target spec \"$spec\". Expected format url|token[|insecure]."+ return 1+ fi++ PARSED_TARGET_URL="${raw_url%/}"+ PARSED_TARGET_TOKEN="$raw_token"++ if [[ -n "$raw_insecure" ]]; then+ if parse_bool "$raw_insecure"; then+ PARSED_TARGET_INSECURE="$PARSED_BOOL"+ else+ log_error "Invalid insecure flag \"$raw_insecure\" in target spec \"$spec\"."+ return 1+ fi+ else+ PARSED_TARGET_INSECURE="false"+ fi++ return 0+}++split_targets_from_env() {+ local value="$1"+ if [[ -z "$value" ]]; then+ return 0+ fi++ value="${value//$'\n'/;}"+ IFS=';' read -ra __env_targets <<< "$value"+ for entry in "${__env_targets[@]}"; do+ local trimmed_entry+ trimmed_entry=$(trim "$entry")+ if [[ -n "$trimmed_entry" ]]; then+ TARGET_SPECS+=("$trimmed_entry")+ fi+ done+}++# -----------------------------------------------------------------------------+# Default paths + globals+# -----------------------------------------------------------------------------++DEFAULT_ROOTFUL_AGENT="/usr/local/bin/pulse-docker-agent"+DEFAULT_ROOTLESS_AGENT="$HOME/.local/bin/pulse-docker-agent"+ROOTFUL_ENV_FILE="/etc/pulse/pulse-docker-agent.env"+ROOTFUL_SERVICE="/etc/systemd/system/pulse-docker-agent.service"+ROOTFUL_LOG="/var/log/pulse-docker-agent.log"+ROOTLESS_ENV_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/pulse/pulse-docker-agent.env"+ROOTLESS_SERVICE="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/pulse-docker-agent.service"+ROOTLESS_LOG="${XDG_STATE_HOME:-$HOME/.local/state}/pulse-docker-agent/pulse-docker-agent.log"++INTERVAL="30s"+UNINSTALL="false"+PURGE="false"+RUNTIME="podman"+RUNTIME_MODE="auto"+ROOTLESS="auto"+CONTAINER_SOCKET_INPUT=""+CONTAINER_SOCKET_PATH=""+CONTAINER_SOCKET_URI=""+PULSE_URL=""+TOKEN=""+PRIMARY_URL=""+PRIMARY_TOKEN=""+PRIMARY_INSECURE="false"+JOINED_TARGETS=""+INSTALLER_URL_HINT=""+NO_AUTO_UPDATE_FLAG=""+DOWNLOAD_ARCH=""+AGENT_PATH_OVERRIDE=""+AGENT_PATH=""++PULSE_TARGETS_ENV="${PULSE_TARGETS:-}"+PULSE_RUNTIME_ENV="$(trim "${PULSE_RUNTIME:-}")"+PULSE_RUNTIME_SOCKET_ENV="$(trim "${PULSE_CONTAINER_SOCKET:-${CONTAINER_HOST:-}}")"+PULSE_ROOTLESS_ENV="$(trim "${PULSE_RUNTIME_ROOTLESS:-}")"++ORIGINAL_ARGS=("$@")++# -----------------------------------------------------------------------------+# Argument parsing+# -----------------------------------------------------------------------------++usage() {+ cat <<'EOF'+Pulse Container Agent Installer++Usage:+ install-container-agent.sh [options]++Options:+ --url <url> Primary Pulse server URL.+ --token <token> API token for the primary server (legacy mode).+ --target <spec> Fan-out target spec (url|token[|insecure]); repeatable.+ --interval <duration> Reporting interval (default 30s).+ --runtime <name> Container runtime (podman|docker|auto). Default podman.+ --container-socket <s> Container runtime socket path or unix:// URI.+ --rootless Force rootless install (user service).+ --system Force system-wide install (requires root).+ --agent-path <path> Override binary installation path.+ --uninstall Remove existing installation.+ --purge Remove config files when uninstalling.+ --help Show this help message.+EOF+}++if [[ $# -eq 0 ]]; then+ : # allow interactive prompts when desired+fi++while [[ $# -gt 0 ]]; do+ case "$1" in+ --help|-h)+ usage+ exit 0+ ;;+ --url)+ PULSE_URL="$2"+ shift 2+ ;;+ --token)+ TOKEN="$2"+ shift 2+ ;;+ --target)+ TARGET_SPECS+=("$2")+ shift 2+ ;;+ --interval)+ INTERVAL="$2"+ shift 2+ ;;+ --runtime)+ RUNTIME="$2"+ shift 2+ ;;+ --runtime=*)+ RUNTIME="${1#--runtime=}"+ shift+ ;;+ --container-socket|--socket)+ CONTAINER_SOCKET_INPUT="$2"+ shift 2+ ;;+ --container-socket=*|--socket=*)+ CONTAINER_SOCKET_INPUT="${1#*=}"+ shift+ ;;+ --rootless)+ ROOTLESS="true"+ shift+ ;;+ --system)+ ROOTLESS="false"+ shift+ ;;+ --agent-path)+ AGENT_PATH_OVERRIDE="$2"+ shift 2+ ;;+ --agent-path=*)+ AGENT_PATH_OVERRIDE="${1#*=}"+ shift+ ;;+ --uninstall)+ UNINSTALL="true"+ shift+ ;;+ --purge)+ PURGE="true"+ shift+ ;;+ *)+ log_error "Unknown option: $1"+ usage+ exit 1+ ;;+ esac+done++# -----------------------------------------------------------------------------+# Normalise runtime + mode+# -----------------------------------------------------------------------------++if [[ -n "$PULSE_RUNTIME_ENV" ]]; then+ RUNTIME="$PULSE_RUNTIME_ENV"+fi+RUNTIME="$(to_lower "$(trim "$RUNTIME")")"+if [[ -z "$RUNTIME" || "$RUNTIME" == "auto" ]]; then+ # Prefer docker if explicitly available (compat with legacy usage),+ # otherwise fall back to podman.+ if command -v docker >/dev/null 2>&1; then+ RUNTIME="docker"+ elif command -v podman >/dev/null 2>&1; then+ RUNTIME="podman"+ else+ RUNTIME="podman"+ fi+fi++if [[ "$RUNTIME" == "docker" ]]; then+ # Chain to legacy installer for Docker runtime.+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"+ if [[ -f "${SCRIPT_DIR}/install-docker-agent.sh" ]]; then+ exec "${SCRIPT_DIR}/install-docker-agent.sh" "${ORIGINAL_ARGS[@]}"+ fi+ log_error "Docker runtime requested but install-docker-agent.sh not found."+ exit 1+fi++if [[ "$RUNTIME" != "podman" ]]; then+ log_error "Unsupported runtime \"$RUNTIME\". Supported: podman, docker."+ exit 1+fi++# Determine rootless/system preference+if [[ -n "$PULSE_ROOTLESS_ENV" ]]; then+ if parse_bool "$PULSE_ROOTLESS_ENV"; then+ ROOTLESS="$PARSED_BOOL"+ fi+fi++if [[ "$ROOTLESS" == "auto" ]]; then+ if [[ "$EUID" -ne 0 ]]; then+ ROOTLESS="true"+ else+ ROOTLESS="false"+ fi+else+ ROOTLESS="$(to_lower "$ROOTLESS")"+ case "$ROOTLESS" in+ true|false)+ ;;+ *)+ if parse_bool "$ROOTLESS"; then+ ROOTLESS="$PARSED_BOOL"+ else+ ROOTLESS="false"+ fi+ ;;+ esac+fi++# Runtime socket+if [[ -n "$PULSE_RUNTIME_SOCKET_ENV" && -z "$CONTAINER_SOCKET_INPUT" ]]; then+ CONTAINER_SOCKET_INPUT="$PULSE_RUNTIME_SOCKET_ENV"+fi++normalize_socket() {+ local input="$1"+ if [[ "$input" == unix://* ]]; then+ CONTAINER_SOCKET_URI="$input"+ CONTAINER_SOCKET_PATH="${input#unix://}"+ else+ CONTAINER_SOCKET_PATH="$input"+ CONTAINER_SOCKET_URI="unix://$CONTAINER_SOCKET_PATH"+ fi++ if [[ "$CONTAINER_SOCKET_PATH" != /* ]]; then+ log_error "Socket path must be absolute: $CONTAINER_SOCKET_PATH"+ exit 1+ fi+}++if [[ -n "$CONTAINER_SOCKET_INPUT" ]]; then+ normalize_socket "$CONTAINER_SOCKET_INPUT"+else+ if [[ "$ROOTLESS" == "true" ]]; then+ CONTAINER_SOCKET_PATH="/run/user/$UID/podman/podman.sock"+ else+ CONTAINER_SOCKET_PATH="/run/podman/podman.sock"+ fi+ CONTAINER_SOCKET_URI="unix://$CONTAINER_SOCKET_PATH"+fi++# -----------------------------------------------------------------------------+# Common validation helpers+# -----------------------------------------------------------------------------++ensure_command() {+ local cmd="$1"+ if ! command -v "$cmd" >/dev/null 2>&1; then+ log_error "Required command '$cmd' not found in PATH."+ exit 1+ fi+}++ensure_podman_socket() {+ if [[ ! -S "$CONTAINER_SOCKET_PATH" ]]; then+ if [[ "$ROOTLESS" == "true" ]]; then+ log_info "Podman socket not detected at $CONTAINER_SOCKET_PATH"+ log_info "Attempting to enable podman.socket for the current user"+ if command -v systemctl >/dev/null 2>&1; then+ systemctl --user enable --now podman.socket >/dev/null 2>&1 || true+ fi+ else+ log_info "Podman socket not detected at $CONTAINER_SOCKET_PATH"+ log_info "Attempting to enable system podman.socket"+ if command -v systemctl >/dev/null 2>&1; then+ systemctl enable --now podman.socket >/dev/null 2>&1 || true+ fi+ fi+ fi++ if [[ ! -S "$CONTAINER_SOCKET_PATH" ]]; then+ log_warn "Podman API socket not found at $CONTAINER_SOCKET_PATH."+ log_warn "Start it manually with 'podman system service --time=0' or enable podman.socket."+ fi+}++# -----------------------------------------------------------------------------+# Target + token normalisation+# -----------------------------------------------------------------------------++PULSE_URL="$(trim "$PULSE_URL")"+PULSE_URL="${PULSE_URL%/}"+TOKEN="$(trim "$TOKEN")"++split_targets_from_env "$PULSE_TARGETS_ENV"++if [[ -n "$PULSE_URL" && -n "$TOKEN" ]]; then+ TARGET_SPECS+=("${PULSE_URL}|${TOKEN}")+fi++if [[ -n "$PULSE_URL" && -z "$TOKEN" && ${#TARGET_SPECS[@]} -eq 0 ]]; then+ log_error "--token or at least one --target is required when --url is provided."+ exit 1+fi++if [[ ${#TARGET_SPECS[@]} -eq 0 ]]; then+ log_error "No Pulse targets specified. Use --target or --url + --token."+ exit 1+fi++for spec in "${TARGET_SPECS[@]}"; do+ if ! parse_target_spec "$spec"; then+ exit 1+ fi++ local_normalized="${PARSED_TARGET_URL}|${PARSED_TARGET_TOKEN}|${PARSED_TARGET_INSECURE}"+ if [[ -n "${SEEN_TARGETS[$local_normalized]+x}" ]]; then+ continue+ fi+ SEEN_TARGETS[$local_normalized]=1+ TARGETS+=("$local_normalized")+done++if [[ ${#TARGETS[@]} -eq 0 ]]; then+ log_error "No valid Pulse targets after normalisation."+ exit 1+fi++PRIMARY_URL="$(printf '%s' "${TARGETS[0]}" | awk -F'|' '{print $1}')"+PRIMARY_TOKEN="$(printf '%s' "${TARGETS[0]}" | awk -F'|' '{print $2}')"+PRIMARY_INSECURE="$(printf '%s' "${TARGETS[0]}" | awk -F'|' '{print $3}')"++JOINED_TARGETS=$(printf "%s;" "${TARGETS[@]}")+JOINED_TARGETS="${JOINED_TARGETS%;}"++# -----------------------------------------------------------------------------+# Download helpers (shared for both modes)+# -----------------------------------------------------------------------------++determine_arch() {+ local arch+ arch=$(uname -m)+ case "$arch" in+ x86_64|amd64)+ DOWNLOAD_ARCH="linux-amd64"+ ;;+ aarch64|arm64)+ DOWNLOAD_ARCH="linux-arm64"+ ;;+ armv7l|armhf|armv7)+ DOWNLOAD_ARCH="linux-armv7"+ ;;+ *)+ DOWNLOAD_ARCH=""+ ;;+ esac+}++download_agent() {+ ensure_command uname+ determine_arch++ if ! command -v curl >/dev/null 2>&1 && ! command -v wget >/dev/null 2>&1; then+ log_error "Neither curl nor wget found in PATH."+ exit 1+ fi++ local download_url="$PRIMARY_URL/download/pulse-docker-agent"+ if [[ -n "$DOWNLOAD_ARCH" ]]; then+ download_url="$download_url?arch=$DOWNLOAD_ARCH"+ fi++ log_info "Fetching agent binary from $download_url"++ local tmp+ tmp=$(mktemp "${AGENT_PATH}.download.XXXXXX")++ local fetched="false"+ if command -v wget >/dev/null 2>&1; then+ local wget_args=(-q -O "$tmp" "$download_url")+ if [[ "$PRIMARY_INSECURE" == "true" ]]; then+ wget_args=(--no-check-certificate "${wget_args[@]}")+ fi+ if wget "${wget_args[@]}"; then+ fetched="true"+ else+ rm -f "$tmp"+ fi+ fi++ if [[ "$fetched" != "true" ]]; then+ if command -v curl >/dev/null 2>&1; then+ local curl_args=(-fL --progress-bar -o "$tmp" "$download_url")+ if [[ "$PRIMARY_INSECURE" == "true" ]]; then+ curl_args=(-k "${curl_args[@]}")+ fi+ if curl "${curl_args[@]}"; then+ fetched="true"+ else+ rm -f "$tmp"+ fi+ fi+ fi++ if [[ "$fetched" != "true" ]]; then+ log_error "Failed to download agent binary."+ exit 1+ fi++ mv "$tmp" "$AGENT_PATH"+ chmod +x "$AGENT_PATH"+ log_success "Agent installed at $AGENT_PATH"+}++# -----------------------------------------------------------------------------+# Rootful (system) installation helpers+# -----------------------------------------------------------------------------++SERVICE_USER="pulse-docker"+SERVICE_GROUP="pulse-docker"+SERVICE_HOME="/var/lib/pulse-docker-agent"+SERVICE_USER_CREATED="false"+SERVICE_USER_ACTUAL="$SERVICE_USER"+SERVICE_GROUP_ACTUAL="$SERVICE_GROUP"+SYSTEMD_SUPPLEMENTARY_GROUPS_LINE=""++ensure_service_user() {+ if id -u "$SERVICE_USER" >/dev/null 2>&1; then+ SERVICE_USER_ACTUAL="$SERVICE_USER"+ if getent group "$SERVICE_GROUP" >/dev/null 2>&1; then+ SERVICE_GROUP_ACTUAL="$SERVICE_GROUP"+ else+ SERVICE_GROUP_ACTUAL="$(id -gn "$SERVICE_USER")"+ fi+ return+ fi++ if ! command -v useradd >/dev/null 2>&1; then+ log_warn "useradd not available; running service as root"+ SERVICE_USER_ACTUAL="root"+ SERVICE_GROUP_ACTUAL="root"+ return+ fi++ if ! getent group "$SERVICE_GROUP" >/dev/null 2>&1; then+ groupadd --system "$SERVICE_GROUP" >/dev/null 2>&1 || true+ fi+ useradd --system --home "$SERVICE_HOME" --shell /usr/sbin/nologin --gid "$SERVICE_GROUP" "$SERVICE_USER" >/dev/null 2>&1 || true+ SERVICE_USER_ACTUAL="$SERVICE_USER"+ if getent group "$SERVICE_GROUP" >/dev/null 2>&1; then+ SERVICE_GROUP_ACTUAL="$SERVICE_GROUP"+ else+ SERVICE_GROUP_ACTUAL="$(id -gn "$SERVICE_USER")"+ fi+ SERVICE_USER_CREATED="true"+}++ensure_service_home() {+ if [[ "$SERVICE_USER_ACTUAL" == "root" ]]; then+ return+ fi+ if [[ ! -d "$SERVICE_HOME" ]]; then+ mkdir -p "$SERVICE_HOME"+ fi+ chown "$SERVICE_USER_ACTUAL":"$SERVICE_GROUP_ACTUAL" "$SERVICE_HOME" >/dev/null 2>&1 || true+ chmod 750 "$SERVICE_HOME" >/dev/null 2>&1 || true+}++ensure_podman_group_membership() {+ SYSTEMD_SUPPLEMENTARY_GROUPS_LINE=""+ if [[ "$SERVICE_USER_ACTUAL" == "root" ]]; then+ return+ fi++ local group="podman"+ if ! getent group "$group" >/dev/null 2>&1; then+ log_info "Creating '$group' group for socket access"+ groupadd --system "$group" >/dev/null 2>&1 || {+ log_warn "Failed to create group '$group'; ensure $SERVICE_USER_ACTUAL can access $CONTAINER_SOCKET_PATH"+ return+ }+ # Change socket ownership to the new group if it exists+ if [[ -S "$CONTAINER_SOCKET_PATH" ]]; then+ chgrp "$group" "$CONTAINER_SOCKET_PATH" >/dev/null 2>&1 || log_warn "Failed to change socket group; adjust permissions manually"+ fi+ fi++ if ! id -nG "$SERVICE_USER_ACTUAL" | tr ' ' '\n' | grep -Fxq "$group"; then+ if command -v usermod >/dev/null 2>&1; then+ usermod -a -G "$group" "$SERVICE_USER_ACTUAL" >/dev/null 2>&1 || log_warn "Failed to add $SERVICE_USER_ACTUAL to $group; adjust socket permissions manually."+ else+ log_warn "Unable to modify group memberships; ensure $SERVICE_USER_ACTUAL can access $CONTAINER_SOCKET_PATH."+ fi+ fi++ if id -nG "$SERVICE_USER_ACTUAL" | tr ' ' '\n' | grep -Fxq "$group"; then+ SYSTEMD_SUPPLEMENTARY_GROUPS_LINE="SupplementaryGroups=$group"+ else+ log_warn "Service user $SERVICE_USER_ACTUAL is not in $group; socket access may fail."+ fi+}++write_rootful_env() {+ mkdir -p "$(dirname "$ROOTFUL_ENV_FILE")"+ local tmp+ tmp=$(mktemp "${ROOTFUL_ENV_FILE}.XXXXXX")+ chmod 600 "$tmp"++ {+ printf 'PULSE_URL=%q\n' "$PRIMARY_URL"+ printf 'PULSE_TOKEN=%q\n' "$PRIMARY_TOKEN"+ printf 'PULSE_TARGETS=%q\n' "$JOINED_TARGETS"+ printf 'PULSE_INTERVAL=%q\n' "$INTERVAL"+ printf 'PULSE_RUNTIME=podman\n'+ printf 'CONTAINER_HOST=%q\n' "$CONTAINER_SOCKET_URI"+ printf 'DOCKER_HOST=%q\n' "$CONTAINER_SOCKET_URI"+ if [[ "$PRIMARY_INSECURE" == "true" ]]; then+ printf 'PULSE_INSECURE_SKIP_VERIFY=true\n'+ fi+ } > "$tmp"++ mv "$tmp" "$ROOTFUL_ENV_FILE"+ chmod 600 "$ROOTFUL_ENV_FILE"+ log_success "Environment file written to $ROOTFUL_ENV_FILE"+}++install_rootful() {+ if [[ "$EUID" -ne 0 ]]; then+ if command -v sudo >/dev/null 2>&1; then+ exec sudo -- "$0" "${ORIGINAL_ARGS[@]}" --system+ fi+ log_error "Root privileges required for system installation."+ exit 1+ fi++ ensure_command podman+ ensure_podman_socket++ if [[ -n "$AGENT_PATH_OVERRIDE" ]]; then+ AGENT_PATH=$(trim "$AGENT_PATH_OVERRIDE")+ if [[ ! "$AGENT_PATH" =~ ^/ ]]; then+ log_error "--agent-path must be absolute."+ exit 1+ fi+ else+ AGENT_PATH="$DEFAULT_ROOTFUL_AGENT"+ fi++ mkdir -p "$(dirname "$AGENT_PATH")"++ download_agent++ ensure_service_user+ ensure_service_home+ ensure_podman_group_membership+ write_rootful_env++ mkdir -p "$(dirname "$ROOTFUL_LOG")"+ if [[ ! -f "$ROOTFUL_LOG" ]]; then+ touch "$ROOTFUL_LOG"+ fi+ chown "$SERVICE_USER_ACTUAL":"$SERVICE_GROUP_ACTUAL" "$ROOTFUL_LOG" >/dev/null 2>&1 || true++ cat > "$ROOTFUL_SERVICE" <<EOF+[Unit]+Description=Pulse Container Agent (Podman)+After=network-online.target podman.socket+Wants=network-online.target podman.socket++[Service]+Type=simple+EnvironmentFile=-$ROOTFUL_ENV_FILE+ExecStart=$AGENT_PATH --url "$PRIMARY_URL" --interval "$INTERVAL"+Restart=on-failure+RestartSec=5s+User=$SERVICE_USER_ACTUAL+Group=$SERVICE_GROUP_ACTUAL+$SYSTEMD_SUPPLEMENTARY_GROUPS_LINE+NoNewPrivileges=yes+ProtectSystem=full+ProtectHome=read-only+RestrictSUIDSGID=yes+RestrictRealtime=yes+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6+ReadWritePaths=$CONTAINER_SOCKET_PATH+ProtectClock=yes+ProtectKernelTunables=yes+ProtectKernelModules=yes+ProtectControlGroups=yes+LockPersonality=yes+MemoryDenyWriteExecute=yes++[Install]+WantedBy=multi-user.target+EOF++ log_success "Systemd unit written to $ROOTFUL_SERVICE"++ systemctl daemon-reload+ systemctl enable pulse-docker-agent+ systemctl restart pulse-docker-agent++ log_header "Installation complete"+ log_info "Runtime socket : $CONTAINER_SOCKET_PATH"+ log_info "Service user : $SERVICE_USER_ACTUAL"+ log_info "Agent binary : $AGENT_PATH"+ log_info "Service status : systemctl status pulse-docker-agent"+ log_info "Logs : journalctl -u pulse-docker-agent -f"+}++uninstall_rootful() {+ if [[ "$EUID" -ne 0 ]]; then+ if command -v sudo >/dev/null 2>&1; then+ exec sudo -- "$0" "${ORIGINAL_ARGS[@]}" --system --uninstall+ fi+ log_error "Root privileges required to uninstall system service."+ exit 1+ fi++ if command -v systemctl >/dev/null 2>&1; then+ systemctl stop pulse-docker-agent 2>/dev/null || true+ systemctl disable pulse-docker-agent 2>/dev/null || true+ fi++ rm -f "$ROOTFUL_SERVICE"+ rm -f "$ROOTFUL_ENV_FILE"+ if [[ -n "$AGENT_PATH_OVERRIDE" ]]; then+ AGENT_PATH="$AGENT_PATH_OVERRIDE"+ else+ AGENT_PATH="$DEFAULT_ROOTFUL_AGENT"+ fi+ rm -f "$AGENT_PATH"+ systemctl daemon-reload 2>/dev/null || true++ log_success "System installation removed"+}++# -----------------------------------------------------------------------------+# Rootless helpers+# -----------------------------------------------------------------------------++rootless_env_dir="$(dirname "$ROOTLESS_ENV_FILE")"+rootless_service_dir="$(dirname "$ROOTLESS_SERVICE")"+rootless_log_dir="$(dirname "$ROOTLESS_LOG")"++write_rootless_env() {+ mkdir -p "$rootless_env_dir"+ local tmp+ tmp=$(mktemp "${ROOTLESS_ENV_FILE}.XXXXXX")+ chmod 600 "$tmp"++ {+ printf 'PULSE_URL=%q\n' "$PRIMARY_URL"+ printf 'PULSE_TOKEN=%q\n' "$PRIMARY_TOKEN"+ printf 'PULSE_TARGETS=%q\n' "$JOINED_TARGETS"+ printf 'PULSE_INTERVAL=%q\n' "$INTERVAL"+ printf 'PULSE_RUNTIME=podman\n'+ printf 'CONTAINER_HOST=%q\n' "$CONTAINER_SOCKET_URI"+ printf 'DOCKER_HOST=%q\n' "$CONTAINER_SOCKET_URI"+ if [[ "$PRIMARY_INSECURE" == "true" ]]; then+ printf 'PULSE_INSECURE_SKIP_VERIFY=true\n'+ fi+ } > "$tmp"++ mv "$tmp" "$ROOTLESS_ENV_FILE"+ chmod 600 "$ROOTLESS_ENV_FILE"+ log_success "Environment file written to $ROOTLESS_ENV_FILE"+}++install_rootless() {+ ensure_command podman+ ensure_podman_socket++ if [[ -n "$AGENT_PATH_OVERRIDE" ]]; then+ AGENT_PATH=$(trim "$AGENT_PATH_OVERRIDE")+ if [[ ! "$AGENT_PATH" =~ ^/ ]]; then+ log_error "--agent-path must be absolute."+ exit 1+ fi+ else+ AGENT_PATH="$DEFAULT_ROOTLESS_AGENT"+ fi++ mkdir -p "$(dirname "$AGENT_PATH")"+ download_agent++ write_rootless_env++ mkdir -p "$rootless_log_dir"+ touch "$ROOTLESS_LOG"++ mkdir -p "$rootless_service_dir"+ cat > "$ROOTLESS_SERVICE" <<EOF+[Unit]+Description=Pulse Container Agent (Podman rootless)+After=podman.socket+Requires=podman.socket++[Service]+Type=simple+EnvironmentFile=-$ROOTLESS_ENV_FILE+ExecStart=$AGENT_PATH --url "$PRIMARY_URL" --interval "$INTERVAL"+Restart=on-failure+RestartSec=5s+ProtectSystem=full+ProtectHome=read-only+RestrictSUIDSGID=yes+RestrictRealtime=yes+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6+ReadWritePaths=$CONTAINER_SOCKET_PATH+Environment=STATE_DIR=$rootless_log_dir+Environment=LOG_FILE=$ROOTLESS_LOG++[Install]+WantedBy=default.target+EOF++ log_success "User service unit written to $ROOTLESS_SERVICE"++ if command -v systemctl >/dev/null 2>&1; then+ systemctl --user daemon-reload+ systemctl --user enable --now podman.socket >/dev/null 2>&1 || true+ systemctl --user enable --now pulse-docker-agent+ else+ log_warn "systemctl not available; start the agent manually:"+ log_info " env \$(grep -v '^#' $ROOTLESS_ENV_FILE | xargs) $AGENT_PATH --runtime podman --interval $INTERVAL"+ return+ fi++ if command -v loginctl >/dev/null 2>&1; then+ if ! loginctl show-user "$USER" | grep -q 'Linger=yes'; then+ log_info "Enable lingering to keep the service alive after logout:"+ log_info " sudo loginctl enable-linger $USER"+ fi+ fi++ log_header "Rootless installation complete"+ log_info "Agent binary : $AGENT_PATH"+ log_info "Runtime socket : $CONTAINER_SOCKET_PATH"+ log_info "Service status : systemctl --user status pulse-docker-agent"+ log_info "Logs : journalctl --user -u pulse-docker-agent -f"+}++uninstall_rootless() {+ if command -v systemctl >/dev/null 2>&1; then+ systemctl --user stop pulse-docker-agent 2>/dev/null || true+ systemctl --user disable pulse-docker-agent 2>/dev/null || true+ fi++ rm -f "$ROOTLESS_SERVICE"+ rm -f "$ROOTLESS_ENV_FILE"+ if [[ -n "$AGENT_PATH_OVERRIDE" ]]; then+ AGENT_PATH=$(trim "$AGENT_PATH_OVERRIDE")+ else+ AGENT_PATH="$DEFAULT_ROOTLESS_AGENT"+ fi+ rm -f "$AGENT_PATH"++ log_success "Rootless installation removed"+}++# -----------------------------------------------------------------------------+# Entry point+# -----------------------------------------------------------------------------++if [[ "$UNINSTALL" == "true" ]]; then+ if [[ "$ROOTLESS" == "true" ]]; then+ uninstall_rootless+ else+ uninstall_rootful+ fi+ if [[ "$PURGE" == "true" ]]; then+ rm -f "$ROOTFUL_LOG" "$ROOTLESS_LOG" 2>/dev/null || true+ fi+ exit 0+fi++log_header "Pulse Podman Agent Installer"+log_info "Primary Pulse URL : $PRIMARY_URL"+log_info "Runtime : Podman ($([[ "$ROOTLESS" == "true" ]] && printf 'rootless' || printf 'system'))"+log_info "Runtime socket : $CONTAINER_SOCKET_PATH"+log_info "Reporting interval : $INTERVAL"++if [[ "$ROOTLESS" == "true" ]]; then+ install_rootless+else+ install_rootful+fidiff --git a/scripts/install-docker-agent-v2.sh b/scripts/install-docker-agent-v2.shindex 1bddb2ace3..2390ace5ea 100755--- a/scripts/install-docker-agent-v2.sh+++ b/scripts/install-docker-agent-v2.sh@@ -125,6 +125,43 @@ split_targets_from_env() {done}+# Early runtime detection to hand off Podman installs to the container-aware script.+ORIGINAL_ARGS=("$@")+DETECTED_RUNTIME="${PULSE_RUNTIME:-}"+if [[ -z "$DETECTED_RUNTIME" ]]; then+ idx=0+ total_args=${#ORIGINAL_ARGS[@]}+ while [[ $idx -lt $total_args ]]; do+ arg="${ORIGINAL_ARGS[$idx]}"+ case "$arg" in+ --runtime)+ if (( idx + 1 < total_args )); then+ DETECTED_RUNTIME="${ORIGINAL_ARGS[$((idx + 1))]}"+ fi+ ((idx += 2))+ continue+ ;;+ --runtime=*)+ DETECTED_RUNTIME="${arg#--runtime=}"+ ;;+ esac+ ((idx += 1))+ done+ unset total_args+fi++if [[ -n "$DETECTED_RUNTIME" ]]; then+ runtime_lower=$(printf '%s' "$DETECTED_RUNTIME" | tr '[:upper:]' '[:lower:]')+ if [[ "$runtime_lower" == "podman" ]]; then+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"+ if [[ -f "${SCRIPT_DIR}/install-container-agent.sh" ]]; then+ exec "${SCRIPT_DIR}/install-container-agent.sh" "${ORIGINAL_ARGS[@]}"+ fi+ common::log_error "Podman runtime requested but install-container-agent.sh not found."+ exit 1+ fi+fi+extract_targets_from_service() {local file="$1"[[ ! -f "$file" ]] && return@@ -357,13 +394,19 @@ resolve_agent_path_for_uninstall() {# Pulse Docker Agent Installer/Uninstaller# Install (single target):-# curl -fsSL http://pulse.example.com/install-docker-agent.sh | bash -s -- --url http://pulse.example.com --token <api-token>+# curl -fSL http://pulse.example.com/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \+# sudo bash /tmp/pulse-install-docker-agent.sh --url http://pulse.example.com --token <api-token> && \+# rm -f /tmp/pulse-install-docker-agent.sh# Install (multi-target fan-out):-# curl -fsSL http://pulse.example.com/install-docker-agent.sh | bash -s -- \-# --target https://pulse.example.com|<api-token> \-# --target https://pulse-dr.example.com|<api-token>+# curl -fSL http://pulse.example.com/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \+# sudo bash /tmp/pulse-install-docker-agent.sh -- \+# --target https://pulse.example.com|<api-token> \+# --target https://pulse-dr.example.com|<api-token> && \+# rm -f /tmp/pulse-install-docker-agent.sh# Uninstall:-# curl -fsSL http://pulse.example.com/install-docker-agent.sh | bash -s -- --uninstall+# curl -fSL http://pulse.example.com/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \+# sudo bash /tmp/pulse-install-docker-agent.sh --uninstall && \+# rm -f /tmp/pulse-install-docker-agent.shPULSE_URL=""DEFAULT_AGENT_PATH="/usr/local/bin/pulse-docker-agent"diff --git a/scripts/install-docker-agent.sh b/scripts/install-docker-agent.shindex 92dfe688d6..e3684230c5 100755--- a/scripts/install-docker-agent.sh+++ b/scripts/install-docker-agent.sh@@ -530,15 +530,167 @@ remove_polkit_rule() {fi}+# Auto-detect container runtime if not explicitly specified+detect_container_runtime() {+ local has_podman=false+ local has_docker=false++ # Check if Podman is available and accessible+ if command -v podman &>/dev/null && podman info &>/dev/null 2>&1; then+ has_podman=true+ fi++ # Check if Docker is available and accessible+ if command -v docker &>/dev/null && docker info &>/dev/null 2>&1; then+ has_docker=true+ fi++ # If both are available, ask the user+ if [[ "$has_podman" == "true" && "$has_docker" == "true" ]]; then+ echo "" >&2+ echo "Both Docker and Podman are detected on this system." >&2+ echo "Which container runtime would you like to monitor?" >&2+ echo "" >&2+ echo " 1) Docker" >&2+ echo " 2) Podman" >&2+ echo "" >&2++ # Read user choice+ while true; do+ printf "Enter choice [1-2]: " >&2+ read -r choice+ case "$choice" in+ 1|docker|Docker)+ printf 'docker'+ return 0+ ;;+ 2|podman|Podman)+ printf 'podman'+ return 0+ ;;+ *)+ echo "Invalid choice. Please enter 1 or 2." >&2+ ;;+ esac+ done+ fi++ # Only one is available - use it automatically+ if [[ "$has_podman" == "true" ]]; then+ printf 'podman'+ return 0+ fi++ if [[ "$has_docker" == "true" ]]; then+ printf 'docker'+ return 0+ fi++ # Default to docker if nothing detected+ printf 'docker'+}++# Early runtime detection so we can chain to the container-aware installer.+ORIGINAL_ARGS=("$@")++# Check for explicit --runtime flag+DETECTED_RUNTIME="${PULSE_RUNTIME:-}"+if [[ -z "$DETECTED_RUNTIME" ]]; then+ idx=0+ total_args=${#ORIGINAL_ARGS[@]}+ while [[ $idx -lt $total_args ]]; do+ arg="${ORIGINAL_ARGS[$idx]}"+ case "$arg" in+ --runtime)+ if (( idx + 1 < total_args )); then+ DETECTED_RUNTIME="${ORIGINAL_ARGS[$((idx + 1))]}"+ fi+ ((idx += 2))+ continue+ ;;+ --runtime=*)+ DETECTED_RUNTIME="${arg#--runtime=}"+ ;;+ esac+ ((idx += 1))+ done+ unset total_args+fi++# If still not set, auto-detect+if [[ -z "$DETECTED_RUNTIME" ]]; then+ DETECTED_RUNTIME="$(detect_container_runtime)"+fi++if [[ -n "$DETECTED_RUNTIME" ]]; then+ runtime_lower=$(printf '%s' "$DETECTED_RUNTIME" | tr '[:upper:]' '[:lower:]')+ if [[ "$runtime_lower" == "podman" ]]; then+ # Try to find the script locally first (for development)+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"+ if [[ -f "${SCRIPT_DIR}/install-container-agent.sh" ]]; then+ exec "${SCRIPT_DIR}/install-container-agent.sh" "${ORIGINAL_ARGS[@]}"+ fi++ # Extract Pulse URL from arguments to download the container agent script+ PULSE_URL=""+ idx=0+ total_args=${#ORIGINAL_ARGS[@]}+ while [[ $idx -lt $total_args ]]; do+ arg="${ORIGINAL_ARGS[$idx]}"+ case "$arg" in+ --url)+ if (( idx + 1 < total_args )); then+ PULSE_URL="${ORIGINAL_ARGS[$((idx + 1))]}"+ break+ fi+ ;;+ --url=*)+ PULSE_URL="${arg#--url=}"+ break+ ;;+ esac+ ((idx += 1))+ done++ if [[ -n "$PULSE_URL" ]]; then+ log_info "Detected Podman runtime, downloading container agent installer..."+ CONTAINER_SCRIPT="/tmp/pulse-install-container-agent-$$.sh"+ if command -v curl &>/dev/null; then+ if curl -fsSL "${PULSE_URL%/}/install-container-agent.sh" -o "$CONTAINER_SCRIPT" 2>/dev/null; then+ chmod +x "$CONTAINER_SCRIPT"+ exec bash "$CONTAINER_SCRIPT" "${ORIGINAL_ARGS[@]}"+ fi+ elif command -v wget &>/dev/null; then+ if wget -q -O "$CONTAINER_SCRIPT" "${PULSE_URL%/}/install-container-agent.sh" 2>/dev/null; then+ chmod +x "$CONTAINER_SCRIPT"+ exec bash "$CONTAINER_SCRIPT" "${ORIGINAL_ARGS[@]}"+ fi+ fi+ echo "[ERROR] Failed to download install-container-agent.sh from $PULSE_URL" >&2+ exit 1+ fi++ echo "[ERROR] Podman detected but no --url provided to download container agent installer." >&2+ echo "[INFO] Please provide --url parameter or use --runtime docker to force Docker mode." >&2+ exit 1+ fi+fi+# Pulse Docker Agent Installer/Uninstaller# Install (single target):-# curl -fsSL http://pulse.example.com/install-docker-agent.sh | bash -s -- --url http://pulse.example.com --token <api-token>+# curl -fSL http://pulse.example.com/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \+# sudo bash /tmp/pulse-install-docker-agent.sh --url http://pulse.example.com --token <api-token> && \+# rm -f /tmp/pulse-install-docker-agent.sh# Install (multi-target fan-out):-# curl -fsSL http://pulse.example.com/install-docker-agent.sh | bash -s -- \-# --target https://pulse.example.com|<api-token> \-# --target https://pulse-dr.example.com|<api-token>+# curl -fSL http://pulse.example.com/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \+# sudo bash /tmp/pulse-install-docker-agent.sh -- \+# --target https://pulse.example.com|<api-token> \+# --target https://pulse-dr.example.com|<api-token> && \+# rm -f /tmp/pulse-install-docker-agent.sh# Uninstall:-# curl -fsSL http://pulse.example.com/install-docker-agent.sh | bash -s -- --uninstall [--purge]+# curl -fSL http://pulse.example.com/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \+# sudo bash /tmp/pulse-install-docker-agent.sh --uninstall [--purge] && \+# rm -f /tmp/pulse-install-docker-agent.shPULSE_URL=""DEFAULT_AGENT_PATH="/usr/local/bin/pulse-docker-agent"@@ -701,17 +853,22 @@ PIPELINE_COMMAND_SUDO_C=""PIPELINE_COMMAND_INNER=""if [[ -n "$INSTALLER_URL_HINT" ]]; thenINSTALLER_URL_QUOTED=$(quote_shell_arg "$INSTALLER_URL_HINT")- PIPELINE_COMMAND="curl -fsSL ${INSTALLER_URL_QUOTED} | sudo bash -s"+ INSTALLER_URL_ESCAPED=$(printf '%q' "$INSTALLER_URL_HINT")+ TMP_INSTALLER_PATH="/tmp/pulse-install-docker-agent.sh"+ TMP_INSTALLER_QUOTED=$(quote_shell_arg "$TMP_INSTALLER_PATH")+ PIPELINE_PREFIX="curl -fSL ${INSTALLER_URL_QUOTED} -o ${TMP_INSTALLER_QUOTED} && sudo bash ${TMP_INSTALLER_QUOTED}"+ PIPELINE_INNER_PREFIX="curl -fSL ${INSTALLER_URL_ESCAPED} -o ${TMP_INSTALLER_QUOTED} && bash ${TMP_INSTALLER_QUOTED}"+ PIPELINE_SUFFIX=" && rm -f ${TMP_INSTALLER_QUOTED}"+ PIPELINE_COMMAND="${PIPELINE_PREFIX}"+ PIPELINE_COMMAND_INNER="${PIPELINE_INNER_PREFIX}"if [[ ${#ORIGINAL_ARGS[@]} -gt 0 ]]; thenPIPELINE_COMMAND+=" -- ${ORIGINAL_ARGS_STRING}"- fi- INSTALLER_URL_ESCAPED=$(printf '%q' "$INSTALLER_URL_HINT")- PIPELINE_COMMAND_INNER="curl -fsSL ${INSTALLER_URL_ESCAPED} | bash -s"- if [[ -n "$ORIGINAL_ARGS_ESCAPED" ]]; thenPIPELINE_COMMAND_INNER+=" -- ${ORIGINAL_ARGS_ESCAPED}"fi+ PIPELINE_COMMAND+="${PIPELINE_SUFFIX}"+ PIPELINE_COMMAND_INNER+="${PIPELINE_SUFFIX}"PIPELINE_COMMAND_SUDO_C="sudo bash -c $(quote_shell_arg "$PIPELINE_COMMAND_INNER")"- unset INSTALLER_URL_ESCAPED INSTALLER_URL_QUOTED+ unset INSTALLER_URL_ESCAPED INSTALLER_URL_QUOTED TMP_INSTALLER_PATH TMP_INSTALLER_QUOTED PIPELINE_PREFIX PIPELINE_INNER_PREFIX PIPELINE_SUFFIXfiSCRIPT_SOURCE_HINT=""@@ -796,16 +953,16 @@ if [[ $EUID -ne 0 ]]; thenecho ""fiif [[ -z "$PIPELINE_COMMAND" && -z "$LOCAL_COMMAND" ]]; then- echo "Please re-run the installer with elevated privileges, for example:"- if [[ ${#ORIGINAL_ARGS[@]} -gt 0 ]]; then- echo " curl -fsSL <URL>/install-docker-agent.sh | sudo bash -s -- ${ORIGINAL_ARGS_STRING}"- FALLBACK_PIPELINE_INNER="curl -fsSL <URL>/install-docker-agent.sh | bash -s -- ${ORIGINAL_ARGS_ESCAPED}"- echo " sudo bash -c $(quote_shell_arg "$FALLBACK_PIPELINE_INNER")"- unset FALLBACK_PIPELINE_INNER- else- echo " curl -fsSL <URL>/install-docker-agent.sh | sudo bash -s"- echo " sudo bash -c 'curl -fsSL <URL>/install-docker-agent.sh | bash -s'"- fi+ echo "Please re-run the installer with elevated privileges, for example:"+ if [[ ${#ORIGINAL_ARGS[@]} -gt 0 ]]; then+ echo " curl -fSL <URL>/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \\"+ echo " sudo bash /tmp/pulse-install-docker-agent.sh -- ${ORIGINAL_ARGS_STRING} && \\"+ echo " rm -f /tmp/pulse-install-docker-agent.sh"+ else+ echo " curl -fSL <URL>/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \\"+ echo " sudo bash /tmp/pulse-install-docker-agent.sh && \\"+ echo " rm -f /tmp/pulse-install-docker-agent.sh"+ fifiexit "${AUTO_SUDO_EXIT_CODE:-1}"fi@@ -832,16 +989,16 @@ if [[ $EUID -ne 0 ]]; thenecho ""fiif [[ -z "$PIPELINE_COMMAND" && -z "$LOCAL_COMMAND" ]]; then- echo "Please re-run the installer with elevated privileges, for example:"- if [[ ${#ORIGINAL_ARGS[@]} -gt 0 ]]; then- echo " curl -fsSL <URL>/install-docker-agent.sh | sudo bash -s -- ${ORIGINAL_ARGS_STRING}"- FALLBACK_PIPELINE_INNER="curl -fsSL <URL>/install-docker-agent.sh | bash -s -- ${ORIGINAL_ARGS_ESCAPED}"- echo " sudo bash -c $(quote_shell_arg "$FALLBACK_PIPELINE_INNER")"- unset FALLBACK_PIPELINE_INNER- else- echo " curl -fsSL <URL>/install-docker-agent.sh | sudo bash -s"- echo " sudo bash -c 'curl -fsSL <URL>/install-docker-agent.sh | bash -s'"- fi+ echo "Please re-run the installer with elevated privileges, for example:"+ if [[ ${#ORIGINAL_ARGS[@]} -gt 0 ]]; then+ echo " curl -fSL <URL>/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \\"+ echo " sudo bash /tmp/pulse-install-docker-agent.sh -- ${ORIGINAL_ARGS_STRING} && \\"+ echo " rm -f /tmp/pulse-install-docker-agent.sh"+ else+ echo " curl -fSL <URL>/install-docker-agent.sh -o /tmp/pulse-install-docker-agent.sh && \\"+ echo " sudo bash /tmp/pulse-install-docker-agent.sh && \\"+ echo " rm -f /tmp/pulse-install-docker-agent.sh"+ fifiexit 1fidiff --git a/scripts/install-docker.sh b/scripts/install-docker.shold mode 100644new mode 100755diff --git a/scripts/pulse-auto-update.sh b/scripts/pulse-auto-update.shold mode 100644new mode 100755diff --git a/scripts/pulse-sensor-cleanup.sh b/scripts/pulse-sensor-cleanup.shold mode 100644new mode 100755diff --git a/scripts/take-all-screenshots.js b/scripts/take-all-screenshots.jsdeleted file mode 100644index 5c3cffc839..0000000000--- a/scripts/take-all-screenshots.js+++ /dev/null@@ -1,238 +0,0 @@-const { chromium, devices } = require('@playwright/test');-const fs = require('fs').promises;-const path = require('path');--const PULSE_URL = process.env.PULSE_URL || 'http://localhost:7655';-const OUTPUT_DIR = path.join(__dirname, '..', 'docs', 'images');--async function ensureOutputDir() {- try {- await fs.mkdir(OUTPUT_DIR, { recursive: true });- } catch (error) {- console.error('Error creating output directory:', error);- }-}--async function wait(ms) {- return new Promise(resolve => setTimeout(resolve, ms));-}--async function takeScreenshot(page, name, options = {}) {- const { selector = null, fullPage = false } = options;-- await wait(1500); // Wait for animations-- let screenshotOptions = {- type: 'png',- path: path.join(OUTPUT_DIR, `${name}.png`)- };-- if (selector) {- const element = await page.locator(selector).first();- await element.waitFor({ state: 'visible', timeout: 10000 });- screenshotOptions = {- ...screenshotOptions,- clip: await element.boundingBox()- };- } else if (fullPage) {- screenshotOptions.fullPage = true;- }-- await page.screenshot(screenshotOptions);- console.log(`✅ Saved ${name}.png`);-}--async function clickAndWait(page, selector, waitTime = 1000) {- try {- const element = page.locator(selector).first();- if (await element.count() > 0) {- await element.click();- await wait(waitTime);- return true;- }- } catch (e) {- console.log(`Could not click ${selector}: ${e.message}`);- }- return false;-}--async function ensureDarkTheme(page) {- try {- // Wait a bit for theme system to initialize- await wait(1000);-- // First check if we're already in dark mode- const isDarkMode = await page.evaluate(() => {- return document.documentElement.classList.contains('dark');- });-- console.log(`Current theme mode: ${isDarkMode ? 'dark' : 'light'}`);-- if (!isDarkMode) {- // Try to find and click the theme toggle- // Look for common theme toggle selectors- const themeSelectors = [- 'button[aria-label="Toggle theme"]',- 'button[title*="theme" i]',- 'button[aria-label*="theme" i]',- 'button:has(svg[class*="moon"])',- 'button:has(svg[class*="sun"])',- '.theme-toggle',- 'button:has-text("Theme")',- '[data-theme-toggle]'- ];-- for (const selector of themeSelectors) {- try {- const element = page.locator(selector).first();- if (await element.count() > 0) {- await element.click();- await wait(1000); // Wait for theme transition-- // Verify dark mode is now active- const nowDark = await page.evaluate(() => {- return document.documentElement.classList.contains('dark');- });-- if (nowDark) {- console.log('✅ Successfully switched to dark theme');- return;- }- }- } catch (e) {- // Continue trying other selectors- }- }-- // If no toggle found, try to force dark mode via localStorage or class- await page.evaluate(() => {- document.documentElement.classList.remove('light');- document.documentElement.classList.add('dark');- localStorage.setItem('theme', 'dark');- localStorage.setItem('pulse-theme', 'dark');- });- console.log('⚠️ Forced dark mode via DOM manipulation');- } else {- console.log('✅ Already in dark mode');- }- } catch (e) {- console.log('Could not set dark theme:', e.message);- }-}--async function main() {- await ensureOutputDir();-- const browser = await chromium.launch({- headless: true- });-- // Desktop screenshots- const desktopContext = await browser.newContext({- viewport: { width: 1440, height: 900 }- });-- const page = await desktopContext.newPage();-- try {- console.log(`📸 Starting screenshot capture for ${PULSE_URL}`);-- // Navigate to Pulse- await page.goto(PULSE_URL, { waitUntil: 'networkidle' });- await wait(3000);-- // Ensure dark theme- await ensureDarkTheme(page);-- // 1. Dashboard Screenshot- console.log('📸 Capturing dashboard...');- await takeScreenshot(page, '01-dashboard');-- // 2. Storage View- console.log('📸 Capturing storage view...');- const storageClicked = await clickAndWait(page, 'button:has-text("Storage"), a:has-text("Storage"), [role="tab"]:has-text("Storage")', 2000);- if (storageClicked) {- await takeScreenshot(page, '02-storage');- }-- // 3. Backups View- console.log('📸 Capturing backups view...');- const backupsClicked = await clickAndWait(page, 'button:has-text("Backups"), a:has-text("Backups"), [role="tab"]:has-text("Backups")', 2000);- if (backupsClicked) {- await takeScreenshot(page, '03-backups');- }-- // 4. Alerts View- console.log('📸 Capturing alerts view...');- const alertsClicked = await clickAndWait(page, 'button:has-text("Alerts"), a:has-text("Alerts"), [role="tab"]:has-text("Alerts")', 2000);- if (alertsClicked) {- await takeScreenshot(page, '04-alerts');-- // 5. Try to capture Alert History if available- console.log('📸 Looking for alert history...');- const historyClicked = await clickAndWait(page, 'button:has-text("History"), button:has-text("Alert History"), [role="tab"]:has-text("History")', 2000);- if (historyClicked) {- await takeScreenshot(page, '05-alert-history');- } else {- // If no history tab, just use alerts view- await fs.copyFile(- path.join(OUTPUT_DIR, '04-alerts.png'),- path.join(OUTPUT_DIR, '05-alert-history.png')- );- console.log('✅ Used alerts view for alert history');- }- }-- // 6. Settings View- console.log('📸 Capturing settings view...');- const settingsClicked = await clickAndWait(page, 'button:has-text("Settings"), a:has-text("Settings"), [aria-label="Settings"], .settings-icon', 2000);- if (settingsClicked) {- await takeScreenshot(page, '06-settings');- } else {- // Try clicking a gear icon- await clickAndWait(page, 'svg[class*="settings"], svg[class*="gear"], button:has(svg[class*="settings"])', 2000);- await takeScreenshot(page, '06-settings');- }-- // 7. Dark Mode Screenshot (go back to dashboard for a clean dark mode shot)- console.log('📸 Capturing dark mode view...');- await clickAndWait(page, 'button:has-text("Dashboard"), a:has-text("Dashboard"), [role="tab"]:has-text("Dashboard")', 2000);- await wait(1000);- await takeScreenshot(page, '07-dark-mode');-- // Close desktop context- await desktopContext.close();-- // 8. Mobile Screenshot- console.log('📸 Capturing mobile view...');- const mobileContext = await browser.newContext({- ...devices['iPhone 12'],- viewport: { width: 390, height: 844 }- });-- const mobilePage = await mobileContext.newPage();- await mobilePage.goto(PULSE_URL, { waitUntil: 'networkidle' });- await wait(2000);-- // Ensure dark theme on mobile- await ensureDarkTheme(mobilePage);-- await takeScreenshot(mobilePage, '08-mobile');-- await mobileContext.close();-- console.log('✨ Screenshot capture complete!');- console.log(`📁 Screenshots saved to: ${OUTPUT_DIR}`);-- } catch (error) {- console.error('❌ Error during screenshot capture:', error);-- // Take error screenshot- await takeScreenshot(page, 'error-state');- } finally {- await browser.close();- }-}--// Run the script-main().catch(console.error);\ No newline at end of filediff --git a/scripts/take-screenshots.js b/scripts/take-screenshots.jsdeleted file mode 100644index 88240eb6cb..0000000000--- a/scripts/take-screenshots.js+++ /dev/null@@ -1,231 +0,0 @@-const puppeteer = require('puppeteer');-const fs = require('fs').promises;-const path = require('path');--const PULSE_URL = process.env.PULSE_URL || 'http://localhost:7655';-const OUTPUT_DIR = path.join(__dirname, '..', 'docs', 'images');--async function cleanExistingScreenshots() {- try {- const files = await fs.readdir(OUTPUT_DIR);- const screenshotFiles = files.filter(f =>- f.endsWith('.png') &&- (f.match(/^\d{2}-/) || f.includes('error-state'))- );-- console.log(`Removing ${screenshotFiles.length} existing screenshots...`);-- for (const file of screenshotFiles) {- await fs.unlink(path.join(OUTPUT_DIR, file));- }- } catch (error) {- console.error('Error cleaning screenshots:', error);- }-}--async function wait(ms) {- return new Promise(resolve => setTimeout(resolve, ms));-}--async function main() {- await cleanExistingScreenshots();-- console.log('Starting simple Puppeteer screenshot capture...\n');-- // Launch browser with M1 MacBook Air display settings- const browser = await puppeteer.launch({- headless: 'new', // Use new headless mode- defaultViewport: null, // Don't override viewport- args: [- '--window-size=1440,900', // M1 MacBook Air effective resolution (2560x1600 native / 2)- '--force-device-scale-factor=2', // Retina display (2x)- '--disable-dev-shm-usage', // Better memory handling- '--enable-font-antialiasing', // Smooth fonts- '--font-render-hinting=none' // Disable hinting for sharper text- ]- });-- const page = await browser.newPage();-- // CRITICAL: Set viewport BEFORE navigating for sharp rendering!- // This must happen before page.goto() or text will be blurry- // M1 MacBook Air 13" display dimensions (native 2560x1600, effective 1440x900 at 2x)- await page.setViewport({- width: 1440,- height: 900,- deviceScaleFactor: 2 // Retina display- });-- try {- console.log(`Navigating to ${PULSE_URL}...`);- await page.goto(PULSE_URL, {- waitUntil: 'networkidle0',- timeout: 30000- });-- // Wait for fonts to fully load for crisp text- await page.evaluateHandle('document.fonts.ready');-- // Wait for content to load- await wait(5000);-- // Set dark theme- await page.evaluate(() => {- localStorage.setItem('pulse-theme', 'dark');- document.documentElement.classList.remove('light');- document.documentElement.classList.add('dark');- });-- // Force crisp font rendering- await page.addStyleTag({- content: `- * {- -webkit-font-smoothing: antialiased !important;- -moz-osx-font-smoothing: grayscale !important;- text-rendering: optimizeLegibility !important;- }- `- });-- await wait(2000);-- // Take screenshots of each view- const views = [- { name: 'Dashboard', file: '01-dashboard' },- { name: 'Storage', file: '02-storage' },- { name: 'Backups', file: '03-backups' },- { name: 'Alerts', file: '04-alerts' },- { name: 'Settings', file: '06-settings' }- ];-- for (const view of views) {- console.log(`Capturing ${view.name}...`);-- if (view.name !== 'Dashboard') {- // Try to click on the tab- try {- await page.evaluate((viewName) => {- const buttons = Array.from(document.querySelectorAll('button, [role="tab"], a'));- const button = buttons.find(b => b.textContent.includes(viewName));- if (button) button.click();- }, view.name);-- await wait(3000);- } catch (e) {- console.log(`Could not navigate to ${view.name}`);- }- }-- // Take screenshot - MacBook Air resolution should fit content perfectly- await page.screenshot({- path: path.join(OUTPUT_DIR, `${view.file}.png`),- type: 'png'- });-- console.log(`Saved ${view.file}.png`);- }-- // Note: Active alerts are shown on the main Alerts tab (04-alerts.png)- // The tab has Config and History sub-tabs, no separate Active tab-- // Take alert history screenshot - need to click on History sub-tab- console.log('Capturing alert history...');-- // First make sure we're on the Alerts tab- await page.evaluate(() => {- const alertsTab = Array.from(document.querySelectorAll('button, [role="tab"], a'))- .find(b => b.textContent.includes('Alerts'));- if (alertsTab) alertsTab.click();- });- await wait(2000);-- // Now click on the History sub-tab- await page.evaluate(() => {- const historyTab = Array.from(document.querySelectorAll('button, [role="tab"], a'))- .find(b => b.textContent.trim() === 'History' || b.textContent.includes('History'));- if (historyTab) historyTab.click();- });-- // Wait for alert history to load with retry logic- console.log('Waiting for alert history to load...');- let retries = 0;- const maxRetries = 15; // 15 seconds max-- while (retries < maxRetries) {- await wait(1000);-- // Check if data has loaded by looking for alert rows in the DOM- const hasData = await page.evaluate(() => {- // Look for alert history rows or the "No alerts" message- const rows = document.querySelectorAll('tbody tr, [data-testid="alert-row"], .alert-history-row');- const noDataMsg = Array.from(document.querySelectorAll('*')).find(- el => el.textContent && el.textContent.includes('No alerts in selected time range')- );- return rows.length > 0 || noDataMsg;- });-- if (hasData) {- console.log('Alert history loaded after', retries + 1, 'seconds');- break;- }-- retries++;- }-- // Extra wait for any animations- await wait(1000);-- // Take the screenshot - MacBook Air resolution- await page.screenshot({- path: path.join(OUTPUT_DIR, '05-alert-history.png'),- type: 'png'- });- console.log('Saved 05-alert-history.png');-- // Note: Dashboard is already in dark mode, no need for duplicate or light mode-- // Mobile view- console.log('\nCapturing mobile view...');-- // Set mobile viewport BEFORE reload for sharp rendering- // iPhone 12/13/14 dimensions for modern mobile testing- await page.setViewport({- width: 390, // iPhone 12/13/14 width- height: 844, // iPhone 12/13/14 height- isMobile: true,- deviceScaleFactor: 3 // 3x for Super Retina XDR- });-- // Now reload with the new viewport already set- await page.reload({ waitUntil: 'networkidle0' });-- // Wait for fonts to load again after reload- await page.evaluateHandle('document.fonts.ready');- await wait(3000);-- // Set dark theme again- await page.evaluate(() => {- localStorage.setItem('pulse-theme', 'dark');- document.documentElement.classList.remove('light');- document.documentElement.classList.add('dark');- });-- await wait(2000);-- await page.screenshot({- path: path.join(OUTPUT_DIR, '08-mobile.png'),- type: 'png'- });-- console.log('Saved 08-mobile.png');-- console.log('\nScreenshot capture complete!');-- } catch (error) {- console.error('Error during screenshot capture:', error);- } finally {- await browser.close();- }-}--main().catch(console.error);