From b5af5b54c8495140352740481e2325e727930e97 Mon Sep 17 00:00:00 2001 From: Filip Rojek Date: Thu, 27 Apr 2023 15:20:02 +0200 Subject: [PATCH] updated: signing --- debrepo | 7 ++++++- scripts/gpgSign.sh | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) mode change 100644 => 100755 scripts/gpgSign.sh diff --git a/debrepo b/debrepo index 35d6bd0..61ae423 100755 --- a/debrepo +++ b/debrepo @@ -28,7 +28,12 @@ if [ "$1" = "list" ] || [ "$1" = "-l" ] || [ "$1" = "--list" ]; then exit fi -if [ "$1" = "serve" ] || [ "$1" = "-s" ] ||[ "$1" = "--serve" ]; then +if [ "$1" = "sign" ] || [ "$1" = "-s" ] || [ "$1" = "--sign" ]; then + $DIR/scripts/gpgSign.sh $2 + exit +fi + +if [ "$1" = "serve" ] || [ "$1" = "-S" ] ||[ "$1" = "--serve" ]; then python3 -m http.server exit fi diff --git a/scripts/gpgSign.sh b/scripts/gpgSign.sh old mode 100644 new mode 100755 index 409aadd..fa08211 --- a/scripts/gpgSign.sh +++ b/scripts/gpgSign.sh @@ -1,5 +1,8 @@ #!/bin/sh -# This is INSECURE! -cat ~/tmprepo/apt-repo/dists/stable/Release | gpg --default-key example -abs > ~/tmprepo/apt-repo/dists/stable/Release.gpg -cat ~/tmprepo/apt-repo/dists/stable/Release | gpg --default-key example -abs --clearsign > ~/tmprepo/apt-repo/dists/stable/InRelease +KEY="$1" + +echo "debrepo: signing using $KEY" + +cat ./apt-repo/dists/stable/Release | gpg --default-key $KEY -abs > ./apt-repo/dists/stable/Release.gpg +cat ./apt-repo/dists/stable/Release | gpg --default-key $KEY -abs --clearsign > ./apt-repo/dists/stable/InRelease