Add full banner headers to all scripts across the codebase

Every script now has the established header format: PURPOSE with ─────── separator,
OPERATIONAL MODEL, DESIGN PRINCIPLES, OPERATIONAL SAFEGUARDS, CONFIGURATION, and
RUNTIME MODES — structured with full ====== banner sections throughout.

Orchestrators converted from compact ── inline format to full banners. Stale
emby-fallback and dirty sync references removed from Plugin/user_script_plug-in.sh.
This commit is contained in:
Gmer4Lfe
2026-06-26 18:50:05 -04:00
parent 1003bee72a
commit f92ee4064b
51 changed files with 1822 additions and 563 deletions
+34 -37
View File
@@ -2,51 +2,48 @@
# ==============================================================================================
# ================================= CONFIGURATION LOADER =======================================
# ==============================================================================================
#
# PURPOSE
# ─────────────────────────────────────────────────────────────────────────────
# Single entry point for all configuration sourcing across the ecosystem.
# Every script sources this file instead of sourcing master.conf files directly.
# Every script sources this file instead of sourcing conf files directly.
#
# ── HOW IT WORKS ──────────────────────────────────────────────────────────────────────────────
# 1. Detects OS platform → PLATFORM=unraid|truenas|unknown; exports SCRIPTS_DIR
# 2. Sources master.conf (shared config — hostnames, thresholds, toggles, profiles, job lists)
# 3. Auto-discovers and sources all host*.conf files in the same directory
# Each host conf extends the shared profile arrays and adds host-specific credentials
# 4. Sources common.sh (shared functions — detect_hosts, logging, notifications etc.)
# 5. Sources Plugin/<platform>/adapter.sh (platform_*() functions for OS-specific ops)
# ==============================================================================================
# OPERATIONAL MODEL
# ==============================================================================================
#
# ── WHY THIS EXISTS ───────────────────────────────────────────────────────────────────────────
# Without this loader every script had to explicitly source each conf file:
# source master.conf
# source host1.conf
# source host2.conf
# source common.sh
# Sourcing order (order is load-bearing):
# 1. Detects OS platform → PLATFORM=unraid|truenas|unknown; exports SCRIPTS_DIR
# 2. Sources master.conf — shared config: hostnames, thresholds, toggles, profiles, job lists
# 3. Auto-discovers and sources all host*.conf files present in Configurations/
# Each host conf extends the shared profile arrays and adds host-specific credentials
# 4. Sources common.sh — shared functions: detect_hosts, logging, notifications, etc.
# 5. Sources Plugin/<platform>/adapter.sh — platform_*() functions for OS-specific ops
#
# Adding a new server meant updating every script.
# With this loader — add host3.conf to the git repo and every server
# auto-discovers it on next git pull. Zero script changes required. Ever.
# USAGE IN SCRIPTS
# Scripts in subdirectories (Rsync/, Docker_Essentials/ etc.):
# SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# source "$SCRIPT_DIR/../load_config.sh"
#
# ── ADDING A NEW SERVER ───────────────────────────────────────────────────────────────────────
# 1. Create Configurations/host3.conf following the same structure as HOST1/HOST2
# 2. Commit and push to git repo
# 3. All servers pull it automatically — no other changes needed
# Scripts in the repo root:
# SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# source "$SCRIPT_DIR/load_config.sh"
#
# ── USAGE IN SCRIPTS ──────────────────────────────────────────────────────────────────────────
# Replace the three source lines at the top of every script with:
# SPARSE CHECKOUT NOTE
# Sparse checkout controls which host*.conf files each server receives.
# HOST1 only pulls Configurations/host1.conf — never HOST2's credentials.
# HOST2 only pulls Configurations/host2.conf — never HOST1's credentials.
# This loader sources whatever conf files ARE present — sparse checkout handles the rest.
#
# SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# source "$SCRIPT_DIR/../load_config.sh"
# ==============================================================================================
# DESIGN PRINCIPLES
# ==============================================================================================
#
# Scripts in subdirectories (Rsync/, Docker_Essentials/ etc.) use ../ to reach root.
# Scripts in root directory use ./ instead:
#
# SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# source "$SCRIPT_DIR/load_config.sh"
#
# ── SPARSE CHECKOUT NOTE ──────────────────────────────────────────────────────────────────────
# Sparse checkout controls which host*.conf files each server receives.
# HOST1 only pulls Configurations/host1.conf — never HOST2's credentials.
# HOST2 only pulls Configurations/host2.conf — never HOST1's credentials.
# This loader sources whatever conf files ARE present — sparse checkout handles the rest.
# Both servers pull all non-credential conf files (Configurations/master.conf, common.sh, load_config.sh).
# Zero-Script Expansion
# Without this loader, adding a new server required updating every script to
# source the new host conf. With this loader: create host3.conf in the repo,
# commit and push — all servers auto-discover it on next git pull. No script
# changes required.
#
# ==============================================================================================