This commit includes comprehensive codebase cleanup and refactoring: ## Code Cleanup - Remove dead TypeScript code (types/monitoring.ts - 194 lines duplicate) - Remove unused Go functions (GetClusterNodes, MigratePassword, GetClusterHealthInfo) - Clean up commented-out code blocks across multiple files - Remove unused TypeScript exports (helpTextClass, private tag color helpers) - Delete obsolete test files and components ## localStorage Consolidation - Centralize all storage keys into STORAGE_KEYS constant - Update 5 files to use centralized keys: * utils/apiClient.ts (AUTH, LEGACY_TOKEN) * components/Dashboard/Dashboard.tsx (GUEST_METADATA) * components/Docker/DockerHosts.tsx (DOCKER_METADATA) * App.tsx (PLATFORMS_SEEN) * stores/updates.ts (UPDATES) - Benefits: Single source of truth, prevents typos, better maintainability ## Previous Work Committed - Docker monitoring improvements and disk metrics - Security enhancements and setup fixes - API refactoring and cleanup - Documentation updates - Build system improvements ## Testing - All frontend tests pass (29 tests) - All Go tests pass (15 packages) - Production build successful - Zero breaking changes Total: 186 files changed, 5825 insertions(+), 11602 deletions(-)
3.8 KiB
Port Configuration Guide
Pulse supports multiple ways to configure the frontend port (default: 7655).
Development tip: The hot-reload workflow (
scripts/hot-dev.shormake dev-hot) loads.env,.env.local, and.env.dev. SetFRONTEND_PORTorPULSE_DEV_API_PORTthere to run the backend on a different port while keeping the generatedcurlcommands and Vite proxy in sync.
Recommended Methods
1. During Installation (Easiest)
The installer prompts for the port. To skip the prompt, use:
FRONTEND_PORT=8080 curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash
2. Using systemd override (For existing installations)
sudo systemctl edit pulse
Add these lines:
[Service]
Environment="FRONTEND_PORT=8080"
Then restart: sudo systemctl restart pulse
3. Using system.json (Alternative method)
Edit /etc/pulse/system.json:
{
"frontendPort": 8080
}
Then restart: sudo systemctl restart pulse
4. Using environment variables (Docker)
For Docker deployments:
docker run -e FRONTEND_PORT=8080 -p 8080:8080 rcourtman/pulse:latest
Priority Order
Pulse checks for port configuration in this order:
FRONTEND_PORTenvironment variablePORTenvironment variable (legacy)frontendPortin system.json- Default: 7655
Environment variables always override configuration files.
Why not .env?
The /etc/pulse/.env file is reserved exclusively for authentication credentials:
API_TOKENS- One or more API authentication tokens (hashed)API_TOKEN- Legacy single API token (hashed)PULSE_AUTH_USER- Web UI usernamePULSE_AUTH_PASS- Web UI password (hashed)
Keeping application configuration separate from authentication credentials:
- Makes it clear what's a secret vs what's configuration
- Allows different permission models if needed
- Follows the principle of separation of concerns
- Makes it easier to backup/share configs without exposing credentials
Service Name Variations
Important: Pulse uses different service names depending on the deployment environment:
- Systemd (default):
pulse.serviceorpulse-backend.service(legacy) - Hot-dev scripts:
pulse-hot-dev(development only) - Kubernetes/Helm: Deployment
pulse, Servicepulse(port configured via Helm values)
To check the active service:
# Systemd
systemctl list-units | grep pulse
systemctl status pulse
# Kubernetes
kubectl -n pulse get svc pulse
kubectl -n pulse get deploy pulse
Change Tracking (v4.24.0+)
Port changes via environment variables or system.json take effect immediately after restart. v4.24.0 records configuration changes in update history—useful for audit trails and troubleshooting.
To view change history:
# Via UI
# Navigate to Settings → System → Updates
# Via API
curl -s http://localhost:7655/api/updates/history | jq '.entries[] | {timestamp, action, status}'
Troubleshooting
Port not changing after configuration?
-
Check which service name is in use:
systemctl list-units | grep pulseIt might be
pulse(default),pulse-backend(legacy), orpulse-hot-dev(dev environment) depending on your installation method. -
Verify the configuration is loaded:
# Systemd sudo systemctl show pulse | grep Environment # Kubernetes kubectl -n pulse get deploy pulse -o jsonpath='{.spec.template.spec.containers[0].env}' | jq -
Check if another process is using the port:
sudo lsof -i :8080 -
Verify post-restart (v4.24.0+):
# Check actual listening port curl -s http://localhost:7655/api/version | jq # Check update history for restart event curl -s http://localhost:7655/api/updates/history?limit=5 | jq