release: r014 normalize CA templates

This commit is contained in:
Mikei386
2026-08-21 10:27:33 +02:00
parent f988fd03af
commit 37de236f5a
7 changed files with 21 additions and 10 deletions
+9
View File
@@ -312,6 +312,15 @@ function ca_install(string $template_url, string $name, string $overrides_json,
if (!$found) fail("Override target not present in template: $target");
}
// Some CA templates omit Mode on variables. Unraid's Docker manager reads
// the attribute unconditionally, so normalize it before saving the user's
// template to avoid PHP warnings while preserving an empty mode.
foreach ($dom->getElementsByTagName('Config') as $config) {
if (!$config->hasAttribute('Mode')) {
$config->setAttribute('Mode', '');
}
}
$dom->formatOutput = true;
if ($dom->save($template_path) === false) fail('Unable to write Unraid user template');
chmod($template_path, 0600);