Skip to content

armgit / Pulse

Public Imported from GitHub
0

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.

chore: Improve pre-commit data validation and ignore patterns

rcourtman6de1c660b194
diff --git a/.gitignore b/.gitignore
index 4a64be1bf4..785396a627 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,12 +13,12 @@
# Logs
*.log
-# Database files
+# Data/Export files
+active_subs.json
+charges.json
*.db
*.sqlite
*.sqlite3
-active_subs.json
-charges.json
# OS files
.DS_Store
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 6fa1ee134d..5d9a0bf0d0 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,6 +1,36 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
+# Pre-commit hook to prevent committing restricted or sensitive data
+RESTRICTED_FILES="active_subs.json charges.json customers.json subscriptions.json"
+
+echo "🔒 Running sensitivity check..."
+
+for file in $RESTRICTED_FILES; do
+ if git diff --cached --name-only | grep -q "^${file}$"; then
+ echo "❌ BLOCKED: restricted file pattern matched: ${file}"
+ exit 1
+ fi
+done
+
+# Check for potential credentials or internal identifiers
+if git diff --cached | grep -E "^\+" | grep -v ".husky/pre-commit" | grep -qE "(cus_|sub_|ch_|pi_|pm_|sk_live_|sk_test_)"; then
+ echo "⚠️ WARNING: Potential API keys or identifiers found in staged changes."
+ echo " Use 'git diff --cached' to review before proceeding."
+ if [ -t 0 ]; then
+ printf " Proceed anyway? (y/N): "
+ read REPLY < /dev/tty
+ echo
+ if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]; then
+ exit 1
+ fi
+ else
+ echo " (Skipping confirmation in non-interactive shell)"
+ fi
+fi
+echo "✅ Check passed."
+
+
# Run Go formatting
echo "Running Go formatter..."
gofmt -w -s .