From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 6E1E31FF56C for ; Wed, 17 Apr 2024 16:35:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AB62AB0AE; Wed, 17 Apr 2024 16:35:27 +0200 (CEST) From: Lukas Wagner To: pbs-devel@lists.proxmox.com Date: Wed, 17 Apr 2024 16:34:42 +0200 Message-Id: <20240417143514.346233-12-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240417143514.346233-1-l.wagner@proxmox.com> References: <20240417143514.346233-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.004 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup v2 11/43] buildsys: install templates for test notifications X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" The notification stack loads handlebar templates for notifications from /usr/share/proxmox-backup-server/templates/default/. This commit modifies the build system to install template files from the 'templates' directory at that location. First, we only have templates for test notifications. Signed-off-by: Lukas Wagner Tested-by: Gabriel Goller Reviewed-by: Gabriel Goller --- Makefile | 5 +++-- debian/proxmox-backup-server.install | 3 +++ templates/Makefile | 15 +++++++++++++++ templates/default/test-body.html.hbs | 1 + templates/default/test-body.txt.hbs | 1 + templates/default/test-subject.txt.hbs | 1 + 6 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 templates/Makefile create mode 100644 templates/default/test-body.html.hbs create mode 100644 templates/default/test-body.txt.hbs create mode 100644 templates/default/test-subject.txt.hbs diff --git a/Makefile b/Makefile index 0317dd5e..03e93876 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ include defines.mk PACKAGE := proxmox-backup ARCH := $(DEB_BUILD_ARCH) -SUBDIRS := etc www docs +SUBDIRS := etc www docs templates # Binaries usable by users USR_BIN := \ @@ -93,7 +93,7 @@ build: cp -a debian \ Cargo.toml src \ $(SUBCRATES) \ - docs etc examples tests www zsh-completions \ + docs etc examples tests www zsh-completions templates \ defines.mk Makefile \ ./build/ rm -f build/Cargo.lock @@ -211,6 +211,7 @@ install: $(COMPILED_BINS) install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)$(LIBEXECDIR)/proxmox-backup/ ;) $(MAKE) -C www install $(MAKE) -C docs install + $(MAKE) -C templates install .PHONY: upload upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) diff --git a/debian/proxmox-backup-server.install b/debian/proxmox-backup-server.install index ee114ea3..6aff594d 100644 --- a/debian/proxmox-backup-server.install +++ b/debian/proxmox-backup-server.install @@ -41,3 +41,6 @@ usr/share/zsh/vendor-completions/_pmtx usr/share/zsh/vendor-completions/_proxmox-backup-debug usr/share/zsh/vendor-completions/_proxmox-backup-manager usr/share/zsh/vendor-completions/_proxmox-tape +usr/share/proxmox-backup/templates/default/test-body.txt.hbs +usr/share/proxmox-backup/templates/default/test-body.html.hbs +usr/share/proxmox-backup/templates/default/test-subject.txt.hbs diff --git a/templates/Makefile b/templates/Makefile new file mode 100644 index 00000000..b35a8bb3 --- /dev/null +++ b/templates/Makefile @@ -0,0 +1,15 @@ +include ../defines.mk + +NOTIFICATION_TEMPLATES= \ + default/test-body.txt.hbs \ + default/test-body.html.hbs \ + default/test-subject.txt.hbs \ + +all: + +clean: + +install: + install -dm755 $(DESTDIR)$(DATAROOTDIR)/proxmox-backup/templates/default + $(foreach i,$(NOTIFICATION_TEMPLATES), \ + install -m644 $(i) $(DESTDIR)$(DATAROOTDIR)/proxmox-backup/templates/$(i) ;) diff --git a/templates/default/test-body.html.hbs b/templates/default/test-body.html.hbs new file mode 100644 index 00000000..26a43dde --- /dev/null +++ b/templates/default/test-body.html.hbs @@ -0,0 +1 @@ +This is a test of the notification target '{{ target }}'. diff --git a/templates/default/test-body.txt.hbs b/templates/default/test-body.txt.hbs new file mode 100644 index 00000000..26a43dde --- /dev/null +++ b/templates/default/test-body.txt.hbs @@ -0,0 +1 @@ +This is a test of the notification target '{{ target }}'. diff --git a/templates/default/test-subject.txt.hbs b/templates/default/test-subject.txt.hbs new file mode 100644 index 00000000..cb8e1320 --- /dev/null +++ b/templates/default/test-subject.txt.hbs @@ -0,0 +1 @@ +Test notification -- 2.39.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel