Give the rest of the conf a place to be changed

A third of the settings had no control anywhere, so the answer to "where do I
change this" was to open a file over SSH.
This commit is contained in:
Gmer4Lfe
2026-08-12 19:41:01 -04:00
parent ec3084db12
commit 8ca52c64b9
5 changed files with 889 additions and 128 deletions
+33 -8
View File
@@ -68,10 +68,16 @@ foreach (VV_SCRIPT_CONF_SECTIONS as $script => $subs) {
// ── Route 2: pages that show sections by subject ─────────────────────────────────────────────
foreach (VV_UI_SECTION_SURFACES as $surface) {
$re = '/\b' . preg_quote((string) $surface['match'], '/') . '\b/i';
// "*" is the catch-all, matched the same way api/confform.php matches it. preg_quote would
// turn it into \* and quietly match nothing, which is how the map went on reporting a third
// of the conf as unreachable after the page that reaches it had shipped.
$all = ((string) $surface['match'] === '*');
$re = $all ? '' : '/\b' . preg_quote((string) $surface['match'], '/') . '\b/i';
foreach ($sections as $k => $g) {
if (!preg_match($re, (string) $g['subsection'])) continue;
$routes[$k][] = $surface['route'] . " → *{$g['subsection']}*";
$name = (string) $g['subsection'];
if (isset(VV_UI_SECTION_EXCLUDE[$name])) continue;
if (!$all && !preg_match($re, $name)) continue;
$routes[$k][] = $surface['route'] . " → *{$name}*";
}
}
@@ -194,12 +200,31 @@ foreach ($sections as $k => $g) {
}
}
if ($unreachable) {
// Two different kinds of "no route", and conflating them was unhelpful. One is a gap; the other
// is a decision, and the decision has a reason worth repeating to whoever asks.
$excluded = array_filter($unreachable, fn($g) => isset(VV_UI_SECTION_EXCLUDE[$g['subsection']]));
$gaps = array_filter($unreachable, fn($g) => !isset(VV_UI_SECTION_EXCLUDE[$g['subsection']]));
if ($excluded) {
$md .= "\n---\n\n## Settings deliberately kept out of the UI\n\n";
$md .= "These have no control on purpose. They hold the machine's identity and the roots\n"
. "everything else is derived from, and a text box beside a Save button is the wrong\n"
. "shape for a value that decides whether the server recognises itself on next boot.\n\n"
. "If one is asked about, give the reason and say it is edited in the conf file directly.\n"
. "Do not describe a route — there is none, and that is the point.\n\n";
foreach ($excluded as $g) {
$keys = implode(', ', array_map(fn($f) => '`' . $f['key'] . '`', $g['fields']));
$md .= '- **' . $g['subsection'] . '** (`' . $g['file'] . "`) — $keys \n"
. ' ' . VV_UI_SECTION_EXCLUDE[$g['subsection']] . "\n";
}
}
if ($gaps) {
$md .= "\n---\n\n## Settings with no route through the UI\n\n";
$md .= "These sections are not rendered by any page, so they can only be changed by editing\n"
. "the conf file. If one of these is asked about, say so plainly rather than inventing a\n"
. "route — mapping it into the Scheduler is a code change, not a setting.\n\n";
foreach ($unreachable as $g) {
$md .= "Not a decision, just not built yet: no page renders these, so they can only be changed\n"
. "by editing the conf file. If one of these is asked about, say so plainly rather than\n"
. "inventing a route.\n\n";
foreach ($gaps as $g) {
$keys = implode(', ', array_map(fn($f) => '`' . $f['key'] . '`', $g['fields']));
$md .= '- **' . $g['subsection'] . '** (`' . $g['file'] . "`) — $keys\n";
}