Applied Codex's security and reliability recommendations: **SSH Key Safety:** - Added "pulse-managed-key" comment marker to all SSH keys - Removal now targets only marked keys (prevents deleting operator keys) - Uses atomic file replacement via mktemp for authorized_keys edits **Idempotency Improvements:** - LXC config glob now uses nullglob to handle empty directories - pveum token removal handles missing users gracefully (|| printf '') - All systemctl operations wrapped with || true for non-systemd hosts - sed operations in loops protected with || true **Container Detection:** - Validates container is running before IP check (pct status) - Confirms container exists with pct config before proceeding - Uses printf '' instead of || true for command substitution - Handles IPv6 and multi-IP scenarios more reliably **Network Operations:** - curl now uses --fail --show-error --silent --location - Error messages visible to users instead of silenced - Better diagnostics when download fails **Migration Safety:** - Verifies pulse-sensor-proxy service is active before key removal - Fallback check for binary existence if systemd unavailable - Preserves legacy SSH keys if proxy not confirmed healthy - Clear messaging about deferred cleanup All cleanup operations are now fully idempotent and safe for repeated execution, even on partially-configured hosts. Addresses #123 |
||
|---|---|---|
| .. | ||
| alerts.go | ||
| auth.go | ||
| config_handlers.go | ||
| csrf_store.go | ||
| demo_middleware.go | ||
| diagnostics.go | ||
| DO_NOT_EDIT_FRONTEND_HERE.md | ||
| docker_agents.go | ||
| frontend_embed.go | ||
| guest_metadata.go | ||
| middleware.go | ||
| notifications.go | ||
| oidc_handlers.go | ||
| oidc_service.go | ||
| rate_limit_config.go | ||
| ratelimit.go | ||
| README.md | ||
| recovery_tokens.go | ||
| router.go | ||
| router_integration_test.go | ||
| security.go | ||
| security_oidc.go | ||
| security_setup_fix.go | ||
| session_store.go | ||
| settings.go | ||
| system_settings.go | ||
| types.go | ||
| updates.go | ||
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.