Page MenuHomeDevCentral

D1553.id3969.diff
No OneTemporary

D1553.id3969.diff

diff --git a/roles/freebsd-repo/repo/files/Makefile b/roles/freebsd-repo/repo/files/Makefile
--- a/roles/freebsd-repo/repo/files/Makefile
+++ b/roles/freebsd-repo/repo/files/Makefile
@@ -14,7 +14,6 @@
# </auto-generated>
METADATA=digests.txz meta.txz packagesite.txz
-KEY={{ key }}
# -------------------------------------------------------------
# Main targets
@@ -30,4 +29,4 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
build-repo:
- pkg repo . $(KEY)
+ pkg repo . signing_command: sign-freebsd-repo
diff --git a/roles/freebsd-repo/repo/files/Makefile b/roles/freebsd-repo/repo/files/sign-freebsd-repo.sh.jinja
copy from roles/freebsd-repo/repo/files/Makefile
copy to roles/freebsd-repo/repo/files/sign-freebsd-repo.sh.jinja
--- a/roles/freebsd-repo/repo/files/Makefile
+++ b/roles/freebsd-repo/repo/files/sign-freebsd-repo.sh.jinja
@@ -1,9 +1,12 @@
+#!/bin/sh
+
# -------------------------------------------------------------
# FreeBSD repository
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
-# Source file: roles/freebsd-repo/repo/files/Makefile
+# Source: man 8 pkg-repo
+# Source file: roles/freebsd-repo/repo/files/sign-freebsd-repo.sh.jinja
# -------------------------------------------------------------
#
# <auto-generated>
@@ -13,21 +16,13 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-METADATA=digests.txz meta.txz packagesite.txz
-KEY={{ key }}
-
-# -------------------------------------------------------------
-# Main targets
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-all: build-repo
-
-clean:
- rm -f $(METADATA)
-
-# -------------------------------------------------------------
-# Build targets
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+KEY_DIR={{ keydir }}
-build-repo:
- pkg repo . $(KEY)
+read -t 2 sum
+[ -z "$sum" ] && exit 1
+echo SIGNATURE
+echo -n "$sum" | /usr/bin/openssl dgst -sign "$KEY_DIR/repo.key" -sha256 -binary
+echo
+echo CERT
+cat "$KEY_DIR/repo.pub"
+echo END
diff --git a/roles/freebsd-repo/repo/init.sls b/roles/freebsd-repo/repo/init.sls
--- a/roles/freebsd-repo/repo/init.sls
+++ b/roles/freebsd-repo/repo/init.sls
@@ -19,6 +19,15 @@
{{ repo.repo_dir }}/Makefile:
file.managed:
- source: salt://roles/freebsd-repo/repo/files/Makefile
+
+# -------------------------------------------------------------
+# Signature tool
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/usr/local/bin/sign-freebsd-repo:
+ file.managed:
+ - source: salt://roles/freebsd-repo/repo/files/sign-freebsd-repo.sh.jinja
+ - mode: 755
- template: jinja
- context:
- key: {{ repo.signing_key_dir }}/repo.key
+ keydir: {{ repo.signing_key_dir }}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 01:24 (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2261346
Default Alt Text
D1553.id3969.diff (2 KB)

Event Timeline