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>
37 lines
1.1 KiB
Bash
Executable File
37 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
cliHandleConfigCommands()
|
|
{
|
|
local action="$initial_command2"
|
|
|
|
case "$action" in
|
|
"update")
|
|
local encoded_pairs="$initial_command3"
|
|
if [[ -z "$encoded_pairs" ]]; then
|
|
isError "config update requires the encoded pair string."
|
|
cliShowConfigHelp
|
|
fi
|
|
configUpdateBatch "$encoded_pairs"
|
|
;;
|
|
|
|
"check")
|
|
# Converge live configs on the install templates: copy any missing
|
|
# files / categories (and surface them to the WebUI Config editor
|
|
# via .category), then reconcile the options inside each file —
|
|
# add new keys, drop removed ones, refresh comments, keep the
|
|
# user's values. Read-and-converge; safe to run any time.
|
|
checkConfigFilesMissingFiles
|
|
checkConfigFilesMissingVariables true
|
|
;;
|
|
|
|
"")
|
|
cliShowConfigHelp
|
|
;;
|
|
|
|
*)
|
|
isNotice "Invalid config command: $action"
|
|
cliShowConfigHelp
|
|
;;
|
|
esac
|
|
}
|