Pulse/internal/api
rcourtman b4247fc095 feat: add server-side support for agent installation improvements
API Enhancements:
- Add SHA256 checksum endpoint for binary downloads
  - Computes checksum on-the-fly when .sha256 suffix is requested
  - Example: /download/pulse-host-agent?platform=linux&arch=amd64.sha256
  - Enables installer scripts to verify binary integrity
- Add /uninstall-host-agent.sh endpoint for Linux/macOS uninstall script
- Add endpoint to public paths (no auth required)

Checksum Implementation:
- New serveChecksum() function computes SHA256 hash using crypto/sha256
- Returns plain text checksum in hex format
- Supports all binary download endpoints
- Zero performance impact (only computed when requested)

Install Script Updates:
- Add --force/-f flag to skip all interactive prompts
  - URL/token prompts skipped with --force
  - Reinstall confirmation skipped with --force
  - Checksum mismatch still aborts (security first)
- Force mode auto-accepts updates and reinstalls
- Usage: ./install-host-agent.sh --url $URL --token $TOKEN --force

Security Notes:
- Checksum verification protects against:
  - Corrupted downloads due to network issues
  - Man-in-the-middle binary tampering
  - Storage corruption on server
- Force mode maintains security by aborting on checksum mismatch
- No bypass for security-critical validations

These improvements enable:
- Automated deployments (--force flag)
- Binary integrity verification (checksums)
- Better security posture (tamper detection)
- Standardized uninstall process (endpoint)

The /api/version endpoint already exists and returns version info
for update checks (no changes needed).
2025-10-23 22:27:02 +00:00
..
alerts.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
alerts_test.go Allow printable alert IDs for acknowledgements (#550) 2025-10-14 16:48:22 +00:00
auth.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
auth_scope_test.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
config_handlers.go Respect custom ports when discovering Proxmox clusters 2025-10-22 17:42:52 +00:00
config_handlers_cluster_test.go Respect custom ports when discovering Proxmox clusters 2025-10-22 17:42:52 +00:00
csrf_store.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
demo_middleware.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
diagnostics.go Stabilize diagnostics test VM selection 2025-10-22 19:48:56 +00:00
DO_NOT_EDIT_FRONTEND_HERE.md Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
docker_agents.go feat: add docker agent command handling 2025-10-15 19:27:19 +00:00
frontend_embed.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
guest_metadata.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
host_agents.go feat: add native Windows service support and expandable host details 2025-10-23 22:11:56 +00:00
http_metrics.go feat: comprehensive diagnostics and observability improvements 2025-10-21 12:37:39 +00:00
middleware.go feat: comprehensive diagnostics and observability improvements 2025-10-21 12:37:39 +00:00
notifications.go Add snapshot size alert thresholds (#585) 2025-10-22 13:30:40 +00:00
oidc_handlers.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
oidc_service.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
rate_limit_config.go Fix X-RateLimit-Limit header value 2025-10-19 11:43:03 +02:00
rate_limit_config_test.go test: add X-RateLimit-Limit header regression test 2025-10-20 15:10:59 +00:00
ratelimit.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
README.md Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
recovery_tokens.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
router.go feat: add server-side support for agent installation improvements 2025-10-23 22:27:02 +00:00
router_integration_test.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
security.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
security_oidc.go feat: add professional logging with runtime configuration and performance optimization 2025-10-20 15:13:38 +00:00
security_setup_fix.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
security_tokens.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
security_tokens_test.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
session_store.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
settings.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
system_settings.go Propagate config updates to settings nodes (#588) 2025-10-22 13:45:13 +00:00
types.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
updates.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00

Internal API Package

This directory contains the API server implementation for Pulse.

Important Note About frontend-modern/

The frontend-modern/ subdirectory that appears here is:

  • AUTO-GENERATED during builds
  • NOT the source code - just a build artifact
  • IN .gitignore - never committed
  • REQUIRED BY GO - The embed directive needs it here

Frontend Development Location

👉 Edit frontend files at: /opt/pulse/frontend-modern/src/

Why This Structure?

Go's //go:embed directive has limitations:

  1. Cannot use ../ paths to access parent directories
  2. Cannot follow symbolic links
  3. Must embed files within the Go module

This is a known Go limitation and our structure works around it.