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
chore: Mac-compatible dev scripts
rcourtman222c88f33c2a
diff --git a/internal/api/DO_NOT_EDIT_FRONTEND_HERE.md b/internal/api/DO_NOT_EDIT_FRONTEND_HERE.mdindex 25b1bfa293..9083a15c44 100644--- a/internal/api/DO_NOT_EDIT_FRONTEND_HERE.md+++ b/internal/api/DO_NOT_EDIT_FRONTEND_HERE.md@@ -3,7 +3,7 @@This `frontend-modern` directory is **AUTO-GENERATED** during builds.## The REAL frontend location is-### `/opt/pulse/frontend-modern`+### `${PULSE_REPOS_DIR}/pulse/frontend-modern`## Why does this exist?- Go's `embed` directive cannot access files outside the module@@ -15,7 +15,7 @@ This `frontend-modern` directory is **AUTO-GENERATED** during builds.- The Makefile deletes and recreates this directory## How to edit frontend code-1. Edit files in `/opt/pulse/frontend-modern/src/`+1. Edit files in `${PULSE_REPOS_DIR}/pulse/frontend-modern/src/`2. The dev server (port 7655) will hot-reload3. When building for production, the Makefile copies it herediff --git a/internal/api/README.md b/internal/api/README.mdindex 596ec3c109..5bc34b656f 100644--- a/internal/api/README.md+++ b/internal/api/README.md@@ -11,7 +11,7 @@ The `frontend-modern/` subdirectory that appears here is:- **REQUIRED BY GO** - The embed directive needs it here### Frontend Development Location-π **Edit frontend files at: `/opt/pulse/frontend-modern/src/`**+π **Edit frontend files at: `${PULSE_REPOS_DIR}/pulse/frontend-modern/src/`**### Why This Structure?Go's `//go:embed` directive has limitations:diff --git a/scripts/dev-check.sh b/scripts/dev-check.shindex f1d15f0780..13fb3de0de 100755--- a/scripts/dev-check.sh+++ b/scripts/dev-check.sh@@ -27,9 +27,9 @@ echo ""# Check for duplicate Pulse processes (CRITICAL!)# Count both installed binary and dev binary patterns-# Use tr to strip newlines for robustness-PULSE_COUNT_BIN=$(pgrep -c -f "bin/pulse$" 2>/dev/null | tr -d '\n' || echo 0)-PULSE_COUNT_DEV=$(pgrep -c -f "^\./pulse$" 2>/dev/null | tr -d '\n' || echo 0)+# Note: macOS pgrep doesn't support -c, so we use wc -l+PULSE_COUNT_BIN=$(pgrep -f "bin/pulse$" 2>/dev/null | wc -l | tr -d ' ')+PULSE_COUNT_DEV=$(pgrep -f "^\./pulse$" 2>/dev/null | wc -l | tr -d ' ')PULSE_COUNT=$(( ${PULSE_COUNT_BIN:-0} + ${PULSE_COUNT_DEV:-0} ))echo -n "Pulse processes: "if [[ $PULSE_COUNT -eq 0 ]]; then@@ -47,7 +47,7 @@ fiecho -n "Pulse backend (port 7655): "if curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:7655/api/health 2>/dev/null | grep -q "200\|401\|403"; thenecho -e "${GREEN}β Responding${NC}"-elif systemctl is-active --quiet pulse 2>/dev/null; then+elif [[ "$(uname -s)" == "Linux" ]] && systemctl is-active --quiet pulse 2>/dev/null; thenecho -e "${YELLOW}β Service running but not responding${NC}"elseecho -e "${RED}β NOT RESPONDING${NC}"@@ -59,7 +59,7 @@ if curl -s -o /dev/null http://127.0.0.1:5173/ 2>/dev/null; thenecho -e "${GREEN}β Running${NC}"elseecho -e "${RED}β NOT RUNNING${NC}"- echo " Fix: cd /opt/pulse/frontend-modern && npm run dev"+ echo " Fix: cd \${PULSE_REPOS_DIR:-~/Development/pulse/repos}/pulse/frontend-modern && npm run dev"fi# Check AI status@@ -74,7 +74,13 @@ fi# Show recent errorsecho ""echo "=== Recent Pulse Errors (last 5) ==="-journalctl -u pulse-dev --no-pager -n 20 2>/dev/null | grep -i "error\|fatal\|panic" | tail -5 || echo "None found"+if [[ "$(uname -s)" == "Darwin" ]]; then+ # macOS: check the debug log+ grep -i "error\|fatal\|panic" /tmp/pulse-debug.log 2>/dev/null | tail -5 || echo "None found"+else+ # Linux: use journalctl+ journalctl -u pulse-dev --no-pager -n 20 2>/dev/null | grep -i "error\|fatal\|panic" | tail -5 || echo "None found"+fiecho ""echo "Done."diff --git a/scripts/hot-dev.sh b/scripts/hot-dev.shindex aeec676097..a9513396a2 100755--- a/scripts/hot-dev.sh+++ b/scripts/hot-dev.sh@@ -15,7 +15,7 @@# FRONTEND_DEV_PORT=5173 Frontend dev server port (default: 5173)## Pro Features Mode:-# When /opt/pulse-enterprise exists and HOT_DEV_USE_PRO is not "false",+# When pulse-enterprise repo exists and HOT_DEV_USE_PRO is not "false",# the script builds the Pro binary which includes:# - SQLite-based persistent audit logging# - RBAC (Role-Based Access Control)@@ -130,7 +130,14 @@ ALLOWED_ORIGINS="${ALLOWED_ORIGINS},http://localhost:${FRONTEND_DEV_PORT:-7655},ALLOWED_ORIGINS="${ALLOWED_ORIGINS},http://localhost:5173,http://127.0.0.1:5173"# Detect and add all system IPs (V4)-for ip in $(hostname -I); do+if [[ "$(uname -s)" == "Darwin" ]]; then+ # macOS: get IPs from ifconfig+ ALL_IPS=$(ifconfig 2>/dev/null | grep "inet " | awk '{print $2}' | grep -v "^127\.")+else+ # Linux: use hostname -I+ ALL_IPS=$(hostname -I 2>/dev/null || echo "")+fi+for ip in $ALL_IPS; doif [[ "${ip}" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; thenif [[ "${ip}" != "127.0.0.1" ]]; thenALLOWED_ORIGINS="${ALLOWED_ORIGINS},http://${ip}:${FRONTEND_DEV_PORT:-7655}"@@ -261,7 +268,9 @@ mkdir -p internal/api/frontend-modern/disttouch internal/api/frontend-modern/dist/index.html# Check if Pro module is available and use it for full audit logging support-PRO_MODULE_DIR="/opt/pulse-enterprise"+# Use PULSE_REPOS_DIR env var or default to ~/Development/pulse/repos+PULSE_REPOS_DIR="${PULSE_REPOS_DIR:-$HOME/Development/pulse/repos}"+PRO_MODULE_DIR="${PULSE_REPOS_DIR}/pulse-enterprise"if [[ -d "${PRO_MODULE_DIR}" ]] && [[ ${HOT_DEV_USE_PRO:-true} == "true" ]]; thenlog_info "Building Pro binary (includes persistent audit logging)..."cd "${PRO_MODULE_DIR}"@@ -271,10 +280,10 @@ if [[ -d "${PRO_MODULE_DIR}" ]] && [[ ${HOT_DEV_USE_PRO:-true} == "true" ]]; thego build -o pulse ./cmd/pulse}cd "${ROOT_DIR}"- # Set up audit directory for Pro features- export PULSE_AUDIT_DIR="${PULSE_DATA_DIR:-/etc/pulse}"- log_info "Pro audit logging enabled (SQLite storage in ${PULSE_AUDIT_DIR})"+ # Note: PULSE_AUDIT_DIR is set after PULSE_DATA_DIR is determined below+ PRO_BUILD_SUCCESS=trueelse+ PRO_BUILD_SUCCESS=falsego build -o pulse ./cmd/pulsefi@@ -293,6 +302,11 @@ if [[ ${PULSE_MOCK_MODE:-false} == "true" ]]; thenexport PULSE_DATA_DIR="${ROOT_DIR}/tmp/mock-data"mkdir -p "$PULSE_DATA_DIR"log_info "Mock mode: Using isolated data directory: ${PULSE_DATA_DIR}"+ # Set audit dir for Pro features (must be after PULSE_DATA_DIR is set)+ if [[ ${PRO_BUILD_SUCCESS:-false} == "true" ]]; then+ export PULSE_AUDIT_DIR="${PULSE_DATA_DIR}"+ log_info "Pro audit logging enabled (SQLite storage in ${PULSE_AUDIT_DIR})"+ fielseif [[ -n ${PULSE_DATA_DIR:-} ]]; thenlog_info "Using preconfigured data directory: ${PULSE_DATA_DIR}"@@ -316,8 +330,9 @@ elselog_error "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"log_error "!! Backup used: ${BACKUP_KEY}"log_error "!! "- log_error "!! To find out what deleted the key, run:"- log_error "!! sudo journalctl -u encryption-key-watcher -n 100"+ log_error "!! To find out what deleted the key:"+ log_error "!! Linux: sudo journalctl -u encryption-key-watcher -n 100"+ log_error "!! macOS: check /tmp/pulse-debug.log"log_error "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"echo ""cp -f "${BACKUP_KEY}" "${PULSE_DATA_DIR}/.encryption.key"@@ -363,6 +378,12 @@ elselog_warn "No encryption key found for ${PULSE_DATA_DIR}. Encrypted config may fail to load."fifi++ # Set audit dir for Pro features (must be after PULSE_DATA_DIR is set)+ if [[ ${PRO_BUILD_SUCCESS:-false} == "true" ]]; then+ export PULSE_AUDIT_DIR="${PULSE_DATA_DIR}"+ log_info "Pro audit logging enabled (SQLite storage in ${PULSE_AUDIT_DIR})"+ fifiLOG_LEVEL=debug \@@ -451,7 +472,7 @@ log_info "Starting backend file watcher..."if kill -0 "$NEW_PID" 2>/dev/null; thenlog_info "β Backend restarted (PID: $NEW_PID)"else- log_error "β Backend failed to start! Check /opt/pulse/hotdev.log"+ log_error "β Backend failed to start! Check /tmp/pulse-debug.log"fi}@@ -463,7 +484,8 @@ log_info "Starting backend file watcher..."# Use the same build logic as the initial buildlocal build_success=0- PRO_MODULE_DIR="/opt/pulse-enterprise"+ PULSE_REPOS_DIR="${PULSE_REPOS_DIR:-$HOME/Development/pulse/repos}"+ PRO_MODULE_DIR="${PULSE_REPOS_DIR}/pulse-enterprise"if [[ -d "${PRO_MODULE_DIR}" ]] && [[ ${HOT_DEV_USE_PRO:-true} == "true" ]]; thenlog_info "Building Pro binary..."if (cd "${PRO_MODULE_DIR}" && go build -buildvcs=false -o "${ROOT_DIR}/pulse" ./cmd/pulse-enterprise 2>&1 | grep -v "^#"); then