On 2025-03-21 14:33, Alexander Zeidler wrote:
> Previously, notification templates could be modified by the user, but
> these were overwritten again with installing newer package versions of
> pve-manager and proxmox-backup.
>
> Now override templates can be created cluster-wide in the path
> “/etc/{pve,proxmox-backup}/notification-templates/{namespace}”, which
> are used with priority. The folder structure has to be created and
> populated manually (e.g. /etc/pve/notification-templates/default).
>
> If override templates are not existing or their rendering fails, the
> vendor templates in
> "/usr/share/{pve-manager,proxmox-backup}/templates/default/" are used.
>
> Sequence: [override html -> vendor html ->] override txt -> vendor txt
>
> An error is only returned if none of the template candidates could be
> used. Using an override template gets not logged.
>
> Signed-off-by: Alexander Zeidler <[email protected]>
> ---
> This patch was previously sent as RFC and has now all suggestions from
> Lukas Wagner implemented:
> https://lore.proxmox.com/pve-devel/[email protected]/
>
> This patch should not be merged until the existing PVE and PBS
> templates have been audited. For PVE this is currently being done, for
> PBS a patch is already sent:
> https://lore.proxmox.com/pbs-devel/[email protected]/
>
> The documentation changes for PVE and PBS (steps for override template
> creation, list of variables and helpers) will be sent in separate
> patches after the above mentioned audit is completed.
>
>
This looks good to me now. Tested it in both PVE and PBS, works as expected.
Reviewed-by: Lukas Wagner <[email protected]>
Tested-by: Lukas Wagner <[email protected]>
As Alex already mentioned, this should not be rolled about before
my two template cleanup series [1,2] are merged. Code-wise there are no
dependencies,
but with this patch, our template helpers/variables essentially become a public
API
and thus the cleanup should be rolled out before or at the same time.
For the person merging this, please also bump proxmox-mail-forward, that
one is easy to overlook when changes to proxmox-notify are pushed out.
[1]:
https://lore.proxmox.com/pve-devel/[email protected]/T/#t
[2]:
https://lore.proxmox.com/pbs-devel/[email protected]/T/#t
--
- Lukas
_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel