CRITICAL FIX: launcher.sh never loaded domain-discovery.sh

Root Cause #2:
After fixing the $LIB_DIR bug in system-detect.sh, discovered launcher.sh
was missing domain-discovery.sh from its source list.

The Bug:
launcher.sh lines 20-23 sourced:
  - common-functions.sh
  - system-detect.sh
  - user-manager.sh
  - reference-db.sh

But NOT domain-discovery.sh!

Since launcher.sh sets TOOLKIT_BASE_DIR, reference-db.sh's conditional
sourcing (lines 10-16) was skipped:
  if [ -z "$TOOLKIT_BASE_DIR" ]; then
      source "$SCRIPT_DIR/domain-discovery.sh"  # NEVER RAN
  fi

Impact:
ALL unified discovery functions were unavailable:
- list_all_domains()
- get_domain_owner()
- get_domain_docroot()
- get_domain_logdir()
- get_domain_access_log()
- And 8 more...

Result: reference-db.sh build_domains_section() called list_all_domains()
which didn't exist → 0 domains on BOTH cPanel AND Plesk!

The Fix:
Added domain-discovery.sh to launcher.sh line 22:
  source "$LIB_DIR/domain-discovery.sh"

Now sourced BEFORE reference-db.sh so all unified functions available.

Verified on cPanel:
  ✓ list_all_domains available
  ✓ get_domain_owner available
  ✓ get_domain_docroot available
  ✓ list_all_domains() returns pickledperil.com

Status: CRITICAL BUG #2 FIXED - Ready for Plesk testing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cschantz
2025-12-23 20:58:30 -05:00
parent b3a0794ff4
commit 097bad22d8
+1
View File
@@ -19,6 +19,7 @@ CONFIG_DIR="$BASE_DIR/config"
# Load core libraries
source "$LIB_DIR/common-functions.sh"
source "$LIB_DIR/system-detect.sh"
source "$LIB_DIR/domain-discovery.sh"
source "$LIB_DIR/user-manager.sh"
source "$LIB_DIR/reference-db.sh"