Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3771451
D1553.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D1553.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 00:05 (20 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2261346
Default Alt Text
D1553.diff (2 KB)
Attached To
Mode
D1553: Generate the FreeBSD packages repository signature fingerprints
Attached
Detach File
Event Timeline
Log In to Comment