release: r014 normalize CA templates
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user