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 <a.zeid...@proxmox.com>
> ---
> This patch was previously sent as RFC and has now all suggestions from
> Lukas Wagner implemented:
> https://lore.proxmox.com/pve-devel/20250313151734.258337-1-a.zeid...@proxmox.com/
> 
> 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/20250321122521.198725-1-l.wag...@proxmox.com/
> 
> 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 <l.wag...@proxmox.com>
Tested-by: Lukas Wagner <l.wag...@proxmox.com>

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/20250328101915.73951-1-l.wag...@proxmox.com/T/#t
[2]: 
https://lore.proxmox.com/pbs-devel/20250328102242.75539-1-l.wag...@proxmox.com/T/#t

-- 
- Lukas



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to