Compare commits

..

2 Commits

Author SHA1 Message Date
Developer bd1b68d1f4 Add cache clearing command to launcher
NEW FEATURE:
- launcher.sh --clear-cache: Clear all stale cache and temp files
- Clears .sysref.beta and .sysref.beta.timestamp
- Clears temporary files in tmp/ directory
- Auto-rebuilds cache on next run

USAGE:
  bash launcher.sh --clear-cache

SOLVES:
- Users can now easily clear stale cache
- WordPress site listings will update
- Database/user listings will refresh
- No more ghost entries from previous runs

ADDED TO HELP:
- Updated --help output with --clear-cache option
- Usage examples included
2026-03-20 01:47:44 -04:00
Developer df95500ab9 Fix: Remove cache files from git tracking and update .gitignore
CRITICAL FIX:
- Remove .sysref.beta and .sysref.beta.timestamp from git
- Remove data/suspicious-login-monitor/baseline.dat from git
- Add beta cache files to .gitignore
- Add runtime directories to .gitignore (config, data, logs, tmp)

PROBLEM FIXED:
- Cache files were being committed to git with stale data
- Users pulling dev would get old cached WordPress site list
- Cache wasn't clearing properly between pulls

SOLUTION:
- Cache files no longer tracked by git
- .gitignore prevents future commits of cache/runtime data
- Cache is auto-rebuilt when expired or on fresh checkout

IMPACT:
- Fresh clones will have empty cache (auto-rebuilds on first run)
- No more stale WordPress/domain/database listings
- Clean git history (runtime files removed)
2026-03-20 01:47:16 -04:00
5 changed files with 56 additions and 46 deletions
+10 -2
View File
@@ -5,9 +5,11 @@
*.swo
*~
# Reference database (session data)
# Reference database (session data) - Production and Dev
.sysref
.sysref.timestamp
.sysref.beta
.sysref.beta.timestamp
# System-specific logs
*.log
@@ -28,9 +30,15 @@
.DS_Store
Thumbs.db
# Runtime directories
# Runtime directories and cache
/modules/security/temp/
/modules/security/live-monitor-*/
/config/
/data/
/logs/
/tmp/
/backups/
/downloads/
# Credentials and keys (NEVER commit these)
*.key
-35
View File
@@ -1,35 +0,0 @@
# System Reference Database
# Generated: Thu Mar 19 08:28:56 PM EDT 2026
# Format: Type|Field1|Field2|...
[SYSTEM]
SYS|CONTROL_PANEL|cpanel|11.134.0.10
SYS|OS|almalinux|9.7
SYS|WEB_SERVER|apache|2.4.66
SYS|DATABASE|mariadb|10.6.25
SYS|LOG_DIR|/var/log/apache2/domlogs|
SYS|USER_HOME|/home|
SYS|CPU_CORES|2|
SYS|HOSTNAME|cloudvpstemplate.host.pickledperil.com|
SYS|PHP_VERSION|8.0.30|
SYS|PHP_VERSION|8.1.34|
SYS|PHP_VERSION|8.2.30|
[USERS]
USER|pickledperil|pickledperil.com|1|1|134|/home/pickledperil
[DATABASES]
DB|pickledperil_wp_wt6lz|pickledperil
unknown|pickledperil.com|0.78|12
[DOMAINS]
DOMAIN|pickledperil.com|pickledperil|/home/pickledperil/public_html|/etc/apache2/logs/domlogs/pickledperil.com|ea-php81|yes|primary|www.pickledperil.com|500|500|500_ERROR
DOMAIN|www.pickledperil.com|pickledperil|/home/pickledperil/public_html|/etc/apache2/logs/domlogs/pickledperil.com|ea-php81|no|alias|pickledperil.com|500|500|alias_of_500_ERROR
DOMAIN|67-227-141-132.cprapid.com|unknown||/var/log/apache2/domlogs/67-227-141-132.cprapid.com||unknown|local||timeout|timeout|TIMEOUT
DOMAIN|cloudvpstemplate.host.pickledperil.com|unknown||/var/log/apache2/domlogs/cloudvpstemplate.host.pickledperil.com||unknown|local||200|200|200_OK
[WORDPRESS]
WP|pickledperil.com|pickledperil|/home/pickledperil/public_html|pickledperil_wp_wt6lz|pickledperil_wp_7vcwf|6.9.1|2|3
[LOGS]
-1
View File
@@ -1 +0,0 @@
1773966543
@@ -1,8 +0,0 @@
# Baseline data for suspicious login monitor
# Last updated: Thu Feb 5 08:37:33 PM EST 2026
BASELINE_SSH_KEY_COUNT=1
BASELINE_USER_COUNT=3
BASELINE_TYPICAL_LOGIN_HOURS="19"
BASELINE_PASSWORD_CHANGES_PER_WEEK=0
BASELINE_NEW_USERS_PER_WEEK=0
BASELINE_LAST_UPDATE=1770341853
+46
View File
@@ -780,13 +780,59 @@ main() {
echo "═══════════════════════════════════════════════════════════════"
return 0
;;
--clear-cache)
# Initialize directories first
init_directories || {
echo "ERROR: Failed to initialize directories"
return 1
}
# Clear all caches
local cache_cleared=0
# Production cache
if [ -f "$BASE_DIR/.sysref" ] || [ -f "$BASE_DIR/.sysref.timestamp" ]; then
rm -f "$BASE_DIR/.sysref" "$BASE_DIR/.sysref.timestamp" 2>/dev/null || true
echo "✓ Cleared production cache (.sysref)"
cache_cleared=1
fi
# Dev cache
if [ -f "$BASE_DIR/.sysref.beta" ] || [ -f "$BASE_DIR/.sysref.beta.timestamp" ]; then
rm -f "$BASE_DIR/.sysref.beta" "$BASE_DIR/.sysref.beta.timestamp" 2>/dev/null || true
echo "✓ Cleared dev cache (.sysref.beta)"
cache_cleared=1
fi
# Temp files
if [ -d "$BASE_DIR/tmp" ]; then
rm -rf "$BASE_DIR/tmp"/* 2>/dev/null || true
echo "✓ Cleared temporary files"
cache_cleared=1
fi
if [ $cache_cleared -eq 0 ]; then
echo "️ No cache files to clear"
else
echo ""
echo "Cache cleared successfully!"
echo "System will auto-detect and rebuild cache on next run."
fi
return 0
;;
--help|--usage|-h|-?)
echo "Usage: launcher.sh [OPTIONS]"
echo ""
echo "Options:"
echo " --detect-only Show system detection results and exit"
echo " --clear-cache Clear all cache and temporary files"
echo " --help Show this help message"
echo ""
echo "Examples:"
echo " bash launcher.sh --detect-only # Check what was detected"
echo " bash launcher.sh --clear-cache # Clear stale cache data"
echo " bash launcher.sh # Normal interactive mode"
echo ""
return 0
;;
esac