fix(wizard): emit per-decky service config sections instead of prefix group

[decky.https] relied on ini_loader prefix-matching to propagate config
to decky-03/04/05 — silent and fragile. Now emits [decky-03.https],
[decky-04.https], [decky-05.https] explicitly so the INI is self-evident
and doesn't depend on pattern matching side-effects.
This commit is contained in:
2026-05-10 01:00:43 -04:00
parent 52a52eee78
commit 724380901f

View File

@@ -59,16 +59,15 @@ const buildIni = (
} }
if (mutate) lines.push(`mutate_interval=${mutateEvery}`); if (mutate) lines.push(`mutate_interval=${mutateEvery}`);
lines.push(''); lines.push('');
}
// Per-service overrides emitted as [<prefix>.<svc>] group subsections. // Emit per-service config as [<exact-decky-name>.<svc>] so the section
// The INI loader (decnet/ini_loader.py) prefix-matches these onto every // name unambiguously targets this decky only — no prefix-match magic.
// ``${prefix}-NN`` decky in the batch, so one block covers all clones.
for (const svc of services) { for (const svc of services) {
const cfg = serviceConfigs[svc]; const cfg = serviceConfigs[svc];
if (!cfg || Object.keys(cfg).length === 0) continue; if (!cfg || Object.keys(cfg).length === 0) continue;
const fieldTypes: Record<string, SvcFieldDTO['type']> = {}; const fieldTypes: Record<string, SvcFieldDTO['type']> = {};
for (const f of serviceSchemas[svc] ?? []) fieldTypes[f.key] = f.type; for (const f of serviceSchemas[svc] ?? []) fieldTypes[f.key] = f.type;
lines.push(`[${prefix}.${svc}]`); lines.push(`[${name}.${svc}]`);
for (const [k, v] of Object.entries(cfg)) { for (const [k, v] of Object.entries(cfg)) {
// textarea values may contain newlines that ConfigParser can't carry // textarea values may contain newlines that ConfigParser can't carry
// on a single line; wrap them in `b64:` so validate_cfg decodes back // on a single line; wrap them in `b64:` so validate_cfg decodes back
@@ -83,6 +82,7 @@ const buildIni = (
} }
lines.push(''); lines.push('');
} }
}
return lines.join('\n'); return lines.join('\n');
}; };