Compare commits

...

5 Commits

Author SHA1 Message Date
Developer 3ac1f796cc FIX: Revert for-loop in auto-clear to explicit if statements
- for loop was causing slowdown in startup_detection()
- Split into two explicit cache file checks instead
- Maintains support for both .sysref and .sysref.beta
- Restores instant startup speed
2026-03-20 02:05:10 -04:00
Developer b6ae4b9c65 CRITICAL FIX: Remove confusing 'total entries' message from cache output
- 'total entries' was just the line count of the cache file (including headers/comments)
- Was misleading users who thought it meant 27 of something important
- Now only shows meaningful metrics: users, databases, domains, WordPress sites
- Fixes confusion on fresh server installs
2026-03-20 02:03:51 -04:00
Developer f9ae2477ed Docs: Add non-git deployment workflow for wget/extract users
- Document workflow for servers without git installed
- Explain that cache files are never in download archives
- Provide --clear-cache command for in-place updates
- Makes cache management clear for non-git deployments
2026-03-20 02:02:28 -04:00
Developer e2052b4b45 Docs: Clarify cache clearing workflow and what 'total entries' means
- Add 'Fresh Deployment' section with git clean -fd command
- Update 'After Git Pull' section to include git clean for safety
- Clarify that 'total entries' in cache is line count, not WordPress count
- Helps users avoid confusion with stale cache on fresh deployments
2026-03-20 02:01:52 -04:00
Developer 00cdb0a663 CRITICAL FIX: Auto-clear both production and dev cache files on git pull
- Previous version only cleared .sysref.beta (dev cache)
- Production installations use .sysref (without beta suffix)
- Now clears both .sysref and .sysref.beta automatically
- Fixes issue where old cache data persisted across server migrations
- Users on production installs will now get fresh cache on every git pull
2026-03-20 01:59:58 -04:00
3 changed files with 48 additions and 6 deletions
+41 -3
View File
@@ -129,6 +129,11 @@ cat .sysref.beta | head -20
# Count records by type
awk -F'|' '{print $1}' .sysref.beta | sort | uniq -c
# Count total lines (includes headers and all records)
wc -l .sysref.beta
# Note: This total includes system records, user records, headers, and blank lines
# NOT the count of WordPress sites
```
---
@@ -192,16 +197,49 @@ Now when you pull:
## Recommended Workflow
### Non-Git Deployment (wget/extract without git)
```bash
# 1. Download and extract fresh code
wget https://your-repo-url/archive.tar.gz
tar -xzf archive.tar.gz
# 2. If updating in same directory, clear old cache
bash launcher.sh --clear-cache
# 3. Run fresh detection
bash launcher.sh --detect-only
# 4. Run normally
bash launcher.sh
```
**Note**: Cache files are NOT included in download archives (excluded via .gitignore), so fresh extracts always start clean.
### Fresh Deployment (First Clone or Migration)
```bash
# 1. Clone or navigate to toolkit directory
cd /root/server-toolkit-beta
# 2. Remove any old untracked files (including stale cache)
git clean -fd
# 3. Verify no cache files exist
ls -la .sysref* 2>&1
# 4. Run fresh - cache will be built automatically
bash launcher.sh --detect-only
```
### After Git Pull
```bash
# 1. Update code from git
cd /root/server-toolkit-beta
git pull origin dev
# 2. Clear old cache
bash launcher.sh --clear-cache
# 2. Remove any untracked files from previous versions
git clean -fd
# 3. Verify detection works
# 3. Verify detection works (cache auto-clears if launcher.sh changed)
bash launcher.sh --detect-only
# 4. Run normally
+7 -2
View File
@@ -692,13 +692,18 @@ startup_detection() {
# Auto-clear cache if toolkit files are newer (fresh git pull)
# This ensures users always get fresh data after git updates
if [ -f "$BASE_DIR/.sysref.beta" ] && [ -f "$BASE_DIR/launcher.sh" ]; then
# If launcher.sh is newer than cache, it means git just pulled updates
# and we should rebuild cache with current code
if [ "$BASE_DIR/launcher.sh" -nt "$BASE_DIR/.sysref.beta" ]; then
rm -f "$BASE_DIR/.sysref.beta" "$BASE_DIR/.sysref.beta.timestamp" 2>/dev/null || true
fi
fi
# Also check production cache name for backward compatibility
if [ -f "$BASE_DIR/.sysref" ] && [ -f "$BASE_DIR/launcher.sh" ]; then
if [ "$BASE_DIR/launcher.sh" -nt "$BASE_DIR/.sysref" ]; then
rm -f "$BASE_DIR/.sysref" "$BASE_DIR/.sysref.timestamp" 2>/dev/null || true
fi
fi
# Initialize system detection first (required for show_system_overview)
if [ -z "${SYS_DETECTION_COMPLETE:-}" ]; then
initialize_system_detection
-1
View File
@@ -131,7 +131,6 @@ build_reference_database() {
echo " - $db_count databases"
echo " - $domain_count domains"
echo " - $wp_count WordPress sites"
echo " - $total_lines total entries"
}
build_system_section() {