mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-21 10:43:36 +00:00
a2b8940873
Implements REST API endpoints to enable automatic registration of temperature proxies during sensor-proxy installation. API endpoints: - POST /api/temperature-proxy/register - Accepts: hostname, proxy_url - Returns: authentication token - Finds matching PVE instance and configures proxy URL/token - No authentication required (called during installation) - DELETE /api/temperature-proxy/unregister?hostname=X - Removes proxy configuration from PVE instance - Requires admin authentication Implementation: - Uses config.ConfigPersistence for loading/saving nodes.enc - Matches PVE instances by hostname in Host field or ClusterEndpoints - Generates cryptographically secure random tokens (32 bytes, base64) - Atomic config updates (load → modify → save) Next step: Update install-sensor-proxy.sh to call registration API Related to #571
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:
- Cannot use
../paths to access parent directories - Cannot follow symbolic links
- Must embed files within the Go module
This is a known Go limitation and our structure works around it.