LibrePortal/scripts/cli/commands/config/cli_config_header.sh
librelad 7c28007779 refactor(config): updater knobs -> configs/webui/webui_updater; fix config heal/reconcile gaps
Move the WebUI-updater settings out of general_terminal into their own
advanced webui-category file (webui_logs precedent): new
configs/webui/webui_updater holds CFG_UPDATER_SCAN_INTERVAL and the
migrated CFG_HOTFIX_AUTO, listed in webui/.category.

The move only reaches existing installs if the config convergence
machinery works, and three pieces of it silently didn't:

- checkConfigFilesMissingFiles walked a stale hardcoded category list
  ('general features network' — features doesn't exist; webui/backup/
  security never healed). Derive the categories from the template tree
  instead, and heal .category metadata too: copy it when absent and
  merge missing SUBCATEGORY_ORDER entries when present, so healed files
  actually appear in the WebUI Config editor. core_categories removed.
- Option reconciliation never touched ANY nested config file: configs_dir
  carries a trailing slash, so rel stripping missed ('configs//'), the
  template lookup failed, and reconcileConfigFile early-returned for
  every file. Strip the slash before matching.
- reconcileConfigFile's AUTO_DELETE=false branch read a never-populated
  live_line array, losing the dropped keys it promised to keep. Populate
  it alongside live_value.

Also exclude *.bak from config sourcing (reconciliation writes <file>.bak
next to live configs — now that it runs, sourcing backups would resurrect
deleted keys), and add 'libreportal config check' as a non-interactive
front door to the converge pass (was only reachable via install flows and
the interactive menu).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-06-12 22:33:23 +01:00

18 lines
927 B
Bash
Executable File

#!/bin/bash
cliShowConfigHelp()
{
echo ""
echo "Available Config Commands:"
echo ""
echo " libreportal config check - Converge live configs on the install templates:"
echo " copy missing files, then reconcile options in each"
echo " (add new keys, drop removed ones, keep your values)"
echo " libreportal config update '<encoded>' - Apply a batch of CFG_KEY=VALUE pairs"
echo " <encoded> is pipe-separated; literal '|' in"
echo " values must be URL-encoded as %7C."
echo " Example:"
echo " libreportal config update 'CFG_INSTALL_NAME=server|CFG_TRAEFIK_EMAIL=me%40d.com'"
echo ""
}