diff --git a/.gt/signing-key.public.asc b/.gt/signing-key.public.asc index 1af0893..0b07876 100644 --- a/.gt/signing-key.public.asc +++ b/.gt/signing-key.public.asc @@ -59,31 +59,30 @@ AGeerkJ3XN7/ttUFe6sa0vPxbJX+S8CApFzo2smKaL5B+S0UI92G4MvZXaS65i0u Ow5JSrpfZvvz1L6+6CEPKdTyC+S2HeLpUHzTFnQBFwZimO2wTrLeMQfoW5ZT75Vz 8FBqF9w01JC9hmsSA4n4MEsM3yvQTHkAVY4DoTEtlCJUK9kYWh6SorM3DpEQLVjh Xzw1QOiyOfzDQFP0l24440kaGEvP+w8809Rd0dNsSZXtbtMN/b6lgTKZ2xC37Zkh -Qvs6Hs5sx8Se83/Lyh8gO9At3U6amQz0bTzy3Pa3U3UpABEBAAGJBHIEGAEKACYW -IQQU5W1MPaI/rfVKQONrgrsr7O4ERwUCYrMlyAIbAgUJAeEzgAJACRBrgrsr7O4E -R8F0IAQZAQoAHRYhBJQHlYGGZpXeqdTJWJRf5hWQTlyFBQJisyXIAAoJEJRf5hWQ -TlyFTLIP/i44iSXGBT8gRncDddfPWEEWqjVl/W5q3VC1ow5FKEDk3Fe91/yU/iCN -0AMhmIFkAdZckZJAm5uRL04e2j3L3sHqbEcpXNDUzwSPR9zSwYDrk01b9QGhUFjV -vYmhvL6MfFquDaWttcllOAoRBt4SJDgBtY2mtTpZlH9OgJPHP4ROgxqRnCdvVIBS -JXRvCJxRTSVE+8xzjjTZULxDkzGUMBVv9UM/9PfFZOBvlO5py9iuVfX5rY9+/YV1 -n9XG5ZwZbYqi3K80R9NkNhiZLsLU9rXA0/OYEF6DhmepngxmYabdJTwH3dSXOKHS -6aXHrLH+n2xaKFlND6C8Mfe6tykWjCZPHYQntWiM/7S7+vgVYsE16ZKwUmRpu5B2 -zpK+bZLGgIDEm/f/an3l2qvUNf/NmQfJouBTMwUhDViYxOuqYKTkZOefofiY9fr2 -EGCwZ2jt25KR/J8Cec7FvJ9c6pWUAZNkVxfYs2EmXlp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Q8Pn8mIGFpeiT ++zuhdYSwifm0wC3hEMouuKBkcdC4EMrtSEpU9oAWlWrpn8bimBcqGhwUTrtnObX1 +jo6k2T6Dp/HP4/+QiVq/OFJhvbPdFe2uhbJJIg+lJDP+lkVvqDfTTdGcgMgcb2d9 +jSDrNNbqRL8hOVK87yHLKTOi1yCulc6pFYM/ADGt0C+UgtCUj8DS1v+LvZ4zd950 +/Y72WwLYDcuwLyP6NwQDehKhkUvjpVr83HCG8I85FgNyCL5V22ckgpPfZ8qHpE3n +WJXPc7Ut7q+ZB2Wuy3nP72bs2PwAb2T67k+xBVmj6doXvtC/WbM1z3u0rIYxfgLR +fkQXk63joX9vZ7YkWIV+26HHdGwGTnPI6kvy +=tB7/ -----END PGP PUBLIC KEY BLOCK----- - diff --git a/.gt/signing-key.public.asc.sig b/.gt/signing-key.public.asc.sig index 6aad2e7..9e26136 100644 Binary files a/.gt/signing-key.public.asc.sig and b/.gt/signing-key.public.asc.sig differ diff --git a/README.md b/README.md index b78108b..c0905d4 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,16 @@ Please have a look at [CONTRIBUTING.md](https://github.com/tegonal/github-commons/tree/main/.github/CONTRIBUTING.md) for further suggestions and guidelines. +## Extend expiration of signing-key + +Execute the following script, which will extend the sub-key 945FE615904E5C85 by one year and copies it to +src/gt/signing-key.public.asc and also signs it again with the key 4B78012139378220 and finally copies the files +to the .gt folder. + +```bash +./scripts/extend-expiration-signing-key.sh +``` + # License Most provided files are licensed under [Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/scripts/extend-expiration-signing-key.sh b/scripts/extend-expiration-signing-key.sh new file mode 100755 index 0000000..e76dbf6 --- /dev/null +++ b/scripts/extend-expiration-signing-key.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash +# +# / /____ ___ ____ ___ ___ _/ / This file is provided to you by https://github.com/tegonal/github-commons +# / __/ -_) _ `/ _ \/ _ \/ _ `/ / Copyright 2022 Tegonal Genossenschaft +# \__/\__/\_, /\___/_//_/\_,_/_/ It is licensed under Creative Commons Zero v1.0 Universal +# /___/ Please report bugs and contribute back your improvements +# +# Version: v2.9.0-SNAPSHOT +################################### +set -euo pipefail +shopt -s inherit_errexit +unset CDPATH + +if ! [[ -v scriptsDir ]]; then + scriptsDir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" >/dev/null && pwd 2>/dev/null)" + readonly scriptsDir +fi + +if ! [[ -v projectDir ]]; then + projectDir="$(realpath "$scriptsDir/../")" + readonly projectDir +fi + +if ! [[ -v dir_of_github_commons ]]; then + dir_of_github_commons="$projectDir/src" + readonly dir_of_github_commons +fi + +if ! [[ -v dir_of_tegonal_scripts ]]; then + dir_of_tegonal_scripts="$scriptsDir/../lib/tegonal-scripts/src" + source "$dir_of_tegonal_scripts/setup.sh" "$dir_of_tegonal_scripts" +fi + +sourceOnce "$dir_of_tegonal_scripts/utility/gpg-utils.sh" + +function setupTmpDir() { + local -r tmpDir=$1 + mkdir "$tmpDir" + local -r gpgDir="$tmpDir/gpg" + mkdir "$gpgDir" + chmod 700 "$gpgDir" +} + +function importGpgViaClipboard() { + local -r tmpDir=$1 + local -r keyId=$2 + local -r gpgDir="$tmpDir/gpg" + + echo "copy the private key of $keyId into your clipboard and press enter" + read -r + xclip -o -sel clipboard >"$tmpDir/$keyId.asc" + # we make sure the asc ends with an empty line otherwise gpg will fail + echo "" >>"./$keyId.asc" + gpg --homedir "$gpgDir" --import "$tmpDir/$keyId.asc" + + gpg --homedir "$gpgDir" --list-secret-keys +} + +function extendExpirationSigningKey() { + trap "[[ -d /tmp/signing-key ]] && rm -r /tmp/signing-key" EXIT + + local -r signingKey="$dir_of_github_commons/gt/signing-key.public.asc" + local -r actualSig="$dir_of_github_commons/gt/signing-key.public.asc.actual_sig" + local -r tmpDir="/tmp/signing-key" + local -r gpgDir="$tmpDir/gpg" + + setupTmpDir "$tmpDir" + gpg --homedir "$gpgDir" --import "$signingKey" + importGpgViaClipboard "$tmpDir" 6B82BB2BECEE0447 + printf "key 945FE615904E5C85\nexpire\n1y\nsave\n" | + gpg --homedir "$gpgDir" --batch --command-fd 0 --edit-key 6B82BB2BECEE0447 + gpg --homedir "$gpgDir" --export --armor 6B82BB2BECEE0447 >"$signingKey" + rm -r "$tmpDir" + + setupTmpDir "$tmpDir" + importGpgViaClipboard "$tmpDir" 4B78012139378220 + gpg --homedir "$gpgDir" --detach-sign -u 4B78012139378220 --output "$actualSig" "$signingKey" + rm -r "$tmpDir" + + "$scriptsDir/before-pr.sh" + + logSuccess "expiration date for %s updated and signed (%s) and copied to the .gt directory" "$signingKey" "$actualSig" + +} + +${__SOURCED__:+return} +extendExpirationSigningKey "$@" diff --git a/src/gt/signing-key.public.asc b/src/gt/signing-key.public.asc index 1af0893..0b07876 100644 --- a/src/gt/signing-key.public.asc +++ b/src/gt/signing-key.public.asc @@ -59,31 +59,30 @@ AGeerkJ3XN7/ttUFe6sa0vPxbJX+S8CApFzo2smKaL5B+S0UI92G4MvZXaS65i0u Ow5JSrpfZvvz1L6+6CEPKdTyC+S2HeLpUHzTFnQBFwZimO2wTrLeMQfoW5ZT75Vz 8FBqF9w01JC9hmsSA4n4MEsM3yvQTHkAVY4DoTEtlCJUK9kYWh6SorM3DpEQLVjh Xzw1QOiyOfzDQFP0l24440kaGEvP+w8809Rd0dNsSZXtbtMN/b6lgTKZ2xC37Zkh -Qvs6Hs5sx8Se83/Lyh8gO9At3U6amQz0bTzy3Pa3U3UpABEBAAGJBHIEGAEKACYW -IQQU5W1MPaI/rfVKQONrgrsr7O4ERwUCYrMlyAIbAgUJAeEzgAJACRBrgrsr7O4E -R8F0IAQZAQoAHRYhBJQHlYGGZpXeqdTJWJRf5hWQTlyFBQJisyXIAAoJEJRf5hWQ -TlyFTLIP/i44iSXGBT8gRncDddfPWEEWqjVl/W5q3VC1ow5FKEDk3Fe91/yU/iCN -0AMhmIFkAdZckZJAm5uRL04e2j3L3sHqbEcpXNDUzwSPR9zSwYDrk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UU9WgPuvo +PsxeetreiHCMtbR3judbPu8acJR+M2t69BDV4IAJEGuCuyvs7gRH8NkP/2WxlneI +SqsmFFBYrSRsQSNSBucqV/1IY0vLeGD+bevnB7yKdWx0QtNdyuf5yhBGU66l82i5 +1enJiqsFrVFy4vvTjH3osuEYcSMVD+A7zGom7qnZCjQFDqKMnZjYdsLwunlB2fXY +DP4AF3jNxtB7yboq0apE5JvBgTB0UPnZTOzXFsSL3oO5KSPQJ1PsLaxFOawG0SEi +9aqkM6iBCH2GS5D/7jyIYHRVRDD3j6uG2kDALSgaKexn/3Hx7qDVti8pTqeAAPdR +pPZeFFpjo+Ee1F1V+we5nQtC+kHo0BgJPDErE5h9aZvgTG8Wmq+Q8Pn8mIGFpeiT ++zuhdYSwifm0wC3hEMouuKBkcdC4EMrtSEpU9oAWlWrpn8bimBcqGhwUTrtnObX1 +jo6k2T6Dp/HP4/+QiVq/OFJhvbPdFe2uhbJJIg+lJDP+lkVvqDfTTdGcgMgcb2d9 +jSDrNNbqRL8hOVK87yHLKTOi1yCulc6pFYM/ADGt0C+UgtCUj8DS1v+LvZ4zd950 +/Y72WwLYDcuwLyP6NwQDehKhkUvjpVr83HCG8I85FgNyCL5V22ckgpPfZ8qHpE3n +WJXPc7Ut7q+ZB2Wuy3nP72bs2PwAb2T67k+xBVmj6doXvtC/WbM1z3u0rIYxfgLR +fkQXk63joX9vZ7YkWIV+26HHdGwGTnPI6kvy +=tB7/ -----END PGP PUBLIC KEY BLOCK----- - diff --git a/src/gt/signing-key.public.asc.actual_sig b/src/gt/signing-key.public.asc.actual_sig index 6aad2e7..9e26136 100644 Binary files a/src/gt/signing-key.public.asc.actual_sig and b/src/gt/signing-key.public.asc.actual_sig differ